Skip to main content

google_cloud_networksecurity_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17/// Request and client builders for [AddressGroupService][crate::client::AddressGroupService].
18pub mod address_group_service {
19    use crate::Result;
20
21    /// A builder for [AddressGroupService][crate::client::AddressGroupService].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_networksecurity_v1::*;
26    /// # use builder::address_group_service::ClientBuilder;
27    /// # use client::AddressGroupService;
28    /// let builder : ClientBuilder = AddressGroupService::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://networksecurity.googleapis.com")
31    ///     .build().await?;
32    /// # Ok(()) }
33    /// ```
34    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::AddressGroupService;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = AddressGroupService;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> crate::ClientBuilderResult<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::AddressGroupService] 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::AddressGroupService>,
55        request: R,
56        options: crate::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [AddressGroupService::list_address_groups][crate::client::AddressGroupService::list_address_groups] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListAddressGroups;
79    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
80    /// use google_cloud_gax::paginator::ItemPaginator;
81    ///
82    /// let builder = prepare_request_builder();
83    /// let mut items = builder.by_item();
84    /// while let Some(result) = items.next().await {
85    ///   let item = result?;
86    /// }
87    /// # Ok(()) }
88    ///
89    /// fn prepare_request_builder() -> ListAddressGroups {
90    ///   # panic!();
91    ///   // ... details omitted ...
92    /// }
93    /// ```
94    #[derive(Clone, Debug)]
95    pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
96
97    impl ListAddressGroups {
98        pub(crate) fn new(
99            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
100        ) -> Self {
101            Self(RequestBuilder::new(stub))
102        }
103
104        /// Sets the full request, replacing any prior values.
105        pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
106            mut self,
107            v: V,
108        ) -> Self {
109            self.0.request = v.into();
110            self
111        }
112
113        /// Sets all the options, replacing any prior values.
114        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
115            self.0.options = v.into();
116            self
117        }
118
119        /// Sends the request.
120        pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
121            (*self.0.stub)
122                .list_address_groups(self.0.request, self.0.options)
123                .await
124                .map(crate::Response::into_body)
125        }
126
127        /// Streams each page in the collection.
128        pub fn by_page(
129            self,
130        ) -> impl google_cloud_gax::paginator::Paginator<
131            crate::model::ListAddressGroupsResponse,
132            crate::Error,
133        > {
134            use std::clone::Clone;
135            let token = self.0.request.page_token.clone();
136            let execute = move |token: String| {
137                let mut builder = self.clone();
138                builder.0.request = builder.0.request.set_page_token(token);
139                builder.send()
140            };
141            google_cloud_gax::paginator::internal::new_paginator(token, execute)
142        }
143
144        /// Streams each item in the collection.
145        pub fn by_item(
146            self,
147        ) -> impl google_cloud_gax::paginator::ItemPaginator<
148            crate::model::ListAddressGroupsResponse,
149            crate::Error,
150        > {
151            use google_cloud_gax::paginator::Paginator;
152            self.by_page().items()
153        }
154
155        /// Sets the value of [parent][crate::model::ListAddressGroupsRequest::parent].
156        ///
157        /// This is a **required** field for requests.
158        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
159            self.0.request.parent = v.into();
160            self
161        }
162
163        /// Sets the value of [page_size][crate::model::ListAddressGroupsRequest::page_size].
164        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
165            self.0.request.page_size = v.into();
166            self
167        }
168
169        /// Sets the value of [page_token][crate::model::ListAddressGroupsRequest::page_token].
170        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
171            self.0.request.page_token = v.into();
172            self
173        }
174
175        /// Sets the value of [return_partial_success][crate::model::ListAddressGroupsRequest::return_partial_success].
176        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
177            self.0.request.return_partial_success = v.into();
178            self
179        }
180    }
181
182    #[doc(hidden)]
183    impl crate::RequestBuilder for ListAddressGroups {
184        fn request_options(&mut self) -> &mut crate::RequestOptions {
185            &mut self.0.options
186        }
187    }
188
189    /// The request builder for [AddressGroupService::get_address_group][crate::client::AddressGroupService::get_address_group] calls.
190    ///
191    /// # Example
192    /// ```
193    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetAddressGroup;
194    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
195    ///
196    /// let builder = prepare_request_builder();
197    /// let response = builder.send().await?;
198    /// # Ok(()) }
199    ///
200    /// fn prepare_request_builder() -> GetAddressGroup {
201    ///   # panic!();
202    ///   // ... details omitted ...
203    /// }
204    /// ```
205    #[derive(Clone, Debug)]
206    pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
207
208    impl GetAddressGroup {
209        pub(crate) fn new(
210            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
211        ) -> Self {
212            Self(RequestBuilder::new(stub))
213        }
214
215        /// Sets the full request, replacing any prior values.
216        pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
217            self.0.request = v.into();
218            self
219        }
220
221        /// Sets all the options, replacing any prior values.
222        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
223            self.0.options = v.into();
224            self
225        }
226
227        /// Sends the request.
228        pub async fn send(self) -> Result<crate::model::AddressGroup> {
229            (*self.0.stub)
230                .get_address_group(self.0.request, self.0.options)
231                .await
232                .map(crate::Response::into_body)
233        }
234
235        /// Sets the value of [name][crate::model::GetAddressGroupRequest::name].
236        ///
237        /// This is a **required** field for requests.
238        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
239            self.0.request.name = v.into();
240            self
241        }
242    }
243
244    #[doc(hidden)]
245    impl crate::RequestBuilder for GetAddressGroup {
246        fn request_options(&mut self) -> &mut crate::RequestOptions {
247            &mut self.0.options
248        }
249    }
250
251    /// The request builder for [AddressGroupService::create_address_group][crate::client::AddressGroupService::create_address_group] calls.
252    ///
253    /// # Example
254    /// ```
255    /// # use google_cloud_networksecurity_v1::builder::address_group_service::CreateAddressGroup;
256    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
257    /// use google_cloud_lro::Poller;
258    ///
259    /// let builder = prepare_request_builder();
260    /// let response = builder.poller().until_done().await?;
261    /// # Ok(()) }
262    ///
263    /// fn prepare_request_builder() -> CreateAddressGroup {
264    ///   # panic!();
265    ///   // ... details omitted ...
266    /// }
267    /// ```
268    #[derive(Clone, Debug)]
269    pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
270
271    impl CreateAddressGroup {
272        pub(crate) fn new(
273            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
274        ) -> Self {
275            Self(RequestBuilder::new(stub))
276        }
277
278        /// Sets the full request, replacing any prior values.
279        pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
280            mut self,
281            v: V,
282        ) -> Self {
283            self.0.request = v.into();
284            self
285        }
286
287        /// Sets all the options, replacing any prior values.
288        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
289            self.0.options = v.into();
290            self
291        }
292
293        /// Sends the request.
294        ///
295        /// # Long running operations
296        ///
297        /// This starts, but does not poll, a longrunning operation. More information
298        /// on [create_address_group][crate::client::AddressGroupService::create_address_group].
299        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
300            (*self.0.stub)
301                .create_address_group(self.0.request, self.0.options)
302                .await
303                .map(crate::Response::into_body)
304        }
305
306        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_address_group`.
307        pub fn poller(
308            self,
309        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
310        {
311            type Operation = google_cloud_lro::internal::Operation<
312                crate::model::AddressGroup,
313                crate::model::OperationMetadata,
314            >;
315            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
316            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
317            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
318            if let Some(ref mut details) = poller_options.tracing {
319                details.method_name = "google_cloud_networksecurity_v1::client::AddressGroupService::create_address_group::until_done";
320            }
321
322            let stub = self.0.stub.clone();
323            let mut options = self.0.options.clone();
324            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
325            let query = move |name| {
326                let stub = stub.clone();
327                let options = options.clone();
328                async {
329                    let op = GetOperation::new(stub)
330                        .set_name(name)
331                        .with_options(options)
332                        .send()
333                        .await?;
334                    Ok(Operation::new(op))
335                }
336            };
337
338            let start = move || async {
339                let op = self.send().await?;
340                Ok(Operation::new(op))
341            };
342
343            use google_cloud_lro::internal::PollerExt;
344            {
345                google_cloud_lro::internal::new_poller(
346                    polling_error_policy,
347                    polling_backoff_policy,
348                    start,
349                    query,
350                )
351            }
352            .with_options(poller_options)
353        }
354
355        /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
356        ///
357        /// This is a **required** field for requests.
358        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
359            self.0.request.parent = v.into();
360            self
361        }
362
363        /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
364        ///
365        /// This is a **required** field for requests.
366        pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
367            self.0.request.address_group_id = v.into();
368            self
369        }
370
371        /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
372        ///
373        /// This is a **required** field for requests.
374        pub fn set_address_group<T>(mut self, v: T) -> Self
375        where
376            T: std::convert::Into<crate::model::AddressGroup>,
377        {
378            self.0.request.address_group = std::option::Option::Some(v.into());
379            self
380        }
381
382        /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
383        ///
384        /// This is a **required** field for requests.
385        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
386        where
387            T: std::convert::Into<crate::model::AddressGroup>,
388        {
389            self.0.request.address_group = v.map(|x| x.into());
390            self
391        }
392
393        /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
394        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
395            self.0.request.request_id = v.into();
396            self
397        }
398    }
399
400    #[doc(hidden)]
401    impl crate::RequestBuilder for CreateAddressGroup {
402        fn request_options(&mut self) -> &mut crate::RequestOptions {
403            &mut self.0.options
404        }
405    }
406
407    /// The request builder for [AddressGroupService::update_address_group][crate::client::AddressGroupService::update_address_group] calls.
408    ///
409    /// # Example
410    /// ```
411    /// # use google_cloud_networksecurity_v1::builder::address_group_service::UpdateAddressGroup;
412    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
413    /// use google_cloud_lro::Poller;
414    ///
415    /// let builder = prepare_request_builder();
416    /// let response = builder.poller().until_done().await?;
417    /// # Ok(()) }
418    ///
419    /// fn prepare_request_builder() -> UpdateAddressGroup {
420    ///   # panic!();
421    ///   // ... details omitted ...
422    /// }
423    /// ```
424    #[derive(Clone, Debug)]
425    pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
426
427    impl UpdateAddressGroup {
428        pub(crate) fn new(
429            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
430        ) -> Self {
431            Self(RequestBuilder::new(stub))
432        }
433
434        /// Sets the full request, replacing any prior values.
435        pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
436            mut self,
437            v: V,
438        ) -> Self {
439            self.0.request = v.into();
440            self
441        }
442
443        /// Sets all the options, replacing any prior values.
444        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
445            self.0.options = v.into();
446            self
447        }
448
449        /// Sends the request.
450        ///
451        /// # Long running operations
452        ///
453        /// This starts, but does not poll, a longrunning operation. More information
454        /// on [update_address_group][crate::client::AddressGroupService::update_address_group].
455        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
456            (*self.0.stub)
457                .update_address_group(self.0.request, self.0.options)
458                .await
459                .map(crate::Response::into_body)
460        }
461
462        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_address_group`.
463        pub fn poller(
464            self,
465        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
466        {
467            type Operation = google_cloud_lro::internal::Operation<
468                crate::model::AddressGroup,
469                crate::model::OperationMetadata,
470            >;
471            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
472            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
473            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
474            if let Some(ref mut details) = poller_options.tracing {
475                details.method_name = "google_cloud_networksecurity_v1::client::AddressGroupService::update_address_group::until_done";
476            }
477
478            let stub = self.0.stub.clone();
479            let mut options = self.0.options.clone();
480            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
481            let query = move |name| {
482                let stub = stub.clone();
483                let options = options.clone();
484                async {
485                    let op = GetOperation::new(stub)
486                        .set_name(name)
487                        .with_options(options)
488                        .send()
489                        .await?;
490                    Ok(Operation::new(op))
491                }
492            };
493
494            let start = move || async {
495                let op = self.send().await?;
496                Ok(Operation::new(op))
497            };
498
499            use google_cloud_lro::internal::PollerExt;
500            {
501                google_cloud_lro::internal::new_poller(
502                    polling_error_policy,
503                    polling_backoff_policy,
504                    start,
505                    query,
506                )
507            }
508            .with_options(poller_options)
509        }
510
511        /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
512        pub fn set_update_mask<T>(mut self, v: T) -> Self
513        where
514            T: std::convert::Into<wkt::FieldMask>,
515        {
516            self.0.request.update_mask = std::option::Option::Some(v.into());
517            self
518        }
519
520        /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
521        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
522        where
523            T: std::convert::Into<wkt::FieldMask>,
524        {
525            self.0.request.update_mask = v.map(|x| x.into());
526            self
527        }
528
529        /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
530        ///
531        /// This is a **required** field for requests.
532        pub fn set_address_group<T>(mut self, v: T) -> Self
533        where
534            T: std::convert::Into<crate::model::AddressGroup>,
535        {
536            self.0.request.address_group = std::option::Option::Some(v.into());
537            self
538        }
539
540        /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
541        ///
542        /// This is a **required** field for requests.
543        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
544        where
545            T: std::convert::Into<crate::model::AddressGroup>,
546        {
547            self.0.request.address_group = v.map(|x| x.into());
548            self
549        }
550
551        /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
552        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
553            self.0.request.request_id = v.into();
554            self
555        }
556    }
557
558    #[doc(hidden)]
559    impl crate::RequestBuilder for UpdateAddressGroup {
560        fn request_options(&mut self) -> &mut crate::RequestOptions {
561            &mut self.0.options
562        }
563    }
564
565    /// The request builder for [AddressGroupService::add_address_group_items][crate::client::AddressGroupService::add_address_group_items] calls.
566    ///
567    /// # Example
568    /// ```
569    /// # use google_cloud_networksecurity_v1::builder::address_group_service::AddAddressGroupItems;
570    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
571    /// use google_cloud_lro::Poller;
572    ///
573    /// let builder = prepare_request_builder();
574    /// let response = builder.poller().until_done().await?;
575    /// # Ok(()) }
576    ///
577    /// fn prepare_request_builder() -> AddAddressGroupItems {
578    ///   # panic!();
579    ///   // ... details omitted ...
580    /// }
581    /// ```
582    #[derive(Clone, Debug)]
583    pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
584
585    impl AddAddressGroupItems {
586        pub(crate) fn new(
587            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
588        ) -> Self {
589            Self(RequestBuilder::new(stub))
590        }
591
592        /// Sets the full request, replacing any prior values.
593        pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
594            mut self,
595            v: V,
596        ) -> Self {
597            self.0.request = v.into();
598            self
599        }
600
601        /// Sets all the options, replacing any prior values.
602        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
603            self.0.options = v.into();
604            self
605        }
606
607        /// Sends the request.
608        ///
609        /// # Long running operations
610        ///
611        /// This starts, but does not poll, a longrunning operation. More information
612        /// on [add_address_group_items][crate::client::AddressGroupService::add_address_group_items].
613        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
614            (*self.0.stub)
615                .add_address_group_items(self.0.request, self.0.options)
616                .await
617                .map(crate::Response::into_body)
618        }
619
620        /// Creates a [Poller][google_cloud_lro::Poller] to work with `add_address_group_items`.
621        pub fn poller(
622            self,
623        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
624        {
625            type Operation = google_cloud_lro::internal::Operation<
626                crate::model::AddressGroup,
627                crate::model::OperationMetadata,
628            >;
629            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
630            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
631            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
632            if let Some(ref mut details) = poller_options.tracing {
633                details.method_name = "google_cloud_networksecurity_v1::client::AddressGroupService::add_address_group_items::until_done";
634            }
635
636            let stub = self.0.stub.clone();
637            let mut options = self.0.options.clone();
638            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
639            let query = move |name| {
640                let stub = stub.clone();
641                let options = options.clone();
642                async {
643                    let op = GetOperation::new(stub)
644                        .set_name(name)
645                        .with_options(options)
646                        .send()
647                        .await?;
648                    Ok(Operation::new(op))
649                }
650            };
651
652            let start = move || async {
653                let op = self.send().await?;
654                Ok(Operation::new(op))
655            };
656
657            use google_cloud_lro::internal::PollerExt;
658            {
659                google_cloud_lro::internal::new_poller(
660                    polling_error_policy,
661                    polling_backoff_policy,
662                    start,
663                    query,
664                )
665            }
666            .with_options(poller_options)
667        }
668
669        /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
670        ///
671        /// This is a **required** field for requests.
672        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
673            self.0.request.address_group = v.into();
674            self
675        }
676
677        /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
678        ///
679        /// This is a **required** field for requests.
680        pub fn set_items<T, V>(mut self, v: T) -> Self
681        where
682            T: std::iter::IntoIterator<Item = V>,
683            V: std::convert::Into<std::string::String>,
684        {
685            use std::iter::Iterator;
686            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
687            self
688        }
689
690        /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
691        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
692            self.0.request.request_id = v.into();
693            self
694        }
695    }
696
697    #[doc(hidden)]
698    impl crate::RequestBuilder for AddAddressGroupItems {
699        fn request_options(&mut self) -> &mut crate::RequestOptions {
700            &mut self.0.options
701        }
702    }
703
704    /// The request builder for [AddressGroupService::remove_address_group_items][crate::client::AddressGroupService::remove_address_group_items] calls.
705    ///
706    /// # Example
707    /// ```
708    /// # use google_cloud_networksecurity_v1::builder::address_group_service::RemoveAddressGroupItems;
709    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
710    /// use google_cloud_lro::Poller;
711    ///
712    /// let builder = prepare_request_builder();
713    /// let response = builder.poller().until_done().await?;
714    /// # Ok(()) }
715    ///
716    /// fn prepare_request_builder() -> RemoveAddressGroupItems {
717    ///   # panic!();
718    ///   // ... details omitted ...
719    /// }
720    /// ```
721    #[derive(Clone, Debug)]
722    pub struct RemoveAddressGroupItems(
723        RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
724    );
725
726    impl RemoveAddressGroupItems {
727        pub(crate) fn new(
728            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
729        ) -> Self {
730            Self(RequestBuilder::new(stub))
731        }
732
733        /// Sets the full request, replacing any prior values.
734        pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
735            mut self,
736            v: V,
737        ) -> Self {
738            self.0.request = v.into();
739            self
740        }
741
742        /// Sets all the options, replacing any prior values.
743        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
744            self.0.options = v.into();
745            self
746        }
747
748        /// Sends the request.
749        ///
750        /// # Long running operations
751        ///
752        /// This starts, but does not poll, a longrunning operation. More information
753        /// on [remove_address_group_items][crate::client::AddressGroupService::remove_address_group_items].
754        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
755            (*self.0.stub)
756                .remove_address_group_items(self.0.request, self.0.options)
757                .await
758                .map(crate::Response::into_body)
759        }
760
761        /// Creates a [Poller][google_cloud_lro::Poller] to work with `remove_address_group_items`.
762        pub fn poller(
763            self,
764        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
765        {
766            type Operation = google_cloud_lro::internal::Operation<
767                crate::model::AddressGroup,
768                crate::model::OperationMetadata,
769            >;
770            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
771            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
772            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
773            if let Some(ref mut details) = poller_options.tracing {
774                details.method_name = "google_cloud_networksecurity_v1::client::AddressGroupService::remove_address_group_items::until_done";
775            }
776
777            let stub = self.0.stub.clone();
778            let mut options = self.0.options.clone();
779            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
780            let query = move |name| {
781                let stub = stub.clone();
782                let options = options.clone();
783                async {
784                    let op = GetOperation::new(stub)
785                        .set_name(name)
786                        .with_options(options)
787                        .send()
788                        .await?;
789                    Ok(Operation::new(op))
790                }
791            };
792
793            let start = move || async {
794                let op = self.send().await?;
795                Ok(Operation::new(op))
796            };
797
798            use google_cloud_lro::internal::PollerExt;
799            {
800                google_cloud_lro::internal::new_poller(
801                    polling_error_policy,
802                    polling_backoff_policy,
803                    start,
804                    query,
805                )
806            }
807            .with_options(poller_options)
808        }
809
810        /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
811        ///
812        /// This is a **required** field for requests.
813        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
814            self.0.request.address_group = v.into();
815            self
816        }
817
818        /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
819        ///
820        /// This is a **required** field for requests.
821        pub fn set_items<T, V>(mut self, v: T) -> Self
822        where
823            T: std::iter::IntoIterator<Item = V>,
824            V: std::convert::Into<std::string::String>,
825        {
826            use std::iter::Iterator;
827            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
828            self
829        }
830
831        /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
832        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
833            self.0.request.request_id = v.into();
834            self
835        }
836    }
837
838    #[doc(hidden)]
839    impl crate::RequestBuilder for RemoveAddressGroupItems {
840        fn request_options(&mut self) -> &mut crate::RequestOptions {
841            &mut self.0.options
842        }
843    }
844
845    /// The request builder for [AddressGroupService::clone_address_group_items][crate::client::AddressGroupService::clone_address_group_items] calls.
846    ///
847    /// # Example
848    /// ```
849    /// # use google_cloud_networksecurity_v1::builder::address_group_service::CloneAddressGroupItems;
850    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
851    /// use google_cloud_lro::Poller;
852    ///
853    /// let builder = prepare_request_builder();
854    /// let response = builder.poller().until_done().await?;
855    /// # Ok(()) }
856    ///
857    /// fn prepare_request_builder() -> CloneAddressGroupItems {
858    ///   # panic!();
859    ///   // ... details omitted ...
860    /// }
861    /// ```
862    #[derive(Clone, Debug)]
863    pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
864
865    impl CloneAddressGroupItems {
866        pub(crate) fn new(
867            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
868        ) -> Self {
869            Self(RequestBuilder::new(stub))
870        }
871
872        /// Sets the full request, replacing any prior values.
873        pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
874            mut self,
875            v: V,
876        ) -> Self {
877            self.0.request = v.into();
878            self
879        }
880
881        /// Sets all the options, replacing any prior values.
882        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
883            self.0.options = v.into();
884            self
885        }
886
887        /// Sends the request.
888        ///
889        /// # Long running operations
890        ///
891        /// This starts, but does not poll, a longrunning operation. More information
892        /// on [clone_address_group_items][crate::client::AddressGroupService::clone_address_group_items].
893        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
894            (*self.0.stub)
895                .clone_address_group_items(self.0.request, self.0.options)
896                .await
897                .map(crate::Response::into_body)
898        }
899
900        /// Creates a [Poller][google_cloud_lro::Poller] to work with `clone_address_group_items`.
901        pub fn poller(
902            self,
903        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
904        {
905            type Operation = google_cloud_lro::internal::Operation<
906                crate::model::AddressGroup,
907                crate::model::OperationMetadata,
908            >;
909            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
910            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
911            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
912            if let Some(ref mut details) = poller_options.tracing {
913                details.method_name = "google_cloud_networksecurity_v1::client::AddressGroupService::clone_address_group_items::until_done";
914            }
915
916            let stub = self.0.stub.clone();
917            let mut options = self.0.options.clone();
918            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
919            let query = move |name| {
920                let stub = stub.clone();
921                let options = options.clone();
922                async {
923                    let op = GetOperation::new(stub)
924                        .set_name(name)
925                        .with_options(options)
926                        .send()
927                        .await?;
928                    Ok(Operation::new(op))
929                }
930            };
931
932            let start = move || async {
933                let op = self.send().await?;
934                Ok(Operation::new(op))
935            };
936
937            use google_cloud_lro::internal::PollerExt;
938            {
939                google_cloud_lro::internal::new_poller(
940                    polling_error_policy,
941                    polling_backoff_policy,
942                    start,
943                    query,
944                )
945            }
946            .with_options(poller_options)
947        }
948
949        /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
950        ///
951        /// This is a **required** field for requests.
952        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
953            self.0.request.address_group = v.into();
954            self
955        }
956
957        /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
958        ///
959        /// This is a **required** field for requests.
960        pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
961            self.0.request.source_address_group = v.into();
962            self
963        }
964
965        /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
966        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
967            self.0.request.request_id = v.into();
968            self
969        }
970    }
971
972    #[doc(hidden)]
973    impl crate::RequestBuilder for CloneAddressGroupItems {
974        fn request_options(&mut self) -> &mut crate::RequestOptions {
975            &mut self.0.options
976        }
977    }
978
979    /// The request builder for [AddressGroupService::delete_address_group][crate::client::AddressGroupService::delete_address_group] calls.
980    ///
981    /// # Example
982    /// ```
983    /// # use google_cloud_networksecurity_v1::builder::address_group_service::DeleteAddressGroup;
984    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
985    /// use google_cloud_lro::Poller;
986    ///
987    /// let builder = prepare_request_builder();
988    /// let response = builder.poller().until_done().await?;
989    /// # Ok(()) }
990    ///
991    /// fn prepare_request_builder() -> DeleteAddressGroup {
992    ///   # panic!();
993    ///   // ... details omitted ...
994    /// }
995    /// ```
996    #[derive(Clone, Debug)]
997    pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
998
999    impl DeleteAddressGroup {
1000        pub(crate) fn new(
1001            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1002        ) -> Self {
1003            Self(RequestBuilder::new(stub))
1004        }
1005
1006        /// Sets the full request, replacing any prior values.
1007        pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
1008            mut self,
1009            v: V,
1010        ) -> Self {
1011            self.0.request = v.into();
1012            self
1013        }
1014
1015        /// Sets all the options, replacing any prior values.
1016        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1017            self.0.options = v.into();
1018            self
1019        }
1020
1021        /// Sends the request.
1022        ///
1023        /// # Long running operations
1024        ///
1025        /// This starts, but does not poll, a longrunning operation. More information
1026        /// on [delete_address_group][crate::client::AddressGroupService::delete_address_group].
1027        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1028            (*self.0.stub)
1029                .delete_address_group(self.0.request, self.0.options)
1030                .await
1031                .map(crate::Response::into_body)
1032        }
1033
1034        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_address_group`.
1035        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1036            type Operation =
1037                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1038            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1039            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1040            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1041            if let Some(ref mut details) = poller_options.tracing {
1042                details.method_name = "google_cloud_networksecurity_v1::client::AddressGroupService::delete_address_group::until_done";
1043            }
1044
1045            let stub = self.0.stub.clone();
1046            let mut options = self.0.options.clone();
1047            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1048            let query = move |name| {
1049                let stub = stub.clone();
1050                let options = options.clone();
1051                async {
1052                    let op = GetOperation::new(stub)
1053                        .set_name(name)
1054                        .with_options(options)
1055                        .send()
1056                        .await?;
1057                    Ok(Operation::new(op))
1058                }
1059            };
1060
1061            let start = move || async {
1062                let op = self.send().await?;
1063                Ok(Operation::new(op))
1064            };
1065
1066            use google_cloud_lro::internal::PollerExt;
1067            {
1068                google_cloud_lro::internal::new_unit_response_poller(
1069                    polling_error_policy,
1070                    polling_backoff_policy,
1071                    start,
1072                    query,
1073                )
1074            }
1075            .with_options(poller_options)
1076        }
1077
1078        /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
1079        ///
1080        /// This is a **required** field for requests.
1081        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1082            self.0.request.name = v.into();
1083            self
1084        }
1085
1086        /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
1087        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1088            self.0.request.request_id = v.into();
1089            self
1090        }
1091    }
1092
1093    #[doc(hidden)]
1094    impl crate::RequestBuilder for DeleteAddressGroup {
1095        fn request_options(&mut self) -> &mut crate::RequestOptions {
1096            &mut self.0.options
1097        }
1098    }
1099
1100    /// The request builder for [AddressGroupService::list_address_group_references][crate::client::AddressGroupService::list_address_group_references] calls.
1101    ///
1102    /// # Example
1103    /// ```
1104    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListAddressGroupReferences;
1105    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1106    /// use google_cloud_gax::paginator::ItemPaginator;
1107    ///
1108    /// let builder = prepare_request_builder();
1109    /// let mut items = builder.by_item();
1110    /// while let Some(result) = items.next().await {
1111    ///   let item = result?;
1112    /// }
1113    /// # Ok(()) }
1114    ///
1115    /// fn prepare_request_builder() -> ListAddressGroupReferences {
1116    ///   # panic!();
1117    ///   // ... details omitted ...
1118    /// }
1119    /// ```
1120    #[derive(Clone, Debug)]
1121    pub struct ListAddressGroupReferences(
1122        RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
1123    );
1124
1125    impl ListAddressGroupReferences {
1126        pub(crate) fn new(
1127            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1128        ) -> Self {
1129            Self(RequestBuilder::new(stub))
1130        }
1131
1132        /// Sets the full request, replacing any prior values.
1133        pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
1134            mut self,
1135            v: V,
1136        ) -> Self {
1137            self.0.request = v.into();
1138            self
1139        }
1140
1141        /// Sets all the options, replacing any prior values.
1142        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1143            self.0.options = v.into();
1144            self
1145        }
1146
1147        /// Sends the request.
1148        pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
1149            (*self.0.stub)
1150                .list_address_group_references(self.0.request, self.0.options)
1151                .await
1152                .map(crate::Response::into_body)
1153        }
1154
1155        /// Streams each page in the collection.
1156        pub fn by_page(
1157            self,
1158        ) -> impl google_cloud_gax::paginator::Paginator<
1159            crate::model::ListAddressGroupReferencesResponse,
1160            crate::Error,
1161        > {
1162            use std::clone::Clone;
1163            let token = self.0.request.page_token.clone();
1164            let execute = move |token: String| {
1165                let mut builder = self.clone();
1166                builder.0.request = builder.0.request.set_page_token(token);
1167                builder.send()
1168            };
1169            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1170        }
1171
1172        /// Streams each item in the collection.
1173        pub fn by_item(
1174            self,
1175        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1176            crate::model::ListAddressGroupReferencesResponse,
1177            crate::Error,
1178        > {
1179            use google_cloud_gax::paginator::Paginator;
1180            self.by_page().items()
1181        }
1182
1183        /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
1184        ///
1185        /// This is a **required** field for requests.
1186        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
1187            self.0.request.address_group = v.into();
1188            self
1189        }
1190
1191        /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
1192        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1193            self.0.request.page_size = v.into();
1194            self
1195        }
1196
1197        /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
1198        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1199            self.0.request.page_token = v.into();
1200            self
1201        }
1202    }
1203
1204    #[doc(hidden)]
1205    impl crate::RequestBuilder for ListAddressGroupReferences {
1206        fn request_options(&mut self) -> &mut crate::RequestOptions {
1207            &mut self.0.options
1208        }
1209    }
1210
1211    /// The request builder for [AddressGroupService::list_locations][crate::client::AddressGroupService::list_locations] calls.
1212    ///
1213    /// # Example
1214    /// ```
1215    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListLocations;
1216    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1217    /// use google_cloud_gax::paginator::ItemPaginator;
1218    ///
1219    /// let builder = prepare_request_builder();
1220    /// let mut items = builder.by_item();
1221    /// while let Some(result) = items.next().await {
1222    ///   let item = result?;
1223    /// }
1224    /// # Ok(()) }
1225    ///
1226    /// fn prepare_request_builder() -> ListLocations {
1227    ///   # panic!();
1228    ///   // ... details omitted ...
1229    /// }
1230    /// ```
1231    #[derive(Clone, Debug)]
1232    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1233
1234    impl ListLocations {
1235        pub(crate) fn new(
1236            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1237        ) -> Self {
1238            Self(RequestBuilder::new(stub))
1239        }
1240
1241        /// Sets the full request, replacing any prior values.
1242        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1243            mut self,
1244            v: V,
1245        ) -> Self {
1246            self.0.request = v.into();
1247            self
1248        }
1249
1250        /// Sets all the options, replacing any prior values.
1251        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1252            self.0.options = v.into();
1253            self
1254        }
1255
1256        /// Sends the request.
1257        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1258            (*self.0.stub)
1259                .list_locations(self.0.request, self.0.options)
1260                .await
1261                .map(crate::Response::into_body)
1262        }
1263
1264        /// Streams each page in the collection.
1265        pub fn by_page(
1266            self,
1267        ) -> impl google_cloud_gax::paginator::Paginator<
1268            google_cloud_location::model::ListLocationsResponse,
1269            crate::Error,
1270        > {
1271            use std::clone::Clone;
1272            let token = self.0.request.page_token.clone();
1273            let execute = move |token: String| {
1274                let mut builder = self.clone();
1275                builder.0.request = builder.0.request.set_page_token(token);
1276                builder.send()
1277            };
1278            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1279        }
1280
1281        /// Streams each item in the collection.
1282        pub fn by_item(
1283            self,
1284        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1285            google_cloud_location::model::ListLocationsResponse,
1286            crate::Error,
1287        > {
1288            use google_cloud_gax::paginator::Paginator;
1289            self.by_page().items()
1290        }
1291
1292        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1293        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1294            self.0.request.name = v.into();
1295            self
1296        }
1297
1298        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1299        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1300            self.0.request.filter = v.into();
1301            self
1302        }
1303
1304        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1305        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1306            self.0.request.page_size = v.into();
1307            self
1308        }
1309
1310        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1311        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1312            self.0.request.page_token = v.into();
1313            self
1314        }
1315    }
1316
1317    #[doc(hidden)]
1318    impl crate::RequestBuilder for ListLocations {
1319        fn request_options(&mut self) -> &mut crate::RequestOptions {
1320            &mut self.0.options
1321        }
1322    }
1323
1324    /// The request builder for [AddressGroupService::get_location][crate::client::AddressGroupService::get_location] calls.
1325    ///
1326    /// # Example
1327    /// ```
1328    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetLocation;
1329    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1330    ///
1331    /// let builder = prepare_request_builder();
1332    /// let response = builder.send().await?;
1333    /// # Ok(()) }
1334    ///
1335    /// fn prepare_request_builder() -> GetLocation {
1336    ///   # panic!();
1337    ///   // ... details omitted ...
1338    /// }
1339    /// ```
1340    #[derive(Clone, Debug)]
1341    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1342
1343    impl GetLocation {
1344        pub(crate) fn new(
1345            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1346        ) -> Self {
1347            Self(RequestBuilder::new(stub))
1348        }
1349
1350        /// Sets the full request, replacing any prior values.
1351        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1352            mut self,
1353            v: V,
1354        ) -> Self {
1355            self.0.request = v.into();
1356            self
1357        }
1358
1359        /// Sets all the options, replacing any prior values.
1360        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1361            self.0.options = v.into();
1362            self
1363        }
1364
1365        /// Sends the request.
1366        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1367            (*self.0.stub)
1368                .get_location(self.0.request, self.0.options)
1369                .await
1370                .map(crate::Response::into_body)
1371        }
1372
1373        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1374        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1375            self.0.request.name = v.into();
1376            self
1377        }
1378    }
1379
1380    #[doc(hidden)]
1381    impl crate::RequestBuilder for GetLocation {
1382        fn request_options(&mut self) -> &mut crate::RequestOptions {
1383            &mut self.0.options
1384        }
1385    }
1386
1387    /// The request builder for [AddressGroupService::set_iam_policy][crate::client::AddressGroupService::set_iam_policy] calls.
1388    ///
1389    /// # Example
1390    /// ```
1391    /// # use google_cloud_networksecurity_v1::builder::address_group_service::SetIamPolicy;
1392    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1393    ///
1394    /// let builder = prepare_request_builder();
1395    /// let response = builder.send().await?;
1396    /// # Ok(()) }
1397    ///
1398    /// fn prepare_request_builder() -> SetIamPolicy {
1399    ///   # panic!();
1400    ///   // ... details omitted ...
1401    /// }
1402    /// ```
1403    #[derive(Clone, Debug)]
1404    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1405
1406    impl SetIamPolicy {
1407        pub(crate) fn new(
1408            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1409        ) -> Self {
1410            Self(RequestBuilder::new(stub))
1411        }
1412
1413        /// Sets the full request, replacing any prior values.
1414        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1415            mut self,
1416            v: V,
1417        ) -> Self {
1418            self.0.request = v.into();
1419            self
1420        }
1421
1422        /// Sets all the options, replacing any prior values.
1423        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1424            self.0.options = v.into();
1425            self
1426        }
1427
1428        /// Sends the request.
1429        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1430            (*self.0.stub)
1431                .set_iam_policy(self.0.request, self.0.options)
1432                .await
1433                .map(crate::Response::into_body)
1434        }
1435
1436        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
1437        ///
1438        /// This is a **required** field for requests.
1439        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1440            self.0.request.resource = v.into();
1441            self
1442        }
1443
1444        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1445        ///
1446        /// This is a **required** field for requests.
1447        pub fn set_policy<T>(mut self, v: T) -> Self
1448        where
1449            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1450        {
1451            self.0.request.policy = std::option::Option::Some(v.into());
1452            self
1453        }
1454
1455        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1456        ///
1457        /// This is a **required** field for requests.
1458        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1459        where
1460            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1461        {
1462            self.0.request.policy = v.map(|x| x.into());
1463            self
1464        }
1465
1466        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1467        pub fn set_update_mask<T>(mut self, v: T) -> Self
1468        where
1469            T: std::convert::Into<wkt::FieldMask>,
1470        {
1471            self.0.request.update_mask = std::option::Option::Some(v.into());
1472            self
1473        }
1474
1475        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1476        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1477        where
1478            T: std::convert::Into<wkt::FieldMask>,
1479        {
1480            self.0.request.update_mask = v.map(|x| x.into());
1481            self
1482        }
1483    }
1484
1485    #[doc(hidden)]
1486    impl crate::RequestBuilder for SetIamPolicy {
1487        fn request_options(&mut self) -> &mut crate::RequestOptions {
1488            &mut self.0.options
1489        }
1490    }
1491
1492    /// The request builder for [AddressGroupService::get_iam_policy][crate::client::AddressGroupService::get_iam_policy] calls.
1493    ///
1494    /// # Example
1495    /// ```
1496    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetIamPolicy;
1497    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1498    ///
1499    /// let builder = prepare_request_builder();
1500    /// let response = builder.send().await?;
1501    /// # Ok(()) }
1502    ///
1503    /// fn prepare_request_builder() -> GetIamPolicy {
1504    ///   # panic!();
1505    ///   // ... details omitted ...
1506    /// }
1507    /// ```
1508    #[derive(Clone, Debug)]
1509    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1510
1511    impl GetIamPolicy {
1512        pub(crate) fn new(
1513            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1514        ) -> Self {
1515            Self(RequestBuilder::new(stub))
1516        }
1517
1518        /// Sets the full request, replacing any prior values.
1519        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1520            mut self,
1521            v: V,
1522        ) -> Self {
1523            self.0.request = v.into();
1524            self
1525        }
1526
1527        /// Sets all the options, replacing any prior values.
1528        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1529            self.0.options = v.into();
1530            self
1531        }
1532
1533        /// Sends the request.
1534        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1535            (*self.0.stub)
1536                .get_iam_policy(self.0.request, self.0.options)
1537                .await
1538                .map(crate::Response::into_body)
1539        }
1540
1541        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
1542        ///
1543        /// This is a **required** field for requests.
1544        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1545            self.0.request.resource = v.into();
1546            self
1547        }
1548
1549        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1550        pub fn set_options<T>(mut self, v: T) -> Self
1551        where
1552            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1553        {
1554            self.0.request.options = std::option::Option::Some(v.into());
1555            self
1556        }
1557
1558        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1559        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1560        where
1561            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1562        {
1563            self.0.request.options = v.map(|x| x.into());
1564            self
1565        }
1566    }
1567
1568    #[doc(hidden)]
1569    impl crate::RequestBuilder for GetIamPolicy {
1570        fn request_options(&mut self) -> &mut crate::RequestOptions {
1571            &mut self.0.options
1572        }
1573    }
1574
1575    /// The request builder for [AddressGroupService::test_iam_permissions][crate::client::AddressGroupService::test_iam_permissions] calls.
1576    ///
1577    /// # Example
1578    /// ```
1579    /// # use google_cloud_networksecurity_v1::builder::address_group_service::TestIamPermissions;
1580    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1581    ///
1582    /// let builder = prepare_request_builder();
1583    /// let response = builder.send().await?;
1584    /// # Ok(()) }
1585    ///
1586    /// fn prepare_request_builder() -> TestIamPermissions {
1587    ///   # panic!();
1588    ///   // ... details omitted ...
1589    /// }
1590    /// ```
1591    #[derive(Clone, Debug)]
1592    pub struct TestIamPermissions(
1593        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1594    );
1595
1596    impl TestIamPermissions {
1597        pub(crate) fn new(
1598            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1599        ) -> Self {
1600            Self(RequestBuilder::new(stub))
1601        }
1602
1603        /// Sets the full request, replacing any prior values.
1604        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1605            mut self,
1606            v: V,
1607        ) -> Self {
1608            self.0.request = v.into();
1609            self
1610        }
1611
1612        /// Sets all the options, replacing any prior values.
1613        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1614            self.0.options = v.into();
1615            self
1616        }
1617
1618        /// Sends the request.
1619        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1620            (*self.0.stub)
1621                .test_iam_permissions(self.0.request, self.0.options)
1622                .await
1623                .map(crate::Response::into_body)
1624        }
1625
1626        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
1627        ///
1628        /// This is a **required** field for requests.
1629        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1630            self.0.request.resource = v.into();
1631            self
1632        }
1633
1634        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
1635        ///
1636        /// This is a **required** field for requests.
1637        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1638        where
1639            T: std::iter::IntoIterator<Item = V>,
1640            V: std::convert::Into<std::string::String>,
1641        {
1642            use std::iter::Iterator;
1643            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1644            self
1645        }
1646    }
1647
1648    #[doc(hidden)]
1649    impl crate::RequestBuilder for TestIamPermissions {
1650        fn request_options(&mut self) -> &mut crate::RequestOptions {
1651            &mut self.0.options
1652        }
1653    }
1654
1655    /// The request builder for [AddressGroupService::list_operations][crate::client::AddressGroupService::list_operations] calls.
1656    ///
1657    /// # Example
1658    /// ```
1659    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListOperations;
1660    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1661    /// use google_cloud_gax::paginator::ItemPaginator;
1662    ///
1663    /// let builder = prepare_request_builder();
1664    /// let mut items = builder.by_item();
1665    /// while let Some(result) = items.next().await {
1666    ///   let item = result?;
1667    /// }
1668    /// # Ok(()) }
1669    ///
1670    /// fn prepare_request_builder() -> ListOperations {
1671    ///   # panic!();
1672    ///   // ... details omitted ...
1673    /// }
1674    /// ```
1675    #[derive(Clone, Debug)]
1676    pub struct ListOperations(
1677        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1678    );
1679
1680    impl ListOperations {
1681        pub(crate) fn new(
1682            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1683        ) -> Self {
1684            Self(RequestBuilder::new(stub))
1685        }
1686
1687        /// Sets the full request, replacing any prior values.
1688        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1689            mut self,
1690            v: V,
1691        ) -> Self {
1692            self.0.request = v.into();
1693            self
1694        }
1695
1696        /// Sets all the options, replacing any prior values.
1697        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1698            self.0.options = v.into();
1699            self
1700        }
1701
1702        /// Sends the request.
1703        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1704            (*self.0.stub)
1705                .list_operations(self.0.request, self.0.options)
1706                .await
1707                .map(crate::Response::into_body)
1708        }
1709
1710        /// Streams each page in the collection.
1711        pub fn by_page(
1712            self,
1713        ) -> impl google_cloud_gax::paginator::Paginator<
1714            google_cloud_longrunning::model::ListOperationsResponse,
1715            crate::Error,
1716        > {
1717            use std::clone::Clone;
1718            let token = self.0.request.page_token.clone();
1719            let execute = move |token: String| {
1720                let mut builder = self.clone();
1721                builder.0.request = builder.0.request.set_page_token(token);
1722                builder.send()
1723            };
1724            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1725        }
1726
1727        /// Streams each item in the collection.
1728        pub fn by_item(
1729            self,
1730        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1731            google_cloud_longrunning::model::ListOperationsResponse,
1732            crate::Error,
1733        > {
1734            use google_cloud_gax::paginator::Paginator;
1735            self.by_page().items()
1736        }
1737
1738        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1739        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1740            self.0.request.name = v.into();
1741            self
1742        }
1743
1744        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1745        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1746            self.0.request.filter = v.into();
1747            self
1748        }
1749
1750        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1751        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1752            self.0.request.page_size = v.into();
1753            self
1754        }
1755
1756        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1757        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1758            self.0.request.page_token = v.into();
1759            self
1760        }
1761
1762        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1763        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1764            self.0.request.return_partial_success = v.into();
1765            self
1766        }
1767    }
1768
1769    #[doc(hidden)]
1770    impl crate::RequestBuilder for ListOperations {
1771        fn request_options(&mut self) -> &mut crate::RequestOptions {
1772            &mut self.0.options
1773        }
1774    }
1775
1776    /// The request builder for [AddressGroupService::get_operation][crate::client::AddressGroupService::get_operation] calls.
1777    ///
1778    /// # Example
1779    /// ```
1780    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetOperation;
1781    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1782    ///
1783    /// let builder = prepare_request_builder();
1784    /// let response = builder.send().await?;
1785    /// # Ok(()) }
1786    ///
1787    /// fn prepare_request_builder() -> GetOperation {
1788    ///   # panic!();
1789    ///   // ... details omitted ...
1790    /// }
1791    /// ```
1792    #[derive(Clone, Debug)]
1793    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1794
1795    impl GetOperation {
1796        pub(crate) fn new(
1797            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1798        ) -> Self {
1799            Self(RequestBuilder::new(stub))
1800        }
1801
1802        /// Sets the full request, replacing any prior values.
1803        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1804            mut self,
1805            v: V,
1806        ) -> Self {
1807            self.0.request = v.into();
1808            self
1809        }
1810
1811        /// Sets all the options, replacing any prior values.
1812        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1813            self.0.options = v.into();
1814            self
1815        }
1816
1817        /// Sends the request.
1818        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1819            (*self.0.stub)
1820                .get_operation(self.0.request, self.0.options)
1821                .await
1822                .map(crate::Response::into_body)
1823        }
1824
1825        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1826        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1827            self.0.request.name = v.into();
1828            self
1829        }
1830    }
1831
1832    #[doc(hidden)]
1833    impl crate::RequestBuilder for GetOperation {
1834        fn request_options(&mut self) -> &mut crate::RequestOptions {
1835            &mut self.0.options
1836        }
1837    }
1838
1839    /// The request builder for [AddressGroupService::delete_operation][crate::client::AddressGroupService::delete_operation] calls.
1840    ///
1841    /// # Example
1842    /// ```
1843    /// # use google_cloud_networksecurity_v1::builder::address_group_service::DeleteOperation;
1844    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1845    ///
1846    /// let builder = prepare_request_builder();
1847    /// let response = builder.send().await?;
1848    /// # Ok(()) }
1849    ///
1850    /// fn prepare_request_builder() -> DeleteOperation {
1851    ///   # panic!();
1852    ///   // ... details omitted ...
1853    /// }
1854    /// ```
1855    #[derive(Clone, Debug)]
1856    pub struct DeleteOperation(
1857        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1858    );
1859
1860    impl DeleteOperation {
1861        pub(crate) fn new(
1862            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1863        ) -> Self {
1864            Self(RequestBuilder::new(stub))
1865        }
1866
1867        /// Sets the full request, replacing any prior values.
1868        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1869            mut self,
1870            v: V,
1871        ) -> Self {
1872            self.0.request = v.into();
1873            self
1874        }
1875
1876        /// Sets all the options, replacing any prior values.
1877        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1878            self.0.options = v.into();
1879            self
1880        }
1881
1882        /// Sends the request.
1883        pub async fn send(self) -> Result<()> {
1884            (*self.0.stub)
1885                .delete_operation(self.0.request, self.0.options)
1886                .await
1887                .map(crate::Response::into_body)
1888        }
1889
1890        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
1891        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1892            self.0.request.name = v.into();
1893            self
1894        }
1895    }
1896
1897    #[doc(hidden)]
1898    impl crate::RequestBuilder for DeleteOperation {
1899        fn request_options(&mut self) -> &mut crate::RequestOptions {
1900            &mut self.0.options
1901        }
1902    }
1903
1904    /// The request builder for [AddressGroupService::cancel_operation][crate::client::AddressGroupService::cancel_operation] calls.
1905    ///
1906    /// # Example
1907    /// ```
1908    /// # use google_cloud_networksecurity_v1::builder::address_group_service::CancelOperation;
1909    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1910    ///
1911    /// let builder = prepare_request_builder();
1912    /// let response = builder.send().await?;
1913    /// # Ok(()) }
1914    ///
1915    /// fn prepare_request_builder() -> CancelOperation {
1916    ///   # panic!();
1917    ///   // ... details omitted ...
1918    /// }
1919    /// ```
1920    #[derive(Clone, Debug)]
1921    pub struct CancelOperation(
1922        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1923    );
1924
1925    impl CancelOperation {
1926        pub(crate) fn new(
1927            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1928        ) -> Self {
1929            Self(RequestBuilder::new(stub))
1930        }
1931
1932        /// Sets the full request, replacing any prior values.
1933        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1934            mut self,
1935            v: V,
1936        ) -> Self {
1937            self.0.request = v.into();
1938            self
1939        }
1940
1941        /// Sets all the options, replacing any prior values.
1942        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1943            self.0.options = v.into();
1944            self
1945        }
1946
1947        /// Sends the request.
1948        pub async fn send(self) -> Result<()> {
1949            (*self.0.stub)
1950                .cancel_operation(self.0.request, self.0.options)
1951                .await
1952                .map(crate::Response::into_body)
1953        }
1954
1955        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1956        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1957            self.0.request.name = v.into();
1958            self
1959        }
1960    }
1961
1962    #[doc(hidden)]
1963    impl crate::RequestBuilder for CancelOperation {
1964        fn request_options(&mut self) -> &mut crate::RequestOptions {
1965            &mut self.0.options
1966        }
1967    }
1968}
1969
1970/// Request and client builders for [OrganizationAddressGroupService][crate::client::OrganizationAddressGroupService].
1971pub mod organization_address_group_service {
1972    use crate::Result;
1973
1974    /// A builder for [OrganizationAddressGroupService][crate::client::OrganizationAddressGroupService].
1975    ///
1976    /// ```
1977    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1978    /// # use google_cloud_networksecurity_v1::*;
1979    /// # use builder::organization_address_group_service::ClientBuilder;
1980    /// # use client::OrganizationAddressGroupService;
1981    /// let builder : ClientBuilder = OrganizationAddressGroupService::builder();
1982    /// let client = builder
1983    ///     .with_endpoint("https://networksecurity.googleapis.com")
1984    ///     .build().await?;
1985    /// # Ok(()) }
1986    /// ```
1987    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1988
1989    pub(crate) mod client {
1990        use super::super::super::client::OrganizationAddressGroupService;
1991        pub struct Factory;
1992        impl crate::ClientFactory for Factory {
1993            type Client = OrganizationAddressGroupService;
1994            type Credentials = gaxi::options::Credentials;
1995            async fn build(
1996                self,
1997                config: gaxi::options::ClientConfig,
1998            ) -> crate::ClientBuilderResult<Self::Client> {
1999                Self::Client::new(config).await
2000            }
2001        }
2002    }
2003
2004    /// Common implementation for [crate::client::OrganizationAddressGroupService] request builders.
2005    #[derive(Clone, Debug)]
2006    pub(crate) struct RequestBuilder<R: std::default::Default> {
2007        stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2008        request: R,
2009        options: crate::RequestOptions,
2010    }
2011
2012    impl<R> RequestBuilder<R>
2013    where
2014        R: std::default::Default,
2015    {
2016        pub(crate) fn new(
2017            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2018        ) -> Self {
2019            Self {
2020                stub,
2021                request: R::default(),
2022                options: crate::RequestOptions::default(),
2023            }
2024        }
2025    }
2026
2027    /// The request builder for [OrganizationAddressGroupService::list_address_groups][crate::client::OrganizationAddressGroupService::list_address_groups] calls.
2028    ///
2029    /// # Example
2030    /// ```
2031    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListAddressGroups;
2032    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2033    /// use google_cloud_gax::paginator::ItemPaginator;
2034    ///
2035    /// let builder = prepare_request_builder();
2036    /// let mut items = builder.by_item();
2037    /// while let Some(result) = items.next().await {
2038    ///   let item = result?;
2039    /// }
2040    /// # Ok(()) }
2041    ///
2042    /// fn prepare_request_builder() -> ListAddressGroups {
2043    ///   # panic!();
2044    ///   // ... details omitted ...
2045    /// }
2046    /// ```
2047    #[derive(Clone, Debug)]
2048    pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
2049
2050    impl ListAddressGroups {
2051        pub(crate) fn new(
2052            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2053        ) -> Self {
2054            Self(RequestBuilder::new(stub))
2055        }
2056
2057        /// Sets the full request, replacing any prior values.
2058        pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
2059            mut self,
2060            v: V,
2061        ) -> Self {
2062            self.0.request = v.into();
2063            self
2064        }
2065
2066        /// Sets all the options, replacing any prior values.
2067        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2068            self.0.options = v.into();
2069            self
2070        }
2071
2072        /// Sends the request.
2073        pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
2074            (*self.0.stub)
2075                .list_address_groups(self.0.request, self.0.options)
2076                .await
2077                .map(crate::Response::into_body)
2078        }
2079
2080        /// Streams each page in the collection.
2081        pub fn by_page(
2082            self,
2083        ) -> impl google_cloud_gax::paginator::Paginator<
2084            crate::model::ListAddressGroupsResponse,
2085            crate::Error,
2086        > {
2087            use std::clone::Clone;
2088            let token = self.0.request.page_token.clone();
2089            let execute = move |token: String| {
2090                let mut builder = self.clone();
2091                builder.0.request = builder.0.request.set_page_token(token);
2092                builder.send()
2093            };
2094            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2095        }
2096
2097        /// Streams each item in the collection.
2098        pub fn by_item(
2099            self,
2100        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2101            crate::model::ListAddressGroupsResponse,
2102            crate::Error,
2103        > {
2104            use google_cloud_gax::paginator::Paginator;
2105            self.by_page().items()
2106        }
2107
2108        /// Sets the value of [parent][crate::model::ListAddressGroupsRequest::parent].
2109        ///
2110        /// This is a **required** field for requests.
2111        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2112            self.0.request.parent = v.into();
2113            self
2114        }
2115
2116        /// Sets the value of [page_size][crate::model::ListAddressGroupsRequest::page_size].
2117        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2118            self.0.request.page_size = v.into();
2119            self
2120        }
2121
2122        /// Sets the value of [page_token][crate::model::ListAddressGroupsRequest::page_token].
2123        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2124            self.0.request.page_token = v.into();
2125            self
2126        }
2127
2128        /// Sets the value of [return_partial_success][crate::model::ListAddressGroupsRequest::return_partial_success].
2129        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2130            self.0.request.return_partial_success = v.into();
2131            self
2132        }
2133    }
2134
2135    #[doc(hidden)]
2136    impl crate::RequestBuilder for ListAddressGroups {
2137        fn request_options(&mut self) -> &mut crate::RequestOptions {
2138            &mut self.0.options
2139        }
2140    }
2141
2142    /// The request builder for [OrganizationAddressGroupService::get_address_group][crate::client::OrganizationAddressGroupService::get_address_group] calls.
2143    ///
2144    /// # Example
2145    /// ```
2146    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetAddressGroup;
2147    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2148    ///
2149    /// let builder = prepare_request_builder();
2150    /// let response = builder.send().await?;
2151    /// # Ok(()) }
2152    ///
2153    /// fn prepare_request_builder() -> GetAddressGroup {
2154    ///   # panic!();
2155    ///   // ... details omitted ...
2156    /// }
2157    /// ```
2158    #[derive(Clone, Debug)]
2159    pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
2160
2161    impl GetAddressGroup {
2162        pub(crate) fn new(
2163            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2164        ) -> Self {
2165            Self(RequestBuilder::new(stub))
2166        }
2167
2168        /// Sets the full request, replacing any prior values.
2169        pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
2170            self.0.request = v.into();
2171            self
2172        }
2173
2174        /// Sets all the options, replacing any prior values.
2175        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2176            self.0.options = v.into();
2177            self
2178        }
2179
2180        /// Sends the request.
2181        pub async fn send(self) -> Result<crate::model::AddressGroup> {
2182            (*self.0.stub)
2183                .get_address_group(self.0.request, self.0.options)
2184                .await
2185                .map(crate::Response::into_body)
2186        }
2187
2188        /// Sets the value of [name][crate::model::GetAddressGroupRequest::name].
2189        ///
2190        /// This is a **required** field for requests.
2191        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2192            self.0.request.name = v.into();
2193            self
2194        }
2195    }
2196
2197    #[doc(hidden)]
2198    impl crate::RequestBuilder for GetAddressGroup {
2199        fn request_options(&mut self) -> &mut crate::RequestOptions {
2200            &mut self.0.options
2201        }
2202    }
2203
2204    /// The request builder for [OrganizationAddressGroupService::create_address_group][crate::client::OrganizationAddressGroupService::create_address_group] calls.
2205    ///
2206    /// # Example
2207    /// ```
2208    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::CreateAddressGroup;
2209    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2210    /// use google_cloud_lro::Poller;
2211    ///
2212    /// let builder = prepare_request_builder();
2213    /// let response = builder.poller().until_done().await?;
2214    /// # Ok(()) }
2215    ///
2216    /// fn prepare_request_builder() -> CreateAddressGroup {
2217    ///   # panic!();
2218    ///   // ... details omitted ...
2219    /// }
2220    /// ```
2221    #[derive(Clone, Debug)]
2222    pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
2223
2224    impl CreateAddressGroup {
2225        pub(crate) fn new(
2226            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2227        ) -> Self {
2228            Self(RequestBuilder::new(stub))
2229        }
2230
2231        /// Sets the full request, replacing any prior values.
2232        pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
2233            mut self,
2234            v: V,
2235        ) -> Self {
2236            self.0.request = v.into();
2237            self
2238        }
2239
2240        /// Sets all the options, replacing any prior values.
2241        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2242            self.0.options = v.into();
2243            self
2244        }
2245
2246        /// Sends the request.
2247        ///
2248        /// # Long running operations
2249        ///
2250        /// This starts, but does not poll, a longrunning operation. More information
2251        /// on [create_address_group][crate::client::OrganizationAddressGroupService::create_address_group].
2252        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2253            (*self.0.stub)
2254                .create_address_group(self.0.request, self.0.options)
2255                .await
2256                .map(crate::Response::into_body)
2257        }
2258
2259        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_address_group`.
2260        pub fn poller(
2261            self,
2262        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2263        {
2264            type Operation = google_cloud_lro::internal::Operation<
2265                crate::model::AddressGroup,
2266                crate::model::OperationMetadata,
2267            >;
2268            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2269            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2270            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2271            if let Some(ref mut details) = poller_options.tracing {
2272                details.method_name = "google_cloud_networksecurity_v1::client::OrganizationAddressGroupService::create_address_group::until_done";
2273            }
2274
2275            let stub = self.0.stub.clone();
2276            let mut options = self.0.options.clone();
2277            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2278            let query = move |name| {
2279                let stub = stub.clone();
2280                let options = options.clone();
2281                async {
2282                    let op = GetOperation::new(stub)
2283                        .set_name(name)
2284                        .with_options(options)
2285                        .send()
2286                        .await?;
2287                    Ok(Operation::new(op))
2288                }
2289            };
2290
2291            let start = move || async {
2292                let op = self.send().await?;
2293                Ok(Operation::new(op))
2294            };
2295
2296            use google_cloud_lro::internal::PollerExt;
2297            {
2298                google_cloud_lro::internal::new_poller(
2299                    polling_error_policy,
2300                    polling_backoff_policy,
2301                    start,
2302                    query,
2303                )
2304            }
2305            .with_options(poller_options)
2306        }
2307
2308        /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
2309        ///
2310        /// This is a **required** field for requests.
2311        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2312            self.0.request.parent = v.into();
2313            self
2314        }
2315
2316        /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
2317        ///
2318        /// This is a **required** field for requests.
2319        pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2320            self.0.request.address_group_id = v.into();
2321            self
2322        }
2323
2324        /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
2325        ///
2326        /// This is a **required** field for requests.
2327        pub fn set_address_group<T>(mut self, v: T) -> Self
2328        where
2329            T: std::convert::Into<crate::model::AddressGroup>,
2330        {
2331            self.0.request.address_group = std::option::Option::Some(v.into());
2332            self
2333        }
2334
2335        /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
2336        ///
2337        /// This is a **required** field for requests.
2338        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2339        where
2340            T: std::convert::Into<crate::model::AddressGroup>,
2341        {
2342            self.0.request.address_group = v.map(|x| x.into());
2343            self
2344        }
2345
2346        /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
2347        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2348            self.0.request.request_id = v.into();
2349            self
2350        }
2351    }
2352
2353    #[doc(hidden)]
2354    impl crate::RequestBuilder for CreateAddressGroup {
2355        fn request_options(&mut self) -> &mut crate::RequestOptions {
2356            &mut self.0.options
2357        }
2358    }
2359
2360    /// The request builder for [OrganizationAddressGroupService::update_address_group][crate::client::OrganizationAddressGroupService::update_address_group] calls.
2361    ///
2362    /// # Example
2363    /// ```
2364    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::UpdateAddressGroup;
2365    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2366    /// use google_cloud_lro::Poller;
2367    ///
2368    /// let builder = prepare_request_builder();
2369    /// let response = builder.poller().until_done().await?;
2370    /// # Ok(()) }
2371    ///
2372    /// fn prepare_request_builder() -> UpdateAddressGroup {
2373    ///   # panic!();
2374    ///   // ... details omitted ...
2375    /// }
2376    /// ```
2377    #[derive(Clone, Debug)]
2378    pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
2379
2380    impl UpdateAddressGroup {
2381        pub(crate) fn new(
2382            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2383        ) -> Self {
2384            Self(RequestBuilder::new(stub))
2385        }
2386
2387        /// Sets the full request, replacing any prior values.
2388        pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
2389            mut self,
2390            v: V,
2391        ) -> Self {
2392            self.0.request = v.into();
2393            self
2394        }
2395
2396        /// Sets all the options, replacing any prior values.
2397        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2398            self.0.options = v.into();
2399            self
2400        }
2401
2402        /// Sends the request.
2403        ///
2404        /// # Long running operations
2405        ///
2406        /// This starts, but does not poll, a longrunning operation. More information
2407        /// on [update_address_group][crate::client::OrganizationAddressGroupService::update_address_group].
2408        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2409            (*self.0.stub)
2410                .update_address_group(self.0.request, self.0.options)
2411                .await
2412                .map(crate::Response::into_body)
2413        }
2414
2415        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_address_group`.
2416        pub fn poller(
2417            self,
2418        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2419        {
2420            type Operation = google_cloud_lro::internal::Operation<
2421                crate::model::AddressGroup,
2422                crate::model::OperationMetadata,
2423            >;
2424            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2425            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2426            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2427            if let Some(ref mut details) = poller_options.tracing {
2428                details.method_name = "google_cloud_networksecurity_v1::client::OrganizationAddressGroupService::update_address_group::until_done";
2429            }
2430
2431            let stub = self.0.stub.clone();
2432            let mut options = self.0.options.clone();
2433            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2434            let query = move |name| {
2435                let stub = stub.clone();
2436                let options = options.clone();
2437                async {
2438                    let op = GetOperation::new(stub)
2439                        .set_name(name)
2440                        .with_options(options)
2441                        .send()
2442                        .await?;
2443                    Ok(Operation::new(op))
2444                }
2445            };
2446
2447            let start = move || async {
2448                let op = self.send().await?;
2449                Ok(Operation::new(op))
2450            };
2451
2452            use google_cloud_lro::internal::PollerExt;
2453            {
2454                google_cloud_lro::internal::new_poller(
2455                    polling_error_policy,
2456                    polling_backoff_policy,
2457                    start,
2458                    query,
2459                )
2460            }
2461            .with_options(poller_options)
2462        }
2463
2464        /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
2465        pub fn set_update_mask<T>(mut self, v: T) -> Self
2466        where
2467            T: std::convert::Into<wkt::FieldMask>,
2468        {
2469            self.0.request.update_mask = std::option::Option::Some(v.into());
2470            self
2471        }
2472
2473        /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
2474        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2475        where
2476            T: std::convert::Into<wkt::FieldMask>,
2477        {
2478            self.0.request.update_mask = v.map(|x| x.into());
2479            self
2480        }
2481
2482        /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
2483        ///
2484        /// This is a **required** field for requests.
2485        pub fn set_address_group<T>(mut self, v: T) -> Self
2486        where
2487            T: std::convert::Into<crate::model::AddressGroup>,
2488        {
2489            self.0.request.address_group = std::option::Option::Some(v.into());
2490            self
2491        }
2492
2493        /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
2494        ///
2495        /// This is a **required** field for requests.
2496        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2497        where
2498            T: std::convert::Into<crate::model::AddressGroup>,
2499        {
2500            self.0.request.address_group = v.map(|x| x.into());
2501            self
2502        }
2503
2504        /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
2505        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2506            self.0.request.request_id = v.into();
2507            self
2508        }
2509    }
2510
2511    #[doc(hidden)]
2512    impl crate::RequestBuilder for UpdateAddressGroup {
2513        fn request_options(&mut self) -> &mut crate::RequestOptions {
2514            &mut self.0.options
2515        }
2516    }
2517
2518    /// The request builder for [OrganizationAddressGroupService::add_address_group_items][crate::client::OrganizationAddressGroupService::add_address_group_items] calls.
2519    ///
2520    /// # Example
2521    /// ```
2522    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::AddAddressGroupItems;
2523    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2524    /// use google_cloud_lro::Poller;
2525    ///
2526    /// let builder = prepare_request_builder();
2527    /// let response = builder.poller().until_done().await?;
2528    /// # Ok(()) }
2529    ///
2530    /// fn prepare_request_builder() -> AddAddressGroupItems {
2531    ///   # panic!();
2532    ///   // ... details omitted ...
2533    /// }
2534    /// ```
2535    #[derive(Clone, Debug)]
2536    pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
2537
2538    impl AddAddressGroupItems {
2539        pub(crate) fn new(
2540            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2541        ) -> Self {
2542            Self(RequestBuilder::new(stub))
2543        }
2544
2545        /// Sets the full request, replacing any prior values.
2546        pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
2547            mut self,
2548            v: V,
2549        ) -> Self {
2550            self.0.request = v.into();
2551            self
2552        }
2553
2554        /// Sets all the options, replacing any prior values.
2555        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2556            self.0.options = v.into();
2557            self
2558        }
2559
2560        /// Sends the request.
2561        ///
2562        /// # Long running operations
2563        ///
2564        /// This starts, but does not poll, a longrunning operation. More information
2565        /// on [add_address_group_items][crate::client::OrganizationAddressGroupService::add_address_group_items].
2566        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2567            (*self.0.stub)
2568                .add_address_group_items(self.0.request, self.0.options)
2569                .await
2570                .map(crate::Response::into_body)
2571        }
2572
2573        /// Creates a [Poller][google_cloud_lro::Poller] to work with `add_address_group_items`.
2574        pub fn poller(
2575            self,
2576        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2577        {
2578            type Operation = google_cloud_lro::internal::Operation<
2579                crate::model::AddressGroup,
2580                crate::model::OperationMetadata,
2581            >;
2582            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2583            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2584            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2585            if let Some(ref mut details) = poller_options.tracing {
2586                details.method_name = "google_cloud_networksecurity_v1::client::OrganizationAddressGroupService::add_address_group_items::until_done";
2587            }
2588
2589            let stub = self.0.stub.clone();
2590            let mut options = self.0.options.clone();
2591            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2592            let query = move |name| {
2593                let stub = stub.clone();
2594                let options = options.clone();
2595                async {
2596                    let op = GetOperation::new(stub)
2597                        .set_name(name)
2598                        .with_options(options)
2599                        .send()
2600                        .await?;
2601                    Ok(Operation::new(op))
2602                }
2603            };
2604
2605            let start = move || async {
2606                let op = self.send().await?;
2607                Ok(Operation::new(op))
2608            };
2609
2610            use google_cloud_lro::internal::PollerExt;
2611            {
2612                google_cloud_lro::internal::new_poller(
2613                    polling_error_policy,
2614                    polling_backoff_policy,
2615                    start,
2616                    query,
2617                )
2618            }
2619            .with_options(poller_options)
2620        }
2621
2622        /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
2623        ///
2624        /// This is a **required** field for requests.
2625        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2626            self.0.request.address_group = v.into();
2627            self
2628        }
2629
2630        /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
2631        ///
2632        /// This is a **required** field for requests.
2633        pub fn set_items<T, V>(mut self, v: T) -> Self
2634        where
2635            T: std::iter::IntoIterator<Item = V>,
2636            V: std::convert::Into<std::string::String>,
2637        {
2638            use std::iter::Iterator;
2639            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2640            self
2641        }
2642
2643        /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
2644        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2645            self.0.request.request_id = v.into();
2646            self
2647        }
2648    }
2649
2650    #[doc(hidden)]
2651    impl crate::RequestBuilder for AddAddressGroupItems {
2652        fn request_options(&mut self) -> &mut crate::RequestOptions {
2653            &mut self.0.options
2654        }
2655    }
2656
2657    /// The request builder for [OrganizationAddressGroupService::remove_address_group_items][crate::client::OrganizationAddressGroupService::remove_address_group_items] calls.
2658    ///
2659    /// # Example
2660    /// ```
2661    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::RemoveAddressGroupItems;
2662    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2663    /// use google_cloud_lro::Poller;
2664    ///
2665    /// let builder = prepare_request_builder();
2666    /// let response = builder.poller().until_done().await?;
2667    /// # Ok(()) }
2668    ///
2669    /// fn prepare_request_builder() -> RemoveAddressGroupItems {
2670    ///   # panic!();
2671    ///   // ... details omitted ...
2672    /// }
2673    /// ```
2674    #[derive(Clone, Debug)]
2675    pub struct RemoveAddressGroupItems(
2676        RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
2677    );
2678
2679    impl RemoveAddressGroupItems {
2680        pub(crate) fn new(
2681            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2682        ) -> Self {
2683            Self(RequestBuilder::new(stub))
2684        }
2685
2686        /// Sets the full request, replacing any prior values.
2687        pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
2688            mut self,
2689            v: V,
2690        ) -> Self {
2691            self.0.request = v.into();
2692            self
2693        }
2694
2695        /// Sets all the options, replacing any prior values.
2696        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2697            self.0.options = v.into();
2698            self
2699        }
2700
2701        /// Sends the request.
2702        ///
2703        /// # Long running operations
2704        ///
2705        /// This starts, but does not poll, a longrunning operation. More information
2706        /// on [remove_address_group_items][crate::client::OrganizationAddressGroupService::remove_address_group_items].
2707        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2708            (*self.0.stub)
2709                .remove_address_group_items(self.0.request, self.0.options)
2710                .await
2711                .map(crate::Response::into_body)
2712        }
2713
2714        /// Creates a [Poller][google_cloud_lro::Poller] to work with `remove_address_group_items`.
2715        pub fn poller(
2716            self,
2717        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2718        {
2719            type Operation = google_cloud_lro::internal::Operation<
2720                crate::model::AddressGroup,
2721                crate::model::OperationMetadata,
2722            >;
2723            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2724            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2725            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2726            if let Some(ref mut details) = poller_options.tracing {
2727                details.method_name = "google_cloud_networksecurity_v1::client::OrganizationAddressGroupService::remove_address_group_items::until_done";
2728            }
2729
2730            let stub = self.0.stub.clone();
2731            let mut options = self.0.options.clone();
2732            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2733            let query = move |name| {
2734                let stub = stub.clone();
2735                let options = options.clone();
2736                async {
2737                    let op = GetOperation::new(stub)
2738                        .set_name(name)
2739                        .with_options(options)
2740                        .send()
2741                        .await?;
2742                    Ok(Operation::new(op))
2743                }
2744            };
2745
2746            let start = move || async {
2747                let op = self.send().await?;
2748                Ok(Operation::new(op))
2749            };
2750
2751            use google_cloud_lro::internal::PollerExt;
2752            {
2753                google_cloud_lro::internal::new_poller(
2754                    polling_error_policy,
2755                    polling_backoff_policy,
2756                    start,
2757                    query,
2758                )
2759            }
2760            .with_options(poller_options)
2761        }
2762
2763        /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
2764        ///
2765        /// This is a **required** field for requests.
2766        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2767            self.0.request.address_group = v.into();
2768            self
2769        }
2770
2771        /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
2772        ///
2773        /// This is a **required** field for requests.
2774        pub fn set_items<T, V>(mut self, v: T) -> Self
2775        where
2776            T: std::iter::IntoIterator<Item = V>,
2777            V: std::convert::Into<std::string::String>,
2778        {
2779            use std::iter::Iterator;
2780            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2781            self
2782        }
2783
2784        /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
2785        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2786            self.0.request.request_id = v.into();
2787            self
2788        }
2789    }
2790
2791    #[doc(hidden)]
2792    impl crate::RequestBuilder for RemoveAddressGroupItems {
2793        fn request_options(&mut self) -> &mut crate::RequestOptions {
2794            &mut self.0.options
2795        }
2796    }
2797
2798    /// The request builder for [OrganizationAddressGroupService::clone_address_group_items][crate::client::OrganizationAddressGroupService::clone_address_group_items] calls.
2799    ///
2800    /// # Example
2801    /// ```
2802    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::CloneAddressGroupItems;
2803    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2804    /// use google_cloud_lro::Poller;
2805    ///
2806    /// let builder = prepare_request_builder();
2807    /// let response = builder.poller().until_done().await?;
2808    /// # Ok(()) }
2809    ///
2810    /// fn prepare_request_builder() -> CloneAddressGroupItems {
2811    ///   # panic!();
2812    ///   // ... details omitted ...
2813    /// }
2814    /// ```
2815    #[derive(Clone, Debug)]
2816    pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
2817
2818    impl CloneAddressGroupItems {
2819        pub(crate) fn new(
2820            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2821        ) -> Self {
2822            Self(RequestBuilder::new(stub))
2823        }
2824
2825        /// Sets the full request, replacing any prior values.
2826        pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
2827            mut self,
2828            v: V,
2829        ) -> Self {
2830            self.0.request = v.into();
2831            self
2832        }
2833
2834        /// Sets all the options, replacing any prior values.
2835        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2836            self.0.options = v.into();
2837            self
2838        }
2839
2840        /// Sends the request.
2841        ///
2842        /// # Long running operations
2843        ///
2844        /// This starts, but does not poll, a longrunning operation. More information
2845        /// on [clone_address_group_items][crate::client::OrganizationAddressGroupService::clone_address_group_items].
2846        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2847            (*self.0.stub)
2848                .clone_address_group_items(self.0.request, self.0.options)
2849                .await
2850                .map(crate::Response::into_body)
2851        }
2852
2853        /// Creates a [Poller][google_cloud_lro::Poller] to work with `clone_address_group_items`.
2854        pub fn poller(
2855            self,
2856        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2857        {
2858            type Operation = google_cloud_lro::internal::Operation<
2859                crate::model::AddressGroup,
2860                crate::model::OperationMetadata,
2861            >;
2862            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2863            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2864            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2865            if let Some(ref mut details) = poller_options.tracing {
2866                details.method_name = "google_cloud_networksecurity_v1::client::OrganizationAddressGroupService::clone_address_group_items::until_done";
2867            }
2868
2869            let stub = self.0.stub.clone();
2870            let mut options = self.0.options.clone();
2871            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2872            let query = move |name| {
2873                let stub = stub.clone();
2874                let options = options.clone();
2875                async {
2876                    let op = GetOperation::new(stub)
2877                        .set_name(name)
2878                        .with_options(options)
2879                        .send()
2880                        .await?;
2881                    Ok(Operation::new(op))
2882                }
2883            };
2884
2885            let start = move || async {
2886                let op = self.send().await?;
2887                Ok(Operation::new(op))
2888            };
2889
2890            use google_cloud_lro::internal::PollerExt;
2891            {
2892                google_cloud_lro::internal::new_poller(
2893                    polling_error_policy,
2894                    polling_backoff_policy,
2895                    start,
2896                    query,
2897                )
2898            }
2899            .with_options(poller_options)
2900        }
2901
2902        /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
2903        ///
2904        /// This is a **required** field for requests.
2905        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2906            self.0.request.address_group = v.into();
2907            self
2908        }
2909
2910        /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
2911        ///
2912        /// This is a **required** field for requests.
2913        pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2914            self.0.request.source_address_group = v.into();
2915            self
2916        }
2917
2918        /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
2919        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2920            self.0.request.request_id = v.into();
2921            self
2922        }
2923    }
2924
2925    #[doc(hidden)]
2926    impl crate::RequestBuilder for CloneAddressGroupItems {
2927        fn request_options(&mut self) -> &mut crate::RequestOptions {
2928            &mut self.0.options
2929        }
2930    }
2931
2932    /// The request builder for [OrganizationAddressGroupService::delete_address_group][crate::client::OrganizationAddressGroupService::delete_address_group] calls.
2933    ///
2934    /// # Example
2935    /// ```
2936    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::DeleteAddressGroup;
2937    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2938    /// use google_cloud_lro::Poller;
2939    ///
2940    /// let builder = prepare_request_builder();
2941    /// let response = builder.poller().until_done().await?;
2942    /// # Ok(()) }
2943    ///
2944    /// fn prepare_request_builder() -> DeleteAddressGroup {
2945    ///   # panic!();
2946    ///   // ... details omitted ...
2947    /// }
2948    /// ```
2949    #[derive(Clone, Debug)]
2950    pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
2951
2952    impl DeleteAddressGroup {
2953        pub(crate) fn new(
2954            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2955        ) -> Self {
2956            Self(RequestBuilder::new(stub))
2957        }
2958
2959        /// Sets the full request, replacing any prior values.
2960        pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
2961            mut self,
2962            v: V,
2963        ) -> Self {
2964            self.0.request = v.into();
2965            self
2966        }
2967
2968        /// Sets all the options, replacing any prior values.
2969        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2970            self.0.options = v.into();
2971            self
2972        }
2973
2974        /// Sends the request.
2975        ///
2976        /// # Long running operations
2977        ///
2978        /// This starts, but does not poll, a longrunning operation. More information
2979        /// on [delete_address_group][crate::client::OrganizationAddressGroupService::delete_address_group].
2980        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2981            (*self.0.stub)
2982                .delete_address_group(self.0.request, self.0.options)
2983                .await
2984                .map(crate::Response::into_body)
2985        }
2986
2987        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_address_group`.
2988        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2989            type Operation =
2990                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2991            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2992            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2993            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2994            if let Some(ref mut details) = poller_options.tracing {
2995                details.method_name = "google_cloud_networksecurity_v1::client::OrganizationAddressGroupService::delete_address_group::until_done";
2996            }
2997
2998            let stub = self.0.stub.clone();
2999            let mut options = self.0.options.clone();
3000            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3001            let query = move |name| {
3002                let stub = stub.clone();
3003                let options = options.clone();
3004                async {
3005                    let op = GetOperation::new(stub)
3006                        .set_name(name)
3007                        .with_options(options)
3008                        .send()
3009                        .await?;
3010                    Ok(Operation::new(op))
3011                }
3012            };
3013
3014            let start = move || async {
3015                let op = self.send().await?;
3016                Ok(Operation::new(op))
3017            };
3018
3019            use google_cloud_lro::internal::PollerExt;
3020            {
3021                google_cloud_lro::internal::new_unit_response_poller(
3022                    polling_error_policy,
3023                    polling_backoff_policy,
3024                    start,
3025                    query,
3026                )
3027            }
3028            .with_options(poller_options)
3029        }
3030
3031        /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
3032        ///
3033        /// This is a **required** field for requests.
3034        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3035            self.0.request.name = v.into();
3036            self
3037        }
3038
3039        /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
3040        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3041            self.0.request.request_id = v.into();
3042            self
3043        }
3044    }
3045
3046    #[doc(hidden)]
3047    impl crate::RequestBuilder for DeleteAddressGroup {
3048        fn request_options(&mut self) -> &mut crate::RequestOptions {
3049            &mut self.0.options
3050        }
3051    }
3052
3053    /// The request builder for [OrganizationAddressGroupService::list_address_group_references][crate::client::OrganizationAddressGroupService::list_address_group_references] calls.
3054    ///
3055    /// # Example
3056    /// ```
3057    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListAddressGroupReferences;
3058    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3059    /// use google_cloud_gax::paginator::ItemPaginator;
3060    ///
3061    /// let builder = prepare_request_builder();
3062    /// let mut items = builder.by_item();
3063    /// while let Some(result) = items.next().await {
3064    ///   let item = result?;
3065    /// }
3066    /// # Ok(()) }
3067    ///
3068    /// fn prepare_request_builder() -> ListAddressGroupReferences {
3069    ///   # panic!();
3070    ///   // ... details omitted ...
3071    /// }
3072    /// ```
3073    #[derive(Clone, Debug)]
3074    pub struct ListAddressGroupReferences(
3075        RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
3076    );
3077
3078    impl ListAddressGroupReferences {
3079        pub(crate) fn new(
3080            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3081        ) -> Self {
3082            Self(RequestBuilder::new(stub))
3083        }
3084
3085        /// Sets the full request, replacing any prior values.
3086        pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
3087            mut self,
3088            v: V,
3089        ) -> Self {
3090            self.0.request = v.into();
3091            self
3092        }
3093
3094        /// Sets all the options, replacing any prior values.
3095        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3096            self.0.options = v.into();
3097            self
3098        }
3099
3100        /// Sends the request.
3101        pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
3102            (*self.0.stub)
3103                .list_address_group_references(self.0.request, self.0.options)
3104                .await
3105                .map(crate::Response::into_body)
3106        }
3107
3108        /// Streams each page in the collection.
3109        pub fn by_page(
3110            self,
3111        ) -> impl google_cloud_gax::paginator::Paginator<
3112            crate::model::ListAddressGroupReferencesResponse,
3113            crate::Error,
3114        > {
3115            use std::clone::Clone;
3116            let token = self.0.request.page_token.clone();
3117            let execute = move |token: String| {
3118                let mut builder = self.clone();
3119                builder.0.request = builder.0.request.set_page_token(token);
3120                builder.send()
3121            };
3122            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3123        }
3124
3125        /// Streams each item in the collection.
3126        pub fn by_item(
3127            self,
3128        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3129            crate::model::ListAddressGroupReferencesResponse,
3130            crate::Error,
3131        > {
3132            use google_cloud_gax::paginator::Paginator;
3133            self.by_page().items()
3134        }
3135
3136        /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
3137        ///
3138        /// This is a **required** field for requests.
3139        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
3140            self.0.request.address_group = v.into();
3141            self
3142        }
3143
3144        /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
3145        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3146            self.0.request.page_size = v.into();
3147            self
3148        }
3149
3150        /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
3151        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3152            self.0.request.page_token = v.into();
3153            self
3154        }
3155    }
3156
3157    #[doc(hidden)]
3158    impl crate::RequestBuilder for ListAddressGroupReferences {
3159        fn request_options(&mut self) -> &mut crate::RequestOptions {
3160            &mut self.0.options
3161        }
3162    }
3163
3164    /// The request builder for [OrganizationAddressGroupService::list_locations][crate::client::OrganizationAddressGroupService::list_locations] calls.
3165    ///
3166    /// # Example
3167    /// ```
3168    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListLocations;
3169    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3170    /// use google_cloud_gax::paginator::ItemPaginator;
3171    ///
3172    /// let builder = prepare_request_builder();
3173    /// let mut items = builder.by_item();
3174    /// while let Some(result) = items.next().await {
3175    ///   let item = result?;
3176    /// }
3177    /// # Ok(()) }
3178    ///
3179    /// fn prepare_request_builder() -> ListLocations {
3180    ///   # panic!();
3181    ///   // ... details omitted ...
3182    /// }
3183    /// ```
3184    #[derive(Clone, Debug)]
3185    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3186
3187    impl ListLocations {
3188        pub(crate) fn new(
3189            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3190        ) -> Self {
3191            Self(RequestBuilder::new(stub))
3192        }
3193
3194        /// Sets the full request, replacing any prior values.
3195        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3196            mut self,
3197            v: V,
3198        ) -> Self {
3199            self.0.request = v.into();
3200            self
3201        }
3202
3203        /// Sets all the options, replacing any prior values.
3204        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3205            self.0.options = v.into();
3206            self
3207        }
3208
3209        /// Sends the request.
3210        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3211            (*self.0.stub)
3212                .list_locations(self.0.request, self.0.options)
3213                .await
3214                .map(crate::Response::into_body)
3215        }
3216
3217        /// Streams each page in the collection.
3218        pub fn by_page(
3219            self,
3220        ) -> impl google_cloud_gax::paginator::Paginator<
3221            google_cloud_location::model::ListLocationsResponse,
3222            crate::Error,
3223        > {
3224            use std::clone::Clone;
3225            let token = self.0.request.page_token.clone();
3226            let execute = move |token: String| {
3227                let mut builder = self.clone();
3228                builder.0.request = builder.0.request.set_page_token(token);
3229                builder.send()
3230            };
3231            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3232        }
3233
3234        /// Streams each item in the collection.
3235        pub fn by_item(
3236            self,
3237        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3238            google_cloud_location::model::ListLocationsResponse,
3239            crate::Error,
3240        > {
3241            use google_cloud_gax::paginator::Paginator;
3242            self.by_page().items()
3243        }
3244
3245        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
3246        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3247            self.0.request.name = v.into();
3248            self
3249        }
3250
3251        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
3252        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3253            self.0.request.filter = v.into();
3254            self
3255        }
3256
3257        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
3258        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3259            self.0.request.page_size = v.into();
3260            self
3261        }
3262
3263        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
3264        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3265            self.0.request.page_token = v.into();
3266            self
3267        }
3268    }
3269
3270    #[doc(hidden)]
3271    impl crate::RequestBuilder for ListLocations {
3272        fn request_options(&mut self) -> &mut crate::RequestOptions {
3273            &mut self.0.options
3274        }
3275    }
3276
3277    /// The request builder for [OrganizationAddressGroupService::get_location][crate::client::OrganizationAddressGroupService::get_location] calls.
3278    ///
3279    /// # Example
3280    /// ```
3281    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetLocation;
3282    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3283    ///
3284    /// let builder = prepare_request_builder();
3285    /// let response = builder.send().await?;
3286    /// # Ok(()) }
3287    ///
3288    /// fn prepare_request_builder() -> GetLocation {
3289    ///   # panic!();
3290    ///   // ... details omitted ...
3291    /// }
3292    /// ```
3293    #[derive(Clone, Debug)]
3294    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3295
3296    impl GetLocation {
3297        pub(crate) fn new(
3298            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3299        ) -> Self {
3300            Self(RequestBuilder::new(stub))
3301        }
3302
3303        /// Sets the full request, replacing any prior values.
3304        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3305            mut self,
3306            v: V,
3307        ) -> Self {
3308            self.0.request = v.into();
3309            self
3310        }
3311
3312        /// Sets all the options, replacing any prior values.
3313        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3314            self.0.options = v.into();
3315            self
3316        }
3317
3318        /// Sends the request.
3319        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3320            (*self.0.stub)
3321                .get_location(self.0.request, self.0.options)
3322                .await
3323                .map(crate::Response::into_body)
3324        }
3325
3326        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
3327        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3328            self.0.request.name = v.into();
3329            self
3330        }
3331    }
3332
3333    #[doc(hidden)]
3334    impl crate::RequestBuilder for GetLocation {
3335        fn request_options(&mut self) -> &mut crate::RequestOptions {
3336            &mut self.0.options
3337        }
3338    }
3339
3340    /// The request builder for [OrganizationAddressGroupService::set_iam_policy][crate::client::OrganizationAddressGroupService::set_iam_policy] calls.
3341    ///
3342    /// # Example
3343    /// ```
3344    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::SetIamPolicy;
3345    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3346    ///
3347    /// let builder = prepare_request_builder();
3348    /// let response = builder.send().await?;
3349    /// # Ok(()) }
3350    ///
3351    /// fn prepare_request_builder() -> SetIamPolicy {
3352    ///   # panic!();
3353    ///   // ... details omitted ...
3354    /// }
3355    /// ```
3356    #[derive(Clone, Debug)]
3357    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3358
3359    impl SetIamPolicy {
3360        pub(crate) fn new(
3361            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3362        ) -> Self {
3363            Self(RequestBuilder::new(stub))
3364        }
3365
3366        /// Sets the full request, replacing any prior values.
3367        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3368            mut self,
3369            v: V,
3370        ) -> Self {
3371            self.0.request = v.into();
3372            self
3373        }
3374
3375        /// Sets all the options, replacing any prior values.
3376        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3377            self.0.options = v.into();
3378            self
3379        }
3380
3381        /// Sends the request.
3382        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3383            (*self.0.stub)
3384                .set_iam_policy(self.0.request, self.0.options)
3385                .await
3386                .map(crate::Response::into_body)
3387        }
3388
3389        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
3390        ///
3391        /// This is a **required** field for requests.
3392        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3393            self.0.request.resource = v.into();
3394            self
3395        }
3396
3397        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3398        ///
3399        /// This is a **required** field for requests.
3400        pub fn set_policy<T>(mut self, v: T) -> Self
3401        where
3402            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3403        {
3404            self.0.request.policy = std::option::Option::Some(v.into());
3405            self
3406        }
3407
3408        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3409        ///
3410        /// This is a **required** field for requests.
3411        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3412        where
3413            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3414        {
3415            self.0.request.policy = v.map(|x| x.into());
3416            self
3417        }
3418
3419        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3420        pub fn set_update_mask<T>(mut self, v: T) -> Self
3421        where
3422            T: std::convert::Into<wkt::FieldMask>,
3423        {
3424            self.0.request.update_mask = std::option::Option::Some(v.into());
3425            self
3426        }
3427
3428        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3429        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3430        where
3431            T: std::convert::Into<wkt::FieldMask>,
3432        {
3433            self.0.request.update_mask = v.map(|x| x.into());
3434            self
3435        }
3436    }
3437
3438    #[doc(hidden)]
3439    impl crate::RequestBuilder for SetIamPolicy {
3440        fn request_options(&mut self) -> &mut crate::RequestOptions {
3441            &mut self.0.options
3442        }
3443    }
3444
3445    /// The request builder for [OrganizationAddressGroupService::get_iam_policy][crate::client::OrganizationAddressGroupService::get_iam_policy] calls.
3446    ///
3447    /// # Example
3448    /// ```
3449    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetIamPolicy;
3450    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3451    ///
3452    /// let builder = prepare_request_builder();
3453    /// let response = builder.send().await?;
3454    /// # Ok(()) }
3455    ///
3456    /// fn prepare_request_builder() -> GetIamPolicy {
3457    ///   # panic!();
3458    ///   // ... details omitted ...
3459    /// }
3460    /// ```
3461    #[derive(Clone, Debug)]
3462    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3463
3464    impl GetIamPolicy {
3465        pub(crate) fn new(
3466            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3467        ) -> Self {
3468            Self(RequestBuilder::new(stub))
3469        }
3470
3471        /// Sets the full request, replacing any prior values.
3472        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3473            mut self,
3474            v: V,
3475        ) -> Self {
3476            self.0.request = v.into();
3477            self
3478        }
3479
3480        /// Sets all the options, replacing any prior values.
3481        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3482            self.0.options = v.into();
3483            self
3484        }
3485
3486        /// Sends the request.
3487        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3488            (*self.0.stub)
3489                .get_iam_policy(self.0.request, self.0.options)
3490                .await
3491                .map(crate::Response::into_body)
3492        }
3493
3494        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
3495        ///
3496        /// This is a **required** field for requests.
3497        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3498            self.0.request.resource = v.into();
3499            self
3500        }
3501
3502        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3503        pub fn set_options<T>(mut self, v: T) -> Self
3504        where
3505            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3506        {
3507            self.0.request.options = std::option::Option::Some(v.into());
3508            self
3509        }
3510
3511        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3512        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3513        where
3514            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3515        {
3516            self.0.request.options = v.map(|x| x.into());
3517            self
3518        }
3519    }
3520
3521    #[doc(hidden)]
3522    impl crate::RequestBuilder for GetIamPolicy {
3523        fn request_options(&mut self) -> &mut crate::RequestOptions {
3524            &mut self.0.options
3525        }
3526    }
3527
3528    /// The request builder for [OrganizationAddressGroupService::test_iam_permissions][crate::client::OrganizationAddressGroupService::test_iam_permissions] calls.
3529    ///
3530    /// # Example
3531    /// ```
3532    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::TestIamPermissions;
3533    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3534    ///
3535    /// let builder = prepare_request_builder();
3536    /// let response = builder.send().await?;
3537    /// # Ok(()) }
3538    ///
3539    /// fn prepare_request_builder() -> TestIamPermissions {
3540    ///   # panic!();
3541    ///   // ... details omitted ...
3542    /// }
3543    /// ```
3544    #[derive(Clone, Debug)]
3545    pub struct TestIamPermissions(
3546        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3547    );
3548
3549    impl TestIamPermissions {
3550        pub(crate) fn new(
3551            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3552        ) -> Self {
3553            Self(RequestBuilder::new(stub))
3554        }
3555
3556        /// Sets the full request, replacing any prior values.
3557        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3558            mut self,
3559            v: V,
3560        ) -> Self {
3561            self.0.request = v.into();
3562            self
3563        }
3564
3565        /// Sets all the options, replacing any prior values.
3566        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3567            self.0.options = v.into();
3568            self
3569        }
3570
3571        /// Sends the request.
3572        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3573            (*self.0.stub)
3574                .test_iam_permissions(self.0.request, self.0.options)
3575                .await
3576                .map(crate::Response::into_body)
3577        }
3578
3579        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
3580        ///
3581        /// This is a **required** field for requests.
3582        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3583            self.0.request.resource = v.into();
3584            self
3585        }
3586
3587        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
3588        ///
3589        /// This is a **required** field for requests.
3590        pub fn set_permissions<T, V>(mut self, v: T) -> Self
3591        where
3592            T: std::iter::IntoIterator<Item = V>,
3593            V: std::convert::Into<std::string::String>,
3594        {
3595            use std::iter::Iterator;
3596            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3597            self
3598        }
3599    }
3600
3601    #[doc(hidden)]
3602    impl crate::RequestBuilder for TestIamPermissions {
3603        fn request_options(&mut self) -> &mut crate::RequestOptions {
3604            &mut self.0.options
3605        }
3606    }
3607
3608    /// The request builder for [OrganizationAddressGroupService::list_operations][crate::client::OrganizationAddressGroupService::list_operations] calls.
3609    ///
3610    /// # Example
3611    /// ```
3612    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListOperations;
3613    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3614    /// use google_cloud_gax::paginator::ItemPaginator;
3615    ///
3616    /// let builder = prepare_request_builder();
3617    /// let mut items = builder.by_item();
3618    /// while let Some(result) = items.next().await {
3619    ///   let item = result?;
3620    /// }
3621    /// # Ok(()) }
3622    ///
3623    /// fn prepare_request_builder() -> ListOperations {
3624    ///   # panic!();
3625    ///   // ... details omitted ...
3626    /// }
3627    /// ```
3628    #[derive(Clone, Debug)]
3629    pub struct ListOperations(
3630        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3631    );
3632
3633    impl ListOperations {
3634        pub(crate) fn new(
3635            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3636        ) -> Self {
3637            Self(RequestBuilder::new(stub))
3638        }
3639
3640        /// Sets the full request, replacing any prior values.
3641        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3642            mut self,
3643            v: V,
3644        ) -> Self {
3645            self.0.request = v.into();
3646            self
3647        }
3648
3649        /// Sets all the options, replacing any prior values.
3650        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3651            self.0.options = v.into();
3652            self
3653        }
3654
3655        /// Sends the request.
3656        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3657            (*self.0.stub)
3658                .list_operations(self.0.request, self.0.options)
3659                .await
3660                .map(crate::Response::into_body)
3661        }
3662
3663        /// Streams each page in the collection.
3664        pub fn by_page(
3665            self,
3666        ) -> impl google_cloud_gax::paginator::Paginator<
3667            google_cloud_longrunning::model::ListOperationsResponse,
3668            crate::Error,
3669        > {
3670            use std::clone::Clone;
3671            let token = self.0.request.page_token.clone();
3672            let execute = move |token: String| {
3673                let mut builder = self.clone();
3674                builder.0.request = builder.0.request.set_page_token(token);
3675                builder.send()
3676            };
3677            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3678        }
3679
3680        /// Streams each item in the collection.
3681        pub fn by_item(
3682            self,
3683        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3684            google_cloud_longrunning::model::ListOperationsResponse,
3685            crate::Error,
3686        > {
3687            use google_cloud_gax::paginator::Paginator;
3688            self.by_page().items()
3689        }
3690
3691        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3692        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3693            self.0.request.name = v.into();
3694            self
3695        }
3696
3697        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3698        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3699            self.0.request.filter = v.into();
3700            self
3701        }
3702
3703        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3704        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3705            self.0.request.page_size = v.into();
3706            self
3707        }
3708
3709        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3710        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3711            self.0.request.page_token = v.into();
3712            self
3713        }
3714
3715        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3716        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3717            self.0.request.return_partial_success = v.into();
3718            self
3719        }
3720    }
3721
3722    #[doc(hidden)]
3723    impl crate::RequestBuilder for ListOperations {
3724        fn request_options(&mut self) -> &mut crate::RequestOptions {
3725            &mut self.0.options
3726        }
3727    }
3728
3729    /// The request builder for [OrganizationAddressGroupService::get_operation][crate::client::OrganizationAddressGroupService::get_operation] calls.
3730    ///
3731    /// # Example
3732    /// ```
3733    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetOperation;
3734    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3735    ///
3736    /// let builder = prepare_request_builder();
3737    /// let response = builder.send().await?;
3738    /// # Ok(()) }
3739    ///
3740    /// fn prepare_request_builder() -> GetOperation {
3741    ///   # panic!();
3742    ///   // ... details omitted ...
3743    /// }
3744    /// ```
3745    #[derive(Clone, Debug)]
3746    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3747
3748    impl GetOperation {
3749        pub(crate) fn new(
3750            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3751        ) -> Self {
3752            Self(RequestBuilder::new(stub))
3753        }
3754
3755        /// Sets the full request, replacing any prior values.
3756        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3757            mut self,
3758            v: V,
3759        ) -> Self {
3760            self.0.request = v.into();
3761            self
3762        }
3763
3764        /// Sets all the options, replacing any prior values.
3765        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3766            self.0.options = v.into();
3767            self
3768        }
3769
3770        /// Sends the request.
3771        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3772            (*self.0.stub)
3773                .get_operation(self.0.request, self.0.options)
3774                .await
3775                .map(crate::Response::into_body)
3776        }
3777
3778        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3779        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3780            self.0.request.name = v.into();
3781            self
3782        }
3783    }
3784
3785    #[doc(hidden)]
3786    impl crate::RequestBuilder for GetOperation {
3787        fn request_options(&mut self) -> &mut crate::RequestOptions {
3788            &mut self.0.options
3789        }
3790    }
3791
3792    /// The request builder for [OrganizationAddressGroupService::delete_operation][crate::client::OrganizationAddressGroupService::delete_operation] calls.
3793    ///
3794    /// # Example
3795    /// ```
3796    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::DeleteOperation;
3797    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3798    ///
3799    /// let builder = prepare_request_builder();
3800    /// let response = builder.send().await?;
3801    /// # Ok(()) }
3802    ///
3803    /// fn prepare_request_builder() -> DeleteOperation {
3804    ///   # panic!();
3805    ///   // ... details omitted ...
3806    /// }
3807    /// ```
3808    #[derive(Clone, Debug)]
3809    pub struct DeleteOperation(
3810        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3811    );
3812
3813    impl DeleteOperation {
3814        pub(crate) fn new(
3815            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3816        ) -> Self {
3817            Self(RequestBuilder::new(stub))
3818        }
3819
3820        /// Sets the full request, replacing any prior values.
3821        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3822            mut self,
3823            v: V,
3824        ) -> Self {
3825            self.0.request = v.into();
3826            self
3827        }
3828
3829        /// Sets all the options, replacing any prior values.
3830        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3831            self.0.options = v.into();
3832            self
3833        }
3834
3835        /// Sends the request.
3836        pub async fn send(self) -> Result<()> {
3837            (*self.0.stub)
3838                .delete_operation(self.0.request, self.0.options)
3839                .await
3840                .map(crate::Response::into_body)
3841        }
3842
3843        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3844        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3845            self.0.request.name = v.into();
3846            self
3847        }
3848    }
3849
3850    #[doc(hidden)]
3851    impl crate::RequestBuilder for DeleteOperation {
3852        fn request_options(&mut self) -> &mut crate::RequestOptions {
3853            &mut self.0.options
3854        }
3855    }
3856
3857    /// The request builder for [OrganizationAddressGroupService::cancel_operation][crate::client::OrganizationAddressGroupService::cancel_operation] calls.
3858    ///
3859    /// # Example
3860    /// ```
3861    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::CancelOperation;
3862    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3863    ///
3864    /// let builder = prepare_request_builder();
3865    /// let response = builder.send().await?;
3866    /// # Ok(()) }
3867    ///
3868    /// fn prepare_request_builder() -> CancelOperation {
3869    ///   # panic!();
3870    ///   // ... details omitted ...
3871    /// }
3872    /// ```
3873    #[derive(Clone, Debug)]
3874    pub struct CancelOperation(
3875        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3876    );
3877
3878    impl CancelOperation {
3879        pub(crate) fn new(
3880            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3881        ) -> Self {
3882            Self(RequestBuilder::new(stub))
3883        }
3884
3885        /// Sets the full request, replacing any prior values.
3886        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3887            mut self,
3888            v: V,
3889        ) -> Self {
3890            self.0.request = v.into();
3891            self
3892        }
3893
3894        /// Sets all the options, replacing any prior values.
3895        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3896            self.0.options = v.into();
3897            self
3898        }
3899
3900        /// Sends the request.
3901        pub async fn send(self) -> Result<()> {
3902            (*self.0.stub)
3903                .cancel_operation(self.0.request, self.0.options)
3904                .await
3905                .map(crate::Response::into_body)
3906        }
3907
3908        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3909        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3910            self.0.request.name = v.into();
3911            self
3912        }
3913    }
3914
3915    #[doc(hidden)]
3916    impl crate::RequestBuilder for CancelOperation {
3917        fn request_options(&mut self) -> &mut crate::RequestOptions {
3918            &mut self.0.options
3919        }
3920    }
3921}
3922
3923/// Request and client builders for [DnsThreatDetectorService][crate::client::DnsThreatDetectorService].
3924pub mod dns_threat_detector_service {
3925    use crate::Result;
3926
3927    /// A builder for [DnsThreatDetectorService][crate::client::DnsThreatDetectorService].
3928    ///
3929    /// ```
3930    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3931    /// # use google_cloud_networksecurity_v1::*;
3932    /// # use builder::dns_threat_detector_service::ClientBuilder;
3933    /// # use client::DnsThreatDetectorService;
3934    /// let builder : ClientBuilder = DnsThreatDetectorService::builder();
3935    /// let client = builder
3936    ///     .with_endpoint("https://networksecurity.googleapis.com")
3937    ///     .build().await?;
3938    /// # Ok(()) }
3939    /// ```
3940    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3941
3942    pub(crate) mod client {
3943        use super::super::super::client::DnsThreatDetectorService;
3944        pub struct Factory;
3945        impl crate::ClientFactory for Factory {
3946            type Client = DnsThreatDetectorService;
3947            type Credentials = gaxi::options::Credentials;
3948            async fn build(
3949                self,
3950                config: gaxi::options::ClientConfig,
3951            ) -> crate::ClientBuilderResult<Self::Client> {
3952                Self::Client::new(config).await
3953            }
3954        }
3955    }
3956
3957    /// Common implementation for [crate::client::DnsThreatDetectorService] request builders.
3958    #[derive(Clone, Debug)]
3959    pub(crate) struct RequestBuilder<R: std::default::Default> {
3960        stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3961        request: R,
3962        options: crate::RequestOptions,
3963    }
3964
3965    impl<R> RequestBuilder<R>
3966    where
3967        R: std::default::Default,
3968    {
3969        pub(crate) fn new(
3970            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3971        ) -> Self {
3972            Self {
3973                stub,
3974                request: R::default(),
3975                options: crate::RequestOptions::default(),
3976            }
3977        }
3978    }
3979
3980    /// The request builder for [DnsThreatDetectorService::list_dns_threat_detectors][crate::client::DnsThreatDetectorService::list_dns_threat_detectors] calls.
3981    ///
3982    /// # Example
3983    /// ```
3984    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::ListDnsThreatDetectors;
3985    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3986    /// use google_cloud_gax::paginator::ItemPaginator;
3987    ///
3988    /// let builder = prepare_request_builder();
3989    /// let mut items = builder.by_item();
3990    /// while let Some(result) = items.next().await {
3991    ///   let item = result?;
3992    /// }
3993    /// # Ok(()) }
3994    ///
3995    /// fn prepare_request_builder() -> ListDnsThreatDetectors {
3996    ///   # panic!();
3997    ///   // ... details omitted ...
3998    /// }
3999    /// ```
4000    #[derive(Clone, Debug)]
4001    pub struct ListDnsThreatDetectors(RequestBuilder<crate::model::ListDnsThreatDetectorsRequest>);
4002
4003    impl ListDnsThreatDetectors {
4004        pub(crate) fn new(
4005            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4006        ) -> Self {
4007            Self(RequestBuilder::new(stub))
4008        }
4009
4010        /// Sets the full request, replacing any prior values.
4011        pub fn with_request<V: Into<crate::model::ListDnsThreatDetectorsRequest>>(
4012            mut self,
4013            v: V,
4014        ) -> Self {
4015            self.0.request = v.into();
4016            self
4017        }
4018
4019        /// Sets all the options, replacing any prior values.
4020        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4021            self.0.options = v.into();
4022            self
4023        }
4024
4025        /// Sends the request.
4026        pub async fn send(self) -> Result<crate::model::ListDnsThreatDetectorsResponse> {
4027            (*self.0.stub)
4028                .list_dns_threat_detectors(self.0.request, self.0.options)
4029                .await
4030                .map(crate::Response::into_body)
4031        }
4032
4033        /// Streams each page in the collection.
4034        pub fn by_page(
4035            self,
4036        ) -> impl google_cloud_gax::paginator::Paginator<
4037            crate::model::ListDnsThreatDetectorsResponse,
4038            crate::Error,
4039        > {
4040            use std::clone::Clone;
4041            let token = self.0.request.page_token.clone();
4042            let execute = move |token: String| {
4043                let mut builder = self.clone();
4044                builder.0.request = builder.0.request.set_page_token(token);
4045                builder.send()
4046            };
4047            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4048        }
4049
4050        /// Streams each item in the collection.
4051        pub fn by_item(
4052            self,
4053        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4054            crate::model::ListDnsThreatDetectorsResponse,
4055            crate::Error,
4056        > {
4057            use google_cloud_gax::paginator::Paginator;
4058            self.by_page().items()
4059        }
4060
4061        /// Sets the value of [parent][crate::model::ListDnsThreatDetectorsRequest::parent].
4062        ///
4063        /// This is a **required** field for requests.
4064        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4065            self.0.request.parent = v.into();
4066            self
4067        }
4068
4069        /// Sets the value of [page_size][crate::model::ListDnsThreatDetectorsRequest::page_size].
4070        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4071            self.0.request.page_size = v.into();
4072            self
4073        }
4074
4075        /// Sets the value of [page_token][crate::model::ListDnsThreatDetectorsRequest::page_token].
4076        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4077            self.0.request.page_token = v.into();
4078            self
4079        }
4080    }
4081
4082    #[doc(hidden)]
4083    impl crate::RequestBuilder for ListDnsThreatDetectors {
4084        fn request_options(&mut self) -> &mut crate::RequestOptions {
4085            &mut self.0.options
4086        }
4087    }
4088
4089    /// The request builder for [DnsThreatDetectorService::get_dns_threat_detector][crate::client::DnsThreatDetectorService::get_dns_threat_detector] calls.
4090    ///
4091    /// # Example
4092    /// ```
4093    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetDnsThreatDetector;
4094    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4095    ///
4096    /// let builder = prepare_request_builder();
4097    /// let response = builder.send().await?;
4098    /// # Ok(()) }
4099    ///
4100    /// fn prepare_request_builder() -> GetDnsThreatDetector {
4101    ///   # panic!();
4102    ///   // ... details omitted ...
4103    /// }
4104    /// ```
4105    #[derive(Clone, Debug)]
4106    pub struct GetDnsThreatDetector(RequestBuilder<crate::model::GetDnsThreatDetectorRequest>);
4107
4108    impl GetDnsThreatDetector {
4109        pub(crate) fn new(
4110            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4111        ) -> Self {
4112            Self(RequestBuilder::new(stub))
4113        }
4114
4115        /// Sets the full request, replacing any prior values.
4116        pub fn with_request<V: Into<crate::model::GetDnsThreatDetectorRequest>>(
4117            mut self,
4118            v: V,
4119        ) -> Self {
4120            self.0.request = v.into();
4121            self
4122        }
4123
4124        /// Sets all the options, replacing any prior values.
4125        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4126            self.0.options = v.into();
4127            self
4128        }
4129
4130        /// Sends the request.
4131        pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4132            (*self.0.stub)
4133                .get_dns_threat_detector(self.0.request, self.0.options)
4134                .await
4135                .map(crate::Response::into_body)
4136        }
4137
4138        /// Sets the value of [name][crate::model::GetDnsThreatDetectorRequest::name].
4139        ///
4140        /// This is a **required** field for requests.
4141        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4142            self.0.request.name = v.into();
4143            self
4144        }
4145    }
4146
4147    #[doc(hidden)]
4148    impl crate::RequestBuilder for GetDnsThreatDetector {
4149        fn request_options(&mut self) -> &mut crate::RequestOptions {
4150            &mut self.0.options
4151        }
4152    }
4153
4154    /// The request builder for [DnsThreatDetectorService::create_dns_threat_detector][crate::client::DnsThreatDetectorService::create_dns_threat_detector] calls.
4155    ///
4156    /// # Example
4157    /// ```
4158    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::CreateDnsThreatDetector;
4159    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4160    ///
4161    /// let builder = prepare_request_builder();
4162    /// let response = builder.send().await?;
4163    /// # Ok(()) }
4164    ///
4165    /// fn prepare_request_builder() -> CreateDnsThreatDetector {
4166    ///   # panic!();
4167    ///   // ... details omitted ...
4168    /// }
4169    /// ```
4170    #[derive(Clone, Debug)]
4171    pub struct CreateDnsThreatDetector(
4172        RequestBuilder<crate::model::CreateDnsThreatDetectorRequest>,
4173    );
4174
4175    impl CreateDnsThreatDetector {
4176        pub(crate) fn new(
4177            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4178        ) -> Self {
4179            Self(RequestBuilder::new(stub))
4180        }
4181
4182        /// Sets the full request, replacing any prior values.
4183        pub fn with_request<V: Into<crate::model::CreateDnsThreatDetectorRequest>>(
4184            mut self,
4185            v: V,
4186        ) -> Self {
4187            self.0.request = v.into();
4188            self
4189        }
4190
4191        /// Sets all the options, replacing any prior values.
4192        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4193            self.0.options = v.into();
4194            self
4195        }
4196
4197        /// Sends the request.
4198        pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4199            (*self.0.stub)
4200                .create_dns_threat_detector(self.0.request, self.0.options)
4201                .await
4202                .map(crate::Response::into_body)
4203        }
4204
4205        /// Sets the value of [parent][crate::model::CreateDnsThreatDetectorRequest::parent].
4206        ///
4207        /// This is a **required** field for requests.
4208        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4209            self.0.request.parent = v.into();
4210            self
4211        }
4212
4213        /// Sets the value of [dns_threat_detector_id][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector_id].
4214        pub fn set_dns_threat_detector_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4215            self.0.request.dns_threat_detector_id = v.into();
4216            self
4217        }
4218
4219        /// Sets the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
4220        ///
4221        /// This is a **required** field for requests.
4222        pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4223        where
4224            T: std::convert::Into<crate::model::DnsThreatDetector>,
4225        {
4226            self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4227            self
4228        }
4229
4230        /// Sets or clears the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
4231        ///
4232        /// This is a **required** field for requests.
4233        pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4234        where
4235            T: std::convert::Into<crate::model::DnsThreatDetector>,
4236        {
4237            self.0.request.dns_threat_detector = v.map(|x| x.into());
4238            self
4239        }
4240    }
4241
4242    #[doc(hidden)]
4243    impl crate::RequestBuilder for CreateDnsThreatDetector {
4244        fn request_options(&mut self) -> &mut crate::RequestOptions {
4245            &mut self.0.options
4246        }
4247    }
4248
4249    /// The request builder for [DnsThreatDetectorService::update_dns_threat_detector][crate::client::DnsThreatDetectorService::update_dns_threat_detector] calls.
4250    ///
4251    /// # Example
4252    /// ```
4253    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::UpdateDnsThreatDetector;
4254    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4255    ///
4256    /// let builder = prepare_request_builder();
4257    /// let response = builder.send().await?;
4258    /// # Ok(()) }
4259    ///
4260    /// fn prepare_request_builder() -> UpdateDnsThreatDetector {
4261    ///   # panic!();
4262    ///   // ... details omitted ...
4263    /// }
4264    /// ```
4265    #[derive(Clone, Debug)]
4266    pub struct UpdateDnsThreatDetector(
4267        RequestBuilder<crate::model::UpdateDnsThreatDetectorRequest>,
4268    );
4269
4270    impl UpdateDnsThreatDetector {
4271        pub(crate) fn new(
4272            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4273        ) -> Self {
4274            Self(RequestBuilder::new(stub))
4275        }
4276
4277        /// Sets the full request, replacing any prior values.
4278        pub fn with_request<V: Into<crate::model::UpdateDnsThreatDetectorRequest>>(
4279            mut self,
4280            v: V,
4281        ) -> Self {
4282            self.0.request = v.into();
4283            self
4284        }
4285
4286        /// Sets all the options, replacing any prior values.
4287        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4288            self.0.options = v.into();
4289            self
4290        }
4291
4292        /// Sends the request.
4293        pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4294            (*self.0.stub)
4295                .update_dns_threat_detector(self.0.request, self.0.options)
4296                .await
4297                .map(crate::Response::into_body)
4298        }
4299
4300        /// Sets the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
4301        pub fn set_update_mask<T>(mut self, v: T) -> Self
4302        where
4303            T: std::convert::Into<wkt::FieldMask>,
4304        {
4305            self.0.request.update_mask = std::option::Option::Some(v.into());
4306            self
4307        }
4308
4309        /// Sets or clears the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
4310        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4311        where
4312            T: std::convert::Into<wkt::FieldMask>,
4313        {
4314            self.0.request.update_mask = v.map(|x| x.into());
4315            self
4316        }
4317
4318        /// Sets the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
4319        ///
4320        /// This is a **required** field for requests.
4321        pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4322        where
4323            T: std::convert::Into<crate::model::DnsThreatDetector>,
4324        {
4325            self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4326            self
4327        }
4328
4329        /// Sets or clears the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
4330        ///
4331        /// This is a **required** field for requests.
4332        pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4333        where
4334            T: std::convert::Into<crate::model::DnsThreatDetector>,
4335        {
4336            self.0.request.dns_threat_detector = v.map(|x| x.into());
4337            self
4338        }
4339    }
4340
4341    #[doc(hidden)]
4342    impl crate::RequestBuilder for UpdateDnsThreatDetector {
4343        fn request_options(&mut self) -> &mut crate::RequestOptions {
4344            &mut self.0.options
4345        }
4346    }
4347
4348    /// The request builder for [DnsThreatDetectorService::delete_dns_threat_detector][crate::client::DnsThreatDetectorService::delete_dns_threat_detector] calls.
4349    ///
4350    /// # Example
4351    /// ```
4352    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::DeleteDnsThreatDetector;
4353    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4354    ///
4355    /// let builder = prepare_request_builder();
4356    /// let response = builder.send().await?;
4357    /// # Ok(()) }
4358    ///
4359    /// fn prepare_request_builder() -> DeleteDnsThreatDetector {
4360    ///   # panic!();
4361    ///   // ... details omitted ...
4362    /// }
4363    /// ```
4364    #[derive(Clone, Debug)]
4365    pub struct DeleteDnsThreatDetector(
4366        RequestBuilder<crate::model::DeleteDnsThreatDetectorRequest>,
4367    );
4368
4369    impl DeleteDnsThreatDetector {
4370        pub(crate) fn new(
4371            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4372        ) -> Self {
4373            Self(RequestBuilder::new(stub))
4374        }
4375
4376        /// Sets the full request, replacing any prior values.
4377        pub fn with_request<V: Into<crate::model::DeleteDnsThreatDetectorRequest>>(
4378            mut self,
4379            v: V,
4380        ) -> Self {
4381            self.0.request = v.into();
4382            self
4383        }
4384
4385        /// Sets all the options, replacing any prior values.
4386        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4387            self.0.options = v.into();
4388            self
4389        }
4390
4391        /// Sends the request.
4392        pub async fn send(self) -> Result<()> {
4393            (*self.0.stub)
4394                .delete_dns_threat_detector(self.0.request, self.0.options)
4395                .await
4396                .map(crate::Response::into_body)
4397        }
4398
4399        /// Sets the value of [name][crate::model::DeleteDnsThreatDetectorRequest::name].
4400        ///
4401        /// This is a **required** field for requests.
4402        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4403            self.0.request.name = v.into();
4404            self
4405        }
4406    }
4407
4408    #[doc(hidden)]
4409    impl crate::RequestBuilder for DeleteDnsThreatDetector {
4410        fn request_options(&mut self) -> &mut crate::RequestOptions {
4411            &mut self.0.options
4412        }
4413    }
4414
4415    /// The request builder for [DnsThreatDetectorService::list_locations][crate::client::DnsThreatDetectorService::list_locations] calls.
4416    ///
4417    /// # Example
4418    /// ```
4419    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::ListLocations;
4420    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4421    /// use google_cloud_gax::paginator::ItemPaginator;
4422    ///
4423    /// let builder = prepare_request_builder();
4424    /// let mut items = builder.by_item();
4425    /// while let Some(result) = items.next().await {
4426    ///   let item = result?;
4427    /// }
4428    /// # Ok(()) }
4429    ///
4430    /// fn prepare_request_builder() -> ListLocations {
4431    ///   # panic!();
4432    ///   // ... details omitted ...
4433    /// }
4434    /// ```
4435    #[derive(Clone, Debug)]
4436    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4437
4438    impl ListLocations {
4439        pub(crate) fn new(
4440            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4441        ) -> Self {
4442            Self(RequestBuilder::new(stub))
4443        }
4444
4445        /// Sets the full request, replacing any prior values.
4446        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4447            mut self,
4448            v: V,
4449        ) -> Self {
4450            self.0.request = v.into();
4451            self
4452        }
4453
4454        /// Sets all the options, replacing any prior values.
4455        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4456            self.0.options = v.into();
4457            self
4458        }
4459
4460        /// Sends the request.
4461        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4462            (*self.0.stub)
4463                .list_locations(self.0.request, self.0.options)
4464                .await
4465                .map(crate::Response::into_body)
4466        }
4467
4468        /// Streams each page in the collection.
4469        pub fn by_page(
4470            self,
4471        ) -> impl google_cloud_gax::paginator::Paginator<
4472            google_cloud_location::model::ListLocationsResponse,
4473            crate::Error,
4474        > {
4475            use std::clone::Clone;
4476            let token = self.0.request.page_token.clone();
4477            let execute = move |token: String| {
4478                let mut builder = self.clone();
4479                builder.0.request = builder.0.request.set_page_token(token);
4480                builder.send()
4481            };
4482            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4483        }
4484
4485        /// Streams each item in the collection.
4486        pub fn by_item(
4487            self,
4488        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4489            google_cloud_location::model::ListLocationsResponse,
4490            crate::Error,
4491        > {
4492            use google_cloud_gax::paginator::Paginator;
4493            self.by_page().items()
4494        }
4495
4496        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
4497        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4498            self.0.request.name = v.into();
4499            self
4500        }
4501
4502        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
4503        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4504            self.0.request.filter = v.into();
4505            self
4506        }
4507
4508        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
4509        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4510            self.0.request.page_size = v.into();
4511            self
4512        }
4513
4514        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
4515        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4516            self.0.request.page_token = v.into();
4517            self
4518        }
4519    }
4520
4521    #[doc(hidden)]
4522    impl crate::RequestBuilder for ListLocations {
4523        fn request_options(&mut self) -> &mut crate::RequestOptions {
4524            &mut self.0.options
4525        }
4526    }
4527
4528    /// The request builder for [DnsThreatDetectorService::get_location][crate::client::DnsThreatDetectorService::get_location] calls.
4529    ///
4530    /// # Example
4531    /// ```
4532    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetLocation;
4533    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4534    ///
4535    /// let builder = prepare_request_builder();
4536    /// let response = builder.send().await?;
4537    /// # Ok(()) }
4538    ///
4539    /// fn prepare_request_builder() -> GetLocation {
4540    ///   # panic!();
4541    ///   // ... details omitted ...
4542    /// }
4543    /// ```
4544    #[derive(Clone, Debug)]
4545    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4546
4547    impl GetLocation {
4548        pub(crate) fn new(
4549            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4550        ) -> Self {
4551            Self(RequestBuilder::new(stub))
4552        }
4553
4554        /// Sets the full request, replacing any prior values.
4555        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4556            mut self,
4557            v: V,
4558        ) -> Self {
4559            self.0.request = v.into();
4560            self
4561        }
4562
4563        /// Sets all the options, replacing any prior values.
4564        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4565            self.0.options = v.into();
4566            self
4567        }
4568
4569        /// Sends the request.
4570        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4571            (*self.0.stub)
4572                .get_location(self.0.request, self.0.options)
4573                .await
4574                .map(crate::Response::into_body)
4575        }
4576
4577        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
4578        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4579            self.0.request.name = v.into();
4580            self
4581        }
4582    }
4583
4584    #[doc(hidden)]
4585    impl crate::RequestBuilder for GetLocation {
4586        fn request_options(&mut self) -> &mut crate::RequestOptions {
4587            &mut self.0.options
4588        }
4589    }
4590
4591    /// The request builder for [DnsThreatDetectorService::set_iam_policy][crate::client::DnsThreatDetectorService::set_iam_policy] calls.
4592    ///
4593    /// # Example
4594    /// ```
4595    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::SetIamPolicy;
4596    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4597    ///
4598    /// let builder = prepare_request_builder();
4599    /// let response = builder.send().await?;
4600    /// # Ok(()) }
4601    ///
4602    /// fn prepare_request_builder() -> SetIamPolicy {
4603    ///   # panic!();
4604    ///   // ... details omitted ...
4605    /// }
4606    /// ```
4607    #[derive(Clone, Debug)]
4608    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4609
4610    impl SetIamPolicy {
4611        pub(crate) fn new(
4612            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4613        ) -> Self {
4614            Self(RequestBuilder::new(stub))
4615        }
4616
4617        /// Sets the full request, replacing any prior values.
4618        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4619            mut self,
4620            v: V,
4621        ) -> Self {
4622            self.0.request = v.into();
4623            self
4624        }
4625
4626        /// Sets all the options, replacing any prior values.
4627        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4628            self.0.options = v.into();
4629            self
4630        }
4631
4632        /// Sends the request.
4633        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4634            (*self.0.stub)
4635                .set_iam_policy(self.0.request, self.0.options)
4636                .await
4637                .map(crate::Response::into_body)
4638        }
4639
4640        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
4641        ///
4642        /// This is a **required** field for requests.
4643        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4644            self.0.request.resource = v.into();
4645            self
4646        }
4647
4648        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4649        ///
4650        /// This is a **required** field for requests.
4651        pub fn set_policy<T>(mut self, v: T) -> Self
4652        where
4653            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4654        {
4655            self.0.request.policy = std::option::Option::Some(v.into());
4656            self
4657        }
4658
4659        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4660        ///
4661        /// This is a **required** field for requests.
4662        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4663        where
4664            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4665        {
4666            self.0.request.policy = v.map(|x| x.into());
4667            self
4668        }
4669
4670        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4671        pub fn set_update_mask<T>(mut self, v: T) -> Self
4672        where
4673            T: std::convert::Into<wkt::FieldMask>,
4674        {
4675            self.0.request.update_mask = std::option::Option::Some(v.into());
4676            self
4677        }
4678
4679        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4680        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4681        where
4682            T: std::convert::Into<wkt::FieldMask>,
4683        {
4684            self.0.request.update_mask = v.map(|x| x.into());
4685            self
4686        }
4687    }
4688
4689    #[doc(hidden)]
4690    impl crate::RequestBuilder for SetIamPolicy {
4691        fn request_options(&mut self) -> &mut crate::RequestOptions {
4692            &mut self.0.options
4693        }
4694    }
4695
4696    /// The request builder for [DnsThreatDetectorService::get_iam_policy][crate::client::DnsThreatDetectorService::get_iam_policy] calls.
4697    ///
4698    /// # Example
4699    /// ```
4700    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetIamPolicy;
4701    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4702    ///
4703    /// let builder = prepare_request_builder();
4704    /// let response = builder.send().await?;
4705    /// # Ok(()) }
4706    ///
4707    /// fn prepare_request_builder() -> GetIamPolicy {
4708    ///   # panic!();
4709    ///   // ... details omitted ...
4710    /// }
4711    /// ```
4712    #[derive(Clone, Debug)]
4713    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4714
4715    impl GetIamPolicy {
4716        pub(crate) fn new(
4717            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4718        ) -> Self {
4719            Self(RequestBuilder::new(stub))
4720        }
4721
4722        /// Sets the full request, replacing any prior values.
4723        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4724            mut self,
4725            v: V,
4726        ) -> Self {
4727            self.0.request = v.into();
4728            self
4729        }
4730
4731        /// Sets all the options, replacing any prior values.
4732        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4733            self.0.options = v.into();
4734            self
4735        }
4736
4737        /// Sends the request.
4738        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4739            (*self.0.stub)
4740                .get_iam_policy(self.0.request, self.0.options)
4741                .await
4742                .map(crate::Response::into_body)
4743        }
4744
4745        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
4746        ///
4747        /// This is a **required** field for requests.
4748        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4749            self.0.request.resource = v.into();
4750            self
4751        }
4752
4753        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4754        pub fn set_options<T>(mut self, v: T) -> Self
4755        where
4756            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4757        {
4758            self.0.request.options = std::option::Option::Some(v.into());
4759            self
4760        }
4761
4762        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4763        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4764        where
4765            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4766        {
4767            self.0.request.options = v.map(|x| x.into());
4768            self
4769        }
4770    }
4771
4772    #[doc(hidden)]
4773    impl crate::RequestBuilder for GetIamPolicy {
4774        fn request_options(&mut self) -> &mut crate::RequestOptions {
4775            &mut self.0.options
4776        }
4777    }
4778
4779    /// The request builder for [DnsThreatDetectorService::test_iam_permissions][crate::client::DnsThreatDetectorService::test_iam_permissions] calls.
4780    ///
4781    /// # Example
4782    /// ```
4783    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::TestIamPermissions;
4784    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4785    ///
4786    /// let builder = prepare_request_builder();
4787    /// let response = builder.send().await?;
4788    /// # Ok(()) }
4789    ///
4790    /// fn prepare_request_builder() -> TestIamPermissions {
4791    ///   # panic!();
4792    ///   // ... details omitted ...
4793    /// }
4794    /// ```
4795    #[derive(Clone, Debug)]
4796    pub struct TestIamPermissions(
4797        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4798    );
4799
4800    impl TestIamPermissions {
4801        pub(crate) fn new(
4802            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4803        ) -> Self {
4804            Self(RequestBuilder::new(stub))
4805        }
4806
4807        /// Sets the full request, replacing any prior values.
4808        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4809            mut self,
4810            v: V,
4811        ) -> Self {
4812            self.0.request = v.into();
4813            self
4814        }
4815
4816        /// Sets all the options, replacing any prior values.
4817        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4818            self.0.options = v.into();
4819            self
4820        }
4821
4822        /// Sends the request.
4823        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4824            (*self.0.stub)
4825                .test_iam_permissions(self.0.request, self.0.options)
4826                .await
4827                .map(crate::Response::into_body)
4828        }
4829
4830        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
4831        ///
4832        /// This is a **required** field for requests.
4833        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4834            self.0.request.resource = v.into();
4835            self
4836        }
4837
4838        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
4839        ///
4840        /// This is a **required** field for requests.
4841        pub fn set_permissions<T, V>(mut self, v: T) -> Self
4842        where
4843            T: std::iter::IntoIterator<Item = V>,
4844            V: std::convert::Into<std::string::String>,
4845        {
4846            use std::iter::Iterator;
4847            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4848            self
4849        }
4850    }
4851
4852    #[doc(hidden)]
4853    impl crate::RequestBuilder for TestIamPermissions {
4854        fn request_options(&mut self) -> &mut crate::RequestOptions {
4855            &mut self.0.options
4856        }
4857    }
4858
4859    /// The request builder for [DnsThreatDetectorService::list_operations][crate::client::DnsThreatDetectorService::list_operations] calls.
4860    ///
4861    /// # Example
4862    /// ```
4863    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::ListOperations;
4864    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4865    /// use google_cloud_gax::paginator::ItemPaginator;
4866    ///
4867    /// let builder = prepare_request_builder();
4868    /// let mut items = builder.by_item();
4869    /// while let Some(result) = items.next().await {
4870    ///   let item = result?;
4871    /// }
4872    /// # Ok(()) }
4873    ///
4874    /// fn prepare_request_builder() -> ListOperations {
4875    ///   # panic!();
4876    ///   // ... details omitted ...
4877    /// }
4878    /// ```
4879    #[derive(Clone, Debug)]
4880    pub struct ListOperations(
4881        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4882    );
4883
4884    impl ListOperations {
4885        pub(crate) fn new(
4886            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4887        ) -> Self {
4888            Self(RequestBuilder::new(stub))
4889        }
4890
4891        /// Sets the full request, replacing any prior values.
4892        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4893            mut self,
4894            v: V,
4895        ) -> Self {
4896            self.0.request = v.into();
4897            self
4898        }
4899
4900        /// Sets all the options, replacing any prior values.
4901        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4902            self.0.options = v.into();
4903            self
4904        }
4905
4906        /// Sends the request.
4907        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4908            (*self.0.stub)
4909                .list_operations(self.0.request, self.0.options)
4910                .await
4911                .map(crate::Response::into_body)
4912        }
4913
4914        /// Streams each page in the collection.
4915        pub fn by_page(
4916            self,
4917        ) -> impl google_cloud_gax::paginator::Paginator<
4918            google_cloud_longrunning::model::ListOperationsResponse,
4919            crate::Error,
4920        > {
4921            use std::clone::Clone;
4922            let token = self.0.request.page_token.clone();
4923            let execute = move |token: String| {
4924                let mut builder = self.clone();
4925                builder.0.request = builder.0.request.set_page_token(token);
4926                builder.send()
4927            };
4928            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4929        }
4930
4931        /// Streams each item in the collection.
4932        pub fn by_item(
4933            self,
4934        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4935            google_cloud_longrunning::model::ListOperationsResponse,
4936            crate::Error,
4937        > {
4938            use google_cloud_gax::paginator::Paginator;
4939            self.by_page().items()
4940        }
4941
4942        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
4943        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4944            self.0.request.name = v.into();
4945            self
4946        }
4947
4948        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
4949        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4950            self.0.request.filter = v.into();
4951            self
4952        }
4953
4954        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
4955        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4956            self.0.request.page_size = v.into();
4957            self
4958        }
4959
4960        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
4961        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4962            self.0.request.page_token = v.into();
4963            self
4964        }
4965
4966        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
4967        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4968            self.0.request.return_partial_success = v.into();
4969            self
4970        }
4971    }
4972
4973    #[doc(hidden)]
4974    impl crate::RequestBuilder for ListOperations {
4975        fn request_options(&mut self) -> &mut crate::RequestOptions {
4976            &mut self.0.options
4977        }
4978    }
4979
4980    /// The request builder for [DnsThreatDetectorService::get_operation][crate::client::DnsThreatDetectorService::get_operation] calls.
4981    ///
4982    /// # Example
4983    /// ```
4984    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetOperation;
4985    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4986    ///
4987    /// let builder = prepare_request_builder();
4988    /// let response = builder.send().await?;
4989    /// # Ok(()) }
4990    ///
4991    /// fn prepare_request_builder() -> GetOperation {
4992    ///   # panic!();
4993    ///   // ... details omitted ...
4994    /// }
4995    /// ```
4996    #[derive(Clone, Debug)]
4997    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4998
4999    impl GetOperation {
5000        pub(crate) fn new(
5001            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
5002        ) -> Self {
5003            Self(RequestBuilder::new(stub))
5004        }
5005
5006        /// Sets the full request, replacing any prior values.
5007        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5008            mut self,
5009            v: V,
5010        ) -> Self {
5011            self.0.request = v.into();
5012            self
5013        }
5014
5015        /// Sets all the options, replacing any prior values.
5016        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5017            self.0.options = v.into();
5018            self
5019        }
5020
5021        /// Sends the request.
5022        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5023            (*self.0.stub)
5024                .get_operation(self.0.request, self.0.options)
5025                .await
5026                .map(crate::Response::into_body)
5027        }
5028
5029        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
5030        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5031            self.0.request.name = v.into();
5032            self
5033        }
5034    }
5035
5036    #[doc(hidden)]
5037    impl crate::RequestBuilder for GetOperation {
5038        fn request_options(&mut self) -> &mut crate::RequestOptions {
5039            &mut self.0.options
5040        }
5041    }
5042
5043    /// The request builder for [DnsThreatDetectorService::delete_operation][crate::client::DnsThreatDetectorService::delete_operation] calls.
5044    ///
5045    /// # Example
5046    /// ```
5047    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::DeleteOperation;
5048    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5049    ///
5050    /// let builder = prepare_request_builder();
5051    /// let response = builder.send().await?;
5052    /// # Ok(()) }
5053    ///
5054    /// fn prepare_request_builder() -> DeleteOperation {
5055    ///   # panic!();
5056    ///   // ... details omitted ...
5057    /// }
5058    /// ```
5059    #[derive(Clone, Debug)]
5060    pub struct DeleteOperation(
5061        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5062    );
5063
5064    impl DeleteOperation {
5065        pub(crate) fn new(
5066            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
5067        ) -> Self {
5068            Self(RequestBuilder::new(stub))
5069        }
5070
5071        /// Sets the full request, replacing any prior values.
5072        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5073            mut self,
5074            v: V,
5075        ) -> Self {
5076            self.0.request = v.into();
5077            self
5078        }
5079
5080        /// Sets all the options, replacing any prior values.
5081        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5082            self.0.options = v.into();
5083            self
5084        }
5085
5086        /// Sends the request.
5087        pub async fn send(self) -> Result<()> {
5088            (*self.0.stub)
5089                .delete_operation(self.0.request, self.0.options)
5090                .await
5091                .map(crate::Response::into_body)
5092        }
5093
5094        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
5095        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5096            self.0.request.name = v.into();
5097            self
5098        }
5099    }
5100
5101    #[doc(hidden)]
5102    impl crate::RequestBuilder for DeleteOperation {
5103        fn request_options(&mut self) -> &mut crate::RequestOptions {
5104            &mut self.0.options
5105        }
5106    }
5107
5108    /// The request builder for [DnsThreatDetectorService::cancel_operation][crate::client::DnsThreatDetectorService::cancel_operation] calls.
5109    ///
5110    /// # Example
5111    /// ```
5112    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::CancelOperation;
5113    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5114    ///
5115    /// let builder = prepare_request_builder();
5116    /// let response = builder.send().await?;
5117    /// # Ok(()) }
5118    ///
5119    /// fn prepare_request_builder() -> CancelOperation {
5120    ///   # panic!();
5121    ///   // ... details omitted ...
5122    /// }
5123    /// ```
5124    #[derive(Clone, Debug)]
5125    pub struct CancelOperation(
5126        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5127    );
5128
5129    impl CancelOperation {
5130        pub(crate) fn new(
5131            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
5132        ) -> Self {
5133            Self(RequestBuilder::new(stub))
5134        }
5135
5136        /// Sets the full request, replacing any prior values.
5137        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5138            mut self,
5139            v: V,
5140        ) -> Self {
5141            self.0.request = v.into();
5142            self
5143        }
5144
5145        /// Sets all the options, replacing any prior values.
5146        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5147            self.0.options = v.into();
5148            self
5149        }
5150
5151        /// Sends the request.
5152        pub async fn send(self) -> Result<()> {
5153            (*self.0.stub)
5154                .cancel_operation(self.0.request, self.0.options)
5155                .await
5156                .map(crate::Response::into_body)
5157        }
5158
5159        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5160        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5161            self.0.request.name = v.into();
5162            self
5163        }
5164    }
5165
5166    #[doc(hidden)]
5167    impl crate::RequestBuilder for CancelOperation {
5168        fn request_options(&mut self) -> &mut crate::RequestOptions {
5169            &mut self.0.options
5170        }
5171    }
5172}
5173
5174/// Request and client builders for [FirewallActivation][crate::client::FirewallActivation].
5175pub mod firewall_activation {
5176    use crate::Result;
5177
5178    /// A builder for [FirewallActivation][crate::client::FirewallActivation].
5179    ///
5180    /// ```
5181    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5182    /// # use google_cloud_networksecurity_v1::*;
5183    /// # use builder::firewall_activation::ClientBuilder;
5184    /// # use client::FirewallActivation;
5185    /// let builder : ClientBuilder = FirewallActivation::builder();
5186    /// let client = builder
5187    ///     .with_endpoint("https://networksecurity.googleapis.com")
5188    ///     .build().await?;
5189    /// # Ok(()) }
5190    /// ```
5191    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5192
5193    pub(crate) mod client {
5194        use super::super::super::client::FirewallActivation;
5195        pub struct Factory;
5196        impl crate::ClientFactory for Factory {
5197            type Client = FirewallActivation;
5198            type Credentials = gaxi::options::Credentials;
5199            async fn build(
5200                self,
5201                config: gaxi::options::ClientConfig,
5202            ) -> crate::ClientBuilderResult<Self::Client> {
5203                Self::Client::new(config).await
5204            }
5205        }
5206    }
5207
5208    /// Common implementation for [crate::client::FirewallActivation] request builders.
5209    #[derive(Clone, Debug)]
5210    pub(crate) struct RequestBuilder<R: std::default::Default> {
5211        stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5212        request: R,
5213        options: crate::RequestOptions,
5214    }
5215
5216    impl<R> RequestBuilder<R>
5217    where
5218        R: std::default::Default,
5219    {
5220        pub(crate) fn new(
5221            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5222        ) -> Self {
5223            Self {
5224                stub,
5225                request: R::default(),
5226                options: crate::RequestOptions::default(),
5227            }
5228        }
5229    }
5230
5231    /// The request builder for [FirewallActivation::list_firewall_endpoints][crate::client::FirewallActivation::list_firewall_endpoints] calls.
5232    ///
5233    /// # Example
5234    /// ```
5235    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListFirewallEndpoints;
5236    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5237    /// use google_cloud_gax::paginator::ItemPaginator;
5238    ///
5239    /// let builder = prepare_request_builder();
5240    /// let mut items = builder.by_item();
5241    /// while let Some(result) = items.next().await {
5242    ///   let item = result?;
5243    /// }
5244    /// # Ok(()) }
5245    ///
5246    /// fn prepare_request_builder() -> ListFirewallEndpoints {
5247    ///   # panic!();
5248    ///   // ... details omitted ...
5249    /// }
5250    /// ```
5251    #[derive(Clone, Debug)]
5252    pub struct ListFirewallEndpoints(RequestBuilder<crate::model::ListFirewallEndpointsRequest>);
5253
5254    impl ListFirewallEndpoints {
5255        pub(crate) fn new(
5256            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5257        ) -> Self {
5258            Self(RequestBuilder::new(stub))
5259        }
5260
5261        /// Sets the full request, replacing any prior values.
5262        pub fn with_request<V: Into<crate::model::ListFirewallEndpointsRequest>>(
5263            mut self,
5264            v: V,
5265        ) -> Self {
5266            self.0.request = v.into();
5267            self
5268        }
5269
5270        /// Sets all the options, replacing any prior values.
5271        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5272            self.0.options = v.into();
5273            self
5274        }
5275
5276        /// Sends the request.
5277        pub async fn send(self) -> Result<crate::model::ListFirewallEndpointsResponse> {
5278            (*self.0.stub)
5279                .list_firewall_endpoints(self.0.request, self.0.options)
5280                .await
5281                .map(crate::Response::into_body)
5282        }
5283
5284        /// Streams each page in the collection.
5285        pub fn by_page(
5286            self,
5287        ) -> impl google_cloud_gax::paginator::Paginator<
5288            crate::model::ListFirewallEndpointsResponse,
5289            crate::Error,
5290        > {
5291            use std::clone::Clone;
5292            let token = self.0.request.page_token.clone();
5293            let execute = move |token: String| {
5294                let mut builder = self.clone();
5295                builder.0.request = builder.0.request.set_page_token(token);
5296                builder.send()
5297            };
5298            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5299        }
5300
5301        /// Streams each item in the collection.
5302        pub fn by_item(
5303            self,
5304        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5305            crate::model::ListFirewallEndpointsResponse,
5306            crate::Error,
5307        > {
5308            use google_cloud_gax::paginator::Paginator;
5309            self.by_page().items()
5310        }
5311
5312        /// Sets the value of [parent][crate::model::ListFirewallEndpointsRequest::parent].
5313        ///
5314        /// This is a **required** field for requests.
5315        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5316            self.0.request.parent = v.into();
5317            self
5318        }
5319
5320        /// Sets the value of [page_size][crate::model::ListFirewallEndpointsRequest::page_size].
5321        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5322            self.0.request.page_size = v.into();
5323            self
5324        }
5325
5326        /// Sets the value of [page_token][crate::model::ListFirewallEndpointsRequest::page_token].
5327        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5328            self.0.request.page_token = v.into();
5329            self
5330        }
5331
5332        /// Sets the value of [filter][crate::model::ListFirewallEndpointsRequest::filter].
5333        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5334            self.0.request.filter = v.into();
5335            self
5336        }
5337
5338        /// Sets the value of [order_by][crate::model::ListFirewallEndpointsRequest::order_by].
5339        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5340            self.0.request.order_by = v.into();
5341            self
5342        }
5343    }
5344
5345    #[doc(hidden)]
5346    impl crate::RequestBuilder for ListFirewallEndpoints {
5347        fn request_options(&mut self) -> &mut crate::RequestOptions {
5348            &mut self.0.options
5349        }
5350    }
5351
5352    /// The request builder for [FirewallActivation::list_project_firewall_endpoints][crate::client::FirewallActivation::list_project_firewall_endpoints] calls.
5353    ///
5354    /// # Example
5355    /// ```
5356    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListProjectFirewallEndpoints;
5357    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5358    /// use google_cloud_gax::paginator::ItemPaginator;
5359    ///
5360    /// let builder = prepare_request_builder();
5361    /// let mut items = builder.by_item();
5362    /// while let Some(result) = items.next().await {
5363    ///   let item = result?;
5364    /// }
5365    /// # Ok(()) }
5366    ///
5367    /// fn prepare_request_builder() -> ListProjectFirewallEndpoints {
5368    ///   # panic!();
5369    ///   // ... details omitted ...
5370    /// }
5371    /// ```
5372    #[derive(Clone, Debug)]
5373    pub struct ListProjectFirewallEndpoints(
5374        RequestBuilder<crate::model::ListFirewallEndpointsRequest>,
5375    );
5376
5377    impl ListProjectFirewallEndpoints {
5378        pub(crate) fn new(
5379            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5380        ) -> Self {
5381            Self(RequestBuilder::new(stub))
5382        }
5383
5384        /// Sets the full request, replacing any prior values.
5385        pub fn with_request<V: Into<crate::model::ListFirewallEndpointsRequest>>(
5386            mut self,
5387            v: V,
5388        ) -> Self {
5389            self.0.request = v.into();
5390            self
5391        }
5392
5393        /// Sets all the options, replacing any prior values.
5394        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5395            self.0.options = v.into();
5396            self
5397        }
5398
5399        /// Sends the request.
5400        pub async fn send(self) -> Result<crate::model::ListFirewallEndpointsResponse> {
5401            (*self.0.stub)
5402                .list_project_firewall_endpoints(self.0.request, self.0.options)
5403                .await
5404                .map(crate::Response::into_body)
5405        }
5406
5407        /// Streams each page in the collection.
5408        pub fn by_page(
5409            self,
5410        ) -> impl google_cloud_gax::paginator::Paginator<
5411            crate::model::ListFirewallEndpointsResponse,
5412            crate::Error,
5413        > {
5414            use std::clone::Clone;
5415            let token = self.0.request.page_token.clone();
5416            let execute = move |token: String| {
5417                let mut builder = self.clone();
5418                builder.0.request = builder.0.request.set_page_token(token);
5419                builder.send()
5420            };
5421            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5422        }
5423
5424        /// Streams each item in the collection.
5425        pub fn by_item(
5426            self,
5427        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5428            crate::model::ListFirewallEndpointsResponse,
5429            crate::Error,
5430        > {
5431            use google_cloud_gax::paginator::Paginator;
5432            self.by_page().items()
5433        }
5434
5435        /// Sets the value of [parent][crate::model::ListFirewallEndpointsRequest::parent].
5436        ///
5437        /// This is a **required** field for requests.
5438        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5439            self.0.request.parent = v.into();
5440            self
5441        }
5442
5443        /// Sets the value of [page_size][crate::model::ListFirewallEndpointsRequest::page_size].
5444        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5445            self.0.request.page_size = v.into();
5446            self
5447        }
5448
5449        /// Sets the value of [page_token][crate::model::ListFirewallEndpointsRequest::page_token].
5450        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5451            self.0.request.page_token = v.into();
5452            self
5453        }
5454
5455        /// Sets the value of [filter][crate::model::ListFirewallEndpointsRequest::filter].
5456        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5457            self.0.request.filter = v.into();
5458            self
5459        }
5460
5461        /// Sets the value of [order_by][crate::model::ListFirewallEndpointsRequest::order_by].
5462        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5463            self.0.request.order_by = v.into();
5464            self
5465        }
5466    }
5467
5468    #[doc(hidden)]
5469    impl crate::RequestBuilder for ListProjectFirewallEndpoints {
5470        fn request_options(&mut self) -> &mut crate::RequestOptions {
5471            &mut self.0.options
5472        }
5473    }
5474
5475    /// The request builder for [FirewallActivation::get_firewall_endpoint][crate::client::FirewallActivation::get_firewall_endpoint] calls.
5476    ///
5477    /// # Example
5478    /// ```
5479    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetFirewallEndpoint;
5480    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5481    ///
5482    /// let builder = prepare_request_builder();
5483    /// let response = builder.send().await?;
5484    /// # Ok(()) }
5485    ///
5486    /// fn prepare_request_builder() -> GetFirewallEndpoint {
5487    ///   # panic!();
5488    ///   // ... details omitted ...
5489    /// }
5490    /// ```
5491    #[derive(Clone, Debug)]
5492    pub struct GetFirewallEndpoint(RequestBuilder<crate::model::GetFirewallEndpointRequest>);
5493
5494    impl GetFirewallEndpoint {
5495        pub(crate) fn new(
5496            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5497        ) -> Self {
5498            Self(RequestBuilder::new(stub))
5499        }
5500
5501        /// Sets the full request, replacing any prior values.
5502        pub fn with_request<V: Into<crate::model::GetFirewallEndpointRequest>>(
5503            mut self,
5504            v: V,
5505        ) -> Self {
5506            self.0.request = v.into();
5507            self
5508        }
5509
5510        /// Sets all the options, replacing any prior values.
5511        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5512            self.0.options = v.into();
5513            self
5514        }
5515
5516        /// Sends the request.
5517        pub async fn send(self) -> Result<crate::model::FirewallEndpoint> {
5518            (*self.0.stub)
5519                .get_firewall_endpoint(self.0.request, self.0.options)
5520                .await
5521                .map(crate::Response::into_body)
5522        }
5523
5524        /// Sets the value of [name][crate::model::GetFirewallEndpointRequest::name].
5525        ///
5526        /// This is a **required** field for requests.
5527        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5528            self.0.request.name = v.into();
5529            self
5530        }
5531    }
5532
5533    #[doc(hidden)]
5534    impl crate::RequestBuilder for GetFirewallEndpoint {
5535        fn request_options(&mut self) -> &mut crate::RequestOptions {
5536            &mut self.0.options
5537        }
5538    }
5539
5540    /// The request builder for [FirewallActivation::get_project_firewall_endpoint][crate::client::FirewallActivation::get_project_firewall_endpoint] calls.
5541    ///
5542    /// # Example
5543    /// ```
5544    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetProjectFirewallEndpoint;
5545    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5546    ///
5547    /// let builder = prepare_request_builder();
5548    /// let response = builder.send().await?;
5549    /// # Ok(()) }
5550    ///
5551    /// fn prepare_request_builder() -> GetProjectFirewallEndpoint {
5552    ///   # panic!();
5553    ///   // ... details omitted ...
5554    /// }
5555    /// ```
5556    #[derive(Clone, Debug)]
5557    pub struct GetProjectFirewallEndpoint(RequestBuilder<crate::model::GetFirewallEndpointRequest>);
5558
5559    impl GetProjectFirewallEndpoint {
5560        pub(crate) fn new(
5561            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5562        ) -> Self {
5563            Self(RequestBuilder::new(stub))
5564        }
5565
5566        /// Sets the full request, replacing any prior values.
5567        pub fn with_request<V: Into<crate::model::GetFirewallEndpointRequest>>(
5568            mut self,
5569            v: V,
5570        ) -> Self {
5571            self.0.request = v.into();
5572            self
5573        }
5574
5575        /// Sets all the options, replacing any prior values.
5576        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5577            self.0.options = v.into();
5578            self
5579        }
5580
5581        /// Sends the request.
5582        pub async fn send(self) -> Result<crate::model::FirewallEndpoint> {
5583            (*self.0.stub)
5584                .get_project_firewall_endpoint(self.0.request, self.0.options)
5585                .await
5586                .map(crate::Response::into_body)
5587        }
5588
5589        /// Sets the value of [name][crate::model::GetFirewallEndpointRequest::name].
5590        ///
5591        /// This is a **required** field for requests.
5592        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5593            self.0.request.name = v.into();
5594            self
5595        }
5596    }
5597
5598    #[doc(hidden)]
5599    impl crate::RequestBuilder for GetProjectFirewallEndpoint {
5600        fn request_options(&mut self) -> &mut crate::RequestOptions {
5601            &mut self.0.options
5602        }
5603    }
5604
5605    /// The request builder for [FirewallActivation::create_firewall_endpoint][crate::client::FirewallActivation::create_firewall_endpoint] calls.
5606    ///
5607    /// # Example
5608    /// ```
5609    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::CreateFirewallEndpoint;
5610    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5611    /// use google_cloud_lro::Poller;
5612    ///
5613    /// let builder = prepare_request_builder();
5614    /// let response = builder.poller().until_done().await?;
5615    /// # Ok(()) }
5616    ///
5617    /// fn prepare_request_builder() -> CreateFirewallEndpoint {
5618    ///   # panic!();
5619    ///   // ... details omitted ...
5620    /// }
5621    /// ```
5622    #[derive(Clone, Debug)]
5623    pub struct CreateFirewallEndpoint(RequestBuilder<crate::model::CreateFirewallEndpointRequest>);
5624
5625    impl CreateFirewallEndpoint {
5626        pub(crate) fn new(
5627            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5628        ) -> Self {
5629            Self(RequestBuilder::new(stub))
5630        }
5631
5632        /// Sets the full request, replacing any prior values.
5633        pub fn with_request<V: Into<crate::model::CreateFirewallEndpointRequest>>(
5634            mut self,
5635            v: V,
5636        ) -> Self {
5637            self.0.request = v.into();
5638            self
5639        }
5640
5641        /// Sets all the options, replacing any prior values.
5642        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5643            self.0.options = v.into();
5644            self
5645        }
5646
5647        /// Sends the request.
5648        ///
5649        /// # Long running operations
5650        ///
5651        /// This starts, but does not poll, a longrunning operation. More information
5652        /// on [create_firewall_endpoint][crate::client::FirewallActivation::create_firewall_endpoint].
5653        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5654            (*self.0.stub)
5655                .create_firewall_endpoint(self.0.request, self.0.options)
5656                .await
5657                .map(crate::Response::into_body)
5658        }
5659
5660        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_firewall_endpoint`.
5661        pub fn poller(
5662            self,
5663        ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5664        {
5665            type Operation = google_cloud_lro::internal::Operation<
5666                crate::model::FirewallEndpoint,
5667                crate::model::OperationMetadata,
5668            >;
5669            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5670            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5671            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5672            if let Some(ref mut details) = poller_options.tracing {
5673                details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::create_firewall_endpoint::until_done";
5674            }
5675
5676            let stub = self.0.stub.clone();
5677            let mut options = self.0.options.clone();
5678            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5679            let query = move |name| {
5680                let stub = stub.clone();
5681                let options = options.clone();
5682                async {
5683                    let op = GetOperation::new(stub)
5684                        .set_name(name)
5685                        .with_options(options)
5686                        .send()
5687                        .await?;
5688                    Ok(Operation::new(op))
5689                }
5690            };
5691
5692            let start = move || async {
5693                let op = self.send().await?;
5694                Ok(Operation::new(op))
5695            };
5696
5697            use google_cloud_lro::internal::PollerExt;
5698            {
5699                google_cloud_lro::internal::new_poller(
5700                    polling_error_policy,
5701                    polling_backoff_policy,
5702                    start,
5703                    query,
5704                )
5705            }
5706            .with_options(poller_options)
5707        }
5708
5709        /// Sets the value of [parent][crate::model::CreateFirewallEndpointRequest::parent].
5710        ///
5711        /// This is a **required** field for requests.
5712        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5713            self.0.request.parent = v.into();
5714            self
5715        }
5716
5717        /// Sets the value of [firewall_endpoint_id][crate::model::CreateFirewallEndpointRequest::firewall_endpoint_id].
5718        ///
5719        /// This is a **required** field for requests.
5720        pub fn set_firewall_endpoint_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5721            self.0.request.firewall_endpoint_id = v.into();
5722            self
5723        }
5724
5725        /// Sets the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
5726        ///
5727        /// This is a **required** field for requests.
5728        pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5729        where
5730            T: std::convert::Into<crate::model::FirewallEndpoint>,
5731        {
5732            self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5733            self
5734        }
5735
5736        /// Sets or clears the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
5737        ///
5738        /// This is a **required** field for requests.
5739        pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5740        where
5741            T: std::convert::Into<crate::model::FirewallEndpoint>,
5742        {
5743            self.0.request.firewall_endpoint = v.map(|x| x.into());
5744            self
5745        }
5746
5747        /// Sets the value of [request_id][crate::model::CreateFirewallEndpointRequest::request_id].
5748        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5749            self.0.request.request_id = v.into();
5750            self
5751        }
5752    }
5753
5754    #[doc(hidden)]
5755    impl crate::RequestBuilder for CreateFirewallEndpoint {
5756        fn request_options(&mut self) -> &mut crate::RequestOptions {
5757            &mut self.0.options
5758        }
5759    }
5760
5761    /// The request builder for [FirewallActivation::create_project_firewall_endpoint][crate::client::FirewallActivation::create_project_firewall_endpoint] calls.
5762    ///
5763    /// # Example
5764    /// ```
5765    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::CreateProjectFirewallEndpoint;
5766    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5767    /// use google_cloud_lro::Poller;
5768    ///
5769    /// let builder = prepare_request_builder();
5770    /// let response = builder.poller().until_done().await?;
5771    /// # Ok(()) }
5772    ///
5773    /// fn prepare_request_builder() -> CreateProjectFirewallEndpoint {
5774    ///   # panic!();
5775    ///   // ... details omitted ...
5776    /// }
5777    /// ```
5778    #[derive(Clone, Debug)]
5779    pub struct CreateProjectFirewallEndpoint(
5780        RequestBuilder<crate::model::CreateFirewallEndpointRequest>,
5781    );
5782
5783    impl CreateProjectFirewallEndpoint {
5784        pub(crate) fn new(
5785            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5786        ) -> Self {
5787            Self(RequestBuilder::new(stub))
5788        }
5789
5790        /// Sets the full request, replacing any prior values.
5791        pub fn with_request<V: Into<crate::model::CreateFirewallEndpointRequest>>(
5792            mut self,
5793            v: V,
5794        ) -> Self {
5795            self.0.request = v.into();
5796            self
5797        }
5798
5799        /// Sets all the options, replacing any prior values.
5800        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5801            self.0.options = v.into();
5802            self
5803        }
5804
5805        /// Sends the request.
5806        ///
5807        /// # Long running operations
5808        ///
5809        /// This starts, but does not poll, a longrunning operation. More information
5810        /// on [create_project_firewall_endpoint][crate::client::FirewallActivation::create_project_firewall_endpoint].
5811        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5812            (*self.0.stub)
5813                .create_project_firewall_endpoint(self.0.request, self.0.options)
5814                .await
5815                .map(crate::Response::into_body)
5816        }
5817
5818        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_project_firewall_endpoint`.
5819        pub fn poller(
5820            self,
5821        ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5822        {
5823            type Operation = google_cloud_lro::internal::Operation<
5824                crate::model::FirewallEndpoint,
5825                crate::model::OperationMetadata,
5826            >;
5827            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5828            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5829            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5830            if let Some(ref mut details) = poller_options.tracing {
5831                details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::create_project_firewall_endpoint::until_done";
5832            }
5833
5834            let stub = self.0.stub.clone();
5835            let mut options = self.0.options.clone();
5836            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5837            let query = move |name| {
5838                let stub = stub.clone();
5839                let options = options.clone();
5840                async {
5841                    let op = GetOperation::new(stub)
5842                        .set_name(name)
5843                        .with_options(options)
5844                        .send()
5845                        .await?;
5846                    Ok(Operation::new(op))
5847                }
5848            };
5849
5850            let start = move || async {
5851                let op = self.send().await?;
5852                Ok(Operation::new(op))
5853            };
5854
5855            use google_cloud_lro::internal::PollerExt;
5856            {
5857                google_cloud_lro::internal::new_poller(
5858                    polling_error_policy,
5859                    polling_backoff_policy,
5860                    start,
5861                    query,
5862                )
5863            }
5864            .with_options(poller_options)
5865        }
5866
5867        /// Sets the value of [parent][crate::model::CreateFirewallEndpointRequest::parent].
5868        ///
5869        /// This is a **required** field for requests.
5870        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5871            self.0.request.parent = v.into();
5872            self
5873        }
5874
5875        /// Sets the value of [firewall_endpoint_id][crate::model::CreateFirewallEndpointRequest::firewall_endpoint_id].
5876        ///
5877        /// This is a **required** field for requests.
5878        pub fn set_firewall_endpoint_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5879            self.0.request.firewall_endpoint_id = v.into();
5880            self
5881        }
5882
5883        /// Sets the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
5884        ///
5885        /// This is a **required** field for requests.
5886        pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5887        where
5888            T: std::convert::Into<crate::model::FirewallEndpoint>,
5889        {
5890            self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5891            self
5892        }
5893
5894        /// Sets or clears the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
5895        ///
5896        /// This is a **required** field for requests.
5897        pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5898        where
5899            T: std::convert::Into<crate::model::FirewallEndpoint>,
5900        {
5901            self.0.request.firewall_endpoint = v.map(|x| x.into());
5902            self
5903        }
5904
5905        /// Sets the value of [request_id][crate::model::CreateFirewallEndpointRequest::request_id].
5906        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5907            self.0.request.request_id = v.into();
5908            self
5909        }
5910    }
5911
5912    #[doc(hidden)]
5913    impl crate::RequestBuilder for CreateProjectFirewallEndpoint {
5914        fn request_options(&mut self) -> &mut crate::RequestOptions {
5915            &mut self.0.options
5916        }
5917    }
5918
5919    /// The request builder for [FirewallActivation::delete_firewall_endpoint][crate::client::FirewallActivation::delete_firewall_endpoint] calls.
5920    ///
5921    /// # Example
5922    /// ```
5923    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::DeleteFirewallEndpoint;
5924    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5925    /// use google_cloud_lro::Poller;
5926    ///
5927    /// let builder = prepare_request_builder();
5928    /// let response = builder.poller().until_done().await?;
5929    /// # Ok(()) }
5930    ///
5931    /// fn prepare_request_builder() -> DeleteFirewallEndpoint {
5932    ///   # panic!();
5933    ///   // ... details omitted ...
5934    /// }
5935    /// ```
5936    #[derive(Clone, Debug)]
5937    pub struct DeleteFirewallEndpoint(RequestBuilder<crate::model::DeleteFirewallEndpointRequest>);
5938
5939    impl DeleteFirewallEndpoint {
5940        pub(crate) fn new(
5941            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5942        ) -> Self {
5943            Self(RequestBuilder::new(stub))
5944        }
5945
5946        /// Sets the full request, replacing any prior values.
5947        pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointRequest>>(
5948            mut self,
5949            v: V,
5950        ) -> Self {
5951            self.0.request = v.into();
5952            self
5953        }
5954
5955        /// Sets all the options, replacing any prior values.
5956        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5957            self.0.options = v.into();
5958            self
5959        }
5960
5961        /// Sends the request.
5962        ///
5963        /// # Long running operations
5964        ///
5965        /// This starts, but does not poll, a longrunning operation. More information
5966        /// on [delete_firewall_endpoint][crate::client::FirewallActivation::delete_firewall_endpoint].
5967        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5968            (*self.0.stub)
5969                .delete_firewall_endpoint(self.0.request, self.0.options)
5970                .await
5971                .map(crate::Response::into_body)
5972        }
5973
5974        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_firewall_endpoint`.
5975        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5976            type Operation =
5977                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5978            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5979            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5980            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5981            if let Some(ref mut details) = poller_options.tracing {
5982                details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::delete_firewall_endpoint::until_done";
5983            }
5984
5985            let stub = self.0.stub.clone();
5986            let mut options = self.0.options.clone();
5987            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5988            let query = move |name| {
5989                let stub = stub.clone();
5990                let options = options.clone();
5991                async {
5992                    let op = GetOperation::new(stub)
5993                        .set_name(name)
5994                        .with_options(options)
5995                        .send()
5996                        .await?;
5997                    Ok(Operation::new(op))
5998                }
5999            };
6000
6001            let start = move || async {
6002                let op = self.send().await?;
6003                Ok(Operation::new(op))
6004            };
6005
6006            use google_cloud_lro::internal::PollerExt;
6007            {
6008                google_cloud_lro::internal::new_unit_response_poller(
6009                    polling_error_policy,
6010                    polling_backoff_policy,
6011                    start,
6012                    query,
6013                )
6014            }
6015            .with_options(poller_options)
6016        }
6017
6018        /// Sets the value of [name][crate::model::DeleteFirewallEndpointRequest::name].
6019        ///
6020        /// This is a **required** field for requests.
6021        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6022            self.0.request.name = v.into();
6023            self
6024        }
6025
6026        /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointRequest::request_id].
6027        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6028            self.0.request.request_id = v.into();
6029            self
6030        }
6031    }
6032
6033    #[doc(hidden)]
6034    impl crate::RequestBuilder for DeleteFirewallEndpoint {
6035        fn request_options(&mut self) -> &mut crate::RequestOptions {
6036            &mut self.0.options
6037        }
6038    }
6039
6040    /// The request builder for [FirewallActivation::delete_project_firewall_endpoint][crate::client::FirewallActivation::delete_project_firewall_endpoint] calls.
6041    ///
6042    /// # Example
6043    /// ```
6044    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::DeleteProjectFirewallEndpoint;
6045    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6046    /// use google_cloud_lro::Poller;
6047    ///
6048    /// let builder = prepare_request_builder();
6049    /// let response = builder.poller().until_done().await?;
6050    /// # Ok(()) }
6051    ///
6052    /// fn prepare_request_builder() -> DeleteProjectFirewallEndpoint {
6053    ///   # panic!();
6054    ///   // ... details omitted ...
6055    /// }
6056    /// ```
6057    #[derive(Clone, Debug)]
6058    pub struct DeleteProjectFirewallEndpoint(
6059        RequestBuilder<crate::model::DeleteFirewallEndpointRequest>,
6060    );
6061
6062    impl DeleteProjectFirewallEndpoint {
6063        pub(crate) fn new(
6064            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6065        ) -> Self {
6066            Self(RequestBuilder::new(stub))
6067        }
6068
6069        /// Sets the full request, replacing any prior values.
6070        pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointRequest>>(
6071            mut self,
6072            v: V,
6073        ) -> Self {
6074            self.0.request = v.into();
6075            self
6076        }
6077
6078        /// Sets all the options, replacing any prior values.
6079        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6080            self.0.options = v.into();
6081            self
6082        }
6083
6084        /// Sends the request.
6085        ///
6086        /// # Long running operations
6087        ///
6088        /// This starts, but does not poll, a longrunning operation. More information
6089        /// on [delete_project_firewall_endpoint][crate::client::FirewallActivation::delete_project_firewall_endpoint].
6090        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6091            (*self.0.stub)
6092                .delete_project_firewall_endpoint(self.0.request, self.0.options)
6093                .await
6094                .map(crate::Response::into_body)
6095        }
6096
6097        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_project_firewall_endpoint`.
6098        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6099            type Operation =
6100                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6101            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6102            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6103            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6104            if let Some(ref mut details) = poller_options.tracing {
6105                details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::delete_project_firewall_endpoint::until_done";
6106            }
6107
6108            let stub = self.0.stub.clone();
6109            let mut options = self.0.options.clone();
6110            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6111            let query = move |name| {
6112                let stub = stub.clone();
6113                let options = options.clone();
6114                async {
6115                    let op = GetOperation::new(stub)
6116                        .set_name(name)
6117                        .with_options(options)
6118                        .send()
6119                        .await?;
6120                    Ok(Operation::new(op))
6121                }
6122            };
6123
6124            let start = move || async {
6125                let op = self.send().await?;
6126                Ok(Operation::new(op))
6127            };
6128
6129            use google_cloud_lro::internal::PollerExt;
6130            {
6131                google_cloud_lro::internal::new_unit_response_poller(
6132                    polling_error_policy,
6133                    polling_backoff_policy,
6134                    start,
6135                    query,
6136                )
6137            }
6138            .with_options(poller_options)
6139        }
6140
6141        /// Sets the value of [name][crate::model::DeleteFirewallEndpointRequest::name].
6142        ///
6143        /// This is a **required** field for requests.
6144        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6145            self.0.request.name = v.into();
6146            self
6147        }
6148
6149        /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointRequest::request_id].
6150        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6151            self.0.request.request_id = v.into();
6152            self
6153        }
6154    }
6155
6156    #[doc(hidden)]
6157    impl crate::RequestBuilder for DeleteProjectFirewallEndpoint {
6158        fn request_options(&mut self) -> &mut crate::RequestOptions {
6159            &mut self.0.options
6160        }
6161    }
6162
6163    /// The request builder for [FirewallActivation::update_firewall_endpoint][crate::client::FirewallActivation::update_firewall_endpoint] calls.
6164    ///
6165    /// # Example
6166    /// ```
6167    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::UpdateFirewallEndpoint;
6168    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6169    /// use google_cloud_lro::Poller;
6170    ///
6171    /// let builder = prepare_request_builder();
6172    /// let response = builder.poller().until_done().await?;
6173    /// # Ok(()) }
6174    ///
6175    /// fn prepare_request_builder() -> UpdateFirewallEndpoint {
6176    ///   # panic!();
6177    ///   // ... details omitted ...
6178    /// }
6179    /// ```
6180    #[derive(Clone, Debug)]
6181    pub struct UpdateFirewallEndpoint(RequestBuilder<crate::model::UpdateFirewallEndpointRequest>);
6182
6183    impl UpdateFirewallEndpoint {
6184        pub(crate) fn new(
6185            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6186        ) -> Self {
6187            Self(RequestBuilder::new(stub))
6188        }
6189
6190        /// Sets the full request, replacing any prior values.
6191        pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointRequest>>(
6192            mut self,
6193            v: V,
6194        ) -> Self {
6195            self.0.request = v.into();
6196            self
6197        }
6198
6199        /// Sets all the options, replacing any prior values.
6200        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6201            self.0.options = v.into();
6202            self
6203        }
6204
6205        /// Sends the request.
6206        ///
6207        /// # Long running operations
6208        ///
6209        /// This starts, but does not poll, a longrunning operation. More information
6210        /// on [update_firewall_endpoint][crate::client::FirewallActivation::update_firewall_endpoint].
6211        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6212            (*self.0.stub)
6213                .update_firewall_endpoint(self.0.request, self.0.options)
6214                .await
6215                .map(crate::Response::into_body)
6216        }
6217
6218        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_firewall_endpoint`.
6219        pub fn poller(
6220            self,
6221        ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
6222        {
6223            type Operation = google_cloud_lro::internal::Operation<
6224                crate::model::FirewallEndpoint,
6225                crate::model::OperationMetadata,
6226            >;
6227            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6228            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6229            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6230            if let Some(ref mut details) = poller_options.tracing {
6231                details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::update_firewall_endpoint::until_done";
6232            }
6233
6234            let stub = self.0.stub.clone();
6235            let mut options = self.0.options.clone();
6236            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6237            let query = move |name| {
6238                let stub = stub.clone();
6239                let options = options.clone();
6240                async {
6241                    let op = GetOperation::new(stub)
6242                        .set_name(name)
6243                        .with_options(options)
6244                        .send()
6245                        .await?;
6246                    Ok(Operation::new(op))
6247                }
6248            };
6249
6250            let start = move || async {
6251                let op = self.send().await?;
6252                Ok(Operation::new(op))
6253            };
6254
6255            use google_cloud_lro::internal::PollerExt;
6256            {
6257                google_cloud_lro::internal::new_poller(
6258                    polling_error_policy,
6259                    polling_backoff_policy,
6260                    start,
6261                    query,
6262                )
6263            }
6264            .with_options(poller_options)
6265        }
6266
6267        /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
6268        ///
6269        /// This is a **required** field for requests.
6270        pub fn set_update_mask<T>(mut self, v: T) -> Self
6271        where
6272            T: std::convert::Into<wkt::FieldMask>,
6273        {
6274            self.0.request.update_mask = std::option::Option::Some(v.into());
6275            self
6276        }
6277
6278        /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
6279        ///
6280        /// This is a **required** field for requests.
6281        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6282        where
6283            T: std::convert::Into<wkt::FieldMask>,
6284        {
6285            self.0.request.update_mask = v.map(|x| x.into());
6286            self
6287        }
6288
6289        /// Sets the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
6290        ///
6291        /// This is a **required** field for requests.
6292        pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
6293        where
6294            T: std::convert::Into<crate::model::FirewallEndpoint>,
6295        {
6296            self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
6297            self
6298        }
6299
6300        /// Sets or clears the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
6301        ///
6302        /// This is a **required** field for requests.
6303        pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
6304        where
6305            T: std::convert::Into<crate::model::FirewallEndpoint>,
6306        {
6307            self.0.request.firewall_endpoint = v.map(|x| x.into());
6308            self
6309        }
6310
6311        /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointRequest::request_id].
6312        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6313            self.0.request.request_id = v.into();
6314            self
6315        }
6316    }
6317
6318    #[doc(hidden)]
6319    impl crate::RequestBuilder for UpdateFirewallEndpoint {
6320        fn request_options(&mut self) -> &mut crate::RequestOptions {
6321            &mut self.0.options
6322        }
6323    }
6324
6325    /// The request builder for [FirewallActivation::update_project_firewall_endpoint][crate::client::FirewallActivation::update_project_firewall_endpoint] calls.
6326    ///
6327    /// # Example
6328    /// ```
6329    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::UpdateProjectFirewallEndpoint;
6330    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6331    /// use google_cloud_lro::Poller;
6332    ///
6333    /// let builder = prepare_request_builder();
6334    /// let response = builder.poller().until_done().await?;
6335    /// # Ok(()) }
6336    ///
6337    /// fn prepare_request_builder() -> UpdateProjectFirewallEndpoint {
6338    ///   # panic!();
6339    ///   // ... details omitted ...
6340    /// }
6341    /// ```
6342    #[derive(Clone, Debug)]
6343    pub struct UpdateProjectFirewallEndpoint(
6344        RequestBuilder<crate::model::UpdateFirewallEndpointRequest>,
6345    );
6346
6347    impl UpdateProjectFirewallEndpoint {
6348        pub(crate) fn new(
6349            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6350        ) -> Self {
6351            Self(RequestBuilder::new(stub))
6352        }
6353
6354        /// Sets the full request, replacing any prior values.
6355        pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointRequest>>(
6356            mut self,
6357            v: V,
6358        ) -> Self {
6359            self.0.request = v.into();
6360            self
6361        }
6362
6363        /// Sets all the options, replacing any prior values.
6364        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6365            self.0.options = v.into();
6366            self
6367        }
6368
6369        /// Sends the request.
6370        ///
6371        /// # Long running operations
6372        ///
6373        /// This starts, but does not poll, a longrunning operation. More information
6374        /// on [update_project_firewall_endpoint][crate::client::FirewallActivation::update_project_firewall_endpoint].
6375        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6376            (*self.0.stub)
6377                .update_project_firewall_endpoint(self.0.request, self.0.options)
6378                .await
6379                .map(crate::Response::into_body)
6380        }
6381
6382        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_project_firewall_endpoint`.
6383        pub fn poller(
6384            self,
6385        ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
6386        {
6387            type Operation = google_cloud_lro::internal::Operation<
6388                crate::model::FirewallEndpoint,
6389                crate::model::OperationMetadata,
6390            >;
6391            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6392            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6393            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6394            if let Some(ref mut details) = poller_options.tracing {
6395                details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::update_project_firewall_endpoint::until_done";
6396            }
6397
6398            let stub = self.0.stub.clone();
6399            let mut options = self.0.options.clone();
6400            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6401            let query = move |name| {
6402                let stub = stub.clone();
6403                let options = options.clone();
6404                async {
6405                    let op = GetOperation::new(stub)
6406                        .set_name(name)
6407                        .with_options(options)
6408                        .send()
6409                        .await?;
6410                    Ok(Operation::new(op))
6411                }
6412            };
6413
6414            let start = move || async {
6415                let op = self.send().await?;
6416                Ok(Operation::new(op))
6417            };
6418
6419            use google_cloud_lro::internal::PollerExt;
6420            {
6421                google_cloud_lro::internal::new_poller(
6422                    polling_error_policy,
6423                    polling_backoff_policy,
6424                    start,
6425                    query,
6426                )
6427            }
6428            .with_options(poller_options)
6429        }
6430
6431        /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
6432        ///
6433        /// This is a **required** field for requests.
6434        pub fn set_update_mask<T>(mut self, v: T) -> Self
6435        where
6436            T: std::convert::Into<wkt::FieldMask>,
6437        {
6438            self.0.request.update_mask = std::option::Option::Some(v.into());
6439            self
6440        }
6441
6442        /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
6443        ///
6444        /// This is a **required** field for requests.
6445        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6446        where
6447            T: std::convert::Into<wkt::FieldMask>,
6448        {
6449            self.0.request.update_mask = v.map(|x| x.into());
6450            self
6451        }
6452
6453        /// Sets the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
6454        ///
6455        /// This is a **required** field for requests.
6456        pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
6457        where
6458            T: std::convert::Into<crate::model::FirewallEndpoint>,
6459        {
6460            self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
6461            self
6462        }
6463
6464        /// Sets or clears the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
6465        ///
6466        /// This is a **required** field for requests.
6467        pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
6468        where
6469            T: std::convert::Into<crate::model::FirewallEndpoint>,
6470        {
6471            self.0.request.firewall_endpoint = v.map(|x| x.into());
6472            self
6473        }
6474
6475        /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointRequest::request_id].
6476        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6477            self.0.request.request_id = v.into();
6478            self
6479        }
6480    }
6481
6482    #[doc(hidden)]
6483    impl crate::RequestBuilder for UpdateProjectFirewallEndpoint {
6484        fn request_options(&mut self) -> &mut crate::RequestOptions {
6485            &mut self.0.options
6486        }
6487    }
6488
6489    /// The request builder for [FirewallActivation::list_firewall_endpoint_associations][crate::client::FirewallActivation::list_firewall_endpoint_associations] calls.
6490    ///
6491    /// # Example
6492    /// ```
6493    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListFirewallEndpointAssociations;
6494    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6495    /// use google_cloud_gax::paginator::ItemPaginator;
6496    ///
6497    /// let builder = prepare_request_builder();
6498    /// let mut items = builder.by_item();
6499    /// while let Some(result) = items.next().await {
6500    ///   let item = result?;
6501    /// }
6502    /// # Ok(()) }
6503    ///
6504    /// fn prepare_request_builder() -> ListFirewallEndpointAssociations {
6505    ///   # panic!();
6506    ///   // ... details omitted ...
6507    /// }
6508    /// ```
6509    #[derive(Clone, Debug)]
6510    pub struct ListFirewallEndpointAssociations(
6511        RequestBuilder<crate::model::ListFirewallEndpointAssociationsRequest>,
6512    );
6513
6514    impl ListFirewallEndpointAssociations {
6515        pub(crate) fn new(
6516            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6517        ) -> Self {
6518            Self(RequestBuilder::new(stub))
6519        }
6520
6521        /// Sets the full request, replacing any prior values.
6522        pub fn with_request<V: Into<crate::model::ListFirewallEndpointAssociationsRequest>>(
6523            mut self,
6524            v: V,
6525        ) -> Self {
6526            self.0.request = v.into();
6527            self
6528        }
6529
6530        /// Sets all the options, replacing any prior values.
6531        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6532            self.0.options = v.into();
6533            self
6534        }
6535
6536        /// Sends the request.
6537        pub async fn send(self) -> Result<crate::model::ListFirewallEndpointAssociationsResponse> {
6538            (*self.0.stub)
6539                .list_firewall_endpoint_associations(self.0.request, self.0.options)
6540                .await
6541                .map(crate::Response::into_body)
6542        }
6543
6544        /// Streams each page in the collection.
6545        pub fn by_page(
6546            self,
6547        ) -> impl google_cloud_gax::paginator::Paginator<
6548            crate::model::ListFirewallEndpointAssociationsResponse,
6549            crate::Error,
6550        > {
6551            use std::clone::Clone;
6552            let token = self.0.request.page_token.clone();
6553            let execute = move |token: String| {
6554                let mut builder = self.clone();
6555                builder.0.request = builder.0.request.set_page_token(token);
6556                builder.send()
6557            };
6558            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6559        }
6560
6561        /// Streams each item in the collection.
6562        pub fn by_item(
6563            self,
6564        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6565            crate::model::ListFirewallEndpointAssociationsResponse,
6566            crate::Error,
6567        > {
6568            use google_cloud_gax::paginator::Paginator;
6569            self.by_page().items()
6570        }
6571
6572        /// Sets the value of [parent][crate::model::ListFirewallEndpointAssociationsRequest::parent].
6573        ///
6574        /// This is a **required** field for requests.
6575        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6576            self.0.request.parent = v.into();
6577            self
6578        }
6579
6580        /// Sets the value of [page_size][crate::model::ListFirewallEndpointAssociationsRequest::page_size].
6581        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6582            self.0.request.page_size = v.into();
6583            self
6584        }
6585
6586        /// Sets the value of [page_token][crate::model::ListFirewallEndpointAssociationsRequest::page_token].
6587        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6588            self.0.request.page_token = v.into();
6589            self
6590        }
6591
6592        /// Sets the value of [filter][crate::model::ListFirewallEndpointAssociationsRequest::filter].
6593        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6594            self.0.request.filter = v.into();
6595            self
6596        }
6597
6598        /// Sets the value of [order_by][crate::model::ListFirewallEndpointAssociationsRequest::order_by].
6599        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6600            self.0.request.order_by = v.into();
6601            self
6602        }
6603    }
6604
6605    #[doc(hidden)]
6606    impl crate::RequestBuilder for ListFirewallEndpointAssociations {
6607        fn request_options(&mut self) -> &mut crate::RequestOptions {
6608            &mut self.0.options
6609        }
6610    }
6611
6612    /// The request builder for [FirewallActivation::get_firewall_endpoint_association][crate::client::FirewallActivation::get_firewall_endpoint_association] calls.
6613    ///
6614    /// # Example
6615    /// ```
6616    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetFirewallEndpointAssociation;
6617    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6618    ///
6619    /// let builder = prepare_request_builder();
6620    /// let response = builder.send().await?;
6621    /// # Ok(()) }
6622    ///
6623    /// fn prepare_request_builder() -> GetFirewallEndpointAssociation {
6624    ///   # panic!();
6625    ///   // ... details omitted ...
6626    /// }
6627    /// ```
6628    #[derive(Clone, Debug)]
6629    pub struct GetFirewallEndpointAssociation(
6630        RequestBuilder<crate::model::GetFirewallEndpointAssociationRequest>,
6631    );
6632
6633    impl GetFirewallEndpointAssociation {
6634        pub(crate) fn new(
6635            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6636        ) -> Self {
6637            Self(RequestBuilder::new(stub))
6638        }
6639
6640        /// Sets the full request, replacing any prior values.
6641        pub fn with_request<V: Into<crate::model::GetFirewallEndpointAssociationRequest>>(
6642            mut self,
6643            v: V,
6644        ) -> Self {
6645            self.0.request = v.into();
6646            self
6647        }
6648
6649        /// Sets all the options, replacing any prior values.
6650        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6651            self.0.options = v.into();
6652            self
6653        }
6654
6655        /// Sends the request.
6656        pub async fn send(self) -> Result<crate::model::FirewallEndpointAssociation> {
6657            (*self.0.stub)
6658                .get_firewall_endpoint_association(self.0.request, self.0.options)
6659                .await
6660                .map(crate::Response::into_body)
6661        }
6662
6663        /// Sets the value of [name][crate::model::GetFirewallEndpointAssociationRequest::name].
6664        ///
6665        /// This is a **required** field for requests.
6666        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6667            self.0.request.name = v.into();
6668            self
6669        }
6670    }
6671
6672    #[doc(hidden)]
6673    impl crate::RequestBuilder for GetFirewallEndpointAssociation {
6674        fn request_options(&mut self) -> &mut crate::RequestOptions {
6675            &mut self.0.options
6676        }
6677    }
6678
6679    /// The request builder for [FirewallActivation::create_firewall_endpoint_association][crate::client::FirewallActivation::create_firewall_endpoint_association] calls.
6680    ///
6681    /// # Example
6682    /// ```
6683    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::CreateFirewallEndpointAssociation;
6684    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6685    /// use google_cloud_lro::Poller;
6686    ///
6687    /// let builder = prepare_request_builder();
6688    /// let response = builder.poller().until_done().await?;
6689    /// # Ok(()) }
6690    ///
6691    /// fn prepare_request_builder() -> CreateFirewallEndpointAssociation {
6692    ///   # panic!();
6693    ///   // ... details omitted ...
6694    /// }
6695    /// ```
6696    #[derive(Clone, Debug)]
6697    pub struct CreateFirewallEndpointAssociation(
6698        RequestBuilder<crate::model::CreateFirewallEndpointAssociationRequest>,
6699    );
6700
6701    impl CreateFirewallEndpointAssociation {
6702        pub(crate) fn new(
6703            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6704        ) -> Self {
6705            Self(RequestBuilder::new(stub))
6706        }
6707
6708        /// Sets the full request, replacing any prior values.
6709        pub fn with_request<V: Into<crate::model::CreateFirewallEndpointAssociationRequest>>(
6710            mut self,
6711            v: V,
6712        ) -> Self {
6713            self.0.request = v.into();
6714            self
6715        }
6716
6717        /// Sets all the options, replacing any prior values.
6718        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6719            self.0.options = v.into();
6720            self
6721        }
6722
6723        /// Sends the request.
6724        ///
6725        /// # Long running operations
6726        ///
6727        /// This starts, but does not poll, a longrunning operation. More information
6728        /// on [create_firewall_endpoint_association][crate::client::FirewallActivation::create_firewall_endpoint_association].
6729        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6730            (*self.0.stub)
6731                .create_firewall_endpoint_association(self.0.request, self.0.options)
6732                .await
6733                .map(crate::Response::into_body)
6734        }
6735
6736        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_firewall_endpoint_association`.
6737        pub fn poller(
6738            self,
6739        ) -> impl google_cloud_lro::Poller<
6740            crate::model::FirewallEndpointAssociation,
6741            crate::model::OperationMetadata,
6742        > {
6743            type Operation = google_cloud_lro::internal::Operation<
6744                crate::model::FirewallEndpointAssociation,
6745                crate::model::OperationMetadata,
6746            >;
6747            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6748            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6749            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6750            if let Some(ref mut details) = poller_options.tracing {
6751                details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::create_firewall_endpoint_association::until_done";
6752            }
6753
6754            let stub = self.0.stub.clone();
6755            let mut options = self.0.options.clone();
6756            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6757            let query = move |name| {
6758                let stub = stub.clone();
6759                let options = options.clone();
6760                async {
6761                    let op = GetOperation::new(stub)
6762                        .set_name(name)
6763                        .with_options(options)
6764                        .send()
6765                        .await?;
6766                    Ok(Operation::new(op))
6767                }
6768            };
6769
6770            let start = move || async {
6771                let op = self.send().await?;
6772                Ok(Operation::new(op))
6773            };
6774
6775            use google_cloud_lro::internal::PollerExt;
6776            {
6777                google_cloud_lro::internal::new_poller(
6778                    polling_error_policy,
6779                    polling_backoff_policy,
6780                    start,
6781                    query,
6782                )
6783            }
6784            .with_options(poller_options)
6785        }
6786
6787        /// Sets the value of [parent][crate::model::CreateFirewallEndpointAssociationRequest::parent].
6788        ///
6789        /// This is a **required** field for requests.
6790        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6791            self.0.request.parent = v.into();
6792            self
6793        }
6794
6795        /// Sets the value of [firewall_endpoint_association_id][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association_id].
6796        pub fn set_firewall_endpoint_association_id<T: Into<std::string::String>>(
6797            mut self,
6798            v: T,
6799        ) -> Self {
6800            self.0.request.firewall_endpoint_association_id = v.into();
6801            self
6802        }
6803
6804        /// Sets the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
6805        ///
6806        /// This is a **required** field for requests.
6807        pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
6808        where
6809            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6810        {
6811            self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
6812            self
6813        }
6814
6815        /// Sets or clears the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
6816        ///
6817        /// This is a **required** field for requests.
6818        pub fn set_or_clear_firewall_endpoint_association<T>(
6819            mut self,
6820            v: std::option::Option<T>,
6821        ) -> Self
6822        where
6823            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6824        {
6825            self.0.request.firewall_endpoint_association = v.map(|x| x.into());
6826            self
6827        }
6828
6829        /// Sets the value of [request_id][crate::model::CreateFirewallEndpointAssociationRequest::request_id].
6830        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6831            self.0.request.request_id = v.into();
6832            self
6833        }
6834    }
6835
6836    #[doc(hidden)]
6837    impl crate::RequestBuilder for CreateFirewallEndpointAssociation {
6838        fn request_options(&mut self) -> &mut crate::RequestOptions {
6839            &mut self.0.options
6840        }
6841    }
6842
6843    /// The request builder for [FirewallActivation::delete_firewall_endpoint_association][crate::client::FirewallActivation::delete_firewall_endpoint_association] calls.
6844    ///
6845    /// # Example
6846    /// ```
6847    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::DeleteFirewallEndpointAssociation;
6848    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6849    /// use google_cloud_lro::Poller;
6850    ///
6851    /// let builder = prepare_request_builder();
6852    /// let response = builder.poller().until_done().await?;
6853    /// # Ok(()) }
6854    ///
6855    /// fn prepare_request_builder() -> DeleteFirewallEndpointAssociation {
6856    ///   # panic!();
6857    ///   // ... details omitted ...
6858    /// }
6859    /// ```
6860    #[derive(Clone, Debug)]
6861    pub struct DeleteFirewallEndpointAssociation(
6862        RequestBuilder<crate::model::DeleteFirewallEndpointAssociationRequest>,
6863    );
6864
6865    impl DeleteFirewallEndpointAssociation {
6866        pub(crate) fn new(
6867            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6868        ) -> Self {
6869            Self(RequestBuilder::new(stub))
6870        }
6871
6872        /// Sets the full request, replacing any prior values.
6873        pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointAssociationRequest>>(
6874            mut self,
6875            v: V,
6876        ) -> Self {
6877            self.0.request = v.into();
6878            self
6879        }
6880
6881        /// Sets all the options, replacing any prior values.
6882        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6883            self.0.options = v.into();
6884            self
6885        }
6886
6887        /// Sends the request.
6888        ///
6889        /// # Long running operations
6890        ///
6891        /// This starts, but does not poll, a longrunning operation. More information
6892        /// on [delete_firewall_endpoint_association][crate::client::FirewallActivation::delete_firewall_endpoint_association].
6893        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6894            (*self.0.stub)
6895                .delete_firewall_endpoint_association(self.0.request, self.0.options)
6896                .await
6897                .map(crate::Response::into_body)
6898        }
6899
6900        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_firewall_endpoint_association`.
6901        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6902            type Operation =
6903                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6904            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6905            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6906            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6907            if let Some(ref mut details) = poller_options.tracing {
6908                details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::delete_firewall_endpoint_association::until_done";
6909            }
6910
6911            let stub = self.0.stub.clone();
6912            let mut options = self.0.options.clone();
6913            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6914            let query = move |name| {
6915                let stub = stub.clone();
6916                let options = options.clone();
6917                async {
6918                    let op = GetOperation::new(stub)
6919                        .set_name(name)
6920                        .with_options(options)
6921                        .send()
6922                        .await?;
6923                    Ok(Operation::new(op))
6924                }
6925            };
6926
6927            let start = move || async {
6928                let op = self.send().await?;
6929                Ok(Operation::new(op))
6930            };
6931
6932            use google_cloud_lro::internal::PollerExt;
6933            {
6934                google_cloud_lro::internal::new_unit_response_poller(
6935                    polling_error_policy,
6936                    polling_backoff_policy,
6937                    start,
6938                    query,
6939                )
6940            }
6941            .with_options(poller_options)
6942        }
6943
6944        /// Sets the value of [name][crate::model::DeleteFirewallEndpointAssociationRequest::name].
6945        ///
6946        /// This is a **required** field for requests.
6947        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6948            self.0.request.name = v.into();
6949            self
6950        }
6951
6952        /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointAssociationRequest::request_id].
6953        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6954            self.0.request.request_id = v.into();
6955            self
6956        }
6957    }
6958
6959    #[doc(hidden)]
6960    impl crate::RequestBuilder for DeleteFirewallEndpointAssociation {
6961        fn request_options(&mut self) -> &mut crate::RequestOptions {
6962            &mut self.0.options
6963        }
6964    }
6965
6966    /// The request builder for [FirewallActivation::update_firewall_endpoint_association][crate::client::FirewallActivation::update_firewall_endpoint_association] calls.
6967    ///
6968    /// # Example
6969    /// ```
6970    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::UpdateFirewallEndpointAssociation;
6971    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6972    /// use google_cloud_lro::Poller;
6973    ///
6974    /// let builder = prepare_request_builder();
6975    /// let response = builder.poller().until_done().await?;
6976    /// # Ok(()) }
6977    ///
6978    /// fn prepare_request_builder() -> UpdateFirewallEndpointAssociation {
6979    ///   # panic!();
6980    ///   // ... details omitted ...
6981    /// }
6982    /// ```
6983    #[derive(Clone, Debug)]
6984    pub struct UpdateFirewallEndpointAssociation(
6985        RequestBuilder<crate::model::UpdateFirewallEndpointAssociationRequest>,
6986    );
6987
6988    impl UpdateFirewallEndpointAssociation {
6989        pub(crate) fn new(
6990            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6991        ) -> Self {
6992            Self(RequestBuilder::new(stub))
6993        }
6994
6995        /// Sets the full request, replacing any prior values.
6996        pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointAssociationRequest>>(
6997            mut self,
6998            v: V,
6999        ) -> Self {
7000            self.0.request = v.into();
7001            self
7002        }
7003
7004        /// Sets all the options, replacing any prior values.
7005        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7006            self.0.options = v.into();
7007            self
7008        }
7009
7010        /// Sends the request.
7011        ///
7012        /// # Long running operations
7013        ///
7014        /// This starts, but does not poll, a longrunning operation. More information
7015        /// on [update_firewall_endpoint_association][crate::client::FirewallActivation::update_firewall_endpoint_association].
7016        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7017            (*self.0.stub)
7018                .update_firewall_endpoint_association(self.0.request, self.0.options)
7019                .await
7020                .map(crate::Response::into_body)
7021        }
7022
7023        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_firewall_endpoint_association`.
7024        pub fn poller(
7025            self,
7026        ) -> impl google_cloud_lro::Poller<
7027            crate::model::FirewallEndpointAssociation,
7028            crate::model::OperationMetadata,
7029        > {
7030            type Operation = google_cloud_lro::internal::Operation<
7031                crate::model::FirewallEndpointAssociation,
7032                crate::model::OperationMetadata,
7033            >;
7034            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7035            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7036            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7037            if let Some(ref mut details) = poller_options.tracing {
7038                details.method_name = "google_cloud_networksecurity_v1::client::FirewallActivation::update_firewall_endpoint_association::until_done";
7039            }
7040
7041            let stub = self.0.stub.clone();
7042            let mut options = self.0.options.clone();
7043            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7044            let query = move |name| {
7045                let stub = stub.clone();
7046                let options = options.clone();
7047                async {
7048                    let op = GetOperation::new(stub)
7049                        .set_name(name)
7050                        .with_options(options)
7051                        .send()
7052                        .await?;
7053                    Ok(Operation::new(op))
7054                }
7055            };
7056
7057            let start = move || async {
7058                let op = self.send().await?;
7059                Ok(Operation::new(op))
7060            };
7061
7062            use google_cloud_lro::internal::PollerExt;
7063            {
7064                google_cloud_lro::internal::new_poller(
7065                    polling_error_policy,
7066                    polling_backoff_policy,
7067                    start,
7068                    query,
7069                )
7070            }
7071            .with_options(poller_options)
7072        }
7073
7074        /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
7075        ///
7076        /// This is a **required** field for requests.
7077        pub fn set_update_mask<T>(mut self, v: T) -> Self
7078        where
7079            T: std::convert::Into<wkt::FieldMask>,
7080        {
7081            self.0.request.update_mask = std::option::Option::Some(v.into());
7082            self
7083        }
7084
7085        /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
7086        ///
7087        /// This is a **required** field for requests.
7088        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7089        where
7090            T: std::convert::Into<wkt::FieldMask>,
7091        {
7092            self.0.request.update_mask = v.map(|x| x.into());
7093            self
7094        }
7095
7096        /// Sets the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
7097        ///
7098        /// This is a **required** field for requests.
7099        pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
7100        where
7101            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
7102        {
7103            self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
7104            self
7105        }
7106
7107        /// Sets or clears the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
7108        ///
7109        /// This is a **required** field for requests.
7110        pub fn set_or_clear_firewall_endpoint_association<T>(
7111            mut self,
7112            v: std::option::Option<T>,
7113        ) -> Self
7114        where
7115            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
7116        {
7117            self.0.request.firewall_endpoint_association = v.map(|x| x.into());
7118            self
7119        }
7120
7121        /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointAssociationRequest::request_id].
7122        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7123            self.0.request.request_id = v.into();
7124            self
7125        }
7126    }
7127
7128    #[doc(hidden)]
7129    impl crate::RequestBuilder for UpdateFirewallEndpointAssociation {
7130        fn request_options(&mut self) -> &mut crate::RequestOptions {
7131            &mut self.0.options
7132        }
7133    }
7134
7135    /// The request builder for [FirewallActivation::list_locations][crate::client::FirewallActivation::list_locations] calls.
7136    ///
7137    /// # Example
7138    /// ```
7139    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListLocations;
7140    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7141    /// use google_cloud_gax::paginator::ItemPaginator;
7142    ///
7143    /// let builder = prepare_request_builder();
7144    /// let mut items = builder.by_item();
7145    /// while let Some(result) = items.next().await {
7146    ///   let item = result?;
7147    /// }
7148    /// # Ok(()) }
7149    ///
7150    /// fn prepare_request_builder() -> ListLocations {
7151    ///   # panic!();
7152    ///   // ... details omitted ...
7153    /// }
7154    /// ```
7155    #[derive(Clone, Debug)]
7156    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7157
7158    impl ListLocations {
7159        pub(crate) fn new(
7160            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7161        ) -> Self {
7162            Self(RequestBuilder::new(stub))
7163        }
7164
7165        /// Sets the full request, replacing any prior values.
7166        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7167            mut self,
7168            v: V,
7169        ) -> Self {
7170            self.0.request = v.into();
7171            self
7172        }
7173
7174        /// Sets all the options, replacing any prior values.
7175        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7176            self.0.options = v.into();
7177            self
7178        }
7179
7180        /// Sends the request.
7181        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7182            (*self.0.stub)
7183                .list_locations(self.0.request, self.0.options)
7184                .await
7185                .map(crate::Response::into_body)
7186        }
7187
7188        /// Streams each page in the collection.
7189        pub fn by_page(
7190            self,
7191        ) -> impl google_cloud_gax::paginator::Paginator<
7192            google_cloud_location::model::ListLocationsResponse,
7193            crate::Error,
7194        > {
7195            use std::clone::Clone;
7196            let token = self.0.request.page_token.clone();
7197            let execute = move |token: String| {
7198                let mut builder = self.clone();
7199                builder.0.request = builder.0.request.set_page_token(token);
7200                builder.send()
7201            };
7202            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7203        }
7204
7205        /// Streams each item in the collection.
7206        pub fn by_item(
7207            self,
7208        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7209            google_cloud_location::model::ListLocationsResponse,
7210            crate::Error,
7211        > {
7212            use google_cloud_gax::paginator::Paginator;
7213            self.by_page().items()
7214        }
7215
7216        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
7217        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7218            self.0.request.name = v.into();
7219            self
7220        }
7221
7222        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
7223        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7224            self.0.request.filter = v.into();
7225            self
7226        }
7227
7228        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
7229        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7230            self.0.request.page_size = v.into();
7231            self
7232        }
7233
7234        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
7235        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7236            self.0.request.page_token = v.into();
7237            self
7238        }
7239    }
7240
7241    #[doc(hidden)]
7242    impl crate::RequestBuilder for ListLocations {
7243        fn request_options(&mut self) -> &mut crate::RequestOptions {
7244            &mut self.0.options
7245        }
7246    }
7247
7248    /// The request builder for [FirewallActivation::get_location][crate::client::FirewallActivation::get_location] calls.
7249    ///
7250    /// # Example
7251    /// ```
7252    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetLocation;
7253    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7254    ///
7255    /// let builder = prepare_request_builder();
7256    /// let response = builder.send().await?;
7257    /// # Ok(()) }
7258    ///
7259    /// fn prepare_request_builder() -> GetLocation {
7260    ///   # panic!();
7261    ///   // ... details omitted ...
7262    /// }
7263    /// ```
7264    #[derive(Clone, Debug)]
7265    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
7266
7267    impl GetLocation {
7268        pub(crate) fn new(
7269            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7270        ) -> Self {
7271            Self(RequestBuilder::new(stub))
7272        }
7273
7274        /// Sets the full request, replacing any prior values.
7275        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
7276            mut self,
7277            v: V,
7278        ) -> Self {
7279            self.0.request = v.into();
7280            self
7281        }
7282
7283        /// Sets all the options, replacing any prior values.
7284        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7285            self.0.options = v.into();
7286            self
7287        }
7288
7289        /// Sends the request.
7290        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
7291            (*self.0.stub)
7292                .get_location(self.0.request, self.0.options)
7293                .await
7294                .map(crate::Response::into_body)
7295        }
7296
7297        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
7298        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7299            self.0.request.name = v.into();
7300            self
7301        }
7302    }
7303
7304    #[doc(hidden)]
7305    impl crate::RequestBuilder for GetLocation {
7306        fn request_options(&mut self) -> &mut crate::RequestOptions {
7307            &mut self.0.options
7308        }
7309    }
7310
7311    /// The request builder for [FirewallActivation::set_iam_policy][crate::client::FirewallActivation::set_iam_policy] calls.
7312    ///
7313    /// # Example
7314    /// ```
7315    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::SetIamPolicy;
7316    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7317    ///
7318    /// let builder = prepare_request_builder();
7319    /// let response = builder.send().await?;
7320    /// # Ok(()) }
7321    ///
7322    /// fn prepare_request_builder() -> SetIamPolicy {
7323    ///   # panic!();
7324    ///   // ... details omitted ...
7325    /// }
7326    /// ```
7327    #[derive(Clone, Debug)]
7328    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
7329
7330    impl SetIamPolicy {
7331        pub(crate) fn new(
7332            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7333        ) -> Self {
7334            Self(RequestBuilder::new(stub))
7335        }
7336
7337        /// Sets the full request, replacing any prior values.
7338        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
7339            mut self,
7340            v: V,
7341        ) -> Self {
7342            self.0.request = v.into();
7343            self
7344        }
7345
7346        /// Sets all the options, replacing any prior values.
7347        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7348            self.0.options = v.into();
7349            self
7350        }
7351
7352        /// Sends the request.
7353        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
7354            (*self.0.stub)
7355                .set_iam_policy(self.0.request, self.0.options)
7356                .await
7357                .map(crate::Response::into_body)
7358        }
7359
7360        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
7361        ///
7362        /// This is a **required** field for requests.
7363        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7364            self.0.request.resource = v.into();
7365            self
7366        }
7367
7368        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
7369        ///
7370        /// This is a **required** field for requests.
7371        pub fn set_policy<T>(mut self, v: T) -> Self
7372        where
7373            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
7374        {
7375            self.0.request.policy = std::option::Option::Some(v.into());
7376            self
7377        }
7378
7379        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
7380        ///
7381        /// This is a **required** field for requests.
7382        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
7383        where
7384            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
7385        {
7386            self.0.request.policy = v.map(|x| x.into());
7387            self
7388        }
7389
7390        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
7391        pub fn set_update_mask<T>(mut self, v: T) -> Self
7392        where
7393            T: std::convert::Into<wkt::FieldMask>,
7394        {
7395            self.0.request.update_mask = std::option::Option::Some(v.into());
7396            self
7397        }
7398
7399        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
7400        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7401        where
7402            T: std::convert::Into<wkt::FieldMask>,
7403        {
7404            self.0.request.update_mask = v.map(|x| x.into());
7405            self
7406        }
7407    }
7408
7409    #[doc(hidden)]
7410    impl crate::RequestBuilder for SetIamPolicy {
7411        fn request_options(&mut self) -> &mut crate::RequestOptions {
7412            &mut self.0.options
7413        }
7414    }
7415
7416    /// The request builder for [FirewallActivation::get_iam_policy][crate::client::FirewallActivation::get_iam_policy] calls.
7417    ///
7418    /// # Example
7419    /// ```
7420    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetIamPolicy;
7421    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7422    ///
7423    /// let builder = prepare_request_builder();
7424    /// let response = builder.send().await?;
7425    /// # Ok(()) }
7426    ///
7427    /// fn prepare_request_builder() -> GetIamPolicy {
7428    ///   # panic!();
7429    ///   // ... details omitted ...
7430    /// }
7431    /// ```
7432    #[derive(Clone, Debug)]
7433    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
7434
7435    impl GetIamPolicy {
7436        pub(crate) fn new(
7437            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7438        ) -> Self {
7439            Self(RequestBuilder::new(stub))
7440        }
7441
7442        /// Sets the full request, replacing any prior values.
7443        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
7444            mut self,
7445            v: V,
7446        ) -> Self {
7447            self.0.request = v.into();
7448            self
7449        }
7450
7451        /// Sets all the options, replacing any prior values.
7452        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7453            self.0.options = v.into();
7454            self
7455        }
7456
7457        /// Sends the request.
7458        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
7459            (*self.0.stub)
7460                .get_iam_policy(self.0.request, self.0.options)
7461                .await
7462                .map(crate::Response::into_body)
7463        }
7464
7465        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
7466        ///
7467        /// This is a **required** field for requests.
7468        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7469            self.0.request.resource = v.into();
7470            self
7471        }
7472
7473        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
7474        pub fn set_options<T>(mut self, v: T) -> Self
7475        where
7476            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
7477        {
7478            self.0.request.options = std::option::Option::Some(v.into());
7479            self
7480        }
7481
7482        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
7483        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
7484        where
7485            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
7486        {
7487            self.0.request.options = v.map(|x| x.into());
7488            self
7489        }
7490    }
7491
7492    #[doc(hidden)]
7493    impl crate::RequestBuilder for GetIamPolicy {
7494        fn request_options(&mut self) -> &mut crate::RequestOptions {
7495            &mut self.0.options
7496        }
7497    }
7498
7499    /// The request builder for [FirewallActivation::test_iam_permissions][crate::client::FirewallActivation::test_iam_permissions] calls.
7500    ///
7501    /// # Example
7502    /// ```
7503    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::TestIamPermissions;
7504    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7505    ///
7506    /// let builder = prepare_request_builder();
7507    /// let response = builder.send().await?;
7508    /// # Ok(()) }
7509    ///
7510    /// fn prepare_request_builder() -> TestIamPermissions {
7511    ///   # panic!();
7512    ///   // ... details omitted ...
7513    /// }
7514    /// ```
7515    #[derive(Clone, Debug)]
7516    pub struct TestIamPermissions(
7517        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
7518    );
7519
7520    impl TestIamPermissions {
7521        pub(crate) fn new(
7522            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7523        ) -> Self {
7524            Self(RequestBuilder::new(stub))
7525        }
7526
7527        /// Sets the full request, replacing any prior values.
7528        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
7529            mut self,
7530            v: V,
7531        ) -> Self {
7532            self.0.request = v.into();
7533            self
7534        }
7535
7536        /// Sets all the options, replacing any prior values.
7537        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7538            self.0.options = v.into();
7539            self
7540        }
7541
7542        /// Sends the request.
7543        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
7544            (*self.0.stub)
7545                .test_iam_permissions(self.0.request, self.0.options)
7546                .await
7547                .map(crate::Response::into_body)
7548        }
7549
7550        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
7551        ///
7552        /// This is a **required** field for requests.
7553        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7554            self.0.request.resource = v.into();
7555            self
7556        }
7557
7558        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
7559        ///
7560        /// This is a **required** field for requests.
7561        pub fn set_permissions<T, V>(mut self, v: T) -> Self
7562        where
7563            T: std::iter::IntoIterator<Item = V>,
7564            V: std::convert::Into<std::string::String>,
7565        {
7566            use std::iter::Iterator;
7567            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
7568            self
7569        }
7570    }
7571
7572    #[doc(hidden)]
7573    impl crate::RequestBuilder for TestIamPermissions {
7574        fn request_options(&mut self) -> &mut crate::RequestOptions {
7575            &mut self.0.options
7576        }
7577    }
7578
7579    /// The request builder for [FirewallActivation::list_operations][crate::client::FirewallActivation::list_operations] calls.
7580    ///
7581    /// # Example
7582    /// ```
7583    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListOperations;
7584    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7585    /// use google_cloud_gax::paginator::ItemPaginator;
7586    ///
7587    /// let builder = prepare_request_builder();
7588    /// let mut items = builder.by_item();
7589    /// while let Some(result) = items.next().await {
7590    ///   let item = result?;
7591    /// }
7592    /// # Ok(()) }
7593    ///
7594    /// fn prepare_request_builder() -> ListOperations {
7595    ///   # panic!();
7596    ///   // ... details omitted ...
7597    /// }
7598    /// ```
7599    #[derive(Clone, Debug)]
7600    pub struct ListOperations(
7601        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
7602    );
7603
7604    impl ListOperations {
7605        pub(crate) fn new(
7606            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7607        ) -> Self {
7608            Self(RequestBuilder::new(stub))
7609        }
7610
7611        /// Sets the full request, replacing any prior values.
7612        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7613            mut self,
7614            v: V,
7615        ) -> Self {
7616            self.0.request = v.into();
7617            self
7618        }
7619
7620        /// Sets all the options, replacing any prior values.
7621        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7622            self.0.options = v.into();
7623            self
7624        }
7625
7626        /// Sends the request.
7627        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7628            (*self.0.stub)
7629                .list_operations(self.0.request, self.0.options)
7630                .await
7631                .map(crate::Response::into_body)
7632        }
7633
7634        /// Streams each page in the collection.
7635        pub fn by_page(
7636            self,
7637        ) -> impl google_cloud_gax::paginator::Paginator<
7638            google_cloud_longrunning::model::ListOperationsResponse,
7639            crate::Error,
7640        > {
7641            use std::clone::Clone;
7642            let token = self.0.request.page_token.clone();
7643            let execute = move |token: String| {
7644                let mut builder = self.clone();
7645                builder.0.request = builder.0.request.set_page_token(token);
7646                builder.send()
7647            };
7648            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7649        }
7650
7651        /// Streams each item in the collection.
7652        pub fn by_item(
7653            self,
7654        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7655            google_cloud_longrunning::model::ListOperationsResponse,
7656            crate::Error,
7657        > {
7658            use google_cloud_gax::paginator::Paginator;
7659            self.by_page().items()
7660        }
7661
7662        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
7663        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7664            self.0.request.name = v.into();
7665            self
7666        }
7667
7668        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
7669        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7670            self.0.request.filter = v.into();
7671            self
7672        }
7673
7674        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
7675        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7676            self.0.request.page_size = v.into();
7677            self
7678        }
7679
7680        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
7681        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7682            self.0.request.page_token = v.into();
7683            self
7684        }
7685
7686        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
7687        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7688            self.0.request.return_partial_success = v.into();
7689            self
7690        }
7691    }
7692
7693    #[doc(hidden)]
7694    impl crate::RequestBuilder for ListOperations {
7695        fn request_options(&mut self) -> &mut crate::RequestOptions {
7696            &mut self.0.options
7697        }
7698    }
7699
7700    /// The request builder for [FirewallActivation::get_operation][crate::client::FirewallActivation::get_operation] calls.
7701    ///
7702    /// # Example
7703    /// ```
7704    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetOperation;
7705    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7706    ///
7707    /// let builder = prepare_request_builder();
7708    /// let response = builder.send().await?;
7709    /// # Ok(()) }
7710    ///
7711    /// fn prepare_request_builder() -> GetOperation {
7712    ///   # panic!();
7713    ///   // ... details omitted ...
7714    /// }
7715    /// ```
7716    #[derive(Clone, Debug)]
7717    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7718
7719    impl GetOperation {
7720        pub(crate) fn new(
7721            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7722        ) -> Self {
7723            Self(RequestBuilder::new(stub))
7724        }
7725
7726        /// Sets the full request, replacing any prior values.
7727        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7728            mut self,
7729            v: V,
7730        ) -> Self {
7731            self.0.request = v.into();
7732            self
7733        }
7734
7735        /// Sets all the options, replacing any prior values.
7736        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7737            self.0.options = v.into();
7738            self
7739        }
7740
7741        /// Sends the request.
7742        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7743            (*self.0.stub)
7744                .get_operation(self.0.request, self.0.options)
7745                .await
7746                .map(crate::Response::into_body)
7747        }
7748
7749        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
7750        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7751            self.0.request.name = v.into();
7752            self
7753        }
7754    }
7755
7756    #[doc(hidden)]
7757    impl crate::RequestBuilder for GetOperation {
7758        fn request_options(&mut self) -> &mut crate::RequestOptions {
7759            &mut self.0.options
7760        }
7761    }
7762
7763    /// The request builder for [FirewallActivation::delete_operation][crate::client::FirewallActivation::delete_operation] calls.
7764    ///
7765    /// # Example
7766    /// ```
7767    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::DeleteOperation;
7768    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7769    ///
7770    /// let builder = prepare_request_builder();
7771    /// let response = builder.send().await?;
7772    /// # Ok(()) }
7773    ///
7774    /// fn prepare_request_builder() -> DeleteOperation {
7775    ///   # panic!();
7776    ///   // ... details omitted ...
7777    /// }
7778    /// ```
7779    #[derive(Clone, Debug)]
7780    pub struct DeleteOperation(
7781        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7782    );
7783
7784    impl DeleteOperation {
7785        pub(crate) fn new(
7786            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7787        ) -> Self {
7788            Self(RequestBuilder::new(stub))
7789        }
7790
7791        /// Sets the full request, replacing any prior values.
7792        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7793            mut self,
7794            v: V,
7795        ) -> Self {
7796            self.0.request = v.into();
7797            self
7798        }
7799
7800        /// Sets all the options, replacing any prior values.
7801        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7802            self.0.options = v.into();
7803            self
7804        }
7805
7806        /// Sends the request.
7807        pub async fn send(self) -> Result<()> {
7808            (*self.0.stub)
7809                .delete_operation(self.0.request, self.0.options)
7810                .await
7811                .map(crate::Response::into_body)
7812        }
7813
7814        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
7815        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7816            self.0.request.name = v.into();
7817            self
7818        }
7819    }
7820
7821    #[doc(hidden)]
7822    impl crate::RequestBuilder for DeleteOperation {
7823        fn request_options(&mut self) -> &mut crate::RequestOptions {
7824            &mut self.0.options
7825        }
7826    }
7827
7828    /// The request builder for [FirewallActivation::cancel_operation][crate::client::FirewallActivation::cancel_operation] calls.
7829    ///
7830    /// # Example
7831    /// ```
7832    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::CancelOperation;
7833    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7834    ///
7835    /// let builder = prepare_request_builder();
7836    /// let response = builder.send().await?;
7837    /// # Ok(()) }
7838    ///
7839    /// fn prepare_request_builder() -> CancelOperation {
7840    ///   # panic!();
7841    ///   // ... details omitted ...
7842    /// }
7843    /// ```
7844    #[derive(Clone, Debug)]
7845    pub struct CancelOperation(
7846        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7847    );
7848
7849    impl CancelOperation {
7850        pub(crate) fn new(
7851            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7852        ) -> Self {
7853            Self(RequestBuilder::new(stub))
7854        }
7855
7856        /// Sets the full request, replacing any prior values.
7857        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7858            mut self,
7859            v: V,
7860        ) -> Self {
7861            self.0.request = v.into();
7862            self
7863        }
7864
7865        /// Sets all the options, replacing any prior values.
7866        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7867            self.0.options = v.into();
7868            self
7869        }
7870
7871        /// Sends the request.
7872        pub async fn send(self) -> Result<()> {
7873            (*self.0.stub)
7874                .cancel_operation(self.0.request, self.0.options)
7875                .await
7876                .map(crate::Response::into_body)
7877        }
7878
7879        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
7880        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7881            self.0.request.name = v.into();
7882            self
7883        }
7884    }
7885
7886    #[doc(hidden)]
7887    impl crate::RequestBuilder for CancelOperation {
7888        fn request_options(&mut self) -> &mut crate::RequestOptions {
7889            &mut self.0.options
7890        }
7891    }
7892}
7893
7894/// Request and client builders for [Intercept][crate::client::Intercept].
7895pub mod intercept {
7896    use crate::Result;
7897
7898    /// A builder for [Intercept][crate::client::Intercept].
7899    ///
7900    /// ```
7901    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7902    /// # use google_cloud_networksecurity_v1::*;
7903    /// # use builder::intercept::ClientBuilder;
7904    /// # use client::Intercept;
7905    /// let builder : ClientBuilder = Intercept::builder();
7906    /// let client = builder
7907    ///     .with_endpoint("https://networksecurity.googleapis.com")
7908    ///     .build().await?;
7909    /// # Ok(()) }
7910    /// ```
7911    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7912
7913    pub(crate) mod client {
7914        use super::super::super::client::Intercept;
7915        pub struct Factory;
7916        impl crate::ClientFactory for Factory {
7917            type Client = Intercept;
7918            type Credentials = gaxi::options::Credentials;
7919            async fn build(
7920                self,
7921                config: gaxi::options::ClientConfig,
7922            ) -> crate::ClientBuilderResult<Self::Client> {
7923                Self::Client::new(config).await
7924            }
7925        }
7926    }
7927
7928    /// Common implementation for [crate::client::Intercept] request builders.
7929    #[derive(Clone, Debug)]
7930    pub(crate) struct RequestBuilder<R: std::default::Default> {
7931        stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7932        request: R,
7933        options: crate::RequestOptions,
7934    }
7935
7936    impl<R> RequestBuilder<R>
7937    where
7938        R: std::default::Default,
7939    {
7940        pub(crate) fn new(
7941            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7942        ) -> Self {
7943            Self {
7944                stub,
7945                request: R::default(),
7946                options: crate::RequestOptions::default(),
7947            }
7948        }
7949    }
7950
7951    /// The request builder for [Intercept::list_intercept_endpoint_groups][crate::client::Intercept::list_intercept_endpoint_groups] calls.
7952    ///
7953    /// # Example
7954    /// ```
7955    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptEndpointGroups;
7956    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7957    /// use google_cloud_gax::paginator::ItemPaginator;
7958    ///
7959    /// let builder = prepare_request_builder();
7960    /// let mut items = builder.by_item();
7961    /// while let Some(result) = items.next().await {
7962    ///   let item = result?;
7963    /// }
7964    /// # Ok(()) }
7965    ///
7966    /// fn prepare_request_builder() -> ListInterceptEndpointGroups {
7967    ///   # panic!();
7968    ///   // ... details omitted ...
7969    /// }
7970    /// ```
7971    #[derive(Clone, Debug)]
7972    pub struct ListInterceptEndpointGroups(
7973        RequestBuilder<crate::model::ListInterceptEndpointGroupsRequest>,
7974    );
7975
7976    impl ListInterceptEndpointGroups {
7977        pub(crate) fn new(
7978            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7979        ) -> Self {
7980            Self(RequestBuilder::new(stub))
7981        }
7982
7983        /// Sets the full request, replacing any prior values.
7984        pub fn with_request<V: Into<crate::model::ListInterceptEndpointGroupsRequest>>(
7985            mut self,
7986            v: V,
7987        ) -> Self {
7988            self.0.request = v.into();
7989            self
7990        }
7991
7992        /// Sets all the options, replacing any prior values.
7993        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7994            self.0.options = v.into();
7995            self
7996        }
7997
7998        /// Sends the request.
7999        pub async fn send(self) -> Result<crate::model::ListInterceptEndpointGroupsResponse> {
8000            (*self.0.stub)
8001                .list_intercept_endpoint_groups(self.0.request, self.0.options)
8002                .await
8003                .map(crate::Response::into_body)
8004        }
8005
8006        /// Streams each page in the collection.
8007        pub fn by_page(
8008            self,
8009        ) -> impl google_cloud_gax::paginator::Paginator<
8010            crate::model::ListInterceptEndpointGroupsResponse,
8011            crate::Error,
8012        > {
8013            use std::clone::Clone;
8014            let token = self.0.request.page_token.clone();
8015            let execute = move |token: String| {
8016                let mut builder = self.clone();
8017                builder.0.request = builder.0.request.set_page_token(token);
8018                builder.send()
8019            };
8020            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8021        }
8022
8023        /// Streams each item in the collection.
8024        pub fn by_item(
8025            self,
8026        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8027            crate::model::ListInterceptEndpointGroupsResponse,
8028            crate::Error,
8029        > {
8030            use google_cloud_gax::paginator::Paginator;
8031            self.by_page().items()
8032        }
8033
8034        /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupsRequest::parent].
8035        ///
8036        /// This is a **required** field for requests.
8037        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8038            self.0.request.parent = v.into();
8039            self
8040        }
8041
8042        /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupsRequest::page_size].
8043        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8044            self.0.request.page_size = v.into();
8045            self
8046        }
8047
8048        /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupsRequest::page_token].
8049        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8050            self.0.request.page_token = v.into();
8051            self
8052        }
8053
8054        /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupsRequest::filter].
8055        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8056            self.0.request.filter = v.into();
8057            self
8058        }
8059
8060        /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupsRequest::order_by].
8061        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8062            self.0.request.order_by = v.into();
8063            self
8064        }
8065    }
8066
8067    #[doc(hidden)]
8068    impl crate::RequestBuilder for ListInterceptEndpointGroups {
8069        fn request_options(&mut self) -> &mut crate::RequestOptions {
8070            &mut self.0.options
8071        }
8072    }
8073
8074    /// The request builder for [Intercept::get_intercept_endpoint_group][crate::client::Intercept::get_intercept_endpoint_group] calls.
8075    ///
8076    /// # Example
8077    /// ```
8078    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptEndpointGroup;
8079    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8080    ///
8081    /// let builder = prepare_request_builder();
8082    /// let response = builder.send().await?;
8083    /// # Ok(()) }
8084    ///
8085    /// fn prepare_request_builder() -> GetInterceptEndpointGroup {
8086    ///   # panic!();
8087    ///   // ... details omitted ...
8088    /// }
8089    /// ```
8090    #[derive(Clone, Debug)]
8091    pub struct GetInterceptEndpointGroup(
8092        RequestBuilder<crate::model::GetInterceptEndpointGroupRequest>,
8093    );
8094
8095    impl GetInterceptEndpointGroup {
8096        pub(crate) fn new(
8097            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8098        ) -> Self {
8099            Self(RequestBuilder::new(stub))
8100        }
8101
8102        /// Sets the full request, replacing any prior values.
8103        pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupRequest>>(
8104            mut self,
8105            v: V,
8106        ) -> Self {
8107            self.0.request = v.into();
8108            self
8109        }
8110
8111        /// Sets all the options, replacing any prior values.
8112        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8113            self.0.options = v.into();
8114            self
8115        }
8116
8117        /// Sends the request.
8118        pub async fn send(self) -> Result<crate::model::InterceptEndpointGroup> {
8119            (*self.0.stub)
8120                .get_intercept_endpoint_group(self.0.request, self.0.options)
8121                .await
8122                .map(crate::Response::into_body)
8123        }
8124
8125        /// Sets the value of [name][crate::model::GetInterceptEndpointGroupRequest::name].
8126        ///
8127        /// This is a **required** field for requests.
8128        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8129            self.0.request.name = v.into();
8130            self
8131        }
8132    }
8133
8134    #[doc(hidden)]
8135    impl crate::RequestBuilder for GetInterceptEndpointGroup {
8136        fn request_options(&mut self) -> &mut crate::RequestOptions {
8137            &mut self.0.options
8138        }
8139    }
8140
8141    /// The request builder for [Intercept::create_intercept_endpoint_group][crate::client::Intercept::create_intercept_endpoint_group] calls.
8142    ///
8143    /// # Example
8144    /// ```
8145    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptEndpointGroup;
8146    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8147    /// use google_cloud_lro::Poller;
8148    ///
8149    /// let builder = prepare_request_builder();
8150    /// let response = builder.poller().until_done().await?;
8151    /// # Ok(()) }
8152    ///
8153    /// fn prepare_request_builder() -> CreateInterceptEndpointGroup {
8154    ///   # panic!();
8155    ///   // ... details omitted ...
8156    /// }
8157    /// ```
8158    #[derive(Clone, Debug)]
8159    pub struct CreateInterceptEndpointGroup(
8160        RequestBuilder<crate::model::CreateInterceptEndpointGroupRequest>,
8161    );
8162
8163    impl CreateInterceptEndpointGroup {
8164        pub(crate) fn new(
8165            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8166        ) -> Self {
8167            Self(RequestBuilder::new(stub))
8168        }
8169
8170        /// Sets the full request, replacing any prior values.
8171        pub fn with_request<V: Into<crate::model::CreateInterceptEndpointGroupRequest>>(
8172            mut self,
8173            v: V,
8174        ) -> Self {
8175            self.0.request = v.into();
8176            self
8177        }
8178
8179        /// Sets all the options, replacing any prior values.
8180        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8181            self.0.options = v.into();
8182            self
8183        }
8184
8185        /// Sends the request.
8186        ///
8187        /// # Long running operations
8188        ///
8189        /// This starts, but does not poll, a longrunning operation. More information
8190        /// on [create_intercept_endpoint_group][crate::client::Intercept::create_intercept_endpoint_group].
8191        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8192            (*self.0.stub)
8193                .create_intercept_endpoint_group(self.0.request, self.0.options)
8194                .await
8195                .map(crate::Response::into_body)
8196        }
8197
8198        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_endpoint_group`.
8199        pub fn poller(
8200            self,
8201        ) -> impl google_cloud_lro::Poller<
8202            crate::model::InterceptEndpointGroup,
8203            crate::model::OperationMetadata,
8204        > {
8205            type Operation = google_cloud_lro::internal::Operation<
8206                crate::model::InterceptEndpointGroup,
8207                crate::model::OperationMetadata,
8208            >;
8209            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8210            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8211            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8212            if let Some(ref mut details) = poller_options.tracing {
8213                details.method_name = "google_cloud_networksecurity_v1::client::Intercept::create_intercept_endpoint_group::until_done";
8214            }
8215
8216            let stub = self.0.stub.clone();
8217            let mut options = self.0.options.clone();
8218            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8219            let query = move |name| {
8220                let stub = stub.clone();
8221                let options = options.clone();
8222                async {
8223                    let op = GetOperation::new(stub)
8224                        .set_name(name)
8225                        .with_options(options)
8226                        .send()
8227                        .await?;
8228                    Ok(Operation::new(op))
8229                }
8230            };
8231
8232            let start = move || async {
8233                let op = self.send().await?;
8234                Ok(Operation::new(op))
8235            };
8236
8237            use google_cloud_lro::internal::PollerExt;
8238            {
8239                google_cloud_lro::internal::new_poller(
8240                    polling_error_policy,
8241                    polling_backoff_policy,
8242                    start,
8243                    query,
8244                )
8245            }
8246            .with_options(poller_options)
8247        }
8248
8249        /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupRequest::parent].
8250        ///
8251        /// This is a **required** field for requests.
8252        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8253            self.0.request.parent = v.into();
8254            self
8255        }
8256
8257        /// Sets the value of [intercept_endpoint_group_id][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group_id].
8258        ///
8259        /// This is a **required** field for requests.
8260        pub fn set_intercept_endpoint_group_id<T: Into<std::string::String>>(
8261            mut self,
8262            v: T,
8263        ) -> Self {
8264            self.0.request.intercept_endpoint_group_id = v.into();
8265            self
8266        }
8267
8268        /// Sets the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
8269        ///
8270        /// This is a **required** field for requests.
8271        pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
8272        where
8273            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8274        {
8275            self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
8276            self
8277        }
8278
8279        /// Sets or clears the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
8280        ///
8281        /// This is a **required** field for requests.
8282        pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
8283        where
8284            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8285        {
8286            self.0.request.intercept_endpoint_group = v.map(|x| x.into());
8287            self
8288        }
8289
8290        /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupRequest::request_id].
8291        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8292            self.0.request.request_id = v.into();
8293            self
8294        }
8295    }
8296
8297    #[doc(hidden)]
8298    impl crate::RequestBuilder for CreateInterceptEndpointGroup {
8299        fn request_options(&mut self) -> &mut crate::RequestOptions {
8300            &mut self.0.options
8301        }
8302    }
8303
8304    /// The request builder for [Intercept::update_intercept_endpoint_group][crate::client::Intercept::update_intercept_endpoint_group] calls.
8305    ///
8306    /// # Example
8307    /// ```
8308    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptEndpointGroup;
8309    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8310    /// use google_cloud_lro::Poller;
8311    ///
8312    /// let builder = prepare_request_builder();
8313    /// let response = builder.poller().until_done().await?;
8314    /// # Ok(()) }
8315    ///
8316    /// fn prepare_request_builder() -> UpdateInterceptEndpointGroup {
8317    ///   # panic!();
8318    ///   // ... details omitted ...
8319    /// }
8320    /// ```
8321    #[derive(Clone, Debug)]
8322    pub struct UpdateInterceptEndpointGroup(
8323        RequestBuilder<crate::model::UpdateInterceptEndpointGroupRequest>,
8324    );
8325
8326    impl UpdateInterceptEndpointGroup {
8327        pub(crate) fn new(
8328            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8329        ) -> Self {
8330            Self(RequestBuilder::new(stub))
8331        }
8332
8333        /// Sets the full request, replacing any prior values.
8334        pub fn with_request<V: Into<crate::model::UpdateInterceptEndpointGroupRequest>>(
8335            mut self,
8336            v: V,
8337        ) -> Self {
8338            self.0.request = v.into();
8339            self
8340        }
8341
8342        /// Sets all the options, replacing any prior values.
8343        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8344            self.0.options = v.into();
8345            self
8346        }
8347
8348        /// Sends the request.
8349        ///
8350        /// # Long running operations
8351        ///
8352        /// This starts, but does not poll, a longrunning operation. More information
8353        /// on [update_intercept_endpoint_group][crate::client::Intercept::update_intercept_endpoint_group].
8354        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8355            (*self.0.stub)
8356                .update_intercept_endpoint_group(self.0.request, self.0.options)
8357                .await
8358                .map(crate::Response::into_body)
8359        }
8360
8361        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_endpoint_group`.
8362        pub fn poller(
8363            self,
8364        ) -> impl google_cloud_lro::Poller<
8365            crate::model::InterceptEndpointGroup,
8366            crate::model::OperationMetadata,
8367        > {
8368            type Operation = google_cloud_lro::internal::Operation<
8369                crate::model::InterceptEndpointGroup,
8370                crate::model::OperationMetadata,
8371            >;
8372            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8373            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8374            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8375            if let Some(ref mut details) = poller_options.tracing {
8376                details.method_name = "google_cloud_networksecurity_v1::client::Intercept::update_intercept_endpoint_group::until_done";
8377            }
8378
8379            let stub = self.0.stub.clone();
8380            let mut options = self.0.options.clone();
8381            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8382            let query = move |name| {
8383                let stub = stub.clone();
8384                let options = options.clone();
8385                async {
8386                    let op = GetOperation::new(stub)
8387                        .set_name(name)
8388                        .with_options(options)
8389                        .send()
8390                        .await?;
8391                    Ok(Operation::new(op))
8392                }
8393            };
8394
8395            let start = move || async {
8396                let op = self.send().await?;
8397                Ok(Operation::new(op))
8398            };
8399
8400            use google_cloud_lro::internal::PollerExt;
8401            {
8402                google_cloud_lro::internal::new_poller(
8403                    polling_error_policy,
8404                    polling_backoff_policy,
8405                    start,
8406                    query,
8407                )
8408            }
8409            .with_options(poller_options)
8410        }
8411
8412        /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
8413        pub fn set_update_mask<T>(mut self, v: T) -> Self
8414        where
8415            T: std::convert::Into<wkt::FieldMask>,
8416        {
8417            self.0.request.update_mask = std::option::Option::Some(v.into());
8418            self
8419        }
8420
8421        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
8422        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8423        where
8424            T: std::convert::Into<wkt::FieldMask>,
8425        {
8426            self.0.request.update_mask = v.map(|x| x.into());
8427            self
8428        }
8429
8430        /// Sets the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
8431        ///
8432        /// This is a **required** field for requests.
8433        pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
8434        where
8435            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8436        {
8437            self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
8438            self
8439        }
8440
8441        /// Sets or clears the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
8442        ///
8443        /// This is a **required** field for requests.
8444        pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
8445        where
8446            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8447        {
8448            self.0.request.intercept_endpoint_group = v.map(|x| x.into());
8449            self
8450        }
8451
8452        /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupRequest::request_id].
8453        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8454            self.0.request.request_id = v.into();
8455            self
8456        }
8457    }
8458
8459    #[doc(hidden)]
8460    impl crate::RequestBuilder for UpdateInterceptEndpointGroup {
8461        fn request_options(&mut self) -> &mut crate::RequestOptions {
8462            &mut self.0.options
8463        }
8464    }
8465
8466    /// The request builder for [Intercept::delete_intercept_endpoint_group][crate::client::Intercept::delete_intercept_endpoint_group] calls.
8467    ///
8468    /// # Example
8469    /// ```
8470    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptEndpointGroup;
8471    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8472    /// use google_cloud_lro::Poller;
8473    ///
8474    /// let builder = prepare_request_builder();
8475    /// let response = builder.poller().until_done().await?;
8476    /// # Ok(()) }
8477    ///
8478    /// fn prepare_request_builder() -> DeleteInterceptEndpointGroup {
8479    ///   # panic!();
8480    ///   // ... details omitted ...
8481    /// }
8482    /// ```
8483    #[derive(Clone, Debug)]
8484    pub struct DeleteInterceptEndpointGroup(
8485        RequestBuilder<crate::model::DeleteInterceptEndpointGroupRequest>,
8486    );
8487
8488    impl DeleteInterceptEndpointGroup {
8489        pub(crate) fn new(
8490            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8491        ) -> Self {
8492            Self(RequestBuilder::new(stub))
8493        }
8494
8495        /// Sets the full request, replacing any prior values.
8496        pub fn with_request<V: Into<crate::model::DeleteInterceptEndpointGroupRequest>>(
8497            mut self,
8498            v: V,
8499        ) -> Self {
8500            self.0.request = v.into();
8501            self
8502        }
8503
8504        /// Sets all the options, replacing any prior values.
8505        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8506            self.0.options = v.into();
8507            self
8508        }
8509
8510        /// Sends the request.
8511        ///
8512        /// # Long running operations
8513        ///
8514        /// This starts, but does not poll, a longrunning operation. More information
8515        /// on [delete_intercept_endpoint_group][crate::client::Intercept::delete_intercept_endpoint_group].
8516        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8517            (*self.0.stub)
8518                .delete_intercept_endpoint_group(self.0.request, self.0.options)
8519                .await
8520                .map(crate::Response::into_body)
8521        }
8522
8523        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_endpoint_group`.
8524        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
8525            type Operation =
8526                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8527            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8528            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8529            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8530            if let Some(ref mut details) = poller_options.tracing {
8531                details.method_name = "google_cloud_networksecurity_v1::client::Intercept::delete_intercept_endpoint_group::until_done";
8532            }
8533
8534            let stub = self.0.stub.clone();
8535            let mut options = self.0.options.clone();
8536            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8537            let query = move |name| {
8538                let stub = stub.clone();
8539                let options = options.clone();
8540                async {
8541                    let op = GetOperation::new(stub)
8542                        .set_name(name)
8543                        .with_options(options)
8544                        .send()
8545                        .await?;
8546                    Ok(Operation::new(op))
8547                }
8548            };
8549
8550            let start = move || async {
8551                let op = self.send().await?;
8552                Ok(Operation::new(op))
8553            };
8554
8555            use google_cloud_lro::internal::PollerExt;
8556            {
8557                google_cloud_lro::internal::new_unit_response_poller(
8558                    polling_error_policy,
8559                    polling_backoff_policy,
8560                    start,
8561                    query,
8562                )
8563            }
8564            .with_options(poller_options)
8565        }
8566
8567        /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupRequest::name].
8568        ///
8569        /// This is a **required** field for requests.
8570        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8571            self.0.request.name = v.into();
8572            self
8573        }
8574
8575        /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupRequest::request_id].
8576        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8577            self.0.request.request_id = v.into();
8578            self
8579        }
8580    }
8581
8582    #[doc(hidden)]
8583    impl crate::RequestBuilder for DeleteInterceptEndpointGroup {
8584        fn request_options(&mut self) -> &mut crate::RequestOptions {
8585            &mut self.0.options
8586        }
8587    }
8588
8589    /// The request builder for [Intercept::list_intercept_endpoint_group_associations][crate::client::Intercept::list_intercept_endpoint_group_associations] calls.
8590    ///
8591    /// # Example
8592    /// ```
8593    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptEndpointGroupAssociations;
8594    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8595    /// use google_cloud_gax::paginator::ItemPaginator;
8596    ///
8597    /// let builder = prepare_request_builder();
8598    /// let mut items = builder.by_item();
8599    /// while let Some(result) = items.next().await {
8600    ///   let item = result?;
8601    /// }
8602    /// # Ok(()) }
8603    ///
8604    /// fn prepare_request_builder() -> ListInterceptEndpointGroupAssociations {
8605    ///   # panic!();
8606    ///   // ... details omitted ...
8607    /// }
8608    /// ```
8609    #[derive(Clone, Debug)]
8610    pub struct ListInterceptEndpointGroupAssociations(
8611        RequestBuilder<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
8612    );
8613
8614    impl ListInterceptEndpointGroupAssociations {
8615        pub(crate) fn new(
8616            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8617        ) -> Self {
8618            Self(RequestBuilder::new(stub))
8619        }
8620
8621        /// Sets the full request, replacing any prior values.
8622        pub fn with_request<
8623            V: Into<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
8624        >(
8625            mut self,
8626            v: V,
8627        ) -> Self {
8628            self.0.request = v.into();
8629            self
8630        }
8631
8632        /// Sets all the options, replacing any prior values.
8633        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8634            self.0.options = v.into();
8635            self
8636        }
8637
8638        /// Sends the request.
8639        pub async fn send(
8640            self,
8641        ) -> Result<crate::model::ListInterceptEndpointGroupAssociationsResponse> {
8642            (*self.0.stub)
8643                .list_intercept_endpoint_group_associations(self.0.request, self.0.options)
8644                .await
8645                .map(crate::Response::into_body)
8646        }
8647
8648        /// Streams each page in the collection.
8649        pub fn by_page(
8650            self,
8651        ) -> impl google_cloud_gax::paginator::Paginator<
8652            crate::model::ListInterceptEndpointGroupAssociationsResponse,
8653            crate::Error,
8654        > {
8655            use std::clone::Clone;
8656            let token = self.0.request.page_token.clone();
8657            let execute = move |token: String| {
8658                let mut builder = self.clone();
8659                builder.0.request = builder.0.request.set_page_token(token);
8660                builder.send()
8661            };
8662            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8663        }
8664
8665        /// Streams each item in the collection.
8666        pub fn by_item(
8667            self,
8668        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8669            crate::model::ListInterceptEndpointGroupAssociationsResponse,
8670            crate::Error,
8671        > {
8672            use google_cloud_gax::paginator::Paginator;
8673            self.by_page().items()
8674        }
8675
8676        /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupAssociationsRequest::parent].
8677        ///
8678        /// This is a **required** field for requests.
8679        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8680            self.0.request.parent = v.into();
8681            self
8682        }
8683
8684        /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_size].
8685        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8686            self.0.request.page_size = v.into();
8687            self
8688        }
8689
8690        /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_token].
8691        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8692            self.0.request.page_token = v.into();
8693            self
8694        }
8695
8696        /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupAssociationsRequest::filter].
8697        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8698            self.0.request.filter = v.into();
8699            self
8700        }
8701
8702        /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupAssociationsRequest::order_by].
8703        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8704            self.0.request.order_by = v.into();
8705            self
8706        }
8707    }
8708
8709    #[doc(hidden)]
8710    impl crate::RequestBuilder for ListInterceptEndpointGroupAssociations {
8711        fn request_options(&mut self) -> &mut crate::RequestOptions {
8712            &mut self.0.options
8713        }
8714    }
8715
8716    /// The request builder for [Intercept::get_intercept_endpoint_group_association][crate::client::Intercept::get_intercept_endpoint_group_association] calls.
8717    ///
8718    /// # Example
8719    /// ```
8720    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptEndpointGroupAssociation;
8721    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8722    ///
8723    /// let builder = prepare_request_builder();
8724    /// let response = builder.send().await?;
8725    /// # Ok(()) }
8726    ///
8727    /// fn prepare_request_builder() -> GetInterceptEndpointGroupAssociation {
8728    ///   # panic!();
8729    ///   // ... details omitted ...
8730    /// }
8731    /// ```
8732    #[derive(Clone, Debug)]
8733    pub struct GetInterceptEndpointGroupAssociation(
8734        RequestBuilder<crate::model::GetInterceptEndpointGroupAssociationRequest>,
8735    );
8736
8737    impl GetInterceptEndpointGroupAssociation {
8738        pub(crate) fn new(
8739            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8740        ) -> Self {
8741            Self(RequestBuilder::new(stub))
8742        }
8743
8744        /// Sets the full request, replacing any prior values.
8745        pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupAssociationRequest>>(
8746            mut self,
8747            v: V,
8748        ) -> Self {
8749            self.0.request = v.into();
8750            self
8751        }
8752
8753        /// Sets all the options, replacing any prior values.
8754        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8755            self.0.options = v.into();
8756            self
8757        }
8758
8759        /// Sends the request.
8760        pub async fn send(self) -> Result<crate::model::InterceptEndpointGroupAssociation> {
8761            (*self.0.stub)
8762                .get_intercept_endpoint_group_association(self.0.request, self.0.options)
8763                .await
8764                .map(crate::Response::into_body)
8765        }
8766
8767        /// Sets the value of [name][crate::model::GetInterceptEndpointGroupAssociationRequest::name].
8768        ///
8769        /// This is a **required** field for requests.
8770        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8771            self.0.request.name = v.into();
8772            self
8773        }
8774    }
8775
8776    #[doc(hidden)]
8777    impl crate::RequestBuilder for GetInterceptEndpointGroupAssociation {
8778        fn request_options(&mut self) -> &mut crate::RequestOptions {
8779            &mut self.0.options
8780        }
8781    }
8782
8783    /// The request builder for [Intercept::create_intercept_endpoint_group_association][crate::client::Intercept::create_intercept_endpoint_group_association] calls.
8784    ///
8785    /// # Example
8786    /// ```
8787    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptEndpointGroupAssociation;
8788    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8789    /// use google_cloud_lro::Poller;
8790    ///
8791    /// let builder = prepare_request_builder();
8792    /// let response = builder.poller().until_done().await?;
8793    /// # Ok(()) }
8794    ///
8795    /// fn prepare_request_builder() -> CreateInterceptEndpointGroupAssociation {
8796    ///   # panic!();
8797    ///   // ... details omitted ...
8798    /// }
8799    /// ```
8800    #[derive(Clone, Debug)]
8801    pub struct CreateInterceptEndpointGroupAssociation(
8802        RequestBuilder<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
8803    );
8804
8805    impl CreateInterceptEndpointGroupAssociation {
8806        pub(crate) fn new(
8807            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8808        ) -> Self {
8809            Self(RequestBuilder::new(stub))
8810        }
8811
8812        /// Sets the full request, replacing any prior values.
8813        pub fn with_request<
8814            V: Into<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
8815        >(
8816            mut self,
8817            v: V,
8818        ) -> Self {
8819            self.0.request = v.into();
8820            self
8821        }
8822
8823        /// Sets all the options, replacing any prior values.
8824        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8825            self.0.options = v.into();
8826            self
8827        }
8828
8829        /// Sends the request.
8830        ///
8831        /// # Long running operations
8832        ///
8833        /// This starts, but does not poll, a longrunning operation. More information
8834        /// on [create_intercept_endpoint_group_association][crate::client::Intercept::create_intercept_endpoint_group_association].
8835        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8836            (*self.0.stub)
8837                .create_intercept_endpoint_group_association(self.0.request, self.0.options)
8838                .await
8839                .map(crate::Response::into_body)
8840        }
8841
8842        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_endpoint_group_association`.
8843        pub fn poller(
8844            self,
8845        ) -> impl google_cloud_lro::Poller<
8846            crate::model::InterceptEndpointGroupAssociation,
8847            crate::model::OperationMetadata,
8848        > {
8849            type Operation = google_cloud_lro::internal::Operation<
8850                crate::model::InterceptEndpointGroupAssociation,
8851                crate::model::OperationMetadata,
8852            >;
8853            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8854            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8855            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8856            if let Some(ref mut details) = poller_options.tracing {
8857                details.method_name = "google_cloud_networksecurity_v1::client::Intercept::create_intercept_endpoint_group_association::until_done";
8858            }
8859
8860            let stub = self.0.stub.clone();
8861            let mut options = self.0.options.clone();
8862            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8863            let query = move |name| {
8864                let stub = stub.clone();
8865                let options = options.clone();
8866                async {
8867                    let op = GetOperation::new(stub)
8868                        .set_name(name)
8869                        .with_options(options)
8870                        .send()
8871                        .await?;
8872                    Ok(Operation::new(op))
8873                }
8874            };
8875
8876            let start = move || async {
8877                let op = self.send().await?;
8878                Ok(Operation::new(op))
8879            };
8880
8881            use google_cloud_lro::internal::PollerExt;
8882            {
8883                google_cloud_lro::internal::new_poller(
8884                    polling_error_policy,
8885                    polling_backoff_policy,
8886                    start,
8887                    query,
8888                )
8889            }
8890            .with_options(poller_options)
8891        }
8892
8893        /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupAssociationRequest::parent].
8894        ///
8895        /// This is a **required** field for requests.
8896        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8897            self.0.request.parent = v.into();
8898            self
8899        }
8900
8901        /// Sets the value of [intercept_endpoint_group_association_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association_id].
8902        pub fn set_intercept_endpoint_group_association_id<T: Into<std::string::String>>(
8903            mut self,
8904            v: T,
8905        ) -> Self {
8906            self.0.request.intercept_endpoint_group_association_id = v.into();
8907            self
8908        }
8909
8910        /// Sets the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
8911        ///
8912        /// This is a **required** field for requests.
8913        pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
8914        where
8915            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8916        {
8917            self.0.request.intercept_endpoint_group_association =
8918                std::option::Option::Some(v.into());
8919            self
8920        }
8921
8922        /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
8923        ///
8924        /// This is a **required** field for requests.
8925        pub fn set_or_clear_intercept_endpoint_group_association<T>(
8926            mut self,
8927            v: std::option::Option<T>,
8928        ) -> Self
8929        where
8930            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8931        {
8932            self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
8933            self
8934        }
8935
8936        /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::request_id].
8937        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8938            self.0.request.request_id = v.into();
8939            self
8940        }
8941    }
8942
8943    #[doc(hidden)]
8944    impl crate::RequestBuilder for CreateInterceptEndpointGroupAssociation {
8945        fn request_options(&mut self) -> &mut crate::RequestOptions {
8946            &mut self.0.options
8947        }
8948    }
8949
8950    /// The request builder for [Intercept::update_intercept_endpoint_group_association][crate::client::Intercept::update_intercept_endpoint_group_association] calls.
8951    ///
8952    /// # Example
8953    /// ```
8954    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptEndpointGroupAssociation;
8955    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8956    /// use google_cloud_lro::Poller;
8957    ///
8958    /// let builder = prepare_request_builder();
8959    /// let response = builder.poller().until_done().await?;
8960    /// # Ok(()) }
8961    ///
8962    /// fn prepare_request_builder() -> UpdateInterceptEndpointGroupAssociation {
8963    ///   # panic!();
8964    ///   // ... details omitted ...
8965    /// }
8966    /// ```
8967    #[derive(Clone, Debug)]
8968    pub struct UpdateInterceptEndpointGroupAssociation(
8969        RequestBuilder<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8970    );
8971
8972    impl UpdateInterceptEndpointGroupAssociation {
8973        pub(crate) fn new(
8974            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8975        ) -> Self {
8976            Self(RequestBuilder::new(stub))
8977        }
8978
8979        /// Sets the full request, replacing any prior values.
8980        pub fn with_request<
8981            V: Into<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8982        >(
8983            mut self,
8984            v: V,
8985        ) -> Self {
8986            self.0.request = v.into();
8987            self
8988        }
8989
8990        /// Sets all the options, replacing any prior values.
8991        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8992            self.0.options = v.into();
8993            self
8994        }
8995
8996        /// Sends the request.
8997        ///
8998        /// # Long running operations
8999        ///
9000        /// This starts, but does not poll, a longrunning operation. More information
9001        /// on [update_intercept_endpoint_group_association][crate::client::Intercept::update_intercept_endpoint_group_association].
9002        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9003            (*self.0.stub)
9004                .update_intercept_endpoint_group_association(self.0.request, self.0.options)
9005                .await
9006                .map(crate::Response::into_body)
9007        }
9008
9009        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_endpoint_group_association`.
9010        pub fn poller(
9011            self,
9012        ) -> impl google_cloud_lro::Poller<
9013            crate::model::InterceptEndpointGroupAssociation,
9014            crate::model::OperationMetadata,
9015        > {
9016            type Operation = google_cloud_lro::internal::Operation<
9017                crate::model::InterceptEndpointGroupAssociation,
9018                crate::model::OperationMetadata,
9019            >;
9020            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9021            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9022            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9023            if let Some(ref mut details) = poller_options.tracing {
9024                details.method_name = "google_cloud_networksecurity_v1::client::Intercept::update_intercept_endpoint_group_association::until_done";
9025            }
9026
9027            let stub = self.0.stub.clone();
9028            let mut options = self.0.options.clone();
9029            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9030            let query = move |name| {
9031                let stub = stub.clone();
9032                let options = options.clone();
9033                async {
9034                    let op = GetOperation::new(stub)
9035                        .set_name(name)
9036                        .with_options(options)
9037                        .send()
9038                        .await?;
9039                    Ok(Operation::new(op))
9040                }
9041            };
9042
9043            let start = move || async {
9044                let op = self.send().await?;
9045                Ok(Operation::new(op))
9046            };
9047
9048            use google_cloud_lro::internal::PollerExt;
9049            {
9050                google_cloud_lro::internal::new_poller(
9051                    polling_error_policy,
9052                    polling_backoff_policy,
9053                    start,
9054                    query,
9055                )
9056            }
9057            .with_options(poller_options)
9058        }
9059
9060        /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
9061        pub fn set_update_mask<T>(mut self, v: T) -> Self
9062        where
9063            T: std::convert::Into<wkt::FieldMask>,
9064        {
9065            self.0.request.update_mask = std::option::Option::Some(v.into());
9066            self
9067        }
9068
9069        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
9070        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9071        where
9072            T: std::convert::Into<wkt::FieldMask>,
9073        {
9074            self.0.request.update_mask = v.map(|x| x.into());
9075            self
9076        }
9077
9078        /// Sets the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
9079        ///
9080        /// This is a **required** field for requests.
9081        pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
9082        where
9083            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
9084        {
9085            self.0.request.intercept_endpoint_group_association =
9086                std::option::Option::Some(v.into());
9087            self
9088        }
9089
9090        /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
9091        ///
9092        /// This is a **required** field for requests.
9093        pub fn set_or_clear_intercept_endpoint_group_association<T>(
9094            mut self,
9095            v: std::option::Option<T>,
9096        ) -> Self
9097        where
9098            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
9099        {
9100            self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
9101            self
9102        }
9103
9104        /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupAssociationRequest::request_id].
9105        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9106            self.0.request.request_id = v.into();
9107            self
9108        }
9109    }
9110
9111    #[doc(hidden)]
9112    impl crate::RequestBuilder for UpdateInterceptEndpointGroupAssociation {
9113        fn request_options(&mut self) -> &mut crate::RequestOptions {
9114            &mut self.0.options
9115        }
9116    }
9117
9118    /// The request builder for [Intercept::delete_intercept_endpoint_group_association][crate::client::Intercept::delete_intercept_endpoint_group_association] calls.
9119    ///
9120    /// # Example
9121    /// ```
9122    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptEndpointGroupAssociation;
9123    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9124    /// use google_cloud_lro::Poller;
9125    ///
9126    /// let builder = prepare_request_builder();
9127    /// let response = builder.poller().until_done().await?;
9128    /// # Ok(()) }
9129    ///
9130    /// fn prepare_request_builder() -> DeleteInterceptEndpointGroupAssociation {
9131    ///   # panic!();
9132    ///   // ... details omitted ...
9133    /// }
9134    /// ```
9135    #[derive(Clone, Debug)]
9136    pub struct DeleteInterceptEndpointGroupAssociation(
9137        RequestBuilder<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
9138    );
9139
9140    impl DeleteInterceptEndpointGroupAssociation {
9141        pub(crate) fn new(
9142            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9143        ) -> Self {
9144            Self(RequestBuilder::new(stub))
9145        }
9146
9147        /// Sets the full request, replacing any prior values.
9148        pub fn with_request<
9149            V: Into<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
9150        >(
9151            mut self,
9152            v: V,
9153        ) -> Self {
9154            self.0.request = v.into();
9155            self
9156        }
9157
9158        /// Sets all the options, replacing any prior values.
9159        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9160            self.0.options = v.into();
9161            self
9162        }
9163
9164        /// Sends the request.
9165        ///
9166        /// # Long running operations
9167        ///
9168        /// This starts, but does not poll, a longrunning operation. More information
9169        /// on [delete_intercept_endpoint_group_association][crate::client::Intercept::delete_intercept_endpoint_group_association].
9170        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9171            (*self.0.stub)
9172                .delete_intercept_endpoint_group_association(self.0.request, self.0.options)
9173                .await
9174                .map(crate::Response::into_body)
9175        }
9176
9177        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_endpoint_group_association`.
9178        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9179            type Operation =
9180                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9181            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9182            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9183            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9184            if let Some(ref mut details) = poller_options.tracing {
9185                details.method_name = "google_cloud_networksecurity_v1::client::Intercept::delete_intercept_endpoint_group_association::until_done";
9186            }
9187
9188            let stub = self.0.stub.clone();
9189            let mut options = self.0.options.clone();
9190            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9191            let query = move |name| {
9192                let stub = stub.clone();
9193                let options = options.clone();
9194                async {
9195                    let op = GetOperation::new(stub)
9196                        .set_name(name)
9197                        .with_options(options)
9198                        .send()
9199                        .await?;
9200                    Ok(Operation::new(op))
9201                }
9202            };
9203
9204            let start = move || async {
9205                let op = self.send().await?;
9206                Ok(Operation::new(op))
9207            };
9208
9209            use google_cloud_lro::internal::PollerExt;
9210            {
9211                google_cloud_lro::internal::new_unit_response_poller(
9212                    polling_error_policy,
9213                    polling_backoff_policy,
9214                    start,
9215                    query,
9216                )
9217            }
9218            .with_options(poller_options)
9219        }
9220
9221        /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupAssociationRequest::name].
9222        ///
9223        /// This is a **required** field for requests.
9224        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9225            self.0.request.name = v.into();
9226            self
9227        }
9228
9229        /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupAssociationRequest::request_id].
9230        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9231            self.0.request.request_id = v.into();
9232            self
9233        }
9234    }
9235
9236    #[doc(hidden)]
9237    impl crate::RequestBuilder for DeleteInterceptEndpointGroupAssociation {
9238        fn request_options(&mut self) -> &mut crate::RequestOptions {
9239            &mut self.0.options
9240        }
9241    }
9242
9243    /// The request builder for [Intercept::list_intercept_deployment_groups][crate::client::Intercept::list_intercept_deployment_groups] calls.
9244    ///
9245    /// # Example
9246    /// ```
9247    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptDeploymentGroups;
9248    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9249    /// use google_cloud_gax::paginator::ItemPaginator;
9250    ///
9251    /// let builder = prepare_request_builder();
9252    /// let mut items = builder.by_item();
9253    /// while let Some(result) = items.next().await {
9254    ///   let item = result?;
9255    /// }
9256    /// # Ok(()) }
9257    ///
9258    /// fn prepare_request_builder() -> ListInterceptDeploymentGroups {
9259    ///   # panic!();
9260    ///   // ... details omitted ...
9261    /// }
9262    /// ```
9263    #[derive(Clone, Debug)]
9264    pub struct ListInterceptDeploymentGroups(
9265        RequestBuilder<crate::model::ListInterceptDeploymentGroupsRequest>,
9266    );
9267
9268    impl ListInterceptDeploymentGroups {
9269        pub(crate) fn new(
9270            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9271        ) -> Self {
9272            Self(RequestBuilder::new(stub))
9273        }
9274
9275        /// Sets the full request, replacing any prior values.
9276        pub fn with_request<V: Into<crate::model::ListInterceptDeploymentGroupsRequest>>(
9277            mut self,
9278            v: V,
9279        ) -> Self {
9280            self.0.request = v.into();
9281            self
9282        }
9283
9284        /// Sets all the options, replacing any prior values.
9285        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9286            self.0.options = v.into();
9287            self
9288        }
9289
9290        /// Sends the request.
9291        pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentGroupsResponse> {
9292            (*self.0.stub)
9293                .list_intercept_deployment_groups(self.0.request, self.0.options)
9294                .await
9295                .map(crate::Response::into_body)
9296        }
9297
9298        /// Streams each page in the collection.
9299        pub fn by_page(
9300            self,
9301        ) -> impl google_cloud_gax::paginator::Paginator<
9302            crate::model::ListInterceptDeploymentGroupsResponse,
9303            crate::Error,
9304        > {
9305            use std::clone::Clone;
9306            let token = self.0.request.page_token.clone();
9307            let execute = move |token: String| {
9308                let mut builder = self.clone();
9309                builder.0.request = builder.0.request.set_page_token(token);
9310                builder.send()
9311            };
9312            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9313        }
9314
9315        /// Streams each item in the collection.
9316        pub fn by_item(
9317            self,
9318        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9319            crate::model::ListInterceptDeploymentGroupsResponse,
9320            crate::Error,
9321        > {
9322            use google_cloud_gax::paginator::Paginator;
9323            self.by_page().items()
9324        }
9325
9326        /// Sets the value of [parent][crate::model::ListInterceptDeploymentGroupsRequest::parent].
9327        ///
9328        /// This is a **required** field for requests.
9329        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9330            self.0.request.parent = v.into();
9331            self
9332        }
9333
9334        /// Sets the value of [page_size][crate::model::ListInterceptDeploymentGroupsRequest::page_size].
9335        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9336            self.0.request.page_size = v.into();
9337            self
9338        }
9339
9340        /// Sets the value of [page_token][crate::model::ListInterceptDeploymentGroupsRequest::page_token].
9341        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9342            self.0.request.page_token = v.into();
9343            self
9344        }
9345
9346        /// Sets the value of [filter][crate::model::ListInterceptDeploymentGroupsRequest::filter].
9347        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9348            self.0.request.filter = v.into();
9349            self
9350        }
9351
9352        /// Sets the value of [order_by][crate::model::ListInterceptDeploymentGroupsRequest::order_by].
9353        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9354            self.0.request.order_by = v.into();
9355            self
9356        }
9357    }
9358
9359    #[doc(hidden)]
9360    impl crate::RequestBuilder for ListInterceptDeploymentGroups {
9361        fn request_options(&mut self) -> &mut crate::RequestOptions {
9362            &mut self.0.options
9363        }
9364    }
9365
9366    /// The request builder for [Intercept::get_intercept_deployment_group][crate::client::Intercept::get_intercept_deployment_group] calls.
9367    ///
9368    /// # Example
9369    /// ```
9370    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptDeploymentGroup;
9371    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9372    ///
9373    /// let builder = prepare_request_builder();
9374    /// let response = builder.send().await?;
9375    /// # Ok(()) }
9376    ///
9377    /// fn prepare_request_builder() -> GetInterceptDeploymentGroup {
9378    ///   # panic!();
9379    ///   // ... details omitted ...
9380    /// }
9381    /// ```
9382    #[derive(Clone, Debug)]
9383    pub struct GetInterceptDeploymentGroup(
9384        RequestBuilder<crate::model::GetInterceptDeploymentGroupRequest>,
9385    );
9386
9387    impl GetInterceptDeploymentGroup {
9388        pub(crate) fn new(
9389            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9390        ) -> Self {
9391            Self(RequestBuilder::new(stub))
9392        }
9393
9394        /// Sets the full request, replacing any prior values.
9395        pub fn with_request<V: Into<crate::model::GetInterceptDeploymentGroupRequest>>(
9396            mut self,
9397            v: V,
9398        ) -> Self {
9399            self.0.request = v.into();
9400            self
9401        }
9402
9403        /// Sets all the options, replacing any prior values.
9404        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9405            self.0.options = v.into();
9406            self
9407        }
9408
9409        /// Sends the request.
9410        pub async fn send(self) -> Result<crate::model::InterceptDeploymentGroup> {
9411            (*self.0.stub)
9412                .get_intercept_deployment_group(self.0.request, self.0.options)
9413                .await
9414                .map(crate::Response::into_body)
9415        }
9416
9417        /// Sets the value of [name][crate::model::GetInterceptDeploymentGroupRequest::name].
9418        ///
9419        /// This is a **required** field for requests.
9420        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9421            self.0.request.name = v.into();
9422            self
9423        }
9424    }
9425
9426    #[doc(hidden)]
9427    impl crate::RequestBuilder for GetInterceptDeploymentGroup {
9428        fn request_options(&mut self) -> &mut crate::RequestOptions {
9429            &mut self.0.options
9430        }
9431    }
9432
9433    /// The request builder for [Intercept::create_intercept_deployment_group][crate::client::Intercept::create_intercept_deployment_group] calls.
9434    ///
9435    /// # Example
9436    /// ```
9437    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptDeploymentGroup;
9438    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9439    /// use google_cloud_lro::Poller;
9440    ///
9441    /// let builder = prepare_request_builder();
9442    /// let response = builder.poller().until_done().await?;
9443    /// # Ok(()) }
9444    ///
9445    /// fn prepare_request_builder() -> CreateInterceptDeploymentGroup {
9446    ///   # panic!();
9447    ///   // ... details omitted ...
9448    /// }
9449    /// ```
9450    #[derive(Clone, Debug)]
9451    pub struct CreateInterceptDeploymentGroup(
9452        RequestBuilder<crate::model::CreateInterceptDeploymentGroupRequest>,
9453    );
9454
9455    impl CreateInterceptDeploymentGroup {
9456        pub(crate) fn new(
9457            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9458        ) -> Self {
9459            Self(RequestBuilder::new(stub))
9460        }
9461
9462        /// Sets the full request, replacing any prior values.
9463        pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentGroupRequest>>(
9464            mut self,
9465            v: V,
9466        ) -> Self {
9467            self.0.request = v.into();
9468            self
9469        }
9470
9471        /// Sets all the options, replacing any prior values.
9472        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9473            self.0.options = v.into();
9474            self
9475        }
9476
9477        /// Sends the request.
9478        ///
9479        /// # Long running operations
9480        ///
9481        /// This starts, but does not poll, a longrunning operation. More information
9482        /// on [create_intercept_deployment_group][crate::client::Intercept::create_intercept_deployment_group].
9483        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9484            (*self.0.stub)
9485                .create_intercept_deployment_group(self.0.request, self.0.options)
9486                .await
9487                .map(crate::Response::into_body)
9488        }
9489
9490        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_deployment_group`.
9491        pub fn poller(
9492            self,
9493        ) -> impl google_cloud_lro::Poller<
9494            crate::model::InterceptDeploymentGroup,
9495            crate::model::OperationMetadata,
9496        > {
9497            type Operation = google_cloud_lro::internal::Operation<
9498                crate::model::InterceptDeploymentGroup,
9499                crate::model::OperationMetadata,
9500            >;
9501            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9502            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9503            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9504            if let Some(ref mut details) = poller_options.tracing {
9505                details.method_name = "google_cloud_networksecurity_v1::client::Intercept::create_intercept_deployment_group::until_done";
9506            }
9507
9508            let stub = self.0.stub.clone();
9509            let mut options = self.0.options.clone();
9510            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9511            let query = move |name| {
9512                let stub = stub.clone();
9513                let options = options.clone();
9514                async {
9515                    let op = GetOperation::new(stub)
9516                        .set_name(name)
9517                        .with_options(options)
9518                        .send()
9519                        .await?;
9520                    Ok(Operation::new(op))
9521                }
9522            };
9523
9524            let start = move || async {
9525                let op = self.send().await?;
9526                Ok(Operation::new(op))
9527            };
9528
9529            use google_cloud_lro::internal::PollerExt;
9530            {
9531                google_cloud_lro::internal::new_poller(
9532                    polling_error_policy,
9533                    polling_backoff_policy,
9534                    start,
9535                    query,
9536                )
9537            }
9538            .with_options(poller_options)
9539        }
9540
9541        /// Sets the value of [parent][crate::model::CreateInterceptDeploymentGroupRequest::parent].
9542        ///
9543        /// This is a **required** field for requests.
9544        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9545            self.0.request.parent = v.into();
9546            self
9547        }
9548
9549        /// Sets the value of [intercept_deployment_group_id][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group_id].
9550        ///
9551        /// This is a **required** field for requests.
9552        pub fn set_intercept_deployment_group_id<T: Into<std::string::String>>(
9553            mut self,
9554            v: T,
9555        ) -> Self {
9556            self.0.request.intercept_deployment_group_id = v.into();
9557            self
9558        }
9559
9560        /// Sets the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
9561        ///
9562        /// This is a **required** field for requests.
9563        pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
9564        where
9565            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9566        {
9567            self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
9568            self
9569        }
9570
9571        /// Sets or clears the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
9572        ///
9573        /// This is a **required** field for requests.
9574        pub fn set_or_clear_intercept_deployment_group<T>(
9575            mut self,
9576            v: std::option::Option<T>,
9577        ) -> Self
9578        where
9579            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9580        {
9581            self.0.request.intercept_deployment_group = v.map(|x| x.into());
9582            self
9583        }
9584
9585        /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentGroupRequest::request_id].
9586        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9587            self.0.request.request_id = v.into();
9588            self
9589        }
9590    }
9591
9592    #[doc(hidden)]
9593    impl crate::RequestBuilder for CreateInterceptDeploymentGroup {
9594        fn request_options(&mut self) -> &mut crate::RequestOptions {
9595            &mut self.0.options
9596        }
9597    }
9598
9599    /// The request builder for [Intercept::update_intercept_deployment_group][crate::client::Intercept::update_intercept_deployment_group] calls.
9600    ///
9601    /// # Example
9602    /// ```
9603    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptDeploymentGroup;
9604    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9605    /// use google_cloud_lro::Poller;
9606    ///
9607    /// let builder = prepare_request_builder();
9608    /// let response = builder.poller().until_done().await?;
9609    /// # Ok(()) }
9610    ///
9611    /// fn prepare_request_builder() -> UpdateInterceptDeploymentGroup {
9612    ///   # panic!();
9613    ///   // ... details omitted ...
9614    /// }
9615    /// ```
9616    #[derive(Clone, Debug)]
9617    pub struct UpdateInterceptDeploymentGroup(
9618        RequestBuilder<crate::model::UpdateInterceptDeploymentGroupRequest>,
9619    );
9620
9621    impl UpdateInterceptDeploymentGroup {
9622        pub(crate) fn new(
9623            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9624        ) -> Self {
9625            Self(RequestBuilder::new(stub))
9626        }
9627
9628        /// Sets the full request, replacing any prior values.
9629        pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentGroupRequest>>(
9630            mut self,
9631            v: V,
9632        ) -> Self {
9633            self.0.request = v.into();
9634            self
9635        }
9636
9637        /// Sets all the options, replacing any prior values.
9638        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9639            self.0.options = v.into();
9640            self
9641        }
9642
9643        /// Sends the request.
9644        ///
9645        /// # Long running operations
9646        ///
9647        /// This starts, but does not poll, a longrunning operation. More information
9648        /// on [update_intercept_deployment_group][crate::client::Intercept::update_intercept_deployment_group].
9649        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9650            (*self.0.stub)
9651                .update_intercept_deployment_group(self.0.request, self.0.options)
9652                .await
9653                .map(crate::Response::into_body)
9654        }
9655
9656        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_deployment_group`.
9657        pub fn poller(
9658            self,
9659        ) -> impl google_cloud_lro::Poller<
9660            crate::model::InterceptDeploymentGroup,
9661            crate::model::OperationMetadata,
9662        > {
9663            type Operation = google_cloud_lro::internal::Operation<
9664                crate::model::InterceptDeploymentGroup,
9665                crate::model::OperationMetadata,
9666            >;
9667            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9668            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9669            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9670            if let Some(ref mut details) = poller_options.tracing {
9671                details.method_name = "google_cloud_networksecurity_v1::client::Intercept::update_intercept_deployment_group::until_done";
9672            }
9673
9674            let stub = self.0.stub.clone();
9675            let mut options = self.0.options.clone();
9676            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9677            let query = move |name| {
9678                let stub = stub.clone();
9679                let options = options.clone();
9680                async {
9681                    let op = GetOperation::new(stub)
9682                        .set_name(name)
9683                        .with_options(options)
9684                        .send()
9685                        .await?;
9686                    Ok(Operation::new(op))
9687                }
9688            };
9689
9690            let start = move || async {
9691                let op = self.send().await?;
9692                Ok(Operation::new(op))
9693            };
9694
9695            use google_cloud_lro::internal::PollerExt;
9696            {
9697                google_cloud_lro::internal::new_poller(
9698                    polling_error_policy,
9699                    polling_backoff_policy,
9700                    start,
9701                    query,
9702                )
9703            }
9704            .with_options(poller_options)
9705        }
9706
9707        /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
9708        pub fn set_update_mask<T>(mut self, v: T) -> Self
9709        where
9710            T: std::convert::Into<wkt::FieldMask>,
9711        {
9712            self.0.request.update_mask = std::option::Option::Some(v.into());
9713            self
9714        }
9715
9716        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
9717        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9718        where
9719            T: std::convert::Into<wkt::FieldMask>,
9720        {
9721            self.0.request.update_mask = v.map(|x| x.into());
9722            self
9723        }
9724
9725        /// Sets the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
9726        ///
9727        /// This is a **required** field for requests.
9728        pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
9729        where
9730            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9731        {
9732            self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
9733            self
9734        }
9735
9736        /// Sets or clears the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
9737        ///
9738        /// This is a **required** field for requests.
9739        pub fn set_or_clear_intercept_deployment_group<T>(
9740            mut self,
9741            v: std::option::Option<T>,
9742        ) -> Self
9743        where
9744            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9745        {
9746            self.0.request.intercept_deployment_group = v.map(|x| x.into());
9747            self
9748        }
9749
9750        /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentGroupRequest::request_id].
9751        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9752            self.0.request.request_id = v.into();
9753            self
9754        }
9755    }
9756
9757    #[doc(hidden)]
9758    impl crate::RequestBuilder for UpdateInterceptDeploymentGroup {
9759        fn request_options(&mut self) -> &mut crate::RequestOptions {
9760            &mut self.0.options
9761        }
9762    }
9763
9764    /// The request builder for [Intercept::delete_intercept_deployment_group][crate::client::Intercept::delete_intercept_deployment_group] calls.
9765    ///
9766    /// # Example
9767    /// ```
9768    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptDeploymentGroup;
9769    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9770    /// use google_cloud_lro::Poller;
9771    ///
9772    /// let builder = prepare_request_builder();
9773    /// let response = builder.poller().until_done().await?;
9774    /// # Ok(()) }
9775    ///
9776    /// fn prepare_request_builder() -> DeleteInterceptDeploymentGroup {
9777    ///   # panic!();
9778    ///   // ... details omitted ...
9779    /// }
9780    /// ```
9781    #[derive(Clone, Debug)]
9782    pub struct DeleteInterceptDeploymentGroup(
9783        RequestBuilder<crate::model::DeleteInterceptDeploymentGroupRequest>,
9784    );
9785
9786    impl DeleteInterceptDeploymentGroup {
9787        pub(crate) fn new(
9788            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9789        ) -> Self {
9790            Self(RequestBuilder::new(stub))
9791        }
9792
9793        /// Sets the full request, replacing any prior values.
9794        pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentGroupRequest>>(
9795            mut self,
9796            v: V,
9797        ) -> Self {
9798            self.0.request = v.into();
9799            self
9800        }
9801
9802        /// Sets all the options, replacing any prior values.
9803        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9804            self.0.options = v.into();
9805            self
9806        }
9807
9808        /// Sends the request.
9809        ///
9810        /// # Long running operations
9811        ///
9812        /// This starts, but does not poll, a longrunning operation. More information
9813        /// on [delete_intercept_deployment_group][crate::client::Intercept::delete_intercept_deployment_group].
9814        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9815            (*self.0.stub)
9816                .delete_intercept_deployment_group(self.0.request, self.0.options)
9817                .await
9818                .map(crate::Response::into_body)
9819        }
9820
9821        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_deployment_group`.
9822        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9823            type Operation =
9824                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9825            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9826            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9827            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9828            if let Some(ref mut details) = poller_options.tracing {
9829                details.method_name = "google_cloud_networksecurity_v1::client::Intercept::delete_intercept_deployment_group::until_done";
9830            }
9831
9832            let stub = self.0.stub.clone();
9833            let mut options = self.0.options.clone();
9834            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9835            let query = move |name| {
9836                let stub = stub.clone();
9837                let options = options.clone();
9838                async {
9839                    let op = GetOperation::new(stub)
9840                        .set_name(name)
9841                        .with_options(options)
9842                        .send()
9843                        .await?;
9844                    Ok(Operation::new(op))
9845                }
9846            };
9847
9848            let start = move || async {
9849                let op = self.send().await?;
9850                Ok(Operation::new(op))
9851            };
9852
9853            use google_cloud_lro::internal::PollerExt;
9854            {
9855                google_cloud_lro::internal::new_unit_response_poller(
9856                    polling_error_policy,
9857                    polling_backoff_policy,
9858                    start,
9859                    query,
9860                )
9861            }
9862            .with_options(poller_options)
9863        }
9864
9865        /// Sets the value of [name][crate::model::DeleteInterceptDeploymentGroupRequest::name].
9866        ///
9867        /// This is a **required** field for requests.
9868        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9869            self.0.request.name = v.into();
9870            self
9871        }
9872
9873        /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentGroupRequest::request_id].
9874        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9875            self.0.request.request_id = v.into();
9876            self
9877        }
9878    }
9879
9880    #[doc(hidden)]
9881    impl crate::RequestBuilder for DeleteInterceptDeploymentGroup {
9882        fn request_options(&mut self) -> &mut crate::RequestOptions {
9883            &mut self.0.options
9884        }
9885    }
9886
9887    /// The request builder for [Intercept::list_intercept_deployments][crate::client::Intercept::list_intercept_deployments] calls.
9888    ///
9889    /// # Example
9890    /// ```
9891    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptDeployments;
9892    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9893    /// use google_cloud_gax::paginator::ItemPaginator;
9894    ///
9895    /// let builder = prepare_request_builder();
9896    /// let mut items = builder.by_item();
9897    /// while let Some(result) = items.next().await {
9898    ///   let item = result?;
9899    /// }
9900    /// # Ok(()) }
9901    ///
9902    /// fn prepare_request_builder() -> ListInterceptDeployments {
9903    ///   # panic!();
9904    ///   // ... details omitted ...
9905    /// }
9906    /// ```
9907    #[derive(Clone, Debug)]
9908    pub struct ListInterceptDeployments(
9909        RequestBuilder<crate::model::ListInterceptDeploymentsRequest>,
9910    );
9911
9912    impl ListInterceptDeployments {
9913        pub(crate) fn new(
9914            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9915        ) -> Self {
9916            Self(RequestBuilder::new(stub))
9917        }
9918
9919        /// Sets the full request, replacing any prior values.
9920        pub fn with_request<V: Into<crate::model::ListInterceptDeploymentsRequest>>(
9921            mut self,
9922            v: V,
9923        ) -> Self {
9924            self.0.request = v.into();
9925            self
9926        }
9927
9928        /// Sets all the options, replacing any prior values.
9929        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9930            self.0.options = v.into();
9931            self
9932        }
9933
9934        /// Sends the request.
9935        pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentsResponse> {
9936            (*self.0.stub)
9937                .list_intercept_deployments(self.0.request, self.0.options)
9938                .await
9939                .map(crate::Response::into_body)
9940        }
9941
9942        /// Streams each page in the collection.
9943        pub fn by_page(
9944            self,
9945        ) -> impl google_cloud_gax::paginator::Paginator<
9946            crate::model::ListInterceptDeploymentsResponse,
9947            crate::Error,
9948        > {
9949            use std::clone::Clone;
9950            let token = self.0.request.page_token.clone();
9951            let execute = move |token: String| {
9952                let mut builder = self.clone();
9953                builder.0.request = builder.0.request.set_page_token(token);
9954                builder.send()
9955            };
9956            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9957        }
9958
9959        /// Streams each item in the collection.
9960        pub fn by_item(
9961            self,
9962        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9963            crate::model::ListInterceptDeploymentsResponse,
9964            crate::Error,
9965        > {
9966            use google_cloud_gax::paginator::Paginator;
9967            self.by_page().items()
9968        }
9969
9970        /// Sets the value of [parent][crate::model::ListInterceptDeploymentsRequest::parent].
9971        ///
9972        /// This is a **required** field for requests.
9973        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9974            self.0.request.parent = v.into();
9975            self
9976        }
9977
9978        /// Sets the value of [page_size][crate::model::ListInterceptDeploymentsRequest::page_size].
9979        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9980            self.0.request.page_size = v.into();
9981            self
9982        }
9983
9984        /// Sets the value of [page_token][crate::model::ListInterceptDeploymentsRequest::page_token].
9985        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9986            self.0.request.page_token = v.into();
9987            self
9988        }
9989
9990        /// Sets the value of [filter][crate::model::ListInterceptDeploymentsRequest::filter].
9991        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9992            self.0.request.filter = v.into();
9993            self
9994        }
9995
9996        /// Sets the value of [order_by][crate::model::ListInterceptDeploymentsRequest::order_by].
9997        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9998            self.0.request.order_by = v.into();
9999            self
10000        }
10001    }
10002
10003    #[doc(hidden)]
10004    impl crate::RequestBuilder for ListInterceptDeployments {
10005        fn request_options(&mut self) -> &mut crate::RequestOptions {
10006            &mut self.0.options
10007        }
10008    }
10009
10010    /// The request builder for [Intercept::get_intercept_deployment][crate::client::Intercept::get_intercept_deployment] calls.
10011    ///
10012    /// # Example
10013    /// ```
10014    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptDeployment;
10015    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10016    ///
10017    /// let builder = prepare_request_builder();
10018    /// let response = builder.send().await?;
10019    /// # Ok(()) }
10020    ///
10021    /// fn prepare_request_builder() -> GetInterceptDeployment {
10022    ///   # panic!();
10023    ///   // ... details omitted ...
10024    /// }
10025    /// ```
10026    #[derive(Clone, Debug)]
10027    pub struct GetInterceptDeployment(RequestBuilder<crate::model::GetInterceptDeploymentRequest>);
10028
10029    impl GetInterceptDeployment {
10030        pub(crate) fn new(
10031            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10032        ) -> Self {
10033            Self(RequestBuilder::new(stub))
10034        }
10035
10036        /// Sets the full request, replacing any prior values.
10037        pub fn with_request<V: Into<crate::model::GetInterceptDeploymentRequest>>(
10038            mut self,
10039            v: V,
10040        ) -> Self {
10041            self.0.request = v.into();
10042            self
10043        }
10044
10045        /// Sets all the options, replacing any prior values.
10046        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10047            self.0.options = v.into();
10048            self
10049        }
10050
10051        /// Sends the request.
10052        pub async fn send(self) -> Result<crate::model::InterceptDeployment> {
10053            (*self.0.stub)
10054                .get_intercept_deployment(self.0.request, self.0.options)
10055                .await
10056                .map(crate::Response::into_body)
10057        }
10058
10059        /// Sets the value of [name][crate::model::GetInterceptDeploymentRequest::name].
10060        ///
10061        /// This is a **required** field for requests.
10062        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10063            self.0.request.name = v.into();
10064            self
10065        }
10066    }
10067
10068    #[doc(hidden)]
10069    impl crate::RequestBuilder for GetInterceptDeployment {
10070        fn request_options(&mut self) -> &mut crate::RequestOptions {
10071            &mut self.0.options
10072        }
10073    }
10074
10075    /// The request builder for [Intercept::create_intercept_deployment][crate::client::Intercept::create_intercept_deployment] calls.
10076    ///
10077    /// # Example
10078    /// ```
10079    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptDeployment;
10080    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10081    /// use google_cloud_lro::Poller;
10082    ///
10083    /// let builder = prepare_request_builder();
10084    /// let response = builder.poller().until_done().await?;
10085    /// # Ok(()) }
10086    ///
10087    /// fn prepare_request_builder() -> CreateInterceptDeployment {
10088    ///   # panic!();
10089    ///   // ... details omitted ...
10090    /// }
10091    /// ```
10092    #[derive(Clone, Debug)]
10093    pub struct CreateInterceptDeployment(
10094        RequestBuilder<crate::model::CreateInterceptDeploymentRequest>,
10095    );
10096
10097    impl CreateInterceptDeployment {
10098        pub(crate) fn new(
10099            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10100        ) -> Self {
10101            Self(RequestBuilder::new(stub))
10102        }
10103
10104        /// Sets the full request, replacing any prior values.
10105        pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentRequest>>(
10106            mut self,
10107            v: V,
10108        ) -> Self {
10109            self.0.request = v.into();
10110            self
10111        }
10112
10113        /// Sets all the options, replacing any prior values.
10114        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10115            self.0.options = v.into();
10116            self
10117        }
10118
10119        /// Sends the request.
10120        ///
10121        /// # Long running operations
10122        ///
10123        /// This starts, but does not poll, a longrunning operation. More information
10124        /// on [create_intercept_deployment][crate::client::Intercept::create_intercept_deployment].
10125        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10126            (*self.0.stub)
10127                .create_intercept_deployment(self.0.request, self.0.options)
10128                .await
10129                .map(crate::Response::into_body)
10130        }
10131
10132        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_deployment`.
10133        pub fn poller(
10134            self,
10135        ) -> impl google_cloud_lro::Poller<
10136            crate::model::InterceptDeployment,
10137            crate::model::OperationMetadata,
10138        > {
10139            type Operation = google_cloud_lro::internal::Operation<
10140                crate::model::InterceptDeployment,
10141                crate::model::OperationMetadata,
10142            >;
10143            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10144            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10145            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
10146            if let Some(ref mut details) = poller_options.tracing {
10147                details.method_name = "google_cloud_networksecurity_v1::client::Intercept::create_intercept_deployment::until_done";
10148            }
10149
10150            let stub = self.0.stub.clone();
10151            let mut options = self.0.options.clone();
10152            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10153            let query = move |name| {
10154                let stub = stub.clone();
10155                let options = options.clone();
10156                async {
10157                    let op = GetOperation::new(stub)
10158                        .set_name(name)
10159                        .with_options(options)
10160                        .send()
10161                        .await?;
10162                    Ok(Operation::new(op))
10163                }
10164            };
10165
10166            let start = move || async {
10167                let op = self.send().await?;
10168                Ok(Operation::new(op))
10169            };
10170
10171            use google_cloud_lro::internal::PollerExt;
10172            {
10173                google_cloud_lro::internal::new_poller(
10174                    polling_error_policy,
10175                    polling_backoff_policy,
10176                    start,
10177                    query,
10178                )
10179            }
10180            .with_options(poller_options)
10181        }
10182
10183        /// Sets the value of [parent][crate::model::CreateInterceptDeploymentRequest::parent].
10184        ///
10185        /// This is a **required** field for requests.
10186        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10187            self.0.request.parent = v.into();
10188            self
10189        }
10190
10191        /// Sets the value of [intercept_deployment_id][crate::model::CreateInterceptDeploymentRequest::intercept_deployment_id].
10192        ///
10193        /// This is a **required** field for requests.
10194        pub fn set_intercept_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10195            self.0.request.intercept_deployment_id = v.into();
10196            self
10197        }
10198
10199        /// Sets the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
10200        ///
10201        /// This is a **required** field for requests.
10202        pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
10203        where
10204            T: std::convert::Into<crate::model::InterceptDeployment>,
10205        {
10206            self.0.request.intercept_deployment = std::option::Option::Some(v.into());
10207            self
10208        }
10209
10210        /// Sets or clears the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
10211        ///
10212        /// This is a **required** field for requests.
10213        pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
10214        where
10215            T: std::convert::Into<crate::model::InterceptDeployment>,
10216        {
10217            self.0.request.intercept_deployment = v.map(|x| x.into());
10218            self
10219        }
10220
10221        /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentRequest::request_id].
10222        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10223            self.0.request.request_id = v.into();
10224            self
10225        }
10226    }
10227
10228    #[doc(hidden)]
10229    impl crate::RequestBuilder for CreateInterceptDeployment {
10230        fn request_options(&mut self) -> &mut crate::RequestOptions {
10231            &mut self.0.options
10232        }
10233    }
10234
10235    /// The request builder for [Intercept::update_intercept_deployment][crate::client::Intercept::update_intercept_deployment] calls.
10236    ///
10237    /// # Example
10238    /// ```
10239    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptDeployment;
10240    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10241    /// use google_cloud_lro::Poller;
10242    ///
10243    /// let builder = prepare_request_builder();
10244    /// let response = builder.poller().until_done().await?;
10245    /// # Ok(()) }
10246    ///
10247    /// fn prepare_request_builder() -> UpdateInterceptDeployment {
10248    ///   # panic!();
10249    ///   // ... details omitted ...
10250    /// }
10251    /// ```
10252    #[derive(Clone, Debug)]
10253    pub struct UpdateInterceptDeployment(
10254        RequestBuilder<crate::model::UpdateInterceptDeploymentRequest>,
10255    );
10256
10257    impl UpdateInterceptDeployment {
10258        pub(crate) fn new(
10259            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10260        ) -> Self {
10261            Self(RequestBuilder::new(stub))
10262        }
10263
10264        /// Sets the full request, replacing any prior values.
10265        pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentRequest>>(
10266            mut self,
10267            v: V,
10268        ) -> Self {
10269            self.0.request = v.into();
10270            self
10271        }
10272
10273        /// Sets all the options, replacing any prior values.
10274        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10275            self.0.options = v.into();
10276            self
10277        }
10278
10279        /// Sends the request.
10280        ///
10281        /// # Long running operations
10282        ///
10283        /// This starts, but does not poll, a longrunning operation. More information
10284        /// on [update_intercept_deployment][crate::client::Intercept::update_intercept_deployment].
10285        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10286            (*self.0.stub)
10287                .update_intercept_deployment(self.0.request, self.0.options)
10288                .await
10289                .map(crate::Response::into_body)
10290        }
10291
10292        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_deployment`.
10293        pub fn poller(
10294            self,
10295        ) -> impl google_cloud_lro::Poller<
10296            crate::model::InterceptDeployment,
10297            crate::model::OperationMetadata,
10298        > {
10299            type Operation = google_cloud_lro::internal::Operation<
10300                crate::model::InterceptDeployment,
10301                crate::model::OperationMetadata,
10302            >;
10303            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10304            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10305            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
10306            if let Some(ref mut details) = poller_options.tracing {
10307                details.method_name = "google_cloud_networksecurity_v1::client::Intercept::update_intercept_deployment::until_done";
10308            }
10309
10310            let stub = self.0.stub.clone();
10311            let mut options = self.0.options.clone();
10312            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10313            let query = move |name| {
10314                let stub = stub.clone();
10315                let options = options.clone();
10316                async {
10317                    let op = GetOperation::new(stub)
10318                        .set_name(name)
10319                        .with_options(options)
10320                        .send()
10321                        .await?;
10322                    Ok(Operation::new(op))
10323                }
10324            };
10325
10326            let start = move || async {
10327                let op = self.send().await?;
10328                Ok(Operation::new(op))
10329            };
10330
10331            use google_cloud_lro::internal::PollerExt;
10332            {
10333                google_cloud_lro::internal::new_poller(
10334                    polling_error_policy,
10335                    polling_backoff_policy,
10336                    start,
10337                    query,
10338                )
10339            }
10340            .with_options(poller_options)
10341        }
10342
10343        /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
10344        pub fn set_update_mask<T>(mut self, v: T) -> Self
10345        where
10346            T: std::convert::Into<wkt::FieldMask>,
10347        {
10348            self.0.request.update_mask = std::option::Option::Some(v.into());
10349            self
10350        }
10351
10352        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
10353        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10354        where
10355            T: std::convert::Into<wkt::FieldMask>,
10356        {
10357            self.0.request.update_mask = v.map(|x| x.into());
10358            self
10359        }
10360
10361        /// Sets the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
10362        ///
10363        /// This is a **required** field for requests.
10364        pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
10365        where
10366            T: std::convert::Into<crate::model::InterceptDeployment>,
10367        {
10368            self.0.request.intercept_deployment = std::option::Option::Some(v.into());
10369            self
10370        }
10371
10372        /// Sets or clears the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
10373        ///
10374        /// This is a **required** field for requests.
10375        pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
10376        where
10377            T: std::convert::Into<crate::model::InterceptDeployment>,
10378        {
10379            self.0.request.intercept_deployment = v.map(|x| x.into());
10380            self
10381        }
10382
10383        /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentRequest::request_id].
10384        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10385            self.0.request.request_id = v.into();
10386            self
10387        }
10388    }
10389
10390    #[doc(hidden)]
10391    impl crate::RequestBuilder for UpdateInterceptDeployment {
10392        fn request_options(&mut self) -> &mut crate::RequestOptions {
10393            &mut self.0.options
10394        }
10395    }
10396
10397    /// The request builder for [Intercept::delete_intercept_deployment][crate::client::Intercept::delete_intercept_deployment] calls.
10398    ///
10399    /// # Example
10400    /// ```
10401    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptDeployment;
10402    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10403    /// use google_cloud_lro::Poller;
10404    ///
10405    /// let builder = prepare_request_builder();
10406    /// let response = builder.poller().until_done().await?;
10407    /// # Ok(()) }
10408    ///
10409    /// fn prepare_request_builder() -> DeleteInterceptDeployment {
10410    ///   # panic!();
10411    ///   // ... details omitted ...
10412    /// }
10413    /// ```
10414    #[derive(Clone, Debug)]
10415    pub struct DeleteInterceptDeployment(
10416        RequestBuilder<crate::model::DeleteInterceptDeploymentRequest>,
10417    );
10418
10419    impl DeleteInterceptDeployment {
10420        pub(crate) fn new(
10421            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10422        ) -> Self {
10423            Self(RequestBuilder::new(stub))
10424        }
10425
10426        /// Sets the full request, replacing any prior values.
10427        pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentRequest>>(
10428            mut self,
10429            v: V,
10430        ) -> Self {
10431            self.0.request = v.into();
10432            self
10433        }
10434
10435        /// Sets all the options, replacing any prior values.
10436        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10437            self.0.options = v.into();
10438            self
10439        }
10440
10441        /// Sends the request.
10442        ///
10443        /// # Long running operations
10444        ///
10445        /// This starts, but does not poll, a longrunning operation. More information
10446        /// on [delete_intercept_deployment][crate::client::Intercept::delete_intercept_deployment].
10447        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10448            (*self.0.stub)
10449                .delete_intercept_deployment(self.0.request, self.0.options)
10450                .await
10451                .map(crate::Response::into_body)
10452        }
10453
10454        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_deployment`.
10455        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
10456            type Operation =
10457                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10458            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10459            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10460            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
10461            if let Some(ref mut details) = poller_options.tracing {
10462                details.method_name = "google_cloud_networksecurity_v1::client::Intercept::delete_intercept_deployment::until_done";
10463            }
10464
10465            let stub = self.0.stub.clone();
10466            let mut options = self.0.options.clone();
10467            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10468            let query = move |name| {
10469                let stub = stub.clone();
10470                let options = options.clone();
10471                async {
10472                    let op = GetOperation::new(stub)
10473                        .set_name(name)
10474                        .with_options(options)
10475                        .send()
10476                        .await?;
10477                    Ok(Operation::new(op))
10478                }
10479            };
10480
10481            let start = move || async {
10482                let op = self.send().await?;
10483                Ok(Operation::new(op))
10484            };
10485
10486            use google_cloud_lro::internal::PollerExt;
10487            {
10488                google_cloud_lro::internal::new_unit_response_poller(
10489                    polling_error_policy,
10490                    polling_backoff_policy,
10491                    start,
10492                    query,
10493                )
10494            }
10495            .with_options(poller_options)
10496        }
10497
10498        /// Sets the value of [name][crate::model::DeleteInterceptDeploymentRequest::name].
10499        ///
10500        /// This is a **required** field for requests.
10501        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10502            self.0.request.name = v.into();
10503            self
10504        }
10505
10506        /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentRequest::request_id].
10507        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10508            self.0.request.request_id = v.into();
10509            self
10510        }
10511    }
10512
10513    #[doc(hidden)]
10514    impl crate::RequestBuilder for DeleteInterceptDeployment {
10515        fn request_options(&mut self) -> &mut crate::RequestOptions {
10516            &mut self.0.options
10517        }
10518    }
10519
10520    /// The request builder for [Intercept::list_locations][crate::client::Intercept::list_locations] calls.
10521    ///
10522    /// # Example
10523    /// ```
10524    /// # use google_cloud_networksecurity_v1::builder::intercept::ListLocations;
10525    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10526    /// use google_cloud_gax::paginator::ItemPaginator;
10527    ///
10528    /// let builder = prepare_request_builder();
10529    /// let mut items = builder.by_item();
10530    /// while let Some(result) = items.next().await {
10531    ///   let item = result?;
10532    /// }
10533    /// # Ok(()) }
10534    ///
10535    /// fn prepare_request_builder() -> ListLocations {
10536    ///   # panic!();
10537    ///   // ... details omitted ...
10538    /// }
10539    /// ```
10540    #[derive(Clone, Debug)]
10541    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10542
10543    impl ListLocations {
10544        pub(crate) fn new(
10545            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10546        ) -> Self {
10547            Self(RequestBuilder::new(stub))
10548        }
10549
10550        /// Sets the full request, replacing any prior values.
10551        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10552            mut self,
10553            v: V,
10554        ) -> Self {
10555            self.0.request = v.into();
10556            self
10557        }
10558
10559        /// Sets all the options, replacing any prior values.
10560        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10561            self.0.options = v.into();
10562            self
10563        }
10564
10565        /// Sends the request.
10566        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10567            (*self.0.stub)
10568                .list_locations(self.0.request, self.0.options)
10569                .await
10570                .map(crate::Response::into_body)
10571        }
10572
10573        /// Streams each page in the collection.
10574        pub fn by_page(
10575            self,
10576        ) -> impl google_cloud_gax::paginator::Paginator<
10577            google_cloud_location::model::ListLocationsResponse,
10578            crate::Error,
10579        > {
10580            use std::clone::Clone;
10581            let token = self.0.request.page_token.clone();
10582            let execute = move |token: String| {
10583                let mut builder = self.clone();
10584                builder.0.request = builder.0.request.set_page_token(token);
10585                builder.send()
10586            };
10587            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10588        }
10589
10590        /// Streams each item in the collection.
10591        pub fn by_item(
10592            self,
10593        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10594            google_cloud_location::model::ListLocationsResponse,
10595            crate::Error,
10596        > {
10597            use google_cloud_gax::paginator::Paginator;
10598            self.by_page().items()
10599        }
10600
10601        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
10602        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10603            self.0.request.name = v.into();
10604            self
10605        }
10606
10607        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
10608        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10609            self.0.request.filter = v.into();
10610            self
10611        }
10612
10613        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
10614        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10615            self.0.request.page_size = v.into();
10616            self
10617        }
10618
10619        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
10620        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10621            self.0.request.page_token = v.into();
10622            self
10623        }
10624    }
10625
10626    #[doc(hidden)]
10627    impl crate::RequestBuilder for ListLocations {
10628        fn request_options(&mut self) -> &mut crate::RequestOptions {
10629            &mut self.0.options
10630        }
10631    }
10632
10633    /// The request builder for [Intercept::get_location][crate::client::Intercept::get_location] calls.
10634    ///
10635    /// # Example
10636    /// ```
10637    /// # use google_cloud_networksecurity_v1::builder::intercept::GetLocation;
10638    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10639    ///
10640    /// let builder = prepare_request_builder();
10641    /// let response = builder.send().await?;
10642    /// # Ok(()) }
10643    ///
10644    /// fn prepare_request_builder() -> GetLocation {
10645    ///   # panic!();
10646    ///   // ... details omitted ...
10647    /// }
10648    /// ```
10649    #[derive(Clone, Debug)]
10650    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10651
10652    impl GetLocation {
10653        pub(crate) fn new(
10654            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10655        ) -> Self {
10656            Self(RequestBuilder::new(stub))
10657        }
10658
10659        /// Sets the full request, replacing any prior values.
10660        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10661            mut self,
10662            v: V,
10663        ) -> Self {
10664            self.0.request = v.into();
10665            self
10666        }
10667
10668        /// Sets all the options, replacing any prior values.
10669        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10670            self.0.options = v.into();
10671            self
10672        }
10673
10674        /// Sends the request.
10675        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10676            (*self.0.stub)
10677                .get_location(self.0.request, self.0.options)
10678                .await
10679                .map(crate::Response::into_body)
10680        }
10681
10682        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
10683        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10684            self.0.request.name = v.into();
10685            self
10686        }
10687    }
10688
10689    #[doc(hidden)]
10690    impl crate::RequestBuilder for GetLocation {
10691        fn request_options(&mut self) -> &mut crate::RequestOptions {
10692            &mut self.0.options
10693        }
10694    }
10695
10696    /// The request builder for [Intercept::set_iam_policy][crate::client::Intercept::set_iam_policy] calls.
10697    ///
10698    /// # Example
10699    /// ```
10700    /// # use google_cloud_networksecurity_v1::builder::intercept::SetIamPolicy;
10701    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10702    ///
10703    /// let builder = prepare_request_builder();
10704    /// let response = builder.send().await?;
10705    /// # Ok(()) }
10706    ///
10707    /// fn prepare_request_builder() -> SetIamPolicy {
10708    ///   # panic!();
10709    ///   // ... details omitted ...
10710    /// }
10711    /// ```
10712    #[derive(Clone, Debug)]
10713    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
10714
10715    impl SetIamPolicy {
10716        pub(crate) fn new(
10717            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10718        ) -> Self {
10719            Self(RequestBuilder::new(stub))
10720        }
10721
10722        /// Sets the full request, replacing any prior values.
10723        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
10724            mut self,
10725            v: V,
10726        ) -> Self {
10727            self.0.request = v.into();
10728            self
10729        }
10730
10731        /// Sets all the options, replacing any prior values.
10732        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10733            self.0.options = v.into();
10734            self
10735        }
10736
10737        /// Sends the request.
10738        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10739            (*self.0.stub)
10740                .set_iam_policy(self.0.request, self.0.options)
10741                .await
10742                .map(crate::Response::into_body)
10743        }
10744
10745        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
10746        ///
10747        /// This is a **required** field for requests.
10748        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10749            self.0.request.resource = v.into();
10750            self
10751        }
10752
10753        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
10754        ///
10755        /// This is a **required** field for requests.
10756        pub fn set_policy<T>(mut self, v: T) -> Self
10757        where
10758            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10759        {
10760            self.0.request.policy = std::option::Option::Some(v.into());
10761            self
10762        }
10763
10764        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
10765        ///
10766        /// This is a **required** field for requests.
10767        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10768        where
10769            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10770        {
10771            self.0.request.policy = v.map(|x| x.into());
10772            self
10773        }
10774
10775        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
10776        pub fn set_update_mask<T>(mut self, v: T) -> Self
10777        where
10778            T: std::convert::Into<wkt::FieldMask>,
10779        {
10780            self.0.request.update_mask = std::option::Option::Some(v.into());
10781            self
10782        }
10783
10784        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
10785        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10786        where
10787            T: std::convert::Into<wkt::FieldMask>,
10788        {
10789            self.0.request.update_mask = v.map(|x| x.into());
10790            self
10791        }
10792    }
10793
10794    #[doc(hidden)]
10795    impl crate::RequestBuilder for SetIamPolicy {
10796        fn request_options(&mut self) -> &mut crate::RequestOptions {
10797            &mut self.0.options
10798        }
10799    }
10800
10801    /// The request builder for [Intercept::get_iam_policy][crate::client::Intercept::get_iam_policy] calls.
10802    ///
10803    /// # Example
10804    /// ```
10805    /// # use google_cloud_networksecurity_v1::builder::intercept::GetIamPolicy;
10806    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10807    ///
10808    /// let builder = prepare_request_builder();
10809    /// let response = builder.send().await?;
10810    /// # Ok(()) }
10811    ///
10812    /// fn prepare_request_builder() -> GetIamPolicy {
10813    ///   # panic!();
10814    ///   // ... details omitted ...
10815    /// }
10816    /// ```
10817    #[derive(Clone, Debug)]
10818    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
10819
10820    impl GetIamPolicy {
10821        pub(crate) fn new(
10822            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10823        ) -> Self {
10824            Self(RequestBuilder::new(stub))
10825        }
10826
10827        /// Sets the full request, replacing any prior values.
10828        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
10829            mut self,
10830            v: V,
10831        ) -> Self {
10832            self.0.request = v.into();
10833            self
10834        }
10835
10836        /// Sets all the options, replacing any prior values.
10837        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10838            self.0.options = v.into();
10839            self
10840        }
10841
10842        /// Sends the request.
10843        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10844            (*self.0.stub)
10845                .get_iam_policy(self.0.request, self.0.options)
10846                .await
10847                .map(crate::Response::into_body)
10848        }
10849
10850        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
10851        ///
10852        /// This is a **required** field for requests.
10853        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10854            self.0.request.resource = v.into();
10855            self
10856        }
10857
10858        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
10859        pub fn set_options<T>(mut self, v: T) -> Self
10860        where
10861            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10862        {
10863            self.0.request.options = std::option::Option::Some(v.into());
10864            self
10865        }
10866
10867        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
10868        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10869        where
10870            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10871        {
10872            self.0.request.options = v.map(|x| x.into());
10873            self
10874        }
10875    }
10876
10877    #[doc(hidden)]
10878    impl crate::RequestBuilder for GetIamPolicy {
10879        fn request_options(&mut self) -> &mut crate::RequestOptions {
10880            &mut self.0.options
10881        }
10882    }
10883
10884    /// The request builder for [Intercept::test_iam_permissions][crate::client::Intercept::test_iam_permissions] calls.
10885    ///
10886    /// # Example
10887    /// ```
10888    /// # use google_cloud_networksecurity_v1::builder::intercept::TestIamPermissions;
10889    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10890    ///
10891    /// let builder = prepare_request_builder();
10892    /// let response = builder.send().await?;
10893    /// # Ok(()) }
10894    ///
10895    /// fn prepare_request_builder() -> TestIamPermissions {
10896    ///   # panic!();
10897    ///   // ... details omitted ...
10898    /// }
10899    /// ```
10900    #[derive(Clone, Debug)]
10901    pub struct TestIamPermissions(
10902        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
10903    );
10904
10905    impl TestIamPermissions {
10906        pub(crate) fn new(
10907            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10908        ) -> Self {
10909            Self(RequestBuilder::new(stub))
10910        }
10911
10912        /// Sets the full request, replacing any prior values.
10913        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
10914            mut self,
10915            v: V,
10916        ) -> Self {
10917            self.0.request = v.into();
10918            self
10919        }
10920
10921        /// Sets all the options, replacing any prior values.
10922        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10923            self.0.options = v.into();
10924            self
10925        }
10926
10927        /// Sends the request.
10928        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
10929            (*self.0.stub)
10930                .test_iam_permissions(self.0.request, self.0.options)
10931                .await
10932                .map(crate::Response::into_body)
10933        }
10934
10935        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
10936        ///
10937        /// This is a **required** field for requests.
10938        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10939            self.0.request.resource = v.into();
10940            self
10941        }
10942
10943        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
10944        ///
10945        /// This is a **required** field for requests.
10946        pub fn set_permissions<T, V>(mut self, v: T) -> Self
10947        where
10948            T: std::iter::IntoIterator<Item = V>,
10949            V: std::convert::Into<std::string::String>,
10950        {
10951            use std::iter::Iterator;
10952            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10953            self
10954        }
10955    }
10956
10957    #[doc(hidden)]
10958    impl crate::RequestBuilder for TestIamPermissions {
10959        fn request_options(&mut self) -> &mut crate::RequestOptions {
10960            &mut self.0.options
10961        }
10962    }
10963
10964    /// The request builder for [Intercept::list_operations][crate::client::Intercept::list_operations] calls.
10965    ///
10966    /// # Example
10967    /// ```
10968    /// # use google_cloud_networksecurity_v1::builder::intercept::ListOperations;
10969    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10970    /// use google_cloud_gax::paginator::ItemPaginator;
10971    ///
10972    /// let builder = prepare_request_builder();
10973    /// let mut items = builder.by_item();
10974    /// while let Some(result) = items.next().await {
10975    ///   let item = result?;
10976    /// }
10977    /// # Ok(()) }
10978    ///
10979    /// fn prepare_request_builder() -> ListOperations {
10980    ///   # panic!();
10981    ///   // ... details omitted ...
10982    /// }
10983    /// ```
10984    #[derive(Clone, Debug)]
10985    pub struct ListOperations(
10986        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10987    );
10988
10989    impl ListOperations {
10990        pub(crate) fn new(
10991            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10992        ) -> Self {
10993            Self(RequestBuilder::new(stub))
10994        }
10995
10996        /// Sets the full request, replacing any prior values.
10997        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10998            mut self,
10999            v: V,
11000        ) -> Self {
11001            self.0.request = v.into();
11002            self
11003        }
11004
11005        /// Sets all the options, replacing any prior values.
11006        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11007            self.0.options = v.into();
11008            self
11009        }
11010
11011        /// Sends the request.
11012        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11013            (*self.0.stub)
11014                .list_operations(self.0.request, self.0.options)
11015                .await
11016                .map(crate::Response::into_body)
11017        }
11018
11019        /// Streams each page in the collection.
11020        pub fn by_page(
11021            self,
11022        ) -> impl google_cloud_gax::paginator::Paginator<
11023            google_cloud_longrunning::model::ListOperationsResponse,
11024            crate::Error,
11025        > {
11026            use std::clone::Clone;
11027            let token = self.0.request.page_token.clone();
11028            let execute = move |token: String| {
11029                let mut builder = self.clone();
11030                builder.0.request = builder.0.request.set_page_token(token);
11031                builder.send()
11032            };
11033            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11034        }
11035
11036        /// Streams each item in the collection.
11037        pub fn by_item(
11038            self,
11039        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11040            google_cloud_longrunning::model::ListOperationsResponse,
11041            crate::Error,
11042        > {
11043            use google_cloud_gax::paginator::Paginator;
11044            self.by_page().items()
11045        }
11046
11047        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
11048        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11049            self.0.request.name = v.into();
11050            self
11051        }
11052
11053        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
11054        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11055            self.0.request.filter = v.into();
11056            self
11057        }
11058
11059        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
11060        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11061            self.0.request.page_size = v.into();
11062            self
11063        }
11064
11065        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
11066        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11067            self.0.request.page_token = v.into();
11068            self
11069        }
11070
11071        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
11072        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11073            self.0.request.return_partial_success = v.into();
11074            self
11075        }
11076    }
11077
11078    #[doc(hidden)]
11079    impl crate::RequestBuilder for ListOperations {
11080        fn request_options(&mut self) -> &mut crate::RequestOptions {
11081            &mut self.0.options
11082        }
11083    }
11084
11085    /// The request builder for [Intercept::get_operation][crate::client::Intercept::get_operation] calls.
11086    ///
11087    /// # Example
11088    /// ```
11089    /// # use google_cloud_networksecurity_v1::builder::intercept::GetOperation;
11090    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11091    ///
11092    /// let builder = prepare_request_builder();
11093    /// let response = builder.send().await?;
11094    /// # Ok(()) }
11095    ///
11096    /// fn prepare_request_builder() -> GetOperation {
11097    ///   # panic!();
11098    ///   // ... details omitted ...
11099    /// }
11100    /// ```
11101    #[derive(Clone, Debug)]
11102    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
11103
11104    impl GetOperation {
11105        pub(crate) fn new(
11106            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
11107        ) -> Self {
11108            Self(RequestBuilder::new(stub))
11109        }
11110
11111        /// Sets the full request, replacing any prior values.
11112        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
11113            mut self,
11114            v: V,
11115        ) -> Self {
11116            self.0.request = v.into();
11117            self
11118        }
11119
11120        /// Sets all the options, replacing any prior values.
11121        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11122            self.0.options = v.into();
11123            self
11124        }
11125
11126        /// Sends the request.
11127        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11128            (*self.0.stub)
11129                .get_operation(self.0.request, self.0.options)
11130                .await
11131                .map(crate::Response::into_body)
11132        }
11133
11134        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
11135        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11136            self.0.request.name = v.into();
11137            self
11138        }
11139    }
11140
11141    #[doc(hidden)]
11142    impl crate::RequestBuilder for GetOperation {
11143        fn request_options(&mut self) -> &mut crate::RequestOptions {
11144            &mut self.0.options
11145        }
11146    }
11147
11148    /// The request builder for [Intercept::delete_operation][crate::client::Intercept::delete_operation] calls.
11149    ///
11150    /// # Example
11151    /// ```
11152    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteOperation;
11153    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11154    ///
11155    /// let builder = prepare_request_builder();
11156    /// let response = builder.send().await?;
11157    /// # Ok(()) }
11158    ///
11159    /// fn prepare_request_builder() -> DeleteOperation {
11160    ///   # panic!();
11161    ///   // ... details omitted ...
11162    /// }
11163    /// ```
11164    #[derive(Clone, Debug)]
11165    pub struct DeleteOperation(
11166        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
11167    );
11168
11169    impl DeleteOperation {
11170        pub(crate) fn new(
11171            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
11172        ) -> Self {
11173            Self(RequestBuilder::new(stub))
11174        }
11175
11176        /// Sets the full request, replacing any prior values.
11177        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
11178            mut self,
11179            v: V,
11180        ) -> Self {
11181            self.0.request = v.into();
11182            self
11183        }
11184
11185        /// Sets all the options, replacing any prior values.
11186        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11187            self.0.options = v.into();
11188            self
11189        }
11190
11191        /// Sends the request.
11192        pub async fn send(self) -> Result<()> {
11193            (*self.0.stub)
11194                .delete_operation(self.0.request, self.0.options)
11195                .await
11196                .map(crate::Response::into_body)
11197        }
11198
11199        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
11200        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11201            self.0.request.name = v.into();
11202            self
11203        }
11204    }
11205
11206    #[doc(hidden)]
11207    impl crate::RequestBuilder for DeleteOperation {
11208        fn request_options(&mut self) -> &mut crate::RequestOptions {
11209            &mut self.0.options
11210        }
11211    }
11212
11213    /// The request builder for [Intercept::cancel_operation][crate::client::Intercept::cancel_operation] calls.
11214    ///
11215    /// # Example
11216    /// ```
11217    /// # use google_cloud_networksecurity_v1::builder::intercept::CancelOperation;
11218    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11219    ///
11220    /// let builder = prepare_request_builder();
11221    /// let response = builder.send().await?;
11222    /// # Ok(()) }
11223    ///
11224    /// fn prepare_request_builder() -> CancelOperation {
11225    ///   # panic!();
11226    ///   // ... details omitted ...
11227    /// }
11228    /// ```
11229    #[derive(Clone, Debug)]
11230    pub struct CancelOperation(
11231        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
11232    );
11233
11234    impl CancelOperation {
11235        pub(crate) fn new(
11236            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
11237        ) -> Self {
11238            Self(RequestBuilder::new(stub))
11239        }
11240
11241        /// Sets the full request, replacing any prior values.
11242        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
11243            mut self,
11244            v: V,
11245        ) -> Self {
11246            self.0.request = v.into();
11247            self
11248        }
11249
11250        /// Sets all the options, replacing any prior values.
11251        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11252            self.0.options = v.into();
11253            self
11254        }
11255
11256        /// Sends the request.
11257        pub async fn send(self) -> Result<()> {
11258            (*self.0.stub)
11259                .cancel_operation(self.0.request, self.0.options)
11260                .await
11261                .map(crate::Response::into_body)
11262        }
11263
11264        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
11265        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11266            self.0.request.name = v.into();
11267            self
11268        }
11269    }
11270
11271    #[doc(hidden)]
11272    impl crate::RequestBuilder for CancelOperation {
11273        fn request_options(&mut self) -> &mut crate::RequestOptions {
11274            &mut self.0.options
11275        }
11276    }
11277}
11278
11279/// Request and client builders for [Mirroring][crate::client::Mirroring].
11280pub mod mirroring {
11281    use crate::Result;
11282
11283    /// A builder for [Mirroring][crate::client::Mirroring].
11284    ///
11285    /// ```
11286    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11287    /// # use google_cloud_networksecurity_v1::*;
11288    /// # use builder::mirroring::ClientBuilder;
11289    /// # use client::Mirroring;
11290    /// let builder : ClientBuilder = Mirroring::builder();
11291    /// let client = builder
11292    ///     .with_endpoint("https://networksecurity.googleapis.com")
11293    ///     .build().await?;
11294    /// # Ok(()) }
11295    /// ```
11296    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11297
11298    pub(crate) mod client {
11299        use super::super::super::client::Mirroring;
11300        pub struct Factory;
11301        impl crate::ClientFactory for Factory {
11302            type Client = Mirroring;
11303            type Credentials = gaxi::options::Credentials;
11304            async fn build(
11305                self,
11306                config: gaxi::options::ClientConfig,
11307            ) -> crate::ClientBuilderResult<Self::Client> {
11308                Self::Client::new(config).await
11309            }
11310        }
11311    }
11312
11313    /// Common implementation for [crate::client::Mirroring] request builders.
11314    #[derive(Clone, Debug)]
11315    pub(crate) struct RequestBuilder<R: std::default::Default> {
11316        stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11317        request: R,
11318        options: crate::RequestOptions,
11319    }
11320
11321    impl<R> RequestBuilder<R>
11322    where
11323        R: std::default::Default,
11324    {
11325        pub(crate) fn new(
11326            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11327        ) -> Self {
11328            Self {
11329                stub,
11330                request: R::default(),
11331                options: crate::RequestOptions::default(),
11332            }
11333        }
11334    }
11335
11336    /// The request builder for [Mirroring::list_mirroring_endpoint_groups][crate::client::Mirroring::list_mirroring_endpoint_groups] calls.
11337    ///
11338    /// # Example
11339    /// ```
11340    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringEndpointGroups;
11341    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11342    /// use google_cloud_gax::paginator::ItemPaginator;
11343    ///
11344    /// let builder = prepare_request_builder();
11345    /// let mut items = builder.by_item();
11346    /// while let Some(result) = items.next().await {
11347    ///   let item = result?;
11348    /// }
11349    /// # Ok(()) }
11350    ///
11351    /// fn prepare_request_builder() -> ListMirroringEndpointGroups {
11352    ///   # panic!();
11353    ///   // ... details omitted ...
11354    /// }
11355    /// ```
11356    #[derive(Clone, Debug)]
11357    pub struct ListMirroringEndpointGroups(
11358        RequestBuilder<crate::model::ListMirroringEndpointGroupsRequest>,
11359    );
11360
11361    impl ListMirroringEndpointGroups {
11362        pub(crate) fn new(
11363            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11364        ) -> Self {
11365            Self(RequestBuilder::new(stub))
11366        }
11367
11368        /// Sets the full request, replacing any prior values.
11369        pub fn with_request<V: Into<crate::model::ListMirroringEndpointGroupsRequest>>(
11370            mut self,
11371            v: V,
11372        ) -> Self {
11373            self.0.request = v.into();
11374            self
11375        }
11376
11377        /// Sets all the options, replacing any prior values.
11378        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11379            self.0.options = v.into();
11380            self
11381        }
11382
11383        /// Sends the request.
11384        pub async fn send(self) -> Result<crate::model::ListMirroringEndpointGroupsResponse> {
11385            (*self.0.stub)
11386                .list_mirroring_endpoint_groups(self.0.request, self.0.options)
11387                .await
11388                .map(crate::Response::into_body)
11389        }
11390
11391        /// Streams each page in the collection.
11392        pub fn by_page(
11393            self,
11394        ) -> impl google_cloud_gax::paginator::Paginator<
11395            crate::model::ListMirroringEndpointGroupsResponse,
11396            crate::Error,
11397        > {
11398            use std::clone::Clone;
11399            let token = self.0.request.page_token.clone();
11400            let execute = move |token: String| {
11401                let mut builder = self.clone();
11402                builder.0.request = builder.0.request.set_page_token(token);
11403                builder.send()
11404            };
11405            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11406        }
11407
11408        /// Streams each item in the collection.
11409        pub fn by_item(
11410            self,
11411        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11412            crate::model::ListMirroringEndpointGroupsResponse,
11413            crate::Error,
11414        > {
11415            use google_cloud_gax::paginator::Paginator;
11416            self.by_page().items()
11417        }
11418
11419        /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupsRequest::parent].
11420        ///
11421        /// This is a **required** field for requests.
11422        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11423            self.0.request.parent = v.into();
11424            self
11425        }
11426
11427        /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupsRequest::page_size].
11428        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11429            self.0.request.page_size = v.into();
11430            self
11431        }
11432
11433        /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupsRequest::page_token].
11434        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11435            self.0.request.page_token = v.into();
11436            self
11437        }
11438
11439        /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupsRequest::filter].
11440        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11441            self.0.request.filter = v.into();
11442            self
11443        }
11444
11445        /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupsRequest::order_by].
11446        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11447            self.0.request.order_by = v.into();
11448            self
11449        }
11450    }
11451
11452    #[doc(hidden)]
11453    impl crate::RequestBuilder for ListMirroringEndpointGroups {
11454        fn request_options(&mut self) -> &mut crate::RequestOptions {
11455            &mut self.0.options
11456        }
11457    }
11458
11459    /// The request builder for [Mirroring::get_mirroring_endpoint_group][crate::client::Mirroring::get_mirroring_endpoint_group] calls.
11460    ///
11461    /// # Example
11462    /// ```
11463    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringEndpointGroup;
11464    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11465    ///
11466    /// let builder = prepare_request_builder();
11467    /// let response = builder.send().await?;
11468    /// # Ok(()) }
11469    ///
11470    /// fn prepare_request_builder() -> GetMirroringEndpointGroup {
11471    ///   # panic!();
11472    ///   // ... details omitted ...
11473    /// }
11474    /// ```
11475    #[derive(Clone, Debug)]
11476    pub struct GetMirroringEndpointGroup(
11477        RequestBuilder<crate::model::GetMirroringEndpointGroupRequest>,
11478    );
11479
11480    impl GetMirroringEndpointGroup {
11481        pub(crate) fn new(
11482            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11483        ) -> Self {
11484            Self(RequestBuilder::new(stub))
11485        }
11486
11487        /// Sets the full request, replacing any prior values.
11488        pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupRequest>>(
11489            mut self,
11490            v: V,
11491        ) -> Self {
11492            self.0.request = v.into();
11493            self
11494        }
11495
11496        /// Sets all the options, replacing any prior values.
11497        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11498            self.0.options = v.into();
11499            self
11500        }
11501
11502        /// Sends the request.
11503        pub async fn send(self) -> Result<crate::model::MirroringEndpointGroup> {
11504            (*self.0.stub)
11505                .get_mirroring_endpoint_group(self.0.request, self.0.options)
11506                .await
11507                .map(crate::Response::into_body)
11508        }
11509
11510        /// Sets the value of [name][crate::model::GetMirroringEndpointGroupRequest::name].
11511        ///
11512        /// This is a **required** field for requests.
11513        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11514            self.0.request.name = v.into();
11515            self
11516        }
11517    }
11518
11519    #[doc(hidden)]
11520    impl crate::RequestBuilder for GetMirroringEndpointGroup {
11521        fn request_options(&mut self) -> &mut crate::RequestOptions {
11522            &mut self.0.options
11523        }
11524    }
11525
11526    /// The request builder for [Mirroring::create_mirroring_endpoint_group][crate::client::Mirroring::create_mirroring_endpoint_group] calls.
11527    ///
11528    /// # Example
11529    /// ```
11530    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringEndpointGroup;
11531    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11532    /// use google_cloud_lro::Poller;
11533    ///
11534    /// let builder = prepare_request_builder();
11535    /// let response = builder.poller().until_done().await?;
11536    /// # Ok(()) }
11537    ///
11538    /// fn prepare_request_builder() -> CreateMirroringEndpointGroup {
11539    ///   # panic!();
11540    ///   // ... details omitted ...
11541    /// }
11542    /// ```
11543    #[derive(Clone, Debug)]
11544    pub struct CreateMirroringEndpointGroup(
11545        RequestBuilder<crate::model::CreateMirroringEndpointGroupRequest>,
11546    );
11547
11548    impl CreateMirroringEndpointGroup {
11549        pub(crate) fn new(
11550            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11551        ) -> Self {
11552            Self(RequestBuilder::new(stub))
11553        }
11554
11555        /// Sets the full request, replacing any prior values.
11556        pub fn with_request<V: Into<crate::model::CreateMirroringEndpointGroupRequest>>(
11557            mut self,
11558            v: V,
11559        ) -> Self {
11560            self.0.request = v.into();
11561            self
11562        }
11563
11564        /// Sets all the options, replacing any prior values.
11565        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11566            self.0.options = v.into();
11567            self
11568        }
11569
11570        /// Sends the request.
11571        ///
11572        /// # Long running operations
11573        ///
11574        /// This starts, but does not poll, a longrunning operation. More information
11575        /// on [create_mirroring_endpoint_group][crate::client::Mirroring::create_mirroring_endpoint_group].
11576        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11577            (*self.0.stub)
11578                .create_mirroring_endpoint_group(self.0.request, self.0.options)
11579                .await
11580                .map(crate::Response::into_body)
11581        }
11582
11583        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_endpoint_group`.
11584        pub fn poller(
11585            self,
11586        ) -> impl google_cloud_lro::Poller<
11587            crate::model::MirroringEndpointGroup,
11588            crate::model::OperationMetadata,
11589        > {
11590            type Operation = google_cloud_lro::internal::Operation<
11591                crate::model::MirroringEndpointGroup,
11592                crate::model::OperationMetadata,
11593            >;
11594            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11595            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11596            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11597            if let Some(ref mut details) = poller_options.tracing {
11598                details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::create_mirroring_endpoint_group::until_done";
11599            }
11600
11601            let stub = self.0.stub.clone();
11602            let mut options = self.0.options.clone();
11603            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11604            let query = move |name| {
11605                let stub = stub.clone();
11606                let options = options.clone();
11607                async {
11608                    let op = GetOperation::new(stub)
11609                        .set_name(name)
11610                        .with_options(options)
11611                        .send()
11612                        .await?;
11613                    Ok(Operation::new(op))
11614                }
11615            };
11616
11617            let start = move || async {
11618                let op = self.send().await?;
11619                Ok(Operation::new(op))
11620            };
11621
11622            use google_cloud_lro::internal::PollerExt;
11623            {
11624                google_cloud_lro::internal::new_poller(
11625                    polling_error_policy,
11626                    polling_backoff_policy,
11627                    start,
11628                    query,
11629                )
11630            }
11631            .with_options(poller_options)
11632        }
11633
11634        /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupRequest::parent].
11635        ///
11636        /// This is a **required** field for requests.
11637        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11638            self.0.request.parent = v.into();
11639            self
11640        }
11641
11642        /// Sets the value of [mirroring_endpoint_group_id][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group_id].
11643        ///
11644        /// This is a **required** field for requests.
11645        pub fn set_mirroring_endpoint_group_id<T: Into<std::string::String>>(
11646            mut self,
11647            v: T,
11648        ) -> Self {
11649            self.0.request.mirroring_endpoint_group_id = v.into();
11650            self
11651        }
11652
11653        /// Sets the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
11654        ///
11655        /// This is a **required** field for requests.
11656        pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
11657        where
11658            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11659        {
11660            self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
11661            self
11662        }
11663
11664        /// Sets or clears the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
11665        ///
11666        /// This is a **required** field for requests.
11667        pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
11668        where
11669            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11670        {
11671            self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
11672            self
11673        }
11674
11675        /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupRequest::request_id].
11676        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11677            self.0.request.request_id = v.into();
11678            self
11679        }
11680    }
11681
11682    #[doc(hidden)]
11683    impl crate::RequestBuilder for CreateMirroringEndpointGroup {
11684        fn request_options(&mut self) -> &mut crate::RequestOptions {
11685            &mut self.0.options
11686        }
11687    }
11688
11689    /// The request builder for [Mirroring::update_mirroring_endpoint_group][crate::client::Mirroring::update_mirroring_endpoint_group] calls.
11690    ///
11691    /// # Example
11692    /// ```
11693    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringEndpointGroup;
11694    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11695    /// use google_cloud_lro::Poller;
11696    ///
11697    /// let builder = prepare_request_builder();
11698    /// let response = builder.poller().until_done().await?;
11699    /// # Ok(()) }
11700    ///
11701    /// fn prepare_request_builder() -> UpdateMirroringEndpointGroup {
11702    ///   # panic!();
11703    ///   // ... details omitted ...
11704    /// }
11705    /// ```
11706    #[derive(Clone, Debug)]
11707    pub struct UpdateMirroringEndpointGroup(
11708        RequestBuilder<crate::model::UpdateMirroringEndpointGroupRequest>,
11709    );
11710
11711    impl UpdateMirroringEndpointGroup {
11712        pub(crate) fn new(
11713            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11714        ) -> Self {
11715            Self(RequestBuilder::new(stub))
11716        }
11717
11718        /// Sets the full request, replacing any prior values.
11719        pub fn with_request<V: Into<crate::model::UpdateMirroringEndpointGroupRequest>>(
11720            mut self,
11721            v: V,
11722        ) -> Self {
11723            self.0.request = v.into();
11724            self
11725        }
11726
11727        /// Sets all the options, replacing any prior values.
11728        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11729            self.0.options = v.into();
11730            self
11731        }
11732
11733        /// Sends the request.
11734        ///
11735        /// # Long running operations
11736        ///
11737        /// This starts, but does not poll, a longrunning operation. More information
11738        /// on [update_mirroring_endpoint_group][crate::client::Mirroring::update_mirroring_endpoint_group].
11739        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11740            (*self.0.stub)
11741                .update_mirroring_endpoint_group(self.0.request, self.0.options)
11742                .await
11743                .map(crate::Response::into_body)
11744        }
11745
11746        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_endpoint_group`.
11747        pub fn poller(
11748            self,
11749        ) -> impl google_cloud_lro::Poller<
11750            crate::model::MirroringEndpointGroup,
11751            crate::model::OperationMetadata,
11752        > {
11753            type Operation = google_cloud_lro::internal::Operation<
11754                crate::model::MirroringEndpointGroup,
11755                crate::model::OperationMetadata,
11756            >;
11757            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11758            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11759            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11760            if let Some(ref mut details) = poller_options.tracing {
11761                details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::update_mirroring_endpoint_group::until_done";
11762            }
11763
11764            let stub = self.0.stub.clone();
11765            let mut options = self.0.options.clone();
11766            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11767            let query = move |name| {
11768                let stub = stub.clone();
11769                let options = options.clone();
11770                async {
11771                    let op = GetOperation::new(stub)
11772                        .set_name(name)
11773                        .with_options(options)
11774                        .send()
11775                        .await?;
11776                    Ok(Operation::new(op))
11777                }
11778            };
11779
11780            let start = move || async {
11781                let op = self.send().await?;
11782                Ok(Operation::new(op))
11783            };
11784
11785            use google_cloud_lro::internal::PollerExt;
11786            {
11787                google_cloud_lro::internal::new_poller(
11788                    polling_error_policy,
11789                    polling_backoff_policy,
11790                    start,
11791                    query,
11792                )
11793            }
11794            .with_options(poller_options)
11795        }
11796
11797        /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
11798        pub fn set_update_mask<T>(mut self, v: T) -> Self
11799        where
11800            T: std::convert::Into<wkt::FieldMask>,
11801        {
11802            self.0.request.update_mask = std::option::Option::Some(v.into());
11803            self
11804        }
11805
11806        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
11807        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11808        where
11809            T: std::convert::Into<wkt::FieldMask>,
11810        {
11811            self.0.request.update_mask = v.map(|x| x.into());
11812            self
11813        }
11814
11815        /// Sets the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
11816        ///
11817        /// This is a **required** field for requests.
11818        pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
11819        where
11820            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11821        {
11822            self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
11823            self
11824        }
11825
11826        /// Sets or clears the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
11827        ///
11828        /// This is a **required** field for requests.
11829        pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
11830        where
11831            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11832        {
11833            self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
11834            self
11835        }
11836
11837        /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupRequest::request_id].
11838        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11839            self.0.request.request_id = v.into();
11840            self
11841        }
11842    }
11843
11844    #[doc(hidden)]
11845    impl crate::RequestBuilder for UpdateMirroringEndpointGroup {
11846        fn request_options(&mut self) -> &mut crate::RequestOptions {
11847            &mut self.0.options
11848        }
11849    }
11850
11851    /// The request builder for [Mirroring::delete_mirroring_endpoint_group][crate::client::Mirroring::delete_mirroring_endpoint_group] calls.
11852    ///
11853    /// # Example
11854    /// ```
11855    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringEndpointGroup;
11856    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11857    /// use google_cloud_lro::Poller;
11858    ///
11859    /// let builder = prepare_request_builder();
11860    /// let response = builder.poller().until_done().await?;
11861    /// # Ok(()) }
11862    ///
11863    /// fn prepare_request_builder() -> DeleteMirroringEndpointGroup {
11864    ///   # panic!();
11865    ///   // ... details omitted ...
11866    /// }
11867    /// ```
11868    #[derive(Clone, Debug)]
11869    pub struct DeleteMirroringEndpointGroup(
11870        RequestBuilder<crate::model::DeleteMirroringEndpointGroupRequest>,
11871    );
11872
11873    impl DeleteMirroringEndpointGroup {
11874        pub(crate) fn new(
11875            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11876        ) -> Self {
11877            Self(RequestBuilder::new(stub))
11878        }
11879
11880        /// Sets the full request, replacing any prior values.
11881        pub fn with_request<V: Into<crate::model::DeleteMirroringEndpointGroupRequest>>(
11882            mut self,
11883            v: V,
11884        ) -> Self {
11885            self.0.request = v.into();
11886            self
11887        }
11888
11889        /// Sets all the options, replacing any prior values.
11890        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11891            self.0.options = v.into();
11892            self
11893        }
11894
11895        /// Sends the request.
11896        ///
11897        /// # Long running operations
11898        ///
11899        /// This starts, but does not poll, a longrunning operation. More information
11900        /// on [delete_mirroring_endpoint_group][crate::client::Mirroring::delete_mirroring_endpoint_group].
11901        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11902            (*self.0.stub)
11903                .delete_mirroring_endpoint_group(self.0.request, self.0.options)
11904                .await
11905                .map(crate::Response::into_body)
11906        }
11907
11908        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_endpoint_group`.
11909        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11910            type Operation =
11911                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11912            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11913            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11914            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11915            if let Some(ref mut details) = poller_options.tracing {
11916                details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::delete_mirroring_endpoint_group::until_done";
11917            }
11918
11919            let stub = self.0.stub.clone();
11920            let mut options = self.0.options.clone();
11921            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11922            let query = move |name| {
11923                let stub = stub.clone();
11924                let options = options.clone();
11925                async {
11926                    let op = GetOperation::new(stub)
11927                        .set_name(name)
11928                        .with_options(options)
11929                        .send()
11930                        .await?;
11931                    Ok(Operation::new(op))
11932                }
11933            };
11934
11935            let start = move || async {
11936                let op = self.send().await?;
11937                Ok(Operation::new(op))
11938            };
11939
11940            use google_cloud_lro::internal::PollerExt;
11941            {
11942                google_cloud_lro::internal::new_unit_response_poller(
11943                    polling_error_policy,
11944                    polling_backoff_policy,
11945                    start,
11946                    query,
11947                )
11948            }
11949            .with_options(poller_options)
11950        }
11951
11952        /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupRequest::name].
11953        ///
11954        /// This is a **required** field for requests.
11955        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11956            self.0.request.name = v.into();
11957            self
11958        }
11959
11960        /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupRequest::request_id].
11961        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11962            self.0.request.request_id = v.into();
11963            self
11964        }
11965    }
11966
11967    #[doc(hidden)]
11968    impl crate::RequestBuilder for DeleteMirroringEndpointGroup {
11969        fn request_options(&mut self) -> &mut crate::RequestOptions {
11970            &mut self.0.options
11971        }
11972    }
11973
11974    /// The request builder for [Mirroring::list_mirroring_endpoint_group_associations][crate::client::Mirroring::list_mirroring_endpoint_group_associations] calls.
11975    ///
11976    /// # Example
11977    /// ```
11978    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringEndpointGroupAssociations;
11979    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11980    /// use google_cloud_gax::paginator::ItemPaginator;
11981    ///
11982    /// let builder = prepare_request_builder();
11983    /// let mut items = builder.by_item();
11984    /// while let Some(result) = items.next().await {
11985    ///   let item = result?;
11986    /// }
11987    /// # Ok(()) }
11988    ///
11989    /// fn prepare_request_builder() -> ListMirroringEndpointGroupAssociations {
11990    ///   # panic!();
11991    ///   // ... details omitted ...
11992    /// }
11993    /// ```
11994    #[derive(Clone, Debug)]
11995    pub struct ListMirroringEndpointGroupAssociations(
11996        RequestBuilder<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
11997    );
11998
11999    impl ListMirroringEndpointGroupAssociations {
12000        pub(crate) fn new(
12001            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12002        ) -> Self {
12003            Self(RequestBuilder::new(stub))
12004        }
12005
12006        /// Sets the full request, replacing any prior values.
12007        pub fn with_request<
12008            V: Into<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
12009        >(
12010            mut self,
12011            v: V,
12012        ) -> Self {
12013            self.0.request = v.into();
12014            self
12015        }
12016
12017        /// Sets all the options, replacing any prior values.
12018        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12019            self.0.options = v.into();
12020            self
12021        }
12022
12023        /// Sends the request.
12024        pub async fn send(
12025            self,
12026        ) -> Result<crate::model::ListMirroringEndpointGroupAssociationsResponse> {
12027            (*self.0.stub)
12028                .list_mirroring_endpoint_group_associations(self.0.request, self.0.options)
12029                .await
12030                .map(crate::Response::into_body)
12031        }
12032
12033        /// Streams each page in the collection.
12034        pub fn by_page(
12035            self,
12036        ) -> impl google_cloud_gax::paginator::Paginator<
12037            crate::model::ListMirroringEndpointGroupAssociationsResponse,
12038            crate::Error,
12039        > {
12040            use std::clone::Clone;
12041            let token = self.0.request.page_token.clone();
12042            let execute = move |token: String| {
12043                let mut builder = self.clone();
12044                builder.0.request = builder.0.request.set_page_token(token);
12045                builder.send()
12046            };
12047            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12048        }
12049
12050        /// Streams each item in the collection.
12051        pub fn by_item(
12052            self,
12053        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12054            crate::model::ListMirroringEndpointGroupAssociationsResponse,
12055            crate::Error,
12056        > {
12057            use google_cloud_gax::paginator::Paginator;
12058            self.by_page().items()
12059        }
12060
12061        /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupAssociationsRequest::parent].
12062        ///
12063        /// This is a **required** field for requests.
12064        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12065            self.0.request.parent = v.into();
12066            self
12067        }
12068
12069        /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_size].
12070        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12071            self.0.request.page_size = v.into();
12072            self
12073        }
12074
12075        /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_token].
12076        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12077            self.0.request.page_token = v.into();
12078            self
12079        }
12080
12081        /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupAssociationsRequest::filter].
12082        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12083            self.0.request.filter = v.into();
12084            self
12085        }
12086
12087        /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupAssociationsRequest::order_by].
12088        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12089            self.0.request.order_by = v.into();
12090            self
12091        }
12092    }
12093
12094    #[doc(hidden)]
12095    impl crate::RequestBuilder for ListMirroringEndpointGroupAssociations {
12096        fn request_options(&mut self) -> &mut crate::RequestOptions {
12097            &mut self.0.options
12098        }
12099    }
12100
12101    /// The request builder for [Mirroring::get_mirroring_endpoint_group_association][crate::client::Mirroring::get_mirroring_endpoint_group_association] calls.
12102    ///
12103    /// # Example
12104    /// ```
12105    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringEndpointGroupAssociation;
12106    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12107    ///
12108    /// let builder = prepare_request_builder();
12109    /// let response = builder.send().await?;
12110    /// # Ok(()) }
12111    ///
12112    /// fn prepare_request_builder() -> GetMirroringEndpointGroupAssociation {
12113    ///   # panic!();
12114    ///   // ... details omitted ...
12115    /// }
12116    /// ```
12117    #[derive(Clone, Debug)]
12118    pub struct GetMirroringEndpointGroupAssociation(
12119        RequestBuilder<crate::model::GetMirroringEndpointGroupAssociationRequest>,
12120    );
12121
12122    impl GetMirroringEndpointGroupAssociation {
12123        pub(crate) fn new(
12124            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12125        ) -> Self {
12126            Self(RequestBuilder::new(stub))
12127        }
12128
12129        /// Sets the full request, replacing any prior values.
12130        pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupAssociationRequest>>(
12131            mut self,
12132            v: V,
12133        ) -> Self {
12134            self.0.request = v.into();
12135            self
12136        }
12137
12138        /// Sets all the options, replacing any prior values.
12139        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12140            self.0.options = v.into();
12141            self
12142        }
12143
12144        /// Sends the request.
12145        pub async fn send(self) -> Result<crate::model::MirroringEndpointGroupAssociation> {
12146            (*self.0.stub)
12147                .get_mirroring_endpoint_group_association(self.0.request, self.0.options)
12148                .await
12149                .map(crate::Response::into_body)
12150        }
12151
12152        /// Sets the value of [name][crate::model::GetMirroringEndpointGroupAssociationRequest::name].
12153        ///
12154        /// This is a **required** field for requests.
12155        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12156            self.0.request.name = v.into();
12157            self
12158        }
12159    }
12160
12161    #[doc(hidden)]
12162    impl crate::RequestBuilder for GetMirroringEndpointGroupAssociation {
12163        fn request_options(&mut self) -> &mut crate::RequestOptions {
12164            &mut self.0.options
12165        }
12166    }
12167
12168    /// The request builder for [Mirroring::create_mirroring_endpoint_group_association][crate::client::Mirroring::create_mirroring_endpoint_group_association] calls.
12169    ///
12170    /// # Example
12171    /// ```
12172    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringEndpointGroupAssociation;
12173    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12174    /// use google_cloud_lro::Poller;
12175    ///
12176    /// let builder = prepare_request_builder();
12177    /// let response = builder.poller().until_done().await?;
12178    /// # Ok(()) }
12179    ///
12180    /// fn prepare_request_builder() -> CreateMirroringEndpointGroupAssociation {
12181    ///   # panic!();
12182    ///   // ... details omitted ...
12183    /// }
12184    /// ```
12185    #[derive(Clone, Debug)]
12186    pub struct CreateMirroringEndpointGroupAssociation(
12187        RequestBuilder<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
12188    );
12189
12190    impl CreateMirroringEndpointGroupAssociation {
12191        pub(crate) fn new(
12192            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12193        ) -> Self {
12194            Self(RequestBuilder::new(stub))
12195        }
12196
12197        /// Sets the full request, replacing any prior values.
12198        pub fn with_request<
12199            V: Into<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
12200        >(
12201            mut self,
12202            v: V,
12203        ) -> Self {
12204            self.0.request = v.into();
12205            self
12206        }
12207
12208        /// Sets all the options, replacing any prior values.
12209        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12210            self.0.options = v.into();
12211            self
12212        }
12213
12214        /// Sends the request.
12215        ///
12216        /// # Long running operations
12217        ///
12218        /// This starts, but does not poll, a longrunning operation. More information
12219        /// on [create_mirroring_endpoint_group_association][crate::client::Mirroring::create_mirroring_endpoint_group_association].
12220        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12221            (*self.0.stub)
12222                .create_mirroring_endpoint_group_association(self.0.request, self.0.options)
12223                .await
12224                .map(crate::Response::into_body)
12225        }
12226
12227        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_endpoint_group_association`.
12228        pub fn poller(
12229            self,
12230        ) -> impl google_cloud_lro::Poller<
12231            crate::model::MirroringEndpointGroupAssociation,
12232            crate::model::OperationMetadata,
12233        > {
12234            type Operation = google_cloud_lro::internal::Operation<
12235                crate::model::MirroringEndpointGroupAssociation,
12236                crate::model::OperationMetadata,
12237            >;
12238            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12239            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12240            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
12241            if let Some(ref mut details) = poller_options.tracing {
12242                details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::create_mirroring_endpoint_group_association::until_done";
12243            }
12244
12245            let stub = self.0.stub.clone();
12246            let mut options = self.0.options.clone();
12247            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12248            let query = move |name| {
12249                let stub = stub.clone();
12250                let options = options.clone();
12251                async {
12252                    let op = GetOperation::new(stub)
12253                        .set_name(name)
12254                        .with_options(options)
12255                        .send()
12256                        .await?;
12257                    Ok(Operation::new(op))
12258                }
12259            };
12260
12261            let start = move || async {
12262                let op = self.send().await?;
12263                Ok(Operation::new(op))
12264            };
12265
12266            use google_cloud_lro::internal::PollerExt;
12267            {
12268                google_cloud_lro::internal::new_poller(
12269                    polling_error_policy,
12270                    polling_backoff_policy,
12271                    start,
12272                    query,
12273                )
12274            }
12275            .with_options(poller_options)
12276        }
12277
12278        /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupAssociationRequest::parent].
12279        ///
12280        /// This is a **required** field for requests.
12281        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12282            self.0.request.parent = v.into();
12283            self
12284        }
12285
12286        /// Sets the value of [mirroring_endpoint_group_association_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association_id].
12287        pub fn set_mirroring_endpoint_group_association_id<T: Into<std::string::String>>(
12288            mut self,
12289            v: T,
12290        ) -> Self {
12291            self.0.request.mirroring_endpoint_group_association_id = v.into();
12292            self
12293        }
12294
12295        /// Sets the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
12296        ///
12297        /// This is a **required** field for requests.
12298        pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
12299        where
12300            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12301        {
12302            self.0.request.mirroring_endpoint_group_association =
12303                std::option::Option::Some(v.into());
12304            self
12305        }
12306
12307        /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
12308        ///
12309        /// This is a **required** field for requests.
12310        pub fn set_or_clear_mirroring_endpoint_group_association<T>(
12311            mut self,
12312            v: std::option::Option<T>,
12313        ) -> Self
12314        where
12315            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12316        {
12317            self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
12318            self
12319        }
12320
12321        /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::request_id].
12322        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12323            self.0.request.request_id = v.into();
12324            self
12325        }
12326    }
12327
12328    #[doc(hidden)]
12329    impl crate::RequestBuilder for CreateMirroringEndpointGroupAssociation {
12330        fn request_options(&mut self) -> &mut crate::RequestOptions {
12331            &mut self.0.options
12332        }
12333    }
12334
12335    /// The request builder for [Mirroring::update_mirroring_endpoint_group_association][crate::client::Mirroring::update_mirroring_endpoint_group_association] calls.
12336    ///
12337    /// # Example
12338    /// ```
12339    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringEndpointGroupAssociation;
12340    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12341    /// use google_cloud_lro::Poller;
12342    ///
12343    /// let builder = prepare_request_builder();
12344    /// let response = builder.poller().until_done().await?;
12345    /// # Ok(()) }
12346    ///
12347    /// fn prepare_request_builder() -> UpdateMirroringEndpointGroupAssociation {
12348    ///   # panic!();
12349    ///   // ... details omitted ...
12350    /// }
12351    /// ```
12352    #[derive(Clone, Debug)]
12353    pub struct UpdateMirroringEndpointGroupAssociation(
12354        RequestBuilder<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
12355    );
12356
12357    impl UpdateMirroringEndpointGroupAssociation {
12358        pub(crate) fn new(
12359            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12360        ) -> Self {
12361            Self(RequestBuilder::new(stub))
12362        }
12363
12364        /// Sets the full request, replacing any prior values.
12365        pub fn with_request<
12366            V: Into<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
12367        >(
12368            mut self,
12369            v: V,
12370        ) -> Self {
12371            self.0.request = v.into();
12372            self
12373        }
12374
12375        /// Sets all the options, replacing any prior values.
12376        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12377            self.0.options = v.into();
12378            self
12379        }
12380
12381        /// Sends the request.
12382        ///
12383        /// # Long running operations
12384        ///
12385        /// This starts, but does not poll, a longrunning operation. More information
12386        /// on [update_mirroring_endpoint_group_association][crate::client::Mirroring::update_mirroring_endpoint_group_association].
12387        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12388            (*self.0.stub)
12389                .update_mirroring_endpoint_group_association(self.0.request, self.0.options)
12390                .await
12391                .map(crate::Response::into_body)
12392        }
12393
12394        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_endpoint_group_association`.
12395        pub fn poller(
12396            self,
12397        ) -> impl google_cloud_lro::Poller<
12398            crate::model::MirroringEndpointGroupAssociation,
12399            crate::model::OperationMetadata,
12400        > {
12401            type Operation = google_cloud_lro::internal::Operation<
12402                crate::model::MirroringEndpointGroupAssociation,
12403                crate::model::OperationMetadata,
12404            >;
12405            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12406            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12407            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
12408            if let Some(ref mut details) = poller_options.tracing {
12409                details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::update_mirroring_endpoint_group_association::until_done";
12410            }
12411
12412            let stub = self.0.stub.clone();
12413            let mut options = self.0.options.clone();
12414            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12415            let query = move |name| {
12416                let stub = stub.clone();
12417                let options = options.clone();
12418                async {
12419                    let op = GetOperation::new(stub)
12420                        .set_name(name)
12421                        .with_options(options)
12422                        .send()
12423                        .await?;
12424                    Ok(Operation::new(op))
12425                }
12426            };
12427
12428            let start = move || async {
12429                let op = self.send().await?;
12430                Ok(Operation::new(op))
12431            };
12432
12433            use google_cloud_lro::internal::PollerExt;
12434            {
12435                google_cloud_lro::internal::new_poller(
12436                    polling_error_policy,
12437                    polling_backoff_policy,
12438                    start,
12439                    query,
12440                )
12441            }
12442            .with_options(poller_options)
12443        }
12444
12445        /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
12446        pub fn set_update_mask<T>(mut self, v: T) -> Self
12447        where
12448            T: std::convert::Into<wkt::FieldMask>,
12449        {
12450            self.0.request.update_mask = std::option::Option::Some(v.into());
12451            self
12452        }
12453
12454        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
12455        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12456        where
12457            T: std::convert::Into<wkt::FieldMask>,
12458        {
12459            self.0.request.update_mask = v.map(|x| x.into());
12460            self
12461        }
12462
12463        /// Sets the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
12464        ///
12465        /// This is a **required** field for requests.
12466        pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
12467        where
12468            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12469        {
12470            self.0.request.mirroring_endpoint_group_association =
12471                std::option::Option::Some(v.into());
12472            self
12473        }
12474
12475        /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
12476        ///
12477        /// This is a **required** field for requests.
12478        pub fn set_or_clear_mirroring_endpoint_group_association<T>(
12479            mut self,
12480            v: std::option::Option<T>,
12481        ) -> Self
12482        where
12483            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12484        {
12485            self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
12486            self
12487        }
12488
12489        /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupAssociationRequest::request_id].
12490        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12491            self.0.request.request_id = v.into();
12492            self
12493        }
12494    }
12495
12496    #[doc(hidden)]
12497    impl crate::RequestBuilder for UpdateMirroringEndpointGroupAssociation {
12498        fn request_options(&mut self) -> &mut crate::RequestOptions {
12499            &mut self.0.options
12500        }
12501    }
12502
12503    /// The request builder for [Mirroring::delete_mirroring_endpoint_group_association][crate::client::Mirroring::delete_mirroring_endpoint_group_association] calls.
12504    ///
12505    /// # Example
12506    /// ```
12507    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringEndpointGroupAssociation;
12508    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12509    /// use google_cloud_lro::Poller;
12510    ///
12511    /// let builder = prepare_request_builder();
12512    /// let response = builder.poller().until_done().await?;
12513    /// # Ok(()) }
12514    ///
12515    /// fn prepare_request_builder() -> DeleteMirroringEndpointGroupAssociation {
12516    ///   # panic!();
12517    ///   // ... details omitted ...
12518    /// }
12519    /// ```
12520    #[derive(Clone, Debug)]
12521    pub struct DeleteMirroringEndpointGroupAssociation(
12522        RequestBuilder<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
12523    );
12524
12525    impl DeleteMirroringEndpointGroupAssociation {
12526        pub(crate) fn new(
12527            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12528        ) -> Self {
12529            Self(RequestBuilder::new(stub))
12530        }
12531
12532        /// Sets the full request, replacing any prior values.
12533        pub fn with_request<
12534            V: Into<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
12535        >(
12536            mut self,
12537            v: V,
12538        ) -> Self {
12539            self.0.request = v.into();
12540            self
12541        }
12542
12543        /// Sets all the options, replacing any prior values.
12544        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12545            self.0.options = v.into();
12546            self
12547        }
12548
12549        /// Sends the request.
12550        ///
12551        /// # Long running operations
12552        ///
12553        /// This starts, but does not poll, a longrunning operation. More information
12554        /// on [delete_mirroring_endpoint_group_association][crate::client::Mirroring::delete_mirroring_endpoint_group_association].
12555        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12556            (*self.0.stub)
12557                .delete_mirroring_endpoint_group_association(self.0.request, self.0.options)
12558                .await
12559                .map(crate::Response::into_body)
12560        }
12561
12562        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_endpoint_group_association`.
12563        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12564            type Operation =
12565                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12566            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12567            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12568            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
12569            if let Some(ref mut details) = poller_options.tracing {
12570                details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::delete_mirroring_endpoint_group_association::until_done";
12571            }
12572
12573            let stub = self.0.stub.clone();
12574            let mut options = self.0.options.clone();
12575            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12576            let query = move |name| {
12577                let stub = stub.clone();
12578                let options = options.clone();
12579                async {
12580                    let op = GetOperation::new(stub)
12581                        .set_name(name)
12582                        .with_options(options)
12583                        .send()
12584                        .await?;
12585                    Ok(Operation::new(op))
12586                }
12587            };
12588
12589            let start = move || async {
12590                let op = self.send().await?;
12591                Ok(Operation::new(op))
12592            };
12593
12594            use google_cloud_lro::internal::PollerExt;
12595            {
12596                google_cloud_lro::internal::new_unit_response_poller(
12597                    polling_error_policy,
12598                    polling_backoff_policy,
12599                    start,
12600                    query,
12601                )
12602            }
12603            .with_options(poller_options)
12604        }
12605
12606        /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupAssociationRequest::name].
12607        ///
12608        /// This is a **required** field for requests.
12609        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12610            self.0.request.name = v.into();
12611            self
12612        }
12613
12614        /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupAssociationRequest::request_id].
12615        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12616            self.0.request.request_id = v.into();
12617            self
12618        }
12619    }
12620
12621    #[doc(hidden)]
12622    impl crate::RequestBuilder for DeleteMirroringEndpointGroupAssociation {
12623        fn request_options(&mut self) -> &mut crate::RequestOptions {
12624            &mut self.0.options
12625        }
12626    }
12627
12628    /// The request builder for [Mirroring::list_mirroring_deployment_groups][crate::client::Mirroring::list_mirroring_deployment_groups] calls.
12629    ///
12630    /// # Example
12631    /// ```
12632    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringDeploymentGroups;
12633    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12634    /// use google_cloud_gax::paginator::ItemPaginator;
12635    ///
12636    /// let builder = prepare_request_builder();
12637    /// let mut items = builder.by_item();
12638    /// while let Some(result) = items.next().await {
12639    ///   let item = result?;
12640    /// }
12641    /// # Ok(()) }
12642    ///
12643    /// fn prepare_request_builder() -> ListMirroringDeploymentGroups {
12644    ///   # panic!();
12645    ///   // ... details omitted ...
12646    /// }
12647    /// ```
12648    #[derive(Clone, Debug)]
12649    pub struct ListMirroringDeploymentGroups(
12650        RequestBuilder<crate::model::ListMirroringDeploymentGroupsRequest>,
12651    );
12652
12653    impl ListMirroringDeploymentGroups {
12654        pub(crate) fn new(
12655            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12656        ) -> Self {
12657            Self(RequestBuilder::new(stub))
12658        }
12659
12660        /// Sets the full request, replacing any prior values.
12661        pub fn with_request<V: Into<crate::model::ListMirroringDeploymentGroupsRequest>>(
12662            mut self,
12663            v: V,
12664        ) -> Self {
12665            self.0.request = v.into();
12666            self
12667        }
12668
12669        /// Sets all the options, replacing any prior values.
12670        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12671            self.0.options = v.into();
12672            self
12673        }
12674
12675        /// Sends the request.
12676        pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentGroupsResponse> {
12677            (*self.0.stub)
12678                .list_mirroring_deployment_groups(self.0.request, self.0.options)
12679                .await
12680                .map(crate::Response::into_body)
12681        }
12682
12683        /// Streams each page in the collection.
12684        pub fn by_page(
12685            self,
12686        ) -> impl google_cloud_gax::paginator::Paginator<
12687            crate::model::ListMirroringDeploymentGroupsResponse,
12688            crate::Error,
12689        > {
12690            use std::clone::Clone;
12691            let token = self.0.request.page_token.clone();
12692            let execute = move |token: String| {
12693                let mut builder = self.clone();
12694                builder.0.request = builder.0.request.set_page_token(token);
12695                builder.send()
12696            };
12697            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12698        }
12699
12700        /// Streams each item in the collection.
12701        pub fn by_item(
12702            self,
12703        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12704            crate::model::ListMirroringDeploymentGroupsResponse,
12705            crate::Error,
12706        > {
12707            use google_cloud_gax::paginator::Paginator;
12708            self.by_page().items()
12709        }
12710
12711        /// Sets the value of [parent][crate::model::ListMirroringDeploymentGroupsRequest::parent].
12712        ///
12713        /// This is a **required** field for requests.
12714        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12715            self.0.request.parent = v.into();
12716            self
12717        }
12718
12719        /// Sets the value of [page_size][crate::model::ListMirroringDeploymentGroupsRequest::page_size].
12720        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12721            self.0.request.page_size = v.into();
12722            self
12723        }
12724
12725        /// Sets the value of [page_token][crate::model::ListMirroringDeploymentGroupsRequest::page_token].
12726        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12727            self.0.request.page_token = v.into();
12728            self
12729        }
12730
12731        /// Sets the value of [filter][crate::model::ListMirroringDeploymentGroupsRequest::filter].
12732        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12733            self.0.request.filter = v.into();
12734            self
12735        }
12736
12737        /// Sets the value of [order_by][crate::model::ListMirroringDeploymentGroupsRequest::order_by].
12738        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12739            self.0.request.order_by = v.into();
12740            self
12741        }
12742    }
12743
12744    #[doc(hidden)]
12745    impl crate::RequestBuilder for ListMirroringDeploymentGroups {
12746        fn request_options(&mut self) -> &mut crate::RequestOptions {
12747            &mut self.0.options
12748        }
12749    }
12750
12751    /// The request builder for [Mirroring::get_mirroring_deployment_group][crate::client::Mirroring::get_mirroring_deployment_group] calls.
12752    ///
12753    /// # Example
12754    /// ```
12755    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringDeploymentGroup;
12756    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12757    ///
12758    /// let builder = prepare_request_builder();
12759    /// let response = builder.send().await?;
12760    /// # Ok(()) }
12761    ///
12762    /// fn prepare_request_builder() -> GetMirroringDeploymentGroup {
12763    ///   # panic!();
12764    ///   // ... details omitted ...
12765    /// }
12766    /// ```
12767    #[derive(Clone, Debug)]
12768    pub struct GetMirroringDeploymentGroup(
12769        RequestBuilder<crate::model::GetMirroringDeploymentGroupRequest>,
12770    );
12771
12772    impl GetMirroringDeploymentGroup {
12773        pub(crate) fn new(
12774            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12775        ) -> Self {
12776            Self(RequestBuilder::new(stub))
12777        }
12778
12779        /// Sets the full request, replacing any prior values.
12780        pub fn with_request<V: Into<crate::model::GetMirroringDeploymentGroupRequest>>(
12781            mut self,
12782            v: V,
12783        ) -> Self {
12784            self.0.request = v.into();
12785            self
12786        }
12787
12788        /// Sets all the options, replacing any prior values.
12789        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12790            self.0.options = v.into();
12791            self
12792        }
12793
12794        /// Sends the request.
12795        pub async fn send(self) -> Result<crate::model::MirroringDeploymentGroup> {
12796            (*self.0.stub)
12797                .get_mirroring_deployment_group(self.0.request, self.0.options)
12798                .await
12799                .map(crate::Response::into_body)
12800        }
12801
12802        /// Sets the value of [name][crate::model::GetMirroringDeploymentGroupRequest::name].
12803        ///
12804        /// This is a **required** field for requests.
12805        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12806            self.0.request.name = v.into();
12807            self
12808        }
12809    }
12810
12811    #[doc(hidden)]
12812    impl crate::RequestBuilder for GetMirroringDeploymentGroup {
12813        fn request_options(&mut self) -> &mut crate::RequestOptions {
12814            &mut self.0.options
12815        }
12816    }
12817
12818    /// The request builder for [Mirroring::create_mirroring_deployment_group][crate::client::Mirroring::create_mirroring_deployment_group] calls.
12819    ///
12820    /// # Example
12821    /// ```
12822    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringDeploymentGroup;
12823    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12824    /// use google_cloud_lro::Poller;
12825    ///
12826    /// let builder = prepare_request_builder();
12827    /// let response = builder.poller().until_done().await?;
12828    /// # Ok(()) }
12829    ///
12830    /// fn prepare_request_builder() -> CreateMirroringDeploymentGroup {
12831    ///   # panic!();
12832    ///   // ... details omitted ...
12833    /// }
12834    /// ```
12835    #[derive(Clone, Debug)]
12836    pub struct CreateMirroringDeploymentGroup(
12837        RequestBuilder<crate::model::CreateMirroringDeploymentGroupRequest>,
12838    );
12839
12840    impl CreateMirroringDeploymentGroup {
12841        pub(crate) fn new(
12842            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12843        ) -> Self {
12844            Self(RequestBuilder::new(stub))
12845        }
12846
12847        /// Sets the full request, replacing any prior values.
12848        pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentGroupRequest>>(
12849            mut self,
12850            v: V,
12851        ) -> Self {
12852            self.0.request = v.into();
12853            self
12854        }
12855
12856        /// Sets all the options, replacing any prior values.
12857        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12858            self.0.options = v.into();
12859            self
12860        }
12861
12862        /// Sends the request.
12863        ///
12864        /// # Long running operations
12865        ///
12866        /// This starts, but does not poll, a longrunning operation. More information
12867        /// on [create_mirroring_deployment_group][crate::client::Mirroring::create_mirroring_deployment_group].
12868        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12869            (*self.0.stub)
12870                .create_mirroring_deployment_group(self.0.request, self.0.options)
12871                .await
12872                .map(crate::Response::into_body)
12873        }
12874
12875        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_deployment_group`.
12876        pub fn poller(
12877            self,
12878        ) -> impl google_cloud_lro::Poller<
12879            crate::model::MirroringDeploymentGroup,
12880            crate::model::OperationMetadata,
12881        > {
12882            type Operation = google_cloud_lro::internal::Operation<
12883                crate::model::MirroringDeploymentGroup,
12884                crate::model::OperationMetadata,
12885            >;
12886            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12887            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12888            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
12889            if let Some(ref mut details) = poller_options.tracing {
12890                details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::create_mirroring_deployment_group::until_done";
12891            }
12892
12893            let stub = self.0.stub.clone();
12894            let mut options = self.0.options.clone();
12895            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12896            let query = move |name| {
12897                let stub = stub.clone();
12898                let options = options.clone();
12899                async {
12900                    let op = GetOperation::new(stub)
12901                        .set_name(name)
12902                        .with_options(options)
12903                        .send()
12904                        .await?;
12905                    Ok(Operation::new(op))
12906                }
12907            };
12908
12909            let start = move || async {
12910                let op = self.send().await?;
12911                Ok(Operation::new(op))
12912            };
12913
12914            use google_cloud_lro::internal::PollerExt;
12915            {
12916                google_cloud_lro::internal::new_poller(
12917                    polling_error_policy,
12918                    polling_backoff_policy,
12919                    start,
12920                    query,
12921                )
12922            }
12923            .with_options(poller_options)
12924        }
12925
12926        /// Sets the value of [parent][crate::model::CreateMirroringDeploymentGroupRequest::parent].
12927        ///
12928        /// This is a **required** field for requests.
12929        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12930            self.0.request.parent = v.into();
12931            self
12932        }
12933
12934        /// Sets the value of [mirroring_deployment_group_id][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group_id].
12935        ///
12936        /// This is a **required** field for requests.
12937        pub fn set_mirroring_deployment_group_id<T: Into<std::string::String>>(
12938            mut self,
12939            v: T,
12940        ) -> Self {
12941            self.0.request.mirroring_deployment_group_id = v.into();
12942            self
12943        }
12944
12945        /// Sets the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
12946        ///
12947        /// This is a **required** field for requests.
12948        pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
12949        where
12950            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12951        {
12952            self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
12953            self
12954        }
12955
12956        /// Sets or clears the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
12957        ///
12958        /// This is a **required** field for requests.
12959        pub fn set_or_clear_mirroring_deployment_group<T>(
12960            mut self,
12961            v: std::option::Option<T>,
12962        ) -> Self
12963        where
12964            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12965        {
12966            self.0.request.mirroring_deployment_group = v.map(|x| x.into());
12967            self
12968        }
12969
12970        /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentGroupRequest::request_id].
12971        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12972            self.0.request.request_id = v.into();
12973            self
12974        }
12975    }
12976
12977    #[doc(hidden)]
12978    impl crate::RequestBuilder for CreateMirroringDeploymentGroup {
12979        fn request_options(&mut self) -> &mut crate::RequestOptions {
12980            &mut self.0.options
12981        }
12982    }
12983
12984    /// The request builder for [Mirroring::update_mirroring_deployment_group][crate::client::Mirroring::update_mirroring_deployment_group] calls.
12985    ///
12986    /// # Example
12987    /// ```
12988    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringDeploymentGroup;
12989    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12990    /// use google_cloud_lro::Poller;
12991    ///
12992    /// let builder = prepare_request_builder();
12993    /// let response = builder.poller().until_done().await?;
12994    /// # Ok(()) }
12995    ///
12996    /// fn prepare_request_builder() -> UpdateMirroringDeploymentGroup {
12997    ///   # panic!();
12998    ///   // ... details omitted ...
12999    /// }
13000    /// ```
13001    #[derive(Clone, Debug)]
13002    pub struct UpdateMirroringDeploymentGroup(
13003        RequestBuilder<crate::model::UpdateMirroringDeploymentGroupRequest>,
13004    );
13005
13006    impl UpdateMirroringDeploymentGroup {
13007        pub(crate) fn new(
13008            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13009        ) -> Self {
13010            Self(RequestBuilder::new(stub))
13011        }
13012
13013        /// Sets the full request, replacing any prior values.
13014        pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentGroupRequest>>(
13015            mut self,
13016            v: V,
13017        ) -> Self {
13018            self.0.request = v.into();
13019            self
13020        }
13021
13022        /// Sets all the options, replacing any prior values.
13023        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13024            self.0.options = v.into();
13025            self
13026        }
13027
13028        /// Sends the request.
13029        ///
13030        /// # Long running operations
13031        ///
13032        /// This starts, but does not poll, a longrunning operation. More information
13033        /// on [update_mirroring_deployment_group][crate::client::Mirroring::update_mirroring_deployment_group].
13034        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13035            (*self.0.stub)
13036                .update_mirroring_deployment_group(self.0.request, self.0.options)
13037                .await
13038                .map(crate::Response::into_body)
13039        }
13040
13041        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_deployment_group`.
13042        pub fn poller(
13043            self,
13044        ) -> impl google_cloud_lro::Poller<
13045            crate::model::MirroringDeploymentGroup,
13046            crate::model::OperationMetadata,
13047        > {
13048            type Operation = google_cloud_lro::internal::Operation<
13049                crate::model::MirroringDeploymentGroup,
13050                crate::model::OperationMetadata,
13051            >;
13052            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13053            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13054            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
13055            if let Some(ref mut details) = poller_options.tracing {
13056                details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::update_mirroring_deployment_group::until_done";
13057            }
13058
13059            let stub = self.0.stub.clone();
13060            let mut options = self.0.options.clone();
13061            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13062            let query = move |name| {
13063                let stub = stub.clone();
13064                let options = options.clone();
13065                async {
13066                    let op = GetOperation::new(stub)
13067                        .set_name(name)
13068                        .with_options(options)
13069                        .send()
13070                        .await?;
13071                    Ok(Operation::new(op))
13072                }
13073            };
13074
13075            let start = move || async {
13076                let op = self.send().await?;
13077                Ok(Operation::new(op))
13078            };
13079
13080            use google_cloud_lro::internal::PollerExt;
13081            {
13082                google_cloud_lro::internal::new_poller(
13083                    polling_error_policy,
13084                    polling_backoff_policy,
13085                    start,
13086                    query,
13087                )
13088            }
13089            .with_options(poller_options)
13090        }
13091
13092        /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
13093        pub fn set_update_mask<T>(mut self, v: T) -> Self
13094        where
13095            T: std::convert::Into<wkt::FieldMask>,
13096        {
13097            self.0.request.update_mask = std::option::Option::Some(v.into());
13098            self
13099        }
13100
13101        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
13102        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13103        where
13104            T: std::convert::Into<wkt::FieldMask>,
13105        {
13106            self.0.request.update_mask = v.map(|x| x.into());
13107            self
13108        }
13109
13110        /// Sets the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
13111        ///
13112        /// This is a **required** field for requests.
13113        pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
13114        where
13115            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
13116        {
13117            self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
13118            self
13119        }
13120
13121        /// Sets or clears the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
13122        ///
13123        /// This is a **required** field for requests.
13124        pub fn set_or_clear_mirroring_deployment_group<T>(
13125            mut self,
13126            v: std::option::Option<T>,
13127        ) -> Self
13128        where
13129            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
13130        {
13131            self.0.request.mirroring_deployment_group = v.map(|x| x.into());
13132            self
13133        }
13134
13135        /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentGroupRequest::request_id].
13136        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13137            self.0.request.request_id = v.into();
13138            self
13139        }
13140    }
13141
13142    #[doc(hidden)]
13143    impl crate::RequestBuilder for UpdateMirroringDeploymentGroup {
13144        fn request_options(&mut self) -> &mut crate::RequestOptions {
13145            &mut self.0.options
13146        }
13147    }
13148
13149    /// The request builder for [Mirroring::delete_mirroring_deployment_group][crate::client::Mirroring::delete_mirroring_deployment_group] calls.
13150    ///
13151    /// # Example
13152    /// ```
13153    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringDeploymentGroup;
13154    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13155    /// use google_cloud_lro::Poller;
13156    ///
13157    /// let builder = prepare_request_builder();
13158    /// let response = builder.poller().until_done().await?;
13159    /// # Ok(()) }
13160    ///
13161    /// fn prepare_request_builder() -> DeleteMirroringDeploymentGroup {
13162    ///   # panic!();
13163    ///   // ... details omitted ...
13164    /// }
13165    /// ```
13166    #[derive(Clone, Debug)]
13167    pub struct DeleteMirroringDeploymentGroup(
13168        RequestBuilder<crate::model::DeleteMirroringDeploymentGroupRequest>,
13169    );
13170
13171    impl DeleteMirroringDeploymentGroup {
13172        pub(crate) fn new(
13173            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13174        ) -> Self {
13175            Self(RequestBuilder::new(stub))
13176        }
13177
13178        /// Sets the full request, replacing any prior values.
13179        pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentGroupRequest>>(
13180            mut self,
13181            v: V,
13182        ) -> Self {
13183            self.0.request = v.into();
13184            self
13185        }
13186
13187        /// Sets all the options, replacing any prior values.
13188        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13189            self.0.options = v.into();
13190            self
13191        }
13192
13193        /// Sends the request.
13194        ///
13195        /// # Long running operations
13196        ///
13197        /// This starts, but does not poll, a longrunning operation. More information
13198        /// on [delete_mirroring_deployment_group][crate::client::Mirroring::delete_mirroring_deployment_group].
13199        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13200            (*self.0.stub)
13201                .delete_mirroring_deployment_group(self.0.request, self.0.options)
13202                .await
13203                .map(crate::Response::into_body)
13204        }
13205
13206        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_deployment_group`.
13207        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
13208            type Operation =
13209                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
13210            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13211            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13212            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
13213            if let Some(ref mut details) = poller_options.tracing {
13214                details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::delete_mirroring_deployment_group::until_done";
13215            }
13216
13217            let stub = self.0.stub.clone();
13218            let mut options = self.0.options.clone();
13219            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13220            let query = move |name| {
13221                let stub = stub.clone();
13222                let options = options.clone();
13223                async {
13224                    let op = GetOperation::new(stub)
13225                        .set_name(name)
13226                        .with_options(options)
13227                        .send()
13228                        .await?;
13229                    Ok(Operation::new(op))
13230                }
13231            };
13232
13233            let start = move || async {
13234                let op = self.send().await?;
13235                Ok(Operation::new(op))
13236            };
13237
13238            use google_cloud_lro::internal::PollerExt;
13239            {
13240                google_cloud_lro::internal::new_unit_response_poller(
13241                    polling_error_policy,
13242                    polling_backoff_policy,
13243                    start,
13244                    query,
13245                )
13246            }
13247            .with_options(poller_options)
13248        }
13249
13250        /// Sets the value of [name][crate::model::DeleteMirroringDeploymentGroupRequest::name].
13251        ///
13252        /// This is a **required** field for requests.
13253        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13254            self.0.request.name = v.into();
13255            self
13256        }
13257
13258        /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentGroupRequest::request_id].
13259        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13260            self.0.request.request_id = v.into();
13261            self
13262        }
13263    }
13264
13265    #[doc(hidden)]
13266    impl crate::RequestBuilder for DeleteMirroringDeploymentGroup {
13267        fn request_options(&mut self) -> &mut crate::RequestOptions {
13268            &mut self.0.options
13269        }
13270    }
13271
13272    /// The request builder for [Mirroring::list_mirroring_deployments][crate::client::Mirroring::list_mirroring_deployments] calls.
13273    ///
13274    /// # Example
13275    /// ```
13276    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringDeployments;
13277    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13278    /// use google_cloud_gax::paginator::ItemPaginator;
13279    ///
13280    /// let builder = prepare_request_builder();
13281    /// let mut items = builder.by_item();
13282    /// while let Some(result) = items.next().await {
13283    ///   let item = result?;
13284    /// }
13285    /// # Ok(()) }
13286    ///
13287    /// fn prepare_request_builder() -> ListMirroringDeployments {
13288    ///   # panic!();
13289    ///   // ... details omitted ...
13290    /// }
13291    /// ```
13292    #[derive(Clone, Debug)]
13293    pub struct ListMirroringDeployments(
13294        RequestBuilder<crate::model::ListMirroringDeploymentsRequest>,
13295    );
13296
13297    impl ListMirroringDeployments {
13298        pub(crate) fn new(
13299            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13300        ) -> Self {
13301            Self(RequestBuilder::new(stub))
13302        }
13303
13304        /// Sets the full request, replacing any prior values.
13305        pub fn with_request<V: Into<crate::model::ListMirroringDeploymentsRequest>>(
13306            mut self,
13307            v: V,
13308        ) -> Self {
13309            self.0.request = v.into();
13310            self
13311        }
13312
13313        /// Sets all the options, replacing any prior values.
13314        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13315            self.0.options = v.into();
13316            self
13317        }
13318
13319        /// Sends the request.
13320        pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentsResponse> {
13321            (*self.0.stub)
13322                .list_mirroring_deployments(self.0.request, self.0.options)
13323                .await
13324                .map(crate::Response::into_body)
13325        }
13326
13327        /// Streams each page in the collection.
13328        pub fn by_page(
13329            self,
13330        ) -> impl google_cloud_gax::paginator::Paginator<
13331            crate::model::ListMirroringDeploymentsResponse,
13332            crate::Error,
13333        > {
13334            use std::clone::Clone;
13335            let token = self.0.request.page_token.clone();
13336            let execute = move |token: String| {
13337                let mut builder = self.clone();
13338                builder.0.request = builder.0.request.set_page_token(token);
13339                builder.send()
13340            };
13341            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13342        }
13343
13344        /// Streams each item in the collection.
13345        pub fn by_item(
13346            self,
13347        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13348            crate::model::ListMirroringDeploymentsResponse,
13349            crate::Error,
13350        > {
13351            use google_cloud_gax::paginator::Paginator;
13352            self.by_page().items()
13353        }
13354
13355        /// Sets the value of [parent][crate::model::ListMirroringDeploymentsRequest::parent].
13356        ///
13357        /// This is a **required** field for requests.
13358        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13359            self.0.request.parent = v.into();
13360            self
13361        }
13362
13363        /// Sets the value of [page_size][crate::model::ListMirroringDeploymentsRequest::page_size].
13364        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13365            self.0.request.page_size = v.into();
13366            self
13367        }
13368
13369        /// Sets the value of [page_token][crate::model::ListMirroringDeploymentsRequest::page_token].
13370        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13371            self.0.request.page_token = v.into();
13372            self
13373        }
13374
13375        /// Sets the value of [filter][crate::model::ListMirroringDeploymentsRequest::filter].
13376        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13377            self.0.request.filter = v.into();
13378            self
13379        }
13380
13381        /// Sets the value of [order_by][crate::model::ListMirroringDeploymentsRequest::order_by].
13382        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
13383            self.0.request.order_by = v.into();
13384            self
13385        }
13386    }
13387
13388    #[doc(hidden)]
13389    impl crate::RequestBuilder for ListMirroringDeployments {
13390        fn request_options(&mut self) -> &mut crate::RequestOptions {
13391            &mut self.0.options
13392        }
13393    }
13394
13395    /// The request builder for [Mirroring::get_mirroring_deployment][crate::client::Mirroring::get_mirroring_deployment] calls.
13396    ///
13397    /// # Example
13398    /// ```
13399    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringDeployment;
13400    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13401    ///
13402    /// let builder = prepare_request_builder();
13403    /// let response = builder.send().await?;
13404    /// # Ok(()) }
13405    ///
13406    /// fn prepare_request_builder() -> GetMirroringDeployment {
13407    ///   # panic!();
13408    ///   // ... details omitted ...
13409    /// }
13410    /// ```
13411    #[derive(Clone, Debug)]
13412    pub struct GetMirroringDeployment(RequestBuilder<crate::model::GetMirroringDeploymentRequest>);
13413
13414    impl GetMirroringDeployment {
13415        pub(crate) fn new(
13416            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13417        ) -> Self {
13418            Self(RequestBuilder::new(stub))
13419        }
13420
13421        /// Sets the full request, replacing any prior values.
13422        pub fn with_request<V: Into<crate::model::GetMirroringDeploymentRequest>>(
13423            mut self,
13424            v: V,
13425        ) -> Self {
13426            self.0.request = v.into();
13427            self
13428        }
13429
13430        /// Sets all the options, replacing any prior values.
13431        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13432            self.0.options = v.into();
13433            self
13434        }
13435
13436        /// Sends the request.
13437        pub async fn send(self) -> Result<crate::model::MirroringDeployment> {
13438            (*self.0.stub)
13439                .get_mirroring_deployment(self.0.request, self.0.options)
13440                .await
13441                .map(crate::Response::into_body)
13442        }
13443
13444        /// Sets the value of [name][crate::model::GetMirroringDeploymentRequest::name].
13445        ///
13446        /// This is a **required** field for requests.
13447        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13448            self.0.request.name = v.into();
13449            self
13450        }
13451    }
13452
13453    #[doc(hidden)]
13454    impl crate::RequestBuilder for GetMirroringDeployment {
13455        fn request_options(&mut self) -> &mut crate::RequestOptions {
13456            &mut self.0.options
13457        }
13458    }
13459
13460    /// The request builder for [Mirroring::create_mirroring_deployment][crate::client::Mirroring::create_mirroring_deployment] calls.
13461    ///
13462    /// # Example
13463    /// ```
13464    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringDeployment;
13465    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13466    /// use google_cloud_lro::Poller;
13467    ///
13468    /// let builder = prepare_request_builder();
13469    /// let response = builder.poller().until_done().await?;
13470    /// # Ok(()) }
13471    ///
13472    /// fn prepare_request_builder() -> CreateMirroringDeployment {
13473    ///   # panic!();
13474    ///   // ... details omitted ...
13475    /// }
13476    /// ```
13477    #[derive(Clone, Debug)]
13478    pub struct CreateMirroringDeployment(
13479        RequestBuilder<crate::model::CreateMirroringDeploymentRequest>,
13480    );
13481
13482    impl CreateMirroringDeployment {
13483        pub(crate) fn new(
13484            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13485        ) -> Self {
13486            Self(RequestBuilder::new(stub))
13487        }
13488
13489        /// Sets the full request, replacing any prior values.
13490        pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentRequest>>(
13491            mut self,
13492            v: V,
13493        ) -> Self {
13494            self.0.request = v.into();
13495            self
13496        }
13497
13498        /// Sets all the options, replacing any prior values.
13499        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13500            self.0.options = v.into();
13501            self
13502        }
13503
13504        /// Sends the request.
13505        ///
13506        /// # Long running operations
13507        ///
13508        /// This starts, but does not poll, a longrunning operation. More information
13509        /// on [create_mirroring_deployment][crate::client::Mirroring::create_mirroring_deployment].
13510        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13511            (*self.0.stub)
13512                .create_mirroring_deployment(self.0.request, self.0.options)
13513                .await
13514                .map(crate::Response::into_body)
13515        }
13516
13517        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_deployment`.
13518        pub fn poller(
13519            self,
13520        ) -> impl google_cloud_lro::Poller<
13521            crate::model::MirroringDeployment,
13522            crate::model::OperationMetadata,
13523        > {
13524            type Operation = google_cloud_lro::internal::Operation<
13525                crate::model::MirroringDeployment,
13526                crate::model::OperationMetadata,
13527            >;
13528            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13529            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13530            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
13531            if let Some(ref mut details) = poller_options.tracing {
13532                details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::create_mirroring_deployment::until_done";
13533            }
13534
13535            let stub = self.0.stub.clone();
13536            let mut options = self.0.options.clone();
13537            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13538            let query = move |name| {
13539                let stub = stub.clone();
13540                let options = options.clone();
13541                async {
13542                    let op = GetOperation::new(stub)
13543                        .set_name(name)
13544                        .with_options(options)
13545                        .send()
13546                        .await?;
13547                    Ok(Operation::new(op))
13548                }
13549            };
13550
13551            let start = move || async {
13552                let op = self.send().await?;
13553                Ok(Operation::new(op))
13554            };
13555
13556            use google_cloud_lro::internal::PollerExt;
13557            {
13558                google_cloud_lro::internal::new_poller(
13559                    polling_error_policy,
13560                    polling_backoff_policy,
13561                    start,
13562                    query,
13563                )
13564            }
13565            .with_options(poller_options)
13566        }
13567
13568        /// Sets the value of [parent][crate::model::CreateMirroringDeploymentRequest::parent].
13569        ///
13570        /// This is a **required** field for requests.
13571        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13572            self.0.request.parent = v.into();
13573            self
13574        }
13575
13576        /// Sets the value of [mirroring_deployment_id][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment_id].
13577        ///
13578        /// This is a **required** field for requests.
13579        pub fn set_mirroring_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13580            self.0.request.mirroring_deployment_id = v.into();
13581            self
13582        }
13583
13584        /// Sets the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
13585        ///
13586        /// This is a **required** field for requests.
13587        pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
13588        where
13589            T: std::convert::Into<crate::model::MirroringDeployment>,
13590        {
13591            self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
13592            self
13593        }
13594
13595        /// Sets or clears the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
13596        ///
13597        /// This is a **required** field for requests.
13598        pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
13599        where
13600            T: std::convert::Into<crate::model::MirroringDeployment>,
13601        {
13602            self.0.request.mirroring_deployment = v.map(|x| x.into());
13603            self
13604        }
13605
13606        /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentRequest::request_id].
13607        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13608            self.0.request.request_id = v.into();
13609            self
13610        }
13611    }
13612
13613    #[doc(hidden)]
13614    impl crate::RequestBuilder for CreateMirroringDeployment {
13615        fn request_options(&mut self) -> &mut crate::RequestOptions {
13616            &mut self.0.options
13617        }
13618    }
13619
13620    /// The request builder for [Mirroring::update_mirroring_deployment][crate::client::Mirroring::update_mirroring_deployment] calls.
13621    ///
13622    /// # Example
13623    /// ```
13624    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringDeployment;
13625    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13626    /// use google_cloud_lro::Poller;
13627    ///
13628    /// let builder = prepare_request_builder();
13629    /// let response = builder.poller().until_done().await?;
13630    /// # Ok(()) }
13631    ///
13632    /// fn prepare_request_builder() -> UpdateMirroringDeployment {
13633    ///   # panic!();
13634    ///   // ... details omitted ...
13635    /// }
13636    /// ```
13637    #[derive(Clone, Debug)]
13638    pub struct UpdateMirroringDeployment(
13639        RequestBuilder<crate::model::UpdateMirroringDeploymentRequest>,
13640    );
13641
13642    impl UpdateMirroringDeployment {
13643        pub(crate) fn new(
13644            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13645        ) -> Self {
13646            Self(RequestBuilder::new(stub))
13647        }
13648
13649        /// Sets the full request, replacing any prior values.
13650        pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentRequest>>(
13651            mut self,
13652            v: V,
13653        ) -> Self {
13654            self.0.request = v.into();
13655            self
13656        }
13657
13658        /// Sets all the options, replacing any prior values.
13659        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13660            self.0.options = v.into();
13661            self
13662        }
13663
13664        /// Sends the request.
13665        ///
13666        /// # Long running operations
13667        ///
13668        /// This starts, but does not poll, a longrunning operation. More information
13669        /// on [update_mirroring_deployment][crate::client::Mirroring::update_mirroring_deployment].
13670        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13671            (*self.0.stub)
13672                .update_mirroring_deployment(self.0.request, self.0.options)
13673                .await
13674                .map(crate::Response::into_body)
13675        }
13676
13677        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_deployment`.
13678        pub fn poller(
13679            self,
13680        ) -> impl google_cloud_lro::Poller<
13681            crate::model::MirroringDeployment,
13682            crate::model::OperationMetadata,
13683        > {
13684            type Operation = google_cloud_lro::internal::Operation<
13685                crate::model::MirroringDeployment,
13686                crate::model::OperationMetadata,
13687            >;
13688            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13689            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13690            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
13691            if let Some(ref mut details) = poller_options.tracing {
13692                details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::update_mirroring_deployment::until_done";
13693            }
13694
13695            let stub = self.0.stub.clone();
13696            let mut options = self.0.options.clone();
13697            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13698            let query = move |name| {
13699                let stub = stub.clone();
13700                let options = options.clone();
13701                async {
13702                    let op = GetOperation::new(stub)
13703                        .set_name(name)
13704                        .with_options(options)
13705                        .send()
13706                        .await?;
13707                    Ok(Operation::new(op))
13708                }
13709            };
13710
13711            let start = move || async {
13712                let op = self.send().await?;
13713                Ok(Operation::new(op))
13714            };
13715
13716            use google_cloud_lro::internal::PollerExt;
13717            {
13718                google_cloud_lro::internal::new_poller(
13719                    polling_error_policy,
13720                    polling_backoff_policy,
13721                    start,
13722                    query,
13723                )
13724            }
13725            .with_options(poller_options)
13726        }
13727
13728        /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
13729        pub fn set_update_mask<T>(mut self, v: T) -> Self
13730        where
13731            T: std::convert::Into<wkt::FieldMask>,
13732        {
13733            self.0.request.update_mask = std::option::Option::Some(v.into());
13734            self
13735        }
13736
13737        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
13738        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13739        where
13740            T: std::convert::Into<wkt::FieldMask>,
13741        {
13742            self.0.request.update_mask = v.map(|x| x.into());
13743            self
13744        }
13745
13746        /// Sets the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
13747        ///
13748        /// This is a **required** field for requests.
13749        pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
13750        where
13751            T: std::convert::Into<crate::model::MirroringDeployment>,
13752        {
13753            self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
13754            self
13755        }
13756
13757        /// Sets or clears the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
13758        ///
13759        /// This is a **required** field for requests.
13760        pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
13761        where
13762            T: std::convert::Into<crate::model::MirroringDeployment>,
13763        {
13764            self.0.request.mirroring_deployment = v.map(|x| x.into());
13765            self
13766        }
13767
13768        /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentRequest::request_id].
13769        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13770            self.0.request.request_id = v.into();
13771            self
13772        }
13773    }
13774
13775    #[doc(hidden)]
13776    impl crate::RequestBuilder for UpdateMirroringDeployment {
13777        fn request_options(&mut self) -> &mut crate::RequestOptions {
13778            &mut self.0.options
13779        }
13780    }
13781
13782    /// The request builder for [Mirroring::delete_mirroring_deployment][crate::client::Mirroring::delete_mirroring_deployment] calls.
13783    ///
13784    /// # Example
13785    /// ```
13786    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringDeployment;
13787    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13788    /// use google_cloud_lro::Poller;
13789    ///
13790    /// let builder = prepare_request_builder();
13791    /// let response = builder.poller().until_done().await?;
13792    /// # Ok(()) }
13793    ///
13794    /// fn prepare_request_builder() -> DeleteMirroringDeployment {
13795    ///   # panic!();
13796    ///   // ... details omitted ...
13797    /// }
13798    /// ```
13799    #[derive(Clone, Debug)]
13800    pub struct DeleteMirroringDeployment(
13801        RequestBuilder<crate::model::DeleteMirroringDeploymentRequest>,
13802    );
13803
13804    impl DeleteMirroringDeployment {
13805        pub(crate) fn new(
13806            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13807        ) -> Self {
13808            Self(RequestBuilder::new(stub))
13809        }
13810
13811        /// Sets the full request, replacing any prior values.
13812        pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentRequest>>(
13813            mut self,
13814            v: V,
13815        ) -> Self {
13816            self.0.request = v.into();
13817            self
13818        }
13819
13820        /// Sets all the options, replacing any prior values.
13821        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13822            self.0.options = v.into();
13823            self
13824        }
13825
13826        /// Sends the request.
13827        ///
13828        /// # Long running operations
13829        ///
13830        /// This starts, but does not poll, a longrunning operation. More information
13831        /// on [delete_mirroring_deployment][crate::client::Mirroring::delete_mirroring_deployment].
13832        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13833            (*self.0.stub)
13834                .delete_mirroring_deployment(self.0.request, self.0.options)
13835                .await
13836                .map(crate::Response::into_body)
13837        }
13838
13839        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_deployment`.
13840        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
13841            type Operation =
13842                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
13843            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13844            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13845            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
13846            if let Some(ref mut details) = poller_options.tracing {
13847                details.method_name = "google_cloud_networksecurity_v1::client::Mirroring::delete_mirroring_deployment::until_done";
13848            }
13849
13850            let stub = self.0.stub.clone();
13851            let mut options = self.0.options.clone();
13852            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13853            let query = move |name| {
13854                let stub = stub.clone();
13855                let options = options.clone();
13856                async {
13857                    let op = GetOperation::new(stub)
13858                        .set_name(name)
13859                        .with_options(options)
13860                        .send()
13861                        .await?;
13862                    Ok(Operation::new(op))
13863                }
13864            };
13865
13866            let start = move || async {
13867                let op = self.send().await?;
13868                Ok(Operation::new(op))
13869            };
13870
13871            use google_cloud_lro::internal::PollerExt;
13872            {
13873                google_cloud_lro::internal::new_unit_response_poller(
13874                    polling_error_policy,
13875                    polling_backoff_policy,
13876                    start,
13877                    query,
13878                )
13879            }
13880            .with_options(poller_options)
13881        }
13882
13883        /// Sets the value of [name][crate::model::DeleteMirroringDeploymentRequest::name].
13884        ///
13885        /// This is a **required** field for requests.
13886        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13887            self.0.request.name = v.into();
13888            self
13889        }
13890
13891        /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentRequest::request_id].
13892        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13893            self.0.request.request_id = v.into();
13894            self
13895        }
13896    }
13897
13898    #[doc(hidden)]
13899    impl crate::RequestBuilder for DeleteMirroringDeployment {
13900        fn request_options(&mut self) -> &mut crate::RequestOptions {
13901            &mut self.0.options
13902        }
13903    }
13904
13905    /// The request builder for [Mirroring::list_locations][crate::client::Mirroring::list_locations] calls.
13906    ///
13907    /// # Example
13908    /// ```
13909    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListLocations;
13910    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13911    /// use google_cloud_gax::paginator::ItemPaginator;
13912    ///
13913    /// let builder = prepare_request_builder();
13914    /// let mut items = builder.by_item();
13915    /// while let Some(result) = items.next().await {
13916    ///   let item = result?;
13917    /// }
13918    /// # Ok(()) }
13919    ///
13920    /// fn prepare_request_builder() -> ListLocations {
13921    ///   # panic!();
13922    ///   // ... details omitted ...
13923    /// }
13924    /// ```
13925    #[derive(Clone, Debug)]
13926    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13927
13928    impl ListLocations {
13929        pub(crate) fn new(
13930            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13931        ) -> Self {
13932            Self(RequestBuilder::new(stub))
13933        }
13934
13935        /// Sets the full request, replacing any prior values.
13936        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13937            mut self,
13938            v: V,
13939        ) -> Self {
13940            self.0.request = v.into();
13941            self
13942        }
13943
13944        /// Sets all the options, replacing any prior values.
13945        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13946            self.0.options = v.into();
13947            self
13948        }
13949
13950        /// Sends the request.
13951        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
13952            (*self.0.stub)
13953                .list_locations(self.0.request, self.0.options)
13954                .await
13955                .map(crate::Response::into_body)
13956        }
13957
13958        /// Streams each page in the collection.
13959        pub fn by_page(
13960            self,
13961        ) -> impl google_cloud_gax::paginator::Paginator<
13962            google_cloud_location::model::ListLocationsResponse,
13963            crate::Error,
13964        > {
13965            use std::clone::Clone;
13966            let token = self.0.request.page_token.clone();
13967            let execute = move |token: String| {
13968                let mut builder = self.clone();
13969                builder.0.request = builder.0.request.set_page_token(token);
13970                builder.send()
13971            };
13972            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13973        }
13974
13975        /// Streams each item in the collection.
13976        pub fn by_item(
13977            self,
13978        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13979            google_cloud_location::model::ListLocationsResponse,
13980            crate::Error,
13981        > {
13982            use google_cloud_gax::paginator::Paginator;
13983            self.by_page().items()
13984        }
13985
13986        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
13987        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13988            self.0.request.name = v.into();
13989            self
13990        }
13991
13992        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
13993        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13994            self.0.request.filter = v.into();
13995            self
13996        }
13997
13998        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
13999        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14000            self.0.request.page_size = v.into();
14001            self
14002        }
14003
14004        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
14005        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14006            self.0.request.page_token = v.into();
14007            self
14008        }
14009    }
14010
14011    #[doc(hidden)]
14012    impl crate::RequestBuilder for ListLocations {
14013        fn request_options(&mut self) -> &mut crate::RequestOptions {
14014            &mut self.0.options
14015        }
14016    }
14017
14018    /// The request builder for [Mirroring::get_location][crate::client::Mirroring::get_location] calls.
14019    ///
14020    /// # Example
14021    /// ```
14022    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetLocation;
14023    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14024    ///
14025    /// let builder = prepare_request_builder();
14026    /// let response = builder.send().await?;
14027    /// # Ok(()) }
14028    ///
14029    /// fn prepare_request_builder() -> GetLocation {
14030    ///   # panic!();
14031    ///   // ... details omitted ...
14032    /// }
14033    /// ```
14034    #[derive(Clone, Debug)]
14035    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
14036
14037    impl GetLocation {
14038        pub(crate) fn new(
14039            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14040        ) -> Self {
14041            Self(RequestBuilder::new(stub))
14042        }
14043
14044        /// Sets the full request, replacing any prior values.
14045        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
14046            mut self,
14047            v: V,
14048        ) -> Self {
14049            self.0.request = v.into();
14050            self
14051        }
14052
14053        /// Sets all the options, replacing any prior values.
14054        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14055            self.0.options = v.into();
14056            self
14057        }
14058
14059        /// Sends the request.
14060        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
14061            (*self.0.stub)
14062                .get_location(self.0.request, self.0.options)
14063                .await
14064                .map(crate::Response::into_body)
14065        }
14066
14067        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
14068        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14069            self.0.request.name = v.into();
14070            self
14071        }
14072    }
14073
14074    #[doc(hidden)]
14075    impl crate::RequestBuilder for GetLocation {
14076        fn request_options(&mut self) -> &mut crate::RequestOptions {
14077            &mut self.0.options
14078        }
14079    }
14080
14081    /// The request builder for [Mirroring::set_iam_policy][crate::client::Mirroring::set_iam_policy] calls.
14082    ///
14083    /// # Example
14084    /// ```
14085    /// # use google_cloud_networksecurity_v1::builder::mirroring::SetIamPolicy;
14086    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14087    ///
14088    /// let builder = prepare_request_builder();
14089    /// let response = builder.send().await?;
14090    /// # Ok(()) }
14091    ///
14092    /// fn prepare_request_builder() -> SetIamPolicy {
14093    ///   # panic!();
14094    ///   // ... details omitted ...
14095    /// }
14096    /// ```
14097    #[derive(Clone, Debug)]
14098    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
14099
14100    impl SetIamPolicy {
14101        pub(crate) fn new(
14102            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14103        ) -> Self {
14104            Self(RequestBuilder::new(stub))
14105        }
14106
14107        /// Sets the full request, replacing any prior values.
14108        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
14109            mut self,
14110            v: V,
14111        ) -> Self {
14112            self.0.request = v.into();
14113            self
14114        }
14115
14116        /// Sets all the options, replacing any prior values.
14117        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14118            self.0.options = v.into();
14119            self
14120        }
14121
14122        /// Sends the request.
14123        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
14124            (*self.0.stub)
14125                .set_iam_policy(self.0.request, self.0.options)
14126                .await
14127                .map(crate::Response::into_body)
14128        }
14129
14130        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
14131        ///
14132        /// This is a **required** field for requests.
14133        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
14134            self.0.request.resource = v.into();
14135            self
14136        }
14137
14138        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
14139        ///
14140        /// This is a **required** field for requests.
14141        pub fn set_policy<T>(mut self, v: T) -> Self
14142        where
14143            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
14144        {
14145            self.0.request.policy = std::option::Option::Some(v.into());
14146            self
14147        }
14148
14149        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
14150        ///
14151        /// This is a **required** field for requests.
14152        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
14153        where
14154            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
14155        {
14156            self.0.request.policy = v.map(|x| x.into());
14157            self
14158        }
14159
14160        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
14161        pub fn set_update_mask<T>(mut self, v: T) -> Self
14162        where
14163            T: std::convert::Into<wkt::FieldMask>,
14164        {
14165            self.0.request.update_mask = std::option::Option::Some(v.into());
14166            self
14167        }
14168
14169        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
14170        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14171        where
14172            T: std::convert::Into<wkt::FieldMask>,
14173        {
14174            self.0.request.update_mask = v.map(|x| x.into());
14175            self
14176        }
14177    }
14178
14179    #[doc(hidden)]
14180    impl crate::RequestBuilder for SetIamPolicy {
14181        fn request_options(&mut self) -> &mut crate::RequestOptions {
14182            &mut self.0.options
14183        }
14184    }
14185
14186    /// The request builder for [Mirroring::get_iam_policy][crate::client::Mirroring::get_iam_policy] calls.
14187    ///
14188    /// # Example
14189    /// ```
14190    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetIamPolicy;
14191    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14192    ///
14193    /// let builder = prepare_request_builder();
14194    /// let response = builder.send().await?;
14195    /// # Ok(()) }
14196    ///
14197    /// fn prepare_request_builder() -> GetIamPolicy {
14198    ///   # panic!();
14199    ///   // ... details omitted ...
14200    /// }
14201    /// ```
14202    #[derive(Clone, Debug)]
14203    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
14204
14205    impl GetIamPolicy {
14206        pub(crate) fn new(
14207            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14208        ) -> Self {
14209            Self(RequestBuilder::new(stub))
14210        }
14211
14212        /// Sets the full request, replacing any prior values.
14213        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
14214            mut self,
14215            v: V,
14216        ) -> Self {
14217            self.0.request = v.into();
14218            self
14219        }
14220
14221        /// Sets all the options, replacing any prior values.
14222        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14223            self.0.options = v.into();
14224            self
14225        }
14226
14227        /// Sends the request.
14228        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
14229            (*self.0.stub)
14230                .get_iam_policy(self.0.request, self.0.options)
14231                .await
14232                .map(crate::Response::into_body)
14233        }
14234
14235        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
14236        ///
14237        /// This is a **required** field for requests.
14238        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
14239            self.0.request.resource = v.into();
14240            self
14241        }
14242
14243        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
14244        pub fn set_options<T>(mut self, v: T) -> Self
14245        where
14246            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
14247        {
14248            self.0.request.options = std::option::Option::Some(v.into());
14249            self
14250        }
14251
14252        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
14253        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
14254        where
14255            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
14256        {
14257            self.0.request.options = v.map(|x| x.into());
14258            self
14259        }
14260    }
14261
14262    #[doc(hidden)]
14263    impl crate::RequestBuilder for GetIamPolicy {
14264        fn request_options(&mut self) -> &mut crate::RequestOptions {
14265            &mut self.0.options
14266        }
14267    }
14268
14269    /// The request builder for [Mirroring::test_iam_permissions][crate::client::Mirroring::test_iam_permissions] calls.
14270    ///
14271    /// # Example
14272    /// ```
14273    /// # use google_cloud_networksecurity_v1::builder::mirroring::TestIamPermissions;
14274    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14275    ///
14276    /// let builder = prepare_request_builder();
14277    /// let response = builder.send().await?;
14278    /// # Ok(()) }
14279    ///
14280    /// fn prepare_request_builder() -> TestIamPermissions {
14281    ///   # panic!();
14282    ///   // ... details omitted ...
14283    /// }
14284    /// ```
14285    #[derive(Clone, Debug)]
14286    pub struct TestIamPermissions(
14287        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
14288    );
14289
14290    impl TestIamPermissions {
14291        pub(crate) fn new(
14292            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14293        ) -> Self {
14294            Self(RequestBuilder::new(stub))
14295        }
14296
14297        /// Sets the full request, replacing any prior values.
14298        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
14299            mut self,
14300            v: V,
14301        ) -> Self {
14302            self.0.request = v.into();
14303            self
14304        }
14305
14306        /// Sets all the options, replacing any prior values.
14307        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14308            self.0.options = v.into();
14309            self
14310        }
14311
14312        /// Sends the request.
14313        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
14314            (*self.0.stub)
14315                .test_iam_permissions(self.0.request, self.0.options)
14316                .await
14317                .map(crate::Response::into_body)
14318        }
14319
14320        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
14321        ///
14322        /// This is a **required** field for requests.
14323        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
14324            self.0.request.resource = v.into();
14325            self
14326        }
14327
14328        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
14329        ///
14330        /// This is a **required** field for requests.
14331        pub fn set_permissions<T, V>(mut self, v: T) -> Self
14332        where
14333            T: std::iter::IntoIterator<Item = V>,
14334            V: std::convert::Into<std::string::String>,
14335        {
14336            use std::iter::Iterator;
14337            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
14338            self
14339        }
14340    }
14341
14342    #[doc(hidden)]
14343    impl crate::RequestBuilder for TestIamPermissions {
14344        fn request_options(&mut self) -> &mut crate::RequestOptions {
14345            &mut self.0.options
14346        }
14347    }
14348
14349    /// The request builder for [Mirroring::list_operations][crate::client::Mirroring::list_operations] calls.
14350    ///
14351    /// # Example
14352    /// ```
14353    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListOperations;
14354    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14355    /// use google_cloud_gax::paginator::ItemPaginator;
14356    ///
14357    /// let builder = prepare_request_builder();
14358    /// let mut items = builder.by_item();
14359    /// while let Some(result) = items.next().await {
14360    ///   let item = result?;
14361    /// }
14362    /// # Ok(()) }
14363    ///
14364    /// fn prepare_request_builder() -> ListOperations {
14365    ///   # panic!();
14366    ///   // ... details omitted ...
14367    /// }
14368    /// ```
14369    #[derive(Clone, Debug)]
14370    pub struct ListOperations(
14371        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
14372    );
14373
14374    impl ListOperations {
14375        pub(crate) fn new(
14376            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14377        ) -> Self {
14378            Self(RequestBuilder::new(stub))
14379        }
14380
14381        /// Sets the full request, replacing any prior values.
14382        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
14383            mut self,
14384            v: V,
14385        ) -> Self {
14386            self.0.request = v.into();
14387            self
14388        }
14389
14390        /// Sets all the options, replacing any prior values.
14391        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14392            self.0.options = v.into();
14393            self
14394        }
14395
14396        /// Sends the request.
14397        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
14398            (*self.0.stub)
14399                .list_operations(self.0.request, self.0.options)
14400                .await
14401                .map(crate::Response::into_body)
14402        }
14403
14404        /// Streams each page in the collection.
14405        pub fn by_page(
14406            self,
14407        ) -> impl google_cloud_gax::paginator::Paginator<
14408            google_cloud_longrunning::model::ListOperationsResponse,
14409            crate::Error,
14410        > {
14411            use std::clone::Clone;
14412            let token = self.0.request.page_token.clone();
14413            let execute = move |token: String| {
14414                let mut builder = self.clone();
14415                builder.0.request = builder.0.request.set_page_token(token);
14416                builder.send()
14417            };
14418            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14419        }
14420
14421        /// Streams each item in the collection.
14422        pub fn by_item(
14423            self,
14424        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14425            google_cloud_longrunning::model::ListOperationsResponse,
14426            crate::Error,
14427        > {
14428            use google_cloud_gax::paginator::Paginator;
14429            self.by_page().items()
14430        }
14431
14432        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
14433        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14434            self.0.request.name = v.into();
14435            self
14436        }
14437
14438        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
14439        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14440            self.0.request.filter = v.into();
14441            self
14442        }
14443
14444        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
14445        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14446            self.0.request.page_size = v.into();
14447            self
14448        }
14449
14450        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
14451        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14452            self.0.request.page_token = v.into();
14453            self
14454        }
14455
14456        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
14457        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14458            self.0.request.return_partial_success = v.into();
14459            self
14460        }
14461    }
14462
14463    #[doc(hidden)]
14464    impl crate::RequestBuilder for ListOperations {
14465        fn request_options(&mut self) -> &mut crate::RequestOptions {
14466            &mut self.0.options
14467        }
14468    }
14469
14470    /// The request builder for [Mirroring::get_operation][crate::client::Mirroring::get_operation] calls.
14471    ///
14472    /// # Example
14473    /// ```
14474    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetOperation;
14475    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14476    ///
14477    /// let builder = prepare_request_builder();
14478    /// let response = builder.send().await?;
14479    /// # Ok(()) }
14480    ///
14481    /// fn prepare_request_builder() -> GetOperation {
14482    ///   # panic!();
14483    ///   // ... details omitted ...
14484    /// }
14485    /// ```
14486    #[derive(Clone, Debug)]
14487    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
14488
14489    impl GetOperation {
14490        pub(crate) fn new(
14491            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14492        ) -> Self {
14493            Self(RequestBuilder::new(stub))
14494        }
14495
14496        /// Sets the full request, replacing any prior values.
14497        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
14498            mut self,
14499            v: V,
14500        ) -> Self {
14501            self.0.request = v.into();
14502            self
14503        }
14504
14505        /// Sets all the options, replacing any prior values.
14506        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14507            self.0.options = v.into();
14508            self
14509        }
14510
14511        /// Sends the request.
14512        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14513            (*self.0.stub)
14514                .get_operation(self.0.request, self.0.options)
14515                .await
14516                .map(crate::Response::into_body)
14517        }
14518
14519        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
14520        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14521            self.0.request.name = v.into();
14522            self
14523        }
14524    }
14525
14526    #[doc(hidden)]
14527    impl crate::RequestBuilder for GetOperation {
14528        fn request_options(&mut self) -> &mut crate::RequestOptions {
14529            &mut self.0.options
14530        }
14531    }
14532
14533    /// The request builder for [Mirroring::delete_operation][crate::client::Mirroring::delete_operation] calls.
14534    ///
14535    /// # Example
14536    /// ```
14537    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteOperation;
14538    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14539    ///
14540    /// let builder = prepare_request_builder();
14541    /// let response = builder.send().await?;
14542    /// # Ok(()) }
14543    ///
14544    /// fn prepare_request_builder() -> DeleteOperation {
14545    ///   # panic!();
14546    ///   // ... details omitted ...
14547    /// }
14548    /// ```
14549    #[derive(Clone, Debug)]
14550    pub struct DeleteOperation(
14551        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
14552    );
14553
14554    impl DeleteOperation {
14555        pub(crate) fn new(
14556            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14557        ) -> Self {
14558            Self(RequestBuilder::new(stub))
14559        }
14560
14561        /// Sets the full request, replacing any prior values.
14562        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
14563            mut self,
14564            v: V,
14565        ) -> Self {
14566            self.0.request = v.into();
14567            self
14568        }
14569
14570        /// Sets all the options, replacing any prior values.
14571        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14572            self.0.options = v.into();
14573            self
14574        }
14575
14576        /// Sends the request.
14577        pub async fn send(self) -> Result<()> {
14578            (*self.0.stub)
14579                .delete_operation(self.0.request, self.0.options)
14580                .await
14581                .map(crate::Response::into_body)
14582        }
14583
14584        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
14585        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14586            self.0.request.name = v.into();
14587            self
14588        }
14589    }
14590
14591    #[doc(hidden)]
14592    impl crate::RequestBuilder for DeleteOperation {
14593        fn request_options(&mut self) -> &mut crate::RequestOptions {
14594            &mut self.0.options
14595        }
14596    }
14597
14598    /// The request builder for [Mirroring::cancel_operation][crate::client::Mirroring::cancel_operation] calls.
14599    ///
14600    /// # Example
14601    /// ```
14602    /// # use google_cloud_networksecurity_v1::builder::mirroring::CancelOperation;
14603    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14604    ///
14605    /// let builder = prepare_request_builder();
14606    /// let response = builder.send().await?;
14607    /// # Ok(()) }
14608    ///
14609    /// fn prepare_request_builder() -> CancelOperation {
14610    ///   # panic!();
14611    ///   // ... details omitted ...
14612    /// }
14613    /// ```
14614    #[derive(Clone, Debug)]
14615    pub struct CancelOperation(
14616        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
14617    );
14618
14619    impl CancelOperation {
14620        pub(crate) fn new(
14621            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14622        ) -> Self {
14623            Self(RequestBuilder::new(stub))
14624        }
14625
14626        /// Sets the full request, replacing any prior values.
14627        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
14628            mut self,
14629            v: V,
14630        ) -> Self {
14631            self.0.request = v.into();
14632            self
14633        }
14634
14635        /// Sets all the options, replacing any prior values.
14636        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14637            self.0.options = v.into();
14638            self
14639        }
14640
14641        /// Sends the request.
14642        pub async fn send(self) -> Result<()> {
14643            (*self.0.stub)
14644                .cancel_operation(self.0.request, self.0.options)
14645                .await
14646                .map(crate::Response::into_body)
14647        }
14648
14649        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
14650        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14651            self.0.request.name = v.into();
14652            self
14653        }
14654    }
14655
14656    #[doc(hidden)]
14657    impl crate::RequestBuilder for CancelOperation {
14658        fn request_options(&mut self) -> &mut crate::RequestOptions {
14659            &mut self.0.options
14660        }
14661    }
14662}
14663
14664/// Request and client builders for [NetworkSecurity][crate::client::NetworkSecurity].
14665pub mod network_security {
14666    use crate::Result;
14667
14668    /// A builder for [NetworkSecurity][crate::client::NetworkSecurity].
14669    ///
14670    /// ```
14671    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14672    /// # use google_cloud_networksecurity_v1::*;
14673    /// # use builder::network_security::ClientBuilder;
14674    /// # use client::NetworkSecurity;
14675    /// let builder : ClientBuilder = NetworkSecurity::builder();
14676    /// let client = builder
14677    ///     .with_endpoint("https://networksecurity.googleapis.com")
14678    ///     .build().await?;
14679    /// # Ok(()) }
14680    /// ```
14681    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14682
14683    pub(crate) mod client {
14684        use super::super::super::client::NetworkSecurity;
14685        pub struct Factory;
14686        impl crate::ClientFactory for Factory {
14687            type Client = NetworkSecurity;
14688            type Credentials = gaxi::options::Credentials;
14689            async fn build(
14690                self,
14691                config: gaxi::options::ClientConfig,
14692            ) -> crate::ClientBuilderResult<Self::Client> {
14693                Self::Client::new(config).await
14694            }
14695        }
14696    }
14697
14698    /// Common implementation for [crate::client::NetworkSecurity] request builders.
14699    #[derive(Clone, Debug)]
14700    pub(crate) struct RequestBuilder<R: std::default::Default> {
14701        stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14702        request: R,
14703        options: crate::RequestOptions,
14704    }
14705
14706    impl<R> RequestBuilder<R>
14707    where
14708        R: std::default::Default,
14709    {
14710        pub(crate) fn new(
14711            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14712        ) -> Self {
14713            Self {
14714                stub,
14715                request: R::default(),
14716                options: crate::RequestOptions::default(),
14717            }
14718        }
14719    }
14720
14721    /// The request builder for [NetworkSecurity::list_authorization_policies][crate::client::NetworkSecurity::list_authorization_policies] calls.
14722    ///
14723    /// # Example
14724    /// ```
14725    /// # use google_cloud_networksecurity_v1::builder::network_security::ListAuthorizationPolicies;
14726    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14727    /// use google_cloud_gax::paginator::ItemPaginator;
14728    ///
14729    /// let builder = prepare_request_builder();
14730    /// let mut items = builder.by_item();
14731    /// while let Some(result) = items.next().await {
14732    ///   let item = result?;
14733    /// }
14734    /// # Ok(()) }
14735    ///
14736    /// fn prepare_request_builder() -> ListAuthorizationPolicies {
14737    ///   # panic!();
14738    ///   // ... details omitted ...
14739    /// }
14740    /// ```
14741    #[derive(Clone, Debug)]
14742    pub struct ListAuthorizationPolicies(
14743        RequestBuilder<crate::model::ListAuthorizationPoliciesRequest>,
14744    );
14745
14746    impl ListAuthorizationPolicies {
14747        pub(crate) fn new(
14748            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14749        ) -> Self {
14750            Self(RequestBuilder::new(stub))
14751        }
14752
14753        /// Sets the full request, replacing any prior values.
14754        pub fn with_request<V: Into<crate::model::ListAuthorizationPoliciesRequest>>(
14755            mut self,
14756            v: V,
14757        ) -> Self {
14758            self.0.request = v.into();
14759            self
14760        }
14761
14762        /// Sets all the options, replacing any prior values.
14763        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14764            self.0.options = v.into();
14765            self
14766        }
14767
14768        /// Sends the request.
14769        pub async fn send(self) -> Result<crate::model::ListAuthorizationPoliciesResponse> {
14770            (*self.0.stub)
14771                .list_authorization_policies(self.0.request, self.0.options)
14772                .await
14773                .map(crate::Response::into_body)
14774        }
14775
14776        /// Streams each page in the collection.
14777        pub fn by_page(
14778            self,
14779        ) -> impl google_cloud_gax::paginator::Paginator<
14780            crate::model::ListAuthorizationPoliciesResponse,
14781            crate::Error,
14782        > {
14783            use std::clone::Clone;
14784            let token = self.0.request.page_token.clone();
14785            let execute = move |token: String| {
14786                let mut builder = self.clone();
14787                builder.0.request = builder.0.request.set_page_token(token);
14788                builder.send()
14789            };
14790            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14791        }
14792
14793        /// Streams each item in the collection.
14794        pub fn by_item(
14795            self,
14796        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14797            crate::model::ListAuthorizationPoliciesResponse,
14798            crate::Error,
14799        > {
14800            use google_cloud_gax::paginator::Paginator;
14801            self.by_page().items()
14802        }
14803
14804        /// Sets the value of [parent][crate::model::ListAuthorizationPoliciesRequest::parent].
14805        ///
14806        /// This is a **required** field for requests.
14807        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14808            self.0.request.parent = v.into();
14809            self
14810        }
14811
14812        /// Sets the value of [page_size][crate::model::ListAuthorizationPoliciesRequest::page_size].
14813        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14814            self.0.request.page_size = v.into();
14815            self
14816        }
14817
14818        /// Sets the value of [page_token][crate::model::ListAuthorizationPoliciesRequest::page_token].
14819        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14820            self.0.request.page_token = v.into();
14821            self
14822        }
14823    }
14824
14825    #[doc(hidden)]
14826    impl crate::RequestBuilder for ListAuthorizationPolicies {
14827        fn request_options(&mut self) -> &mut crate::RequestOptions {
14828            &mut self.0.options
14829        }
14830    }
14831
14832    /// The request builder for [NetworkSecurity::get_authorization_policy][crate::client::NetworkSecurity::get_authorization_policy] calls.
14833    ///
14834    /// # Example
14835    /// ```
14836    /// # use google_cloud_networksecurity_v1::builder::network_security::GetAuthorizationPolicy;
14837    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14838    ///
14839    /// let builder = prepare_request_builder();
14840    /// let response = builder.send().await?;
14841    /// # Ok(()) }
14842    ///
14843    /// fn prepare_request_builder() -> GetAuthorizationPolicy {
14844    ///   # panic!();
14845    ///   // ... details omitted ...
14846    /// }
14847    /// ```
14848    #[derive(Clone, Debug)]
14849    pub struct GetAuthorizationPolicy(RequestBuilder<crate::model::GetAuthorizationPolicyRequest>);
14850
14851    impl GetAuthorizationPolicy {
14852        pub(crate) fn new(
14853            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14854        ) -> Self {
14855            Self(RequestBuilder::new(stub))
14856        }
14857
14858        /// Sets the full request, replacing any prior values.
14859        pub fn with_request<V: Into<crate::model::GetAuthorizationPolicyRequest>>(
14860            mut self,
14861            v: V,
14862        ) -> Self {
14863            self.0.request = v.into();
14864            self
14865        }
14866
14867        /// Sets all the options, replacing any prior values.
14868        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14869            self.0.options = v.into();
14870            self
14871        }
14872
14873        /// Sends the request.
14874        pub async fn send(self) -> Result<crate::model::AuthorizationPolicy> {
14875            (*self.0.stub)
14876                .get_authorization_policy(self.0.request, self.0.options)
14877                .await
14878                .map(crate::Response::into_body)
14879        }
14880
14881        /// Sets the value of [name][crate::model::GetAuthorizationPolicyRequest::name].
14882        ///
14883        /// This is a **required** field for requests.
14884        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14885            self.0.request.name = v.into();
14886            self
14887        }
14888    }
14889
14890    #[doc(hidden)]
14891    impl crate::RequestBuilder for GetAuthorizationPolicy {
14892        fn request_options(&mut self) -> &mut crate::RequestOptions {
14893            &mut self.0.options
14894        }
14895    }
14896
14897    /// The request builder for [NetworkSecurity::create_authorization_policy][crate::client::NetworkSecurity::create_authorization_policy] calls.
14898    ///
14899    /// # Example
14900    /// ```
14901    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateAuthorizationPolicy;
14902    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14903    /// use google_cloud_lro::Poller;
14904    ///
14905    /// let builder = prepare_request_builder();
14906    /// let response = builder.poller().until_done().await?;
14907    /// # Ok(()) }
14908    ///
14909    /// fn prepare_request_builder() -> CreateAuthorizationPolicy {
14910    ///   # panic!();
14911    ///   // ... details omitted ...
14912    /// }
14913    /// ```
14914    #[derive(Clone, Debug)]
14915    pub struct CreateAuthorizationPolicy(
14916        RequestBuilder<crate::model::CreateAuthorizationPolicyRequest>,
14917    );
14918
14919    impl CreateAuthorizationPolicy {
14920        pub(crate) fn new(
14921            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14922        ) -> Self {
14923            Self(RequestBuilder::new(stub))
14924        }
14925
14926        /// Sets the full request, replacing any prior values.
14927        pub fn with_request<V: Into<crate::model::CreateAuthorizationPolicyRequest>>(
14928            mut self,
14929            v: V,
14930        ) -> Self {
14931            self.0.request = v.into();
14932            self
14933        }
14934
14935        /// Sets all the options, replacing any prior values.
14936        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14937            self.0.options = v.into();
14938            self
14939        }
14940
14941        /// Sends the request.
14942        ///
14943        /// # Long running operations
14944        ///
14945        /// This starts, but does not poll, a longrunning operation. More information
14946        /// on [create_authorization_policy][crate::client::NetworkSecurity::create_authorization_policy].
14947        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14948            (*self.0.stub)
14949                .create_authorization_policy(self.0.request, self.0.options)
14950                .await
14951                .map(crate::Response::into_body)
14952        }
14953
14954        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_authorization_policy`.
14955        pub fn poller(
14956            self,
14957        ) -> impl google_cloud_lro::Poller<
14958            crate::model::AuthorizationPolicy,
14959            crate::model::OperationMetadata,
14960        > {
14961            type Operation = google_cloud_lro::internal::Operation<
14962                crate::model::AuthorizationPolicy,
14963                crate::model::OperationMetadata,
14964            >;
14965            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14966            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14967            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
14968            if let Some(ref mut details) = poller_options.tracing {
14969                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_authorization_policy::until_done";
14970            }
14971
14972            let stub = self.0.stub.clone();
14973            let mut options = self.0.options.clone();
14974            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14975            let query = move |name| {
14976                let stub = stub.clone();
14977                let options = options.clone();
14978                async {
14979                    let op = GetOperation::new(stub)
14980                        .set_name(name)
14981                        .with_options(options)
14982                        .send()
14983                        .await?;
14984                    Ok(Operation::new(op))
14985                }
14986            };
14987
14988            let start = move || async {
14989                let op = self.send().await?;
14990                Ok(Operation::new(op))
14991            };
14992
14993            use google_cloud_lro::internal::PollerExt;
14994            {
14995                google_cloud_lro::internal::new_poller(
14996                    polling_error_policy,
14997                    polling_backoff_policy,
14998                    start,
14999                    query,
15000                )
15001            }
15002            .with_options(poller_options)
15003        }
15004
15005        /// Sets the value of [parent][crate::model::CreateAuthorizationPolicyRequest::parent].
15006        ///
15007        /// This is a **required** field for requests.
15008        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15009            self.0.request.parent = v.into();
15010            self
15011        }
15012
15013        /// Sets the value of [authorization_policy_id][crate::model::CreateAuthorizationPolicyRequest::authorization_policy_id].
15014        ///
15015        /// This is a **required** field for requests.
15016        pub fn set_authorization_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15017            self.0.request.authorization_policy_id = v.into();
15018            self
15019        }
15020
15021        /// Sets the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
15022        ///
15023        /// This is a **required** field for requests.
15024        pub fn set_authorization_policy<T>(mut self, v: T) -> Self
15025        where
15026            T: std::convert::Into<crate::model::AuthorizationPolicy>,
15027        {
15028            self.0.request.authorization_policy = std::option::Option::Some(v.into());
15029            self
15030        }
15031
15032        /// Sets or clears the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
15033        ///
15034        /// This is a **required** field for requests.
15035        pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
15036        where
15037            T: std::convert::Into<crate::model::AuthorizationPolicy>,
15038        {
15039            self.0.request.authorization_policy = v.map(|x| x.into());
15040            self
15041        }
15042    }
15043
15044    #[doc(hidden)]
15045    impl crate::RequestBuilder for CreateAuthorizationPolicy {
15046        fn request_options(&mut self) -> &mut crate::RequestOptions {
15047            &mut self.0.options
15048        }
15049    }
15050
15051    /// The request builder for [NetworkSecurity::update_authorization_policy][crate::client::NetworkSecurity::update_authorization_policy] calls.
15052    ///
15053    /// # Example
15054    /// ```
15055    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateAuthorizationPolicy;
15056    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15057    /// use google_cloud_lro::Poller;
15058    ///
15059    /// let builder = prepare_request_builder();
15060    /// let response = builder.poller().until_done().await?;
15061    /// # Ok(()) }
15062    ///
15063    /// fn prepare_request_builder() -> UpdateAuthorizationPolicy {
15064    ///   # panic!();
15065    ///   // ... details omitted ...
15066    /// }
15067    /// ```
15068    #[derive(Clone, Debug)]
15069    pub struct UpdateAuthorizationPolicy(
15070        RequestBuilder<crate::model::UpdateAuthorizationPolicyRequest>,
15071    );
15072
15073    impl UpdateAuthorizationPolicy {
15074        pub(crate) fn new(
15075            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15076        ) -> Self {
15077            Self(RequestBuilder::new(stub))
15078        }
15079
15080        /// Sets the full request, replacing any prior values.
15081        pub fn with_request<V: Into<crate::model::UpdateAuthorizationPolicyRequest>>(
15082            mut self,
15083            v: V,
15084        ) -> Self {
15085            self.0.request = v.into();
15086            self
15087        }
15088
15089        /// Sets all the options, replacing any prior values.
15090        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15091            self.0.options = v.into();
15092            self
15093        }
15094
15095        /// Sends the request.
15096        ///
15097        /// # Long running operations
15098        ///
15099        /// This starts, but does not poll, a longrunning operation. More information
15100        /// on [update_authorization_policy][crate::client::NetworkSecurity::update_authorization_policy].
15101        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15102            (*self.0.stub)
15103                .update_authorization_policy(self.0.request, self.0.options)
15104                .await
15105                .map(crate::Response::into_body)
15106        }
15107
15108        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_authorization_policy`.
15109        pub fn poller(
15110            self,
15111        ) -> impl google_cloud_lro::Poller<
15112            crate::model::AuthorizationPolicy,
15113            crate::model::OperationMetadata,
15114        > {
15115            type Operation = google_cloud_lro::internal::Operation<
15116                crate::model::AuthorizationPolicy,
15117                crate::model::OperationMetadata,
15118            >;
15119            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15120            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15121            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
15122            if let Some(ref mut details) = poller_options.tracing {
15123                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_authorization_policy::until_done";
15124            }
15125
15126            let stub = self.0.stub.clone();
15127            let mut options = self.0.options.clone();
15128            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15129            let query = move |name| {
15130                let stub = stub.clone();
15131                let options = options.clone();
15132                async {
15133                    let op = GetOperation::new(stub)
15134                        .set_name(name)
15135                        .with_options(options)
15136                        .send()
15137                        .await?;
15138                    Ok(Operation::new(op))
15139                }
15140            };
15141
15142            let start = move || async {
15143                let op = self.send().await?;
15144                Ok(Operation::new(op))
15145            };
15146
15147            use google_cloud_lro::internal::PollerExt;
15148            {
15149                google_cloud_lro::internal::new_poller(
15150                    polling_error_policy,
15151                    polling_backoff_policy,
15152                    start,
15153                    query,
15154                )
15155            }
15156            .with_options(poller_options)
15157        }
15158
15159        /// Sets the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
15160        pub fn set_update_mask<T>(mut self, v: T) -> Self
15161        where
15162            T: std::convert::Into<wkt::FieldMask>,
15163        {
15164            self.0.request.update_mask = std::option::Option::Some(v.into());
15165            self
15166        }
15167
15168        /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
15169        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15170        where
15171            T: std::convert::Into<wkt::FieldMask>,
15172        {
15173            self.0.request.update_mask = v.map(|x| x.into());
15174            self
15175        }
15176
15177        /// Sets the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
15178        ///
15179        /// This is a **required** field for requests.
15180        pub fn set_authorization_policy<T>(mut self, v: T) -> Self
15181        where
15182            T: std::convert::Into<crate::model::AuthorizationPolicy>,
15183        {
15184            self.0.request.authorization_policy = std::option::Option::Some(v.into());
15185            self
15186        }
15187
15188        /// Sets or clears the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
15189        ///
15190        /// This is a **required** field for requests.
15191        pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
15192        where
15193            T: std::convert::Into<crate::model::AuthorizationPolicy>,
15194        {
15195            self.0.request.authorization_policy = v.map(|x| x.into());
15196            self
15197        }
15198    }
15199
15200    #[doc(hidden)]
15201    impl crate::RequestBuilder for UpdateAuthorizationPolicy {
15202        fn request_options(&mut self) -> &mut crate::RequestOptions {
15203            &mut self.0.options
15204        }
15205    }
15206
15207    /// The request builder for [NetworkSecurity::delete_authorization_policy][crate::client::NetworkSecurity::delete_authorization_policy] calls.
15208    ///
15209    /// # Example
15210    /// ```
15211    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteAuthorizationPolicy;
15212    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15213    /// use google_cloud_lro::Poller;
15214    ///
15215    /// let builder = prepare_request_builder();
15216    /// let response = builder.poller().until_done().await?;
15217    /// # Ok(()) }
15218    ///
15219    /// fn prepare_request_builder() -> DeleteAuthorizationPolicy {
15220    ///   # panic!();
15221    ///   // ... details omitted ...
15222    /// }
15223    /// ```
15224    #[derive(Clone, Debug)]
15225    pub struct DeleteAuthorizationPolicy(
15226        RequestBuilder<crate::model::DeleteAuthorizationPolicyRequest>,
15227    );
15228
15229    impl DeleteAuthorizationPolicy {
15230        pub(crate) fn new(
15231            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15232        ) -> Self {
15233            Self(RequestBuilder::new(stub))
15234        }
15235
15236        /// Sets the full request, replacing any prior values.
15237        pub fn with_request<V: Into<crate::model::DeleteAuthorizationPolicyRequest>>(
15238            mut self,
15239            v: V,
15240        ) -> Self {
15241            self.0.request = v.into();
15242            self
15243        }
15244
15245        /// Sets all the options, replacing any prior values.
15246        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15247            self.0.options = v.into();
15248            self
15249        }
15250
15251        /// Sends the request.
15252        ///
15253        /// # Long running operations
15254        ///
15255        /// This starts, but does not poll, a longrunning operation. More information
15256        /// on [delete_authorization_policy][crate::client::NetworkSecurity::delete_authorization_policy].
15257        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15258            (*self.0.stub)
15259                .delete_authorization_policy(self.0.request, self.0.options)
15260                .await
15261                .map(crate::Response::into_body)
15262        }
15263
15264        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_authorization_policy`.
15265        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
15266            type Operation =
15267                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15268            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15269            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15270            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
15271            if let Some(ref mut details) = poller_options.tracing {
15272                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_authorization_policy::until_done";
15273            }
15274
15275            let stub = self.0.stub.clone();
15276            let mut options = self.0.options.clone();
15277            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15278            let query = move |name| {
15279                let stub = stub.clone();
15280                let options = options.clone();
15281                async {
15282                    let op = GetOperation::new(stub)
15283                        .set_name(name)
15284                        .with_options(options)
15285                        .send()
15286                        .await?;
15287                    Ok(Operation::new(op))
15288                }
15289            };
15290
15291            let start = move || async {
15292                let op = self.send().await?;
15293                Ok(Operation::new(op))
15294            };
15295
15296            use google_cloud_lro::internal::PollerExt;
15297            {
15298                google_cloud_lro::internal::new_unit_response_poller(
15299                    polling_error_policy,
15300                    polling_backoff_policy,
15301                    start,
15302                    query,
15303                )
15304            }
15305            .with_options(poller_options)
15306        }
15307
15308        /// Sets the value of [name][crate::model::DeleteAuthorizationPolicyRequest::name].
15309        ///
15310        /// This is a **required** field for requests.
15311        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15312            self.0.request.name = v.into();
15313            self
15314        }
15315    }
15316
15317    #[doc(hidden)]
15318    impl crate::RequestBuilder for DeleteAuthorizationPolicy {
15319        fn request_options(&mut self) -> &mut crate::RequestOptions {
15320            &mut self.0.options
15321        }
15322    }
15323
15324    /// The request builder for [NetworkSecurity::list_backend_authentication_configs][crate::client::NetworkSecurity::list_backend_authentication_configs] calls.
15325    ///
15326    /// # Example
15327    /// ```
15328    /// # use google_cloud_networksecurity_v1::builder::network_security::ListBackendAuthenticationConfigs;
15329    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15330    /// use google_cloud_gax::paginator::ItemPaginator;
15331    ///
15332    /// let builder = prepare_request_builder();
15333    /// let mut items = builder.by_item();
15334    /// while let Some(result) = items.next().await {
15335    ///   let item = result?;
15336    /// }
15337    /// # Ok(()) }
15338    ///
15339    /// fn prepare_request_builder() -> ListBackendAuthenticationConfigs {
15340    ///   # panic!();
15341    ///   // ... details omitted ...
15342    /// }
15343    /// ```
15344    #[derive(Clone, Debug)]
15345    pub struct ListBackendAuthenticationConfigs(
15346        RequestBuilder<crate::model::ListBackendAuthenticationConfigsRequest>,
15347    );
15348
15349    impl ListBackendAuthenticationConfigs {
15350        pub(crate) fn new(
15351            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15352        ) -> Self {
15353            Self(RequestBuilder::new(stub))
15354        }
15355
15356        /// Sets the full request, replacing any prior values.
15357        pub fn with_request<V: Into<crate::model::ListBackendAuthenticationConfigsRequest>>(
15358            mut self,
15359            v: V,
15360        ) -> Self {
15361            self.0.request = v.into();
15362            self
15363        }
15364
15365        /// Sets all the options, replacing any prior values.
15366        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15367            self.0.options = v.into();
15368            self
15369        }
15370
15371        /// Sends the request.
15372        pub async fn send(self) -> Result<crate::model::ListBackendAuthenticationConfigsResponse> {
15373            (*self.0.stub)
15374                .list_backend_authentication_configs(self.0.request, self.0.options)
15375                .await
15376                .map(crate::Response::into_body)
15377        }
15378
15379        /// Streams each page in the collection.
15380        pub fn by_page(
15381            self,
15382        ) -> impl google_cloud_gax::paginator::Paginator<
15383            crate::model::ListBackendAuthenticationConfigsResponse,
15384            crate::Error,
15385        > {
15386            use std::clone::Clone;
15387            let token = self.0.request.page_token.clone();
15388            let execute = move |token: String| {
15389                let mut builder = self.clone();
15390                builder.0.request = builder.0.request.set_page_token(token);
15391                builder.send()
15392            };
15393            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15394        }
15395
15396        /// Streams each item in the collection.
15397        pub fn by_item(
15398            self,
15399        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15400            crate::model::ListBackendAuthenticationConfigsResponse,
15401            crate::Error,
15402        > {
15403            use google_cloud_gax::paginator::Paginator;
15404            self.by_page().items()
15405        }
15406
15407        /// Sets the value of [parent][crate::model::ListBackendAuthenticationConfigsRequest::parent].
15408        ///
15409        /// This is a **required** field for requests.
15410        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15411            self.0.request.parent = v.into();
15412            self
15413        }
15414
15415        /// Sets the value of [page_size][crate::model::ListBackendAuthenticationConfigsRequest::page_size].
15416        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15417            self.0.request.page_size = v.into();
15418            self
15419        }
15420
15421        /// Sets the value of [page_token][crate::model::ListBackendAuthenticationConfigsRequest::page_token].
15422        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15423            self.0.request.page_token = v.into();
15424            self
15425        }
15426    }
15427
15428    #[doc(hidden)]
15429    impl crate::RequestBuilder for ListBackendAuthenticationConfigs {
15430        fn request_options(&mut self) -> &mut crate::RequestOptions {
15431            &mut self.0.options
15432        }
15433    }
15434
15435    /// The request builder for [NetworkSecurity::get_backend_authentication_config][crate::client::NetworkSecurity::get_backend_authentication_config] calls.
15436    ///
15437    /// # Example
15438    /// ```
15439    /// # use google_cloud_networksecurity_v1::builder::network_security::GetBackendAuthenticationConfig;
15440    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15441    ///
15442    /// let builder = prepare_request_builder();
15443    /// let response = builder.send().await?;
15444    /// # Ok(()) }
15445    ///
15446    /// fn prepare_request_builder() -> GetBackendAuthenticationConfig {
15447    ///   # panic!();
15448    ///   // ... details omitted ...
15449    /// }
15450    /// ```
15451    #[derive(Clone, Debug)]
15452    pub struct GetBackendAuthenticationConfig(
15453        RequestBuilder<crate::model::GetBackendAuthenticationConfigRequest>,
15454    );
15455
15456    impl GetBackendAuthenticationConfig {
15457        pub(crate) fn new(
15458            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15459        ) -> Self {
15460            Self(RequestBuilder::new(stub))
15461        }
15462
15463        /// Sets the full request, replacing any prior values.
15464        pub fn with_request<V: Into<crate::model::GetBackendAuthenticationConfigRequest>>(
15465            mut self,
15466            v: V,
15467        ) -> Self {
15468            self.0.request = v.into();
15469            self
15470        }
15471
15472        /// Sets all the options, replacing any prior values.
15473        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15474            self.0.options = v.into();
15475            self
15476        }
15477
15478        /// Sends the request.
15479        pub async fn send(self) -> Result<crate::model::BackendAuthenticationConfig> {
15480            (*self.0.stub)
15481                .get_backend_authentication_config(self.0.request, self.0.options)
15482                .await
15483                .map(crate::Response::into_body)
15484        }
15485
15486        /// Sets the value of [name][crate::model::GetBackendAuthenticationConfigRequest::name].
15487        ///
15488        /// This is a **required** field for requests.
15489        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15490            self.0.request.name = v.into();
15491            self
15492        }
15493    }
15494
15495    #[doc(hidden)]
15496    impl crate::RequestBuilder for GetBackendAuthenticationConfig {
15497        fn request_options(&mut self) -> &mut crate::RequestOptions {
15498            &mut self.0.options
15499        }
15500    }
15501
15502    /// The request builder for [NetworkSecurity::create_backend_authentication_config][crate::client::NetworkSecurity::create_backend_authentication_config] calls.
15503    ///
15504    /// # Example
15505    /// ```
15506    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateBackendAuthenticationConfig;
15507    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15508    /// use google_cloud_lro::Poller;
15509    ///
15510    /// let builder = prepare_request_builder();
15511    /// let response = builder.poller().until_done().await?;
15512    /// # Ok(()) }
15513    ///
15514    /// fn prepare_request_builder() -> CreateBackendAuthenticationConfig {
15515    ///   # panic!();
15516    ///   // ... details omitted ...
15517    /// }
15518    /// ```
15519    #[derive(Clone, Debug)]
15520    pub struct CreateBackendAuthenticationConfig(
15521        RequestBuilder<crate::model::CreateBackendAuthenticationConfigRequest>,
15522    );
15523
15524    impl CreateBackendAuthenticationConfig {
15525        pub(crate) fn new(
15526            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15527        ) -> Self {
15528            Self(RequestBuilder::new(stub))
15529        }
15530
15531        /// Sets the full request, replacing any prior values.
15532        pub fn with_request<V: Into<crate::model::CreateBackendAuthenticationConfigRequest>>(
15533            mut self,
15534            v: V,
15535        ) -> Self {
15536            self.0.request = v.into();
15537            self
15538        }
15539
15540        /// Sets all the options, replacing any prior values.
15541        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15542            self.0.options = v.into();
15543            self
15544        }
15545
15546        /// Sends the request.
15547        ///
15548        /// # Long running operations
15549        ///
15550        /// This starts, but does not poll, a longrunning operation. More information
15551        /// on [create_backend_authentication_config][crate::client::NetworkSecurity::create_backend_authentication_config].
15552        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15553            (*self.0.stub)
15554                .create_backend_authentication_config(self.0.request, self.0.options)
15555                .await
15556                .map(crate::Response::into_body)
15557        }
15558
15559        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_backend_authentication_config`.
15560        pub fn poller(
15561            self,
15562        ) -> impl google_cloud_lro::Poller<
15563            crate::model::BackendAuthenticationConfig,
15564            crate::model::OperationMetadata,
15565        > {
15566            type Operation = google_cloud_lro::internal::Operation<
15567                crate::model::BackendAuthenticationConfig,
15568                crate::model::OperationMetadata,
15569            >;
15570            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15571            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15572            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
15573            if let Some(ref mut details) = poller_options.tracing {
15574                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_backend_authentication_config::until_done";
15575            }
15576
15577            let stub = self.0.stub.clone();
15578            let mut options = self.0.options.clone();
15579            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15580            let query = move |name| {
15581                let stub = stub.clone();
15582                let options = options.clone();
15583                async {
15584                    let op = GetOperation::new(stub)
15585                        .set_name(name)
15586                        .with_options(options)
15587                        .send()
15588                        .await?;
15589                    Ok(Operation::new(op))
15590                }
15591            };
15592
15593            let start = move || async {
15594                let op = self.send().await?;
15595                Ok(Operation::new(op))
15596            };
15597
15598            use google_cloud_lro::internal::PollerExt;
15599            {
15600                google_cloud_lro::internal::new_poller(
15601                    polling_error_policy,
15602                    polling_backoff_policy,
15603                    start,
15604                    query,
15605                )
15606            }
15607            .with_options(poller_options)
15608        }
15609
15610        /// Sets the value of [parent][crate::model::CreateBackendAuthenticationConfigRequest::parent].
15611        ///
15612        /// This is a **required** field for requests.
15613        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15614            self.0.request.parent = v.into();
15615            self
15616        }
15617
15618        /// Sets the value of [backend_authentication_config_id][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config_id].
15619        ///
15620        /// This is a **required** field for requests.
15621        pub fn set_backend_authentication_config_id<T: Into<std::string::String>>(
15622            mut self,
15623            v: T,
15624        ) -> Self {
15625            self.0.request.backend_authentication_config_id = v.into();
15626            self
15627        }
15628
15629        /// Sets the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
15630        ///
15631        /// This is a **required** field for requests.
15632        pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
15633        where
15634            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15635        {
15636            self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
15637            self
15638        }
15639
15640        /// Sets or clears the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
15641        ///
15642        /// This is a **required** field for requests.
15643        pub fn set_or_clear_backend_authentication_config<T>(
15644            mut self,
15645            v: std::option::Option<T>,
15646        ) -> Self
15647        where
15648            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15649        {
15650            self.0.request.backend_authentication_config = v.map(|x| x.into());
15651            self
15652        }
15653    }
15654
15655    #[doc(hidden)]
15656    impl crate::RequestBuilder for CreateBackendAuthenticationConfig {
15657        fn request_options(&mut self) -> &mut crate::RequestOptions {
15658            &mut self.0.options
15659        }
15660    }
15661
15662    /// The request builder for [NetworkSecurity::update_backend_authentication_config][crate::client::NetworkSecurity::update_backend_authentication_config] calls.
15663    ///
15664    /// # Example
15665    /// ```
15666    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateBackendAuthenticationConfig;
15667    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15668    /// use google_cloud_lro::Poller;
15669    ///
15670    /// let builder = prepare_request_builder();
15671    /// let response = builder.poller().until_done().await?;
15672    /// # Ok(()) }
15673    ///
15674    /// fn prepare_request_builder() -> UpdateBackendAuthenticationConfig {
15675    ///   # panic!();
15676    ///   // ... details omitted ...
15677    /// }
15678    /// ```
15679    #[derive(Clone, Debug)]
15680    pub struct UpdateBackendAuthenticationConfig(
15681        RequestBuilder<crate::model::UpdateBackendAuthenticationConfigRequest>,
15682    );
15683
15684    impl UpdateBackendAuthenticationConfig {
15685        pub(crate) fn new(
15686            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15687        ) -> Self {
15688            Self(RequestBuilder::new(stub))
15689        }
15690
15691        /// Sets the full request, replacing any prior values.
15692        pub fn with_request<V: Into<crate::model::UpdateBackendAuthenticationConfigRequest>>(
15693            mut self,
15694            v: V,
15695        ) -> Self {
15696            self.0.request = v.into();
15697            self
15698        }
15699
15700        /// Sets all the options, replacing any prior values.
15701        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15702            self.0.options = v.into();
15703            self
15704        }
15705
15706        /// Sends the request.
15707        ///
15708        /// # Long running operations
15709        ///
15710        /// This starts, but does not poll, a longrunning operation. More information
15711        /// on [update_backend_authentication_config][crate::client::NetworkSecurity::update_backend_authentication_config].
15712        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15713            (*self.0.stub)
15714                .update_backend_authentication_config(self.0.request, self.0.options)
15715                .await
15716                .map(crate::Response::into_body)
15717        }
15718
15719        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_backend_authentication_config`.
15720        pub fn poller(
15721            self,
15722        ) -> impl google_cloud_lro::Poller<
15723            crate::model::BackendAuthenticationConfig,
15724            crate::model::OperationMetadata,
15725        > {
15726            type Operation = google_cloud_lro::internal::Operation<
15727                crate::model::BackendAuthenticationConfig,
15728                crate::model::OperationMetadata,
15729            >;
15730            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15731            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15732            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
15733            if let Some(ref mut details) = poller_options.tracing {
15734                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_backend_authentication_config::until_done";
15735            }
15736
15737            let stub = self.0.stub.clone();
15738            let mut options = self.0.options.clone();
15739            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15740            let query = move |name| {
15741                let stub = stub.clone();
15742                let options = options.clone();
15743                async {
15744                    let op = GetOperation::new(stub)
15745                        .set_name(name)
15746                        .with_options(options)
15747                        .send()
15748                        .await?;
15749                    Ok(Operation::new(op))
15750                }
15751            };
15752
15753            let start = move || async {
15754                let op = self.send().await?;
15755                Ok(Operation::new(op))
15756            };
15757
15758            use google_cloud_lro::internal::PollerExt;
15759            {
15760                google_cloud_lro::internal::new_poller(
15761                    polling_error_policy,
15762                    polling_backoff_policy,
15763                    start,
15764                    query,
15765                )
15766            }
15767            .with_options(poller_options)
15768        }
15769
15770        /// Sets the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
15771        pub fn set_update_mask<T>(mut self, v: T) -> Self
15772        where
15773            T: std::convert::Into<wkt::FieldMask>,
15774        {
15775            self.0.request.update_mask = std::option::Option::Some(v.into());
15776            self
15777        }
15778
15779        /// Sets or clears the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
15780        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15781        where
15782            T: std::convert::Into<wkt::FieldMask>,
15783        {
15784            self.0.request.update_mask = v.map(|x| x.into());
15785            self
15786        }
15787
15788        /// Sets the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
15789        ///
15790        /// This is a **required** field for requests.
15791        pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
15792        where
15793            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15794        {
15795            self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
15796            self
15797        }
15798
15799        /// Sets or clears the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
15800        ///
15801        /// This is a **required** field for requests.
15802        pub fn set_or_clear_backend_authentication_config<T>(
15803            mut self,
15804            v: std::option::Option<T>,
15805        ) -> Self
15806        where
15807            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15808        {
15809            self.0.request.backend_authentication_config = v.map(|x| x.into());
15810            self
15811        }
15812    }
15813
15814    #[doc(hidden)]
15815    impl crate::RequestBuilder for UpdateBackendAuthenticationConfig {
15816        fn request_options(&mut self) -> &mut crate::RequestOptions {
15817            &mut self.0.options
15818        }
15819    }
15820
15821    /// The request builder for [NetworkSecurity::delete_backend_authentication_config][crate::client::NetworkSecurity::delete_backend_authentication_config] calls.
15822    ///
15823    /// # Example
15824    /// ```
15825    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteBackendAuthenticationConfig;
15826    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15827    /// use google_cloud_lro::Poller;
15828    ///
15829    /// let builder = prepare_request_builder();
15830    /// let response = builder.poller().until_done().await?;
15831    /// # Ok(()) }
15832    ///
15833    /// fn prepare_request_builder() -> DeleteBackendAuthenticationConfig {
15834    ///   # panic!();
15835    ///   // ... details omitted ...
15836    /// }
15837    /// ```
15838    #[derive(Clone, Debug)]
15839    pub struct DeleteBackendAuthenticationConfig(
15840        RequestBuilder<crate::model::DeleteBackendAuthenticationConfigRequest>,
15841    );
15842
15843    impl DeleteBackendAuthenticationConfig {
15844        pub(crate) fn new(
15845            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15846        ) -> Self {
15847            Self(RequestBuilder::new(stub))
15848        }
15849
15850        /// Sets the full request, replacing any prior values.
15851        pub fn with_request<V: Into<crate::model::DeleteBackendAuthenticationConfigRequest>>(
15852            mut self,
15853            v: V,
15854        ) -> Self {
15855            self.0.request = v.into();
15856            self
15857        }
15858
15859        /// Sets all the options, replacing any prior values.
15860        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15861            self.0.options = v.into();
15862            self
15863        }
15864
15865        /// Sends the request.
15866        ///
15867        /// # Long running operations
15868        ///
15869        /// This starts, but does not poll, a longrunning operation. More information
15870        /// on [delete_backend_authentication_config][crate::client::NetworkSecurity::delete_backend_authentication_config].
15871        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15872            (*self.0.stub)
15873                .delete_backend_authentication_config(self.0.request, self.0.options)
15874                .await
15875                .map(crate::Response::into_body)
15876        }
15877
15878        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_backend_authentication_config`.
15879        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
15880            type Operation =
15881                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15882            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15883            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15884            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
15885            if let Some(ref mut details) = poller_options.tracing {
15886                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_backend_authentication_config::until_done";
15887            }
15888
15889            let stub = self.0.stub.clone();
15890            let mut options = self.0.options.clone();
15891            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15892            let query = move |name| {
15893                let stub = stub.clone();
15894                let options = options.clone();
15895                async {
15896                    let op = GetOperation::new(stub)
15897                        .set_name(name)
15898                        .with_options(options)
15899                        .send()
15900                        .await?;
15901                    Ok(Operation::new(op))
15902                }
15903            };
15904
15905            let start = move || async {
15906                let op = self.send().await?;
15907                Ok(Operation::new(op))
15908            };
15909
15910            use google_cloud_lro::internal::PollerExt;
15911            {
15912                google_cloud_lro::internal::new_unit_response_poller(
15913                    polling_error_policy,
15914                    polling_backoff_policy,
15915                    start,
15916                    query,
15917                )
15918            }
15919            .with_options(poller_options)
15920        }
15921
15922        /// Sets the value of [name][crate::model::DeleteBackendAuthenticationConfigRequest::name].
15923        ///
15924        /// This is a **required** field for requests.
15925        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15926            self.0.request.name = v.into();
15927            self
15928        }
15929
15930        /// Sets the value of [etag][crate::model::DeleteBackendAuthenticationConfigRequest::etag].
15931        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
15932            self.0.request.etag = v.into();
15933            self
15934        }
15935    }
15936
15937    #[doc(hidden)]
15938    impl crate::RequestBuilder for DeleteBackendAuthenticationConfig {
15939        fn request_options(&mut self) -> &mut crate::RequestOptions {
15940            &mut self.0.options
15941        }
15942    }
15943
15944    /// The request builder for [NetworkSecurity::list_server_tls_policies][crate::client::NetworkSecurity::list_server_tls_policies] calls.
15945    ///
15946    /// # Example
15947    /// ```
15948    /// # use google_cloud_networksecurity_v1::builder::network_security::ListServerTlsPolicies;
15949    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15950    /// use google_cloud_gax::paginator::ItemPaginator;
15951    ///
15952    /// let builder = prepare_request_builder();
15953    /// let mut items = builder.by_item();
15954    /// while let Some(result) = items.next().await {
15955    ///   let item = result?;
15956    /// }
15957    /// # Ok(()) }
15958    ///
15959    /// fn prepare_request_builder() -> ListServerTlsPolicies {
15960    ///   # panic!();
15961    ///   // ... details omitted ...
15962    /// }
15963    /// ```
15964    #[derive(Clone, Debug)]
15965    pub struct ListServerTlsPolicies(RequestBuilder<crate::model::ListServerTlsPoliciesRequest>);
15966
15967    impl ListServerTlsPolicies {
15968        pub(crate) fn new(
15969            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15970        ) -> Self {
15971            Self(RequestBuilder::new(stub))
15972        }
15973
15974        /// Sets the full request, replacing any prior values.
15975        pub fn with_request<V: Into<crate::model::ListServerTlsPoliciesRequest>>(
15976            mut self,
15977            v: V,
15978        ) -> Self {
15979            self.0.request = v.into();
15980            self
15981        }
15982
15983        /// Sets all the options, replacing any prior values.
15984        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15985            self.0.options = v.into();
15986            self
15987        }
15988
15989        /// Sends the request.
15990        pub async fn send(self) -> Result<crate::model::ListServerTlsPoliciesResponse> {
15991            (*self.0.stub)
15992                .list_server_tls_policies(self.0.request, self.0.options)
15993                .await
15994                .map(crate::Response::into_body)
15995        }
15996
15997        /// Streams each page in the collection.
15998        pub fn by_page(
15999            self,
16000        ) -> impl google_cloud_gax::paginator::Paginator<
16001            crate::model::ListServerTlsPoliciesResponse,
16002            crate::Error,
16003        > {
16004            use std::clone::Clone;
16005            let token = self.0.request.page_token.clone();
16006            let execute = move |token: String| {
16007                let mut builder = self.clone();
16008                builder.0.request = builder.0.request.set_page_token(token);
16009                builder.send()
16010            };
16011            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16012        }
16013
16014        /// Streams each item in the collection.
16015        pub fn by_item(
16016            self,
16017        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16018            crate::model::ListServerTlsPoliciesResponse,
16019            crate::Error,
16020        > {
16021            use google_cloud_gax::paginator::Paginator;
16022            self.by_page().items()
16023        }
16024
16025        /// Sets the value of [parent][crate::model::ListServerTlsPoliciesRequest::parent].
16026        ///
16027        /// This is a **required** field for requests.
16028        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16029            self.0.request.parent = v.into();
16030            self
16031        }
16032
16033        /// Sets the value of [page_size][crate::model::ListServerTlsPoliciesRequest::page_size].
16034        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16035            self.0.request.page_size = v.into();
16036            self
16037        }
16038
16039        /// Sets the value of [page_token][crate::model::ListServerTlsPoliciesRequest::page_token].
16040        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16041            self.0.request.page_token = v.into();
16042            self
16043        }
16044
16045        /// Sets the value of [return_partial_success][crate::model::ListServerTlsPoliciesRequest::return_partial_success].
16046        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
16047            self.0.request.return_partial_success = v.into();
16048            self
16049        }
16050    }
16051
16052    #[doc(hidden)]
16053    impl crate::RequestBuilder for ListServerTlsPolicies {
16054        fn request_options(&mut self) -> &mut crate::RequestOptions {
16055            &mut self.0.options
16056        }
16057    }
16058
16059    /// The request builder for [NetworkSecurity::get_server_tls_policy][crate::client::NetworkSecurity::get_server_tls_policy] calls.
16060    ///
16061    /// # Example
16062    /// ```
16063    /// # use google_cloud_networksecurity_v1::builder::network_security::GetServerTlsPolicy;
16064    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16065    ///
16066    /// let builder = prepare_request_builder();
16067    /// let response = builder.send().await?;
16068    /// # Ok(()) }
16069    ///
16070    /// fn prepare_request_builder() -> GetServerTlsPolicy {
16071    ///   # panic!();
16072    ///   // ... details omitted ...
16073    /// }
16074    /// ```
16075    #[derive(Clone, Debug)]
16076    pub struct GetServerTlsPolicy(RequestBuilder<crate::model::GetServerTlsPolicyRequest>);
16077
16078    impl GetServerTlsPolicy {
16079        pub(crate) fn new(
16080            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16081        ) -> Self {
16082            Self(RequestBuilder::new(stub))
16083        }
16084
16085        /// Sets the full request, replacing any prior values.
16086        pub fn with_request<V: Into<crate::model::GetServerTlsPolicyRequest>>(
16087            mut self,
16088            v: V,
16089        ) -> Self {
16090            self.0.request = v.into();
16091            self
16092        }
16093
16094        /// Sets all the options, replacing any prior values.
16095        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16096            self.0.options = v.into();
16097            self
16098        }
16099
16100        /// Sends the request.
16101        pub async fn send(self) -> Result<crate::model::ServerTlsPolicy> {
16102            (*self.0.stub)
16103                .get_server_tls_policy(self.0.request, self.0.options)
16104                .await
16105                .map(crate::Response::into_body)
16106        }
16107
16108        /// Sets the value of [name][crate::model::GetServerTlsPolicyRequest::name].
16109        ///
16110        /// This is a **required** field for requests.
16111        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16112            self.0.request.name = v.into();
16113            self
16114        }
16115    }
16116
16117    #[doc(hidden)]
16118    impl crate::RequestBuilder for GetServerTlsPolicy {
16119        fn request_options(&mut self) -> &mut crate::RequestOptions {
16120            &mut self.0.options
16121        }
16122    }
16123
16124    /// The request builder for [NetworkSecurity::create_server_tls_policy][crate::client::NetworkSecurity::create_server_tls_policy] calls.
16125    ///
16126    /// # Example
16127    /// ```
16128    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateServerTlsPolicy;
16129    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16130    /// use google_cloud_lro::Poller;
16131    ///
16132    /// let builder = prepare_request_builder();
16133    /// let response = builder.poller().until_done().await?;
16134    /// # Ok(()) }
16135    ///
16136    /// fn prepare_request_builder() -> CreateServerTlsPolicy {
16137    ///   # panic!();
16138    ///   // ... details omitted ...
16139    /// }
16140    /// ```
16141    #[derive(Clone, Debug)]
16142    pub struct CreateServerTlsPolicy(RequestBuilder<crate::model::CreateServerTlsPolicyRequest>);
16143
16144    impl CreateServerTlsPolicy {
16145        pub(crate) fn new(
16146            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16147        ) -> Self {
16148            Self(RequestBuilder::new(stub))
16149        }
16150
16151        /// Sets the full request, replacing any prior values.
16152        pub fn with_request<V: Into<crate::model::CreateServerTlsPolicyRequest>>(
16153            mut self,
16154            v: V,
16155        ) -> Self {
16156            self.0.request = v.into();
16157            self
16158        }
16159
16160        /// Sets all the options, replacing any prior values.
16161        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16162            self.0.options = v.into();
16163            self
16164        }
16165
16166        /// Sends the request.
16167        ///
16168        /// # Long running operations
16169        ///
16170        /// This starts, but does not poll, a longrunning operation. More information
16171        /// on [create_server_tls_policy][crate::client::NetworkSecurity::create_server_tls_policy].
16172        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16173            (*self.0.stub)
16174                .create_server_tls_policy(self.0.request, self.0.options)
16175                .await
16176                .map(crate::Response::into_body)
16177        }
16178
16179        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_server_tls_policy`.
16180        pub fn poller(
16181            self,
16182        ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
16183        {
16184            type Operation = google_cloud_lro::internal::Operation<
16185                crate::model::ServerTlsPolicy,
16186                crate::model::OperationMetadata,
16187            >;
16188            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16189            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16190            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
16191            if let Some(ref mut details) = poller_options.tracing {
16192                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_server_tls_policy::until_done";
16193            }
16194
16195            let stub = self.0.stub.clone();
16196            let mut options = self.0.options.clone();
16197            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16198            let query = move |name| {
16199                let stub = stub.clone();
16200                let options = options.clone();
16201                async {
16202                    let op = GetOperation::new(stub)
16203                        .set_name(name)
16204                        .with_options(options)
16205                        .send()
16206                        .await?;
16207                    Ok(Operation::new(op))
16208                }
16209            };
16210
16211            let start = move || async {
16212                let op = self.send().await?;
16213                Ok(Operation::new(op))
16214            };
16215
16216            use google_cloud_lro::internal::PollerExt;
16217            {
16218                google_cloud_lro::internal::new_poller(
16219                    polling_error_policy,
16220                    polling_backoff_policy,
16221                    start,
16222                    query,
16223                )
16224            }
16225            .with_options(poller_options)
16226        }
16227
16228        /// Sets the value of [parent][crate::model::CreateServerTlsPolicyRequest::parent].
16229        ///
16230        /// This is a **required** field for requests.
16231        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16232            self.0.request.parent = v.into();
16233            self
16234        }
16235
16236        /// Sets the value of [server_tls_policy_id][crate::model::CreateServerTlsPolicyRequest::server_tls_policy_id].
16237        ///
16238        /// This is a **required** field for requests.
16239        pub fn set_server_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
16240            self.0.request.server_tls_policy_id = v.into();
16241            self
16242        }
16243
16244        /// Sets the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
16245        ///
16246        /// This is a **required** field for requests.
16247        pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
16248        where
16249            T: std::convert::Into<crate::model::ServerTlsPolicy>,
16250        {
16251            self.0.request.server_tls_policy = std::option::Option::Some(v.into());
16252            self
16253        }
16254
16255        /// Sets or clears the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
16256        ///
16257        /// This is a **required** field for requests.
16258        pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
16259        where
16260            T: std::convert::Into<crate::model::ServerTlsPolicy>,
16261        {
16262            self.0.request.server_tls_policy = v.map(|x| x.into());
16263            self
16264        }
16265    }
16266
16267    #[doc(hidden)]
16268    impl crate::RequestBuilder for CreateServerTlsPolicy {
16269        fn request_options(&mut self) -> &mut crate::RequestOptions {
16270            &mut self.0.options
16271        }
16272    }
16273
16274    /// The request builder for [NetworkSecurity::update_server_tls_policy][crate::client::NetworkSecurity::update_server_tls_policy] calls.
16275    ///
16276    /// # Example
16277    /// ```
16278    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateServerTlsPolicy;
16279    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16280    /// use google_cloud_lro::Poller;
16281    ///
16282    /// let builder = prepare_request_builder();
16283    /// let response = builder.poller().until_done().await?;
16284    /// # Ok(()) }
16285    ///
16286    /// fn prepare_request_builder() -> UpdateServerTlsPolicy {
16287    ///   # panic!();
16288    ///   // ... details omitted ...
16289    /// }
16290    /// ```
16291    #[derive(Clone, Debug)]
16292    pub struct UpdateServerTlsPolicy(RequestBuilder<crate::model::UpdateServerTlsPolicyRequest>);
16293
16294    impl UpdateServerTlsPolicy {
16295        pub(crate) fn new(
16296            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16297        ) -> Self {
16298            Self(RequestBuilder::new(stub))
16299        }
16300
16301        /// Sets the full request, replacing any prior values.
16302        pub fn with_request<V: Into<crate::model::UpdateServerTlsPolicyRequest>>(
16303            mut self,
16304            v: V,
16305        ) -> Self {
16306            self.0.request = v.into();
16307            self
16308        }
16309
16310        /// Sets all the options, replacing any prior values.
16311        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16312            self.0.options = v.into();
16313            self
16314        }
16315
16316        /// Sends the request.
16317        ///
16318        /// # Long running operations
16319        ///
16320        /// This starts, but does not poll, a longrunning operation. More information
16321        /// on [update_server_tls_policy][crate::client::NetworkSecurity::update_server_tls_policy].
16322        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16323            (*self.0.stub)
16324                .update_server_tls_policy(self.0.request, self.0.options)
16325                .await
16326                .map(crate::Response::into_body)
16327        }
16328
16329        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_server_tls_policy`.
16330        pub fn poller(
16331            self,
16332        ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
16333        {
16334            type Operation = google_cloud_lro::internal::Operation<
16335                crate::model::ServerTlsPolicy,
16336                crate::model::OperationMetadata,
16337            >;
16338            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16339            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16340            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
16341            if let Some(ref mut details) = poller_options.tracing {
16342                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_server_tls_policy::until_done";
16343            }
16344
16345            let stub = self.0.stub.clone();
16346            let mut options = self.0.options.clone();
16347            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16348            let query = move |name| {
16349                let stub = stub.clone();
16350                let options = options.clone();
16351                async {
16352                    let op = GetOperation::new(stub)
16353                        .set_name(name)
16354                        .with_options(options)
16355                        .send()
16356                        .await?;
16357                    Ok(Operation::new(op))
16358                }
16359            };
16360
16361            let start = move || async {
16362                let op = self.send().await?;
16363                Ok(Operation::new(op))
16364            };
16365
16366            use google_cloud_lro::internal::PollerExt;
16367            {
16368                google_cloud_lro::internal::new_poller(
16369                    polling_error_policy,
16370                    polling_backoff_policy,
16371                    start,
16372                    query,
16373                )
16374            }
16375            .with_options(poller_options)
16376        }
16377
16378        /// Sets the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
16379        pub fn set_update_mask<T>(mut self, v: T) -> Self
16380        where
16381            T: std::convert::Into<wkt::FieldMask>,
16382        {
16383            self.0.request.update_mask = std::option::Option::Some(v.into());
16384            self
16385        }
16386
16387        /// Sets or clears the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
16388        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16389        where
16390            T: std::convert::Into<wkt::FieldMask>,
16391        {
16392            self.0.request.update_mask = v.map(|x| x.into());
16393            self
16394        }
16395
16396        /// Sets the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
16397        ///
16398        /// This is a **required** field for requests.
16399        pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
16400        where
16401            T: std::convert::Into<crate::model::ServerTlsPolicy>,
16402        {
16403            self.0.request.server_tls_policy = std::option::Option::Some(v.into());
16404            self
16405        }
16406
16407        /// Sets or clears the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
16408        ///
16409        /// This is a **required** field for requests.
16410        pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
16411        where
16412            T: std::convert::Into<crate::model::ServerTlsPolicy>,
16413        {
16414            self.0.request.server_tls_policy = v.map(|x| x.into());
16415            self
16416        }
16417    }
16418
16419    #[doc(hidden)]
16420    impl crate::RequestBuilder for UpdateServerTlsPolicy {
16421        fn request_options(&mut self) -> &mut crate::RequestOptions {
16422            &mut self.0.options
16423        }
16424    }
16425
16426    /// The request builder for [NetworkSecurity::delete_server_tls_policy][crate::client::NetworkSecurity::delete_server_tls_policy] calls.
16427    ///
16428    /// # Example
16429    /// ```
16430    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteServerTlsPolicy;
16431    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16432    /// use google_cloud_lro::Poller;
16433    ///
16434    /// let builder = prepare_request_builder();
16435    /// let response = builder.poller().until_done().await?;
16436    /// # Ok(()) }
16437    ///
16438    /// fn prepare_request_builder() -> DeleteServerTlsPolicy {
16439    ///   # panic!();
16440    ///   // ... details omitted ...
16441    /// }
16442    /// ```
16443    #[derive(Clone, Debug)]
16444    pub struct DeleteServerTlsPolicy(RequestBuilder<crate::model::DeleteServerTlsPolicyRequest>);
16445
16446    impl DeleteServerTlsPolicy {
16447        pub(crate) fn new(
16448            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16449        ) -> Self {
16450            Self(RequestBuilder::new(stub))
16451        }
16452
16453        /// Sets the full request, replacing any prior values.
16454        pub fn with_request<V: Into<crate::model::DeleteServerTlsPolicyRequest>>(
16455            mut self,
16456            v: V,
16457        ) -> Self {
16458            self.0.request = v.into();
16459            self
16460        }
16461
16462        /// Sets all the options, replacing any prior values.
16463        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16464            self.0.options = v.into();
16465            self
16466        }
16467
16468        /// Sends the request.
16469        ///
16470        /// # Long running operations
16471        ///
16472        /// This starts, but does not poll, a longrunning operation. More information
16473        /// on [delete_server_tls_policy][crate::client::NetworkSecurity::delete_server_tls_policy].
16474        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16475            (*self.0.stub)
16476                .delete_server_tls_policy(self.0.request, self.0.options)
16477                .await
16478                .map(crate::Response::into_body)
16479        }
16480
16481        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_server_tls_policy`.
16482        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16483            type Operation =
16484                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16485            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16486            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16487            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
16488            if let Some(ref mut details) = poller_options.tracing {
16489                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_server_tls_policy::until_done";
16490            }
16491
16492            let stub = self.0.stub.clone();
16493            let mut options = self.0.options.clone();
16494            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16495            let query = move |name| {
16496                let stub = stub.clone();
16497                let options = options.clone();
16498                async {
16499                    let op = GetOperation::new(stub)
16500                        .set_name(name)
16501                        .with_options(options)
16502                        .send()
16503                        .await?;
16504                    Ok(Operation::new(op))
16505                }
16506            };
16507
16508            let start = move || async {
16509                let op = self.send().await?;
16510                Ok(Operation::new(op))
16511            };
16512
16513            use google_cloud_lro::internal::PollerExt;
16514            {
16515                google_cloud_lro::internal::new_unit_response_poller(
16516                    polling_error_policy,
16517                    polling_backoff_policy,
16518                    start,
16519                    query,
16520                )
16521            }
16522            .with_options(poller_options)
16523        }
16524
16525        /// Sets the value of [name][crate::model::DeleteServerTlsPolicyRequest::name].
16526        ///
16527        /// This is a **required** field for requests.
16528        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16529            self.0.request.name = v.into();
16530            self
16531        }
16532    }
16533
16534    #[doc(hidden)]
16535    impl crate::RequestBuilder for DeleteServerTlsPolicy {
16536        fn request_options(&mut self) -> &mut crate::RequestOptions {
16537            &mut self.0.options
16538        }
16539    }
16540
16541    /// The request builder for [NetworkSecurity::list_client_tls_policies][crate::client::NetworkSecurity::list_client_tls_policies] calls.
16542    ///
16543    /// # Example
16544    /// ```
16545    /// # use google_cloud_networksecurity_v1::builder::network_security::ListClientTlsPolicies;
16546    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16547    /// use google_cloud_gax::paginator::ItemPaginator;
16548    ///
16549    /// let builder = prepare_request_builder();
16550    /// let mut items = builder.by_item();
16551    /// while let Some(result) = items.next().await {
16552    ///   let item = result?;
16553    /// }
16554    /// # Ok(()) }
16555    ///
16556    /// fn prepare_request_builder() -> ListClientTlsPolicies {
16557    ///   # panic!();
16558    ///   // ... details omitted ...
16559    /// }
16560    /// ```
16561    #[derive(Clone, Debug)]
16562    pub struct ListClientTlsPolicies(RequestBuilder<crate::model::ListClientTlsPoliciesRequest>);
16563
16564    impl ListClientTlsPolicies {
16565        pub(crate) fn new(
16566            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16567        ) -> Self {
16568            Self(RequestBuilder::new(stub))
16569        }
16570
16571        /// Sets the full request, replacing any prior values.
16572        pub fn with_request<V: Into<crate::model::ListClientTlsPoliciesRequest>>(
16573            mut self,
16574            v: V,
16575        ) -> Self {
16576            self.0.request = v.into();
16577            self
16578        }
16579
16580        /// Sets all the options, replacing any prior values.
16581        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16582            self.0.options = v.into();
16583            self
16584        }
16585
16586        /// Sends the request.
16587        pub async fn send(self) -> Result<crate::model::ListClientTlsPoliciesResponse> {
16588            (*self.0.stub)
16589                .list_client_tls_policies(self.0.request, self.0.options)
16590                .await
16591                .map(crate::Response::into_body)
16592        }
16593
16594        /// Streams each page in the collection.
16595        pub fn by_page(
16596            self,
16597        ) -> impl google_cloud_gax::paginator::Paginator<
16598            crate::model::ListClientTlsPoliciesResponse,
16599            crate::Error,
16600        > {
16601            use std::clone::Clone;
16602            let token = self.0.request.page_token.clone();
16603            let execute = move |token: String| {
16604                let mut builder = self.clone();
16605                builder.0.request = builder.0.request.set_page_token(token);
16606                builder.send()
16607            };
16608            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16609        }
16610
16611        /// Streams each item in the collection.
16612        pub fn by_item(
16613            self,
16614        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16615            crate::model::ListClientTlsPoliciesResponse,
16616            crate::Error,
16617        > {
16618            use google_cloud_gax::paginator::Paginator;
16619            self.by_page().items()
16620        }
16621
16622        /// Sets the value of [parent][crate::model::ListClientTlsPoliciesRequest::parent].
16623        ///
16624        /// This is a **required** field for requests.
16625        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16626            self.0.request.parent = v.into();
16627            self
16628        }
16629
16630        /// Sets the value of [page_size][crate::model::ListClientTlsPoliciesRequest::page_size].
16631        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16632            self.0.request.page_size = v.into();
16633            self
16634        }
16635
16636        /// Sets the value of [page_token][crate::model::ListClientTlsPoliciesRequest::page_token].
16637        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16638            self.0.request.page_token = v.into();
16639            self
16640        }
16641    }
16642
16643    #[doc(hidden)]
16644    impl crate::RequestBuilder for ListClientTlsPolicies {
16645        fn request_options(&mut self) -> &mut crate::RequestOptions {
16646            &mut self.0.options
16647        }
16648    }
16649
16650    /// The request builder for [NetworkSecurity::get_client_tls_policy][crate::client::NetworkSecurity::get_client_tls_policy] calls.
16651    ///
16652    /// # Example
16653    /// ```
16654    /// # use google_cloud_networksecurity_v1::builder::network_security::GetClientTlsPolicy;
16655    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16656    ///
16657    /// let builder = prepare_request_builder();
16658    /// let response = builder.send().await?;
16659    /// # Ok(()) }
16660    ///
16661    /// fn prepare_request_builder() -> GetClientTlsPolicy {
16662    ///   # panic!();
16663    ///   // ... details omitted ...
16664    /// }
16665    /// ```
16666    #[derive(Clone, Debug)]
16667    pub struct GetClientTlsPolicy(RequestBuilder<crate::model::GetClientTlsPolicyRequest>);
16668
16669    impl GetClientTlsPolicy {
16670        pub(crate) fn new(
16671            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16672        ) -> Self {
16673            Self(RequestBuilder::new(stub))
16674        }
16675
16676        /// Sets the full request, replacing any prior values.
16677        pub fn with_request<V: Into<crate::model::GetClientTlsPolicyRequest>>(
16678            mut self,
16679            v: V,
16680        ) -> Self {
16681            self.0.request = v.into();
16682            self
16683        }
16684
16685        /// Sets all the options, replacing any prior values.
16686        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16687            self.0.options = v.into();
16688            self
16689        }
16690
16691        /// Sends the request.
16692        pub async fn send(self) -> Result<crate::model::ClientTlsPolicy> {
16693            (*self.0.stub)
16694                .get_client_tls_policy(self.0.request, self.0.options)
16695                .await
16696                .map(crate::Response::into_body)
16697        }
16698
16699        /// Sets the value of [name][crate::model::GetClientTlsPolicyRequest::name].
16700        ///
16701        /// This is a **required** field for requests.
16702        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16703            self.0.request.name = v.into();
16704            self
16705        }
16706    }
16707
16708    #[doc(hidden)]
16709    impl crate::RequestBuilder for GetClientTlsPolicy {
16710        fn request_options(&mut self) -> &mut crate::RequestOptions {
16711            &mut self.0.options
16712        }
16713    }
16714
16715    /// The request builder for [NetworkSecurity::create_client_tls_policy][crate::client::NetworkSecurity::create_client_tls_policy] calls.
16716    ///
16717    /// # Example
16718    /// ```
16719    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateClientTlsPolicy;
16720    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16721    /// use google_cloud_lro::Poller;
16722    ///
16723    /// let builder = prepare_request_builder();
16724    /// let response = builder.poller().until_done().await?;
16725    /// # Ok(()) }
16726    ///
16727    /// fn prepare_request_builder() -> CreateClientTlsPolicy {
16728    ///   # panic!();
16729    ///   // ... details omitted ...
16730    /// }
16731    /// ```
16732    #[derive(Clone, Debug)]
16733    pub struct CreateClientTlsPolicy(RequestBuilder<crate::model::CreateClientTlsPolicyRequest>);
16734
16735    impl CreateClientTlsPolicy {
16736        pub(crate) fn new(
16737            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16738        ) -> Self {
16739            Self(RequestBuilder::new(stub))
16740        }
16741
16742        /// Sets the full request, replacing any prior values.
16743        pub fn with_request<V: Into<crate::model::CreateClientTlsPolicyRequest>>(
16744            mut self,
16745            v: V,
16746        ) -> Self {
16747            self.0.request = v.into();
16748            self
16749        }
16750
16751        /// Sets all the options, replacing any prior values.
16752        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16753            self.0.options = v.into();
16754            self
16755        }
16756
16757        /// Sends the request.
16758        ///
16759        /// # Long running operations
16760        ///
16761        /// This starts, but does not poll, a longrunning operation. More information
16762        /// on [create_client_tls_policy][crate::client::NetworkSecurity::create_client_tls_policy].
16763        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16764            (*self.0.stub)
16765                .create_client_tls_policy(self.0.request, self.0.options)
16766                .await
16767                .map(crate::Response::into_body)
16768        }
16769
16770        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_client_tls_policy`.
16771        pub fn poller(
16772            self,
16773        ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
16774        {
16775            type Operation = google_cloud_lro::internal::Operation<
16776                crate::model::ClientTlsPolicy,
16777                crate::model::OperationMetadata,
16778            >;
16779            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16780            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16781            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
16782            if let Some(ref mut details) = poller_options.tracing {
16783                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_client_tls_policy::until_done";
16784            }
16785
16786            let stub = self.0.stub.clone();
16787            let mut options = self.0.options.clone();
16788            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16789            let query = move |name| {
16790                let stub = stub.clone();
16791                let options = options.clone();
16792                async {
16793                    let op = GetOperation::new(stub)
16794                        .set_name(name)
16795                        .with_options(options)
16796                        .send()
16797                        .await?;
16798                    Ok(Operation::new(op))
16799                }
16800            };
16801
16802            let start = move || async {
16803                let op = self.send().await?;
16804                Ok(Operation::new(op))
16805            };
16806
16807            use google_cloud_lro::internal::PollerExt;
16808            {
16809                google_cloud_lro::internal::new_poller(
16810                    polling_error_policy,
16811                    polling_backoff_policy,
16812                    start,
16813                    query,
16814                )
16815            }
16816            .with_options(poller_options)
16817        }
16818
16819        /// Sets the value of [parent][crate::model::CreateClientTlsPolicyRequest::parent].
16820        ///
16821        /// This is a **required** field for requests.
16822        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16823            self.0.request.parent = v.into();
16824            self
16825        }
16826
16827        /// Sets the value of [client_tls_policy_id][crate::model::CreateClientTlsPolicyRequest::client_tls_policy_id].
16828        ///
16829        /// This is a **required** field for requests.
16830        pub fn set_client_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
16831            self.0.request.client_tls_policy_id = v.into();
16832            self
16833        }
16834
16835        /// Sets the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
16836        ///
16837        /// This is a **required** field for requests.
16838        pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
16839        where
16840            T: std::convert::Into<crate::model::ClientTlsPolicy>,
16841        {
16842            self.0.request.client_tls_policy = std::option::Option::Some(v.into());
16843            self
16844        }
16845
16846        /// Sets or clears the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
16847        ///
16848        /// This is a **required** field for requests.
16849        pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
16850        where
16851            T: std::convert::Into<crate::model::ClientTlsPolicy>,
16852        {
16853            self.0.request.client_tls_policy = v.map(|x| x.into());
16854            self
16855        }
16856    }
16857
16858    #[doc(hidden)]
16859    impl crate::RequestBuilder for CreateClientTlsPolicy {
16860        fn request_options(&mut self) -> &mut crate::RequestOptions {
16861            &mut self.0.options
16862        }
16863    }
16864
16865    /// The request builder for [NetworkSecurity::update_client_tls_policy][crate::client::NetworkSecurity::update_client_tls_policy] calls.
16866    ///
16867    /// # Example
16868    /// ```
16869    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateClientTlsPolicy;
16870    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16871    /// use google_cloud_lro::Poller;
16872    ///
16873    /// let builder = prepare_request_builder();
16874    /// let response = builder.poller().until_done().await?;
16875    /// # Ok(()) }
16876    ///
16877    /// fn prepare_request_builder() -> UpdateClientTlsPolicy {
16878    ///   # panic!();
16879    ///   // ... details omitted ...
16880    /// }
16881    /// ```
16882    #[derive(Clone, Debug)]
16883    pub struct UpdateClientTlsPolicy(RequestBuilder<crate::model::UpdateClientTlsPolicyRequest>);
16884
16885    impl UpdateClientTlsPolicy {
16886        pub(crate) fn new(
16887            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16888        ) -> Self {
16889            Self(RequestBuilder::new(stub))
16890        }
16891
16892        /// Sets the full request, replacing any prior values.
16893        pub fn with_request<V: Into<crate::model::UpdateClientTlsPolicyRequest>>(
16894            mut self,
16895            v: V,
16896        ) -> Self {
16897            self.0.request = v.into();
16898            self
16899        }
16900
16901        /// Sets all the options, replacing any prior values.
16902        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16903            self.0.options = v.into();
16904            self
16905        }
16906
16907        /// Sends the request.
16908        ///
16909        /// # Long running operations
16910        ///
16911        /// This starts, but does not poll, a longrunning operation. More information
16912        /// on [update_client_tls_policy][crate::client::NetworkSecurity::update_client_tls_policy].
16913        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16914            (*self.0.stub)
16915                .update_client_tls_policy(self.0.request, self.0.options)
16916                .await
16917                .map(crate::Response::into_body)
16918        }
16919
16920        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_client_tls_policy`.
16921        pub fn poller(
16922            self,
16923        ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
16924        {
16925            type Operation = google_cloud_lro::internal::Operation<
16926                crate::model::ClientTlsPolicy,
16927                crate::model::OperationMetadata,
16928            >;
16929            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16930            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16931            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
16932            if let Some(ref mut details) = poller_options.tracing {
16933                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_client_tls_policy::until_done";
16934            }
16935
16936            let stub = self.0.stub.clone();
16937            let mut options = self.0.options.clone();
16938            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16939            let query = move |name| {
16940                let stub = stub.clone();
16941                let options = options.clone();
16942                async {
16943                    let op = GetOperation::new(stub)
16944                        .set_name(name)
16945                        .with_options(options)
16946                        .send()
16947                        .await?;
16948                    Ok(Operation::new(op))
16949                }
16950            };
16951
16952            let start = move || async {
16953                let op = self.send().await?;
16954                Ok(Operation::new(op))
16955            };
16956
16957            use google_cloud_lro::internal::PollerExt;
16958            {
16959                google_cloud_lro::internal::new_poller(
16960                    polling_error_policy,
16961                    polling_backoff_policy,
16962                    start,
16963                    query,
16964                )
16965            }
16966            .with_options(poller_options)
16967        }
16968
16969        /// Sets the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
16970        pub fn set_update_mask<T>(mut self, v: T) -> Self
16971        where
16972            T: std::convert::Into<wkt::FieldMask>,
16973        {
16974            self.0.request.update_mask = std::option::Option::Some(v.into());
16975            self
16976        }
16977
16978        /// Sets or clears the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
16979        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16980        where
16981            T: std::convert::Into<wkt::FieldMask>,
16982        {
16983            self.0.request.update_mask = v.map(|x| x.into());
16984            self
16985        }
16986
16987        /// Sets the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
16988        ///
16989        /// This is a **required** field for requests.
16990        pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
16991        where
16992            T: std::convert::Into<crate::model::ClientTlsPolicy>,
16993        {
16994            self.0.request.client_tls_policy = std::option::Option::Some(v.into());
16995            self
16996        }
16997
16998        /// Sets or clears the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
16999        ///
17000        /// This is a **required** field for requests.
17001        pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
17002        where
17003            T: std::convert::Into<crate::model::ClientTlsPolicy>,
17004        {
17005            self.0.request.client_tls_policy = v.map(|x| x.into());
17006            self
17007        }
17008    }
17009
17010    #[doc(hidden)]
17011    impl crate::RequestBuilder for UpdateClientTlsPolicy {
17012        fn request_options(&mut self) -> &mut crate::RequestOptions {
17013            &mut self.0.options
17014        }
17015    }
17016
17017    /// The request builder for [NetworkSecurity::delete_client_tls_policy][crate::client::NetworkSecurity::delete_client_tls_policy] calls.
17018    ///
17019    /// # Example
17020    /// ```
17021    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteClientTlsPolicy;
17022    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17023    /// use google_cloud_lro::Poller;
17024    ///
17025    /// let builder = prepare_request_builder();
17026    /// let response = builder.poller().until_done().await?;
17027    /// # Ok(()) }
17028    ///
17029    /// fn prepare_request_builder() -> DeleteClientTlsPolicy {
17030    ///   # panic!();
17031    ///   // ... details omitted ...
17032    /// }
17033    /// ```
17034    #[derive(Clone, Debug)]
17035    pub struct DeleteClientTlsPolicy(RequestBuilder<crate::model::DeleteClientTlsPolicyRequest>);
17036
17037    impl DeleteClientTlsPolicy {
17038        pub(crate) fn new(
17039            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17040        ) -> Self {
17041            Self(RequestBuilder::new(stub))
17042        }
17043
17044        /// Sets the full request, replacing any prior values.
17045        pub fn with_request<V: Into<crate::model::DeleteClientTlsPolicyRequest>>(
17046            mut self,
17047            v: V,
17048        ) -> Self {
17049            self.0.request = v.into();
17050            self
17051        }
17052
17053        /// Sets all the options, replacing any prior values.
17054        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17055            self.0.options = v.into();
17056            self
17057        }
17058
17059        /// Sends the request.
17060        ///
17061        /// # Long running operations
17062        ///
17063        /// This starts, but does not poll, a longrunning operation. More information
17064        /// on [delete_client_tls_policy][crate::client::NetworkSecurity::delete_client_tls_policy].
17065        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17066            (*self.0.stub)
17067                .delete_client_tls_policy(self.0.request, self.0.options)
17068                .await
17069                .map(crate::Response::into_body)
17070        }
17071
17072        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_client_tls_policy`.
17073        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17074            type Operation =
17075                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17076            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17077            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17078            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
17079            if let Some(ref mut details) = poller_options.tracing {
17080                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_client_tls_policy::until_done";
17081            }
17082
17083            let stub = self.0.stub.clone();
17084            let mut options = self.0.options.clone();
17085            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17086            let query = move |name| {
17087                let stub = stub.clone();
17088                let options = options.clone();
17089                async {
17090                    let op = GetOperation::new(stub)
17091                        .set_name(name)
17092                        .with_options(options)
17093                        .send()
17094                        .await?;
17095                    Ok(Operation::new(op))
17096                }
17097            };
17098
17099            let start = move || async {
17100                let op = self.send().await?;
17101                Ok(Operation::new(op))
17102            };
17103
17104            use google_cloud_lro::internal::PollerExt;
17105            {
17106                google_cloud_lro::internal::new_unit_response_poller(
17107                    polling_error_policy,
17108                    polling_backoff_policy,
17109                    start,
17110                    query,
17111                )
17112            }
17113            .with_options(poller_options)
17114        }
17115
17116        /// Sets the value of [name][crate::model::DeleteClientTlsPolicyRequest::name].
17117        ///
17118        /// This is a **required** field for requests.
17119        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17120            self.0.request.name = v.into();
17121            self
17122        }
17123    }
17124
17125    #[doc(hidden)]
17126    impl crate::RequestBuilder for DeleteClientTlsPolicy {
17127        fn request_options(&mut self) -> &mut crate::RequestOptions {
17128            &mut self.0.options
17129        }
17130    }
17131
17132    /// The request builder for [NetworkSecurity::list_gateway_security_policies][crate::client::NetworkSecurity::list_gateway_security_policies] calls.
17133    ///
17134    /// # Example
17135    /// ```
17136    /// # use google_cloud_networksecurity_v1::builder::network_security::ListGatewaySecurityPolicies;
17137    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17138    /// use google_cloud_gax::paginator::ItemPaginator;
17139    ///
17140    /// let builder = prepare_request_builder();
17141    /// let mut items = builder.by_item();
17142    /// while let Some(result) = items.next().await {
17143    ///   let item = result?;
17144    /// }
17145    /// # Ok(()) }
17146    ///
17147    /// fn prepare_request_builder() -> ListGatewaySecurityPolicies {
17148    ///   # panic!();
17149    ///   // ... details omitted ...
17150    /// }
17151    /// ```
17152    #[derive(Clone, Debug)]
17153    pub struct ListGatewaySecurityPolicies(
17154        RequestBuilder<crate::model::ListGatewaySecurityPoliciesRequest>,
17155    );
17156
17157    impl ListGatewaySecurityPolicies {
17158        pub(crate) fn new(
17159            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17160        ) -> Self {
17161            Self(RequestBuilder::new(stub))
17162        }
17163
17164        /// Sets the full request, replacing any prior values.
17165        pub fn with_request<V: Into<crate::model::ListGatewaySecurityPoliciesRequest>>(
17166            mut self,
17167            v: V,
17168        ) -> Self {
17169            self.0.request = v.into();
17170            self
17171        }
17172
17173        /// Sets all the options, replacing any prior values.
17174        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17175            self.0.options = v.into();
17176            self
17177        }
17178
17179        /// Sends the request.
17180        pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPoliciesResponse> {
17181            (*self.0.stub)
17182                .list_gateway_security_policies(self.0.request, self.0.options)
17183                .await
17184                .map(crate::Response::into_body)
17185        }
17186
17187        /// Streams each page in the collection.
17188        pub fn by_page(
17189            self,
17190        ) -> impl google_cloud_gax::paginator::Paginator<
17191            crate::model::ListGatewaySecurityPoliciesResponse,
17192            crate::Error,
17193        > {
17194            use std::clone::Clone;
17195            let token = self.0.request.page_token.clone();
17196            let execute = move |token: String| {
17197                let mut builder = self.clone();
17198                builder.0.request = builder.0.request.set_page_token(token);
17199                builder.send()
17200            };
17201            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17202        }
17203
17204        /// Streams each item in the collection.
17205        pub fn by_item(
17206            self,
17207        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17208            crate::model::ListGatewaySecurityPoliciesResponse,
17209            crate::Error,
17210        > {
17211            use google_cloud_gax::paginator::Paginator;
17212            self.by_page().items()
17213        }
17214
17215        /// Sets the value of [parent][crate::model::ListGatewaySecurityPoliciesRequest::parent].
17216        ///
17217        /// This is a **required** field for requests.
17218        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17219            self.0.request.parent = v.into();
17220            self
17221        }
17222
17223        /// Sets the value of [page_size][crate::model::ListGatewaySecurityPoliciesRequest::page_size].
17224        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17225            self.0.request.page_size = v.into();
17226            self
17227        }
17228
17229        /// Sets the value of [page_token][crate::model::ListGatewaySecurityPoliciesRequest::page_token].
17230        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17231            self.0.request.page_token = v.into();
17232            self
17233        }
17234    }
17235
17236    #[doc(hidden)]
17237    impl crate::RequestBuilder for ListGatewaySecurityPolicies {
17238        fn request_options(&mut self) -> &mut crate::RequestOptions {
17239            &mut self.0.options
17240        }
17241    }
17242
17243    /// The request builder for [NetworkSecurity::get_gateway_security_policy][crate::client::NetworkSecurity::get_gateway_security_policy] calls.
17244    ///
17245    /// # Example
17246    /// ```
17247    /// # use google_cloud_networksecurity_v1::builder::network_security::GetGatewaySecurityPolicy;
17248    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17249    ///
17250    /// let builder = prepare_request_builder();
17251    /// let response = builder.send().await?;
17252    /// # Ok(()) }
17253    ///
17254    /// fn prepare_request_builder() -> GetGatewaySecurityPolicy {
17255    ///   # panic!();
17256    ///   // ... details omitted ...
17257    /// }
17258    /// ```
17259    #[derive(Clone, Debug)]
17260    pub struct GetGatewaySecurityPolicy(
17261        RequestBuilder<crate::model::GetGatewaySecurityPolicyRequest>,
17262    );
17263
17264    impl GetGatewaySecurityPolicy {
17265        pub(crate) fn new(
17266            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17267        ) -> Self {
17268            Self(RequestBuilder::new(stub))
17269        }
17270
17271        /// Sets the full request, replacing any prior values.
17272        pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRequest>>(
17273            mut self,
17274            v: V,
17275        ) -> Self {
17276            self.0.request = v.into();
17277            self
17278        }
17279
17280        /// Sets all the options, replacing any prior values.
17281        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17282            self.0.options = v.into();
17283            self
17284        }
17285
17286        /// Sends the request.
17287        pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicy> {
17288            (*self.0.stub)
17289                .get_gateway_security_policy(self.0.request, self.0.options)
17290                .await
17291                .map(crate::Response::into_body)
17292        }
17293
17294        /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRequest::name].
17295        ///
17296        /// This is a **required** field for requests.
17297        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17298            self.0.request.name = v.into();
17299            self
17300        }
17301    }
17302
17303    #[doc(hidden)]
17304    impl crate::RequestBuilder for GetGatewaySecurityPolicy {
17305        fn request_options(&mut self) -> &mut crate::RequestOptions {
17306            &mut self.0.options
17307        }
17308    }
17309
17310    /// The request builder for [NetworkSecurity::create_gateway_security_policy][crate::client::NetworkSecurity::create_gateway_security_policy] calls.
17311    ///
17312    /// # Example
17313    /// ```
17314    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateGatewaySecurityPolicy;
17315    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17316    /// use google_cloud_lro::Poller;
17317    ///
17318    /// let builder = prepare_request_builder();
17319    /// let response = builder.poller().until_done().await?;
17320    /// # Ok(()) }
17321    ///
17322    /// fn prepare_request_builder() -> CreateGatewaySecurityPolicy {
17323    ///   # panic!();
17324    ///   // ... details omitted ...
17325    /// }
17326    /// ```
17327    #[derive(Clone, Debug)]
17328    pub struct CreateGatewaySecurityPolicy(
17329        RequestBuilder<crate::model::CreateGatewaySecurityPolicyRequest>,
17330    );
17331
17332    impl CreateGatewaySecurityPolicy {
17333        pub(crate) fn new(
17334            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17335        ) -> Self {
17336            Self(RequestBuilder::new(stub))
17337        }
17338
17339        /// Sets the full request, replacing any prior values.
17340        pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRequest>>(
17341            mut self,
17342            v: V,
17343        ) -> Self {
17344            self.0.request = v.into();
17345            self
17346        }
17347
17348        /// Sets all the options, replacing any prior values.
17349        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17350            self.0.options = v.into();
17351            self
17352        }
17353
17354        /// Sends the request.
17355        ///
17356        /// # Long running operations
17357        ///
17358        /// This starts, but does not poll, a longrunning operation. More information
17359        /// on [create_gateway_security_policy][crate::client::NetworkSecurity::create_gateway_security_policy].
17360        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17361            (*self.0.stub)
17362                .create_gateway_security_policy(self.0.request, self.0.options)
17363                .await
17364                .map(crate::Response::into_body)
17365        }
17366
17367        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_gateway_security_policy`.
17368        pub fn poller(
17369            self,
17370        ) -> impl google_cloud_lro::Poller<
17371            crate::model::GatewaySecurityPolicy,
17372            crate::model::OperationMetadata,
17373        > {
17374            type Operation = google_cloud_lro::internal::Operation<
17375                crate::model::GatewaySecurityPolicy,
17376                crate::model::OperationMetadata,
17377            >;
17378            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17379            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17380            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
17381            if let Some(ref mut details) = poller_options.tracing {
17382                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_gateway_security_policy::until_done";
17383            }
17384
17385            let stub = self.0.stub.clone();
17386            let mut options = self.0.options.clone();
17387            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17388            let query = move |name| {
17389                let stub = stub.clone();
17390                let options = options.clone();
17391                async {
17392                    let op = GetOperation::new(stub)
17393                        .set_name(name)
17394                        .with_options(options)
17395                        .send()
17396                        .await?;
17397                    Ok(Operation::new(op))
17398                }
17399            };
17400
17401            let start = move || async {
17402                let op = self.send().await?;
17403                Ok(Operation::new(op))
17404            };
17405
17406            use google_cloud_lro::internal::PollerExt;
17407            {
17408                google_cloud_lro::internal::new_poller(
17409                    polling_error_policy,
17410                    polling_backoff_policy,
17411                    start,
17412                    query,
17413                )
17414            }
17415            .with_options(poller_options)
17416        }
17417
17418        /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRequest::parent].
17419        ///
17420        /// This is a **required** field for requests.
17421        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17422            self.0.request.parent = v.into();
17423            self
17424        }
17425
17426        /// Sets the value of [gateway_security_policy_id][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy_id].
17427        ///
17428        /// This is a **required** field for requests.
17429        pub fn set_gateway_security_policy_id<T: Into<std::string::String>>(
17430            mut self,
17431            v: T,
17432        ) -> Self {
17433            self.0.request.gateway_security_policy_id = v.into();
17434            self
17435        }
17436
17437        /// Sets the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
17438        ///
17439        /// This is a **required** field for requests.
17440        pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
17441        where
17442            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
17443        {
17444            self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
17445            self
17446        }
17447
17448        /// Sets or clears the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
17449        ///
17450        /// This is a **required** field for requests.
17451        pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
17452        where
17453            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
17454        {
17455            self.0.request.gateway_security_policy = v.map(|x| x.into());
17456            self
17457        }
17458    }
17459
17460    #[doc(hidden)]
17461    impl crate::RequestBuilder for CreateGatewaySecurityPolicy {
17462        fn request_options(&mut self) -> &mut crate::RequestOptions {
17463            &mut self.0.options
17464        }
17465    }
17466
17467    /// The request builder for [NetworkSecurity::update_gateway_security_policy][crate::client::NetworkSecurity::update_gateway_security_policy] calls.
17468    ///
17469    /// # Example
17470    /// ```
17471    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateGatewaySecurityPolicy;
17472    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17473    /// use google_cloud_lro::Poller;
17474    ///
17475    /// let builder = prepare_request_builder();
17476    /// let response = builder.poller().until_done().await?;
17477    /// # Ok(()) }
17478    ///
17479    /// fn prepare_request_builder() -> UpdateGatewaySecurityPolicy {
17480    ///   # panic!();
17481    ///   // ... details omitted ...
17482    /// }
17483    /// ```
17484    #[derive(Clone, Debug)]
17485    pub struct UpdateGatewaySecurityPolicy(
17486        RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRequest>,
17487    );
17488
17489    impl UpdateGatewaySecurityPolicy {
17490        pub(crate) fn new(
17491            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17492        ) -> Self {
17493            Self(RequestBuilder::new(stub))
17494        }
17495
17496        /// Sets the full request, replacing any prior values.
17497        pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRequest>>(
17498            mut self,
17499            v: V,
17500        ) -> Self {
17501            self.0.request = v.into();
17502            self
17503        }
17504
17505        /// Sets all the options, replacing any prior values.
17506        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17507            self.0.options = v.into();
17508            self
17509        }
17510
17511        /// Sends the request.
17512        ///
17513        /// # Long running operations
17514        ///
17515        /// This starts, but does not poll, a longrunning operation. More information
17516        /// on [update_gateway_security_policy][crate::client::NetworkSecurity::update_gateway_security_policy].
17517        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17518            (*self.0.stub)
17519                .update_gateway_security_policy(self.0.request, self.0.options)
17520                .await
17521                .map(crate::Response::into_body)
17522        }
17523
17524        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_gateway_security_policy`.
17525        pub fn poller(
17526            self,
17527        ) -> impl google_cloud_lro::Poller<
17528            crate::model::GatewaySecurityPolicy,
17529            crate::model::OperationMetadata,
17530        > {
17531            type Operation = google_cloud_lro::internal::Operation<
17532                crate::model::GatewaySecurityPolicy,
17533                crate::model::OperationMetadata,
17534            >;
17535            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17536            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17537            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
17538            if let Some(ref mut details) = poller_options.tracing {
17539                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_gateway_security_policy::until_done";
17540            }
17541
17542            let stub = self.0.stub.clone();
17543            let mut options = self.0.options.clone();
17544            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17545            let query = move |name| {
17546                let stub = stub.clone();
17547                let options = options.clone();
17548                async {
17549                    let op = GetOperation::new(stub)
17550                        .set_name(name)
17551                        .with_options(options)
17552                        .send()
17553                        .await?;
17554                    Ok(Operation::new(op))
17555                }
17556            };
17557
17558            let start = move || async {
17559                let op = self.send().await?;
17560                Ok(Operation::new(op))
17561            };
17562
17563            use google_cloud_lro::internal::PollerExt;
17564            {
17565                google_cloud_lro::internal::new_poller(
17566                    polling_error_policy,
17567                    polling_backoff_policy,
17568                    start,
17569                    query,
17570                )
17571            }
17572            .with_options(poller_options)
17573        }
17574
17575        /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
17576        pub fn set_update_mask<T>(mut self, v: T) -> Self
17577        where
17578            T: std::convert::Into<wkt::FieldMask>,
17579        {
17580            self.0.request.update_mask = std::option::Option::Some(v.into());
17581            self
17582        }
17583
17584        /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
17585        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17586        where
17587            T: std::convert::Into<wkt::FieldMask>,
17588        {
17589            self.0.request.update_mask = v.map(|x| x.into());
17590            self
17591        }
17592
17593        /// Sets the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
17594        ///
17595        /// This is a **required** field for requests.
17596        pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
17597        where
17598            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
17599        {
17600            self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
17601            self
17602        }
17603
17604        /// Sets or clears the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
17605        ///
17606        /// This is a **required** field for requests.
17607        pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
17608        where
17609            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
17610        {
17611            self.0.request.gateway_security_policy = v.map(|x| x.into());
17612            self
17613        }
17614    }
17615
17616    #[doc(hidden)]
17617    impl crate::RequestBuilder for UpdateGatewaySecurityPolicy {
17618        fn request_options(&mut self) -> &mut crate::RequestOptions {
17619            &mut self.0.options
17620        }
17621    }
17622
17623    /// The request builder for [NetworkSecurity::delete_gateway_security_policy][crate::client::NetworkSecurity::delete_gateway_security_policy] calls.
17624    ///
17625    /// # Example
17626    /// ```
17627    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteGatewaySecurityPolicy;
17628    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17629    /// use google_cloud_lro::Poller;
17630    ///
17631    /// let builder = prepare_request_builder();
17632    /// let response = builder.poller().until_done().await?;
17633    /// # Ok(()) }
17634    ///
17635    /// fn prepare_request_builder() -> DeleteGatewaySecurityPolicy {
17636    ///   # panic!();
17637    ///   // ... details omitted ...
17638    /// }
17639    /// ```
17640    #[derive(Clone, Debug)]
17641    pub struct DeleteGatewaySecurityPolicy(
17642        RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRequest>,
17643    );
17644
17645    impl DeleteGatewaySecurityPolicy {
17646        pub(crate) fn new(
17647            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17648        ) -> Self {
17649            Self(RequestBuilder::new(stub))
17650        }
17651
17652        /// Sets the full request, replacing any prior values.
17653        pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRequest>>(
17654            mut self,
17655            v: V,
17656        ) -> Self {
17657            self.0.request = v.into();
17658            self
17659        }
17660
17661        /// Sets all the options, replacing any prior values.
17662        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17663            self.0.options = v.into();
17664            self
17665        }
17666
17667        /// Sends the request.
17668        ///
17669        /// # Long running operations
17670        ///
17671        /// This starts, but does not poll, a longrunning operation. More information
17672        /// on [delete_gateway_security_policy][crate::client::NetworkSecurity::delete_gateway_security_policy].
17673        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17674            (*self.0.stub)
17675                .delete_gateway_security_policy(self.0.request, self.0.options)
17676                .await
17677                .map(crate::Response::into_body)
17678        }
17679
17680        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_gateway_security_policy`.
17681        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17682            type Operation =
17683                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17684            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17685            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17686            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
17687            if let Some(ref mut details) = poller_options.tracing {
17688                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_gateway_security_policy::until_done";
17689            }
17690
17691            let stub = self.0.stub.clone();
17692            let mut options = self.0.options.clone();
17693            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17694            let query = move |name| {
17695                let stub = stub.clone();
17696                let options = options.clone();
17697                async {
17698                    let op = GetOperation::new(stub)
17699                        .set_name(name)
17700                        .with_options(options)
17701                        .send()
17702                        .await?;
17703                    Ok(Operation::new(op))
17704                }
17705            };
17706
17707            let start = move || async {
17708                let op = self.send().await?;
17709                Ok(Operation::new(op))
17710            };
17711
17712            use google_cloud_lro::internal::PollerExt;
17713            {
17714                google_cloud_lro::internal::new_unit_response_poller(
17715                    polling_error_policy,
17716                    polling_backoff_policy,
17717                    start,
17718                    query,
17719                )
17720            }
17721            .with_options(poller_options)
17722        }
17723
17724        /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRequest::name].
17725        ///
17726        /// This is a **required** field for requests.
17727        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17728            self.0.request.name = v.into();
17729            self
17730        }
17731    }
17732
17733    #[doc(hidden)]
17734    impl crate::RequestBuilder for DeleteGatewaySecurityPolicy {
17735        fn request_options(&mut self) -> &mut crate::RequestOptions {
17736            &mut self.0.options
17737        }
17738    }
17739
17740    /// The request builder for [NetworkSecurity::list_gateway_security_policy_rules][crate::client::NetworkSecurity::list_gateway_security_policy_rules] calls.
17741    ///
17742    /// # Example
17743    /// ```
17744    /// # use google_cloud_networksecurity_v1::builder::network_security::ListGatewaySecurityPolicyRules;
17745    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17746    /// use google_cloud_gax::paginator::ItemPaginator;
17747    ///
17748    /// let builder = prepare_request_builder();
17749    /// let mut items = builder.by_item();
17750    /// while let Some(result) = items.next().await {
17751    ///   let item = result?;
17752    /// }
17753    /// # Ok(()) }
17754    ///
17755    /// fn prepare_request_builder() -> ListGatewaySecurityPolicyRules {
17756    ///   # panic!();
17757    ///   // ... details omitted ...
17758    /// }
17759    /// ```
17760    #[derive(Clone, Debug)]
17761    pub struct ListGatewaySecurityPolicyRules(
17762        RequestBuilder<crate::model::ListGatewaySecurityPolicyRulesRequest>,
17763    );
17764
17765    impl ListGatewaySecurityPolicyRules {
17766        pub(crate) fn new(
17767            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17768        ) -> Self {
17769            Self(RequestBuilder::new(stub))
17770        }
17771
17772        /// Sets the full request, replacing any prior values.
17773        pub fn with_request<V: Into<crate::model::ListGatewaySecurityPolicyRulesRequest>>(
17774            mut self,
17775            v: V,
17776        ) -> Self {
17777            self.0.request = v.into();
17778            self
17779        }
17780
17781        /// Sets all the options, replacing any prior values.
17782        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17783            self.0.options = v.into();
17784            self
17785        }
17786
17787        /// Sends the request.
17788        pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPolicyRulesResponse> {
17789            (*self.0.stub)
17790                .list_gateway_security_policy_rules(self.0.request, self.0.options)
17791                .await
17792                .map(crate::Response::into_body)
17793        }
17794
17795        /// Streams each page in the collection.
17796        pub fn by_page(
17797            self,
17798        ) -> impl google_cloud_gax::paginator::Paginator<
17799            crate::model::ListGatewaySecurityPolicyRulesResponse,
17800            crate::Error,
17801        > {
17802            use std::clone::Clone;
17803            let token = self.0.request.page_token.clone();
17804            let execute = move |token: String| {
17805                let mut builder = self.clone();
17806                builder.0.request = builder.0.request.set_page_token(token);
17807                builder.send()
17808            };
17809            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17810        }
17811
17812        /// Streams each item in the collection.
17813        pub fn by_item(
17814            self,
17815        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17816            crate::model::ListGatewaySecurityPolicyRulesResponse,
17817            crate::Error,
17818        > {
17819            use google_cloud_gax::paginator::Paginator;
17820            self.by_page().items()
17821        }
17822
17823        /// Sets the value of [parent][crate::model::ListGatewaySecurityPolicyRulesRequest::parent].
17824        ///
17825        /// This is a **required** field for requests.
17826        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17827            self.0.request.parent = v.into();
17828            self
17829        }
17830
17831        /// Sets the value of [page_size][crate::model::ListGatewaySecurityPolicyRulesRequest::page_size].
17832        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17833            self.0.request.page_size = v.into();
17834            self
17835        }
17836
17837        /// Sets the value of [page_token][crate::model::ListGatewaySecurityPolicyRulesRequest::page_token].
17838        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17839            self.0.request.page_token = v.into();
17840            self
17841        }
17842    }
17843
17844    #[doc(hidden)]
17845    impl crate::RequestBuilder for ListGatewaySecurityPolicyRules {
17846        fn request_options(&mut self) -> &mut crate::RequestOptions {
17847            &mut self.0.options
17848        }
17849    }
17850
17851    /// The request builder for [NetworkSecurity::get_gateway_security_policy_rule][crate::client::NetworkSecurity::get_gateway_security_policy_rule] calls.
17852    ///
17853    /// # Example
17854    /// ```
17855    /// # use google_cloud_networksecurity_v1::builder::network_security::GetGatewaySecurityPolicyRule;
17856    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17857    ///
17858    /// let builder = prepare_request_builder();
17859    /// let response = builder.send().await?;
17860    /// # Ok(()) }
17861    ///
17862    /// fn prepare_request_builder() -> GetGatewaySecurityPolicyRule {
17863    ///   # panic!();
17864    ///   // ... details omitted ...
17865    /// }
17866    /// ```
17867    #[derive(Clone, Debug)]
17868    pub struct GetGatewaySecurityPolicyRule(
17869        RequestBuilder<crate::model::GetGatewaySecurityPolicyRuleRequest>,
17870    );
17871
17872    impl GetGatewaySecurityPolicyRule {
17873        pub(crate) fn new(
17874            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17875        ) -> Self {
17876            Self(RequestBuilder::new(stub))
17877        }
17878
17879        /// Sets the full request, replacing any prior values.
17880        pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRuleRequest>>(
17881            mut self,
17882            v: V,
17883        ) -> Self {
17884            self.0.request = v.into();
17885            self
17886        }
17887
17888        /// Sets all the options, replacing any prior values.
17889        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17890            self.0.options = v.into();
17891            self
17892        }
17893
17894        /// Sends the request.
17895        pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicyRule> {
17896            (*self.0.stub)
17897                .get_gateway_security_policy_rule(self.0.request, self.0.options)
17898                .await
17899                .map(crate::Response::into_body)
17900        }
17901
17902        /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRuleRequest::name].
17903        ///
17904        /// This is a **required** field for requests.
17905        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17906            self.0.request.name = v.into();
17907            self
17908        }
17909    }
17910
17911    #[doc(hidden)]
17912    impl crate::RequestBuilder for GetGatewaySecurityPolicyRule {
17913        fn request_options(&mut self) -> &mut crate::RequestOptions {
17914            &mut self.0.options
17915        }
17916    }
17917
17918    /// The request builder for [NetworkSecurity::create_gateway_security_policy_rule][crate::client::NetworkSecurity::create_gateway_security_policy_rule] calls.
17919    ///
17920    /// # Example
17921    /// ```
17922    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateGatewaySecurityPolicyRule;
17923    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17924    /// use google_cloud_lro::Poller;
17925    ///
17926    /// let builder = prepare_request_builder();
17927    /// let response = builder.poller().until_done().await?;
17928    /// # Ok(()) }
17929    ///
17930    /// fn prepare_request_builder() -> CreateGatewaySecurityPolicyRule {
17931    ///   # panic!();
17932    ///   // ... details omitted ...
17933    /// }
17934    /// ```
17935    #[derive(Clone, Debug)]
17936    pub struct CreateGatewaySecurityPolicyRule(
17937        RequestBuilder<crate::model::CreateGatewaySecurityPolicyRuleRequest>,
17938    );
17939
17940    impl CreateGatewaySecurityPolicyRule {
17941        pub(crate) fn new(
17942            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17943        ) -> Self {
17944            Self(RequestBuilder::new(stub))
17945        }
17946
17947        /// Sets the full request, replacing any prior values.
17948        pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRuleRequest>>(
17949            mut self,
17950            v: V,
17951        ) -> Self {
17952            self.0.request = v.into();
17953            self
17954        }
17955
17956        /// Sets all the options, replacing any prior values.
17957        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17958            self.0.options = v.into();
17959            self
17960        }
17961
17962        /// Sends the request.
17963        ///
17964        /// # Long running operations
17965        ///
17966        /// This starts, but does not poll, a longrunning operation. More information
17967        /// on [create_gateway_security_policy_rule][crate::client::NetworkSecurity::create_gateway_security_policy_rule].
17968        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17969            (*self.0.stub)
17970                .create_gateway_security_policy_rule(self.0.request, self.0.options)
17971                .await
17972                .map(crate::Response::into_body)
17973        }
17974
17975        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_gateway_security_policy_rule`.
17976        pub fn poller(
17977            self,
17978        ) -> impl google_cloud_lro::Poller<
17979            crate::model::GatewaySecurityPolicyRule,
17980            crate::model::OperationMetadata,
17981        > {
17982            type Operation = google_cloud_lro::internal::Operation<
17983                crate::model::GatewaySecurityPolicyRule,
17984                crate::model::OperationMetadata,
17985            >;
17986            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17987            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17988            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
17989            if let Some(ref mut details) = poller_options.tracing {
17990                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_gateway_security_policy_rule::until_done";
17991            }
17992
17993            let stub = self.0.stub.clone();
17994            let mut options = self.0.options.clone();
17995            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17996            let query = move |name| {
17997                let stub = stub.clone();
17998                let options = options.clone();
17999                async {
18000                    let op = GetOperation::new(stub)
18001                        .set_name(name)
18002                        .with_options(options)
18003                        .send()
18004                        .await?;
18005                    Ok(Operation::new(op))
18006                }
18007            };
18008
18009            let start = move || async {
18010                let op = self.send().await?;
18011                Ok(Operation::new(op))
18012            };
18013
18014            use google_cloud_lro::internal::PollerExt;
18015            {
18016                google_cloud_lro::internal::new_poller(
18017                    polling_error_policy,
18018                    polling_backoff_policy,
18019                    start,
18020                    query,
18021                )
18022            }
18023            .with_options(poller_options)
18024        }
18025
18026        /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRuleRequest::parent].
18027        ///
18028        /// This is a **required** field for requests.
18029        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18030            self.0.request.parent = v.into();
18031            self
18032        }
18033
18034        /// Sets the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
18035        ///
18036        /// This is a **required** field for requests.
18037        pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
18038        where
18039            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
18040        {
18041            self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
18042            self
18043        }
18044
18045        /// Sets or clears the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
18046        ///
18047        /// This is a **required** field for requests.
18048        pub fn set_or_clear_gateway_security_policy_rule<T>(
18049            mut self,
18050            v: std::option::Option<T>,
18051        ) -> Self
18052        where
18053            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
18054        {
18055            self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
18056            self
18057        }
18058
18059        /// Sets the value of [gateway_security_policy_rule_id][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule_id].
18060        pub fn set_gateway_security_policy_rule_id<T: Into<std::string::String>>(
18061            mut self,
18062            v: T,
18063        ) -> Self {
18064            self.0.request.gateway_security_policy_rule_id = v.into();
18065            self
18066        }
18067    }
18068
18069    #[doc(hidden)]
18070    impl crate::RequestBuilder for CreateGatewaySecurityPolicyRule {
18071        fn request_options(&mut self) -> &mut crate::RequestOptions {
18072            &mut self.0.options
18073        }
18074    }
18075
18076    /// The request builder for [NetworkSecurity::update_gateway_security_policy_rule][crate::client::NetworkSecurity::update_gateway_security_policy_rule] calls.
18077    ///
18078    /// # Example
18079    /// ```
18080    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateGatewaySecurityPolicyRule;
18081    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18082    /// use google_cloud_lro::Poller;
18083    ///
18084    /// let builder = prepare_request_builder();
18085    /// let response = builder.poller().until_done().await?;
18086    /// # Ok(()) }
18087    ///
18088    /// fn prepare_request_builder() -> UpdateGatewaySecurityPolicyRule {
18089    ///   # panic!();
18090    ///   // ... details omitted ...
18091    /// }
18092    /// ```
18093    #[derive(Clone, Debug)]
18094    pub struct UpdateGatewaySecurityPolicyRule(
18095        RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRuleRequest>,
18096    );
18097
18098    impl UpdateGatewaySecurityPolicyRule {
18099        pub(crate) fn new(
18100            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18101        ) -> Self {
18102            Self(RequestBuilder::new(stub))
18103        }
18104
18105        /// Sets the full request, replacing any prior values.
18106        pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRuleRequest>>(
18107            mut self,
18108            v: V,
18109        ) -> Self {
18110            self.0.request = v.into();
18111            self
18112        }
18113
18114        /// Sets all the options, replacing any prior values.
18115        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18116            self.0.options = v.into();
18117            self
18118        }
18119
18120        /// Sends the request.
18121        ///
18122        /// # Long running operations
18123        ///
18124        /// This starts, but does not poll, a longrunning operation. More information
18125        /// on [update_gateway_security_policy_rule][crate::client::NetworkSecurity::update_gateway_security_policy_rule].
18126        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18127            (*self.0.stub)
18128                .update_gateway_security_policy_rule(self.0.request, self.0.options)
18129                .await
18130                .map(crate::Response::into_body)
18131        }
18132
18133        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_gateway_security_policy_rule`.
18134        pub fn poller(
18135            self,
18136        ) -> impl google_cloud_lro::Poller<
18137            crate::model::GatewaySecurityPolicyRule,
18138            crate::model::OperationMetadata,
18139        > {
18140            type Operation = google_cloud_lro::internal::Operation<
18141                crate::model::GatewaySecurityPolicyRule,
18142                crate::model::OperationMetadata,
18143            >;
18144            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18145            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18146            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
18147            if let Some(ref mut details) = poller_options.tracing {
18148                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_gateway_security_policy_rule::until_done";
18149            }
18150
18151            let stub = self.0.stub.clone();
18152            let mut options = self.0.options.clone();
18153            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18154            let query = move |name| {
18155                let stub = stub.clone();
18156                let options = options.clone();
18157                async {
18158                    let op = GetOperation::new(stub)
18159                        .set_name(name)
18160                        .with_options(options)
18161                        .send()
18162                        .await?;
18163                    Ok(Operation::new(op))
18164                }
18165            };
18166
18167            let start = move || async {
18168                let op = self.send().await?;
18169                Ok(Operation::new(op))
18170            };
18171
18172            use google_cloud_lro::internal::PollerExt;
18173            {
18174                google_cloud_lro::internal::new_poller(
18175                    polling_error_policy,
18176                    polling_backoff_policy,
18177                    start,
18178                    query,
18179                )
18180            }
18181            .with_options(poller_options)
18182        }
18183
18184        /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
18185        pub fn set_update_mask<T>(mut self, v: T) -> Self
18186        where
18187            T: std::convert::Into<wkt::FieldMask>,
18188        {
18189            self.0.request.update_mask = std::option::Option::Some(v.into());
18190            self
18191        }
18192
18193        /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
18194        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18195        where
18196            T: std::convert::Into<wkt::FieldMask>,
18197        {
18198            self.0.request.update_mask = v.map(|x| x.into());
18199            self
18200        }
18201
18202        /// Sets the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
18203        ///
18204        /// This is a **required** field for requests.
18205        pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
18206        where
18207            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
18208        {
18209            self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
18210            self
18211        }
18212
18213        /// Sets or clears the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
18214        ///
18215        /// This is a **required** field for requests.
18216        pub fn set_or_clear_gateway_security_policy_rule<T>(
18217            mut self,
18218            v: std::option::Option<T>,
18219        ) -> Self
18220        where
18221            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
18222        {
18223            self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
18224            self
18225        }
18226    }
18227
18228    #[doc(hidden)]
18229    impl crate::RequestBuilder for UpdateGatewaySecurityPolicyRule {
18230        fn request_options(&mut self) -> &mut crate::RequestOptions {
18231            &mut self.0.options
18232        }
18233    }
18234
18235    /// The request builder for [NetworkSecurity::delete_gateway_security_policy_rule][crate::client::NetworkSecurity::delete_gateway_security_policy_rule] calls.
18236    ///
18237    /// # Example
18238    /// ```
18239    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteGatewaySecurityPolicyRule;
18240    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18241    /// use google_cloud_lro::Poller;
18242    ///
18243    /// let builder = prepare_request_builder();
18244    /// let response = builder.poller().until_done().await?;
18245    /// # Ok(()) }
18246    ///
18247    /// fn prepare_request_builder() -> DeleteGatewaySecurityPolicyRule {
18248    ///   # panic!();
18249    ///   // ... details omitted ...
18250    /// }
18251    /// ```
18252    #[derive(Clone, Debug)]
18253    pub struct DeleteGatewaySecurityPolicyRule(
18254        RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRuleRequest>,
18255    );
18256
18257    impl DeleteGatewaySecurityPolicyRule {
18258        pub(crate) fn new(
18259            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18260        ) -> Self {
18261            Self(RequestBuilder::new(stub))
18262        }
18263
18264        /// Sets the full request, replacing any prior values.
18265        pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRuleRequest>>(
18266            mut self,
18267            v: V,
18268        ) -> Self {
18269            self.0.request = v.into();
18270            self
18271        }
18272
18273        /// Sets all the options, replacing any prior values.
18274        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18275            self.0.options = v.into();
18276            self
18277        }
18278
18279        /// Sends the request.
18280        ///
18281        /// # Long running operations
18282        ///
18283        /// This starts, but does not poll, a longrunning operation. More information
18284        /// on [delete_gateway_security_policy_rule][crate::client::NetworkSecurity::delete_gateway_security_policy_rule].
18285        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18286            (*self.0.stub)
18287                .delete_gateway_security_policy_rule(self.0.request, self.0.options)
18288                .await
18289                .map(crate::Response::into_body)
18290        }
18291
18292        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_gateway_security_policy_rule`.
18293        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18294            type Operation =
18295                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18296            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18297            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18298            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
18299            if let Some(ref mut details) = poller_options.tracing {
18300                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_gateway_security_policy_rule::until_done";
18301            }
18302
18303            let stub = self.0.stub.clone();
18304            let mut options = self.0.options.clone();
18305            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18306            let query = move |name| {
18307                let stub = stub.clone();
18308                let options = options.clone();
18309                async {
18310                    let op = GetOperation::new(stub)
18311                        .set_name(name)
18312                        .with_options(options)
18313                        .send()
18314                        .await?;
18315                    Ok(Operation::new(op))
18316                }
18317            };
18318
18319            let start = move || async {
18320                let op = self.send().await?;
18321                Ok(Operation::new(op))
18322            };
18323
18324            use google_cloud_lro::internal::PollerExt;
18325            {
18326                google_cloud_lro::internal::new_unit_response_poller(
18327                    polling_error_policy,
18328                    polling_backoff_policy,
18329                    start,
18330                    query,
18331                )
18332            }
18333            .with_options(poller_options)
18334        }
18335
18336        /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRuleRequest::name].
18337        ///
18338        /// This is a **required** field for requests.
18339        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18340            self.0.request.name = v.into();
18341            self
18342        }
18343    }
18344
18345    #[doc(hidden)]
18346    impl crate::RequestBuilder for DeleteGatewaySecurityPolicyRule {
18347        fn request_options(&mut self) -> &mut crate::RequestOptions {
18348            &mut self.0.options
18349        }
18350    }
18351
18352    /// The request builder for [NetworkSecurity::list_url_lists][crate::client::NetworkSecurity::list_url_lists] calls.
18353    ///
18354    /// # Example
18355    /// ```
18356    /// # use google_cloud_networksecurity_v1::builder::network_security::ListUrlLists;
18357    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18358    /// use google_cloud_gax::paginator::ItemPaginator;
18359    ///
18360    /// let builder = prepare_request_builder();
18361    /// let mut items = builder.by_item();
18362    /// while let Some(result) = items.next().await {
18363    ///   let item = result?;
18364    /// }
18365    /// # Ok(()) }
18366    ///
18367    /// fn prepare_request_builder() -> ListUrlLists {
18368    ///   # panic!();
18369    ///   // ... details omitted ...
18370    /// }
18371    /// ```
18372    #[derive(Clone, Debug)]
18373    pub struct ListUrlLists(RequestBuilder<crate::model::ListUrlListsRequest>);
18374
18375    impl ListUrlLists {
18376        pub(crate) fn new(
18377            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18378        ) -> Self {
18379            Self(RequestBuilder::new(stub))
18380        }
18381
18382        /// Sets the full request, replacing any prior values.
18383        pub fn with_request<V: Into<crate::model::ListUrlListsRequest>>(mut self, v: V) -> Self {
18384            self.0.request = v.into();
18385            self
18386        }
18387
18388        /// Sets all the options, replacing any prior values.
18389        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18390            self.0.options = v.into();
18391            self
18392        }
18393
18394        /// Sends the request.
18395        pub async fn send(self) -> Result<crate::model::ListUrlListsResponse> {
18396            (*self.0.stub)
18397                .list_url_lists(self.0.request, self.0.options)
18398                .await
18399                .map(crate::Response::into_body)
18400        }
18401
18402        /// Streams each page in the collection.
18403        pub fn by_page(
18404            self,
18405        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListUrlListsResponse, crate::Error>
18406        {
18407            use std::clone::Clone;
18408            let token = self.0.request.page_token.clone();
18409            let execute = move |token: String| {
18410                let mut builder = self.clone();
18411                builder.0.request = builder.0.request.set_page_token(token);
18412                builder.send()
18413            };
18414            google_cloud_gax::paginator::internal::new_paginator(token, execute)
18415        }
18416
18417        /// Streams each item in the collection.
18418        pub fn by_item(
18419            self,
18420        ) -> impl google_cloud_gax::paginator::ItemPaginator<
18421            crate::model::ListUrlListsResponse,
18422            crate::Error,
18423        > {
18424            use google_cloud_gax::paginator::Paginator;
18425            self.by_page().items()
18426        }
18427
18428        /// Sets the value of [parent][crate::model::ListUrlListsRequest::parent].
18429        ///
18430        /// This is a **required** field for requests.
18431        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18432            self.0.request.parent = v.into();
18433            self
18434        }
18435
18436        /// Sets the value of [page_size][crate::model::ListUrlListsRequest::page_size].
18437        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18438            self.0.request.page_size = v.into();
18439            self
18440        }
18441
18442        /// Sets the value of [page_token][crate::model::ListUrlListsRequest::page_token].
18443        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18444            self.0.request.page_token = v.into();
18445            self
18446        }
18447    }
18448
18449    #[doc(hidden)]
18450    impl crate::RequestBuilder for ListUrlLists {
18451        fn request_options(&mut self) -> &mut crate::RequestOptions {
18452            &mut self.0.options
18453        }
18454    }
18455
18456    /// The request builder for [NetworkSecurity::get_url_list][crate::client::NetworkSecurity::get_url_list] calls.
18457    ///
18458    /// # Example
18459    /// ```
18460    /// # use google_cloud_networksecurity_v1::builder::network_security::GetUrlList;
18461    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18462    ///
18463    /// let builder = prepare_request_builder();
18464    /// let response = builder.send().await?;
18465    /// # Ok(()) }
18466    ///
18467    /// fn prepare_request_builder() -> GetUrlList {
18468    ///   # panic!();
18469    ///   // ... details omitted ...
18470    /// }
18471    /// ```
18472    #[derive(Clone, Debug)]
18473    pub struct GetUrlList(RequestBuilder<crate::model::GetUrlListRequest>);
18474
18475    impl GetUrlList {
18476        pub(crate) fn new(
18477            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18478        ) -> Self {
18479            Self(RequestBuilder::new(stub))
18480        }
18481
18482        /// Sets the full request, replacing any prior values.
18483        pub fn with_request<V: Into<crate::model::GetUrlListRequest>>(mut self, v: V) -> Self {
18484            self.0.request = v.into();
18485            self
18486        }
18487
18488        /// Sets all the options, replacing any prior values.
18489        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18490            self.0.options = v.into();
18491            self
18492        }
18493
18494        /// Sends the request.
18495        pub async fn send(self) -> Result<crate::model::UrlList> {
18496            (*self.0.stub)
18497                .get_url_list(self.0.request, self.0.options)
18498                .await
18499                .map(crate::Response::into_body)
18500        }
18501
18502        /// Sets the value of [name][crate::model::GetUrlListRequest::name].
18503        ///
18504        /// This is a **required** field for requests.
18505        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18506            self.0.request.name = v.into();
18507            self
18508        }
18509    }
18510
18511    #[doc(hidden)]
18512    impl crate::RequestBuilder for GetUrlList {
18513        fn request_options(&mut self) -> &mut crate::RequestOptions {
18514            &mut self.0.options
18515        }
18516    }
18517
18518    /// The request builder for [NetworkSecurity::create_url_list][crate::client::NetworkSecurity::create_url_list] calls.
18519    ///
18520    /// # Example
18521    /// ```
18522    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateUrlList;
18523    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18524    /// use google_cloud_lro::Poller;
18525    ///
18526    /// let builder = prepare_request_builder();
18527    /// let response = builder.poller().until_done().await?;
18528    /// # Ok(()) }
18529    ///
18530    /// fn prepare_request_builder() -> CreateUrlList {
18531    ///   # panic!();
18532    ///   // ... details omitted ...
18533    /// }
18534    /// ```
18535    #[derive(Clone, Debug)]
18536    pub struct CreateUrlList(RequestBuilder<crate::model::CreateUrlListRequest>);
18537
18538    impl CreateUrlList {
18539        pub(crate) fn new(
18540            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18541        ) -> Self {
18542            Self(RequestBuilder::new(stub))
18543        }
18544
18545        /// Sets the full request, replacing any prior values.
18546        pub fn with_request<V: Into<crate::model::CreateUrlListRequest>>(mut self, v: V) -> Self {
18547            self.0.request = v.into();
18548            self
18549        }
18550
18551        /// Sets all the options, replacing any prior values.
18552        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18553            self.0.options = v.into();
18554            self
18555        }
18556
18557        /// Sends the request.
18558        ///
18559        /// # Long running operations
18560        ///
18561        /// This starts, but does not poll, a longrunning operation. More information
18562        /// on [create_url_list][crate::client::NetworkSecurity::create_url_list].
18563        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18564            (*self.0.stub)
18565                .create_url_list(self.0.request, self.0.options)
18566                .await
18567                .map(crate::Response::into_body)
18568        }
18569
18570        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_url_list`.
18571        pub fn poller(
18572            self,
18573        ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
18574        {
18575            type Operation = google_cloud_lro::internal::Operation<
18576                crate::model::UrlList,
18577                crate::model::OperationMetadata,
18578            >;
18579            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18580            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18581            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
18582            if let Some(ref mut details) = poller_options.tracing {
18583                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_url_list::until_done";
18584            }
18585
18586            let stub = self.0.stub.clone();
18587            let mut options = self.0.options.clone();
18588            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18589            let query = move |name| {
18590                let stub = stub.clone();
18591                let options = options.clone();
18592                async {
18593                    let op = GetOperation::new(stub)
18594                        .set_name(name)
18595                        .with_options(options)
18596                        .send()
18597                        .await?;
18598                    Ok(Operation::new(op))
18599                }
18600            };
18601
18602            let start = move || async {
18603                let op = self.send().await?;
18604                Ok(Operation::new(op))
18605            };
18606
18607            use google_cloud_lro::internal::PollerExt;
18608            {
18609                google_cloud_lro::internal::new_poller(
18610                    polling_error_policy,
18611                    polling_backoff_policy,
18612                    start,
18613                    query,
18614                )
18615            }
18616            .with_options(poller_options)
18617        }
18618
18619        /// Sets the value of [parent][crate::model::CreateUrlListRequest::parent].
18620        ///
18621        /// This is a **required** field for requests.
18622        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18623            self.0.request.parent = v.into();
18624            self
18625        }
18626
18627        /// Sets the value of [url_list_id][crate::model::CreateUrlListRequest::url_list_id].
18628        ///
18629        /// This is a **required** field for requests.
18630        pub fn set_url_list_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18631            self.0.request.url_list_id = v.into();
18632            self
18633        }
18634
18635        /// Sets the value of [url_list][crate::model::CreateUrlListRequest::url_list].
18636        ///
18637        /// This is a **required** field for requests.
18638        pub fn set_url_list<T>(mut self, v: T) -> Self
18639        where
18640            T: std::convert::Into<crate::model::UrlList>,
18641        {
18642            self.0.request.url_list = std::option::Option::Some(v.into());
18643            self
18644        }
18645
18646        /// Sets or clears the value of [url_list][crate::model::CreateUrlListRequest::url_list].
18647        ///
18648        /// This is a **required** field for requests.
18649        pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
18650        where
18651            T: std::convert::Into<crate::model::UrlList>,
18652        {
18653            self.0.request.url_list = v.map(|x| x.into());
18654            self
18655        }
18656    }
18657
18658    #[doc(hidden)]
18659    impl crate::RequestBuilder for CreateUrlList {
18660        fn request_options(&mut self) -> &mut crate::RequestOptions {
18661            &mut self.0.options
18662        }
18663    }
18664
18665    /// The request builder for [NetworkSecurity::update_url_list][crate::client::NetworkSecurity::update_url_list] calls.
18666    ///
18667    /// # Example
18668    /// ```
18669    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateUrlList;
18670    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18671    /// use google_cloud_lro::Poller;
18672    ///
18673    /// let builder = prepare_request_builder();
18674    /// let response = builder.poller().until_done().await?;
18675    /// # Ok(()) }
18676    ///
18677    /// fn prepare_request_builder() -> UpdateUrlList {
18678    ///   # panic!();
18679    ///   // ... details omitted ...
18680    /// }
18681    /// ```
18682    #[derive(Clone, Debug)]
18683    pub struct UpdateUrlList(RequestBuilder<crate::model::UpdateUrlListRequest>);
18684
18685    impl UpdateUrlList {
18686        pub(crate) fn new(
18687            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18688        ) -> Self {
18689            Self(RequestBuilder::new(stub))
18690        }
18691
18692        /// Sets the full request, replacing any prior values.
18693        pub fn with_request<V: Into<crate::model::UpdateUrlListRequest>>(mut self, v: V) -> Self {
18694            self.0.request = v.into();
18695            self
18696        }
18697
18698        /// Sets all the options, replacing any prior values.
18699        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18700            self.0.options = v.into();
18701            self
18702        }
18703
18704        /// Sends the request.
18705        ///
18706        /// # Long running operations
18707        ///
18708        /// This starts, but does not poll, a longrunning operation. More information
18709        /// on [update_url_list][crate::client::NetworkSecurity::update_url_list].
18710        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18711            (*self.0.stub)
18712                .update_url_list(self.0.request, self.0.options)
18713                .await
18714                .map(crate::Response::into_body)
18715        }
18716
18717        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_url_list`.
18718        pub fn poller(
18719            self,
18720        ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
18721        {
18722            type Operation = google_cloud_lro::internal::Operation<
18723                crate::model::UrlList,
18724                crate::model::OperationMetadata,
18725            >;
18726            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18727            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18728            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
18729            if let Some(ref mut details) = poller_options.tracing {
18730                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_url_list::until_done";
18731            }
18732
18733            let stub = self.0.stub.clone();
18734            let mut options = self.0.options.clone();
18735            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18736            let query = move |name| {
18737                let stub = stub.clone();
18738                let options = options.clone();
18739                async {
18740                    let op = GetOperation::new(stub)
18741                        .set_name(name)
18742                        .with_options(options)
18743                        .send()
18744                        .await?;
18745                    Ok(Operation::new(op))
18746                }
18747            };
18748
18749            let start = move || async {
18750                let op = self.send().await?;
18751                Ok(Operation::new(op))
18752            };
18753
18754            use google_cloud_lro::internal::PollerExt;
18755            {
18756                google_cloud_lro::internal::new_poller(
18757                    polling_error_policy,
18758                    polling_backoff_policy,
18759                    start,
18760                    query,
18761                )
18762            }
18763            .with_options(poller_options)
18764        }
18765
18766        /// Sets the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
18767        pub fn set_update_mask<T>(mut self, v: T) -> Self
18768        where
18769            T: std::convert::Into<wkt::FieldMask>,
18770        {
18771            self.0.request.update_mask = std::option::Option::Some(v.into());
18772            self
18773        }
18774
18775        /// Sets or clears the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
18776        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18777        where
18778            T: std::convert::Into<wkt::FieldMask>,
18779        {
18780            self.0.request.update_mask = v.map(|x| x.into());
18781            self
18782        }
18783
18784        /// Sets the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
18785        ///
18786        /// This is a **required** field for requests.
18787        pub fn set_url_list<T>(mut self, v: T) -> Self
18788        where
18789            T: std::convert::Into<crate::model::UrlList>,
18790        {
18791            self.0.request.url_list = std::option::Option::Some(v.into());
18792            self
18793        }
18794
18795        /// Sets or clears the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
18796        ///
18797        /// This is a **required** field for requests.
18798        pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
18799        where
18800            T: std::convert::Into<crate::model::UrlList>,
18801        {
18802            self.0.request.url_list = v.map(|x| x.into());
18803            self
18804        }
18805    }
18806
18807    #[doc(hidden)]
18808    impl crate::RequestBuilder for UpdateUrlList {
18809        fn request_options(&mut self) -> &mut crate::RequestOptions {
18810            &mut self.0.options
18811        }
18812    }
18813
18814    /// The request builder for [NetworkSecurity::delete_url_list][crate::client::NetworkSecurity::delete_url_list] calls.
18815    ///
18816    /// # Example
18817    /// ```
18818    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteUrlList;
18819    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18820    /// use google_cloud_lro::Poller;
18821    ///
18822    /// let builder = prepare_request_builder();
18823    /// let response = builder.poller().until_done().await?;
18824    /// # Ok(()) }
18825    ///
18826    /// fn prepare_request_builder() -> DeleteUrlList {
18827    ///   # panic!();
18828    ///   // ... details omitted ...
18829    /// }
18830    /// ```
18831    #[derive(Clone, Debug)]
18832    pub struct DeleteUrlList(RequestBuilder<crate::model::DeleteUrlListRequest>);
18833
18834    impl DeleteUrlList {
18835        pub(crate) fn new(
18836            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18837        ) -> Self {
18838            Self(RequestBuilder::new(stub))
18839        }
18840
18841        /// Sets the full request, replacing any prior values.
18842        pub fn with_request<V: Into<crate::model::DeleteUrlListRequest>>(mut self, v: V) -> Self {
18843            self.0.request = v.into();
18844            self
18845        }
18846
18847        /// Sets all the options, replacing any prior values.
18848        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18849            self.0.options = v.into();
18850            self
18851        }
18852
18853        /// Sends the request.
18854        ///
18855        /// # Long running operations
18856        ///
18857        /// This starts, but does not poll, a longrunning operation. More information
18858        /// on [delete_url_list][crate::client::NetworkSecurity::delete_url_list].
18859        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18860            (*self.0.stub)
18861                .delete_url_list(self.0.request, self.0.options)
18862                .await
18863                .map(crate::Response::into_body)
18864        }
18865
18866        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_url_list`.
18867        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18868            type Operation =
18869                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18870            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18871            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18872            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
18873            if let Some(ref mut details) = poller_options.tracing {
18874                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_url_list::until_done";
18875            }
18876
18877            let stub = self.0.stub.clone();
18878            let mut options = self.0.options.clone();
18879            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18880            let query = move |name| {
18881                let stub = stub.clone();
18882                let options = options.clone();
18883                async {
18884                    let op = GetOperation::new(stub)
18885                        .set_name(name)
18886                        .with_options(options)
18887                        .send()
18888                        .await?;
18889                    Ok(Operation::new(op))
18890                }
18891            };
18892
18893            let start = move || async {
18894                let op = self.send().await?;
18895                Ok(Operation::new(op))
18896            };
18897
18898            use google_cloud_lro::internal::PollerExt;
18899            {
18900                google_cloud_lro::internal::new_unit_response_poller(
18901                    polling_error_policy,
18902                    polling_backoff_policy,
18903                    start,
18904                    query,
18905                )
18906            }
18907            .with_options(poller_options)
18908        }
18909
18910        /// Sets the value of [name][crate::model::DeleteUrlListRequest::name].
18911        ///
18912        /// This is a **required** field for requests.
18913        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18914            self.0.request.name = v.into();
18915            self
18916        }
18917    }
18918
18919    #[doc(hidden)]
18920    impl crate::RequestBuilder for DeleteUrlList {
18921        fn request_options(&mut self) -> &mut crate::RequestOptions {
18922            &mut self.0.options
18923        }
18924    }
18925
18926    /// The request builder for [NetworkSecurity::list_tls_inspection_policies][crate::client::NetworkSecurity::list_tls_inspection_policies] calls.
18927    ///
18928    /// # Example
18929    /// ```
18930    /// # use google_cloud_networksecurity_v1::builder::network_security::ListTlsInspectionPolicies;
18931    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18932    /// use google_cloud_gax::paginator::ItemPaginator;
18933    ///
18934    /// let builder = prepare_request_builder();
18935    /// let mut items = builder.by_item();
18936    /// while let Some(result) = items.next().await {
18937    ///   let item = result?;
18938    /// }
18939    /// # Ok(()) }
18940    ///
18941    /// fn prepare_request_builder() -> ListTlsInspectionPolicies {
18942    ///   # panic!();
18943    ///   // ... details omitted ...
18944    /// }
18945    /// ```
18946    #[derive(Clone, Debug)]
18947    pub struct ListTlsInspectionPolicies(
18948        RequestBuilder<crate::model::ListTlsInspectionPoliciesRequest>,
18949    );
18950
18951    impl ListTlsInspectionPolicies {
18952        pub(crate) fn new(
18953            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18954        ) -> Self {
18955            Self(RequestBuilder::new(stub))
18956        }
18957
18958        /// Sets the full request, replacing any prior values.
18959        pub fn with_request<V: Into<crate::model::ListTlsInspectionPoliciesRequest>>(
18960            mut self,
18961            v: V,
18962        ) -> Self {
18963            self.0.request = v.into();
18964            self
18965        }
18966
18967        /// Sets all the options, replacing any prior values.
18968        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18969            self.0.options = v.into();
18970            self
18971        }
18972
18973        /// Sends the request.
18974        pub async fn send(self) -> Result<crate::model::ListTlsInspectionPoliciesResponse> {
18975            (*self.0.stub)
18976                .list_tls_inspection_policies(self.0.request, self.0.options)
18977                .await
18978                .map(crate::Response::into_body)
18979        }
18980
18981        /// Streams each page in the collection.
18982        pub fn by_page(
18983            self,
18984        ) -> impl google_cloud_gax::paginator::Paginator<
18985            crate::model::ListTlsInspectionPoliciesResponse,
18986            crate::Error,
18987        > {
18988            use std::clone::Clone;
18989            let token = self.0.request.page_token.clone();
18990            let execute = move |token: String| {
18991                let mut builder = self.clone();
18992                builder.0.request = builder.0.request.set_page_token(token);
18993                builder.send()
18994            };
18995            google_cloud_gax::paginator::internal::new_paginator(token, execute)
18996        }
18997
18998        /// Streams each item in the collection.
18999        pub fn by_item(
19000            self,
19001        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19002            crate::model::ListTlsInspectionPoliciesResponse,
19003            crate::Error,
19004        > {
19005            use google_cloud_gax::paginator::Paginator;
19006            self.by_page().items()
19007        }
19008
19009        /// Sets the value of [parent][crate::model::ListTlsInspectionPoliciesRequest::parent].
19010        ///
19011        /// This is a **required** field for requests.
19012        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19013            self.0.request.parent = v.into();
19014            self
19015        }
19016
19017        /// Sets the value of [page_size][crate::model::ListTlsInspectionPoliciesRequest::page_size].
19018        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19019            self.0.request.page_size = v.into();
19020            self
19021        }
19022
19023        /// Sets the value of [page_token][crate::model::ListTlsInspectionPoliciesRequest::page_token].
19024        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19025            self.0.request.page_token = v.into();
19026            self
19027        }
19028    }
19029
19030    #[doc(hidden)]
19031    impl crate::RequestBuilder for ListTlsInspectionPolicies {
19032        fn request_options(&mut self) -> &mut crate::RequestOptions {
19033            &mut self.0.options
19034        }
19035    }
19036
19037    /// The request builder for [NetworkSecurity::get_tls_inspection_policy][crate::client::NetworkSecurity::get_tls_inspection_policy] calls.
19038    ///
19039    /// # Example
19040    /// ```
19041    /// # use google_cloud_networksecurity_v1::builder::network_security::GetTlsInspectionPolicy;
19042    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19043    ///
19044    /// let builder = prepare_request_builder();
19045    /// let response = builder.send().await?;
19046    /// # Ok(()) }
19047    ///
19048    /// fn prepare_request_builder() -> GetTlsInspectionPolicy {
19049    ///   # panic!();
19050    ///   // ... details omitted ...
19051    /// }
19052    /// ```
19053    #[derive(Clone, Debug)]
19054    pub struct GetTlsInspectionPolicy(RequestBuilder<crate::model::GetTlsInspectionPolicyRequest>);
19055
19056    impl GetTlsInspectionPolicy {
19057        pub(crate) fn new(
19058            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19059        ) -> Self {
19060            Self(RequestBuilder::new(stub))
19061        }
19062
19063        /// Sets the full request, replacing any prior values.
19064        pub fn with_request<V: Into<crate::model::GetTlsInspectionPolicyRequest>>(
19065            mut self,
19066            v: V,
19067        ) -> Self {
19068            self.0.request = v.into();
19069            self
19070        }
19071
19072        /// Sets all the options, replacing any prior values.
19073        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19074            self.0.options = v.into();
19075            self
19076        }
19077
19078        /// Sends the request.
19079        pub async fn send(self) -> Result<crate::model::TlsInspectionPolicy> {
19080            (*self.0.stub)
19081                .get_tls_inspection_policy(self.0.request, self.0.options)
19082                .await
19083                .map(crate::Response::into_body)
19084        }
19085
19086        /// Sets the value of [name][crate::model::GetTlsInspectionPolicyRequest::name].
19087        ///
19088        /// This is a **required** field for requests.
19089        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19090            self.0.request.name = v.into();
19091            self
19092        }
19093    }
19094
19095    #[doc(hidden)]
19096    impl crate::RequestBuilder for GetTlsInspectionPolicy {
19097        fn request_options(&mut self) -> &mut crate::RequestOptions {
19098            &mut self.0.options
19099        }
19100    }
19101
19102    /// The request builder for [NetworkSecurity::create_tls_inspection_policy][crate::client::NetworkSecurity::create_tls_inspection_policy] calls.
19103    ///
19104    /// # Example
19105    /// ```
19106    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateTlsInspectionPolicy;
19107    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19108    /// use google_cloud_lro::Poller;
19109    ///
19110    /// let builder = prepare_request_builder();
19111    /// let response = builder.poller().until_done().await?;
19112    /// # Ok(()) }
19113    ///
19114    /// fn prepare_request_builder() -> CreateTlsInspectionPolicy {
19115    ///   # panic!();
19116    ///   // ... details omitted ...
19117    /// }
19118    /// ```
19119    #[derive(Clone, Debug)]
19120    pub struct CreateTlsInspectionPolicy(
19121        RequestBuilder<crate::model::CreateTlsInspectionPolicyRequest>,
19122    );
19123
19124    impl CreateTlsInspectionPolicy {
19125        pub(crate) fn new(
19126            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19127        ) -> Self {
19128            Self(RequestBuilder::new(stub))
19129        }
19130
19131        /// Sets the full request, replacing any prior values.
19132        pub fn with_request<V: Into<crate::model::CreateTlsInspectionPolicyRequest>>(
19133            mut self,
19134            v: V,
19135        ) -> Self {
19136            self.0.request = v.into();
19137            self
19138        }
19139
19140        /// Sets all the options, replacing any prior values.
19141        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19142            self.0.options = v.into();
19143            self
19144        }
19145
19146        /// Sends the request.
19147        ///
19148        /// # Long running operations
19149        ///
19150        /// This starts, but does not poll, a longrunning operation. More information
19151        /// on [create_tls_inspection_policy][crate::client::NetworkSecurity::create_tls_inspection_policy].
19152        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19153            (*self.0.stub)
19154                .create_tls_inspection_policy(self.0.request, self.0.options)
19155                .await
19156                .map(crate::Response::into_body)
19157        }
19158
19159        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_tls_inspection_policy`.
19160        pub fn poller(
19161            self,
19162        ) -> impl google_cloud_lro::Poller<
19163            crate::model::TlsInspectionPolicy,
19164            crate::model::OperationMetadata,
19165        > {
19166            type Operation = google_cloud_lro::internal::Operation<
19167                crate::model::TlsInspectionPolicy,
19168                crate::model::OperationMetadata,
19169            >;
19170            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19171            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19172            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
19173            if let Some(ref mut details) = poller_options.tracing {
19174                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_tls_inspection_policy::until_done";
19175            }
19176
19177            let stub = self.0.stub.clone();
19178            let mut options = self.0.options.clone();
19179            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19180            let query = move |name| {
19181                let stub = stub.clone();
19182                let options = options.clone();
19183                async {
19184                    let op = GetOperation::new(stub)
19185                        .set_name(name)
19186                        .with_options(options)
19187                        .send()
19188                        .await?;
19189                    Ok(Operation::new(op))
19190                }
19191            };
19192
19193            let start = move || async {
19194                let op = self.send().await?;
19195                Ok(Operation::new(op))
19196            };
19197
19198            use google_cloud_lro::internal::PollerExt;
19199            {
19200                google_cloud_lro::internal::new_poller(
19201                    polling_error_policy,
19202                    polling_backoff_policy,
19203                    start,
19204                    query,
19205                )
19206            }
19207            .with_options(poller_options)
19208        }
19209
19210        /// Sets the value of [parent][crate::model::CreateTlsInspectionPolicyRequest::parent].
19211        ///
19212        /// This is a **required** field for requests.
19213        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19214            self.0.request.parent = v.into();
19215            self
19216        }
19217
19218        /// Sets the value of [tls_inspection_policy_id][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy_id].
19219        ///
19220        /// This is a **required** field for requests.
19221        pub fn set_tls_inspection_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19222            self.0.request.tls_inspection_policy_id = v.into();
19223            self
19224        }
19225
19226        /// Sets the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
19227        ///
19228        /// This is a **required** field for requests.
19229        pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
19230        where
19231            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
19232        {
19233            self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
19234            self
19235        }
19236
19237        /// Sets or clears the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
19238        ///
19239        /// This is a **required** field for requests.
19240        pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
19241        where
19242            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
19243        {
19244            self.0.request.tls_inspection_policy = v.map(|x| x.into());
19245            self
19246        }
19247    }
19248
19249    #[doc(hidden)]
19250    impl crate::RequestBuilder for CreateTlsInspectionPolicy {
19251        fn request_options(&mut self) -> &mut crate::RequestOptions {
19252            &mut self.0.options
19253        }
19254    }
19255
19256    /// The request builder for [NetworkSecurity::update_tls_inspection_policy][crate::client::NetworkSecurity::update_tls_inspection_policy] calls.
19257    ///
19258    /// # Example
19259    /// ```
19260    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateTlsInspectionPolicy;
19261    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19262    /// use google_cloud_lro::Poller;
19263    ///
19264    /// let builder = prepare_request_builder();
19265    /// let response = builder.poller().until_done().await?;
19266    /// # Ok(()) }
19267    ///
19268    /// fn prepare_request_builder() -> UpdateTlsInspectionPolicy {
19269    ///   # panic!();
19270    ///   // ... details omitted ...
19271    /// }
19272    /// ```
19273    #[derive(Clone, Debug)]
19274    pub struct UpdateTlsInspectionPolicy(
19275        RequestBuilder<crate::model::UpdateTlsInspectionPolicyRequest>,
19276    );
19277
19278    impl UpdateTlsInspectionPolicy {
19279        pub(crate) fn new(
19280            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19281        ) -> Self {
19282            Self(RequestBuilder::new(stub))
19283        }
19284
19285        /// Sets the full request, replacing any prior values.
19286        pub fn with_request<V: Into<crate::model::UpdateTlsInspectionPolicyRequest>>(
19287            mut self,
19288            v: V,
19289        ) -> Self {
19290            self.0.request = v.into();
19291            self
19292        }
19293
19294        /// Sets all the options, replacing any prior values.
19295        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19296            self.0.options = v.into();
19297            self
19298        }
19299
19300        /// Sends the request.
19301        ///
19302        /// # Long running operations
19303        ///
19304        /// This starts, but does not poll, a longrunning operation. More information
19305        /// on [update_tls_inspection_policy][crate::client::NetworkSecurity::update_tls_inspection_policy].
19306        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19307            (*self.0.stub)
19308                .update_tls_inspection_policy(self.0.request, self.0.options)
19309                .await
19310                .map(crate::Response::into_body)
19311        }
19312
19313        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_tls_inspection_policy`.
19314        pub fn poller(
19315            self,
19316        ) -> impl google_cloud_lro::Poller<
19317            crate::model::TlsInspectionPolicy,
19318            crate::model::OperationMetadata,
19319        > {
19320            type Operation = google_cloud_lro::internal::Operation<
19321                crate::model::TlsInspectionPolicy,
19322                crate::model::OperationMetadata,
19323            >;
19324            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19325            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19326            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
19327            if let Some(ref mut details) = poller_options.tracing {
19328                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_tls_inspection_policy::until_done";
19329            }
19330
19331            let stub = self.0.stub.clone();
19332            let mut options = self.0.options.clone();
19333            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19334            let query = move |name| {
19335                let stub = stub.clone();
19336                let options = options.clone();
19337                async {
19338                    let op = GetOperation::new(stub)
19339                        .set_name(name)
19340                        .with_options(options)
19341                        .send()
19342                        .await?;
19343                    Ok(Operation::new(op))
19344                }
19345            };
19346
19347            let start = move || async {
19348                let op = self.send().await?;
19349                Ok(Operation::new(op))
19350            };
19351
19352            use google_cloud_lro::internal::PollerExt;
19353            {
19354                google_cloud_lro::internal::new_poller(
19355                    polling_error_policy,
19356                    polling_backoff_policy,
19357                    start,
19358                    query,
19359                )
19360            }
19361            .with_options(poller_options)
19362        }
19363
19364        /// Sets the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
19365        pub fn set_update_mask<T>(mut self, v: T) -> Self
19366        where
19367            T: std::convert::Into<wkt::FieldMask>,
19368        {
19369            self.0.request.update_mask = std::option::Option::Some(v.into());
19370            self
19371        }
19372
19373        /// Sets or clears the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
19374        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19375        where
19376            T: std::convert::Into<wkt::FieldMask>,
19377        {
19378            self.0.request.update_mask = v.map(|x| x.into());
19379            self
19380        }
19381
19382        /// Sets the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
19383        ///
19384        /// This is a **required** field for requests.
19385        pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
19386        where
19387            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
19388        {
19389            self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
19390            self
19391        }
19392
19393        /// Sets or clears the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
19394        ///
19395        /// This is a **required** field for requests.
19396        pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
19397        where
19398            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
19399        {
19400            self.0.request.tls_inspection_policy = v.map(|x| x.into());
19401            self
19402        }
19403    }
19404
19405    #[doc(hidden)]
19406    impl crate::RequestBuilder for UpdateTlsInspectionPolicy {
19407        fn request_options(&mut self) -> &mut crate::RequestOptions {
19408            &mut self.0.options
19409        }
19410    }
19411
19412    /// The request builder for [NetworkSecurity::delete_tls_inspection_policy][crate::client::NetworkSecurity::delete_tls_inspection_policy] calls.
19413    ///
19414    /// # Example
19415    /// ```
19416    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteTlsInspectionPolicy;
19417    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19418    /// use google_cloud_lro::Poller;
19419    ///
19420    /// let builder = prepare_request_builder();
19421    /// let response = builder.poller().until_done().await?;
19422    /// # Ok(()) }
19423    ///
19424    /// fn prepare_request_builder() -> DeleteTlsInspectionPolicy {
19425    ///   # panic!();
19426    ///   // ... details omitted ...
19427    /// }
19428    /// ```
19429    #[derive(Clone, Debug)]
19430    pub struct DeleteTlsInspectionPolicy(
19431        RequestBuilder<crate::model::DeleteTlsInspectionPolicyRequest>,
19432    );
19433
19434    impl DeleteTlsInspectionPolicy {
19435        pub(crate) fn new(
19436            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19437        ) -> Self {
19438            Self(RequestBuilder::new(stub))
19439        }
19440
19441        /// Sets the full request, replacing any prior values.
19442        pub fn with_request<V: Into<crate::model::DeleteTlsInspectionPolicyRequest>>(
19443            mut self,
19444            v: V,
19445        ) -> Self {
19446            self.0.request = v.into();
19447            self
19448        }
19449
19450        /// Sets all the options, replacing any prior values.
19451        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19452            self.0.options = v.into();
19453            self
19454        }
19455
19456        /// Sends the request.
19457        ///
19458        /// # Long running operations
19459        ///
19460        /// This starts, but does not poll, a longrunning operation. More information
19461        /// on [delete_tls_inspection_policy][crate::client::NetworkSecurity::delete_tls_inspection_policy].
19462        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19463            (*self.0.stub)
19464                .delete_tls_inspection_policy(self.0.request, self.0.options)
19465                .await
19466                .map(crate::Response::into_body)
19467        }
19468
19469        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_tls_inspection_policy`.
19470        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
19471            type Operation =
19472                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
19473            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19474            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19475            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
19476            if let Some(ref mut details) = poller_options.tracing {
19477                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_tls_inspection_policy::until_done";
19478            }
19479
19480            let stub = self.0.stub.clone();
19481            let mut options = self.0.options.clone();
19482            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19483            let query = move |name| {
19484                let stub = stub.clone();
19485                let options = options.clone();
19486                async {
19487                    let op = GetOperation::new(stub)
19488                        .set_name(name)
19489                        .with_options(options)
19490                        .send()
19491                        .await?;
19492                    Ok(Operation::new(op))
19493                }
19494            };
19495
19496            let start = move || async {
19497                let op = self.send().await?;
19498                Ok(Operation::new(op))
19499            };
19500
19501            use google_cloud_lro::internal::PollerExt;
19502            {
19503                google_cloud_lro::internal::new_unit_response_poller(
19504                    polling_error_policy,
19505                    polling_backoff_policy,
19506                    start,
19507                    query,
19508                )
19509            }
19510            .with_options(poller_options)
19511        }
19512
19513        /// Sets the value of [name][crate::model::DeleteTlsInspectionPolicyRequest::name].
19514        ///
19515        /// This is a **required** field for requests.
19516        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19517            self.0.request.name = v.into();
19518            self
19519        }
19520
19521        /// Sets the value of [force][crate::model::DeleteTlsInspectionPolicyRequest::force].
19522        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
19523            self.0.request.force = v.into();
19524            self
19525        }
19526    }
19527
19528    #[doc(hidden)]
19529    impl crate::RequestBuilder for DeleteTlsInspectionPolicy {
19530        fn request_options(&mut self) -> &mut crate::RequestOptions {
19531            &mut self.0.options
19532        }
19533    }
19534
19535    /// The request builder for [NetworkSecurity::list_authz_policies][crate::client::NetworkSecurity::list_authz_policies] calls.
19536    ///
19537    /// # Example
19538    /// ```
19539    /// # use google_cloud_networksecurity_v1::builder::network_security::ListAuthzPolicies;
19540    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19541    /// use google_cloud_gax::paginator::ItemPaginator;
19542    ///
19543    /// let builder = prepare_request_builder();
19544    /// let mut items = builder.by_item();
19545    /// while let Some(result) = items.next().await {
19546    ///   let item = result?;
19547    /// }
19548    /// # Ok(()) }
19549    ///
19550    /// fn prepare_request_builder() -> ListAuthzPolicies {
19551    ///   # panic!();
19552    ///   // ... details omitted ...
19553    /// }
19554    /// ```
19555    #[derive(Clone, Debug)]
19556    pub struct ListAuthzPolicies(RequestBuilder<crate::model::ListAuthzPoliciesRequest>);
19557
19558    impl ListAuthzPolicies {
19559        pub(crate) fn new(
19560            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19561        ) -> Self {
19562            Self(RequestBuilder::new(stub))
19563        }
19564
19565        /// Sets the full request, replacing any prior values.
19566        pub fn with_request<V: Into<crate::model::ListAuthzPoliciesRequest>>(
19567            mut self,
19568            v: V,
19569        ) -> Self {
19570            self.0.request = v.into();
19571            self
19572        }
19573
19574        /// Sets all the options, replacing any prior values.
19575        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19576            self.0.options = v.into();
19577            self
19578        }
19579
19580        /// Sends the request.
19581        pub async fn send(self) -> Result<crate::model::ListAuthzPoliciesResponse> {
19582            (*self.0.stub)
19583                .list_authz_policies(self.0.request, self.0.options)
19584                .await
19585                .map(crate::Response::into_body)
19586        }
19587
19588        /// Streams each page in the collection.
19589        pub fn by_page(
19590            self,
19591        ) -> impl google_cloud_gax::paginator::Paginator<
19592            crate::model::ListAuthzPoliciesResponse,
19593            crate::Error,
19594        > {
19595            use std::clone::Clone;
19596            let token = self.0.request.page_token.clone();
19597            let execute = move |token: String| {
19598                let mut builder = self.clone();
19599                builder.0.request = builder.0.request.set_page_token(token);
19600                builder.send()
19601            };
19602            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19603        }
19604
19605        /// Streams each item in the collection.
19606        pub fn by_item(
19607            self,
19608        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19609            crate::model::ListAuthzPoliciesResponse,
19610            crate::Error,
19611        > {
19612            use google_cloud_gax::paginator::Paginator;
19613            self.by_page().items()
19614        }
19615
19616        /// Sets the value of [parent][crate::model::ListAuthzPoliciesRequest::parent].
19617        ///
19618        /// This is a **required** field for requests.
19619        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19620            self.0.request.parent = v.into();
19621            self
19622        }
19623
19624        /// Sets the value of [page_size][crate::model::ListAuthzPoliciesRequest::page_size].
19625        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19626            self.0.request.page_size = v.into();
19627            self
19628        }
19629
19630        /// Sets the value of [page_token][crate::model::ListAuthzPoliciesRequest::page_token].
19631        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19632            self.0.request.page_token = v.into();
19633            self
19634        }
19635
19636        /// Sets the value of [filter][crate::model::ListAuthzPoliciesRequest::filter].
19637        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19638            self.0.request.filter = v.into();
19639            self
19640        }
19641
19642        /// Sets the value of [order_by][crate::model::ListAuthzPoliciesRequest::order_by].
19643        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
19644            self.0.request.order_by = v.into();
19645            self
19646        }
19647    }
19648
19649    #[doc(hidden)]
19650    impl crate::RequestBuilder for ListAuthzPolicies {
19651        fn request_options(&mut self) -> &mut crate::RequestOptions {
19652            &mut self.0.options
19653        }
19654    }
19655
19656    /// The request builder for [NetworkSecurity::get_authz_policy][crate::client::NetworkSecurity::get_authz_policy] calls.
19657    ///
19658    /// # Example
19659    /// ```
19660    /// # use google_cloud_networksecurity_v1::builder::network_security::GetAuthzPolicy;
19661    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19662    ///
19663    /// let builder = prepare_request_builder();
19664    /// let response = builder.send().await?;
19665    /// # Ok(()) }
19666    ///
19667    /// fn prepare_request_builder() -> GetAuthzPolicy {
19668    ///   # panic!();
19669    ///   // ... details omitted ...
19670    /// }
19671    /// ```
19672    #[derive(Clone, Debug)]
19673    pub struct GetAuthzPolicy(RequestBuilder<crate::model::GetAuthzPolicyRequest>);
19674
19675    impl GetAuthzPolicy {
19676        pub(crate) fn new(
19677            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19678        ) -> Self {
19679            Self(RequestBuilder::new(stub))
19680        }
19681
19682        /// Sets the full request, replacing any prior values.
19683        pub fn with_request<V: Into<crate::model::GetAuthzPolicyRequest>>(mut self, v: V) -> Self {
19684            self.0.request = v.into();
19685            self
19686        }
19687
19688        /// Sets all the options, replacing any prior values.
19689        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19690            self.0.options = v.into();
19691            self
19692        }
19693
19694        /// Sends the request.
19695        pub async fn send(self) -> Result<crate::model::AuthzPolicy> {
19696            (*self.0.stub)
19697                .get_authz_policy(self.0.request, self.0.options)
19698                .await
19699                .map(crate::Response::into_body)
19700        }
19701
19702        /// Sets the value of [name][crate::model::GetAuthzPolicyRequest::name].
19703        ///
19704        /// This is a **required** field for requests.
19705        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19706            self.0.request.name = v.into();
19707            self
19708        }
19709    }
19710
19711    #[doc(hidden)]
19712    impl crate::RequestBuilder for GetAuthzPolicy {
19713        fn request_options(&mut self) -> &mut crate::RequestOptions {
19714            &mut self.0.options
19715        }
19716    }
19717
19718    /// The request builder for [NetworkSecurity::create_authz_policy][crate::client::NetworkSecurity::create_authz_policy] calls.
19719    ///
19720    /// # Example
19721    /// ```
19722    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateAuthzPolicy;
19723    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19724    /// use google_cloud_lro::Poller;
19725    ///
19726    /// let builder = prepare_request_builder();
19727    /// let response = builder.poller().until_done().await?;
19728    /// # Ok(()) }
19729    ///
19730    /// fn prepare_request_builder() -> CreateAuthzPolicy {
19731    ///   # panic!();
19732    ///   // ... details omitted ...
19733    /// }
19734    /// ```
19735    #[derive(Clone, Debug)]
19736    pub struct CreateAuthzPolicy(RequestBuilder<crate::model::CreateAuthzPolicyRequest>);
19737
19738    impl CreateAuthzPolicy {
19739        pub(crate) fn new(
19740            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19741        ) -> Self {
19742            Self(RequestBuilder::new(stub))
19743        }
19744
19745        /// Sets the full request, replacing any prior values.
19746        pub fn with_request<V: Into<crate::model::CreateAuthzPolicyRequest>>(
19747            mut self,
19748            v: V,
19749        ) -> Self {
19750            self.0.request = v.into();
19751            self
19752        }
19753
19754        /// Sets all the options, replacing any prior values.
19755        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19756            self.0.options = v.into();
19757            self
19758        }
19759
19760        /// Sends the request.
19761        ///
19762        /// # Long running operations
19763        ///
19764        /// This starts, but does not poll, a longrunning operation. More information
19765        /// on [create_authz_policy][crate::client::NetworkSecurity::create_authz_policy].
19766        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19767            (*self.0.stub)
19768                .create_authz_policy(self.0.request, self.0.options)
19769                .await
19770                .map(crate::Response::into_body)
19771        }
19772
19773        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_authz_policy`.
19774        pub fn poller(
19775            self,
19776        ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
19777        {
19778            type Operation = google_cloud_lro::internal::Operation<
19779                crate::model::AuthzPolicy,
19780                crate::model::OperationMetadata,
19781            >;
19782            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19783            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19784            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
19785            if let Some(ref mut details) = poller_options.tracing {
19786                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::create_authz_policy::until_done";
19787            }
19788
19789            let stub = self.0.stub.clone();
19790            let mut options = self.0.options.clone();
19791            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19792            let query = move |name| {
19793                let stub = stub.clone();
19794                let options = options.clone();
19795                async {
19796                    let op = GetOperation::new(stub)
19797                        .set_name(name)
19798                        .with_options(options)
19799                        .send()
19800                        .await?;
19801                    Ok(Operation::new(op))
19802                }
19803            };
19804
19805            let start = move || async {
19806                let op = self.send().await?;
19807                Ok(Operation::new(op))
19808            };
19809
19810            use google_cloud_lro::internal::PollerExt;
19811            {
19812                google_cloud_lro::internal::new_poller(
19813                    polling_error_policy,
19814                    polling_backoff_policy,
19815                    start,
19816                    query,
19817                )
19818            }
19819            .with_options(poller_options)
19820        }
19821
19822        /// Sets the value of [parent][crate::model::CreateAuthzPolicyRequest::parent].
19823        ///
19824        /// This is a **required** field for requests.
19825        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19826            self.0.request.parent = v.into();
19827            self
19828        }
19829
19830        /// Sets the value of [authz_policy_id][crate::model::CreateAuthzPolicyRequest::authz_policy_id].
19831        ///
19832        /// This is a **required** field for requests.
19833        pub fn set_authz_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19834            self.0.request.authz_policy_id = v.into();
19835            self
19836        }
19837
19838        /// Sets the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
19839        ///
19840        /// This is a **required** field for requests.
19841        pub fn set_authz_policy<T>(mut self, v: T) -> Self
19842        where
19843            T: std::convert::Into<crate::model::AuthzPolicy>,
19844        {
19845            self.0.request.authz_policy = std::option::Option::Some(v.into());
19846            self
19847        }
19848
19849        /// Sets or clears the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
19850        ///
19851        /// This is a **required** field for requests.
19852        pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
19853        where
19854            T: std::convert::Into<crate::model::AuthzPolicy>,
19855        {
19856            self.0.request.authz_policy = v.map(|x| x.into());
19857            self
19858        }
19859
19860        /// Sets the value of [request_id][crate::model::CreateAuthzPolicyRequest::request_id].
19861        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19862            self.0.request.request_id = v.into();
19863            self
19864        }
19865    }
19866
19867    #[doc(hidden)]
19868    impl crate::RequestBuilder for CreateAuthzPolicy {
19869        fn request_options(&mut self) -> &mut crate::RequestOptions {
19870            &mut self.0.options
19871        }
19872    }
19873
19874    /// The request builder for [NetworkSecurity::update_authz_policy][crate::client::NetworkSecurity::update_authz_policy] calls.
19875    ///
19876    /// # Example
19877    /// ```
19878    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateAuthzPolicy;
19879    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19880    /// use google_cloud_lro::Poller;
19881    ///
19882    /// let builder = prepare_request_builder();
19883    /// let response = builder.poller().until_done().await?;
19884    /// # Ok(()) }
19885    ///
19886    /// fn prepare_request_builder() -> UpdateAuthzPolicy {
19887    ///   # panic!();
19888    ///   // ... details omitted ...
19889    /// }
19890    /// ```
19891    #[derive(Clone, Debug)]
19892    pub struct UpdateAuthzPolicy(RequestBuilder<crate::model::UpdateAuthzPolicyRequest>);
19893
19894    impl UpdateAuthzPolicy {
19895        pub(crate) fn new(
19896            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19897        ) -> Self {
19898            Self(RequestBuilder::new(stub))
19899        }
19900
19901        /// Sets the full request, replacing any prior values.
19902        pub fn with_request<V: Into<crate::model::UpdateAuthzPolicyRequest>>(
19903            mut self,
19904            v: V,
19905        ) -> Self {
19906            self.0.request = v.into();
19907            self
19908        }
19909
19910        /// Sets all the options, replacing any prior values.
19911        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19912            self.0.options = v.into();
19913            self
19914        }
19915
19916        /// Sends the request.
19917        ///
19918        /// # Long running operations
19919        ///
19920        /// This starts, but does not poll, a longrunning operation. More information
19921        /// on [update_authz_policy][crate::client::NetworkSecurity::update_authz_policy].
19922        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19923            (*self.0.stub)
19924                .update_authz_policy(self.0.request, self.0.options)
19925                .await
19926                .map(crate::Response::into_body)
19927        }
19928
19929        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_authz_policy`.
19930        pub fn poller(
19931            self,
19932        ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
19933        {
19934            type Operation = google_cloud_lro::internal::Operation<
19935                crate::model::AuthzPolicy,
19936                crate::model::OperationMetadata,
19937            >;
19938            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19939            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19940            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
19941            if let Some(ref mut details) = poller_options.tracing {
19942                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::update_authz_policy::until_done";
19943            }
19944
19945            let stub = self.0.stub.clone();
19946            let mut options = self.0.options.clone();
19947            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19948            let query = move |name| {
19949                let stub = stub.clone();
19950                let options = options.clone();
19951                async {
19952                    let op = GetOperation::new(stub)
19953                        .set_name(name)
19954                        .with_options(options)
19955                        .send()
19956                        .await?;
19957                    Ok(Operation::new(op))
19958                }
19959            };
19960
19961            let start = move || async {
19962                let op = self.send().await?;
19963                Ok(Operation::new(op))
19964            };
19965
19966            use google_cloud_lro::internal::PollerExt;
19967            {
19968                google_cloud_lro::internal::new_poller(
19969                    polling_error_policy,
19970                    polling_backoff_policy,
19971                    start,
19972                    query,
19973                )
19974            }
19975            .with_options(poller_options)
19976        }
19977
19978        /// Sets the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
19979        ///
19980        /// This is a **required** field for requests.
19981        pub fn set_update_mask<T>(mut self, v: T) -> Self
19982        where
19983            T: std::convert::Into<wkt::FieldMask>,
19984        {
19985            self.0.request.update_mask = std::option::Option::Some(v.into());
19986            self
19987        }
19988
19989        /// Sets or clears the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
19990        ///
19991        /// This is a **required** field for requests.
19992        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19993        where
19994            T: std::convert::Into<wkt::FieldMask>,
19995        {
19996            self.0.request.update_mask = v.map(|x| x.into());
19997            self
19998        }
19999
20000        /// Sets the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
20001        ///
20002        /// This is a **required** field for requests.
20003        pub fn set_authz_policy<T>(mut self, v: T) -> Self
20004        where
20005            T: std::convert::Into<crate::model::AuthzPolicy>,
20006        {
20007            self.0.request.authz_policy = std::option::Option::Some(v.into());
20008            self
20009        }
20010
20011        /// Sets or clears the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
20012        ///
20013        /// This is a **required** field for requests.
20014        pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
20015        where
20016            T: std::convert::Into<crate::model::AuthzPolicy>,
20017        {
20018            self.0.request.authz_policy = v.map(|x| x.into());
20019            self
20020        }
20021
20022        /// Sets the value of [request_id][crate::model::UpdateAuthzPolicyRequest::request_id].
20023        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
20024            self.0.request.request_id = v.into();
20025            self
20026        }
20027    }
20028
20029    #[doc(hidden)]
20030    impl crate::RequestBuilder for UpdateAuthzPolicy {
20031        fn request_options(&mut self) -> &mut crate::RequestOptions {
20032            &mut self.0.options
20033        }
20034    }
20035
20036    /// The request builder for [NetworkSecurity::delete_authz_policy][crate::client::NetworkSecurity::delete_authz_policy] calls.
20037    ///
20038    /// # Example
20039    /// ```
20040    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteAuthzPolicy;
20041    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20042    /// use google_cloud_lro::Poller;
20043    ///
20044    /// let builder = prepare_request_builder();
20045    /// let response = builder.poller().until_done().await?;
20046    /// # Ok(()) }
20047    ///
20048    /// fn prepare_request_builder() -> DeleteAuthzPolicy {
20049    ///   # panic!();
20050    ///   // ... details omitted ...
20051    /// }
20052    /// ```
20053    #[derive(Clone, Debug)]
20054    pub struct DeleteAuthzPolicy(RequestBuilder<crate::model::DeleteAuthzPolicyRequest>);
20055
20056    impl DeleteAuthzPolicy {
20057        pub(crate) fn new(
20058            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20059        ) -> Self {
20060            Self(RequestBuilder::new(stub))
20061        }
20062
20063        /// Sets the full request, replacing any prior values.
20064        pub fn with_request<V: Into<crate::model::DeleteAuthzPolicyRequest>>(
20065            mut self,
20066            v: V,
20067        ) -> Self {
20068            self.0.request = v.into();
20069            self
20070        }
20071
20072        /// Sets all the options, replacing any prior values.
20073        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20074            self.0.options = v.into();
20075            self
20076        }
20077
20078        /// Sends the request.
20079        ///
20080        /// # Long running operations
20081        ///
20082        /// This starts, but does not poll, a longrunning operation. More information
20083        /// on [delete_authz_policy][crate::client::NetworkSecurity::delete_authz_policy].
20084        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20085            (*self.0.stub)
20086                .delete_authz_policy(self.0.request, self.0.options)
20087                .await
20088                .map(crate::Response::into_body)
20089        }
20090
20091        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_authz_policy`.
20092        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
20093            type Operation =
20094                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
20095            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20096            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20097            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
20098            if let Some(ref mut details) = poller_options.tracing {
20099                details.method_name = "google_cloud_networksecurity_v1::client::NetworkSecurity::delete_authz_policy::until_done";
20100            }
20101
20102            let stub = self.0.stub.clone();
20103            let mut options = self.0.options.clone();
20104            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20105            let query = move |name| {
20106                let stub = stub.clone();
20107                let options = options.clone();
20108                async {
20109                    let op = GetOperation::new(stub)
20110                        .set_name(name)
20111                        .with_options(options)
20112                        .send()
20113                        .await?;
20114                    Ok(Operation::new(op))
20115                }
20116            };
20117
20118            let start = move || async {
20119                let op = self.send().await?;
20120                Ok(Operation::new(op))
20121            };
20122
20123            use google_cloud_lro::internal::PollerExt;
20124            {
20125                google_cloud_lro::internal::new_unit_response_poller(
20126                    polling_error_policy,
20127                    polling_backoff_policy,
20128                    start,
20129                    query,
20130                )
20131            }
20132            .with_options(poller_options)
20133        }
20134
20135        /// Sets the value of [name][crate::model::DeleteAuthzPolicyRequest::name].
20136        ///
20137        /// This is a **required** field for requests.
20138        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20139            self.0.request.name = v.into();
20140            self
20141        }
20142
20143        /// Sets the value of [request_id][crate::model::DeleteAuthzPolicyRequest::request_id].
20144        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
20145            self.0.request.request_id = v.into();
20146            self
20147        }
20148    }
20149
20150    #[doc(hidden)]
20151    impl crate::RequestBuilder for DeleteAuthzPolicy {
20152        fn request_options(&mut self) -> &mut crate::RequestOptions {
20153            &mut self.0.options
20154        }
20155    }
20156
20157    /// The request builder for [NetworkSecurity::list_locations][crate::client::NetworkSecurity::list_locations] calls.
20158    ///
20159    /// # Example
20160    /// ```
20161    /// # use google_cloud_networksecurity_v1::builder::network_security::ListLocations;
20162    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20163    /// use google_cloud_gax::paginator::ItemPaginator;
20164    ///
20165    /// let builder = prepare_request_builder();
20166    /// let mut items = builder.by_item();
20167    /// while let Some(result) = items.next().await {
20168    ///   let item = result?;
20169    /// }
20170    /// # Ok(()) }
20171    ///
20172    /// fn prepare_request_builder() -> ListLocations {
20173    ///   # panic!();
20174    ///   // ... details omitted ...
20175    /// }
20176    /// ```
20177    #[derive(Clone, Debug)]
20178    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
20179
20180    impl ListLocations {
20181        pub(crate) fn new(
20182            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20183        ) -> Self {
20184            Self(RequestBuilder::new(stub))
20185        }
20186
20187        /// Sets the full request, replacing any prior values.
20188        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
20189            mut self,
20190            v: V,
20191        ) -> Self {
20192            self.0.request = v.into();
20193            self
20194        }
20195
20196        /// Sets all the options, replacing any prior values.
20197        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20198            self.0.options = v.into();
20199            self
20200        }
20201
20202        /// Sends the request.
20203        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
20204            (*self.0.stub)
20205                .list_locations(self.0.request, self.0.options)
20206                .await
20207                .map(crate::Response::into_body)
20208        }
20209
20210        /// Streams each page in the collection.
20211        pub fn by_page(
20212            self,
20213        ) -> impl google_cloud_gax::paginator::Paginator<
20214            google_cloud_location::model::ListLocationsResponse,
20215            crate::Error,
20216        > {
20217            use std::clone::Clone;
20218            let token = self.0.request.page_token.clone();
20219            let execute = move |token: String| {
20220                let mut builder = self.clone();
20221                builder.0.request = builder.0.request.set_page_token(token);
20222                builder.send()
20223            };
20224            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20225        }
20226
20227        /// Streams each item in the collection.
20228        pub fn by_item(
20229            self,
20230        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20231            google_cloud_location::model::ListLocationsResponse,
20232            crate::Error,
20233        > {
20234            use google_cloud_gax::paginator::Paginator;
20235            self.by_page().items()
20236        }
20237
20238        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
20239        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20240            self.0.request.name = v.into();
20241            self
20242        }
20243
20244        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
20245        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20246            self.0.request.filter = v.into();
20247            self
20248        }
20249
20250        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
20251        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20252            self.0.request.page_size = v.into();
20253            self
20254        }
20255
20256        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
20257        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20258            self.0.request.page_token = v.into();
20259            self
20260        }
20261    }
20262
20263    #[doc(hidden)]
20264    impl crate::RequestBuilder for ListLocations {
20265        fn request_options(&mut self) -> &mut crate::RequestOptions {
20266            &mut self.0.options
20267        }
20268    }
20269
20270    /// The request builder for [NetworkSecurity::get_location][crate::client::NetworkSecurity::get_location] calls.
20271    ///
20272    /// # Example
20273    /// ```
20274    /// # use google_cloud_networksecurity_v1::builder::network_security::GetLocation;
20275    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20276    ///
20277    /// let builder = prepare_request_builder();
20278    /// let response = builder.send().await?;
20279    /// # Ok(()) }
20280    ///
20281    /// fn prepare_request_builder() -> GetLocation {
20282    ///   # panic!();
20283    ///   // ... details omitted ...
20284    /// }
20285    /// ```
20286    #[derive(Clone, Debug)]
20287    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
20288
20289    impl GetLocation {
20290        pub(crate) fn new(
20291            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20292        ) -> Self {
20293            Self(RequestBuilder::new(stub))
20294        }
20295
20296        /// Sets the full request, replacing any prior values.
20297        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
20298            mut self,
20299            v: V,
20300        ) -> Self {
20301            self.0.request = v.into();
20302            self
20303        }
20304
20305        /// Sets all the options, replacing any prior values.
20306        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20307            self.0.options = v.into();
20308            self
20309        }
20310
20311        /// Sends the request.
20312        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
20313            (*self.0.stub)
20314                .get_location(self.0.request, self.0.options)
20315                .await
20316                .map(crate::Response::into_body)
20317        }
20318
20319        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
20320        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20321            self.0.request.name = v.into();
20322            self
20323        }
20324    }
20325
20326    #[doc(hidden)]
20327    impl crate::RequestBuilder for GetLocation {
20328        fn request_options(&mut self) -> &mut crate::RequestOptions {
20329            &mut self.0.options
20330        }
20331    }
20332
20333    /// The request builder for [NetworkSecurity::set_iam_policy][crate::client::NetworkSecurity::set_iam_policy] calls.
20334    ///
20335    /// # Example
20336    /// ```
20337    /// # use google_cloud_networksecurity_v1::builder::network_security::SetIamPolicy;
20338    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20339    ///
20340    /// let builder = prepare_request_builder();
20341    /// let response = builder.send().await?;
20342    /// # Ok(()) }
20343    ///
20344    /// fn prepare_request_builder() -> SetIamPolicy {
20345    ///   # panic!();
20346    ///   // ... details omitted ...
20347    /// }
20348    /// ```
20349    #[derive(Clone, Debug)]
20350    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
20351
20352    impl SetIamPolicy {
20353        pub(crate) fn new(
20354            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20355        ) -> Self {
20356            Self(RequestBuilder::new(stub))
20357        }
20358
20359        /// Sets the full request, replacing any prior values.
20360        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
20361            mut self,
20362            v: V,
20363        ) -> Self {
20364            self.0.request = v.into();
20365            self
20366        }
20367
20368        /// Sets all the options, replacing any prior values.
20369        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20370            self.0.options = v.into();
20371            self
20372        }
20373
20374        /// Sends the request.
20375        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
20376            (*self.0.stub)
20377                .set_iam_policy(self.0.request, self.0.options)
20378                .await
20379                .map(crate::Response::into_body)
20380        }
20381
20382        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
20383        ///
20384        /// This is a **required** field for requests.
20385        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20386            self.0.request.resource = v.into();
20387            self
20388        }
20389
20390        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
20391        ///
20392        /// This is a **required** field for requests.
20393        pub fn set_policy<T>(mut self, v: T) -> Self
20394        where
20395            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
20396        {
20397            self.0.request.policy = std::option::Option::Some(v.into());
20398            self
20399        }
20400
20401        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
20402        ///
20403        /// This is a **required** field for requests.
20404        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
20405        where
20406            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
20407        {
20408            self.0.request.policy = v.map(|x| x.into());
20409            self
20410        }
20411
20412        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
20413        pub fn set_update_mask<T>(mut self, v: T) -> Self
20414        where
20415            T: std::convert::Into<wkt::FieldMask>,
20416        {
20417            self.0.request.update_mask = std::option::Option::Some(v.into());
20418            self
20419        }
20420
20421        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
20422        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20423        where
20424            T: std::convert::Into<wkt::FieldMask>,
20425        {
20426            self.0.request.update_mask = v.map(|x| x.into());
20427            self
20428        }
20429    }
20430
20431    #[doc(hidden)]
20432    impl crate::RequestBuilder for SetIamPolicy {
20433        fn request_options(&mut self) -> &mut crate::RequestOptions {
20434            &mut self.0.options
20435        }
20436    }
20437
20438    /// The request builder for [NetworkSecurity::get_iam_policy][crate::client::NetworkSecurity::get_iam_policy] calls.
20439    ///
20440    /// # Example
20441    /// ```
20442    /// # use google_cloud_networksecurity_v1::builder::network_security::GetIamPolicy;
20443    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20444    ///
20445    /// let builder = prepare_request_builder();
20446    /// let response = builder.send().await?;
20447    /// # Ok(()) }
20448    ///
20449    /// fn prepare_request_builder() -> GetIamPolicy {
20450    ///   # panic!();
20451    ///   // ... details omitted ...
20452    /// }
20453    /// ```
20454    #[derive(Clone, Debug)]
20455    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
20456
20457    impl GetIamPolicy {
20458        pub(crate) fn new(
20459            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20460        ) -> Self {
20461            Self(RequestBuilder::new(stub))
20462        }
20463
20464        /// Sets the full request, replacing any prior values.
20465        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
20466            mut self,
20467            v: V,
20468        ) -> Self {
20469            self.0.request = v.into();
20470            self
20471        }
20472
20473        /// Sets all the options, replacing any prior values.
20474        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20475            self.0.options = v.into();
20476            self
20477        }
20478
20479        /// Sends the request.
20480        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
20481            (*self.0.stub)
20482                .get_iam_policy(self.0.request, self.0.options)
20483                .await
20484                .map(crate::Response::into_body)
20485        }
20486
20487        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
20488        ///
20489        /// This is a **required** field for requests.
20490        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20491            self.0.request.resource = v.into();
20492            self
20493        }
20494
20495        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
20496        pub fn set_options<T>(mut self, v: T) -> Self
20497        where
20498            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
20499        {
20500            self.0.request.options = std::option::Option::Some(v.into());
20501            self
20502        }
20503
20504        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
20505        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
20506        where
20507            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
20508        {
20509            self.0.request.options = v.map(|x| x.into());
20510            self
20511        }
20512    }
20513
20514    #[doc(hidden)]
20515    impl crate::RequestBuilder for GetIamPolicy {
20516        fn request_options(&mut self) -> &mut crate::RequestOptions {
20517            &mut self.0.options
20518        }
20519    }
20520
20521    /// The request builder for [NetworkSecurity::test_iam_permissions][crate::client::NetworkSecurity::test_iam_permissions] calls.
20522    ///
20523    /// # Example
20524    /// ```
20525    /// # use google_cloud_networksecurity_v1::builder::network_security::TestIamPermissions;
20526    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20527    ///
20528    /// let builder = prepare_request_builder();
20529    /// let response = builder.send().await?;
20530    /// # Ok(()) }
20531    ///
20532    /// fn prepare_request_builder() -> TestIamPermissions {
20533    ///   # panic!();
20534    ///   // ... details omitted ...
20535    /// }
20536    /// ```
20537    #[derive(Clone, Debug)]
20538    pub struct TestIamPermissions(
20539        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
20540    );
20541
20542    impl TestIamPermissions {
20543        pub(crate) fn new(
20544            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20545        ) -> Self {
20546            Self(RequestBuilder::new(stub))
20547        }
20548
20549        /// Sets the full request, replacing any prior values.
20550        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
20551            mut self,
20552            v: V,
20553        ) -> Self {
20554            self.0.request = v.into();
20555            self
20556        }
20557
20558        /// Sets all the options, replacing any prior values.
20559        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20560            self.0.options = v.into();
20561            self
20562        }
20563
20564        /// Sends the request.
20565        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
20566            (*self.0.stub)
20567                .test_iam_permissions(self.0.request, self.0.options)
20568                .await
20569                .map(crate::Response::into_body)
20570        }
20571
20572        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
20573        ///
20574        /// This is a **required** field for requests.
20575        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20576            self.0.request.resource = v.into();
20577            self
20578        }
20579
20580        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
20581        ///
20582        /// This is a **required** field for requests.
20583        pub fn set_permissions<T, V>(mut self, v: T) -> Self
20584        where
20585            T: std::iter::IntoIterator<Item = V>,
20586            V: std::convert::Into<std::string::String>,
20587        {
20588            use std::iter::Iterator;
20589            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
20590            self
20591        }
20592    }
20593
20594    #[doc(hidden)]
20595    impl crate::RequestBuilder for TestIamPermissions {
20596        fn request_options(&mut self) -> &mut crate::RequestOptions {
20597            &mut self.0.options
20598        }
20599    }
20600
20601    /// The request builder for [NetworkSecurity::list_operations][crate::client::NetworkSecurity::list_operations] calls.
20602    ///
20603    /// # Example
20604    /// ```
20605    /// # use google_cloud_networksecurity_v1::builder::network_security::ListOperations;
20606    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20607    /// use google_cloud_gax::paginator::ItemPaginator;
20608    ///
20609    /// let builder = prepare_request_builder();
20610    /// let mut items = builder.by_item();
20611    /// while let Some(result) = items.next().await {
20612    ///   let item = result?;
20613    /// }
20614    /// # Ok(()) }
20615    ///
20616    /// fn prepare_request_builder() -> ListOperations {
20617    ///   # panic!();
20618    ///   // ... details omitted ...
20619    /// }
20620    /// ```
20621    #[derive(Clone, Debug)]
20622    pub struct ListOperations(
20623        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
20624    );
20625
20626    impl ListOperations {
20627        pub(crate) fn new(
20628            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20629        ) -> Self {
20630            Self(RequestBuilder::new(stub))
20631        }
20632
20633        /// Sets the full request, replacing any prior values.
20634        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
20635            mut self,
20636            v: V,
20637        ) -> Self {
20638            self.0.request = v.into();
20639            self
20640        }
20641
20642        /// Sets all the options, replacing any prior values.
20643        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20644            self.0.options = v.into();
20645            self
20646        }
20647
20648        /// Sends the request.
20649        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
20650            (*self.0.stub)
20651                .list_operations(self.0.request, self.0.options)
20652                .await
20653                .map(crate::Response::into_body)
20654        }
20655
20656        /// Streams each page in the collection.
20657        pub fn by_page(
20658            self,
20659        ) -> impl google_cloud_gax::paginator::Paginator<
20660            google_cloud_longrunning::model::ListOperationsResponse,
20661            crate::Error,
20662        > {
20663            use std::clone::Clone;
20664            let token = self.0.request.page_token.clone();
20665            let execute = move |token: String| {
20666                let mut builder = self.clone();
20667                builder.0.request = builder.0.request.set_page_token(token);
20668                builder.send()
20669            };
20670            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20671        }
20672
20673        /// Streams each item in the collection.
20674        pub fn by_item(
20675            self,
20676        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20677            google_cloud_longrunning::model::ListOperationsResponse,
20678            crate::Error,
20679        > {
20680            use google_cloud_gax::paginator::Paginator;
20681            self.by_page().items()
20682        }
20683
20684        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
20685        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20686            self.0.request.name = v.into();
20687            self
20688        }
20689
20690        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
20691        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20692            self.0.request.filter = v.into();
20693            self
20694        }
20695
20696        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
20697        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20698            self.0.request.page_size = v.into();
20699            self
20700        }
20701
20702        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
20703        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20704            self.0.request.page_token = v.into();
20705            self
20706        }
20707
20708        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
20709        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
20710            self.0.request.return_partial_success = v.into();
20711            self
20712        }
20713    }
20714
20715    #[doc(hidden)]
20716    impl crate::RequestBuilder for ListOperations {
20717        fn request_options(&mut self) -> &mut crate::RequestOptions {
20718            &mut self.0.options
20719        }
20720    }
20721
20722    /// The request builder for [NetworkSecurity::get_operation][crate::client::NetworkSecurity::get_operation] calls.
20723    ///
20724    /// # Example
20725    /// ```
20726    /// # use google_cloud_networksecurity_v1::builder::network_security::GetOperation;
20727    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20728    ///
20729    /// let builder = prepare_request_builder();
20730    /// let response = builder.send().await?;
20731    /// # Ok(()) }
20732    ///
20733    /// fn prepare_request_builder() -> GetOperation {
20734    ///   # panic!();
20735    ///   // ... details omitted ...
20736    /// }
20737    /// ```
20738    #[derive(Clone, Debug)]
20739    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
20740
20741    impl GetOperation {
20742        pub(crate) fn new(
20743            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20744        ) -> Self {
20745            Self(RequestBuilder::new(stub))
20746        }
20747
20748        /// Sets the full request, replacing any prior values.
20749        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
20750            mut self,
20751            v: V,
20752        ) -> Self {
20753            self.0.request = v.into();
20754            self
20755        }
20756
20757        /// Sets all the options, replacing any prior values.
20758        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20759            self.0.options = v.into();
20760            self
20761        }
20762
20763        /// Sends the request.
20764        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20765            (*self.0.stub)
20766                .get_operation(self.0.request, self.0.options)
20767                .await
20768                .map(crate::Response::into_body)
20769        }
20770
20771        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
20772        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20773            self.0.request.name = v.into();
20774            self
20775        }
20776    }
20777
20778    #[doc(hidden)]
20779    impl crate::RequestBuilder for GetOperation {
20780        fn request_options(&mut self) -> &mut crate::RequestOptions {
20781            &mut self.0.options
20782        }
20783    }
20784
20785    /// The request builder for [NetworkSecurity::delete_operation][crate::client::NetworkSecurity::delete_operation] calls.
20786    ///
20787    /// # Example
20788    /// ```
20789    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteOperation;
20790    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20791    ///
20792    /// let builder = prepare_request_builder();
20793    /// let response = builder.send().await?;
20794    /// # Ok(()) }
20795    ///
20796    /// fn prepare_request_builder() -> DeleteOperation {
20797    ///   # panic!();
20798    ///   // ... details omitted ...
20799    /// }
20800    /// ```
20801    #[derive(Clone, Debug)]
20802    pub struct DeleteOperation(
20803        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
20804    );
20805
20806    impl DeleteOperation {
20807        pub(crate) fn new(
20808            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20809        ) -> Self {
20810            Self(RequestBuilder::new(stub))
20811        }
20812
20813        /// Sets the full request, replacing any prior values.
20814        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
20815            mut self,
20816            v: V,
20817        ) -> Self {
20818            self.0.request = v.into();
20819            self
20820        }
20821
20822        /// Sets all the options, replacing any prior values.
20823        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20824            self.0.options = v.into();
20825            self
20826        }
20827
20828        /// Sends the request.
20829        pub async fn send(self) -> Result<()> {
20830            (*self.0.stub)
20831                .delete_operation(self.0.request, self.0.options)
20832                .await
20833                .map(crate::Response::into_body)
20834        }
20835
20836        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
20837        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20838            self.0.request.name = v.into();
20839            self
20840        }
20841    }
20842
20843    #[doc(hidden)]
20844    impl crate::RequestBuilder for DeleteOperation {
20845        fn request_options(&mut self) -> &mut crate::RequestOptions {
20846            &mut self.0.options
20847        }
20848    }
20849
20850    /// The request builder for [NetworkSecurity::cancel_operation][crate::client::NetworkSecurity::cancel_operation] calls.
20851    ///
20852    /// # Example
20853    /// ```
20854    /// # use google_cloud_networksecurity_v1::builder::network_security::CancelOperation;
20855    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20856    ///
20857    /// let builder = prepare_request_builder();
20858    /// let response = builder.send().await?;
20859    /// # Ok(()) }
20860    ///
20861    /// fn prepare_request_builder() -> CancelOperation {
20862    ///   # panic!();
20863    ///   // ... details omitted ...
20864    /// }
20865    /// ```
20866    #[derive(Clone, Debug)]
20867    pub struct CancelOperation(
20868        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
20869    );
20870
20871    impl CancelOperation {
20872        pub(crate) fn new(
20873            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20874        ) -> Self {
20875            Self(RequestBuilder::new(stub))
20876        }
20877
20878        /// Sets the full request, replacing any prior values.
20879        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
20880            mut self,
20881            v: V,
20882        ) -> Self {
20883            self.0.request = v.into();
20884            self
20885        }
20886
20887        /// Sets all the options, replacing any prior values.
20888        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20889            self.0.options = v.into();
20890            self
20891        }
20892
20893        /// Sends the request.
20894        pub async fn send(self) -> Result<()> {
20895            (*self.0.stub)
20896                .cancel_operation(self.0.request, self.0.options)
20897                .await
20898                .map(crate::Response::into_body)
20899        }
20900
20901        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
20902        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20903            self.0.request.name = v.into();
20904            self
20905        }
20906    }
20907
20908    #[doc(hidden)]
20909    impl crate::RequestBuilder for CancelOperation {
20910        fn request_options(&mut self) -> &mut crate::RequestOptions {
20911            &mut self.0.options
20912        }
20913    }
20914}
20915
20916/// Request and client builders for [SecurityProfileGroupService][crate::client::SecurityProfileGroupService].
20917pub mod security_profile_group_service {
20918    use crate::Result;
20919
20920    /// A builder for [SecurityProfileGroupService][crate::client::SecurityProfileGroupService].
20921    ///
20922    /// ```
20923    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20924    /// # use google_cloud_networksecurity_v1::*;
20925    /// # use builder::security_profile_group_service::ClientBuilder;
20926    /// # use client::SecurityProfileGroupService;
20927    /// let builder : ClientBuilder = SecurityProfileGroupService::builder();
20928    /// let client = builder
20929    ///     .with_endpoint("https://networksecurity.googleapis.com")
20930    ///     .build().await?;
20931    /// # Ok(()) }
20932    /// ```
20933    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
20934
20935    pub(crate) mod client {
20936        use super::super::super::client::SecurityProfileGroupService;
20937        pub struct Factory;
20938        impl crate::ClientFactory for Factory {
20939            type Client = SecurityProfileGroupService;
20940            type Credentials = gaxi::options::Credentials;
20941            async fn build(
20942                self,
20943                config: gaxi::options::ClientConfig,
20944            ) -> crate::ClientBuilderResult<Self::Client> {
20945                Self::Client::new(config).await
20946            }
20947        }
20948    }
20949
20950    /// Common implementation for [crate::client::SecurityProfileGroupService] request builders.
20951    #[derive(Clone, Debug)]
20952    pub(crate) struct RequestBuilder<R: std::default::Default> {
20953        stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20954        request: R,
20955        options: crate::RequestOptions,
20956    }
20957
20958    impl<R> RequestBuilder<R>
20959    where
20960        R: std::default::Default,
20961    {
20962        pub(crate) fn new(
20963            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20964        ) -> Self {
20965            Self {
20966                stub,
20967                request: R::default(),
20968                options: crate::RequestOptions::default(),
20969            }
20970        }
20971    }
20972
20973    /// The request builder for [SecurityProfileGroupService::list_security_profile_groups][crate::client::SecurityProfileGroupService::list_security_profile_groups] calls.
20974    ///
20975    /// # Example
20976    /// ```
20977    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::ListSecurityProfileGroups;
20978    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20979    /// use google_cloud_gax::paginator::ItemPaginator;
20980    ///
20981    /// let builder = prepare_request_builder();
20982    /// let mut items = builder.by_item();
20983    /// while let Some(result) = items.next().await {
20984    ///   let item = result?;
20985    /// }
20986    /// # Ok(()) }
20987    ///
20988    /// fn prepare_request_builder() -> ListSecurityProfileGroups {
20989    ///   # panic!();
20990    ///   // ... details omitted ...
20991    /// }
20992    /// ```
20993    #[derive(Clone, Debug)]
20994    pub struct ListSecurityProfileGroups(
20995        RequestBuilder<crate::model::ListSecurityProfileGroupsRequest>,
20996    );
20997
20998    impl ListSecurityProfileGroups {
20999        pub(crate) fn new(
21000            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21001        ) -> Self {
21002            Self(RequestBuilder::new(stub))
21003        }
21004
21005        /// Sets the full request, replacing any prior values.
21006        pub fn with_request<V: Into<crate::model::ListSecurityProfileGroupsRequest>>(
21007            mut self,
21008            v: V,
21009        ) -> Self {
21010            self.0.request = v.into();
21011            self
21012        }
21013
21014        /// Sets all the options, replacing any prior values.
21015        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21016            self.0.options = v.into();
21017            self
21018        }
21019
21020        /// Sends the request.
21021        pub async fn send(self) -> Result<crate::model::ListSecurityProfileGroupsResponse> {
21022            (*self.0.stub)
21023                .list_security_profile_groups(self.0.request, self.0.options)
21024                .await
21025                .map(crate::Response::into_body)
21026        }
21027
21028        /// Streams each page in the collection.
21029        pub fn by_page(
21030            self,
21031        ) -> impl google_cloud_gax::paginator::Paginator<
21032            crate::model::ListSecurityProfileGroupsResponse,
21033            crate::Error,
21034        > {
21035            use std::clone::Clone;
21036            let token = self.0.request.page_token.clone();
21037            let execute = move |token: String| {
21038                let mut builder = self.clone();
21039                builder.0.request = builder.0.request.set_page_token(token);
21040                builder.send()
21041            };
21042            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21043        }
21044
21045        /// Streams each item in the collection.
21046        pub fn by_item(
21047            self,
21048        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21049            crate::model::ListSecurityProfileGroupsResponse,
21050            crate::Error,
21051        > {
21052            use google_cloud_gax::paginator::Paginator;
21053            self.by_page().items()
21054        }
21055
21056        /// Sets the value of [parent][crate::model::ListSecurityProfileGroupsRequest::parent].
21057        ///
21058        /// This is a **required** field for requests.
21059        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21060            self.0.request.parent = v.into();
21061            self
21062        }
21063
21064        /// Sets the value of [page_size][crate::model::ListSecurityProfileGroupsRequest::page_size].
21065        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21066            self.0.request.page_size = v.into();
21067            self
21068        }
21069
21070        /// Sets the value of [page_token][crate::model::ListSecurityProfileGroupsRequest::page_token].
21071        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21072            self.0.request.page_token = v.into();
21073            self
21074        }
21075    }
21076
21077    #[doc(hidden)]
21078    impl crate::RequestBuilder for ListSecurityProfileGroups {
21079        fn request_options(&mut self) -> &mut crate::RequestOptions {
21080            &mut self.0.options
21081        }
21082    }
21083
21084    /// The request builder for [SecurityProfileGroupService::get_security_profile_group][crate::client::SecurityProfileGroupService::get_security_profile_group] calls.
21085    ///
21086    /// # Example
21087    /// ```
21088    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::GetSecurityProfileGroup;
21089    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21090    ///
21091    /// let builder = prepare_request_builder();
21092    /// let response = builder.send().await?;
21093    /// # Ok(()) }
21094    ///
21095    /// fn prepare_request_builder() -> GetSecurityProfileGroup {
21096    ///   # panic!();
21097    ///   // ... details omitted ...
21098    /// }
21099    /// ```
21100    #[derive(Clone, Debug)]
21101    pub struct GetSecurityProfileGroup(
21102        RequestBuilder<crate::model::GetSecurityProfileGroupRequest>,
21103    );
21104
21105    impl GetSecurityProfileGroup {
21106        pub(crate) fn new(
21107            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21108        ) -> Self {
21109            Self(RequestBuilder::new(stub))
21110        }
21111
21112        /// Sets the full request, replacing any prior values.
21113        pub fn with_request<V: Into<crate::model::GetSecurityProfileGroupRequest>>(
21114            mut self,
21115            v: V,
21116        ) -> Self {
21117            self.0.request = v.into();
21118            self
21119        }
21120
21121        /// Sets all the options, replacing any prior values.
21122        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21123            self.0.options = v.into();
21124            self
21125        }
21126
21127        /// Sends the request.
21128        pub async fn send(self) -> Result<crate::model::SecurityProfileGroup> {
21129            (*self.0.stub)
21130                .get_security_profile_group(self.0.request, self.0.options)
21131                .await
21132                .map(crate::Response::into_body)
21133        }
21134
21135        /// Sets the value of [name][crate::model::GetSecurityProfileGroupRequest::name].
21136        ///
21137        /// This is a **required** field for requests.
21138        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21139            self.0.request.name = v.into();
21140            self
21141        }
21142    }
21143
21144    #[doc(hidden)]
21145    impl crate::RequestBuilder for GetSecurityProfileGroup {
21146        fn request_options(&mut self) -> &mut crate::RequestOptions {
21147            &mut self.0.options
21148        }
21149    }
21150
21151    /// The request builder for [SecurityProfileGroupService::create_security_profile_group][crate::client::SecurityProfileGroupService::create_security_profile_group] calls.
21152    ///
21153    /// # Example
21154    /// ```
21155    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::CreateSecurityProfileGroup;
21156    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21157    /// use google_cloud_lro::Poller;
21158    ///
21159    /// let builder = prepare_request_builder();
21160    /// let response = builder.poller().until_done().await?;
21161    /// # Ok(()) }
21162    ///
21163    /// fn prepare_request_builder() -> CreateSecurityProfileGroup {
21164    ///   # panic!();
21165    ///   // ... details omitted ...
21166    /// }
21167    /// ```
21168    #[derive(Clone, Debug)]
21169    pub struct CreateSecurityProfileGroup(
21170        RequestBuilder<crate::model::CreateSecurityProfileGroupRequest>,
21171    );
21172
21173    impl CreateSecurityProfileGroup {
21174        pub(crate) fn new(
21175            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21176        ) -> Self {
21177            Self(RequestBuilder::new(stub))
21178        }
21179
21180        /// Sets the full request, replacing any prior values.
21181        pub fn with_request<V: Into<crate::model::CreateSecurityProfileGroupRequest>>(
21182            mut self,
21183            v: V,
21184        ) -> Self {
21185            self.0.request = v.into();
21186            self
21187        }
21188
21189        /// Sets all the options, replacing any prior values.
21190        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21191            self.0.options = v.into();
21192            self
21193        }
21194
21195        /// Sends the request.
21196        ///
21197        /// # Long running operations
21198        ///
21199        /// This starts, but does not poll, a longrunning operation. More information
21200        /// on [create_security_profile_group][crate::client::SecurityProfileGroupService::create_security_profile_group].
21201        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21202            (*self.0.stub)
21203                .create_security_profile_group(self.0.request, self.0.options)
21204                .await
21205                .map(crate::Response::into_body)
21206        }
21207
21208        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_security_profile_group`.
21209        pub fn poller(
21210            self,
21211        ) -> impl google_cloud_lro::Poller<
21212            crate::model::SecurityProfileGroup,
21213            crate::model::OperationMetadata,
21214        > {
21215            type Operation = google_cloud_lro::internal::Operation<
21216                crate::model::SecurityProfileGroup,
21217                crate::model::OperationMetadata,
21218            >;
21219            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21220            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21221            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
21222            if let Some(ref mut details) = poller_options.tracing {
21223                details.method_name = "google_cloud_networksecurity_v1::client::SecurityProfileGroupService::create_security_profile_group::until_done";
21224            }
21225
21226            let stub = self.0.stub.clone();
21227            let mut options = self.0.options.clone();
21228            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21229            let query = move |name| {
21230                let stub = stub.clone();
21231                let options = options.clone();
21232                async {
21233                    let op = GetOperation::new(stub)
21234                        .set_name(name)
21235                        .with_options(options)
21236                        .send()
21237                        .await?;
21238                    Ok(Operation::new(op))
21239                }
21240            };
21241
21242            let start = move || async {
21243                let op = self.send().await?;
21244                Ok(Operation::new(op))
21245            };
21246
21247            use google_cloud_lro::internal::PollerExt;
21248            {
21249                google_cloud_lro::internal::new_poller(
21250                    polling_error_policy,
21251                    polling_backoff_policy,
21252                    start,
21253                    query,
21254                )
21255            }
21256            .with_options(poller_options)
21257        }
21258
21259        /// Sets the value of [parent][crate::model::CreateSecurityProfileGroupRequest::parent].
21260        ///
21261        /// This is a **required** field for requests.
21262        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21263            self.0.request.parent = v.into();
21264            self
21265        }
21266
21267        /// Sets the value of [security_profile_group_id][crate::model::CreateSecurityProfileGroupRequest::security_profile_group_id].
21268        ///
21269        /// This is a **required** field for requests.
21270        pub fn set_security_profile_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
21271            self.0.request.security_profile_group_id = v.into();
21272            self
21273        }
21274
21275        /// Sets the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
21276        ///
21277        /// This is a **required** field for requests.
21278        pub fn set_security_profile_group<T>(mut self, v: T) -> Self
21279        where
21280            T: std::convert::Into<crate::model::SecurityProfileGroup>,
21281        {
21282            self.0.request.security_profile_group = std::option::Option::Some(v.into());
21283            self
21284        }
21285
21286        /// Sets or clears the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
21287        ///
21288        /// This is a **required** field for requests.
21289        pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
21290        where
21291            T: std::convert::Into<crate::model::SecurityProfileGroup>,
21292        {
21293            self.0.request.security_profile_group = v.map(|x| x.into());
21294            self
21295        }
21296    }
21297
21298    #[doc(hidden)]
21299    impl crate::RequestBuilder for CreateSecurityProfileGroup {
21300        fn request_options(&mut self) -> &mut crate::RequestOptions {
21301            &mut self.0.options
21302        }
21303    }
21304
21305    /// The request builder for [SecurityProfileGroupService::update_security_profile_group][crate::client::SecurityProfileGroupService::update_security_profile_group] calls.
21306    ///
21307    /// # Example
21308    /// ```
21309    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::UpdateSecurityProfileGroup;
21310    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21311    /// use google_cloud_lro::Poller;
21312    ///
21313    /// let builder = prepare_request_builder();
21314    /// let response = builder.poller().until_done().await?;
21315    /// # Ok(()) }
21316    ///
21317    /// fn prepare_request_builder() -> UpdateSecurityProfileGroup {
21318    ///   # panic!();
21319    ///   // ... details omitted ...
21320    /// }
21321    /// ```
21322    #[derive(Clone, Debug)]
21323    pub struct UpdateSecurityProfileGroup(
21324        RequestBuilder<crate::model::UpdateSecurityProfileGroupRequest>,
21325    );
21326
21327    impl UpdateSecurityProfileGroup {
21328        pub(crate) fn new(
21329            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21330        ) -> Self {
21331            Self(RequestBuilder::new(stub))
21332        }
21333
21334        /// Sets the full request, replacing any prior values.
21335        pub fn with_request<V: Into<crate::model::UpdateSecurityProfileGroupRequest>>(
21336            mut self,
21337            v: V,
21338        ) -> Self {
21339            self.0.request = v.into();
21340            self
21341        }
21342
21343        /// Sets all the options, replacing any prior values.
21344        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21345            self.0.options = v.into();
21346            self
21347        }
21348
21349        /// Sends the request.
21350        ///
21351        /// # Long running operations
21352        ///
21353        /// This starts, but does not poll, a longrunning operation. More information
21354        /// on [update_security_profile_group][crate::client::SecurityProfileGroupService::update_security_profile_group].
21355        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21356            (*self.0.stub)
21357                .update_security_profile_group(self.0.request, self.0.options)
21358                .await
21359                .map(crate::Response::into_body)
21360        }
21361
21362        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_security_profile_group`.
21363        pub fn poller(
21364            self,
21365        ) -> impl google_cloud_lro::Poller<
21366            crate::model::SecurityProfileGroup,
21367            crate::model::OperationMetadata,
21368        > {
21369            type Operation = google_cloud_lro::internal::Operation<
21370                crate::model::SecurityProfileGroup,
21371                crate::model::OperationMetadata,
21372            >;
21373            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21374            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21375            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
21376            if let Some(ref mut details) = poller_options.tracing {
21377                details.method_name = "google_cloud_networksecurity_v1::client::SecurityProfileGroupService::update_security_profile_group::until_done";
21378            }
21379
21380            let stub = self.0.stub.clone();
21381            let mut options = self.0.options.clone();
21382            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21383            let query = move |name| {
21384                let stub = stub.clone();
21385                let options = options.clone();
21386                async {
21387                    let op = GetOperation::new(stub)
21388                        .set_name(name)
21389                        .with_options(options)
21390                        .send()
21391                        .await?;
21392                    Ok(Operation::new(op))
21393                }
21394            };
21395
21396            let start = move || async {
21397                let op = self.send().await?;
21398                Ok(Operation::new(op))
21399            };
21400
21401            use google_cloud_lro::internal::PollerExt;
21402            {
21403                google_cloud_lro::internal::new_poller(
21404                    polling_error_policy,
21405                    polling_backoff_policy,
21406                    start,
21407                    query,
21408                )
21409            }
21410            .with_options(poller_options)
21411        }
21412
21413        /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
21414        ///
21415        /// This is a **required** field for requests.
21416        pub fn set_update_mask<T>(mut self, v: T) -> Self
21417        where
21418            T: std::convert::Into<wkt::FieldMask>,
21419        {
21420            self.0.request.update_mask = std::option::Option::Some(v.into());
21421            self
21422        }
21423
21424        /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
21425        ///
21426        /// This is a **required** field for requests.
21427        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21428        where
21429            T: std::convert::Into<wkt::FieldMask>,
21430        {
21431            self.0.request.update_mask = v.map(|x| x.into());
21432            self
21433        }
21434
21435        /// Sets the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
21436        ///
21437        /// This is a **required** field for requests.
21438        pub fn set_security_profile_group<T>(mut self, v: T) -> Self
21439        where
21440            T: std::convert::Into<crate::model::SecurityProfileGroup>,
21441        {
21442            self.0.request.security_profile_group = std::option::Option::Some(v.into());
21443            self
21444        }
21445
21446        /// Sets or clears the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
21447        ///
21448        /// This is a **required** field for requests.
21449        pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
21450        where
21451            T: std::convert::Into<crate::model::SecurityProfileGroup>,
21452        {
21453            self.0.request.security_profile_group = v.map(|x| x.into());
21454            self
21455        }
21456    }
21457
21458    #[doc(hidden)]
21459    impl crate::RequestBuilder for UpdateSecurityProfileGroup {
21460        fn request_options(&mut self) -> &mut crate::RequestOptions {
21461            &mut self.0.options
21462        }
21463    }
21464
21465    /// The request builder for [SecurityProfileGroupService::delete_security_profile_group][crate::client::SecurityProfileGroupService::delete_security_profile_group] calls.
21466    ///
21467    /// # Example
21468    /// ```
21469    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::DeleteSecurityProfileGroup;
21470    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21471    /// use google_cloud_lro::Poller;
21472    ///
21473    /// let builder = prepare_request_builder();
21474    /// let response = builder.poller().until_done().await?;
21475    /// # Ok(()) }
21476    ///
21477    /// fn prepare_request_builder() -> DeleteSecurityProfileGroup {
21478    ///   # panic!();
21479    ///   // ... details omitted ...
21480    /// }
21481    /// ```
21482    #[derive(Clone, Debug)]
21483    pub struct DeleteSecurityProfileGroup(
21484        RequestBuilder<crate::model::DeleteSecurityProfileGroupRequest>,
21485    );
21486
21487    impl DeleteSecurityProfileGroup {
21488        pub(crate) fn new(
21489            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21490        ) -> Self {
21491            Self(RequestBuilder::new(stub))
21492        }
21493
21494        /// Sets the full request, replacing any prior values.
21495        pub fn with_request<V: Into<crate::model::DeleteSecurityProfileGroupRequest>>(
21496            mut self,
21497            v: V,
21498        ) -> Self {
21499            self.0.request = v.into();
21500            self
21501        }
21502
21503        /// Sets all the options, replacing any prior values.
21504        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21505            self.0.options = v.into();
21506            self
21507        }
21508
21509        /// Sends the request.
21510        ///
21511        /// # Long running operations
21512        ///
21513        /// This starts, but does not poll, a longrunning operation. More information
21514        /// on [delete_security_profile_group][crate::client::SecurityProfileGroupService::delete_security_profile_group].
21515        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21516            (*self.0.stub)
21517                .delete_security_profile_group(self.0.request, self.0.options)
21518                .await
21519                .map(crate::Response::into_body)
21520        }
21521
21522        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_security_profile_group`.
21523        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
21524            type Operation =
21525                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
21526            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21527            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21528            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
21529            if let Some(ref mut details) = poller_options.tracing {
21530                details.method_name = "google_cloud_networksecurity_v1::client::SecurityProfileGroupService::delete_security_profile_group::until_done";
21531            }
21532
21533            let stub = self.0.stub.clone();
21534            let mut options = self.0.options.clone();
21535            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21536            let query = move |name| {
21537                let stub = stub.clone();
21538                let options = options.clone();
21539                async {
21540                    let op = GetOperation::new(stub)
21541                        .set_name(name)
21542                        .with_options(options)
21543                        .send()
21544                        .await?;
21545                    Ok(Operation::new(op))
21546                }
21547            };
21548
21549            let start = move || async {
21550                let op = self.send().await?;
21551                Ok(Operation::new(op))
21552            };
21553
21554            use google_cloud_lro::internal::PollerExt;
21555            {
21556                google_cloud_lro::internal::new_unit_response_poller(
21557                    polling_error_policy,
21558                    polling_backoff_policy,
21559                    start,
21560                    query,
21561                )
21562            }
21563            .with_options(poller_options)
21564        }
21565
21566        /// Sets the value of [name][crate::model::DeleteSecurityProfileGroupRequest::name].
21567        ///
21568        /// This is a **required** field for requests.
21569        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21570            self.0.request.name = v.into();
21571            self
21572        }
21573
21574        /// Sets the value of [etag][crate::model::DeleteSecurityProfileGroupRequest::etag].
21575        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
21576            self.0.request.etag = v.into();
21577            self
21578        }
21579    }
21580
21581    #[doc(hidden)]
21582    impl crate::RequestBuilder for DeleteSecurityProfileGroup {
21583        fn request_options(&mut self) -> &mut crate::RequestOptions {
21584            &mut self.0.options
21585        }
21586    }
21587
21588    /// The request builder for [SecurityProfileGroupService::list_security_profiles][crate::client::SecurityProfileGroupService::list_security_profiles] calls.
21589    ///
21590    /// # Example
21591    /// ```
21592    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::ListSecurityProfiles;
21593    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21594    /// use google_cloud_gax::paginator::ItemPaginator;
21595    ///
21596    /// let builder = prepare_request_builder();
21597    /// let mut items = builder.by_item();
21598    /// while let Some(result) = items.next().await {
21599    ///   let item = result?;
21600    /// }
21601    /// # Ok(()) }
21602    ///
21603    /// fn prepare_request_builder() -> ListSecurityProfiles {
21604    ///   # panic!();
21605    ///   // ... details omitted ...
21606    /// }
21607    /// ```
21608    #[derive(Clone, Debug)]
21609    pub struct ListSecurityProfiles(RequestBuilder<crate::model::ListSecurityProfilesRequest>);
21610
21611    impl ListSecurityProfiles {
21612        pub(crate) fn new(
21613            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21614        ) -> Self {
21615            Self(RequestBuilder::new(stub))
21616        }
21617
21618        /// Sets the full request, replacing any prior values.
21619        pub fn with_request<V: Into<crate::model::ListSecurityProfilesRequest>>(
21620            mut self,
21621            v: V,
21622        ) -> Self {
21623            self.0.request = v.into();
21624            self
21625        }
21626
21627        /// Sets all the options, replacing any prior values.
21628        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21629            self.0.options = v.into();
21630            self
21631        }
21632
21633        /// Sends the request.
21634        pub async fn send(self) -> Result<crate::model::ListSecurityProfilesResponse> {
21635            (*self.0.stub)
21636                .list_security_profiles(self.0.request, self.0.options)
21637                .await
21638                .map(crate::Response::into_body)
21639        }
21640
21641        /// Streams each page in the collection.
21642        pub fn by_page(
21643            self,
21644        ) -> impl google_cloud_gax::paginator::Paginator<
21645            crate::model::ListSecurityProfilesResponse,
21646            crate::Error,
21647        > {
21648            use std::clone::Clone;
21649            let token = self.0.request.page_token.clone();
21650            let execute = move |token: String| {
21651                let mut builder = self.clone();
21652                builder.0.request = builder.0.request.set_page_token(token);
21653                builder.send()
21654            };
21655            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21656        }
21657
21658        /// Streams each item in the collection.
21659        pub fn by_item(
21660            self,
21661        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21662            crate::model::ListSecurityProfilesResponse,
21663            crate::Error,
21664        > {
21665            use google_cloud_gax::paginator::Paginator;
21666            self.by_page().items()
21667        }
21668
21669        /// Sets the value of [parent][crate::model::ListSecurityProfilesRequest::parent].
21670        ///
21671        /// This is a **required** field for requests.
21672        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21673            self.0.request.parent = v.into();
21674            self
21675        }
21676
21677        /// Sets the value of [page_size][crate::model::ListSecurityProfilesRequest::page_size].
21678        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21679            self.0.request.page_size = v.into();
21680            self
21681        }
21682
21683        /// Sets the value of [page_token][crate::model::ListSecurityProfilesRequest::page_token].
21684        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21685            self.0.request.page_token = v.into();
21686            self
21687        }
21688    }
21689
21690    #[doc(hidden)]
21691    impl crate::RequestBuilder for ListSecurityProfiles {
21692        fn request_options(&mut self) -> &mut crate::RequestOptions {
21693            &mut self.0.options
21694        }
21695    }
21696
21697    /// The request builder for [SecurityProfileGroupService::get_security_profile][crate::client::SecurityProfileGroupService::get_security_profile] calls.
21698    ///
21699    /// # Example
21700    /// ```
21701    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::GetSecurityProfile;
21702    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21703    ///
21704    /// let builder = prepare_request_builder();
21705    /// let response = builder.send().await?;
21706    /// # Ok(()) }
21707    ///
21708    /// fn prepare_request_builder() -> GetSecurityProfile {
21709    ///   # panic!();
21710    ///   // ... details omitted ...
21711    /// }
21712    /// ```
21713    #[derive(Clone, Debug)]
21714    pub struct GetSecurityProfile(RequestBuilder<crate::model::GetSecurityProfileRequest>);
21715
21716    impl GetSecurityProfile {
21717        pub(crate) fn new(
21718            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21719        ) -> Self {
21720            Self(RequestBuilder::new(stub))
21721        }
21722
21723        /// Sets the full request, replacing any prior values.
21724        pub fn with_request<V: Into<crate::model::GetSecurityProfileRequest>>(
21725            mut self,
21726            v: V,
21727        ) -> Self {
21728            self.0.request = v.into();
21729            self
21730        }
21731
21732        /// Sets all the options, replacing any prior values.
21733        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21734            self.0.options = v.into();
21735            self
21736        }
21737
21738        /// Sends the request.
21739        pub async fn send(self) -> Result<crate::model::SecurityProfile> {
21740            (*self.0.stub)
21741                .get_security_profile(self.0.request, self.0.options)
21742                .await
21743                .map(crate::Response::into_body)
21744        }
21745
21746        /// Sets the value of [name][crate::model::GetSecurityProfileRequest::name].
21747        ///
21748        /// This is a **required** field for requests.
21749        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21750            self.0.request.name = v.into();
21751            self
21752        }
21753    }
21754
21755    #[doc(hidden)]
21756    impl crate::RequestBuilder for GetSecurityProfile {
21757        fn request_options(&mut self) -> &mut crate::RequestOptions {
21758            &mut self.0.options
21759        }
21760    }
21761
21762    /// The request builder for [SecurityProfileGroupService::create_security_profile][crate::client::SecurityProfileGroupService::create_security_profile] calls.
21763    ///
21764    /// # Example
21765    /// ```
21766    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::CreateSecurityProfile;
21767    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21768    /// use google_cloud_lro::Poller;
21769    ///
21770    /// let builder = prepare_request_builder();
21771    /// let response = builder.poller().until_done().await?;
21772    /// # Ok(()) }
21773    ///
21774    /// fn prepare_request_builder() -> CreateSecurityProfile {
21775    ///   # panic!();
21776    ///   // ... details omitted ...
21777    /// }
21778    /// ```
21779    #[derive(Clone, Debug)]
21780    pub struct CreateSecurityProfile(RequestBuilder<crate::model::CreateSecurityProfileRequest>);
21781
21782    impl CreateSecurityProfile {
21783        pub(crate) fn new(
21784            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21785        ) -> Self {
21786            Self(RequestBuilder::new(stub))
21787        }
21788
21789        /// Sets the full request, replacing any prior values.
21790        pub fn with_request<V: Into<crate::model::CreateSecurityProfileRequest>>(
21791            mut self,
21792            v: V,
21793        ) -> Self {
21794            self.0.request = v.into();
21795            self
21796        }
21797
21798        /// Sets all the options, replacing any prior values.
21799        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21800            self.0.options = v.into();
21801            self
21802        }
21803
21804        /// Sends the request.
21805        ///
21806        /// # Long running operations
21807        ///
21808        /// This starts, but does not poll, a longrunning operation. More information
21809        /// on [create_security_profile][crate::client::SecurityProfileGroupService::create_security_profile].
21810        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21811            (*self.0.stub)
21812                .create_security_profile(self.0.request, self.0.options)
21813                .await
21814                .map(crate::Response::into_body)
21815        }
21816
21817        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_security_profile`.
21818        pub fn poller(
21819            self,
21820        ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
21821        {
21822            type Operation = google_cloud_lro::internal::Operation<
21823                crate::model::SecurityProfile,
21824                crate::model::OperationMetadata,
21825            >;
21826            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21827            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21828            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
21829            if let Some(ref mut details) = poller_options.tracing {
21830                details.method_name = "google_cloud_networksecurity_v1::client::SecurityProfileGroupService::create_security_profile::until_done";
21831            }
21832
21833            let stub = self.0.stub.clone();
21834            let mut options = self.0.options.clone();
21835            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21836            let query = move |name| {
21837                let stub = stub.clone();
21838                let options = options.clone();
21839                async {
21840                    let op = GetOperation::new(stub)
21841                        .set_name(name)
21842                        .with_options(options)
21843                        .send()
21844                        .await?;
21845                    Ok(Operation::new(op))
21846                }
21847            };
21848
21849            let start = move || async {
21850                let op = self.send().await?;
21851                Ok(Operation::new(op))
21852            };
21853
21854            use google_cloud_lro::internal::PollerExt;
21855            {
21856                google_cloud_lro::internal::new_poller(
21857                    polling_error_policy,
21858                    polling_backoff_policy,
21859                    start,
21860                    query,
21861                )
21862            }
21863            .with_options(poller_options)
21864        }
21865
21866        /// Sets the value of [parent][crate::model::CreateSecurityProfileRequest::parent].
21867        ///
21868        /// This is a **required** field for requests.
21869        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21870            self.0.request.parent = v.into();
21871            self
21872        }
21873
21874        /// Sets the value of [security_profile_id][crate::model::CreateSecurityProfileRequest::security_profile_id].
21875        ///
21876        /// This is a **required** field for requests.
21877        pub fn set_security_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
21878            self.0.request.security_profile_id = v.into();
21879            self
21880        }
21881
21882        /// Sets the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
21883        ///
21884        /// This is a **required** field for requests.
21885        pub fn set_security_profile<T>(mut self, v: T) -> Self
21886        where
21887            T: std::convert::Into<crate::model::SecurityProfile>,
21888        {
21889            self.0.request.security_profile = std::option::Option::Some(v.into());
21890            self
21891        }
21892
21893        /// Sets or clears the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
21894        ///
21895        /// This is a **required** field for requests.
21896        pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
21897        where
21898            T: std::convert::Into<crate::model::SecurityProfile>,
21899        {
21900            self.0.request.security_profile = v.map(|x| x.into());
21901            self
21902        }
21903    }
21904
21905    #[doc(hidden)]
21906    impl crate::RequestBuilder for CreateSecurityProfile {
21907        fn request_options(&mut self) -> &mut crate::RequestOptions {
21908            &mut self.0.options
21909        }
21910    }
21911
21912    /// The request builder for [SecurityProfileGroupService::update_security_profile][crate::client::SecurityProfileGroupService::update_security_profile] calls.
21913    ///
21914    /// # Example
21915    /// ```
21916    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::UpdateSecurityProfile;
21917    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21918    /// use google_cloud_lro::Poller;
21919    ///
21920    /// let builder = prepare_request_builder();
21921    /// let response = builder.poller().until_done().await?;
21922    /// # Ok(()) }
21923    ///
21924    /// fn prepare_request_builder() -> UpdateSecurityProfile {
21925    ///   # panic!();
21926    ///   // ... details omitted ...
21927    /// }
21928    /// ```
21929    #[derive(Clone, Debug)]
21930    pub struct UpdateSecurityProfile(RequestBuilder<crate::model::UpdateSecurityProfileRequest>);
21931
21932    impl UpdateSecurityProfile {
21933        pub(crate) fn new(
21934            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21935        ) -> Self {
21936            Self(RequestBuilder::new(stub))
21937        }
21938
21939        /// Sets the full request, replacing any prior values.
21940        pub fn with_request<V: Into<crate::model::UpdateSecurityProfileRequest>>(
21941            mut self,
21942            v: V,
21943        ) -> Self {
21944            self.0.request = v.into();
21945            self
21946        }
21947
21948        /// Sets all the options, replacing any prior values.
21949        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21950            self.0.options = v.into();
21951            self
21952        }
21953
21954        /// Sends the request.
21955        ///
21956        /// # Long running operations
21957        ///
21958        /// This starts, but does not poll, a longrunning operation. More information
21959        /// on [update_security_profile][crate::client::SecurityProfileGroupService::update_security_profile].
21960        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21961            (*self.0.stub)
21962                .update_security_profile(self.0.request, self.0.options)
21963                .await
21964                .map(crate::Response::into_body)
21965        }
21966
21967        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_security_profile`.
21968        pub fn poller(
21969            self,
21970        ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
21971        {
21972            type Operation = google_cloud_lro::internal::Operation<
21973                crate::model::SecurityProfile,
21974                crate::model::OperationMetadata,
21975            >;
21976            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21977            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21978            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
21979            if let Some(ref mut details) = poller_options.tracing {
21980                details.method_name = "google_cloud_networksecurity_v1::client::SecurityProfileGroupService::update_security_profile::until_done";
21981            }
21982
21983            let stub = self.0.stub.clone();
21984            let mut options = self.0.options.clone();
21985            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21986            let query = move |name| {
21987                let stub = stub.clone();
21988                let options = options.clone();
21989                async {
21990                    let op = GetOperation::new(stub)
21991                        .set_name(name)
21992                        .with_options(options)
21993                        .send()
21994                        .await?;
21995                    Ok(Operation::new(op))
21996                }
21997            };
21998
21999            let start = move || async {
22000                let op = self.send().await?;
22001                Ok(Operation::new(op))
22002            };
22003
22004            use google_cloud_lro::internal::PollerExt;
22005            {
22006                google_cloud_lro::internal::new_poller(
22007                    polling_error_policy,
22008                    polling_backoff_policy,
22009                    start,
22010                    query,
22011                )
22012            }
22013            .with_options(poller_options)
22014        }
22015
22016        /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
22017        ///
22018        /// This is a **required** field for requests.
22019        pub fn set_update_mask<T>(mut self, v: T) -> Self
22020        where
22021            T: std::convert::Into<wkt::FieldMask>,
22022        {
22023            self.0.request.update_mask = std::option::Option::Some(v.into());
22024            self
22025        }
22026
22027        /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
22028        ///
22029        /// This is a **required** field for requests.
22030        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22031        where
22032            T: std::convert::Into<wkt::FieldMask>,
22033        {
22034            self.0.request.update_mask = v.map(|x| x.into());
22035            self
22036        }
22037
22038        /// Sets the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
22039        ///
22040        /// This is a **required** field for requests.
22041        pub fn set_security_profile<T>(mut self, v: T) -> Self
22042        where
22043            T: std::convert::Into<crate::model::SecurityProfile>,
22044        {
22045            self.0.request.security_profile = std::option::Option::Some(v.into());
22046            self
22047        }
22048
22049        /// Sets or clears the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
22050        ///
22051        /// This is a **required** field for requests.
22052        pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
22053        where
22054            T: std::convert::Into<crate::model::SecurityProfile>,
22055        {
22056            self.0.request.security_profile = v.map(|x| x.into());
22057            self
22058        }
22059    }
22060
22061    #[doc(hidden)]
22062    impl crate::RequestBuilder for UpdateSecurityProfile {
22063        fn request_options(&mut self) -> &mut crate::RequestOptions {
22064            &mut self.0.options
22065        }
22066    }
22067
22068    /// The request builder for [SecurityProfileGroupService::delete_security_profile][crate::client::SecurityProfileGroupService::delete_security_profile] calls.
22069    ///
22070    /// # Example
22071    /// ```
22072    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::DeleteSecurityProfile;
22073    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22074    /// use google_cloud_lro::Poller;
22075    ///
22076    /// let builder = prepare_request_builder();
22077    /// let response = builder.poller().until_done().await?;
22078    /// # Ok(()) }
22079    ///
22080    /// fn prepare_request_builder() -> DeleteSecurityProfile {
22081    ///   # panic!();
22082    ///   // ... details omitted ...
22083    /// }
22084    /// ```
22085    #[derive(Clone, Debug)]
22086    pub struct DeleteSecurityProfile(RequestBuilder<crate::model::DeleteSecurityProfileRequest>);
22087
22088    impl DeleteSecurityProfile {
22089        pub(crate) fn new(
22090            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22091        ) -> Self {
22092            Self(RequestBuilder::new(stub))
22093        }
22094
22095        /// Sets the full request, replacing any prior values.
22096        pub fn with_request<V: Into<crate::model::DeleteSecurityProfileRequest>>(
22097            mut self,
22098            v: V,
22099        ) -> Self {
22100            self.0.request = v.into();
22101            self
22102        }
22103
22104        /// Sets all the options, replacing any prior values.
22105        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22106            self.0.options = v.into();
22107            self
22108        }
22109
22110        /// Sends the request.
22111        ///
22112        /// # Long running operations
22113        ///
22114        /// This starts, but does not poll, a longrunning operation. More information
22115        /// on [delete_security_profile][crate::client::SecurityProfileGroupService::delete_security_profile].
22116        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22117            (*self.0.stub)
22118                .delete_security_profile(self.0.request, self.0.options)
22119                .await
22120                .map(crate::Response::into_body)
22121        }
22122
22123        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_security_profile`.
22124        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
22125            type Operation =
22126                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
22127            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
22128            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
22129            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
22130            if let Some(ref mut details) = poller_options.tracing {
22131                details.method_name = "google_cloud_networksecurity_v1::client::SecurityProfileGroupService::delete_security_profile::until_done";
22132            }
22133
22134            let stub = self.0.stub.clone();
22135            let mut options = self.0.options.clone();
22136            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
22137            let query = move |name| {
22138                let stub = stub.clone();
22139                let options = options.clone();
22140                async {
22141                    let op = GetOperation::new(stub)
22142                        .set_name(name)
22143                        .with_options(options)
22144                        .send()
22145                        .await?;
22146                    Ok(Operation::new(op))
22147                }
22148            };
22149
22150            let start = move || async {
22151                let op = self.send().await?;
22152                Ok(Operation::new(op))
22153            };
22154
22155            use google_cloud_lro::internal::PollerExt;
22156            {
22157                google_cloud_lro::internal::new_unit_response_poller(
22158                    polling_error_policy,
22159                    polling_backoff_policy,
22160                    start,
22161                    query,
22162                )
22163            }
22164            .with_options(poller_options)
22165        }
22166
22167        /// Sets the value of [name][crate::model::DeleteSecurityProfileRequest::name].
22168        ///
22169        /// This is a **required** field for requests.
22170        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22171            self.0.request.name = v.into();
22172            self
22173        }
22174
22175        /// Sets the value of [etag][crate::model::DeleteSecurityProfileRequest::etag].
22176        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
22177            self.0.request.etag = v.into();
22178            self
22179        }
22180    }
22181
22182    #[doc(hidden)]
22183    impl crate::RequestBuilder for DeleteSecurityProfile {
22184        fn request_options(&mut self) -> &mut crate::RequestOptions {
22185            &mut self.0.options
22186        }
22187    }
22188
22189    /// The request builder for [SecurityProfileGroupService::list_locations][crate::client::SecurityProfileGroupService::list_locations] calls.
22190    ///
22191    /// # Example
22192    /// ```
22193    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::ListLocations;
22194    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22195    /// use google_cloud_gax::paginator::ItemPaginator;
22196    ///
22197    /// let builder = prepare_request_builder();
22198    /// let mut items = builder.by_item();
22199    /// while let Some(result) = items.next().await {
22200    ///   let item = result?;
22201    /// }
22202    /// # Ok(()) }
22203    ///
22204    /// fn prepare_request_builder() -> ListLocations {
22205    ///   # panic!();
22206    ///   // ... details omitted ...
22207    /// }
22208    /// ```
22209    #[derive(Clone, Debug)]
22210    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
22211
22212    impl ListLocations {
22213        pub(crate) fn new(
22214            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22215        ) -> Self {
22216            Self(RequestBuilder::new(stub))
22217        }
22218
22219        /// Sets the full request, replacing any prior values.
22220        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
22221            mut self,
22222            v: V,
22223        ) -> Self {
22224            self.0.request = v.into();
22225            self
22226        }
22227
22228        /// Sets all the options, replacing any prior values.
22229        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22230            self.0.options = v.into();
22231            self
22232        }
22233
22234        /// Sends the request.
22235        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
22236            (*self.0.stub)
22237                .list_locations(self.0.request, self.0.options)
22238                .await
22239                .map(crate::Response::into_body)
22240        }
22241
22242        /// Streams each page in the collection.
22243        pub fn by_page(
22244            self,
22245        ) -> impl google_cloud_gax::paginator::Paginator<
22246            google_cloud_location::model::ListLocationsResponse,
22247            crate::Error,
22248        > {
22249            use std::clone::Clone;
22250            let token = self.0.request.page_token.clone();
22251            let execute = move |token: String| {
22252                let mut builder = self.clone();
22253                builder.0.request = builder.0.request.set_page_token(token);
22254                builder.send()
22255            };
22256            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22257        }
22258
22259        /// Streams each item in the collection.
22260        pub fn by_item(
22261            self,
22262        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22263            google_cloud_location::model::ListLocationsResponse,
22264            crate::Error,
22265        > {
22266            use google_cloud_gax::paginator::Paginator;
22267            self.by_page().items()
22268        }
22269
22270        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
22271        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22272            self.0.request.name = v.into();
22273            self
22274        }
22275
22276        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
22277        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22278            self.0.request.filter = v.into();
22279            self
22280        }
22281
22282        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
22283        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22284            self.0.request.page_size = v.into();
22285            self
22286        }
22287
22288        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
22289        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22290            self.0.request.page_token = v.into();
22291            self
22292        }
22293    }
22294
22295    #[doc(hidden)]
22296    impl crate::RequestBuilder for ListLocations {
22297        fn request_options(&mut self) -> &mut crate::RequestOptions {
22298            &mut self.0.options
22299        }
22300    }
22301
22302    /// The request builder for [SecurityProfileGroupService::get_location][crate::client::SecurityProfileGroupService::get_location] calls.
22303    ///
22304    /// # Example
22305    /// ```
22306    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::GetLocation;
22307    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22308    ///
22309    /// let builder = prepare_request_builder();
22310    /// let response = builder.send().await?;
22311    /// # Ok(()) }
22312    ///
22313    /// fn prepare_request_builder() -> GetLocation {
22314    ///   # panic!();
22315    ///   // ... details omitted ...
22316    /// }
22317    /// ```
22318    #[derive(Clone, Debug)]
22319    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
22320
22321    impl GetLocation {
22322        pub(crate) fn new(
22323            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22324        ) -> Self {
22325            Self(RequestBuilder::new(stub))
22326        }
22327
22328        /// Sets the full request, replacing any prior values.
22329        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
22330            mut self,
22331            v: V,
22332        ) -> Self {
22333            self.0.request = v.into();
22334            self
22335        }
22336
22337        /// Sets all the options, replacing any prior values.
22338        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22339            self.0.options = v.into();
22340            self
22341        }
22342
22343        /// Sends the request.
22344        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
22345            (*self.0.stub)
22346                .get_location(self.0.request, self.0.options)
22347                .await
22348                .map(crate::Response::into_body)
22349        }
22350
22351        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
22352        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22353            self.0.request.name = v.into();
22354            self
22355        }
22356    }
22357
22358    #[doc(hidden)]
22359    impl crate::RequestBuilder for GetLocation {
22360        fn request_options(&mut self) -> &mut crate::RequestOptions {
22361            &mut self.0.options
22362        }
22363    }
22364
22365    /// The request builder for [SecurityProfileGroupService::set_iam_policy][crate::client::SecurityProfileGroupService::set_iam_policy] calls.
22366    ///
22367    /// # Example
22368    /// ```
22369    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::SetIamPolicy;
22370    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22371    ///
22372    /// let builder = prepare_request_builder();
22373    /// let response = builder.send().await?;
22374    /// # Ok(()) }
22375    ///
22376    /// fn prepare_request_builder() -> SetIamPolicy {
22377    ///   # panic!();
22378    ///   // ... details omitted ...
22379    /// }
22380    /// ```
22381    #[derive(Clone, Debug)]
22382    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
22383
22384    impl SetIamPolicy {
22385        pub(crate) fn new(
22386            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22387        ) -> Self {
22388            Self(RequestBuilder::new(stub))
22389        }
22390
22391        /// Sets the full request, replacing any prior values.
22392        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
22393            mut self,
22394            v: V,
22395        ) -> Self {
22396            self.0.request = v.into();
22397            self
22398        }
22399
22400        /// Sets all the options, replacing any prior values.
22401        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22402            self.0.options = v.into();
22403            self
22404        }
22405
22406        /// Sends the request.
22407        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
22408            (*self.0.stub)
22409                .set_iam_policy(self.0.request, self.0.options)
22410                .await
22411                .map(crate::Response::into_body)
22412        }
22413
22414        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
22415        ///
22416        /// This is a **required** field for requests.
22417        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
22418            self.0.request.resource = v.into();
22419            self
22420        }
22421
22422        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
22423        ///
22424        /// This is a **required** field for requests.
22425        pub fn set_policy<T>(mut self, v: T) -> Self
22426        where
22427            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
22428        {
22429            self.0.request.policy = std::option::Option::Some(v.into());
22430            self
22431        }
22432
22433        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
22434        ///
22435        /// This is a **required** field for requests.
22436        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
22437        where
22438            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
22439        {
22440            self.0.request.policy = v.map(|x| x.into());
22441            self
22442        }
22443
22444        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
22445        pub fn set_update_mask<T>(mut self, v: T) -> Self
22446        where
22447            T: std::convert::Into<wkt::FieldMask>,
22448        {
22449            self.0.request.update_mask = std::option::Option::Some(v.into());
22450            self
22451        }
22452
22453        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
22454        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22455        where
22456            T: std::convert::Into<wkt::FieldMask>,
22457        {
22458            self.0.request.update_mask = v.map(|x| x.into());
22459            self
22460        }
22461    }
22462
22463    #[doc(hidden)]
22464    impl crate::RequestBuilder for SetIamPolicy {
22465        fn request_options(&mut self) -> &mut crate::RequestOptions {
22466            &mut self.0.options
22467        }
22468    }
22469
22470    /// The request builder for [SecurityProfileGroupService::get_iam_policy][crate::client::SecurityProfileGroupService::get_iam_policy] calls.
22471    ///
22472    /// # Example
22473    /// ```
22474    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::GetIamPolicy;
22475    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22476    ///
22477    /// let builder = prepare_request_builder();
22478    /// let response = builder.send().await?;
22479    /// # Ok(()) }
22480    ///
22481    /// fn prepare_request_builder() -> GetIamPolicy {
22482    ///   # panic!();
22483    ///   // ... details omitted ...
22484    /// }
22485    /// ```
22486    #[derive(Clone, Debug)]
22487    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
22488
22489    impl GetIamPolicy {
22490        pub(crate) fn new(
22491            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22492        ) -> Self {
22493            Self(RequestBuilder::new(stub))
22494        }
22495
22496        /// Sets the full request, replacing any prior values.
22497        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
22498            mut self,
22499            v: V,
22500        ) -> Self {
22501            self.0.request = v.into();
22502            self
22503        }
22504
22505        /// Sets all the options, replacing any prior values.
22506        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22507            self.0.options = v.into();
22508            self
22509        }
22510
22511        /// Sends the request.
22512        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
22513            (*self.0.stub)
22514                .get_iam_policy(self.0.request, self.0.options)
22515                .await
22516                .map(crate::Response::into_body)
22517        }
22518
22519        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
22520        ///
22521        /// This is a **required** field for requests.
22522        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
22523            self.0.request.resource = v.into();
22524            self
22525        }
22526
22527        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
22528        pub fn set_options<T>(mut self, v: T) -> Self
22529        where
22530            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
22531        {
22532            self.0.request.options = std::option::Option::Some(v.into());
22533            self
22534        }
22535
22536        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
22537        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
22538        where
22539            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
22540        {
22541            self.0.request.options = v.map(|x| x.into());
22542            self
22543        }
22544    }
22545
22546    #[doc(hidden)]
22547    impl crate::RequestBuilder for GetIamPolicy {
22548        fn request_options(&mut self) -> &mut crate::RequestOptions {
22549            &mut self.0.options
22550        }
22551    }
22552
22553    /// The request builder for [SecurityProfileGroupService::test_iam_permissions][crate::client::SecurityProfileGroupService::test_iam_permissions] calls.
22554    ///
22555    /// # Example
22556    /// ```
22557    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::TestIamPermissions;
22558    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22559    ///
22560    /// let builder = prepare_request_builder();
22561    /// let response = builder.send().await?;
22562    /// # Ok(()) }
22563    ///
22564    /// fn prepare_request_builder() -> TestIamPermissions {
22565    ///   # panic!();
22566    ///   // ... details omitted ...
22567    /// }
22568    /// ```
22569    #[derive(Clone, Debug)]
22570    pub struct TestIamPermissions(
22571        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
22572    );
22573
22574    impl TestIamPermissions {
22575        pub(crate) fn new(
22576            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22577        ) -> Self {
22578            Self(RequestBuilder::new(stub))
22579        }
22580
22581        /// Sets the full request, replacing any prior values.
22582        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
22583            mut self,
22584            v: V,
22585        ) -> Self {
22586            self.0.request = v.into();
22587            self
22588        }
22589
22590        /// Sets all the options, replacing any prior values.
22591        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22592            self.0.options = v.into();
22593            self
22594        }
22595
22596        /// Sends the request.
22597        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
22598            (*self.0.stub)
22599                .test_iam_permissions(self.0.request, self.0.options)
22600                .await
22601                .map(crate::Response::into_body)
22602        }
22603
22604        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
22605        ///
22606        /// This is a **required** field for requests.
22607        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
22608            self.0.request.resource = v.into();
22609            self
22610        }
22611
22612        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
22613        ///
22614        /// This is a **required** field for requests.
22615        pub fn set_permissions<T, V>(mut self, v: T) -> Self
22616        where
22617            T: std::iter::IntoIterator<Item = V>,
22618            V: std::convert::Into<std::string::String>,
22619        {
22620            use std::iter::Iterator;
22621            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
22622            self
22623        }
22624    }
22625
22626    #[doc(hidden)]
22627    impl crate::RequestBuilder for TestIamPermissions {
22628        fn request_options(&mut self) -> &mut crate::RequestOptions {
22629            &mut self.0.options
22630        }
22631    }
22632
22633    /// The request builder for [SecurityProfileGroupService::list_operations][crate::client::SecurityProfileGroupService::list_operations] calls.
22634    ///
22635    /// # Example
22636    /// ```
22637    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::ListOperations;
22638    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22639    /// use google_cloud_gax::paginator::ItemPaginator;
22640    ///
22641    /// let builder = prepare_request_builder();
22642    /// let mut items = builder.by_item();
22643    /// while let Some(result) = items.next().await {
22644    ///   let item = result?;
22645    /// }
22646    /// # Ok(()) }
22647    ///
22648    /// fn prepare_request_builder() -> ListOperations {
22649    ///   # panic!();
22650    ///   // ... details omitted ...
22651    /// }
22652    /// ```
22653    #[derive(Clone, Debug)]
22654    pub struct ListOperations(
22655        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
22656    );
22657
22658    impl ListOperations {
22659        pub(crate) fn new(
22660            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22661        ) -> Self {
22662            Self(RequestBuilder::new(stub))
22663        }
22664
22665        /// Sets the full request, replacing any prior values.
22666        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
22667            mut self,
22668            v: V,
22669        ) -> Self {
22670            self.0.request = v.into();
22671            self
22672        }
22673
22674        /// Sets all the options, replacing any prior values.
22675        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22676            self.0.options = v.into();
22677            self
22678        }
22679
22680        /// Sends the request.
22681        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
22682            (*self.0.stub)
22683                .list_operations(self.0.request, self.0.options)
22684                .await
22685                .map(crate::Response::into_body)
22686        }
22687
22688        /// Streams each page in the collection.
22689        pub fn by_page(
22690            self,
22691        ) -> impl google_cloud_gax::paginator::Paginator<
22692            google_cloud_longrunning::model::ListOperationsResponse,
22693            crate::Error,
22694        > {
22695            use std::clone::Clone;
22696            let token = self.0.request.page_token.clone();
22697            let execute = move |token: String| {
22698                let mut builder = self.clone();
22699                builder.0.request = builder.0.request.set_page_token(token);
22700                builder.send()
22701            };
22702            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22703        }
22704
22705        /// Streams each item in the collection.
22706        pub fn by_item(
22707            self,
22708        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22709            google_cloud_longrunning::model::ListOperationsResponse,
22710            crate::Error,
22711        > {
22712            use google_cloud_gax::paginator::Paginator;
22713            self.by_page().items()
22714        }
22715
22716        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
22717        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22718            self.0.request.name = v.into();
22719            self
22720        }
22721
22722        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
22723        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22724            self.0.request.filter = v.into();
22725            self
22726        }
22727
22728        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
22729        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22730            self.0.request.page_size = v.into();
22731            self
22732        }
22733
22734        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
22735        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22736            self.0.request.page_token = v.into();
22737            self
22738        }
22739
22740        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
22741        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
22742            self.0.request.return_partial_success = v.into();
22743            self
22744        }
22745    }
22746
22747    #[doc(hidden)]
22748    impl crate::RequestBuilder for ListOperations {
22749        fn request_options(&mut self) -> &mut crate::RequestOptions {
22750            &mut self.0.options
22751        }
22752    }
22753
22754    /// The request builder for [SecurityProfileGroupService::get_operation][crate::client::SecurityProfileGroupService::get_operation] calls.
22755    ///
22756    /// # Example
22757    /// ```
22758    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::GetOperation;
22759    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22760    ///
22761    /// let builder = prepare_request_builder();
22762    /// let response = builder.send().await?;
22763    /// # Ok(()) }
22764    ///
22765    /// fn prepare_request_builder() -> GetOperation {
22766    ///   # panic!();
22767    ///   // ... details omitted ...
22768    /// }
22769    /// ```
22770    #[derive(Clone, Debug)]
22771    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
22772
22773    impl GetOperation {
22774        pub(crate) fn new(
22775            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22776        ) -> Self {
22777            Self(RequestBuilder::new(stub))
22778        }
22779
22780        /// Sets the full request, replacing any prior values.
22781        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
22782            mut self,
22783            v: V,
22784        ) -> Self {
22785            self.0.request = v.into();
22786            self
22787        }
22788
22789        /// Sets all the options, replacing any prior values.
22790        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22791            self.0.options = v.into();
22792            self
22793        }
22794
22795        /// Sends the request.
22796        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22797            (*self.0.stub)
22798                .get_operation(self.0.request, self.0.options)
22799                .await
22800                .map(crate::Response::into_body)
22801        }
22802
22803        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
22804        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22805            self.0.request.name = v.into();
22806            self
22807        }
22808    }
22809
22810    #[doc(hidden)]
22811    impl crate::RequestBuilder for GetOperation {
22812        fn request_options(&mut self) -> &mut crate::RequestOptions {
22813            &mut self.0.options
22814        }
22815    }
22816
22817    /// The request builder for [SecurityProfileGroupService::delete_operation][crate::client::SecurityProfileGroupService::delete_operation] calls.
22818    ///
22819    /// # Example
22820    /// ```
22821    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::DeleteOperation;
22822    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22823    ///
22824    /// let builder = prepare_request_builder();
22825    /// let response = builder.send().await?;
22826    /// # Ok(()) }
22827    ///
22828    /// fn prepare_request_builder() -> DeleteOperation {
22829    ///   # panic!();
22830    ///   // ... details omitted ...
22831    /// }
22832    /// ```
22833    #[derive(Clone, Debug)]
22834    pub struct DeleteOperation(
22835        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
22836    );
22837
22838    impl DeleteOperation {
22839        pub(crate) fn new(
22840            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22841        ) -> Self {
22842            Self(RequestBuilder::new(stub))
22843        }
22844
22845        /// Sets the full request, replacing any prior values.
22846        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
22847            mut self,
22848            v: V,
22849        ) -> Self {
22850            self.0.request = v.into();
22851            self
22852        }
22853
22854        /// Sets all the options, replacing any prior values.
22855        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22856            self.0.options = v.into();
22857            self
22858        }
22859
22860        /// Sends the request.
22861        pub async fn send(self) -> Result<()> {
22862            (*self.0.stub)
22863                .delete_operation(self.0.request, self.0.options)
22864                .await
22865                .map(crate::Response::into_body)
22866        }
22867
22868        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
22869        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22870            self.0.request.name = v.into();
22871            self
22872        }
22873    }
22874
22875    #[doc(hidden)]
22876    impl crate::RequestBuilder for DeleteOperation {
22877        fn request_options(&mut self) -> &mut crate::RequestOptions {
22878            &mut self.0.options
22879        }
22880    }
22881
22882    /// The request builder for [SecurityProfileGroupService::cancel_operation][crate::client::SecurityProfileGroupService::cancel_operation] calls.
22883    ///
22884    /// # Example
22885    /// ```
22886    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::CancelOperation;
22887    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22888    ///
22889    /// let builder = prepare_request_builder();
22890    /// let response = builder.send().await?;
22891    /// # Ok(()) }
22892    ///
22893    /// fn prepare_request_builder() -> CancelOperation {
22894    ///   # panic!();
22895    ///   // ... details omitted ...
22896    /// }
22897    /// ```
22898    #[derive(Clone, Debug)]
22899    pub struct CancelOperation(
22900        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
22901    );
22902
22903    impl CancelOperation {
22904        pub(crate) fn new(
22905            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22906        ) -> Self {
22907            Self(RequestBuilder::new(stub))
22908        }
22909
22910        /// Sets the full request, replacing any prior values.
22911        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
22912            mut self,
22913            v: V,
22914        ) -> Self {
22915            self.0.request = v.into();
22916            self
22917        }
22918
22919        /// Sets all the options, replacing any prior values.
22920        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22921            self.0.options = v.into();
22922            self
22923        }
22924
22925        /// Sends the request.
22926        pub async fn send(self) -> Result<()> {
22927            (*self.0.stub)
22928                .cancel_operation(self.0.request, self.0.options)
22929                .await
22930                .map(crate::Response::into_body)
22931        }
22932
22933        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
22934        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22935            self.0.request.name = v.into();
22936            self
22937        }
22938    }
22939
22940    #[doc(hidden)]
22941    impl crate::RequestBuilder for CancelOperation {
22942        fn request_options(&mut self) -> &mut crate::RequestOptions {
22943            &mut self.0.options
22944        }
22945    }
22946}
22947
22948/// Request and client builders for [OrganizationSecurityProfileGroupService][crate::client::OrganizationSecurityProfileGroupService].
22949pub mod organization_security_profile_group_service {
22950    use crate::Result;
22951
22952    /// A builder for [OrganizationSecurityProfileGroupService][crate::client::OrganizationSecurityProfileGroupService].
22953    ///
22954    /// ```
22955    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
22956    /// # use google_cloud_networksecurity_v1::*;
22957    /// # use builder::organization_security_profile_group_service::ClientBuilder;
22958    /// # use client::OrganizationSecurityProfileGroupService;
22959    /// let builder : ClientBuilder = OrganizationSecurityProfileGroupService::builder();
22960    /// let client = builder
22961    ///     .with_endpoint("https://networksecurity.googleapis.com")
22962    ///     .build().await?;
22963    /// # Ok(()) }
22964    /// ```
22965    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
22966
22967    pub(crate) mod client {
22968        use super::super::super::client::OrganizationSecurityProfileGroupService;
22969        pub struct Factory;
22970        impl crate::ClientFactory for Factory {
22971            type Client = OrganizationSecurityProfileGroupService;
22972            type Credentials = gaxi::options::Credentials;
22973            async fn build(
22974                self,
22975                config: gaxi::options::ClientConfig,
22976            ) -> crate::ClientBuilderResult<Self::Client> {
22977                Self::Client::new(config).await
22978            }
22979        }
22980    }
22981
22982    /// Common implementation for [crate::client::OrganizationSecurityProfileGroupService] request builders.
22983    #[derive(Clone, Debug)]
22984    pub(crate) struct RequestBuilder<R: std::default::Default> {
22985        stub: std::sync::Arc<
22986            dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22987        >,
22988        request: R,
22989        options: crate::RequestOptions,
22990    }
22991
22992    impl<R> RequestBuilder<R>
22993    where
22994        R: std::default::Default,
22995    {
22996        pub(crate) fn new(
22997            stub: std::sync::Arc<
22998                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22999            >,
23000        ) -> Self {
23001            Self {
23002                stub,
23003                request: R::default(),
23004                options: crate::RequestOptions::default(),
23005            }
23006        }
23007    }
23008
23009    /// The request builder for [OrganizationSecurityProfileGroupService::list_security_profile_groups][crate::client::OrganizationSecurityProfileGroupService::list_security_profile_groups] calls.
23010    ///
23011    /// # Example
23012    /// ```
23013    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListSecurityProfileGroups;
23014    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23015    /// use google_cloud_gax::paginator::ItemPaginator;
23016    ///
23017    /// let builder = prepare_request_builder();
23018    /// let mut items = builder.by_item();
23019    /// while let Some(result) = items.next().await {
23020    ///   let item = result?;
23021    /// }
23022    /// # Ok(()) }
23023    ///
23024    /// fn prepare_request_builder() -> ListSecurityProfileGroups {
23025    ///   # panic!();
23026    ///   // ... details omitted ...
23027    /// }
23028    /// ```
23029    #[derive(Clone, Debug)]
23030    pub struct ListSecurityProfileGroups(
23031        RequestBuilder<crate::model::ListSecurityProfileGroupsRequest>,
23032    );
23033
23034    impl ListSecurityProfileGroups {
23035        pub(crate) fn new(
23036            stub: std::sync::Arc<
23037                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23038            >,
23039        ) -> Self {
23040            Self(RequestBuilder::new(stub))
23041        }
23042
23043        /// Sets the full request, replacing any prior values.
23044        pub fn with_request<V: Into<crate::model::ListSecurityProfileGroupsRequest>>(
23045            mut self,
23046            v: V,
23047        ) -> Self {
23048            self.0.request = v.into();
23049            self
23050        }
23051
23052        /// Sets all the options, replacing any prior values.
23053        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23054            self.0.options = v.into();
23055            self
23056        }
23057
23058        /// Sends the request.
23059        pub async fn send(self) -> Result<crate::model::ListSecurityProfileGroupsResponse> {
23060            (*self.0.stub)
23061                .list_security_profile_groups(self.0.request, self.0.options)
23062                .await
23063                .map(crate::Response::into_body)
23064        }
23065
23066        /// Streams each page in the collection.
23067        pub fn by_page(
23068            self,
23069        ) -> impl google_cloud_gax::paginator::Paginator<
23070            crate::model::ListSecurityProfileGroupsResponse,
23071            crate::Error,
23072        > {
23073            use std::clone::Clone;
23074            let token = self.0.request.page_token.clone();
23075            let execute = move |token: String| {
23076                let mut builder = self.clone();
23077                builder.0.request = builder.0.request.set_page_token(token);
23078                builder.send()
23079            };
23080            google_cloud_gax::paginator::internal::new_paginator(token, execute)
23081        }
23082
23083        /// Streams each item in the collection.
23084        pub fn by_item(
23085            self,
23086        ) -> impl google_cloud_gax::paginator::ItemPaginator<
23087            crate::model::ListSecurityProfileGroupsResponse,
23088            crate::Error,
23089        > {
23090            use google_cloud_gax::paginator::Paginator;
23091            self.by_page().items()
23092        }
23093
23094        /// Sets the value of [parent][crate::model::ListSecurityProfileGroupsRequest::parent].
23095        ///
23096        /// This is a **required** field for requests.
23097        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
23098            self.0.request.parent = v.into();
23099            self
23100        }
23101
23102        /// Sets the value of [page_size][crate::model::ListSecurityProfileGroupsRequest::page_size].
23103        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
23104            self.0.request.page_size = v.into();
23105            self
23106        }
23107
23108        /// Sets the value of [page_token][crate::model::ListSecurityProfileGroupsRequest::page_token].
23109        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
23110            self.0.request.page_token = v.into();
23111            self
23112        }
23113    }
23114
23115    #[doc(hidden)]
23116    impl crate::RequestBuilder for ListSecurityProfileGroups {
23117        fn request_options(&mut self) -> &mut crate::RequestOptions {
23118            &mut self.0.options
23119        }
23120    }
23121
23122    /// The request builder for [OrganizationSecurityProfileGroupService::get_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::get_security_profile_group] calls.
23123    ///
23124    /// # Example
23125    /// ```
23126    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetSecurityProfileGroup;
23127    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23128    ///
23129    /// let builder = prepare_request_builder();
23130    /// let response = builder.send().await?;
23131    /// # Ok(()) }
23132    ///
23133    /// fn prepare_request_builder() -> GetSecurityProfileGroup {
23134    ///   # panic!();
23135    ///   // ... details omitted ...
23136    /// }
23137    /// ```
23138    #[derive(Clone, Debug)]
23139    pub struct GetSecurityProfileGroup(
23140        RequestBuilder<crate::model::GetSecurityProfileGroupRequest>,
23141    );
23142
23143    impl GetSecurityProfileGroup {
23144        pub(crate) fn new(
23145            stub: std::sync::Arc<
23146                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23147            >,
23148        ) -> Self {
23149            Self(RequestBuilder::new(stub))
23150        }
23151
23152        /// Sets the full request, replacing any prior values.
23153        pub fn with_request<V: Into<crate::model::GetSecurityProfileGroupRequest>>(
23154            mut self,
23155            v: V,
23156        ) -> Self {
23157            self.0.request = v.into();
23158            self
23159        }
23160
23161        /// Sets all the options, replacing any prior values.
23162        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23163            self.0.options = v.into();
23164            self
23165        }
23166
23167        /// Sends the request.
23168        pub async fn send(self) -> Result<crate::model::SecurityProfileGroup> {
23169            (*self.0.stub)
23170                .get_security_profile_group(self.0.request, self.0.options)
23171                .await
23172                .map(crate::Response::into_body)
23173        }
23174
23175        /// Sets the value of [name][crate::model::GetSecurityProfileGroupRequest::name].
23176        ///
23177        /// This is a **required** field for requests.
23178        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23179            self.0.request.name = v.into();
23180            self
23181        }
23182    }
23183
23184    #[doc(hidden)]
23185    impl crate::RequestBuilder for GetSecurityProfileGroup {
23186        fn request_options(&mut self) -> &mut crate::RequestOptions {
23187            &mut self.0.options
23188        }
23189    }
23190
23191    /// The request builder for [OrganizationSecurityProfileGroupService::create_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::create_security_profile_group] calls.
23192    ///
23193    /// # Example
23194    /// ```
23195    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::CreateSecurityProfileGroup;
23196    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23197    /// use google_cloud_lro::Poller;
23198    ///
23199    /// let builder = prepare_request_builder();
23200    /// let response = builder.poller().until_done().await?;
23201    /// # Ok(()) }
23202    ///
23203    /// fn prepare_request_builder() -> CreateSecurityProfileGroup {
23204    ///   # panic!();
23205    ///   // ... details omitted ...
23206    /// }
23207    /// ```
23208    #[derive(Clone, Debug)]
23209    pub struct CreateSecurityProfileGroup(
23210        RequestBuilder<crate::model::CreateSecurityProfileGroupRequest>,
23211    );
23212
23213    impl CreateSecurityProfileGroup {
23214        pub(crate) fn new(
23215            stub: std::sync::Arc<
23216                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23217            >,
23218        ) -> Self {
23219            Self(RequestBuilder::new(stub))
23220        }
23221
23222        /// Sets the full request, replacing any prior values.
23223        pub fn with_request<V: Into<crate::model::CreateSecurityProfileGroupRequest>>(
23224            mut self,
23225            v: V,
23226        ) -> Self {
23227            self.0.request = v.into();
23228            self
23229        }
23230
23231        /// Sets all the options, replacing any prior values.
23232        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23233            self.0.options = v.into();
23234            self
23235        }
23236
23237        /// Sends the request.
23238        ///
23239        /// # Long running operations
23240        ///
23241        /// This starts, but does not poll, a longrunning operation. More information
23242        /// on [create_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::create_security_profile_group].
23243        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23244            (*self.0.stub)
23245                .create_security_profile_group(self.0.request, self.0.options)
23246                .await
23247                .map(crate::Response::into_body)
23248        }
23249
23250        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_security_profile_group`.
23251        pub fn poller(
23252            self,
23253        ) -> impl google_cloud_lro::Poller<
23254            crate::model::SecurityProfileGroup,
23255            crate::model::OperationMetadata,
23256        > {
23257            type Operation = google_cloud_lro::internal::Operation<
23258                crate::model::SecurityProfileGroup,
23259                crate::model::OperationMetadata,
23260            >;
23261            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
23262            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
23263            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
23264            if let Some(ref mut details) = poller_options.tracing {
23265                details.method_name = "google_cloud_networksecurity_v1::client::OrganizationSecurityProfileGroupService::create_security_profile_group::until_done";
23266            }
23267
23268            let stub = self.0.stub.clone();
23269            let mut options = self.0.options.clone();
23270            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
23271            let query = move |name| {
23272                let stub = stub.clone();
23273                let options = options.clone();
23274                async {
23275                    let op = GetOperation::new(stub)
23276                        .set_name(name)
23277                        .with_options(options)
23278                        .send()
23279                        .await?;
23280                    Ok(Operation::new(op))
23281                }
23282            };
23283
23284            let start = move || async {
23285                let op = self.send().await?;
23286                Ok(Operation::new(op))
23287            };
23288
23289            use google_cloud_lro::internal::PollerExt;
23290            {
23291                google_cloud_lro::internal::new_poller(
23292                    polling_error_policy,
23293                    polling_backoff_policy,
23294                    start,
23295                    query,
23296                )
23297            }
23298            .with_options(poller_options)
23299        }
23300
23301        /// Sets the value of [parent][crate::model::CreateSecurityProfileGroupRequest::parent].
23302        ///
23303        /// This is a **required** field for requests.
23304        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
23305            self.0.request.parent = v.into();
23306            self
23307        }
23308
23309        /// Sets the value of [security_profile_group_id][crate::model::CreateSecurityProfileGroupRequest::security_profile_group_id].
23310        ///
23311        /// This is a **required** field for requests.
23312        pub fn set_security_profile_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
23313            self.0.request.security_profile_group_id = v.into();
23314            self
23315        }
23316
23317        /// Sets the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
23318        ///
23319        /// This is a **required** field for requests.
23320        pub fn set_security_profile_group<T>(mut self, v: T) -> Self
23321        where
23322            T: std::convert::Into<crate::model::SecurityProfileGroup>,
23323        {
23324            self.0.request.security_profile_group = std::option::Option::Some(v.into());
23325            self
23326        }
23327
23328        /// Sets or clears the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
23329        ///
23330        /// This is a **required** field for requests.
23331        pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
23332        where
23333            T: std::convert::Into<crate::model::SecurityProfileGroup>,
23334        {
23335            self.0.request.security_profile_group = v.map(|x| x.into());
23336            self
23337        }
23338    }
23339
23340    #[doc(hidden)]
23341    impl crate::RequestBuilder for CreateSecurityProfileGroup {
23342        fn request_options(&mut self) -> &mut crate::RequestOptions {
23343            &mut self.0.options
23344        }
23345    }
23346
23347    /// The request builder for [OrganizationSecurityProfileGroupService::update_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::update_security_profile_group] calls.
23348    ///
23349    /// # Example
23350    /// ```
23351    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::UpdateSecurityProfileGroup;
23352    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23353    /// use google_cloud_lro::Poller;
23354    ///
23355    /// let builder = prepare_request_builder();
23356    /// let response = builder.poller().until_done().await?;
23357    /// # Ok(()) }
23358    ///
23359    /// fn prepare_request_builder() -> UpdateSecurityProfileGroup {
23360    ///   # panic!();
23361    ///   // ... details omitted ...
23362    /// }
23363    /// ```
23364    #[derive(Clone, Debug)]
23365    pub struct UpdateSecurityProfileGroup(
23366        RequestBuilder<crate::model::UpdateSecurityProfileGroupRequest>,
23367    );
23368
23369    impl UpdateSecurityProfileGroup {
23370        pub(crate) fn new(
23371            stub: std::sync::Arc<
23372                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23373            >,
23374        ) -> Self {
23375            Self(RequestBuilder::new(stub))
23376        }
23377
23378        /// Sets the full request, replacing any prior values.
23379        pub fn with_request<V: Into<crate::model::UpdateSecurityProfileGroupRequest>>(
23380            mut self,
23381            v: V,
23382        ) -> Self {
23383            self.0.request = v.into();
23384            self
23385        }
23386
23387        /// Sets all the options, replacing any prior values.
23388        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23389            self.0.options = v.into();
23390            self
23391        }
23392
23393        /// Sends the request.
23394        ///
23395        /// # Long running operations
23396        ///
23397        /// This starts, but does not poll, a longrunning operation. More information
23398        /// on [update_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::update_security_profile_group].
23399        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23400            (*self.0.stub)
23401                .update_security_profile_group(self.0.request, self.0.options)
23402                .await
23403                .map(crate::Response::into_body)
23404        }
23405
23406        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_security_profile_group`.
23407        pub fn poller(
23408            self,
23409        ) -> impl google_cloud_lro::Poller<
23410            crate::model::SecurityProfileGroup,
23411            crate::model::OperationMetadata,
23412        > {
23413            type Operation = google_cloud_lro::internal::Operation<
23414                crate::model::SecurityProfileGroup,
23415                crate::model::OperationMetadata,
23416            >;
23417            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
23418            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
23419            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
23420            if let Some(ref mut details) = poller_options.tracing {
23421                details.method_name = "google_cloud_networksecurity_v1::client::OrganizationSecurityProfileGroupService::update_security_profile_group::until_done";
23422            }
23423
23424            let stub = self.0.stub.clone();
23425            let mut options = self.0.options.clone();
23426            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
23427            let query = move |name| {
23428                let stub = stub.clone();
23429                let options = options.clone();
23430                async {
23431                    let op = GetOperation::new(stub)
23432                        .set_name(name)
23433                        .with_options(options)
23434                        .send()
23435                        .await?;
23436                    Ok(Operation::new(op))
23437                }
23438            };
23439
23440            let start = move || async {
23441                let op = self.send().await?;
23442                Ok(Operation::new(op))
23443            };
23444
23445            use google_cloud_lro::internal::PollerExt;
23446            {
23447                google_cloud_lro::internal::new_poller(
23448                    polling_error_policy,
23449                    polling_backoff_policy,
23450                    start,
23451                    query,
23452                )
23453            }
23454            .with_options(poller_options)
23455        }
23456
23457        /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
23458        ///
23459        /// This is a **required** field for requests.
23460        pub fn set_update_mask<T>(mut self, v: T) -> Self
23461        where
23462            T: std::convert::Into<wkt::FieldMask>,
23463        {
23464            self.0.request.update_mask = std::option::Option::Some(v.into());
23465            self
23466        }
23467
23468        /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
23469        ///
23470        /// This is a **required** field for requests.
23471        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
23472        where
23473            T: std::convert::Into<wkt::FieldMask>,
23474        {
23475            self.0.request.update_mask = v.map(|x| x.into());
23476            self
23477        }
23478
23479        /// Sets the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
23480        ///
23481        /// This is a **required** field for requests.
23482        pub fn set_security_profile_group<T>(mut self, v: T) -> Self
23483        where
23484            T: std::convert::Into<crate::model::SecurityProfileGroup>,
23485        {
23486            self.0.request.security_profile_group = std::option::Option::Some(v.into());
23487            self
23488        }
23489
23490        /// Sets or clears the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
23491        ///
23492        /// This is a **required** field for requests.
23493        pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
23494        where
23495            T: std::convert::Into<crate::model::SecurityProfileGroup>,
23496        {
23497            self.0.request.security_profile_group = v.map(|x| x.into());
23498            self
23499        }
23500    }
23501
23502    #[doc(hidden)]
23503    impl crate::RequestBuilder for UpdateSecurityProfileGroup {
23504        fn request_options(&mut self) -> &mut crate::RequestOptions {
23505            &mut self.0.options
23506        }
23507    }
23508
23509    /// The request builder for [OrganizationSecurityProfileGroupService::delete_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile_group] calls.
23510    ///
23511    /// # Example
23512    /// ```
23513    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::DeleteSecurityProfileGroup;
23514    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23515    /// use google_cloud_lro::Poller;
23516    ///
23517    /// let builder = prepare_request_builder();
23518    /// let response = builder.poller().until_done().await?;
23519    /// # Ok(()) }
23520    ///
23521    /// fn prepare_request_builder() -> DeleteSecurityProfileGroup {
23522    ///   # panic!();
23523    ///   // ... details omitted ...
23524    /// }
23525    /// ```
23526    #[derive(Clone, Debug)]
23527    pub struct DeleteSecurityProfileGroup(
23528        RequestBuilder<crate::model::DeleteSecurityProfileGroupRequest>,
23529    );
23530
23531    impl DeleteSecurityProfileGroup {
23532        pub(crate) fn new(
23533            stub: std::sync::Arc<
23534                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23535            >,
23536        ) -> Self {
23537            Self(RequestBuilder::new(stub))
23538        }
23539
23540        /// Sets the full request, replacing any prior values.
23541        pub fn with_request<V: Into<crate::model::DeleteSecurityProfileGroupRequest>>(
23542            mut self,
23543            v: V,
23544        ) -> Self {
23545            self.0.request = v.into();
23546            self
23547        }
23548
23549        /// Sets all the options, replacing any prior values.
23550        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23551            self.0.options = v.into();
23552            self
23553        }
23554
23555        /// Sends the request.
23556        ///
23557        /// # Long running operations
23558        ///
23559        /// This starts, but does not poll, a longrunning operation. More information
23560        /// on [delete_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile_group].
23561        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23562            (*self.0.stub)
23563                .delete_security_profile_group(self.0.request, self.0.options)
23564                .await
23565                .map(crate::Response::into_body)
23566        }
23567
23568        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_security_profile_group`.
23569        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
23570            type Operation =
23571                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
23572            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
23573            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
23574            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
23575            if let Some(ref mut details) = poller_options.tracing {
23576                details.method_name = "google_cloud_networksecurity_v1::client::OrganizationSecurityProfileGroupService::delete_security_profile_group::until_done";
23577            }
23578
23579            let stub = self.0.stub.clone();
23580            let mut options = self.0.options.clone();
23581            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
23582            let query = move |name| {
23583                let stub = stub.clone();
23584                let options = options.clone();
23585                async {
23586                    let op = GetOperation::new(stub)
23587                        .set_name(name)
23588                        .with_options(options)
23589                        .send()
23590                        .await?;
23591                    Ok(Operation::new(op))
23592                }
23593            };
23594
23595            let start = move || async {
23596                let op = self.send().await?;
23597                Ok(Operation::new(op))
23598            };
23599
23600            use google_cloud_lro::internal::PollerExt;
23601            {
23602                google_cloud_lro::internal::new_unit_response_poller(
23603                    polling_error_policy,
23604                    polling_backoff_policy,
23605                    start,
23606                    query,
23607                )
23608            }
23609            .with_options(poller_options)
23610        }
23611
23612        /// Sets the value of [name][crate::model::DeleteSecurityProfileGroupRequest::name].
23613        ///
23614        /// This is a **required** field for requests.
23615        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23616            self.0.request.name = v.into();
23617            self
23618        }
23619
23620        /// Sets the value of [etag][crate::model::DeleteSecurityProfileGroupRequest::etag].
23621        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
23622            self.0.request.etag = v.into();
23623            self
23624        }
23625    }
23626
23627    #[doc(hidden)]
23628    impl crate::RequestBuilder for DeleteSecurityProfileGroup {
23629        fn request_options(&mut self) -> &mut crate::RequestOptions {
23630            &mut self.0.options
23631        }
23632    }
23633
23634    /// The request builder for [OrganizationSecurityProfileGroupService::list_security_profiles][crate::client::OrganizationSecurityProfileGroupService::list_security_profiles] calls.
23635    ///
23636    /// # Example
23637    /// ```
23638    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListSecurityProfiles;
23639    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23640    /// use google_cloud_gax::paginator::ItemPaginator;
23641    ///
23642    /// let builder = prepare_request_builder();
23643    /// let mut items = builder.by_item();
23644    /// while let Some(result) = items.next().await {
23645    ///   let item = result?;
23646    /// }
23647    /// # Ok(()) }
23648    ///
23649    /// fn prepare_request_builder() -> ListSecurityProfiles {
23650    ///   # panic!();
23651    ///   // ... details omitted ...
23652    /// }
23653    /// ```
23654    #[derive(Clone, Debug)]
23655    pub struct ListSecurityProfiles(RequestBuilder<crate::model::ListSecurityProfilesRequest>);
23656
23657    impl ListSecurityProfiles {
23658        pub(crate) fn new(
23659            stub: std::sync::Arc<
23660                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23661            >,
23662        ) -> Self {
23663            Self(RequestBuilder::new(stub))
23664        }
23665
23666        /// Sets the full request, replacing any prior values.
23667        pub fn with_request<V: Into<crate::model::ListSecurityProfilesRequest>>(
23668            mut self,
23669            v: V,
23670        ) -> Self {
23671            self.0.request = v.into();
23672            self
23673        }
23674
23675        /// Sets all the options, replacing any prior values.
23676        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23677            self.0.options = v.into();
23678            self
23679        }
23680
23681        /// Sends the request.
23682        pub async fn send(self) -> Result<crate::model::ListSecurityProfilesResponse> {
23683            (*self.0.stub)
23684                .list_security_profiles(self.0.request, self.0.options)
23685                .await
23686                .map(crate::Response::into_body)
23687        }
23688
23689        /// Streams each page in the collection.
23690        pub fn by_page(
23691            self,
23692        ) -> impl google_cloud_gax::paginator::Paginator<
23693            crate::model::ListSecurityProfilesResponse,
23694            crate::Error,
23695        > {
23696            use std::clone::Clone;
23697            let token = self.0.request.page_token.clone();
23698            let execute = move |token: String| {
23699                let mut builder = self.clone();
23700                builder.0.request = builder.0.request.set_page_token(token);
23701                builder.send()
23702            };
23703            google_cloud_gax::paginator::internal::new_paginator(token, execute)
23704        }
23705
23706        /// Streams each item in the collection.
23707        pub fn by_item(
23708            self,
23709        ) -> impl google_cloud_gax::paginator::ItemPaginator<
23710            crate::model::ListSecurityProfilesResponse,
23711            crate::Error,
23712        > {
23713            use google_cloud_gax::paginator::Paginator;
23714            self.by_page().items()
23715        }
23716
23717        /// Sets the value of [parent][crate::model::ListSecurityProfilesRequest::parent].
23718        ///
23719        /// This is a **required** field for requests.
23720        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
23721            self.0.request.parent = v.into();
23722            self
23723        }
23724
23725        /// Sets the value of [page_size][crate::model::ListSecurityProfilesRequest::page_size].
23726        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
23727            self.0.request.page_size = v.into();
23728            self
23729        }
23730
23731        /// Sets the value of [page_token][crate::model::ListSecurityProfilesRequest::page_token].
23732        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
23733            self.0.request.page_token = v.into();
23734            self
23735        }
23736    }
23737
23738    #[doc(hidden)]
23739    impl crate::RequestBuilder for ListSecurityProfiles {
23740        fn request_options(&mut self) -> &mut crate::RequestOptions {
23741            &mut self.0.options
23742        }
23743    }
23744
23745    /// The request builder for [OrganizationSecurityProfileGroupService::get_security_profile][crate::client::OrganizationSecurityProfileGroupService::get_security_profile] calls.
23746    ///
23747    /// # Example
23748    /// ```
23749    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetSecurityProfile;
23750    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23751    ///
23752    /// let builder = prepare_request_builder();
23753    /// let response = builder.send().await?;
23754    /// # Ok(()) }
23755    ///
23756    /// fn prepare_request_builder() -> GetSecurityProfile {
23757    ///   # panic!();
23758    ///   // ... details omitted ...
23759    /// }
23760    /// ```
23761    #[derive(Clone, Debug)]
23762    pub struct GetSecurityProfile(RequestBuilder<crate::model::GetSecurityProfileRequest>);
23763
23764    impl GetSecurityProfile {
23765        pub(crate) fn new(
23766            stub: std::sync::Arc<
23767                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23768            >,
23769        ) -> Self {
23770            Self(RequestBuilder::new(stub))
23771        }
23772
23773        /// Sets the full request, replacing any prior values.
23774        pub fn with_request<V: Into<crate::model::GetSecurityProfileRequest>>(
23775            mut self,
23776            v: V,
23777        ) -> Self {
23778            self.0.request = v.into();
23779            self
23780        }
23781
23782        /// Sets all the options, replacing any prior values.
23783        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23784            self.0.options = v.into();
23785            self
23786        }
23787
23788        /// Sends the request.
23789        pub async fn send(self) -> Result<crate::model::SecurityProfile> {
23790            (*self.0.stub)
23791                .get_security_profile(self.0.request, self.0.options)
23792                .await
23793                .map(crate::Response::into_body)
23794        }
23795
23796        /// Sets the value of [name][crate::model::GetSecurityProfileRequest::name].
23797        ///
23798        /// This is a **required** field for requests.
23799        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23800            self.0.request.name = v.into();
23801            self
23802        }
23803    }
23804
23805    #[doc(hidden)]
23806    impl crate::RequestBuilder for GetSecurityProfile {
23807        fn request_options(&mut self) -> &mut crate::RequestOptions {
23808            &mut self.0.options
23809        }
23810    }
23811
23812    /// The request builder for [OrganizationSecurityProfileGroupService::create_security_profile][crate::client::OrganizationSecurityProfileGroupService::create_security_profile] calls.
23813    ///
23814    /// # Example
23815    /// ```
23816    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::CreateSecurityProfile;
23817    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23818    /// use google_cloud_lro::Poller;
23819    ///
23820    /// let builder = prepare_request_builder();
23821    /// let response = builder.poller().until_done().await?;
23822    /// # Ok(()) }
23823    ///
23824    /// fn prepare_request_builder() -> CreateSecurityProfile {
23825    ///   # panic!();
23826    ///   // ... details omitted ...
23827    /// }
23828    /// ```
23829    #[derive(Clone, Debug)]
23830    pub struct CreateSecurityProfile(RequestBuilder<crate::model::CreateSecurityProfileRequest>);
23831
23832    impl CreateSecurityProfile {
23833        pub(crate) fn new(
23834            stub: std::sync::Arc<
23835                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23836            >,
23837        ) -> Self {
23838            Self(RequestBuilder::new(stub))
23839        }
23840
23841        /// Sets the full request, replacing any prior values.
23842        pub fn with_request<V: Into<crate::model::CreateSecurityProfileRequest>>(
23843            mut self,
23844            v: V,
23845        ) -> Self {
23846            self.0.request = v.into();
23847            self
23848        }
23849
23850        /// Sets all the options, replacing any prior values.
23851        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23852            self.0.options = v.into();
23853            self
23854        }
23855
23856        /// Sends the request.
23857        ///
23858        /// # Long running operations
23859        ///
23860        /// This starts, but does not poll, a longrunning operation. More information
23861        /// on [create_security_profile][crate::client::OrganizationSecurityProfileGroupService::create_security_profile].
23862        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23863            (*self.0.stub)
23864                .create_security_profile(self.0.request, self.0.options)
23865                .await
23866                .map(crate::Response::into_body)
23867        }
23868
23869        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_security_profile`.
23870        pub fn poller(
23871            self,
23872        ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
23873        {
23874            type Operation = google_cloud_lro::internal::Operation<
23875                crate::model::SecurityProfile,
23876                crate::model::OperationMetadata,
23877            >;
23878            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
23879            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
23880            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
23881            if let Some(ref mut details) = poller_options.tracing {
23882                details.method_name = "google_cloud_networksecurity_v1::client::OrganizationSecurityProfileGroupService::create_security_profile::until_done";
23883            }
23884
23885            let stub = self.0.stub.clone();
23886            let mut options = self.0.options.clone();
23887            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
23888            let query = move |name| {
23889                let stub = stub.clone();
23890                let options = options.clone();
23891                async {
23892                    let op = GetOperation::new(stub)
23893                        .set_name(name)
23894                        .with_options(options)
23895                        .send()
23896                        .await?;
23897                    Ok(Operation::new(op))
23898                }
23899            };
23900
23901            let start = move || async {
23902                let op = self.send().await?;
23903                Ok(Operation::new(op))
23904            };
23905
23906            use google_cloud_lro::internal::PollerExt;
23907            {
23908                google_cloud_lro::internal::new_poller(
23909                    polling_error_policy,
23910                    polling_backoff_policy,
23911                    start,
23912                    query,
23913                )
23914            }
23915            .with_options(poller_options)
23916        }
23917
23918        /// Sets the value of [parent][crate::model::CreateSecurityProfileRequest::parent].
23919        ///
23920        /// This is a **required** field for requests.
23921        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
23922            self.0.request.parent = v.into();
23923            self
23924        }
23925
23926        /// Sets the value of [security_profile_id][crate::model::CreateSecurityProfileRequest::security_profile_id].
23927        ///
23928        /// This is a **required** field for requests.
23929        pub fn set_security_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
23930            self.0.request.security_profile_id = v.into();
23931            self
23932        }
23933
23934        /// Sets the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
23935        ///
23936        /// This is a **required** field for requests.
23937        pub fn set_security_profile<T>(mut self, v: T) -> Self
23938        where
23939            T: std::convert::Into<crate::model::SecurityProfile>,
23940        {
23941            self.0.request.security_profile = std::option::Option::Some(v.into());
23942            self
23943        }
23944
23945        /// Sets or clears the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
23946        ///
23947        /// This is a **required** field for requests.
23948        pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
23949        where
23950            T: std::convert::Into<crate::model::SecurityProfile>,
23951        {
23952            self.0.request.security_profile = v.map(|x| x.into());
23953            self
23954        }
23955    }
23956
23957    #[doc(hidden)]
23958    impl crate::RequestBuilder for CreateSecurityProfile {
23959        fn request_options(&mut self) -> &mut crate::RequestOptions {
23960            &mut self.0.options
23961        }
23962    }
23963
23964    /// The request builder for [OrganizationSecurityProfileGroupService::update_security_profile][crate::client::OrganizationSecurityProfileGroupService::update_security_profile] calls.
23965    ///
23966    /// # Example
23967    /// ```
23968    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::UpdateSecurityProfile;
23969    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23970    /// use google_cloud_lro::Poller;
23971    ///
23972    /// let builder = prepare_request_builder();
23973    /// let response = builder.poller().until_done().await?;
23974    /// # Ok(()) }
23975    ///
23976    /// fn prepare_request_builder() -> UpdateSecurityProfile {
23977    ///   # panic!();
23978    ///   // ... details omitted ...
23979    /// }
23980    /// ```
23981    #[derive(Clone, Debug)]
23982    pub struct UpdateSecurityProfile(RequestBuilder<crate::model::UpdateSecurityProfileRequest>);
23983
23984    impl UpdateSecurityProfile {
23985        pub(crate) fn new(
23986            stub: std::sync::Arc<
23987                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23988            >,
23989        ) -> Self {
23990            Self(RequestBuilder::new(stub))
23991        }
23992
23993        /// Sets the full request, replacing any prior values.
23994        pub fn with_request<V: Into<crate::model::UpdateSecurityProfileRequest>>(
23995            mut self,
23996            v: V,
23997        ) -> Self {
23998            self.0.request = v.into();
23999            self
24000        }
24001
24002        /// Sets all the options, replacing any prior values.
24003        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24004            self.0.options = v.into();
24005            self
24006        }
24007
24008        /// Sends the request.
24009        ///
24010        /// # Long running operations
24011        ///
24012        /// This starts, but does not poll, a longrunning operation. More information
24013        /// on [update_security_profile][crate::client::OrganizationSecurityProfileGroupService::update_security_profile].
24014        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
24015            (*self.0.stub)
24016                .update_security_profile(self.0.request, self.0.options)
24017                .await
24018                .map(crate::Response::into_body)
24019        }
24020
24021        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_security_profile`.
24022        pub fn poller(
24023            self,
24024        ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
24025        {
24026            type Operation = google_cloud_lro::internal::Operation<
24027                crate::model::SecurityProfile,
24028                crate::model::OperationMetadata,
24029            >;
24030            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
24031            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
24032            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
24033            if let Some(ref mut details) = poller_options.tracing {
24034                details.method_name = "google_cloud_networksecurity_v1::client::OrganizationSecurityProfileGroupService::update_security_profile::until_done";
24035            }
24036
24037            let stub = self.0.stub.clone();
24038            let mut options = self.0.options.clone();
24039            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
24040            let query = move |name| {
24041                let stub = stub.clone();
24042                let options = options.clone();
24043                async {
24044                    let op = GetOperation::new(stub)
24045                        .set_name(name)
24046                        .with_options(options)
24047                        .send()
24048                        .await?;
24049                    Ok(Operation::new(op))
24050                }
24051            };
24052
24053            let start = move || async {
24054                let op = self.send().await?;
24055                Ok(Operation::new(op))
24056            };
24057
24058            use google_cloud_lro::internal::PollerExt;
24059            {
24060                google_cloud_lro::internal::new_poller(
24061                    polling_error_policy,
24062                    polling_backoff_policy,
24063                    start,
24064                    query,
24065                )
24066            }
24067            .with_options(poller_options)
24068        }
24069
24070        /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
24071        ///
24072        /// This is a **required** field for requests.
24073        pub fn set_update_mask<T>(mut self, v: T) -> Self
24074        where
24075            T: std::convert::Into<wkt::FieldMask>,
24076        {
24077            self.0.request.update_mask = std::option::Option::Some(v.into());
24078            self
24079        }
24080
24081        /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
24082        ///
24083        /// This is a **required** field for requests.
24084        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
24085        where
24086            T: std::convert::Into<wkt::FieldMask>,
24087        {
24088            self.0.request.update_mask = v.map(|x| x.into());
24089            self
24090        }
24091
24092        /// Sets the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
24093        ///
24094        /// This is a **required** field for requests.
24095        pub fn set_security_profile<T>(mut self, v: T) -> Self
24096        where
24097            T: std::convert::Into<crate::model::SecurityProfile>,
24098        {
24099            self.0.request.security_profile = std::option::Option::Some(v.into());
24100            self
24101        }
24102
24103        /// Sets or clears the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
24104        ///
24105        /// This is a **required** field for requests.
24106        pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
24107        where
24108            T: std::convert::Into<crate::model::SecurityProfile>,
24109        {
24110            self.0.request.security_profile = v.map(|x| x.into());
24111            self
24112        }
24113    }
24114
24115    #[doc(hidden)]
24116    impl crate::RequestBuilder for UpdateSecurityProfile {
24117        fn request_options(&mut self) -> &mut crate::RequestOptions {
24118            &mut self.0.options
24119        }
24120    }
24121
24122    /// The request builder for [OrganizationSecurityProfileGroupService::delete_security_profile][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile] calls.
24123    ///
24124    /// # Example
24125    /// ```
24126    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::DeleteSecurityProfile;
24127    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24128    /// use google_cloud_lro::Poller;
24129    ///
24130    /// let builder = prepare_request_builder();
24131    /// let response = builder.poller().until_done().await?;
24132    /// # Ok(()) }
24133    ///
24134    /// fn prepare_request_builder() -> DeleteSecurityProfile {
24135    ///   # panic!();
24136    ///   // ... details omitted ...
24137    /// }
24138    /// ```
24139    #[derive(Clone, Debug)]
24140    pub struct DeleteSecurityProfile(RequestBuilder<crate::model::DeleteSecurityProfileRequest>);
24141
24142    impl DeleteSecurityProfile {
24143        pub(crate) fn new(
24144            stub: std::sync::Arc<
24145                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24146            >,
24147        ) -> Self {
24148            Self(RequestBuilder::new(stub))
24149        }
24150
24151        /// Sets the full request, replacing any prior values.
24152        pub fn with_request<V: Into<crate::model::DeleteSecurityProfileRequest>>(
24153            mut self,
24154            v: V,
24155        ) -> Self {
24156            self.0.request = v.into();
24157            self
24158        }
24159
24160        /// Sets all the options, replacing any prior values.
24161        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24162            self.0.options = v.into();
24163            self
24164        }
24165
24166        /// Sends the request.
24167        ///
24168        /// # Long running operations
24169        ///
24170        /// This starts, but does not poll, a longrunning operation. More information
24171        /// on [delete_security_profile][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile].
24172        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
24173            (*self.0.stub)
24174                .delete_security_profile(self.0.request, self.0.options)
24175                .await
24176                .map(crate::Response::into_body)
24177        }
24178
24179        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_security_profile`.
24180        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
24181            type Operation =
24182                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
24183            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
24184            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
24185            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
24186            if let Some(ref mut details) = poller_options.tracing {
24187                details.method_name = "google_cloud_networksecurity_v1::client::OrganizationSecurityProfileGroupService::delete_security_profile::until_done";
24188            }
24189
24190            let stub = self.0.stub.clone();
24191            let mut options = self.0.options.clone();
24192            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
24193            let query = move |name| {
24194                let stub = stub.clone();
24195                let options = options.clone();
24196                async {
24197                    let op = GetOperation::new(stub)
24198                        .set_name(name)
24199                        .with_options(options)
24200                        .send()
24201                        .await?;
24202                    Ok(Operation::new(op))
24203                }
24204            };
24205
24206            let start = move || async {
24207                let op = self.send().await?;
24208                Ok(Operation::new(op))
24209            };
24210
24211            use google_cloud_lro::internal::PollerExt;
24212            {
24213                google_cloud_lro::internal::new_unit_response_poller(
24214                    polling_error_policy,
24215                    polling_backoff_policy,
24216                    start,
24217                    query,
24218                )
24219            }
24220            .with_options(poller_options)
24221        }
24222
24223        /// Sets the value of [name][crate::model::DeleteSecurityProfileRequest::name].
24224        ///
24225        /// This is a **required** field for requests.
24226        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24227            self.0.request.name = v.into();
24228            self
24229        }
24230
24231        /// Sets the value of [etag][crate::model::DeleteSecurityProfileRequest::etag].
24232        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
24233            self.0.request.etag = v.into();
24234            self
24235        }
24236    }
24237
24238    #[doc(hidden)]
24239    impl crate::RequestBuilder for DeleteSecurityProfile {
24240        fn request_options(&mut self) -> &mut crate::RequestOptions {
24241            &mut self.0.options
24242        }
24243    }
24244
24245    /// The request builder for [OrganizationSecurityProfileGroupService::list_locations][crate::client::OrganizationSecurityProfileGroupService::list_locations] calls.
24246    ///
24247    /// # Example
24248    /// ```
24249    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListLocations;
24250    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24251    /// use google_cloud_gax::paginator::ItemPaginator;
24252    ///
24253    /// let builder = prepare_request_builder();
24254    /// let mut items = builder.by_item();
24255    /// while let Some(result) = items.next().await {
24256    ///   let item = result?;
24257    /// }
24258    /// # Ok(()) }
24259    ///
24260    /// fn prepare_request_builder() -> ListLocations {
24261    ///   # panic!();
24262    ///   // ... details omitted ...
24263    /// }
24264    /// ```
24265    #[derive(Clone, Debug)]
24266    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
24267
24268    impl ListLocations {
24269        pub(crate) fn new(
24270            stub: std::sync::Arc<
24271                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24272            >,
24273        ) -> Self {
24274            Self(RequestBuilder::new(stub))
24275        }
24276
24277        /// Sets the full request, replacing any prior values.
24278        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
24279            mut self,
24280            v: V,
24281        ) -> Self {
24282            self.0.request = v.into();
24283            self
24284        }
24285
24286        /// Sets all the options, replacing any prior values.
24287        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24288            self.0.options = v.into();
24289            self
24290        }
24291
24292        /// Sends the request.
24293        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
24294            (*self.0.stub)
24295                .list_locations(self.0.request, self.0.options)
24296                .await
24297                .map(crate::Response::into_body)
24298        }
24299
24300        /// Streams each page in the collection.
24301        pub fn by_page(
24302            self,
24303        ) -> impl google_cloud_gax::paginator::Paginator<
24304            google_cloud_location::model::ListLocationsResponse,
24305            crate::Error,
24306        > {
24307            use std::clone::Clone;
24308            let token = self.0.request.page_token.clone();
24309            let execute = move |token: String| {
24310                let mut builder = self.clone();
24311                builder.0.request = builder.0.request.set_page_token(token);
24312                builder.send()
24313            };
24314            google_cloud_gax::paginator::internal::new_paginator(token, execute)
24315        }
24316
24317        /// Streams each item in the collection.
24318        pub fn by_item(
24319            self,
24320        ) -> impl google_cloud_gax::paginator::ItemPaginator<
24321            google_cloud_location::model::ListLocationsResponse,
24322            crate::Error,
24323        > {
24324            use google_cloud_gax::paginator::Paginator;
24325            self.by_page().items()
24326        }
24327
24328        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
24329        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24330            self.0.request.name = v.into();
24331            self
24332        }
24333
24334        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
24335        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
24336            self.0.request.filter = v.into();
24337            self
24338        }
24339
24340        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
24341        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
24342            self.0.request.page_size = v.into();
24343            self
24344        }
24345
24346        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
24347        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
24348            self.0.request.page_token = v.into();
24349            self
24350        }
24351    }
24352
24353    #[doc(hidden)]
24354    impl crate::RequestBuilder for ListLocations {
24355        fn request_options(&mut self) -> &mut crate::RequestOptions {
24356            &mut self.0.options
24357        }
24358    }
24359
24360    /// The request builder for [OrganizationSecurityProfileGroupService::get_location][crate::client::OrganizationSecurityProfileGroupService::get_location] calls.
24361    ///
24362    /// # Example
24363    /// ```
24364    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetLocation;
24365    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24366    ///
24367    /// let builder = prepare_request_builder();
24368    /// let response = builder.send().await?;
24369    /// # Ok(()) }
24370    ///
24371    /// fn prepare_request_builder() -> GetLocation {
24372    ///   # panic!();
24373    ///   // ... details omitted ...
24374    /// }
24375    /// ```
24376    #[derive(Clone, Debug)]
24377    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
24378
24379    impl GetLocation {
24380        pub(crate) fn new(
24381            stub: std::sync::Arc<
24382                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24383            >,
24384        ) -> Self {
24385            Self(RequestBuilder::new(stub))
24386        }
24387
24388        /// Sets the full request, replacing any prior values.
24389        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
24390            mut self,
24391            v: V,
24392        ) -> Self {
24393            self.0.request = v.into();
24394            self
24395        }
24396
24397        /// Sets all the options, replacing any prior values.
24398        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24399            self.0.options = v.into();
24400            self
24401        }
24402
24403        /// Sends the request.
24404        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
24405            (*self.0.stub)
24406                .get_location(self.0.request, self.0.options)
24407                .await
24408                .map(crate::Response::into_body)
24409        }
24410
24411        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
24412        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24413            self.0.request.name = v.into();
24414            self
24415        }
24416    }
24417
24418    #[doc(hidden)]
24419    impl crate::RequestBuilder for GetLocation {
24420        fn request_options(&mut self) -> &mut crate::RequestOptions {
24421            &mut self.0.options
24422        }
24423    }
24424
24425    /// The request builder for [OrganizationSecurityProfileGroupService::set_iam_policy][crate::client::OrganizationSecurityProfileGroupService::set_iam_policy] calls.
24426    ///
24427    /// # Example
24428    /// ```
24429    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::SetIamPolicy;
24430    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24431    ///
24432    /// let builder = prepare_request_builder();
24433    /// let response = builder.send().await?;
24434    /// # Ok(()) }
24435    ///
24436    /// fn prepare_request_builder() -> SetIamPolicy {
24437    ///   # panic!();
24438    ///   // ... details omitted ...
24439    /// }
24440    /// ```
24441    #[derive(Clone, Debug)]
24442    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
24443
24444    impl SetIamPolicy {
24445        pub(crate) fn new(
24446            stub: std::sync::Arc<
24447                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24448            >,
24449        ) -> Self {
24450            Self(RequestBuilder::new(stub))
24451        }
24452
24453        /// Sets the full request, replacing any prior values.
24454        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
24455            mut self,
24456            v: V,
24457        ) -> Self {
24458            self.0.request = v.into();
24459            self
24460        }
24461
24462        /// Sets all the options, replacing any prior values.
24463        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24464            self.0.options = v.into();
24465            self
24466        }
24467
24468        /// Sends the request.
24469        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
24470            (*self.0.stub)
24471                .set_iam_policy(self.0.request, self.0.options)
24472                .await
24473                .map(crate::Response::into_body)
24474        }
24475
24476        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
24477        ///
24478        /// This is a **required** field for requests.
24479        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
24480            self.0.request.resource = v.into();
24481            self
24482        }
24483
24484        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
24485        ///
24486        /// This is a **required** field for requests.
24487        pub fn set_policy<T>(mut self, v: T) -> Self
24488        where
24489            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
24490        {
24491            self.0.request.policy = std::option::Option::Some(v.into());
24492            self
24493        }
24494
24495        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
24496        ///
24497        /// This is a **required** field for requests.
24498        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
24499        where
24500            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
24501        {
24502            self.0.request.policy = v.map(|x| x.into());
24503            self
24504        }
24505
24506        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
24507        pub fn set_update_mask<T>(mut self, v: T) -> Self
24508        where
24509            T: std::convert::Into<wkt::FieldMask>,
24510        {
24511            self.0.request.update_mask = std::option::Option::Some(v.into());
24512            self
24513        }
24514
24515        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
24516        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
24517        where
24518            T: std::convert::Into<wkt::FieldMask>,
24519        {
24520            self.0.request.update_mask = v.map(|x| x.into());
24521            self
24522        }
24523    }
24524
24525    #[doc(hidden)]
24526    impl crate::RequestBuilder for SetIamPolicy {
24527        fn request_options(&mut self) -> &mut crate::RequestOptions {
24528            &mut self.0.options
24529        }
24530    }
24531
24532    /// The request builder for [OrganizationSecurityProfileGroupService::get_iam_policy][crate::client::OrganizationSecurityProfileGroupService::get_iam_policy] calls.
24533    ///
24534    /// # Example
24535    /// ```
24536    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetIamPolicy;
24537    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24538    ///
24539    /// let builder = prepare_request_builder();
24540    /// let response = builder.send().await?;
24541    /// # Ok(()) }
24542    ///
24543    /// fn prepare_request_builder() -> GetIamPolicy {
24544    ///   # panic!();
24545    ///   // ... details omitted ...
24546    /// }
24547    /// ```
24548    #[derive(Clone, Debug)]
24549    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
24550
24551    impl GetIamPolicy {
24552        pub(crate) fn new(
24553            stub: std::sync::Arc<
24554                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24555            >,
24556        ) -> Self {
24557            Self(RequestBuilder::new(stub))
24558        }
24559
24560        /// Sets the full request, replacing any prior values.
24561        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
24562            mut self,
24563            v: V,
24564        ) -> Self {
24565            self.0.request = v.into();
24566            self
24567        }
24568
24569        /// Sets all the options, replacing any prior values.
24570        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24571            self.0.options = v.into();
24572            self
24573        }
24574
24575        /// Sends the request.
24576        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
24577            (*self.0.stub)
24578                .get_iam_policy(self.0.request, self.0.options)
24579                .await
24580                .map(crate::Response::into_body)
24581        }
24582
24583        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
24584        ///
24585        /// This is a **required** field for requests.
24586        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
24587            self.0.request.resource = v.into();
24588            self
24589        }
24590
24591        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
24592        pub fn set_options<T>(mut self, v: T) -> Self
24593        where
24594            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
24595        {
24596            self.0.request.options = std::option::Option::Some(v.into());
24597            self
24598        }
24599
24600        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
24601        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
24602        where
24603            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
24604        {
24605            self.0.request.options = v.map(|x| x.into());
24606            self
24607        }
24608    }
24609
24610    #[doc(hidden)]
24611    impl crate::RequestBuilder for GetIamPolicy {
24612        fn request_options(&mut self) -> &mut crate::RequestOptions {
24613            &mut self.0.options
24614        }
24615    }
24616
24617    /// The request builder for [OrganizationSecurityProfileGroupService::test_iam_permissions][crate::client::OrganizationSecurityProfileGroupService::test_iam_permissions] calls.
24618    ///
24619    /// # Example
24620    /// ```
24621    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::TestIamPermissions;
24622    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24623    ///
24624    /// let builder = prepare_request_builder();
24625    /// let response = builder.send().await?;
24626    /// # Ok(()) }
24627    ///
24628    /// fn prepare_request_builder() -> TestIamPermissions {
24629    ///   # panic!();
24630    ///   // ... details omitted ...
24631    /// }
24632    /// ```
24633    #[derive(Clone, Debug)]
24634    pub struct TestIamPermissions(
24635        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
24636    );
24637
24638    impl TestIamPermissions {
24639        pub(crate) fn new(
24640            stub: std::sync::Arc<
24641                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24642            >,
24643        ) -> Self {
24644            Self(RequestBuilder::new(stub))
24645        }
24646
24647        /// Sets the full request, replacing any prior values.
24648        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
24649            mut self,
24650            v: V,
24651        ) -> Self {
24652            self.0.request = v.into();
24653            self
24654        }
24655
24656        /// Sets all the options, replacing any prior values.
24657        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24658            self.0.options = v.into();
24659            self
24660        }
24661
24662        /// Sends the request.
24663        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
24664            (*self.0.stub)
24665                .test_iam_permissions(self.0.request, self.0.options)
24666                .await
24667                .map(crate::Response::into_body)
24668        }
24669
24670        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
24671        ///
24672        /// This is a **required** field for requests.
24673        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
24674            self.0.request.resource = v.into();
24675            self
24676        }
24677
24678        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
24679        ///
24680        /// This is a **required** field for requests.
24681        pub fn set_permissions<T, V>(mut self, v: T) -> Self
24682        where
24683            T: std::iter::IntoIterator<Item = V>,
24684            V: std::convert::Into<std::string::String>,
24685        {
24686            use std::iter::Iterator;
24687            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
24688            self
24689        }
24690    }
24691
24692    #[doc(hidden)]
24693    impl crate::RequestBuilder for TestIamPermissions {
24694        fn request_options(&mut self) -> &mut crate::RequestOptions {
24695            &mut self.0.options
24696        }
24697    }
24698
24699    /// The request builder for [OrganizationSecurityProfileGroupService::list_operations][crate::client::OrganizationSecurityProfileGroupService::list_operations] calls.
24700    ///
24701    /// # Example
24702    /// ```
24703    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListOperations;
24704    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24705    /// use google_cloud_gax::paginator::ItemPaginator;
24706    ///
24707    /// let builder = prepare_request_builder();
24708    /// let mut items = builder.by_item();
24709    /// while let Some(result) = items.next().await {
24710    ///   let item = result?;
24711    /// }
24712    /// # Ok(()) }
24713    ///
24714    /// fn prepare_request_builder() -> ListOperations {
24715    ///   # panic!();
24716    ///   // ... details omitted ...
24717    /// }
24718    /// ```
24719    #[derive(Clone, Debug)]
24720    pub struct ListOperations(
24721        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
24722    );
24723
24724    impl ListOperations {
24725        pub(crate) fn new(
24726            stub: std::sync::Arc<
24727                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24728            >,
24729        ) -> Self {
24730            Self(RequestBuilder::new(stub))
24731        }
24732
24733        /// Sets the full request, replacing any prior values.
24734        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
24735            mut self,
24736            v: V,
24737        ) -> Self {
24738            self.0.request = v.into();
24739            self
24740        }
24741
24742        /// Sets all the options, replacing any prior values.
24743        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24744            self.0.options = v.into();
24745            self
24746        }
24747
24748        /// Sends the request.
24749        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
24750            (*self.0.stub)
24751                .list_operations(self.0.request, self.0.options)
24752                .await
24753                .map(crate::Response::into_body)
24754        }
24755
24756        /// Streams each page in the collection.
24757        pub fn by_page(
24758            self,
24759        ) -> impl google_cloud_gax::paginator::Paginator<
24760            google_cloud_longrunning::model::ListOperationsResponse,
24761            crate::Error,
24762        > {
24763            use std::clone::Clone;
24764            let token = self.0.request.page_token.clone();
24765            let execute = move |token: String| {
24766                let mut builder = self.clone();
24767                builder.0.request = builder.0.request.set_page_token(token);
24768                builder.send()
24769            };
24770            google_cloud_gax::paginator::internal::new_paginator(token, execute)
24771        }
24772
24773        /// Streams each item in the collection.
24774        pub fn by_item(
24775            self,
24776        ) -> impl google_cloud_gax::paginator::ItemPaginator<
24777            google_cloud_longrunning::model::ListOperationsResponse,
24778            crate::Error,
24779        > {
24780            use google_cloud_gax::paginator::Paginator;
24781            self.by_page().items()
24782        }
24783
24784        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
24785        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24786            self.0.request.name = v.into();
24787            self
24788        }
24789
24790        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
24791        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
24792            self.0.request.filter = v.into();
24793            self
24794        }
24795
24796        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
24797        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
24798            self.0.request.page_size = v.into();
24799            self
24800        }
24801
24802        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
24803        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
24804            self.0.request.page_token = v.into();
24805            self
24806        }
24807
24808        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
24809        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
24810            self.0.request.return_partial_success = v.into();
24811            self
24812        }
24813    }
24814
24815    #[doc(hidden)]
24816    impl crate::RequestBuilder for ListOperations {
24817        fn request_options(&mut self) -> &mut crate::RequestOptions {
24818            &mut self.0.options
24819        }
24820    }
24821
24822    /// The request builder for [OrganizationSecurityProfileGroupService::get_operation][crate::client::OrganizationSecurityProfileGroupService::get_operation] calls.
24823    ///
24824    /// # Example
24825    /// ```
24826    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetOperation;
24827    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24828    ///
24829    /// let builder = prepare_request_builder();
24830    /// let response = builder.send().await?;
24831    /// # Ok(()) }
24832    ///
24833    /// fn prepare_request_builder() -> GetOperation {
24834    ///   # panic!();
24835    ///   // ... details omitted ...
24836    /// }
24837    /// ```
24838    #[derive(Clone, Debug)]
24839    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
24840
24841    impl GetOperation {
24842        pub(crate) fn new(
24843            stub: std::sync::Arc<
24844                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24845            >,
24846        ) -> Self {
24847            Self(RequestBuilder::new(stub))
24848        }
24849
24850        /// Sets the full request, replacing any prior values.
24851        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
24852            mut self,
24853            v: V,
24854        ) -> Self {
24855            self.0.request = v.into();
24856            self
24857        }
24858
24859        /// Sets all the options, replacing any prior values.
24860        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24861            self.0.options = v.into();
24862            self
24863        }
24864
24865        /// Sends the request.
24866        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
24867            (*self.0.stub)
24868                .get_operation(self.0.request, self.0.options)
24869                .await
24870                .map(crate::Response::into_body)
24871        }
24872
24873        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
24874        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24875            self.0.request.name = v.into();
24876            self
24877        }
24878    }
24879
24880    #[doc(hidden)]
24881    impl crate::RequestBuilder for GetOperation {
24882        fn request_options(&mut self) -> &mut crate::RequestOptions {
24883            &mut self.0.options
24884        }
24885    }
24886
24887    /// The request builder for [OrganizationSecurityProfileGroupService::delete_operation][crate::client::OrganizationSecurityProfileGroupService::delete_operation] calls.
24888    ///
24889    /// # Example
24890    /// ```
24891    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::DeleteOperation;
24892    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24893    ///
24894    /// let builder = prepare_request_builder();
24895    /// let response = builder.send().await?;
24896    /// # Ok(()) }
24897    ///
24898    /// fn prepare_request_builder() -> DeleteOperation {
24899    ///   # panic!();
24900    ///   // ... details omitted ...
24901    /// }
24902    /// ```
24903    #[derive(Clone, Debug)]
24904    pub struct DeleteOperation(
24905        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
24906    );
24907
24908    impl DeleteOperation {
24909        pub(crate) fn new(
24910            stub: std::sync::Arc<
24911                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24912            >,
24913        ) -> Self {
24914            Self(RequestBuilder::new(stub))
24915        }
24916
24917        /// Sets the full request, replacing any prior values.
24918        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
24919            mut self,
24920            v: V,
24921        ) -> Self {
24922            self.0.request = v.into();
24923            self
24924        }
24925
24926        /// Sets all the options, replacing any prior values.
24927        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24928            self.0.options = v.into();
24929            self
24930        }
24931
24932        /// Sends the request.
24933        pub async fn send(self) -> Result<()> {
24934            (*self.0.stub)
24935                .delete_operation(self.0.request, self.0.options)
24936                .await
24937                .map(crate::Response::into_body)
24938        }
24939
24940        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
24941        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24942            self.0.request.name = v.into();
24943            self
24944        }
24945    }
24946
24947    #[doc(hidden)]
24948    impl crate::RequestBuilder for DeleteOperation {
24949        fn request_options(&mut self) -> &mut crate::RequestOptions {
24950            &mut self.0.options
24951        }
24952    }
24953
24954    /// The request builder for [OrganizationSecurityProfileGroupService::cancel_operation][crate::client::OrganizationSecurityProfileGroupService::cancel_operation] calls.
24955    ///
24956    /// # Example
24957    /// ```
24958    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::CancelOperation;
24959    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24960    ///
24961    /// let builder = prepare_request_builder();
24962    /// let response = builder.send().await?;
24963    /// # Ok(()) }
24964    ///
24965    /// fn prepare_request_builder() -> CancelOperation {
24966    ///   # panic!();
24967    ///   // ... details omitted ...
24968    /// }
24969    /// ```
24970    #[derive(Clone, Debug)]
24971    pub struct CancelOperation(
24972        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
24973    );
24974
24975    impl CancelOperation {
24976        pub(crate) fn new(
24977            stub: std::sync::Arc<
24978                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24979            >,
24980        ) -> Self {
24981            Self(RequestBuilder::new(stub))
24982        }
24983
24984        /// Sets the full request, replacing any prior values.
24985        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
24986            mut self,
24987            v: V,
24988        ) -> Self {
24989            self.0.request = v.into();
24990            self
24991        }
24992
24993        /// Sets all the options, replacing any prior values.
24994        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24995            self.0.options = v.into();
24996            self
24997        }
24998
24999        /// Sends the request.
25000        pub async fn send(self) -> Result<()> {
25001            (*self.0.stub)
25002                .cancel_operation(self.0.request, self.0.options)
25003                .await
25004                .map(crate::Response::into_body)
25005        }
25006
25007        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
25008        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25009            self.0.request.name = v.into();
25010            self
25011        }
25012    }
25013
25014    #[doc(hidden)]
25015    impl crate::RequestBuilder for CancelOperation {
25016        fn request_options(&mut self) -> &mut crate::RequestOptions {
25017            &mut self.0.options
25018        }
25019    }
25020}
25021
25022/// Request and client builders for [SSERealmService][crate::client::SSERealmService].
25023pub mod sse_realm_service {
25024    use crate::Result;
25025
25026    /// A builder for [SSERealmService][crate::client::SSERealmService].
25027    ///
25028    /// ```
25029    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25030    /// # use google_cloud_networksecurity_v1::*;
25031    /// # use builder::sse_realm_service::ClientBuilder;
25032    /// # use client::SSERealmService;
25033    /// let builder : ClientBuilder = SSERealmService::builder();
25034    /// let client = builder
25035    ///     .with_endpoint("https://networksecurity.googleapis.com")
25036    ///     .build().await?;
25037    /// # Ok(()) }
25038    /// ```
25039    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
25040
25041    pub(crate) mod client {
25042        use super::super::super::client::SSERealmService;
25043        pub struct Factory;
25044        impl crate::ClientFactory for Factory {
25045            type Client = SSERealmService;
25046            type Credentials = gaxi::options::Credentials;
25047            async fn build(
25048                self,
25049                config: gaxi::options::ClientConfig,
25050            ) -> crate::ClientBuilderResult<Self::Client> {
25051                Self::Client::new(config).await
25052            }
25053        }
25054    }
25055
25056    /// Common implementation for [crate::client::SSERealmService] request builders.
25057    #[derive(Clone, Debug)]
25058    pub(crate) struct RequestBuilder<R: std::default::Default> {
25059        stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25060        request: R,
25061        options: crate::RequestOptions,
25062    }
25063
25064    impl<R> RequestBuilder<R>
25065    where
25066        R: std::default::Default,
25067    {
25068        pub(crate) fn new(
25069            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25070        ) -> Self {
25071            Self {
25072                stub,
25073                request: R::default(),
25074                options: crate::RequestOptions::default(),
25075            }
25076        }
25077    }
25078
25079    /// The request builder for [SSERealmService::list_sac_realms][crate::client::SSERealmService::list_sac_realms] calls.
25080    ///
25081    /// # Example
25082    /// ```
25083    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::ListSACRealms;
25084    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25085    /// use google_cloud_gax::paginator::ItemPaginator;
25086    ///
25087    /// let builder = prepare_request_builder();
25088    /// let mut items = builder.by_item();
25089    /// while let Some(result) = items.next().await {
25090    ///   let item = result?;
25091    /// }
25092    /// # Ok(()) }
25093    ///
25094    /// fn prepare_request_builder() -> ListSACRealms {
25095    ///   # panic!();
25096    ///   // ... details omitted ...
25097    /// }
25098    /// ```
25099    #[derive(Clone, Debug)]
25100    pub struct ListSACRealms(RequestBuilder<crate::model::ListSACRealmsRequest>);
25101
25102    impl ListSACRealms {
25103        pub(crate) fn new(
25104            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25105        ) -> Self {
25106            Self(RequestBuilder::new(stub))
25107        }
25108
25109        /// Sets the full request, replacing any prior values.
25110        pub fn with_request<V: Into<crate::model::ListSACRealmsRequest>>(mut self, v: V) -> Self {
25111            self.0.request = v.into();
25112            self
25113        }
25114
25115        /// Sets all the options, replacing any prior values.
25116        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25117            self.0.options = v.into();
25118            self
25119        }
25120
25121        /// Sends the request.
25122        pub async fn send(self) -> Result<crate::model::ListSACRealmsResponse> {
25123            (*self.0.stub)
25124                .list_sac_realms(self.0.request, self.0.options)
25125                .await
25126                .map(crate::Response::into_body)
25127        }
25128
25129        /// Streams each page in the collection.
25130        pub fn by_page(
25131            self,
25132        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSACRealmsResponse, crate::Error>
25133        {
25134            use std::clone::Clone;
25135            let token = self.0.request.page_token.clone();
25136            let execute = move |token: String| {
25137                let mut builder = self.clone();
25138                builder.0.request = builder.0.request.set_page_token(token);
25139                builder.send()
25140            };
25141            google_cloud_gax::paginator::internal::new_paginator(token, execute)
25142        }
25143
25144        /// Streams each item in the collection.
25145        pub fn by_item(
25146            self,
25147        ) -> impl google_cloud_gax::paginator::ItemPaginator<
25148            crate::model::ListSACRealmsResponse,
25149            crate::Error,
25150        > {
25151            use google_cloud_gax::paginator::Paginator;
25152            self.by_page().items()
25153        }
25154
25155        /// Sets the value of [parent][crate::model::ListSACRealmsRequest::parent].
25156        ///
25157        /// This is a **required** field for requests.
25158        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
25159            self.0.request.parent = v.into();
25160            self
25161        }
25162
25163        /// Sets the value of [page_size][crate::model::ListSACRealmsRequest::page_size].
25164        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
25165            self.0.request.page_size = v.into();
25166            self
25167        }
25168
25169        /// Sets the value of [page_token][crate::model::ListSACRealmsRequest::page_token].
25170        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
25171            self.0.request.page_token = v.into();
25172            self
25173        }
25174
25175        /// Sets the value of [filter][crate::model::ListSACRealmsRequest::filter].
25176        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
25177            self.0.request.filter = v.into();
25178            self
25179        }
25180
25181        /// Sets the value of [order_by][crate::model::ListSACRealmsRequest::order_by].
25182        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
25183            self.0.request.order_by = v.into();
25184            self
25185        }
25186    }
25187
25188    #[doc(hidden)]
25189    impl crate::RequestBuilder for ListSACRealms {
25190        fn request_options(&mut self) -> &mut crate::RequestOptions {
25191            &mut self.0.options
25192        }
25193    }
25194
25195    /// The request builder for [SSERealmService::get_sac_realm][crate::client::SSERealmService::get_sac_realm] calls.
25196    ///
25197    /// # Example
25198    /// ```
25199    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::GetSACRealm;
25200    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25201    ///
25202    /// let builder = prepare_request_builder();
25203    /// let response = builder.send().await?;
25204    /// # Ok(()) }
25205    ///
25206    /// fn prepare_request_builder() -> GetSACRealm {
25207    ///   # panic!();
25208    ///   // ... details omitted ...
25209    /// }
25210    /// ```
25211    #[derive(Clone, Debug)]
25212    pub struct GetSACRealm(RequestBuilder<crate::model::GetSACRealmRequest>);
25213
25214    impl GetSACRealm {
25215        pub(crate) fn new(
25216            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25217        ) -> Self {
25218            Self(RequestBuilder::new(stub))
25219        }
25220
25221        /// Sets the full request, replacing any prior values.
25222        pub fn with_request<V: Into<crate::model::GetSACRealmRequest>>(mut self, v: V) -> Self {
25223            self.0.request = v.into();
25224            self
25225        }
25226
25227        /// Sets all the options, replacing any prior values.
25228        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25229            self.0.options = v.into();
25230            self
25231        }
25232
25233        /// Sends the request.
25234        pub async fn send(self) -> Result<crate::model::SACRealm> {
25235            (*self.0.stub)
25236                .get_sac_realm(self.0.request, self.0.options)
25237                .await
25238                .map(crate::Response::into_body)
25239        }
25240
25241        /// Sets the value of [name][crate::model::GetSACRealmRequest::name].
25242        ///
25243        /// This is a **required** field for requests.
25244        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25245            self.0.request.name = v.into();
25246            self
25247        }
25248    }
25249
25250    #[doc(hidden)]
25251    impl crate::RequestBuilder for GetSACRealm {
25252        fn request_options(&mut self) -> &mut crate::RequestOptions {
25253            &mut self.0.options
25254        }
25255    }
25256
25257    /// The request builder for [SSERealmService::create_sac_realm][crate::client::SSERealmService::create_sac_realm] calls.
25258    ///
25259    /// # Example
25260    /// ```
25261    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::CreateSACRealm;
25262    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25263    /// use google_cloud_lro::Poller;
25264    ///
25265    /// let builder = prepare_request_builder();
25266    /// let response = builder.poller().until_done().await?;
25267    /// # Ok(()) }
25268    ///
25269    /// fn prepare_request_builder() -> CreateSACRealm {
25270    ///   # panic!();
25271    ///   // ... details omitted ...
25272    /// }
25273    /// ```
25274    #[derive(Clone, Debug)]
25275    pub struct CreateSACRealm(RequestBuilder<crate::model::CreateSACRealmRequest>);
25276
25277    impl CreateSACRealm {
25278        pub(crate) fn new(
25279            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25280        ) -> Self {
25281            Self(RequestBuilder::new(stub))
25282        }
25283
25284        /// Sets the full request, replacing any prior values.
25285        pub fn with_request<V: Into<crate::model::CreateSACRealmRequest>>(mut self, v: V) -> Self {
25286            self.0.request = v.into();
25287            self
25288        }
25289
25290        /// Sets all the options, replacing any prior values.
25291        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25292            self.0.options = v.into();
25293            self
25294        }
25295
25296        /// Sends the request.
25297        ///
25298        /// # Long running operations
25299        ///
25300        /// This starts, but does not poll, a longrunning operation. More information
25301        /// on [create_sac_realm][crate::client::SSERealmService::create_sac_realm].
25302        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
25303            (*self.0.stub)
25304                .create_sac_realm(self.0.request, self.0.options)
25305                .await
25306                .map(crate::Response::into_body)
25307        }
25308
25309        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_sac_realm`.
25310        pub fn poller(
25311            self,
25312        ) -> impl google_cloud_lro::Poller<crate::model::SACRealm, crate::model::OperationMetadata>
25313        {
25314            type Operation = google_cloud_lro::internal::Operation<
25315                crate::model::SACRealm,
25316                crate::model::OperationMetadata,
25317            >;
25318            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
25319            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
25320            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
25321            if let Some(ref mut details) = poller_options.tracing {
25322                details.method_name = "google_cloud_networksecurity_v1::client::SSERealmService::create_sac_realm::until_done";
25323            }
25324
25325            let stub = self.0.stub.clone();
25326            let mut options = self.0.options.clone();
25327            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
25328            let query = move |name| {
25329                let stub = stub.clone();
25330                let options = options.clone();
25331                async {
25332                    let op = GetOperation::new(stub)
25333                        .set_name(name)
25334                        .with_options(options)
25335                        .send()
25336                        .await?;
25337                    Ok(Operation::new(op))
25338                }
25339            };
25340
25341            let start = move || async {
25342                let op = self.send().await?;
25343                Ok(Operation::new(op))
25344            };
25345
25346            use google_cloud_lro::internal::PollerExt;
25347            {
25348                google_cloud_lro::internal::new_poller(
25349                    polling_error_policy,
25350                    polling_backoff_policy,
25351                    start,
25352                    query,
25353                )
25354            }
25355            .with_options(poller_options)
25356        }
25357
25358        /// Sets the value of [parent][crate::model::CreateSACRealmRequest::parent].
25359        ///
25360        /// This is a **required** field for requests.
25361        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
25362            self.0.request.parent = v.into();
25363            self
25364        }
25365
25366        /// Sets the value of [sac_realm_id][crate::model::CreateSACRealmRequest::sac_realm_id].
25367        ///
25368        /// This is a **required** field for requests.
25369        pub fn set_sac_realm_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25370            self.0.request.sac_realm_id = v.into();
25371            self
25372        }
25373
25374        /// Sets the value of [sac_realm][crate::model::CreateSACRealmRequest::sac_realm].
25375        ///
25376        /// This is a **required** field for requests.
25377        pub fn set_sac_realm<T>(mut self, v: T) -> Self
25378        where
25379            T: std::convert::Into<crate::model::SACRealm>,
25380        {
25381            self.0.request.sac_realm = std::option::Option::Some(v.into());
25382            self
25383        }
25384
25385        /// Sets or clears the value of [sac_realm][crate::model::CreateSACRealmRequest::sac_realm].
25386        ///
25387        /// This is a **required** field for requests.
25388        pub fn set_or_clear_sac_realm<T>(mut self, v: std::option::Option<T>) -> Self
25389        where
25390            T: std::convert::Into<crate::model::SACRealm>,
25391        {
25392            self.0.request.sac_realm = v.map(|x| x.into());
25393            self
25394        }
25395
25396        /// Sets the value of [request_id][crate::model::CreateSACRealmRequest::request_id].
25397        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25398            self.0.request.request_id = v.into();
25399            self
25400        }
25401    }
25402
25403    #[doc(hidden)]
25404    impl crate::RequestBuilder for CreateSACRealm {
25405        fn request_options(&mut self) -> &mut crate::RequestOptions {
25406            &mut self.0.options
25407        }
25408    }
25409
25410    /// The request builder for [SSERealmService::delete_sac_realm][crate::client::SSERealmService::delete_sac_realm] calls.
25411    ///
25412    /// # Example
25413    /// ```
25414    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::DeleteSACRealm;
25415    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25416    /// use google_cloud_lro::Poller;
25417    ///
25418    /// let builder = prepare_request_builder();
25419    /// let response = builder.poller().until_done().await?;
25420    /// # Ok(()) }
25421    ///
25422    /// fn prepare_request_builder() -> DeleteSACRealm {
25423    ///   # panic!();
25424    ///   // ... details omitted ...
25425    /// }
25426    /// ```
25427    #[derive(Clone, Debug)]
25428    pub struct DeleteSACRealm(RequestBuilder<crate::model::DeleteSACRealmRequest>);
25429
25430    impl DeleteSACRealm {
25431        pub(crate) fn new(
25432            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25433        ) -> Self {
25434            Self(RequestBuilder::new(stub))
25435        }
25436
25437        /// Sets the full request, replacing any prior values.
25438        pub fn with_request<V: Into<crate::model::DeleteSACRealmRequest>>(mut self, v: V) -> Self {
25439            self.0.request = v.into();
25440            self
25441        }
25442
25443        /// Sets all the options, replacing any prior values.
25444        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25445            self.0.options = v.into();
25446            self
25447        }
25448
25449        /// Sends the request.
25450        ///
25451        /// # Long running operations
25452        ///
25453        /// This starts, but does not poll, a longrunning operation. More information
25454        /// on [delete_sac_realm][crate::client::SSERealmService::delete_sac_realm].
25455        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
25456            (*self.0.stub)
25457                .delete_sac_realm(self.0.request, self.0.options)
25458                .await
25459                .map(crate::Response::into_body)
25460        }
25461
25462        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_sac_realm`.
25463        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
25464            type Operation =
25465                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
25466            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
25467            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
25468            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
25469            if let Some(ref mut details) = poller_options.tracing {
25470                details.method_name = "google_cloud_networksecurity_v1::client::SSERealmService::delete_sac_realm::until_done";
25471            }
25472
25473            let stub = self.0.stub.clone();
25474            let mut options = self.0.options.clone();
25475            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
25476            let query = move |name| {
25477                let stub = stub.clone();
25478                let options = options.clone();
25479                async {
25480                    let op = GetOperation::new(stub)
25481                        .set_name(name)
25482                        .with_options(options)
25483                        .send()
25484                        .await?;
25485                    Ok(Operation::new(op))
25486                }
25487            };
25488
25489            let start = move || async {
25490                let op = self.send().await?;
25491                Ok(Operation::new(op))
25492            };
25493
25494            use google_cloud_lro::internal::PollerExt;
25495            {
25496                google_cloud_lro::internal::new_unit_response_poller(
25497                    polling_error_policy,
25498                    polling_backoff_policy,
25499                    start,
25500                    query,
25501                )
25502            }
25503            .with_options(poller_options)
25504        }
25505
25506        /// Sets the value of [name][crate::model::DeleteSACRealmRequest::name].
25507        ///
25508        /// This is a **required** field for requests.
25509        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25510            self.0.request.name = v.into();
25511            self
25512        }
25513
25514        /// Sets the value of [request_id][crate::model::DeleteSACRealmRequest::request_id].
25515        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25516            self.0.request.request_id = v.into();
25517            self
25518        }
25519    }
25520
25521    #[doc(hidden)]
25522    impl crate::RequestBuilder for DeleteSACRealm {
25523        fn request_options(&mut self) -> &mut crate::RequestOptions {
25524            &mut self.0.options
25525        }
25526    }
25527
25528    /// The request builder for [SSERealmService::list_sac_attachments][crate::client::SSERealmService::list_sac_attachments] calls.
25529    ///
25530    /// # Example
25531    /// ```
25532    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::ListSACAttachments;
25533    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25534    /// use google_cloud_gax::paginator::ItemPaginator;
25535    ///
25536    /// let builder = prepare_request_builder();
25537    /// let mut items = builder.by_item();
25538    /// while let Some(result) = items.next().await {
25539    ///   let item = result?;
25540    /// }
25541    /// # Ok(()) }
25542    ///
25543    /// fn prepare_request_builder() -> ListSACAttachments {
25544    ///   # panic!();
25545    ///   // ... details omitted ...
25546    /// }
25547    /// ```
25548    #[derive(Clone, Debug)]
25549    pub struct ListSACAttachments(RequestBuilder<crate::model::ListSACAttachmentsRequest>);
25550
25551    impl ListSACAttachments {
25552        pub(crate) fn new(
25553            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25554        ) -> Self {
25555            Self(RequestBuilder::new(stub))
25556        }
25557
25558        /// Sets the full request, replacing any prior values.
25559        pub fn with_request<V: Into<crate::model::ListSACAttachmentsRequest>>(
25560            mut self,
25561            v: V,
25562        ) -> Self {
25563            self.0.request = v.into();
25564            self
25565        }
25566
25567        /// Sets all the options, replacing any prior values.
25568        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25569            self.0.options = v.into();
25570            self
25571        }
25572
25573        /// Sends the request.
25574        pub async fn send(self) -> Result<crate::model::ListSACAttachmentsResponse> {
25575            (*self.0.stub)
25576                .list_sac_attachments(self.0.request, self.0.options)
25577                .await
25578                .map(crate::Response::into_body)
25579        }
25580
25581        /// Streams each page in the collection.
25582        pub fn by_page(
25583            self,
25584        ) -> impl google_cloud_gax::paginator::Paginator<
25585            crate::model::ListSACAttachmentsResponse,
25586            crate::Error,
25587        > {
25588            use std::clone::Clone;
25589            let token = self.0.request.page_token.clone();
25590            let execute = move |token: String| {
25591                let mut builder = self.clone();
25592                builder.0.request = builder.0.request.set_page_token(token);
25593                builder.send()
25594            };
25595            google_cloud_gax::paginator::internal::new_paginator(token, execute)
25596        }
25597
25598        /// Streams each item in the collection.
25599        pub fn by_item(
25600            self,
25601        ) -> impl google_cloud_gax::paginator::ItemPaginator<
25602            crate::model::ListSACAttachmentsResponse,
25603            crate::Error,
25604        > {
25605            use google_cloud_gax::paginator::Paginator;
25606            self.by_page().items()
25607        }
25608
25609        /// Sets the value of [parent][crate::model::ListSACAttachmentsRequest::parent].
25610        ///
25611        /// This is a **required** field for requests.
25612        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
25613            self.0.request.parent = v.into();
25614            self
25615        }
25616
25617        /// Sets the value of [page_size][crate::model::ListSACAttachmentsRequest::page_size].
25618        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
25619            self.0.request.page_size = v.into();
25620            self
25621        }
25622
25623        /// Sets the value of [page_token][crate::model::ListSACAttachmentsRequest::page_token].
25624        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
25625            self.0.request.page_token = v.into();
25626            self
25627        }
25628
25629        /// Sets the value of [filter][crate::model::ListSACAttachmentsRequest::filter].
25630        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
25631            self.0.request.filter = v.into();
25632            self
25633        }
25634
25635        /// Sets the value of [order_by][crate::model::ListSACAttachmentsRequest::order_by].
25636        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
25637            self.0.request.order_by = v.into();
25638            self
25639        }
25640    }
25641
25642    #[doc(hidden)]
25643    impl crate::RequestBuilder for ListSACAttachments {
25644        fn request_options(&mut self) -> &mut crate::RequestOptions {
25645            &mut self.0.options
25646        }
25647    }
25648
25649    /// The request builder for [SSERealmService::get_sac_attachment][crate::client::SSERealmService::get_sac_attachment] calls.
25650    ///
25651    /// # Example
25652    /// ```
25653    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::GetSACAttachment;
25654    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25655    ///
25656    /// let builder = prepare_request_builder();
25657    /// let response = builder.send().await?;
25658    /// # Ok(()) }
25659    ///
25660    /// fn prepare_request_builder() -> GetSACAttachment {
25661    ///   # panic!();
25662    ///   // ... details omitted ...
25663    /// }
25664    /// ```
25665    #[derive(Clone, Debug)]
25666    pub struct GetSACAttachment(RequestBuilder<crate::model::GetSACAttachmentRequest>);
25667
25668    impl GetSACAttachment {
25669        pub(crate) fn new(
25670            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25671        ) -> Self {
25672            Self(RequestBuilder::new(stub))
25673        }
25674
25675        /// Sets the full request, replacing any prior values.
25676        pub fn with_request<V: Into<crate::model::GetSACAttachmentRequest>>(
25677            mut self,
25678            v: V,
25679        ) -> Self {
25680            self.0.request = v.into();
25681            self
25682        }
25683
25684        /// Sets all the options, replacing any prior values.
25685        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25686            self.0.options = v.into();
25687            self
25688        }
25689
25690        /// Sends the request.
25691        pub async fn send(self) -> Result<crate::model::SACAttachment> {
25692            (*self.0.stub)
25693                .get_sac_attachment(self.0.request, self.0.options)
25694                .await
25695                .map(crate::Response::into_body)
25696        }
25697
25698        /// Sets the value of [name][crate::model::GetSACAttachmentRequest::name].
25699        ///
25700        /// This is a **required** field for requests.
25701        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25702            self.0.request.name = v.into();
25703            self
25704        }
25705    }
25706
25707    #[doc(hidden)]
25708    impl crate::RequestBuilder for GetSACAttachment {
25709        fn request_options(&mut self) -> &mut crate::RequestOptions {
25710            &mut self.0.options
25711        }
25712    }
25713
25714    /// The request builder for [SSERealmService::create_sac_attachment][crate::client::SSERealmService::create_sac_attachment] calls.
25715    ///
25716    /// # Example
25717    /// ```
25718    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::CreateSACAttachment;
25719    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25720    /// use google_cloud_lro::Poller;
25721    ///
25722    /// let builder = prepare_request_builder();
25723    /// let response = builder.poller().until_done().await?;
25724    /// # Ok(()) }
25725    ///
25726    /// fn prepare_request_builder() -> CreateSACAttachment {
25727    ///   # panic!();
25728    ///   // ... details omitted ...
25729    /// }
25730    /// ```
25731    #[derive(Clone, Debug)]
25732    pub struct CreateSACAttachment(RequestBuilder<crate::model::CreateSACAttachmentRequest>);
25733
25734    impl CreateSACAttachment {
25735        pub(crate) fn new(
25736            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25737        ) -> Self {
25738            Self(RequestBuilder::new(stub))
25739        }
25740
25741        /// Sets the full request, replacing any prior values.
25742        pub fn with_request<V: Into<crate::model::CreateSACAttachmentRequest>>(
25743            mut self,
25744            v: V,
25745        ) -> Self {
25746            self.0.request = v.into();
25747            self
25748        }
25749
25750        /// Sets all the options, replacing any prior values.
25751        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25752            self.0.options = v.into();
25753            self
25754        }
25755
25756        /// Sends the request.
25757        ///
25758        /// # Long running operations
25759        ///
25760        /// This starts, but does not poll, a longrunning operation. More information
25761        /// on [create_sac_attachment][crate::client::SSERealmService::create_sac_attachment].
25762        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
25763            (*self.0.stub)
25764                .create_sac_attachment(self.0.request, self.0.options)
25765                .await
25766                .map(crate::Response::into_body)
25767        }
25768
25769        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_sac_attachment`.
25770        pub fn poller(
25771            self,
25772        ) -> impl google_cloud_lro::Poller<crate::model::SACAttachment, crate::model::OperationMetadata>
25773        {
25774            type Operation = google_cloud_lro::internal::Operation<
25775                crate::model::SACAttachment,
25776                crate::model::OperationMetadata,
25777            >;
25778            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
25779            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
25780            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
25781            if let Some(ref mut details) = poller_options.tracing {
25782                details.method_name = "google_cloud_networksecurity_v1::client::SSERealmService::create_sac_attachment::until_done";
25783            }
25784
25785            let stub = self.0.stub.clone();
25786            let mut options = self.0.options.clone();
25787            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
25788            let query = move |name| {
25789                let stub = stub.clone();
25790                let options = options.clone();
25791                async {
25792                    let op = GetOperation::new(stub)
25793                        .set_name(name)
25794                        .with_options(options)
25795                        .send()
25796                        .await?;
25797                    Ok(Operation::new(op))
25798                }
25799            };
25800
25801            let start = move || async {
25802                let op = self.send().await?;
25803                Ok(Operation::new(op))
25804            };
25805
25806            use google_cloud_lro::internal::PollerExt;
25807            {
25808                google_cloud_lro::internal::new_poller(
25809                    polling_error_policy,
25810                    polling_backoff_policy,
25811                    start,
25812                    query,
25813                )
25814            }
25815            .with_options(poller_options)
25816        }
25817
25818        /// Sets the value of [parent][crate::model::CreateSACAttachmentRequest::parent].
25819        ///
25820        /// This is a **required** field for requests.
25821        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
25822            self.0.request.parent = v.into();
25823            self
25824        }
25825
25826        /// Sets the value of [sac_attachment_id][crate::model::CreateSACAttachmentRequest::sac_attachment_id].
25827        ///
25828        /// This is a **required** field for requests.
25829        pub fn set_sac_attachment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25830            self.0.request.sac_attachment_id = v.into();
25831            self
25832        }
25833
25834        /// Sets the value of [sac_attachment][crate::model::CreateSACAttachmentRequest::sac_attachment].
25835        ///
25836        /// This is a **required** field for requests.
25837        pub fn set_sac_attachment<T>(mut self, v: T) -> Self
25838        where
25839            T: std::convert::Into<crate::model::SACAttachment>,
25840        {
25841            self.0.request.sac_attachment = std::option::Option::Some(v.into());
25842            self
25843        }
25844
25845        /// Sets or clears the value of [sac_attachment][crate::model::CreateSACAttachmentRequest::sac_attachment].
25846        ///
25847        /// This is a **required** field for requests.
25848        pub fn set_or_clear_sac_attachment<T>(mut self, v: std::option::Option<T>) -> Self
25849        where
25850            T: std::convert::Into<crate::model::SACAttachment>,
25851        {
25852            self.0.request.sac_attachment = v.map(|x| x.into());
25853            self
25854        }
25855
25856        /// Sets the value of [request_id][crate::model::CreateSACAttachmentRequest::request_id].
25857        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25858            self.0.request.request_id = v.into();
25859            self
25860        }
25861    }
25862
25863    #[doc(hidden)]
25864    impl crate::RequestBuilder for CreateSACAttachment {
25865        fn request_options(&mut self) -> &mut crate::RequestOptions {
25866            &mut self.0.options
25867        }
25868    }
25869
25870    /// The request builder for [SSERealmService::delete_sac_attachment][crate::client::SSERealmService::delete_sac_attachment] calls.
25871    ///
25872    /// # Example
25873    /// ```
25874    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::DeleteSACAttachment;
25875    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25876    /// use google_cloud_lro::Poller;
25877    ///
25878    /// let builder = prepare_request_builder();
25879    /// let response = builder.poller().until_done().await?;
25880    /// # Ok(()) }
25881    ///
25882    /// fn prepare_request_builder() -> DeleteSACAttachment {
25883    ///   # panic!();
25884    ///   // ... details omitted ...
25885    /// }
25886    /// ```
25887    #[derive(Clone, Debug)]
25888    pub struct DeleteSACAttachment(RequestBuilder<crate::model::DeleteSACAttachmentRequest>);
25889
25890    impl DeleteSACAttachment {
25891        pub(crate) fn new(
25892            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25893        ) -> Self {
25894            Self(RequestBuilder::new(stub))
25895        }
25896
25897        /// Sets the full request, replacing any prior values.
25898        pub fn with_request<V: Into<crate::model::DeleteSACAttachmentRequest>>(
25899            mut self,
25900            v: V,
25901        ) -> Self {
25902            self.0.request = v.into();
25903            self
25904        }
25905
25906        /// Sets all the options, replacing any prior values.
25907        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25908            self.0.options = v.into();
25909            self
25910        }
25911
25912        /// Sends the request.
25913        ///
25914        /// # Long running operations
25915        ///
25916        /// This starts, but does not poll, a longrunning operation. More information
25917        /// on [delete_sac_attachment][crate::client::SSERealmService::delete_sac_attachment].
25918        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
25919            (*self.0.stub)
25920                .delete_sac_attachment(self.0.request, self.0.options)
25921                .await
25922                .map(crate::Response::into_body)
25923        }
25924
25925        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_sac_attachment`.
25926        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
25927            type Operation =
25928                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
25929            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
25930            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
25931            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
25932            if let Some(ref mut details) = poller_options.tracing {
25933                details.method_name = "google_cloud_networksecurity_v1::client::SSERealmService::delete_sac_attachment::until_done";
25934            }
25935
25936            let stub = self.0.stub.clone();
25937            let mut options = self.0.options.clone();
25938            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
25939            let query = move |name| {
25940                let stub = stub.clone();
25941                let options = options.clone();
25942                async {
25943                    let op = GetOperation::new(stub)
25944                        .set_name(name)
25945                        .with_options(options)
25946                        .send()
25947                        .await?;
25948                    Ok(Operation::new(op))
25949                }
25950            };
25951
25952            let start = move || async {
25953                let op = self.send().await?;
25954                Ok(Operation::new(op))
25955            };
25956
25957            use google_cloud_lro::internal::PollerExt;
25958            {
25959                google_cloud_lro::internal::new_unit_response_poller(
25960                    polling_error_policy,
25961                    polling_backoff_policy,
25962                    start,
25963                    query,
25964                )
25965            }
25966            .with_options(poller_options)
25967        }
25968
25969        /// Sets the value of [name][crate::model::DeleteSACAttachmentRequest::name].
25970        ///
25971        /// This is a **required** field for requests.
25972        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25973            self.0.request.name = v.into();
25974            self
25975        }
25976
25977        /// Sets the value of [request_id][crate::model::DeleteSACAttachmentRequest::request_id].
25978        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25979            self.0.request.request_id = v.into();
25980            self
25981        }
25982    }
25983
25984    #[doc(hidden)]
25985    impl crate::RequestBuilder for DeleteSACAttachment {
25986        fn request_options(&mut self) -> &mut crate::RequestOptions {
25987            &mut self.0.options
25988        }
25989    }
25990
25991    /// The request builder for [SSERealmService::list_locations][crate::client::SSERealmService::list_locations] calls.
25992    ///
25993    /// # Example
25994    /// ```
25995    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::ListLocations;
25996    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25997    /// use google_cloud_gax::paginator::ItemPaginator;
25998    ///
25999    /// let builder = prepare_request_builder();
26000    /// let mut items = builder.by_item();
26001    /// while let Some(result) = items.next().await {
26002    ///   let item = result?;
26003    /// }
26004    /// # Ok(()) }
26005    ///
26006    /// fn prepare_request_builder() -> ListLocations {
26007    ///   # panic!();
26008    ///   // ... details omitted ...
26009    /// }
26010    /// ```
26011    #[derive(Clone, Debug)]
26012    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
26013
26014    impl ListLocations {
26015        pub(crate) fn new(
26016            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26017        ) -> Self {
26018            Self(RequestBuilder::new(stub))
26019        }
26020
26021        /// Sets the full request, replacing any prior values.
26022        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
26023            mut self,
26024            v: V,
26025        ) -> Self {
26026            self.0.request = v.into();
26027            self
26028        }
26029
26030        /// Sets all the options, replacing any prior values.
26031        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26032            self.0.options = v.into();
26033            self
26034        }
26035
26036        /// Sends the request.
26037        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
26038            (*self.0.stub)
26039                .list_locations(self.0.request, self.0.options)
26040                .await
26041                .map(crate::Response::into_body)
26042        }
26043
26044        /// Streams each page in the collection.
26045        pub fn by_page(
26046            self,
26047        ) -> impl google_cloud_gax::paginator::Paginator<
26048            google_cloud_location::model::ListLocationsResponse,
26049            crate::Error,
26050        > {
26051            use std::clone::Clone;
26052            let token = self.0.request.page_token.clone();
26053            let execute = move |token: String| {
26054                let mut builder = self.clone();
26055                builder.0.request = builder.0.request.set_page_token(token);
26056                builder.send()
26057            };
26058            google_cloud_gax::paginator::internal::new_paginator(token, execute)
26059        }
26060
26061        /// Streams each item in the collection.
26062        pub fn by_item(
26063            self,
26064        ) -> impl google_cloud_gax::paginator::ItemPaginator<
26065            google_cloud_location::model::ListLocationsResponse,
26066            crate::Error,
26067        > {
26068            use google_cloud_gax::paginator::Paginator;
26069            self.by_page().items()
26070        }
26071
26072        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
26073        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
26074            self.0.request.name = v.into();
26075            self
26076        }
26077
26078        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
26079        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
26080            self.0.request.filter = v.into();
26081            self
26082        }
26083
26084        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
26085        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
26086            self.0.request.page_size = v.into();
26087            self
26088        }
26089
26090        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
26091        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
26092            self.0.request.page_token = v.into();
26093            self
26094        }
26095    }
26096
26097    #[doc(hidden)]
26098    impl crate::RequestBuilder for ListLocations {
26099        fn request_options(&mut self) -> &mut crate::RequestOptions {
26100            &mut self.0.options
26101        }
26102    }
26103
26104    /// The request builder for [SSERealmService::get_location][crate::client::SSERealmService::get_location] calls.
26105    ///
26106    /// # Example
26107    /// ```
26108    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::GetLocation;
26109    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
26110    ///
26111    /// let builder = prepare_request_builder();
26112    /// let response = builder.send().await?;
26113    /// # Ok(()) }
26114    ///
26115    /// fn prepare_request_builder() -> GetLocation {
26116    ///   # panic!();
26117    ///   // ... details omitted ...
26118    /// }
26119    /// ```
26120    #[derive(Clone, Debug)]
26121    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
26122
26123    impl GetLocation {
26124        pub(crate) fn new(
26125            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26126        ) -> Self {
26127            Self(RequestBuilder::new(stub))
26128        }
26129
26130        /// Sets the full request, replacing any prior values.
26131        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
26132            mut self,
26133            v: V,
26134        ) -> Self {
26135            self.0.request = v.into();
26136            self
26137        }
26138
26139        /// Sets all the options, replacing any prior values.
26140        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26141            self.0.options = v.into();
26142            self
26143        }
26144
26145        /// Sends the request.
26146        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
26147            (*self.0.stub)
26148                .get_location(self.0.request, self.0.options)
26149                .await
26150                .map(crate::Response::into_body)
26151        }
26152
26153        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
26154        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
26155            self.0.request.name = v.into();
26156            self
26157        }
26158    }
26159
26160    #[doc(hidden)]
26161    impl crate::RequestBuilder for GetLocation {
26162        fn request_options(&mut self) -> &mut crate::RequestOptions {
26163            &mut self.0.options
26164        }
26165    }
26166
26167    /// The request builder for [SSERealmService::set_iam_policy][crate::client::SSERealmService::set_iam_policy] calls.
26168    ///
26169    /// # Example
26170    /// ```
26171    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::SetIamPolicy;
26172    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
26173    ///
26174    /// let builder = prepare_request_builder();
26175    /// let response = builder.send().await?;
26176    /// # Ok(()) }
26177    ///
26178    /// fn prepare_request_builder() -> SetIamPolicy {
26179    ///   # panic!();
26180    ///   // ... details omitted ...
26181    /// }
26182    /// ```
26183    #[derive(Clone, Debug)]
26184    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
26185
26186    impl SetIamPolicy {
26187        pub(crate) fn new(
26188            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26189        ) -> Self {
26190            Self(RequestBuilder::new(stub))
26191        }
26192
26193        /// Sets the full request, replacing any prior values.
26194        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
26195            mut self,
26196            v: V,
26197        ) -> Self {
26198            self.0.request = v.into();
26199            self
26200        }
26201
26202        /// Sets all the options, replacing any prior values.
26203        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26204            self.0.options = v.into();
26205            self
26206        }
26207
26208        /// Sends the request.
26209        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
26210            (*self.0.stub)
26211                .set_iam_policy(self.0.request, self.0.options)
26212                .await
26213                .map(crate::Response::into_body)
26214        }
26215
26216        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
26217        ///
26218        /// This is a **required** field for requests.
26219        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
26220            self.0.request.resource = v.into();
26221            self
26222        }
26223
26224        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
26225        ///
26226        /// This is a **required** field for requests.
26227        pub fn set_policy<T>(mut self, v: T) -> Self
26228        where
26229            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
26230        {
26231            self.0.request.policy = std::option::Option::Some(v.into());
26232            self
26233        }
26234
26235        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
26236        ///
26237        /// This is a **required** field for requests.
26238        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
26239        where
26240            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
26241        {
26242            self.0.request.policy = v.map(|x| x.into());
26243            self
26244        }
26245
26246        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
26247        pub fn set_update_mask<T>(mut self, v: T) -> Self
26248        where
26249            T: std::convert::Into<wkt::FieldMask>,
26250        {
26251            self.0.request.update_mask = std::option::Option::Some(v.into());
26252            self
26253        }
26254
26255        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
26256        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
26257        where
26258            T: std::convert::Into<wkt::FieldMask>,
26259        {
26260            self.0.request.update_mask = v.map(|x| x.into());
26261            self
26262        }
26263    }
26264
26265    #[doc(hidden)]
26266    impl crate::RequestBuilder for SetIamPolicy {
26267        fn request_options(&mut self) -> &mut crate::RequestOptions {
26268            &mut self.0.options
26269        }
26270    }
26271
26272    /// The request builder for [SSERealmService::get_iam_policy][crate::client::SSERealmService::get_iam_policy] calls.
26273    ///
26274    /// # Example
26275    /// ```
26276    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::GetIamPolicy;
26277    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
26278    ///
26279    /// let builder = prepare_request_builder();
26280    /// let response = builder.send().await?;
26281    /// # Ok(()) }
26282    ///
26283    /// fn prepare_request_builder() -> GetIamPolicy {
26284    ///   # panic!();
26285    ///   // ... details omitted ...
26286    /// }
26287    /// ```
26288    #[derive(Clone, Debug)]
26289    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
26290
26291    impl GetIamPolicy {
26292        pub(crate) fn new(
26293            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26294        ) -> Self {
26295            Self(RequestBuilder::new(stub))
26296        }
26297
26298        /// Sets the full request, replacing any prior values.
26299        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
26300            mut self,
26301            v: V,
26302        ) -> Self {
26303            self.0.request = v.into();
26304            self
26305        }
26306
26307        /// Sets all the options, replacing any prior values.
26308        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26309            self.0.options = v.into();
26310            self
26311        }
26312
26313        /// Sends the request.
26314        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
26315            (*self.0.stub)
26316                .get_iam_policy(self.0.request, self.0.options)
26317                .await
26318                .map(crate::Response::into_body)
26319        }
26320
26321        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
26322        ///
26323        /// This is a **required** field for requests.
26324        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
26325            self.0.request.resource = v.into();
26326            self
26327        }
26328
26329        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
26330        pub fn set_options<T>(mut self, v: T) -> Self
26331        where
26332            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
26333        {
26334            self.0.request.options = std::option::Option::Some(v.into());
26335            self
26336        }
26337
26338        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
26339        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
26340        where
26341            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
26342        {
26343            self.0.request.options = v.map(|x| x.into());
26344            self
26345        }
26346    }
26347
26348    #[doc(hidden)]
26349    impl crate::RequestBuilder for GetIamPolicy {
26350        fn request_options(&mut self) -> &mut crate::RequestOptions {
26351            &mut self.0.options
26352        }
26353    }
26354
26355    /// The request builder for [SSERealmService::test_iam_permissions][crate::client::SSERealmService::test_iam_permissions] calls.
26356    ///
26357    /// # Example
26358    /// ```
26359    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::TestIamPermissions;
26360    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
26361    ///
26362    /// let builder = prepare_request_builder();
26363    /// let response = builder.send().await?;
26364    /// # Ok(()) }
26365    ///
26366    /// fn prepare_request_builder() -> TestIamPermissions {
26367    ///   # panic!();
26368    ///   // ... details omitted ...
26369    /// }
26370    /// ```
26371    #[derive(Clone, Debug)]
26372    pub struct TestIamPermissions(
26373        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
26374    );
26375
26376    impl TestIamPermissions {
26377        pub(crate) fn new(
26378            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26379        ) -> Self {
26380            Self(RequestBuilder::new(stub))
26381        }
26382
26383        /// Sets the full request, replacing any prior values.
26384        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
26385            mut self,
26386            v: V,
26387        ) -> Self {
26388            self.0.request = v.into();
26389            self
26390        }
26391
26392        /// Sets all the options, replacing any prior values.
26393        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26394            self.0.options = v.into();
26395            self
26396        }
26397
26398        /// Sends the request.
26399        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
26400            (*self.0.stub)
26401                .test_iam_permissions(self.0.request, self.0.options)
26402                .await
26403                .map(crate::Response::into_body)
26404        }
26405
26406        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
26407        ///
26408        /// This is a **required** field for requests.
26409        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
26410            self.0.request.resource = v.into();
26411            self
26412        }
26413
26414        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
26415        ///
26416        /// This is a **required** field for requests.
26417        pub fn set_permissions<T, V>(mut self, v: T) -> Self
26418        where
26419            T: std::iter::IntoIterator<Item = V>,
26420            V: std::convert::Into<std::string::String>,
26421        {
26422            use std::iter::Iterator;
26423            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
26424            self
26425        }
26426    }
26427
26428    #[doc(hidden)]
26429    impl crate::RequestBuilder for TestIamPermissions {
26430        fn request_options(&mut self) -> &mut crate::RequestOptions {
26431            &mut self.0.options
26432        }
26433    }
26434
26435    /// The request builder for [SSERealmService::list_operations][crate::client::SSERealmService::list_operations] calls.
26436    ///
26437    /// # Example
26438    /// ```
26439    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::ListOperations;
26440    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
26441    /// use google_cloud_gax::paginator::ItemPaginator;
26442    ///
26443    /// let builder = prepare_request_builder();
26444    /// let mut items = builder.by_item();
26445    /// while let Some(result) = items.next().await {
26446    ///   let item = result?;
26447    /// }
26448    /// # Ok(()) }
26449    ///
26450    /// fn prepare_request_builder() -> ListOperations {
26451    ///   # panic!();
26452    ///   // ... details omitted ...
26453    /// }
26454    /// ```
26455    #[derive(Clone, Debug)]
26456    pub struct ListOperations(
26457        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
26458    );
26459
26460    impl ListOperations {
26461        pub(crate) fn new(
26462            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26463        ) -> Self {
26464            Self(RequestBuilder::new(stub))
26465        }
26466
26467        /// Sets the full request, replacing any prior values.
26468        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
26469            mut self,
26470            v: V,
26471        ) -> Self {
26472            self.0.request = v.into();
26473            self
26474        }
26475
26476        /// Sets all the options, replacing any prior values.
26477        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26478            self.0.options = v.into();
26479            self
26480        }
26481
26482        /// Sends the request.
26483        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
26484            (*self.0.stub)
26485                .list_operations(self.0.request, self.0.options)
26486                .await
26487                .map(crate::Response::into_body)
26488        }
26489
26490        /// Streams each page in the collection.
26491        pub fn by_page(
26492            self,
26493        ) -> impl google_cloud_gax::paginator::Paginator<
26494            google_cloud_longrunning::model::ListOperationsResponse,
26495            crate::Error,
26496        > {
26497            use std::clone::Clone;
26498            let token = self.0.request.page_token.clone();
26499            let execute = move |token: String| {
26500                let mut builder = self.clone();
26501                builder.0.request = builder.0.request.set_page_token(token);
26502                builder.send()
26503            };
26504            google_cloud_gax::paginator::internal::new_paginator(token, execute)
26505        }
26506
26507        /// Streams each item in the collection.
26508        pub fn by_item(
26509            self,
26510        ) -> impl google_cloud_gax::paginator::ItemPaginator<
26511            google_cloud_longrunning::model::ListOperationsResponse,
26512            crate::Error,
26513        > {
26514            use google_cloud_gax::paginator::Paginator;
26515            self.by_page().items()
26516        }
26517
26518        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
26519        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
26520            self.0.request.name = v.into();
26521            self
26522        }
26523
26524        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
26525        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
26526            self.0.request.filter = v.into();
26527            self
26528        }
26529
26530        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
26531        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
26532            self.0.request.page_size = v.into();
26533            self
26534        }
26535
26536        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
26537        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
26538            self.0.request.page_token = v.into();
26539            self
26540        }
26541
26542        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
26543        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
26544            self.0.request.return_partial_success = v.into();
26545            self
26546        }
26547    }
26548
26549    #[doc(hidden)]
26550    impl crate::RequestBuilder for ListOperations {
26551        fn request_options(&mut self) -> &mut crate::RequestOptions {
26552            &mut self.0.options
26553        }
26554    }
26555
26556    /// The request builder for [SSERealmService::get_operation][crate::client::SSERealmService::get_operation] calls.
26557    ///
26558    /// # Example
26559    /// ```
26560    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::GetOperation;
26561    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
26562    ///
26563    /// let builder = prepare_request_builder();
26564    /// let response = builder.send().await?;
26565    /// # Ok(()) }
26566    ///
26567    /// fn prepare_request_builder() -> GetOperation {
26568    ///   # panic!();
26569    ///   // ... details omitted ...
26570    /// }
26571    /// ```
26572    #[derive(Clone, Debug)]
26573    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
26574
26575    impl GetOperation {
26576        pub(crate) fn new(
26577            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26578        ) -> Self {
26579            Self(RequestBuilder::new(stub))
26580        }
26581
26582        /// Sets the full request, replacing any prior values.
26583        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
26584            mut self,
26585            v: V,
26586        ) -> Self {
26587            self.0.request = v.into();
26588            self
26589        }
26590
26591        /// Sets all the options, replacing any prior values.
26592        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26593            self.0.options = v.into();
26594            self
26595        }
26596
26597        /// Sends the request.
26598        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
26599            (*self.0.stub)
26600                .get_operation(self.0.request, self.0.options)
26601                .await
26602                .map(crate::Response::into_body)
26603        }
26604
26605        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
26606        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
26607            self.0.request.name = v.into();
26608            self
26609        }
26610    }
26611
26612    #[doc(hidden)]
26613    impl crate::RequestBuilder for GetOperation {
26614        fn request_options(&mut self) -> &mut crate::RequestOptions {
26615            &mut self.0.options
26616        }
26617    }
26618
26619    /// The request builder for [SSERealmService::delete_operation][crate::client::SSERealmService::delete_operation] calls.
26620    ///
26621    /// # Example
26622    /// ```
26623    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::DeleteOperation;
26624    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
26625    ///
26626    /// let builder = prepare_request_builder();
26627    /// let response = builder.send().await?;
26628    /// # Ok(()) }
26629    ///
26630    /// fn prepare_request_builder() -> DeleteOperation {
26631    ///   # panic!();
26632    ///   // ... details omitted ...
26633    /// }
26634    /// ```
26635    #[derive(Clone, Debug)]
26636    pub struct DeleteOperation(
26637        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
26638    );
26639
26640    impl DeleteOperation {
26641        pub(crate) fn new(
26642            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26643        ) -> Self {
26644            Self(RequestBuilder::new(stub))
26645        }
26646
26647        /// Sets the full request, replacing any prior values.
26648        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
26649            mut self,
26650            v: V,
26651        ) -> Self {
26652            self.0.request = v.into();
26653            self
26654        }
26655
26656        /// Sets all the options, replacing any prior values.
26657        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26658            self.0.options = v.into();
26659            self
26660        }
26661
26662        /// Sends the request.
26663        pub async fn send(self) -> Result<()> {
26664            (*self.0.stub)
26665                .delete_operation(self.0.request, self.0.options)
26666                .await
26667                .map(crate::Response::into_body)
26668        }
26669
26670        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
26671        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
26672            self.0.request.name = v.into();
26673            self
26674        }
26675    }
26676
26677    #[doc(hidden)]
26678    impl crate::RequestBuilder for DeleteOperation {
26679        fn request_options(&mut self) -> &mut crate::RequestOptions {
26680            &mut self.0.options
26681        }
26682    }
26683
26684    /// The request builder for [SSERealmService::cancel_operation][crate::client::SSERealmService::cancel_operation] calls.
26685    ///
26686    /// # Example
26687    /// ```
26688    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::CancelOperation;
26689    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
26690    ///
26691    /// let builder = prepare_request_builder();
26692    /// let response = builder.send().await?;
26693    /// # Ok(()) }
26694    ///
26695    /// fn prepare_request_builder() -> CancelOperation {
26696    ///   # panic!();
26697    ///   // ... details omitted ...
26698    /// }
26699    /// ```
26700    #[derive(Clone, Debug)]
26701    pub struct CancelOperation(
26702        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
26703    );
26704
26705    impl CancelOperation {
26706        pub(crate) fn new(
26707            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26708        ) -> Self {
26709            Self(RequestBuilder::new(stub))
26710        }
26711
26712        /// Sets the full request, replacing any prior values.
26713        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
26714            mut self,
26715            v: V,
26716        ) -> Self {
26717            self.0.request = v.into();
26718            self
26719        }
26720
26721        /// Sets all the options, replacing any prior values.
26722        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26723            self.0.options = v.into();
26724            self
26725        }
26726
26727        /// Sends the request.
26728        pub async fn send(self) -> Result<()> {
26729            (*self.0.stub)
26730                .cancel_operation(self.0.request, self.0.options)
26731                .await
26732                .map(crate::Response::into_body)
26733        }
26734
26735        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
26736        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
26737            self.0.request.name = v.into();
26738            self
26739        }
26740    }
26741
26742    #[doc(hidden)]
26743    impl crate::RequestBuilder for CancelOperation {
26744        fn request_options(&mut self) -> &mut crate::RequestOptions {
26745            &mut self.0.options
26746        }
26747    }
26748}