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
318            let stub = self.0.stub.clone();
319            let mut options = self.0.options.clone();
320            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
321            let query = move |name| {
322                let stub = stub.clone();
323                let options = options.clone();
324                async {
325                    let op = GetOperation::new(stub)
326                        .set_name(name)
327                        .with_options(options)
328                        .send()
329                        .await?;
330                    Ok(Operation::new(op))
331                }
332            };
333
334            let start = move || async {
335                let op = self.send().await?;
336                Ok(Operation::new(op))
337            };
338
339            google_cloud_lro::internal::new_poller(
340                polling_error_policy,
341                polling_backoff_policy,
342                start,
343                query,
344            )
345        }
346
347        /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
348        ///
349        /// This is a **required** field for requests.
350        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
351            self.0.request.parent = v.into();
352            self
353        }
354
355        /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
356        ///
357        /// This is a **required** field for requests.
358        pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
359            self.0.request.address_group_id = v.into();
360            self
361        }
362
363        /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
364        ///
365        /// This is a **required** field for requests.
366        pub fn set_address_group<T>(mut self, v: T) -> Self
367        where
368            T: std::convert::Into<crate::model::AddressGroup>,
369        {
370            self.0.request.address_group = std::option::Option::Some(v.into());
371            self
372        }
373
374        /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
375        ///
376        /// This is a **required** field for requests.
377        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
378        where
379            T: std::convert::Into<crate::model::AddressGroup>,
380        {
381            self.0.request.address_group = v.map(|x| x.into());
382            self
383        }
384
385        /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
386        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
387            self.0.request.request_id = v.into();
388            self
389        }
390    }
391
392    #[doc(hidden)]
393    impl crate::RequestBuilder for CreateAddressGroup {
394        fn request_options(&mut self) -> &mut crate::RequestOptions {
395            &mut self.0.options
396        }
397    }
398
399    /// The request builder for [AddressGroupService::update_address_group][crate::client::AddressGroupService::update_address_group] calls.
400    ///
401    /// # Example
402    /// ```
403    /// # use google_cloud_networksecurity_v1::builder::address_group_service::UpdateAddressGroup;
404    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
405    /// use google_cloud_lro::Poller;
406    ///
407    /// let builder = prepare_request_builder();
408    /// let response = builder.poller().until_done().await?;
409    /// # Ok(()) }
410    ///
411    /// fn prepare_request_builder() -> UpdateAddressGroup {
412    ///   # panic!();
413    ///   // ... details omitted ...
414    /// }
415    /// ```
416    #[derive(Clone, Debug)]
417    pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
418
419    impl UpdateAddressGroup {
420        pub(crate) fn new(
421            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
422        ) -> Self {
423            Self(RequestBuilder::new(stub))
424        }
425
426        /// Sets the full request, replacing any prior values.
427        pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
428            mut self,
429            v: V,
430        ) -> Self {
431            self.0.request = v.into();
432            self
433        }
434
435        /// Sets all the options, replacing any prior values.
436        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
437            self.0.options = v.into();
438            self
439        }
440
441        /// Sends the request.
442        ///
443        /// # Long running operations
444        ///
445        /// This starts, but does not poll, a longrunning operation. More information
446        /// on [update_address_group][crate::client::AddressGroupService::update_address_group].
447        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
448            (*self.0.stub)
449                .update_address_group(self.0.request, self.0.options)
450                .await
451                .map(crate::Response::into_body)
452        }
453
454        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_address_group`.
455        pub fn poller(
456            self,
457        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
458        {
459            type Operation = google_cloud_lro::internal::Operation<
460                crate::model::AddressGroup,
461                crate::model::OperationMetadata,
462            >;
463            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
464            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
465
466            let stub = self.0.stub.clone();
467            let mut options = self.0.options.clone();
468            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
469            let query = move |name| {
470                let stub = stub.clone();
471                let options = options.clone();
472                async {
473                    let op = GetOperation::new(stub)
474                        .set_name(name)
475                        .with_options(options)
476                        .send()
477                        .await?;
478                    Ok(Operation::new(op))
479                }
480            };
481
482            let start = move || async {
483                let op = self.send().await?;
484                Ok(Operation::new(op))
485            };
486
487            google_cloud_lro::internal::new_poller(
488                polling_error_policy,
489                polling_backoff_policy,
490                start,
491                query,
492            )
493        }
494
495        /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
496        pub fn set_update_mask<T>(mut self, v: T) -> Self
497        where
498            T: std::convert::Into<wkt::FieldMask>,
499        {
500            self.0.request.update_mask = std::option::Option::Some(v.into());
501            self
502        }
503
504        /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
505        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
506        where
507            T: std::convert::Into<wkt::FieldMask>,
508        {
509            self.0.request.update_mask = v.map(|x| x.into());
510            self
511        }
512
513        /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
514        ///
515        /// This is a **required** field for requests.
516        pub fn set_address_group<T>(mut self, v: T) -> Self
517        where
518            T: std::convert::Into<crate::model::AddressGroup>,
519        {
520            self.0.request.address_group = std::option::Option::Some(v.into());
521            self
522        }
523
524        /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
525        ///
526        /// This is a **required** field for requests.
527        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
528        where
529            T: std::convert::Into<crate::model::AddressGroup>,
530        {
531            self.0.request.address_group = v.map(|x| x.into());
532            self
533        }
534
535        /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
536        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
537            self.0.request.request_id = v.into();
538            self
539        }
540    }
541
542    #[doc(hidden)]
543    impl crate::RequestBuilder for UpdateAddressGroup {
544        fn request_options(&mut self) -> &mut crate::RequestOptions {
545            &mut self.0.options
546        }
547    }
548
549    /// The request builder for [AddressGroupService::add_address_group_items][crate::client::AddressGroupService::add_address_group_items] calls.
550    ///
551    /// # Example
552    /// ```
553    /// # use google_cloud_networksecurity_v1::builder::address_group_service::AddAddressGroupItems;
554    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
555    /// use google_cloud_lro::Poller;
556    ///
557    /// let builder = prepare_request_builder();
558    /// let response = builder.poller().until_done().await?;
559    /// # Ok(()) }
560    ///
561    /// fn prepare_request_builder() -> AddAddressGroupItems {
562    ///   # panic!();
563    ///   // ... details omitted ...
564    /// }
565    /// ```
566    #[derive(Clone, Debug)]
567    pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
568
569    impl AddAddressGroupItems {
570        pub(crate) fn new(
571            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
572        ) -> Self {
573            Self(RequestBuilder::new(stub))
574        }
575
576        /// Sets the full request, replacing any prior values.
577        pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
578            mut self,
579            v: V,
580        ) -> Self {
581            self.0.request = v.into();
582            self
583        }
584
585        /// Sets all the options, replacing any prior values.
586        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
587            self.0.options = v.into();
588            self
589        }
590
591        /// Sends the request.
592        ///
593        /// # Long running operations
594        ///
595        /// This starts, but does not poll, a longrunning operation. More information
596        /// on [add_address_group_items][crate::client::AddressGroupService::add_address_group_items].
597        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
598            (*self.0.stub)
599                .add_address_group_items(self.0.request, self.0.options)
600                .await
601                .map(crate::Response::into_body)
602        }
603
604        /// Creates a [Poller][google_cloud_lro::Poller] to work with `add_address_group_items`.
605        pub fn poller(
606            self,
607        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
608        {
609            type Operation = google_cloud_lro::internal::Operation<
610                crate::model::AddressGroup,
611                crate::model::OperationMetadata,
612            >;
613            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
614            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
615
616            let stub = self.0.stub.clone();
617            let mut options = self.0.options.clone();
618            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
619            let query = move |name| {
620                let stub = stub.clone();
621                let options = options.clone();
622                async {
623                    let op = GetOperation::new(stub)
624                        .set_name(name)
625                        .with_options(options)
626                        .send()
627                        .await?;
628                    Ok(Operation::new(op))
629                }
630            };
631
632            let start = move || async {
633                let op = self.send().await?;
634                Ok(Operation::new(op))
635            };
636
637            google_cloud_lro::internal::new_poller(
638                polling_error_policy,
639                polling_backoff_policy,
640                start,
641                query,
642            )
643        }
644
645        /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
646        ///
647        /// This is a **required** field for requests.
648        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
649            self.0.request.address_group = v.into();
650            self
651        }
652
653        /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
654        ///
655        /// This is a **required** field for requests.
656        pub fn set_items<T, V>(mut self, v: T) -> Self
657        where
658            T: std::iter::IntoIterator<Item = V>,
659            V: std::convert::Into<std::string::String>,
660        {
661            use std::iter::Iterator;
662            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
663            self
664        }
665
666        /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
667        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
668            self.0.request.request_id = v.into();
669            self
670        }
671    }
672
673    #[doc(hidden)]
674    impl crate::RequestBuilder for AddAddressGroupItems {
675        fn request_options(&mut self) -> &mut crate::RequestOptions {
676            &mut self.0.options
677        }
678    }
679
680    /// The request builder for [AddressGroupService::remove_address_group_items][crate::client::AddressGroupService::remove_address_group_items] calls.
681    ///
682    /// # Example
683    /// ```
684    /// # use google_cloud_networksecurity_v1::builder::address_group_service::RemoveAddressGroupItems;
685    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
686    /// use google_cloud_lro::Poller;
687    ///
688    /// let builder = prepare_request_builder();
689    /// let response = builder.poller().until_done().await?;
690    /// # Ok(()) }
691    ///
692    /// fn prepare_request_builder() -> RemoveAddressGroupItems {
693    ///   # panic!();
694    ///   // ... details omitted ...
695    /// }
696    /// ```
697    #[derive(Clone, Debug)]
698    pub struct RemoveAddressGroupItems(
699        RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
700    );
701
702    impl RemoveAddressGroupItems {
703        pub(crate) fn new(
704            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
705        ) -> Self {
706            Self(RequestBuilder::new(stub))
707        }
708
709        /// Sets the full request, replacing any prior values.
710        pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
711            mut self,
712            v: V,
713        ) -> Self {
714            self.0.request = v.into();
715            self
716        }
717
718        /// Sets all the options, replacing any prior values.
719        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
720            self.0.options = v.into();
721            self
722        }
723
724        /// Sends the request.
725        ///
726        /// # Long running operations
727        ///
728        /// This starts, but does not poll, a longrunning operation. More information
729        /// on [remove_address_group_items][crate::client::AddressGroupService::remove_address_group_items].
730        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
731            (*self.0.stub)
732                .remove_address_group_items(self.0.request, self.0.options)
733                .await
734                .map(crate::Response::into_body)
735        }
736
737        /// Creates a [Poller][google_cloud_lro::Poller] to work with `remove_address_group_items`.
738        pub fn poller(
739            self,
740        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
741        {
742            type Operation = google_cloud_lro::internal::Operation<
743                crate::model::AddressGroup,
744                crate::model::OperationMetadata,
745            >;
746            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
747            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
748
749            let stub = self.0.stub.clone();
750            let mut options = self.0.options.clone();
751            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
752            let query = move |name| {
753                let stub = stub.clone();
754                let options = options.clone();
755                async {
756                    let op = GetOperation::new(stub)
757                        .set_name(name)
758                        .with_options(options)
759                        .send()
760                        .await?;
761                    Ok(Operation::new(op))
762                }
763            };
764
765            let start = move || async {
766                let op = self.send().await?;
767                Ok(Operation::new(op))
768            };
769
770            google_cloud_lro::internal::new_poller(
771                polling_error_policy,
772                polling_backoff_policy,
773                start,
774                query,
775            )
776        }
777
778        /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
779        ///
780        /// This is a **required** field for requests.
781        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
782            self.0.request.address_group = v.into();
783            self
784        }
785
786        /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
787        ///
788        /// This is a **required** field for requests.
789        pub fn set_items<T, V>(mut self, v: T) -> Self
790        where
791            T: std::iter::IntoIterator<Item = V>,
792            V: std::convert::Into<std::string::String>,
793        {
794            use std::iter::Iterator;
795            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
796            self
797        }
798
799        /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
800        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
801            self.0.request.request_id = v.into();
802            self
803        }
804    }
805
806    #[doc(hidden)]
807    impl crate::RequestBuilder for RemoveAddressGroupItems {
808        fn request_options(&mut self) -> &mut crate::RequestOptions {
809            &mut self.0.options
810        }
811    }
812
813    /// The request builder for [AddressGroupService::clone_address_group_items][crate::client::AddressGroupService::clone_address_group_items] calls.
814    ///
815    /// # Example
816    /// ```
817    /// # use google_cloud_networksecurity_v1::builder::address_group_service::CloneAddressGroupItems;
818    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
819    /// use google_cloud_lro::Poller;
820    ///
821    /// let builder = prepare_request_builder();
822    /// let response = builder.poller().until_done().await?;
823    /// # Ok(()) }
824    ///
825    /// fn prepare_request_builder() -> CloneAddressGroupItems {
826    ///   # panic!();
827    ///   // ... details omitted ...
828    /// }
829    /// ```
830    #[derive(Clone, Debug)]
831    pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
832
833    impl CloneAddressGroupItems {
834        pub(crate) fn new(
835            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
836        ) -> Self {
837            Self(RequestBuilder::new(stub))
838        }
839
840        /// Sets the full request, replacing any prior values.
841        pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
842            mut self,
843            v: V,
844        ) -> Self {
845            self.0.request = v.into();
846            self
847        }
848
849        /// Sets all the options, replacing any prior values.
850        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
851            self.0.options = v.into();
852            self
853        }
854
855        /// Sends the request.
856        ///
857        /// # Long running operations
858        ///
859        /// This starts, but does not poll, a longrunning operation. More information
860        /// on [clone_address_group_items][crate::client::AddressGroupService::clone_address_group_items].
861        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
862            (*self.0.stub)
863                .clone_address_group_items(self.0.request, self.0.options)
864                .await
865                .map(crate::Response::into_body)
866        }
867
868        /// Creates a [Poller][google_cloud_lro::Poller] to work with `clone_address_group_items`.
869        pub fn poller(
870            self,
871        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
872        {
873            type Operation = google_cloud_lro::internal::Operation<
874                crate::model::AddressGroup,
875                crate::model::OperationMetadata,
876            >;
877            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
878            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
879
880            let stub = self.0.stub.clone();
881            let mut options = self.0.options.clone();
882            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
883            let query = move |name| {
884                let stub = stub.clone();
885                let options = options.clone();
886                async {
887                    let op = GetOperation::new(stub)
888                        .set_name(name)
889                        .with_options(options)
890                        .send()
891                        .await?;
892                    Ok(Operation::new(op))
893                }
894            };
895
896            let start = move || async {
897                let op = self.send().await?;
898                Ok(Operation::new(op))
899            };
900
901            google_cloud_lro::internal::new_poller(
902                polling_error_policy,
903                polling_backoff_policy,
904                start,
905                query,
906            )
907        }
908
909        /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
910        ///
911        /// This is a **required** field for requests.
912        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
913            self.0.request.address_group = v.into();
914            self
915        }
916
917        /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
918        ///
919        /// This is a **required** field for requests.
920        pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
921            self.0.request.source_address_group = v.into();
922            self
923        }
924
925        /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
926        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
927            self.0.request.request_id = v.into();
928            self
929        }
930    }
931
932    #[doc(hidden)]
933    impl crate::RequestBuilder for CloneAddressGroupItems {
934        fn request_options(&mut self) -> &mut crate::RequestOptions {
935            &mut self.0.options
936        }
937    }
938
939    /// The request builder for [AddressGroupService::delete_address_group][crate::client::AddressGroupService::delete_address_group] calls.
940    ///
941    /// # Example
942    /// ```
943    /// # use google_cloud_networksecurity_v1::builder::address_group_service::DeleteAddressGroup;
944    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
945    /// use google_cloud_lro::Poller;
946    ///
947    /// let builder = prepare_request_builder();
948    /// let response = builder.poller().until_done().await?;
949    /// # Ok(()) }
950    ///
951    /// fn prepare_request_builder() -> DeleteAddressGroup {
952    ///   # panic!();
953    ///   // ... details omitted ...
954    /// }
955    /// ```
956    #[derive(Clone, Debug)]
957    pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
958
959    impl DeleteAddressGroup {
960        pub(crate) fn new(
961            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
962        ) -> Self {
963            Self(RequestBuilder::new(stub))
964        }
965
966        /// Sets the full request, replacing any prior values.
967        pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
968            mut self,
969            v: V,
970        ) -> Self {
971            self.0.request = v.into();
972            self
973        }
974
975        /// Sets all the options, replacing any prior values.
976        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
977            self.0.options = v.into();
978            self
979        }
980
981        /// Sends the request.
982        ///
983        /// # Long running operations
984        ///
985        /// This starts, but does not poll, a longrunning operation. More information
986        /// on [delete_address_group][crate::client::AddressGroupService::delete_address_group].
987        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
988            (*self.0.stub)
989                .delete_address_group(self.0.request, self.0.options)
990                .await
991                .map(crate::Response::into_body)
992        }
993
994        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_address_group`.
995        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
996            type Operation =
997                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
998            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
999            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1000
1001            let stub = self.0.stub.clone();
1002            let mut options = self.0.options.clone();
1003            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1004            let query = move |name| {
1005                let stub = stub.clone();
1006                let options = options.clone();
1007                async {
1008                    let op = GetOperation::new(stub)
1009                        .set_name(name)
1010                        .with_options(options)
1011                        .send()
1012                        .await?;
1013                    Ok(Operation::new(op))
1014                }
1015            };
1016
1017            let start = move || async {
1018                let op = self.send().await?;
1019                Ok(Operation::new(op))
1020            };
1021
1022            google_cloud_lro::internal::new_unit_response_poller(
1023                polling_error_policy,
1024                polling_backoff_policy,
1025                start,
1026                query,
1027            )
1028        }
1029
1030        /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
1031        ///
1032        /// This is a **required** field for requests.
1033        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1034            self.0.request.name = v.into();
1035            self
1036        }
1037
1038        /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
1039        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1040            self.0.request.request_id = v.into();
1041            self
1042        }
1043    }
1044
1045    #[doc(hidden)]
1046    impl crate::RequestBuilder for DeleteAddressGroup {
1047        fn request_options(&mut self) -> &mut crate::RequestOptions {
1048            &mut self.0.options
1049        }
1050    }
1051
1052    /// The request builder for [AddressGroupService::list_address_group_references][crate::client::AddressGroupService::list_address_group_references] calls.
1053    ///
1054    /// # Example
1055    /// ```
1056    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListAddressGroupReferences;
1057    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1058    /// use google_cloud_gax::paginator::ItemPaginator;
1059    ///
1060    /// let builder = prepare_request_builder();
1061    /// let mut items = builder.by_item();
1062    /// while let Some(result) = items.next().await {
1063    ///   let item = result?;
1064    /// }
1065    /// # Ok(()) }
1066    ///
1067    /// fn prepare_request_builder() -> ListAddressGroupReferences {
1068    ///   # panic!();
1069    ///   // ... details omitted ...
1070    /// }
1071    /// ```
1072    #[derive(Clone, Debug)]
1073    pub struct ListAddressGroupReferences(
1074        RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
1075    );
1076
1077    impl ListAddressGroupReferences {
1078        pub(crate) fn new(
1079            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1080        ) -> Self {
1081            Self(RequestBuilder::new(stub))
1082        }
1083
1084        /// Sets the full request, replacing any prior values.
1085        pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
1086            mut self,
1087            v: V,
1088        ) -> Self {
1089            self.0.request = v.into();
1090            self
1091        }
1092
1093        /// Sets all the options, replacing any prior values.
1094        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1095            self.0.options = v.into();
1096            self
1097        }
1098
1099        /// Sends the request.
1100        pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
1101            (*self.0.stub)
1102                .list_address_group_references(self.0.request, self.0.options)
1103                .await
1104                .map(crate::Response::into_body)
1105        }
1106
1107        /// Streams each page in the collection.
1108        pub fn by_page(
1109            self,
1110        ) -> impl google_cloud_gax::paginator::Paginator<
1111            crate::model::ListAddressGroupReferencesResponse,
1112            crate::Error,
1113        > {
1114            use std::clone::Clone;
1115            let token = self.0.request.page_token.clone();
1116            let execute = move |token: String| {
1117                let mut builder = self.clone();
1118                builder.0.request = builder.0.request.set_page_token(token);
1119                builder.send()
1120            };
1121            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1122        }
1123
1124        /// Streams each item in the collection.
1125        pub fn by_item(
1126            self,
1127        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1128            crate::model::ListAddressGroupReferencesResponse,
1129            crate::Error,
1130        > {
1131            use google_cloud_gax::paginator::Paginator;
1132            self.by_page().items()
1133        }
1134
1135        /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
1136        ///
1137        /// This is a **required** field for requests.
1138        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
1139            self.0.request.address_group = v.into();
1140            self
1141        }
1142
1143        /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
1144        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1145            self.0.request.page_size = v.into();
1146            self
1147        }
1148
1149        /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
1150        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1151            self.0.request.page_token = v.into();
1152            self
1153        }
1154    }
1155
1156    #[doc(hidden)]
1157    impl crate::RequestBuilder for ListAddressGroupReferences {
1158        fn request_options(&mut self) -> &mut crate::RequestOptions {
1159            &mut self.0.options
1160        }
1161    }
1162
1163    /// The request builder for [AddressGroupService::list_locations][crate::client::AddressGroupService::list_locations] calls.
1164    ///
1165    /// # Example
1166    /// ```
1167    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListLocations;
1168    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1169    /// use google_cloud_gax::paginator::ItemPaginator;
1170    ///
1171    /// let builder = prepare_request_builder();
1172    /// let mut items = builder.by_item();
1173    /// while let Some(result) = items.next().await {
1174    ///   let item = result?;
1175    /// }
1176    /// # Ok(()) }
1177    ///
1178    /// fn prepare_request_builder() -> ListLocations {
1179    ///   # panic!();
1180    ///   // ... details omitted ...
1181    /// }
1182    /// ```
1183    #[derive(Clone, Debug)]
1184    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1185
1186    impl ListLocations {
1187        pub(crate) fn new(
1188            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1189        ) -> Self {
1190            Self(RequestBuilder::new(stub))
1191        }
1192
1193        /// Sets the full request, replacing any prior values.
1194        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1195            mut self,
1196            v: V,
1197        ) -> Self {
1198            self.0.request = v.into();
1199            self
1200        }
1201
1202        /// Sets all the options, replacing any prior values.
1203        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1204            self.0.options = v.into();
1205            self
1206        }
1207
1208        /// Sends the request.
1209        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1210            (*self.0.stub)
1211                .list_locations(self.0.request, self.0.options)
1212                .await
1213                .map(crate::Response::into_body)
1214        }
1215
1216        /// Streams each page in the collection.
1217        pub fn by_page(
1218            self,
1219        ) -> impl google_cloud_gax::paginator::Paginator<
1220            google_cloud_location::model::ListLocationsResponse,
1221            crate::Error,
1222        > {
1223            use std::clone::Clone;
1224            let token = self.0.request.page_token.clone();
1225            let execute = move |token: String| {
1226                let mut builder = self.clone();
1227                builder.0.request = builder.0.request.set_page_token(token);
1228                builder.send()
1229            };
1230            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1231        }
1232
1233        /// Streams each item in the collection.
1234        pub fn by_item(
1235            self,
1236        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1237            google_cloud_location::model::ListLocationsResponse,
1238            crate::Error,
1239        > {
1240            use google_cloud_gax::paginator::Paginator;
1241            self.by_page().items()
1242        }
1243
1244        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1245        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1246            self.0.request.name = v.into();
1247            self
1248        }
1249
1250        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1251        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1252            self.0.request.filter = v.into();
1253            self
1254        }
1255
1256        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1257        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1258            self.0.request.page_size = v.into();
1259            self
1260        }
1261
1262        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1263        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1264            self.0.request.page_token = v.into();
1265            self
1266        }
1267    }
1268
1269    #[doc(hidden)]
1270    impl crate::RequestBuilder for ListLocations {
1271        fn request_options(&mut self) -> &mut crate::RequestOptions {
1272            &mut self.0.options
1273        }
1274    }
1275
1276    /// The request builder for [AddressGroupService::get_location][crate::client::AddressGroupService::get_location] calls.
1277    ///
1278    /// # Example
1279    /// ```
1280    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetLocation;
1281    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1282    ///
1283    /// let builder = prepare_request_builder();
1284    /// let response = builder.send().await?;
1285    /// # Ok(()) }
1286    ///
1287    /// fn prepare_request_builder() -> GetLocation {
1288    ///   # panic!();
1289    ///   // ... details omitted ...
1290    /// }
1291    /// ```
1292    #[derive(Clone, Debug)]
1293    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1294
1295    impl GetLocation {
1296        pub(crate) fn new(
1297            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1298        ) -> Self {
1299            Self(RequestBuilder::new(stub))
1300        }
1301
1302        /// Sets the full request, replacing any prior values.
1303        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1304            mut self,
1305            v: V,
1306        ) -> Self {
1307            self.0.request = v.into();
1308            self
1309        }
1310
1311        /// Sets all the options, replacing any prior values.
1312        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1313            self.0.options = v.into();
1314            self
1315        }
1316
1317        /// Sends the request.
1318        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1319            (*self.0.stub)
1320                .get_location(self.0.request, self.0.options)
1321                .await
1322                .map(crate::Response::into_body)
1323        }
1324
1325        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1326        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1327            self.0.request.name = v.into();
1328            self
1329        }
1330    }
1331
1332    #[doc(hidden)]
1333    impl crate::RequestBuilder for GetLocation {
1334        fn request_options(&mut self) -> &mut crate::RequestOptions {
1335            &mut self.0.options
1336        }
1337    }
1338
1339    /// The request builder for [AddressGroupService::set_iam_policy][crate::client::AddressGroupService::set_iam_policy] calls.
1340    ///
1341    /// # Example
1342    /// ```
1343    /// # use google_cloud_networksecurity_v1::builder::address_group_service::SetIamPolicy;
1344    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1345    ///
1346    /// let builder = prepare_request_builder();
1347    /// let response = builder.send().await?;
1348    /// # Ok(()) }
1349    ///
1350    /// fn prepare_request_builder() -> SetIamPolicy {
1351    ///   # panic!();
1352    ///   // ... details omitted ...
1353    /// }
1354    /// ```
1355    #[derive(Clone, Debug)]
1356    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1357
1358    impl SetIamPolicy {
1359        pub(crate) fn new(
1360            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1361        ) -> Self {
1362            Self(RequestBuilder::new(stub))
1363        }
1364
1365        /// Sets the full request, replacing any prior values.
1366        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1367            mut self,
1368            v: V,
1369        ) -> Self {
1370            self.0.request = v.into();
1371            self
1372        }
1373
1374        /// Sets all the options, replacing any prior values.
1375        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1376            self.0.options = v.into();
1377            self
1378        }
1379
1380        /// Sends the request.
1381        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1382            (*self.0.stub)
1383                .set_iam_policy(self.0.request, self.0.options)
1384                .await
1385                .map(crate::Response::into_body)
1386        }
1387
1388        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
1389        ///
1390        /// This is a **required** field for requests.
1391        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1392            self.0.request.resource = v.into();
1393            self
1394        }
1395
1396        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1397        ///
1398        /// This is a **required** field for requests.
1399        pub fn set_policy<T>(mut self, v: T) -> Self
1400        where
1401            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1402        {
1403            self.0.request.policy = std::option::Option::Some(v.into());
1404            self
1405        }
1406
1407        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1408        ///
1409        /// This is a **required** field for requests.
1410        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1411        where
1412            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1413        {
1414            self.0.request.policy = v.map(|x| x.into());
1415            self
1416        }
1417
1418        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1419        pub fn set_update_mask<T>(mut self, v: T) -> Self
1420        where
1421            T: std::convert::Into<wkt::FieldMask>,
1422        {
1423            self.0.request.update_mask = std::option::Option::Some(v.into());
1424            self
1425        }
1426
1427        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1428        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1429        where
1430            T: std::convert::Into<wkt::FieldMask>,
1431        {
1432            self.0.request.update_mask = v.map(|x| x.into());
1433            self
1434        }
1435    }
1436
1437    #[doc(hidden)]
1438    impl crate::RequestBuilder for SetIamPolicy {
1439        fn request_options(&mut self) -> &mut crate::RequestOptions {
1440            &mut self.0.options
1441        }
1442    }
1443
1444    /// The request builder for [AddressGroupService::get_iam_policy][crate::client::AddressGroupService::get_iam_policy] calls.
1445    ///
1446    /// # Example
1447    /// ```
1448    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetIamPolicy;
1449    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1450    ///
1451    /// let builder = prepare_request_builder();
1452    /// let response = builder.send().await?;
1453    /// # Ok(()) }
1454    ///
1455    /// fn prepare_request_builder() -> GetIamPolicy {
1456    ///   # panic!();
1457    ///   // ... details omitted ...
1458    /// }
1459    /// ```
1460    #[derive(Clone, Debug)]
1461    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1462
1463    impl GetIamPolicy {
1464        pub(crate) fn new(
1465            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1466        ) -> Self {
1467            Self(RequestBuilder::new(stub))
1468        }
1469
1470        /// Sets the full request, replacing any prior values.
1471        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1472            mut self,
1473            v: V,
1474        ) -> Self {
1475            self.0.request = v.into();
1476            self
1477        }
1478
1479        /// Sets all the options, replacing any prior values.
1480        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1481            self.0.options = v.into();
1482            self
1483        }
1484
1485        /// Sends the request.
1486        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1487            (*self.0.stub)
1488                .get_iam_policy(self.0.request, self.0.options)
1489                .await
1490                .map(crate::Response::into_body)
1491        }
1492
1493        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
1494        ///
1495        /// This is a **required** field for requests.
1496        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1497            self.0.request.resource = v.into();
1498            self
1499        }
1500
1501        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1502        pub fn set_options<T>(mut self, v: T) -> Self
1503        where
1504            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1505        {
1506            self.0.request.options = std::option::Option::Some(v.into());
1507            self
1508        }
1509
1510        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1511        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1512        where
1513            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1514        {
1515            self.0.request.options = v.map(|x| x.into());
1516            self
1517        }
1518    }
1519
1520    #[doc(hidden)]
1521    impl crate::RequestBuilder for GetIamPolicy {
1522        fn request_options(&mut self) -> &mut crate::RequestOptions {
1523            &mut self.0.options
1524        }
1525    }
1526
1527    /// The request builder for [AddressGroupService::test_iam_permissions][crate::client::AddressGroupService::test_iam_permissions] calls.
1528    ///
1529    /// # Example
1530    /// ```
1531    /// # use google_cloud_networksecurity_v1::builder::address_group_service::TestIamPermissions;
1532    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1533    ///
1534    /// let builder = prepare_request_builder();
1535    /// let response = builder.send().await?;
1536    /// # Ok(()) }
1537    ///
1538    /// fn prepare_request_builder() -> TestIamPermissions {
1539    ///   # panic!();
1540    ///   // ... details omitted ...
1541    /// }
1542    /// ```
1543    #[derive(Clone, Debug)]
1544    pub struct TestIamPermissions(
1545        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1546    );
1547
1548    impl TestIamPermissions {
1549        pub(crate) fn new(
1550            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1551        ) -> Self {
1552            Self(RequestBuilder::new(stub))
1553        }
1554
1555        /// Sets the full request, replacing any prior values.
1556        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1557            mut self,
1558            v: V,
1559        ) -> Self {
1560            self.0.request = v.into();
1561            self
1562        }
1563
1564        /// Sets all the options, replacing any prior values.
1565        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1566            self.0.options = v.into();
1567            self
1568        }
1569
1570        /// Sends the request.
1571        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1572            (*self.0.stub)
1573                .test_iam_permissions(self.0.request, self.0.options)
1574                .await
1575                .map(crate::Response::into_body)
1576        }
1577
1578        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
1579        ///
1580        /// This is a **required** field for requests.
1581        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1582            self.0.request.resource = v.into();
1583            self
1584        }
1585
1586        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
1587        ///
1588        /// This is a **required** field for requests.
1589        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1590        where
1591            T: std::iter::IntoIterator<Item = V>,
1592            V: std::convert::Into<std::string::String>,
1593        {
1594            use std::iter::Iterator;
1595            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1596            self
1597        }
1598    }
1599
1600    #[doc(hidden)]
1601    impl crate::RequestBuilder for TestIamPermissions {
1602        fn request_options(&mut self) -> &mut crate::RequestOptions {
1603            &mut self.0.options
1604        }
1605    }
1606
1607    /// The request builder for [AddressGroupService::list_operations][crate::client::AddressGroupService::list_operations] calls.
1608    ///
1609    /// # Example
1610    /// ```
1611    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListOperations;
1612    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1613    /// use google_cloud_gax::paginator::ItemPaginator;
1614    ///
1615    /// let builder = prepare_request_builder();
1616    /// let mut items = builder.by_item();
1617    /// while let Some(result) = items.next().await {
1618    ///   let item = result?;
1619    /// }
1620    /// # Ok(()) }
1621    ///
1622    /// fn prepare_request_builder() -> ListOperations {
1623    ///   # panic!();
1624    ///   // ... details omitted ...
1625    /// }
1626    /// ```
1627    #[derive(Clone, Debug)]
1628    pub struct ListOperations(
1629        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1630    );
1631
1632    impl ListOperations {
1633        pub(crate) fn new(
1634            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1635        ) -> Self {
1636            Self(RequestBuilder::new(stub))
1637        }
1638
1639        /// Sets the full request, replacing any prior values.
1640        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1641            mut self,
1642            v: V,
1643        ) -> Self {
1644            self.0.request = v.into();
1645            self
1646        }
1647
1648        /// Sets all the options, replacing any prior values.
1649        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1650            self.0.options = v.into();
1651            self
1652        }
1653
1654        /// Sends the request.
1655        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1656            (*self.0.stub)
1657                .list_operations(self.0.request, self.0.options)
1658                .await
1659                .map(crate::Response::into_body)
1660        }
1661
1662        /// Streams each page in the collection.
1663        pub fn by_page(
1664            self,
1665        ) -> impl google_cloud_gax::paginator::Paginator<
1666            google_cloud_longrunning::model::ListOperationsResponse,
1667            crate::Error,
1668        > {
1669            use std::clone::Clone;
1670            let token = self.0.request.page_token.clone();
1671            let execute = move |token: String| {
1672                let mut builder = self.clone();
1673                builder.0.request = builder.0.request.set_page_token(token);
1674                builder.send()
1675            };
1676            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1677        }
1678
1679        /// Streams each item in the collection.
1680        pub fn by_item(
1681            self,
1682        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1683            google_cloud_longrunning::model::ListOperationsResponse,
1684            crate::Error,
1685        > {
1686            use google_cloud_gax::paginator::Paginator;
1687            self.by_page().items()
1688        }
1689
1690        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1691        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1692            self.0.request.name = v.into();
1693            self
1694        }
1695
1696        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1697        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1698            self.0.request.filter = v.into();
1699            self
1700        }
1701
1702        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1703        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1704            self.0.request.page_size = v.into();
1705            self
1706        }
1707
1708        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1709        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1710            self.0.request.page_token = v.into();
1711            self
1712        }
1713
1714        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1715        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1716            self.0.request.return_partial_success = v.into();
1717            self
1718        }
1719    }
1720
1721    #[doc(hidden)]
1722    impl crate::RequestBuilder for ListOperations {
1723        fn request_options(&mut self) -> &mut crate::RequestOptions {
1724            &mut self.0.options
1725        }
1726    }
1727
1728    /// The request builder for [AddressGroupService::get_operation][crate::client::AddressGroupService::get_operation] calls.
1729    ///
1730    /// # Example
1731    /// ```
1732    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetOperation;
1733    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1734    ///
1735    /// let builder = prepare_request_builder();
1736    /// let response = builder.send().await?;
1737    /// # Ok(()) }
1738    ///
1739    /// fn prepare_request_builder() -> GetOperation {
1740    ///   # panic!();
1741    ///   // ... details omitted ...
1742    /// }
1743    /// ```
1744    #[derive(Clone, Debug)]
1745    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1746
1747    impl GetOperation {
1748        pub(crate) fn new(
1749            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1750        ) -> Self {
1751            Self(RequestBuilder::new(stub))
1752        }
1753
1754        /// Sets the full request, replacing any prior values.
1755        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1756            mut self,
1757            v: V,
1758        ) -> Self {
1759            self.0.request = v.into();
1760            self
1761        }
1762
1763        /// Sets all the options, replacing any prior values.
1764        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1765            self.0.options = v.into();
1766            self
1767        }
1768
1769        /// Sends the request.
1770        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1771            (*self.0.stub)
1772                .get_operation(self.0.request, self.0.options)
1773                .await
1774                .map(crate::Response::into_body)
1775        }
1776
1777        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1778        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1779            self.0.request.name = v.into();
1780            self
1781        }
1782    }
1783
1784    #[doc(hidden)]
1785    impl crate::RequestBuilder for GetOperation {
1786        fn request_options(&mut self) -> &mut crate::RequestOptions {
1787            &mut self.0.options
1788        }
1789    }
1790
1791    /// The request builder for [AddressGroupService::delete_operation][crate::client::AddressGroupService::delete_operation] calls.
1792    ///
1793    /// # Example
1794    /// ```
1795    /// # use google_cloud_networksecurity_v1::builder::address_group_service::DeleteOperation;
1796    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1797    ///
1798    /// let builder = prepare_request_builder();
1799    /// let response = builder.send().await?;
1800    /// # Ok(()) }
1801    ///
1802    /// fn prepare_request_builder() -> DeleteOperation {
1803    ///   # panic!();
1804    ///   // ... details omitted ...
1805    /// }
1806    /// ```
1807    #[derive(Clone, Debug)]
1808    pub struct DeleteOperation(
1809        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1810    );
1811
1812    impl DeleteOperation {
1813        pub(crate) fn new(
1814            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1815        ) -> Self {
1816            Self(RequestBuilder::new(stub))
1817        }
1818
1819        /// Sets the full request, replacing any prior values.
1820        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1821            mut self,
1822            v: V,
1823        ) -> Self {
1824            self.0.request = v.into();
1825            self
1826        }
1827
1828        /// Sets all the options, replacing any prior values.
1829        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1830            self.0.options = v.into();
1831            self
1832        }
1833
1834        /// Sends the request.
1835        pub async fn send(self) -> Result<()> {
1836            (*self.0.stub)
1837                .delete_operation(self.0.request, self.0.options)
1838                .await
1839                .map(crate::Response::into_body)
1840        }
1841
1842        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
1843        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1844            self.0.request.name = v.into();
1845            self
1846        }
1847    }
1848
1849    #[doc(hidden)]
1850    impl crate::RequestBuilder for DeleteOperation {
1851        fn request_options(&mut self) -> &mut crate::RequestOptions {
1852            &mut self.0.options
1853        }
1854    }
1855
1856    /// The request builder for [AddressGroupService::cancel_operation][crate::client::AddressGroupService::cancel_operation] calls.
1857    ///
1858    /// # Example
1859    /// ```
1860    /// # use google_cloud_networksecurity_v1::builder::address_group_service::CancelOperation;
1861    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1862    ///
1863    /// let builder = prepare_request_builder();
1864    /// let response = builder.send().await?;
1865    /// # Ok(()) }
1866    ///
1867    /// fn prepare_request_builder() -> CancelOperation {
1868    ///   # panic!();
1869    ///   // ... details omitted ...
1870    /// }
1871    /// ```
1872    #[derive(Clone, Debug)]
1873    pub struct CancelOperation(
1874        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1875    );
1876
1877    impl CancelOperation {
1878        pub(crate) fn new(
1879            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1880        ) -> Self {
1881            Self(RequestBuilder::new(stub))
1882        }
1883
1884        /// Sets the full request, replacing any prior values.
1885        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1886            mut self,
1887            v: V,
1888        ) -> Self {
1889            self.0.request = v.into();
1890            self
1891        }
1892
1893        /// Sets all the options, replacing any prior values.
1894        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1895            self.0.options = v.into();
1896            self
1897        }
1898
1899        /// Sends the request.
1900        pub async fn send(self) -> Result<()> {
1901            (*self.0.stub)
1902                .cancel_operation(self.0.request, self.0.options)
1903                .await
1904                .map(crate::Response::into_body)
1905        }
1906
1907        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1908        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1909            self.0.request.name = v.into();
1910            self
1911        }
1912    }
1913
1914    #[doc(hidden)]
1915    impl crate::RequestBuilder for CancelOperation {
1916        fn request_options(&mut self) -> &mut crate::RequestOptions {
1917            &mut self.0.options
1918        }
1919    }
1920}
1921
1922/// Request and client builders for [OrganizationAddressGroupService][crate::client::OrganizationAddressGroupService].
1923pub mod organization_address_group_service {
1924    use crate::Result;
1925
1926    /// A builder for [OrganizationAddressGroupService][crate::client::OrganizationAddressGroupService].
1927    ///
1928    /// ```
1929    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1930    /// # use google_cloud_networksecurity_v1::*;
1931    /// # use builder::organization_address_group_service::ClientBuilder;
1932    /// # use client::OrganizationAddressGroupService;
1933    /// let builder : ClientBuilder = OrganizationAddressGroupService::builder();
1934    /// let client = builder
1935    ///     .with_endpoint("https://networksecurity.googleapis.com")
1936    ///     .build().await?;
1937    /// # Ok(()) }
1938    /// ```
1939    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1940
1941    pub(crate) mod client {
1942        use super::super::super::client::OrganizationAddressGroupService;
1943        pub struct Factory;
1944        impl crate::ClientFactory for Factory {
1945            type Client = OrganizationAddressGroupService;
1946            type Credentials = gaxi::options::Credentials;
1947            async fn build(
1948                self,
1949                config: gaxi::options::ClientConfig,
1950            ) -> crate::ClientBuilderResult<Self::Client> {
1951                Self::Client::new(config).await
1952            }
1953        }
1954    }
1955
1956    /// Common implementation for [crate::client::OrganizationAddressGroupService] request builders.
1957    #[derive(Clone, Debug)]
1958    pub(crate) struct RequestBuilder<R: std::default::Default> {
1959        stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1960        request: R,
1961        options: crate::RequestOptions,
1962    }
1963
1964    impl<R> RequestBuilder<R>
1965    where
1966        R: std::default::Default,
1967    {
1968        pub(crate) fn new(
1969            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1970        ) -> Self {
1971            Self {
1972                stub,
1973                request: R::default(),
1974                options: crate::RequestOptions::default(),
1975            }
1976        }
1977    }
1978
1979    /// The request builder for [OrganizationAddressGroupService::list_address_groups][crate::client::OrganizationAddressGroupService::list_address_groups] calls.
1980    ///
1981    /// # Example
1982    /// ```
1983    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListAddressGroups;
1984    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1985    /// use google_cloud_gax::paginator::ItemPaginator;
1986    ///
1987    /// let builder = prepare_request_builder();
1988    /// let mut items = builder.by_item();
1989    /// while let Some(result) = items.next().await {
1990    ///   let item = result?;
1991    /// }
1992    /// # Ok(()) }
1993    ///
1994    /// fn prepare_request_builder() -> ListAddressGroups {
1995    ///   # panic!();
1996    ///   // ... details omitted ...
1997    /// }
1998    /// ```
1999    #[derive(Clone, Debug)]
2000    pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
2001
2002    impl ListAddressGroups {
2003        pub(crate) fn new(
2004            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2005        ) -> Self {
2006            Self(RequestBuilder::new(stub))
2007        }
2008
2009        /// Sets the full request, replacing any prior values.
2010        pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
2011            mut self,
2012            v: V,
2013        ) -> Self {
2014            self.0.request = v.into();
2015            self
2016        }
2017
2018        /// Sets all the options, replacing any prior values.
2019        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2020            self.0.options = v.into();
2021            self
2022        }
2023
2024        /// Sends the request.
2025        pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
2026            (*self.0.stub)
2027                .list_address_groups(self.0.request, self.0.options)
2028                .await
2029                .map(crate::Response::into_body)
2030        }
2031
2032        /// Streams each page in the collection.
2033        pub fn by_page(
2034            self,
2035        ) -> impl google_cloud_gax::paginator::Paginator<
2036            crate::model::ListAddressGroupsResponse,
2037            crate::Error,
2038        > {
2039            use std::clone::Clone;
2040            let token = self.0.request.page_token.clone();
2041            let execute = move |token: String| {
2042                let mut builder = self.clone();
2043                builder.0.request = builder.0.request.set_page_token(token);
2044                builder.send()
2045            };
2046            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2047        }
2048
2049        /// Streams each item in the collection.
2050        pub fn by_item(
2051            self,
2052        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2053            crate::model::ListAddressGroupsResponse,
2054            crate::Error,
2055        > {
2056            use google_cloud_gax::paginator::Paginator;
2057            self.by_page().items()
2058        }
2059
2060        /// Sets the value of [parent][crate::model::ListAddressGroupsRequest::parent].
2061        ///
2062        /// This is a **required** field for requests.
2063        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2064            self.0.request.parent = v.into();
2065            self
2066        }
2067
2068        /// Sets the value of [page_size][crate::model::ListAddressGroupsRequest::page_size].
2069        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2070            self.0.request.page_size = v.into();
2071            self
2072        }
2073
2074        /// Sets the value of [page_token][crate::model::ListAddressGroupsRequest::page_token].
2075        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2076            self.0.request.page_token = v.into();
2077            self
2078        }
2079
2080        /// Sets the value of [return_partial_success][crate::model::ListAddressGroupsRequest::return_partial_success].
2081        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2082            self.0.request.return_partial_success = v.into();
2083            self
2084        }
2085    }
2086
2087    #[doc(hidden)]
2088    impl crate::RequestBuilder for ListAddressGroups {
2089        fn request_options(&mut self) -> &mut crate::RequestOptions {
2090            &mut self.0.options
2091        }
2092    }
2093
2094    /// The request builder for [OrganizationAddressGroupService::get_address_group][crate::client::OrganizationAddressGroupService::get_address_group] calls.
2095    ///
2096    /// # Example
2097    /// ```
2098    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetAddressGroup;
2099    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2100    ///
2101    /// let builder = prepare_request_builder();
2102    /// let response = builder.send().await?;
2103    /// # Ok(()) }
2104    ///
2105    /// fn prepare_request_builder() -> GetAddressGroup {
2106    ///   # panic!();
2107    ///   // ... details omitted ...
2108    /// }
2109    /// ```
2110    #[derive(Clone, Debug)]
2111    pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
2112
2113    impl GetAddressGroup {
2114        pub(crate) fn new(
2115            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2116        ) -> Self {
2117            Self(RequestBuilder::new(stub))
2118        }
2119
2120        /// Sets the full request, replacing any prior values.
2121        pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
2122            self.0.request = v.into();
2123            self
2124        }
2125
2126        /// Sets all the options, replacing any prior values.
2127        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2128            self.0.options = v.into();
2129            self
2130        }
2131
2132        /// Sends the request.
2133        pub async fn send(self) -> Result<crate::model::AddressGroup> {
2134            (*self.0.stub)
2135                .get_address_group(self.0.request, self.0.options)
2136                .await
2137                .map(crate::Response::into_body)
2138        }
2139
2140        /// Sets the value of [name][crate::model::GetAddressGroupRequest::name].
2141        ///
2142        /// This is a **required** field for requests.
2143        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2144            self.0.request.name = v.into();
2145            self
2146        }
2147    }
2148
2149    #[doc(hidden)]
2150    impl crate::RequestBuilder for GetAddressGroup {
2151        fn request_options(&mut self) -> &mut crate::RequestOptions {
2152            &mut self.0.options
2153        }
2154    }
2155
2156    /// The request builder for [OrganizationAddressGroupService::create_address_group][crate::client::OrganizationAddressGroupService::create_address_group] calls.
2157    ///
2158    /// # Example
2159    /// ```
2160    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::CreateAddressGroup;
2161    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2162    /// use google_cloud_lro::Poller;
2163    ///
2164    /// let builder = prepare_request_builder();
2165    /// let response = builder.poller().until_done().await?;
2166    /// # Ok(()) }
2167    ///
2168    /// fn prepare_request_builder() -> CreateAddressGroup {
2169    ///   # panic!();
2170    ///   // ... details omitted ...
2171    /// }
2172    /// ```
2173    #[derive(Clone, Debug)]
2174    pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
2175
2176    impl CreateAddressGroup {
2177        pub(crate) fn new(
2178            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2179        ) -> Self {
2180            Self(RequestBuilder::new(stub))
2181        }
2182
2183        /// Sets the full request, replacing any prior values.
2184        pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
2185            mut self,
2186            v: V,
2187        ) -> Self {
2188            self.0.request = v.into();
2189            self
2190        }
2191
2192        /// Sets all the options, replacing any prior values.
2193        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2194            self.0.options = v.into();
2195            self
2196        }
2197
2198        /// Sends the request.
2199        ///
2200        /// # Long running operations
2201        ///
2202        /// This starts, but does not poll, a longrunning operation. More information
2203        /// on [create_address_group][crate::client::OrganizationAddressGroupService::create_address_group].
2204        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2205            (*self.0.stub)
2206                .create_address_group(self.0.request, self.0.options)
2207                .await
2208                .map(crate::Response::into_body)
2209        }
2210
2211        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_address_group`.
2212        pub fn poller(
2213            self,
2214        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2215        {
2216            type Operation = google_cloud_lro::internal::Operation<
2217                crate::model::AddressGroup,
2218                crate::model::OperationMetadata,
2219            >;
2220            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2221            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2222
2223            let stub = self.0.stub.clone();
2224            let mut options = self.0.options.clone();
2225            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2226            let query = move |name| {
2227                let stub = stub.clone();
2228                let options = options.clone();
2229                async {
2230                    let op = GetOperation::new(stub)
2231                        .set_name(name)
2232                        .with_options(options)
2233                        .send()
2234                        .await?;
2235                    Ok(Operation::new(op))
2236                }
2237            };
2238
2239            let start = move || async {
2240                let op = self.send().await?;
2241                Ok(Operation::new(op))
2242            };
2243
2244            google_cloud_lro::internal::new_poller(
2245                polling_error_policy,
2246                polling_backoff_policy,
2247                start,
2248                query,
2249            )
2250        }
2251
2252        /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
2253        ///
2254        /// This is a **required** field for requests.
2255        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2256            self.0.request.parent = v.into();
2257            self
2258        }
2259
2260        /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
2261        ///
2262        /// This is a **required** field for requests.
2263        pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2264            self.0.request.address_group_id = v.into();
2265            self
2266        }
2267
2268        /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
2269        ///
2270        /// This is a **required** field for requests.
2271        pub fn set_address_group<T>(mut self, v: T) -> Self
2272        where
2273            T: std::convert::Into<crate::model::AddressGroup>,
2274        {
2275            self.0.request.address_group = std::option::Option::Some(v.into());
2276            self
2277        }
2278
2279        /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
2280        ///
2281        /// This is a **required** field for requests.
2282        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2283        where
2284            T: std::convert::Into<crate::model::AddressGroup>,
2285        {
2286            self.0.request.address_group = v.map(|x| x.into());
2287            self
2288        }
2289
2290        /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
2291        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2292            self.0.request.request_id = v.into();
2293            self
2294        }
2295    }
2296
2297    #[doc(hidden)]
2298    impl crate::RequestBuilder for CreateAddressGroup {
2299        fn request_options(&mut self) -> &mut crate::RequestOptions {
2300            &mut self.0.options
2301        }
2302    }
2303
2304    /// The request builder for [OrganizationAddressGroupService::update_address_group][crate::client::OrganizationAddressGroupService::update_address_group] calls.
2305    ///
2306    /// # Example
2307    /// ```
2308    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::UpdateAddressGroup;
2309    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2310    /// use google_cloud_lro::Poller;
2311    ///
2312    /// let builder = prepare_request_builder();
2313    /// let response = builder.poller().until_done().await?;
2314    /// # Ok(()) }
2315    ///
2316    /// fn prepare_request_builder() -> UpdateAddressGroup {
2317    ///   # panic!();
2318    ///   // ... details omitted ...
2319    /// }
2320    /// ```
2321    #[derive(Clone, Debug)]
2322    pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
2323
2324    impl UpdateAddressGroup {
2325        pub(crate) fn new(
2326            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2327        ) -> Self {
2328            Self(RequestBuilder::new(stub))
2329        }
2330
2331        /// Sets the full request, replacing any prior values.
2332        pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
2333            mut self,
2334            v: V,
2335        ) -> Self {
2336            self.0.request = v.into();
2337            self
2338        }
2339
2340        /// Sets all the options, replacing any prior values.
2341        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2342            self.0.options = v.into();
2343            self
2344        }
2345
2346        /// Sends the request.
2347        ///
2348        /// # Long running operations
2349        ///
2350        /// This starts, but does not poll, a longrunning operation. More information
2351        /// on [update_address_group][crate::client::OrganizationAddressGroupService::update_address_group].
2352        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2353            (*self.0.stub)
2354                .update_address_group(self.0.request, self.0.options)
2355                .await
2356                .map(crate::Response::into_body)
2357        }
2358
2359        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_address_group`.
2360        pub fn poller(
2361            self,
2362        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2363        {
2364            type Operation = google_cloud_lro::internal::Operation<
2365                crate::model::AddressGroup,
2366                crate::model::OperationMetadata,
2367            >;
2368            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2369            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2370
2371            let stub = self.0.stub.clone();
2372            let mut options = self.0.options.clone();
2373            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2374            let query = move |name| {
2375                let stub = stub.clone();
2376                let options = options.clone();
2377                async {
2378                    let op = GetOperation::new(stub)
2379                        .set_name(name)
2380                        .with_options(options)
2381                        .send()
2382                        .await?;
2383                    Ok(Operation::new(op))
2384                }
2385            };
2386
2387            let start = move || async {
2388                let op = self.send().await?;
2389                Ok(Operation::new(op))
2390            };
2391
2392            google_cloud_lro::internal::new_poller(
2393                polling_error_policy,
2394                polling_backoff_policy,
2395                start,
2396                query,
2397            )
2398        }
2399
2400        /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
2401        pub fn set_update_mask<T>(mut self, v: T) -> Self
2402        where
2403            T: std::convert::Into<wkt::FieldMask>,
2404        {
2405            self.0.request.update_mask = std::option::Option::Some(v.into());
2406            self
2407        }
2408
2409        /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
2410        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2411        where
2412            T: std::convert::Into<wkt::FieldMask>,
2413        {
2414            self.0.request.update_mask = v.map(|x| x.into());
2415            self
2416        }
2417
2418        /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
2419        ///
2420        /// This is a **required** field for requests.
2421        pub fn set_address_group<T>(mut self, v: T) -> Self
2422        where
2423            T: std::convert::Into<crate::model::AddressGroup>,
2424        {
2425            self.0.request.address_group = std::option::Option::Some(v.into());
2426            self
2427        }
2428
2429        /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
2430        ///
2431        /// This is a **required** field for requests.
2432        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2433        where
2434            T: std::convert::Into<crate::model::AddressGroup>,
2435        {
2436            self.0.request.address_group = v.map(|x| x.into());
2437            self
2438        }
2439
2440        /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
2441        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2442            self.0.request.request_id = v.into();
2443            self
2444        }
2445    }
2446
2447    #[doc(hidden)]
2448    impl crate::RequestBuilder for UpdateAddressGroup {
2449        fn request_options(&mut self) -> &mut crate::RequestOptions {
2450            &mut self.0.options
2451        }
2452    }
2453
2454    /// The request builder for [OrganizationAddressGroupService::add_address_group_items][crate::client::OrganizationAddressGroupService::add_address_group_items] calls.
2455    ///
2456    /// # Example
2457    /// ```
2458    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::AddAddressGroupItems;
2459    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2460    /// use google_cloud_lro::Poller;
2461    ///
2462    /// let builder = prepare_request_builder();
2463    /// let response = builder.poller().until_done().await?;
2464    /// # Ok(()) }
2465    ///
2466    /// fn prepare_request_builder() -> AddAddressGroupItems {
2467    ///   # panic!();
2468    ///   // ... details omitted ...
2469    /// }
2470    /// ```
2471    #[derive(Clone, Debug)]
2472    pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
2473
2474    impl AddAddressGroupItems {
2475        pub(crate) fn new(
2476            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2477        ) -> Self {
2478            Self(RequestBuilder::new(stub))
2479        }
2480
2481        /// Sets the full request, replacing any prior values.
2482        pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
2483            mut self,
2484            v: V,
2485        ) -> Self {
2486            self.0.request = v.into();
2487            self
2488        }
2489
2490        /// Sets all the options, replacing any prior values.
2491        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2492            self.0.options = v.into();
2493            self
2494        }
2495
2496        /// Sends the request.
2497        ///
2498        /// # Long running operations
2499        ///
2500        /// This starts, but does not poll, a longrunning operation. More information
2501        /// on [add_address_group_items][crate::client::OrganizationAddressGroupService::add_address_group_items].
2502        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2503            (*self.0.stub)
2504                .add_address_group_items(self.0.request, self.0.options)
2505                .await
2506                .map(crate::Response::into_body)
2507        }
2508
2509        /// Creates a [Poller][google_cloud_lro::Poller] to work with `add_address_group_items`.
2510        pub fn poller(
2511            self,
2512        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2513        {
2514            type Operation = google_cloud_lro::internal::Operation<
2515                crate::model::AddressGroup,
2516                crate::model::OperationMetadata,
2517            >;
2518            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2519            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2520
2521            let stub = self.0.stub.clone();
2522            let mut options = self.0.options.clone();
2523            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2524            let query = move |name| {
2525                let stub = stub.clone();
2526                let options = options.clone();
2527                async {
2528                    let op = GetOperation::new(stub)
2529                        .set_name(name)
2530                        .with_options(options)
2531                        .send()
2532                        .await?;
2533                    Ok(Operation::new(op))
2534                }
2535            };
2536
2537            let start = move || async {
2538                let op = self.send().await?;
2539                Ok(Operation::new(op))
2540            };
2541
2542            google_cloud_lro::internal::new_poller(
2543                polling_error_policy,
2544                polling_backoff_policy,
2545                start,
2546                query,
2547            )
2548        }
2549
2550        /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
2551        ///
2552        /// This is a **required** field for requests.
2553        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2554            self.0.request.address_group = v.into();
2555            self
2556        }
2557
2558        /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
2559        ///
2560        /// This is a **required** field for requests.
2561        pub fn set_items<T, V>(mut self, v: T) -> Self
2562        where
2563            T: std::iter::IntoIterator<Item = V>,
2564            V: std::convert::Into<std::string::String>,
2565        {
2566            use std::iter::Iterator;
2567            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2568            self
2569        }
2570
2571        /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
2572        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2573            self.0.request.request_id = v.into();
2574            self
2575        }
2576    }
2577
2578    #[doc(hidden)]
2579    impl crate::RequestBuilder for AddAddressGroupItems {
2580        fn request_options(&mut self) -> &mut crate::RequestOptions {
2581            &mut self.0.options
2582        }
2583    }
2584
2585    /// The request builder for [OrganizationAddressGroupService::remove_address_group_items][crate::client::OrganizationAddressGroupService::remove_address_group_items] calls.
2586    ///
2587    /// # Example
2588    /// ```
2589    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::RemoveAddressGroupItems;
2590    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2591    /// use google_cloud_lro::Poller;
2592    ///
2593    /// let builder = prepare_request_builder();
2594    /// let response = builder.poller().until_done().await?;
2595    /// # Ok(()) }
2596    ///
2597    /// fn prepare_request_builder() -> RemoveAddressGroupItems {
2598    ///   # panic!();
2599    ///   // ... details omitted ...
2600    /// }
2601    /// ```
2602    #[derive(Clone, Debug)]
2603    pub struct RemoveAddressGroupItems(
2604        RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
2605    );
2606
2607    impl RemoveAddressGroupItems {
2608        pub(crate) fn new(
2609            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2610        ) -> Self {
2611            Self(RequestBuilder::new(stub))
2612        }
2613
2614        /// Sets the full request, replacing any prior values.
2615        pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
2616            mut self,
2617            v: V,
2618        ) -> Self {
2619            self.0.request = v.into();
2620            self
2621        }
2622
2623        /// Sets all the options, replacing any prior values.
2624        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2625            self.0.options = v.into();
2626            self
2627        }
2628
2629        /// Sends the request.
2630        ///
2631        /// # Long running operations
2632        ///
2633        /// This starts, but does not poll, a longrunning operation. More information
2634        /// on [remove_address_group_items][crate::client::OrganizationAddressGroupService::remove_address_group_items].
2635        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2636            (*self.0.stub)
2637                .remove_address_group_items(self.0.request, self.0.options)
2638                .await
2639                .map(crate::Response::into_body)
2640        }
2641
2642        /// Creates a [Poller][google_cloud_lro::Poller] to work with `remove_address_group_items`.
2643        pub fn poller(
2644            self,
2645        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2646        {
2647            type Operation = google_cloud_lro::internal::Operation<
2648                crate::model::AddressGroup,
2649                crate::model::OperationMetadata,
2650            >;
2651            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2652            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2653
2654            let stub = self.0.stub.clone();
2655            let mut options = self.0.options.clone();
2656            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2657            let query = move |name| {
2658                let stub = stub.clone();
2659                let options = options.clone();
2660                async {
2661                    let op = GetOperation::new(stub)
2662                        .set_name(name)
2663                        .with_options(options)
2664                        .send()
2665                        .await?;
2666                    Ok(Operation::new(op))
2667                }
2668            };
2669
2670            let start = move || async {
2671                let op = self.send().await?;
2672                Ok(Operation::new(op))
2673            };
2674
2675            google_cloud_lro::internal::new_poller(
2676                polling_error_policy,
2677                polling_backoff_policy,
2678                start,
2679                query,
2680            )
2681        }
2682
2683        /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
2684        ///
2685        /// This is a **required** field for requests.
2686        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2687            self.0.request.address_group = v.into();
2688            self
2689        }
2690
2691        /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
2692        ///
2693        /// This is a **required** field for requests.
2694        pub fn set_items<T, V>(mut self, v: T) -> Self
2695        where
2696            T: std::iter::IntoIterator<Item = V>,
2697            V: std::convert::Into<std::string::String>,
2698        {
2699            use std::iter::Iterator;
2700            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2701            self
2702        }
2703
2704        /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
2705        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2706            self.0.request.request_id = v.into();
2707            self
2708        }
2709    }
2710
2711    #[doc(hidden)]
2712    impl crate::RequestBuilder for RemoveAddressGroupItems {
2713        fn request_options(&mut self) -> &mut crate::RequestOptions {
2714            &mut self.0.options
2715        }
2716    }
2717
2718    /// The request builder for [OrganizationAddressGroupService::clone_address_group_items][crate::client::OrganizationAddressGroupService::clone_address_group_items] calls.
2719    ///
2720    /// # Example
2721    /// ```
2722    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::CloneAddressGroupItems;
2723    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2724    /// use google_cloud_lro::Poller;
2725    ///
2726    /// let builder = prepare_request_builder();
2727    /// let response = builder.poller().until_done().await?;
2728    /// # Ok(()) }
2729    ///
2730    /// fn prepare_request_builder() -> CloneAddressGroupItems {
2731    ///   # panic!();
2732    ///   // ... details omitted ...
2733    /// }
2734    /// ```
2735    #[derive(Clone, Debug)]
2736    pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
2737
2738    impl CloneAddressGroupItems {
2739        pub(crate) fn new(
2740            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2741        ) -> Self {
2742            Self(RequestBuilder::new(stub))
2743        }
2744
2745        /// Sets the full request, replacing any prior values.
2746        pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
2747            mut self,
2748            v: V,
2749        ) -> Self {
2750            self.0.request = v.into();
2751            self
2752        }
2753
2754        /// Sets all the options, replacing any prior values.
2755        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2756            self.0.options = v.into();
2757            self
2758        }
2759
2760        /// Sends the request.
2761        ///
2762        /// # Long running operations
2763        ///
2764        /// This starts, but does not poll, a longrunning operation. More information
2765        /// on [clone_address_group_items][crate::client::OrganizationAddressGroupService::clone_address_group_items].
2766        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2767            (*self.0.stub)
2768                .clone_address_group_items(self.0.request, self.0.options)
2769                .await
2770                .map(crate::Response::into_body)
2771        }
2772
2773        /// Creates a [Poller][google_cloud_lro::Poller] to work with `clone_address_group_items`.
2774        pub fn poller(
2775            self,
2776        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2777        {
2778            type Operation = google_cloud_lro::internal::Operation<
2779                crate::model::AddressGroup,
2780                crate::model::OperationMetadata,
2781            >;
2782            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2783            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2784
2785            let stub = self.0.stub.clone();
2786            let mut options = self.0.options.clone();
2787            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2788            let query = move |name| {
2789                let stub = stub.clone();
2790                let options = options.clone();
2791                async {
2792                    let op = GetOperation::new(stub)
2793                        .set_name(name)
2794                        .with_options(options)
2795                        .send()
2796                        .await?;
2797                    Ok(Operation::new(op))
2798                }
2799            };
2800
2801            let start = move || async {
2802                let op = self.send().await?;
2803                Ok(Operation::new(op))
2804            };
2805
2806            google_cloud_lro::internal::new_poller(
2807                polling_error_policy,
2808                polling_backoff_policy,
2809                start,
2810                query,
2811            )
2812        }
2813
2814        /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
2815        ///
2816        /// This is a **required** field for requests.
2817        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2818            self.0.request.address_group = v.into();
2819            self
2820        }
2821
2822        /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
2823        ///
2824        /// This is a **required** field for requests.
2825        pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2826            self.0.request.source_address_group = v.into();
2827            self
2828        }
2829
2830        /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
2831        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2832            self.0.request.request_id = v.into();
2833            self
2834        }
2835    }
2836
2837    #[doc(hidden)]
2838    impl crate::RequestBuilder for CloneAddressGroupItems {
2839        fn request_options(&mut self) -> &mut crate::RequestOptions {
2840            &mut self.0.options
2841        }
2842    }
2843
2844    /// The request builder for [OrganizationAddressGroupService::delete_address_group][crate::client::OrganizationAddressGroupService::delete_address_group] calls.
2845    ///
2846    /// # Example
2847    /// ```
2848    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::DeleteAddressGroup;
2849    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2850    /// use google_cloud_lro::Poller;
2851    ///
2852    /// let builder = prepare_request_builder();
2853    /// let response = builder.poller().until_done().await?;
2854    /// # Ok(()) }
2855    ///
2856    /// fn prepare_request_builder() -> DeleteAddressGroup {
2857    ///   # panic!();
2858    ///   // ... details omitted ...
2859    /// }
2860    /// ```
2861    #[derive(Clone, Debug)]
2862    pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
2863
2864    impl DeleteAddressGroup {
2865        pub(crate) fn new(
2866            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2867        ) -> Self {
2868            Self(RequestBuilder::new(stub))
2869        }
2870
2871        /// Sets the full request, replacing any prior values.
2872        pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
2873            mut self,
2874            v: V,
2875        ) -> Self {
2876            self.0.request = v.into();
2877            self
2878        }
2879
2880        /// Sets all the options, replacing any prior values.
2881        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2882            self.0.options = v.into();
2883            self
2884        }
2885
2886        /// Sends the request.
2887        ///
2888        /// # Long running operations
2889        ///
2890        /// This starts, but does not poll, a longrunning operation. More information
2891        /// on [delete_address_group][crate::client::OrganizationAddressGroupService::delete_address_group].
2892        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2893            (*self.0.stub)
2894                .delete_address_group(self.0.request, self.0.options)
2895                .await
2896                .map(crate::Response::into_body)
2897        }
2898
2899        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_address_group`.
2900        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2901            type Operation =
2902                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2903            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2904            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2905
2906            let stub = self.0.stub.clone();
2907            let mut options = self.0.options.clone();
2908            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2909            let query = move |name| {
2910                let stub = stub.clone();
2911                let options = options.clone();
2912                async {
2913                    let op = GetOperation::new(stub)
2914                        .set_name(name)
2915                        .with_options(options)
2916                        .send()
2917                        .await?;
2918                    Ok(Operation::new(op))
2919                }
2920            };
2921
2922            let start = move || async {
2923                let op = self.send().await?;
2924                Ok(Operation::new(op))
2925            };
2926
2927            google_cloud_lro::internal::new_unit_response_poller(
2928                polling_error_policy,
2929                polling_backoff_policy,
2930                start,
2931                query,
2932            )
2933        }
2934
2935        /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
2936        ///
2937        /// This is a **required** field for requests.
2938        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2939            self.0.request.name = v.into();
2940            self
2941        }
2942
2943        /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
2944        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2945            self.0.request.request_id = v.into();
2946            self
2947        }
2948    }
2949
2950    #[doc(hidden)]
2951    impl crate::RequestBuilder for DeleteAddressGroup {
2952        fn request_options(&mut self) -> &mut crate::RequestOptions {
2953            &mut self.0.options
2954        }
2955    }
2956
2957    /// The request builder for [OrganizationAddressGroupService::list_address_group_references][crate::client::OrganizationAddressGroupService::list_address_group_references] calls.
2958    ///
2959    /// # Example
2960    /// ```
2961    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListAddressGroupReferences;
2962    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2963    /// use google_cloud_gax::paginator::ItemPaginator;
2964    ///
2965    /// let builder = prepare_request_builder();
2966    /// let mut items = builder.by_item();
2967    /// while let Some(result) = items.next().await {
2968    ///   let item = result?;
2969    /// }
2970    /// # Ok(()) }
2971    ///
2972    /// fn prepare_request_builder() -> ListAddressGroupReferences {
2973    ///   # panic!();
2974    ///   // ... details omitted ...
2975    /// }
2976    /// ```
2977    #[derive(Clone, Debug)]
2978    pub struct ListAddressGroupReferences(
2979        RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
2980    );
2981
2982    impl ListAddressGroupReferences {
2983        pub(crate) fn new(
2984            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2985        ) -> Self {
2986            Self(RequestBuilder::new(stub))
2987        }
2988
2989        /// Sets the full request, replacing any prior values.
2990        pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
2991            mut self,
2992            v: V,
2993        ) -> Self {
2994            self.0.request = v.into();
2995            self
2996        }
2997
2998        /// Sets all the options, replacing any prior values.
2999        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3000            self.0.options = v.into();
3001            self
3002        }
3003
3004        /// Sends the request.
3005        pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
3006            (*self.0.stub)
3007                .list_address_group_references(self.0.request, self.0.options)
3008                .await
3009                .map(crate::Response::into_body)
3010        }
3011
3012        /// Streams each page in the collection.
3013        pub fn by_page(
3014            self,
3015        ) -> impl google_cloud_gax::paginator::Paginator<
3016            crate::model::ListAddressGroupReferencesResponse,
3017            crate::Error,
3018        > {
3019            use std::clone::Clone;
3020            let token = self.0.request.page_token.clone();
3021            let execute = move |token: String| {
3022                let mut builder = self.clone();
3023                builder.0.request = builder.0.request.set_page_token(token);
3024                builder.send()
3025            };
3026            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3027        }
3028
3029        /// Streams each item in the collection.
3030        pub fn by_item(
3031            self,
3032        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3033            crate::model::ListAddressGroupReferencesResponse,
3034            crate::Error,
3035        > {
3036            use google_cloud_gax::paginator::Paginator;
3037            self.by_page().items()
3038        }
3039
3040        /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
3041        ///
3042        /// This is a **required** field for requests.
3043        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
3044            self.0.request.address_group = v.into();
3045            self
3046        }
3047
3048        /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
3049        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3050            self.0.request.page_size = v.into();
3051            self
3052        }
3053
3054        /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
3055        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3056            self.0.request.page_token = v.into();
3057            self
3058        }
3059    }
3060
3061    #[doc(hidden)]
3062    impl crate::RequestBuilder for ListAddressGroupReferences {
3063        fn request_options(&mut self) -> &mut crate::RequestOptions {
3064            &mut self.0.options
3065        }
3066    }
3067
3068    /// The request builder for [OrganizationAddressGroupService::list_locations][crate::client::OrganizationAddressGroupService::list_locations] calls.
3069    ///
3070    /// # Example
3071    /// ```
3072    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListLocations;
3073    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3074    /// use google_cloud_gax::paginator::ItemPaginator;
3075    ///
3076    /// let builder = prepare_request_builder();
3077    /// let mut items = builder.by_item();
3078    /// while let Some(result) = items.next().await {
3079    ///   let item = result?;
3080    /// }
3081    /// # Ok(()) }
3082    ///
3083    /// fn prepare_request_builder() -> ListLocations {
3084    ///   # panic!();
3085    ///   // ... details omitted ...
3086    /// }
3087    /// ```
3088    #[derive(Clone, Debug)]
3089    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3090
3091    impl ListLocations {
3092        pub(crate) fn new(
3093            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3094        ) -> Self {
3095            Self(RequestBuilder::new(stub))
3096        }
3097
3098        /// Sets the full request, replacing any prior values.
3099        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3100            mut self,
3101            v: V,
3102        ) -> Self {
3103            self.0.request = v.into();
3104            self
3105        }
3106
3107        /// Sets all the options, replacing any prior values.
3108        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3109            self.0.options = v.into();
3110            self
3111        }
3112
3113        /// Sends the request.
3114        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3115            (*self.0.stub)
3116                .list_locations(self.0.request, self.0.options)
3117                .await
3118                .map(crate::Response::into_body)
3119        }
3120
3121        /// Streams each page in the collection.
3122        pub fn by_page(
3123            self,
3124        ) -> impl google_cloud_gax::paginator::Paginator<
3125            google_cloud_location::model::ListLocationsResponse,
3126            crate::Error,
3127        > {
3128            use std::clone::Clone;
3129            let token = self.0.request.page_token.clone();
3130            let execute = move |token: String| {
3131                let mut builder = self.clone();
3132                builder.0.request = builder.0.request.set_page_token(token);
3133                builder.send()
3134            };
3135            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3136        }
3137
3138        /// Streams each item in the collection.
3139        pub fn by_item(
3140            self,
3141        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3142            google_cloud_location::model::ListLocationsResponse,
3143            crate::Error,
3144        > {
3145            use google_cloud_gax::paginator::Paginator;
3146            self.by_page().items()
3147        }
3148
3149        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
3150        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3151            self.0.request.name = v.into();
3152            self
3153        }
3154
3155        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
3156        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3157            self.0.request.filter = v.into();
3158            self
3159        }
3160
3161        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
3162        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3163            self.0.request.page_size = v.into();
3164            self
3165        }
3166
3167        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
3168        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3169            self.0.request.page_token = v.into();
3170            self
3171        }
3172    }
3173
3174    #[doc(hidden)]
3175    impl crate::RequestBuilder for ListLocations {
3176        fn request_options(&mut self) -> &mut crate::RequestOptions {
3177            &mut self.0.options
3178        }
3179    }
3180
3181    /// The request builder for [OrganizationAddressGroupService::get_location][crate::client::OrganizationAddressGroupService::get_location] calls.
3182    ///
3183    /// # Example
3184    /// ```
3185    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetLocation;
3186    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3187    ///
3188    /// let builder = prepare_request_builder();
3189    /// let response = builder.send().await?;
3190    /// # Ok(()) }
3191    ///
3192    /// fn prepare_request_builder() -> GetLocation {
3193    ///   # panic!();
3194    ///   // ... details omitted ...
3195    /// }
3196    /// ```
3197    #[derive(Clone, Debug)]
3198    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3199
3200    impl GetLocation {
3201        pub(crate) fn new(
3202            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3203        ) -> Self {
3204            Self(RequestBuilder::new(stub))
3205        }
3206
3207        /// Sets the full request, replacing any prior values.
3208        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3209            mut self,
3210            v: V,
3211        ) -> Self {
3212            self.0.request = v.into();
3213            self
3214        }
3215
3216        /// Sets all the options, replacing any prior values.
3217        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3218            self.0.options = v.into();
3219            self
3220        }
3221
3222        /// Sends the request.
3223        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3224            (*self.0.stub)
3225                .get_location(self.0.request, self.0.options)
3226                .await
3227                .map(crate::Response::into_body)
3228        }
3229
3230        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
3231        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3232            self.0.request.name = v.into();
3233            self
3234        }
3235    }
3236
3237    #[doc(hidden)]
3238    impl crate::RequestBuilder for GetLocation {
3239        fn request_options(&mut self) -> &mut crate::RequestOptions {
3240            &mut self.0.options
3241        }
3242    }
3243
3244    /// The request builder for [OrganizationAddressGroupService::set_iam_policy][crate::client::OrganizationAddressGroupService::set_iam_policy] calls.
3245    ///
3246    /// # Example
3247    /// ```
3248    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::SetIamPolicy;
3249    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3250    ///
3251    /// let builder = prepare_request_builder();
3252    /// let response = builder.send().await?;
3253    /// # Ok(()) }
3254    ///
3255    /// fn prepare_request_builder() -> SetIamPolicy {
3256    ///   # panic!();
3257    ///   // ... details omitted ...
3258    /// }
3259    /// ```
3260    #[derive(Clone, Debug)]
3261    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3262
3263    impl SetIamPolicy {
3264        pub(crate) fn new(
3265            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3266        ) -> Self {
3267            Self(RequestBuilder::new(stub))
3268        }
3269
3270        /// Sets the full request, replacing any prior values.
3271        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3272            mut self,
3273            v: V,
3274        ) -> Self {
3275            self.0.request = v.into();
3276            self
3277        }
3278
3279        /// Sets all the options, replacing any prior values.
3280        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3281            self.0.options = v.into();
3282            self
3283        }
3284
3285        /// Sends the request.
3286        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3287            (*self.0.stub)
3288                .set_iam_policy(self.0.request, self.0.options)
3289                .await
3290                .map(crate::Response::into_body)
3291        }
3292
3293        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
3294        ///
3295        /// This is a **required** field for requests.
3296        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3297            self.0.request.resource = v.into();
3298            self
3299        }
3300
3301        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3302        ///
3303        /// This is a **required** field for requests.
3304        pub fn set_policy<T>(mut self, v: T) -> Self
3305        where
3306            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3307        {
3308            self.0.request.policy = std::option::Option::Some(v.into());
3309            self
3310        }
3311
3312        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3313        ///
3314        /// This is a **required** field for requests.
3315        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3316        where
3317            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3318        {
3319            self.0.request.policy = v.map(|x| x.into());
3320            self
3321        }
3322
3323        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3324        pub fn set_update_mask<T>(mut self, v: T) -> Self
3325        where
3326            T: std::convert::Into<wkt::FieldMask>,
3327        {
3328            self.0.request.update_mask = std::option::Option::Some(v.into());
3329            self
3330        }
3331
3332        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3333        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3334        where
3335            T: std::convert::Into<wkt::FieldMask>,
3336        {
3337            self.0.request.update_mask = v.map(|x| x.into());
3338            self
3339        }
3340    }
3341
3342    #[doc(hidden)]
3343    impl crate::RequestBuilder for SetIamPolicy {
3344        fn request_options(&mut self) -> &mut crate::RequestOptions {
3345            &mut self.0.options
3346        }
3347    }
3348
3349    /// The request builder for [OrganizationAddressGroupService::get_iam_policy][crate::client::OrganizationAddressGroupService::get_iam_policy] calls.
3350    ///
3351    /// # Example
3352    /// ```
3353    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetIamPolicy;
3354    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3355    ///
3356    /// let builder = prepare_request_builder();
3357    /// let response = builder.send().await?;
3358    /// # Ok(()) }
3359    ///
3360    /// fn prepare_request_builder() -> GetIamPolicy {
3361    ///   # panic!();
3362    ///   // ... details omitted ...
3363    /// }
3364    /// ```
3365    #[derive(Clone, Debug)]
3366    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3367
3368    impl GetIamPolicy {
3369        pub(crate) fn new(
3370            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3371        ) -> Self {
3372            Self(RequestBuilder::new(stub))
3373        }
3374
3375        /// Sets the full request, replacing any prior values.
3376        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3377            mut self,
3378            v: V,
3379        ) -> Self {
3380            self.0.request = v.into();
3381            self
3382        }
3383
3384        /// Sets all the options, replacing any prior values.
3385        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3386            self.0.options = v.into();
3387            self
3388        }
3389
3390        /// Sends the request.
3391        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3392            (*self.0.stub)
3393                .get_iam_policy(self.0.request, self.0.options)
3394                .await
3395                .map(crate::Response::into_body)
3396        }
3397
3398        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
3399        ///
3400        /// This is a **required** field for requests.
3401        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3402            self.0.request.resource = v.into();
3403            self
3404        }
3405
3406        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3407        pub fn set_options<T>(mut self, v: T) -> Self
3408        where
3409            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3410        {
3411            self.0.request.options = std::option::Option::Some(v.into());
3412            self
3413        }
3414
3415        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3416        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3417        where
3418            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3419        {
3420            self.0.request.options = v.map(|x| x.into());
3421            self
3422        }
3423    }
3424
3425    #[doc(hidden)]
3426    impl crate::RequestBuilder for GetIamPolicy {
3427        fn request_options(&mut self) -> &mut crate::RequestOptions {
3428            &mut self.0.options
3429        }
3430    }
3431
3432    /// The request builder for [OrganizationAddressGroupService::test_iam_permissions][crate::client::OrganizationAddressGroupService::test_iam_permissions] calls.
3433    ///
3434    /// # Example
3435    /// ```
3436    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::TestIamPermissions;
3437    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3438    ///
3439    /// let builder = prepare_request_builder();
3440    /// let response = builder.send().await?;
3441    /// # Ok(()) }
3442    ///
3443    /// fn prepare_request_builder() -> TestIamPermissions {
3444    ///   # panic!();
3445    ///   // ... details omitted ...
3446    /// }
3447    /// ```
3448    #[derive(Clone, Debug)]
3449    pub struct TestIamPermissions(
3450        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3451    );
3452
3453    impl TestIamPermissions {
3454        pub(crate) fn new(
3455            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3456        ) -> Self {
3457            Self(RequestBuilder::new(stub))
3458        }
3459
3460        /// Sets the full request, replacing any prior values.
3461        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3462            mut self,
3463            v: V,
3464        ) -> Self {
3465            self.0.request = v.into();
3466            self
3467        }
3468
3469        /// Sets all the options, replacing any prior values.
3470        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3471            self.0.options = v.into();
3472            self
3473        }
3474
3475        /// Sends the request.
3476        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3477            (*self.0.stub)
3478                .test_iam_permissions(self.0.request, self.0.options)
3479                .await
3480                .map(crate::Response::into_body)
3481        }
3482
3483        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
3484        ///
3485        /// This is a **required** field for requests.
3486        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3487            self.0.request.resource = v.into();
3488            self
3489        }
3490
3491        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
3492        ///
3493        /// This is a **required** field for requests.
3494        pub fn set_permissions<T, V>(mut self, v: T) -> Self
3495        where
3496            T: std::iter::IntoIterator<Item = V>,
3497            V: std::convert::Into<std::string::String>,
3498        {
3499            use std::iter::Iterator;
3500            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3501            self
3502        }
3503    }
3504
3505    #[doc(hidden)]
3506    impl crate::RequestBuilder for TestIamPermissions {
3507        fn request_options(&mut self) -> &mut crate::RequestOptions {
3508            &mut self.0.options
3509        }
3510    }
3511
3512    /// The request builder for [OrganizationAddressGroupService::list_operations][crate::client::OrganizationAddressGroupService::list_operations] calls.
3513    ///
3514    /// # Example
3515    /// ```
3516    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListOperations;
3517    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3518    /// use google_cloud_gax::paginator::ItemPaginator;
3519    ///
3520    /// let builder = prepare_request_builder();
3521    /// let mut items = builder.by_item();
3522    /// while let Some(result) = items.next().await {
3523    ///   let item = result?;
3524    /// }
3525    /// # Ok(()) }
3526    ///
3527    /// fn prepare_request_builder() -> ListOperations {
3528    ///   # panic!();
3529    ///   // ... details omitted ...
3530    /// }
3531    /// ```
3532    #[derive(Clone, Debug)]
3533    pub struct ListOperations(
3534        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3535    );
3536
3537    impl ListOperations {
3538        pub(crate) fn new(
3539            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3540        ) -> Self {
3541            Self(RequestBuilder::new(stub))
3542        }
3543
3544        /// Sets the full request, replacing any prior values.
3545        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3546            mut self,
3547            v: V,
3548        ) -> Self {
3549            self.0.request = v.into();
3550            self
3551        }
3552
3553        /// Sets all the options, replacing any prior values.
3554        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3555            self.0.options = v.into();
3556            self
3557        }
3558
3559        /// Sends the request.
3560        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3561            (*self.0.stub)
3562                .list_operations(self.0.request, self.0.options)
3563                .await
3564                .map(crate::Response::into_body)
3565        }
3566
3567        /// Streams each page in the collection.
3568        pub fn by_page(
3569            self,
3570        ) -> impl google_cloud_gax::paginator::Paginator<
3571            google_cloud_longrunning::model::ListOperationsResponse,
3572            crate::Error,
3573        > {
3574            use std::clone::Clone;
3575            let token = self.0.request.page_token.clone();
3576            let execute = move |token: String| {
3577                let mut builder = self.clone();
3578                builder.0.request = builder.0.request.set_page_token(token);
3579                builder.send()
3580            };
3581            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3582        }
3583
3584        /// Streams each item in the collection.
3585        pub fn by_item(
3586            self,
3587        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3588            google_cloud_longrunning::model::ListOperationsResponse,
3589            crate::Error,
3590        > {
3591            use google_cloud_gax::paginator::Paginator;
3592            self.by_page().items()
3593        }
3594
3595        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3596        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3597            self.0.request.name = v.into();
3598            self
3599        }
3600
3601        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3602        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3603            self.0.request.filter = v.into();
3604            self
3605        }
3606
3607        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3608        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3609            self.0.request.page_size = v.into();
3610            self
3611        }
3612
3613        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3614        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3615            self.0.request.page_token = v.into();
3616            self
3617        }
3618
3619        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3620        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3621            self.0.request.return_partial_success = v.into();
3622            self
3623        }
3624    }
3625
3626    #[doc(hidden)]
3627    impl crate::RequestBuilder for ListOperations {
3628        fn request_options(&mut self) -> &mut crate::RequestOptions {
3629            &mut self.0.options
3630        }
3631    }
3632
3633    /// The request builder for [OrganizationAddressGroupService::get_operation][crate::client::OrganizationAddressGroupService::get_operation] calls.
3634    ///
3635    /// # Example
3636    /// ```
3637    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetOperation;
3638    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3639    ///
3640    /// let builder = prepare_request_builder();
3641    /// let response = builder.send().await?;
3642    /// # Ok(()) }
3643    ///
3644    /// fn prepare_request_builder() -> GetOperation {
3645    ///   # panic!();
3646    ///   // ... details omitted ...
3647    /// }
3648    /// ```
3649    #[derive(Clone, Debug)]
3650    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3651
3652    impl GetOperation {
3653        pub(crate) fn new(
3654            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3655        ) -> Self {
3656            Self(RequestBuilder::new(stub))
3657        }
3658
3659        /// Sets the full request, replacing any prior values.
3660        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3661            mut self,
3662            v: V,
3663        ) -> Self {
3664            self.0.request = v.into();
3665            self
3666        }
3667
3668        /// Sets all the options, replacing any prior values.
3669        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3670            self.0.options = v.into();
3671            self
3672        }
3673
3674        /// Sends the request.
3675        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3676            (*self.0.stub)
3677                .get_operation(self.0.request, self.0.options)
3678                .await
3679                .map(crate::Response::into_body)
3680        }
3681
3682        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3683        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3684            self.0.request.name = v.into();
3685            self
3686        }
3687    }
3688
3689    #[doc(hidden)]
3690    impl crate::RequestBuilder for GetOperation {
3691        fn request_options(&mut self) -> &mut crate::RequestOptions {
3692            &mut self.0.options
3693        }
3694    }
3695
3696    /// The request builder for [OrganizationAddressGroupService::delete_operation][crate::client::OrganizationAddressGroupService::delete_operation] calls.
3697    ///
3698    /// # Example
3699    /// ```
3700    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::DeleteOperation;
3701    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3702    ///
3703    /// let builder = prepare_request_builder();
3704    /// let response = builder.send().await?;
3705    /// # Ok(()) }
3706    ///
3707    /// fn prepare_request_builder() -> DeleteOperation {
3708    ///   # panic!();
3709    ///   // ... details omitted ...
3710    /// }
3711    /// ```
3712    #[derive(Clone, Debug)]
3713    pub struct DeleteOperation(
3714        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3715    );
3716
3717    impl DeleteOperation {
3718        pub(crate) fn new(
3719            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3720        ) -> Self {
3721            Self(RequestBuilder::new(stub))
3722        }
3723
3724        /// Sets the full request, replacing any prior values.
3725        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3726            mut self,
3727            v: V,
3728        ) -> Self {
3729            self.0.request = v.into();
3730            self
3731        }
3732
3733        /// Sets all the options, replacing any prior values.
3734        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3735            self.0.options = v.into();
3736            self
3737        }
3738
3739        /// Sends the request.
3740        pub async fn send(self) -> Result<()> {
3741            (*self.0.stub)
3742                .delete_operation(self.0.request, self.0.options)
3743                .await
3744                .map(crate::Response::into_body)
3745        }
3746
3747        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3748        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3749            self.0.request.name = v.into();
3750            self
3751        }
3752    }
3753
3754    #[doc(hidden)]
3755    impl crate::RequestBuilder for DeleteOperation {
3756        fn request_options(&mut self) -> &mut crate::RequestOptions {
3757            &mut self.0.options
3758        }
3759    }
3760
3761    /// The request builder for [OrganizationAddressGroupService::cancel_operation][crate::client::OrganizationAddressGroupService::cancel_operation] calls.
3762    ///
3763    /// # Example
3764    /// ```
3765    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::CancelOperation;
3766    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3767    ///
3768    /// let builder = prepare_request_builder();
3769    /// let response = builder.send().await?;
3770    /// # Ok(()) }
3771    ///
3772    /// fn prepare_request_builder() -> CancelOperation {
3773    ///   # panic!();
3774    ///   // ... details omitted ...
3775    /// }
3776    /// ```
3777    #[derive(Clone, Debug)]
3778    pub struct CancelOperation(
3779        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3780    );
3781
3782    impl CancelOperation {
3783        pub(crate) fn new(
3784            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3785        ) -> Self {
3786            Self(RequestBuilder::new(stub))
3787        }
3788
3789        /// Sets the full request, replacing any prior values.
3790        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3791            mut self,
3792            v: V,
3793        ) -> Self {
3794            self.0.request = v.into();
3795            self
3796        }
3797
3798        /// Sets all the options, replacing any prior values.
3799        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3800            self.0.options = v.into();
3801            self
3802        }
3803
3804        /// Sends the request.
3805        pub async fn send(self) -> Result<()> {
3806            (*self.0.stub)
3807                .cancel_operation(self.0.request, self.0.options)
3808                .await
3809                .map(crate::Response::into_body)
3810        }
3811
3812        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3813        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3814            self.0.request.name = v.into();
3815            self
3816        }
3817    }
3818
3819    #[doc(hidden)]
3820    impl crate::RequestBuilder for CancelOperation {
3821        fn request_options(&mut self) -> &mut crate::RequestOptions {
3822            &mut self.0.options
3823        }
3824    }
3825}
3826
3827/// Request and client builders for [DnsThreatDetectorService][crate::client::DnsThreatDetectorService].
3828pub mod dns_threat_detector_service {
3829    use crate::Result;
3830
3831    /// A builder for [DnsThreatDetectorService][crate::client::DnsThreatDetectorService].
3832    ///
3833    /// ```
3834    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3835    /// # use google_cloud_networksecurity_v1::*;
3836    /// # use builder::dns_threat_detector_service::ClientBuilder;
3837    /// # use client::DnsThreatDetectorService;
3838    /// let builder : ClientBuilder = DnsThreatDetectorService::builder();
3839    /// let client = builder
3840    ///     .with_endpoint("https://networksecurity.googleapis.com")
3841    ///     .build().await?;
3842    /// # Ok(()) }
3843    /// ```
3844    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3845
3846    pub(crate) mod client {
3847        use super::super::super::client::DnsThreatDetectorService;
3848        pub struct Factory;
3849        impl crate::ClientFactory for Factory {
3850            type Client = DnsThreatDetectorService;
3851            type Credentials = gaxi::options::Credentials;
3852            async fn build(
3853                self,
3854                config: gaxi::options::ClientConfig,
3855            ) -> crate::ClientBuilderResult<Self::Client> {
3856                Self::Client::new(config).await
3857            }
3858        }
3859    }
3860
3861    /// Common implementation for [crate::client::DnsThreatDetectorService] request builders.
3862    #[derive(Clone, Debug)]
3863    pub(crate) struct RequestBuilder<R: std::default::Default> {
3864        stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3865        request: R,
3866        options: crate::RequestOptions,
3867    }
3868
3869    impl<R> RequestBuilder<R>
3870    where
3871        R: std::default::Default,
3872    {
3873        pub(crate) fn new(
3874            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3875        ) -> Self {
3876            Self {
3877                stub,
3878                request: R::default(),
3879                options: crate::RequestOptions::default(),
3880            }
3881        }
3882    }
3883
3884    /// The request builder for [DnsThreatDetectorService::list_dns_threat_detectors][crate::client::DnsThreatDetectorService::list_dns_threat_detectors] calls.
3885    ///
3886    /// # Example
3887    /// ```
3888    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::ListDnsThreatDetectors;
3889    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3890    /// use google_cloud_gax::paginator::ItemPaginator;
3891    ///
3892    /// let builder = prepare_request_builder();
3893    /// let mut items = builder.by_item();
3894    /// while let Some(result) = items.next().await {
3895    ///   let item = result?;
3896    /// }
3897    /// # Ok(()) }
3898    ///
3899    /// fn prepare_request_builder() -> ListDnsThreatDetectors {
3900    ///   # panic!();
3901    ///   // ... details omitted ...
3902    /// }
3903    /// ```
3904    #[derive(Clone, Debug)]
3905    pub struct ListDnsThreatDetectors(RequestBuilder<crate::model::ListDnsThreatDetectorsRequest>);
3906
3907    impl ListDnsThreatDetectors {
3908        pub(crate) fn new(
3909            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3910        ) -> Self {
3911            Self(RequestBuilder::new(stub))
3912        }
3913
3914        /// Sets the full request, replacing any prior values.
3915        pub fn with_request<V: Into<crate::model::ListDnsThreatDetectorsRequest>>(
3916            mut self,
3917            v: V,
3918        ) -> Self {
3919            self.0.request = v.into();
3920            self
3921        }
3922
3923        /// Sets all the options, replacing any prior values.
3924        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3925            self.0.options = v.into();
3926            self
3927        }
3928
3929        /// Sends the request.
3930        pub async fn send(self) -> Result<crate::model::ListDnsThreatDetectorsResponse> {
3931            (*self.0.stub)
3932                .list_dns_threat_detectors(self.0.request, self.0.options)
3933                .await
3934                .map(crate::Response::into_body)
3935        }
3936
3937        /// Streams each page in the collection.
3938        pub fn by_page(
3939            self,
3940        ) -> impl google_cloud_gax::paginator::Paginator<
3941            crate::model::ListDnsThreatDetectorsResponse,
3942            crate::Error,
3943        > {
3944            use std::clone::Clone;
3945            let token = self.0.request.page_token.clone();
3946            let execute = move |token: String| {
3947                let mut builder = self.clone();
3948                builder.0.request = builder.0.request.set_page_token(token);
3949                builder.send()
3950            };
3951            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3952        }
3953
3954        /// Streams each item in the collection.
3955        pub fn by_item(
3956            self,
3957        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3958            crate::model::ListDnsThreatDetectorsResponse,
3959            crate::Error,
3960        > {
3961            use google_cloud_gax::paginator::Paginator;
3962            self.by_page().items()
3963        }
3964
3965        /// Sets the value of [parent][crate::model::ListDnsThreatDetectorsRequest::parent].
3966        ///
3967        /// This is a **required** field for requests.
3968        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3969            self.0.request.parent = v.into();
3970            self
3971        }
3972
3973        /// Sets the value of [page_size][crate::model::ListDnsThreatDetectorsRequest::page_size].
3974        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3975            self.0.request.page_size = v.into();
3976            self
3977        }
3978
3979        /// Sets the value of [page_token][crate::model::ListDnsThreatDetectorsRequest::page_token].
3980        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3981            self.0.request.page_token = v.into();
3982            self
3983        }
3984    }
3985
3986    #[doc(hidden)]
3987    impl crate::RequestBuilder for ListDnsThreatDetectors {
3988        fn request_options(&mut self) -> &mut crate::RequestOptions {
3989            &mut self.0.options
3990        }
3991    }
3992
3993    /// The request builder for [DnsThreatDetectorService::get_dns_threat_detector][crate::client::DnsThreatDetectorService::get_dns_threat_detector] calls.
3994    ///
3995    /// # Example
3996    /// ```
3997    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetDnsThreatDetector;
3998    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3999    ///
4000    /// let builder = prepare_request_builder();
4001    /// let response = builder.send().await?;
4002    /// # Ok(()) }
4003    ///
4004    /// fn prepare_request_builder() -> GetDnsThreatDetector {
4005    ///   # panic!();
4006    ///   // ... details omitted ...
4007    /// }
4008    /// ```
4009    #[derive(Clone, Debug)]
4010    pub struct GetDnsThreatDetector(RequestBuilder<crate::model::GetDnsThreatDetectorRequest>);
4011
4012    impl GetDnsThreatDetector {
4013        pub(crate) fn new(
4014            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4015        ) -> Self {
4016            Self(RequestBuilder::new(stub))
4017        }
4018
4019        /// Sets the full request, replacing any prior values.
4020        pub fn with_request<V: Into<crate::model::GetDnsThreatDetectorRequest>>(
4021            mut self,
4022            v: V,
4023        ) -> Self {
4024            self.0.request = v.into();
4025            self
4026        }
4027
4028        /// Sets all the options, replacing any prior values.
4029        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4030            self.0.options = v.into();
4031            self
4032        }
4033
4034        /// Sends the request.
4035        pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4036            (*self.0.stub)
4037                .get_dns_threat_detector(self.0.request, self.0.options)
4038                .await
4039                .map(crate::Response::into_body)
4040        }
4041
4042        /// Sets the value of [name][crate::model::GetDnsThreatDetectorRequest::name].
4043        ///
4044        /// This is a **required** field for requests.
4045        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4046            self.0.request.name = v.into();
4047            self
4048        }
4049    }
4050
4051    #[doc(hidden)]
4052    impl crate::RequestBuilder for GetDnsThreatDetector {
4053        fn request_options(&mut self) -> &mut crate::RequestOptions {
4054            &mut self.0.options
4055        }
4056    }
4057
4058    /// The request builder for [DnsThreatDetectorService::create_dns_threat_detector][crate::client::DnsThreatDetectorService::create_dns_threat_detector] calls.
4059    ///
4060    /// # Example
4061    /// ```
4062    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::CreateDnsThreatDetector;
4063    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4064    ///
4065    /// let builder = prepare_request_builder();
4066    /// let response = builder.send().await?;
4067    /// # Ok(()) }
4068    ///
4069    /// fn prepare_request_builder() -> CreateDnsThreatDetector {
4070    ///   # panic!();
4071    ///   // ... details omitted ...
4072    /// }
4073    /// ```
4074    #[derive(Clone, Debug)]
4075    pub struct CreateDnsThreatDetector(
4076        RequestBuilder<crate::model::CreateDnsThreatDetectorRequest>,
4077    );
4078
4079    impl CreateDnsThreatDetector {
4080        pub(crate) fn new(
4081            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4082        ) -> Self {
4083            Self(RequestBuilder::new(stub))
4084        }
4085
4086        /// Sets the full request, replacing any prior values.
4087        pub fn with_request<V: Into<crate::model::CreateDnsThreatDetectorRequest>>(
4088            mut self,
4089            v: V,
4090        ) -> Self {
4091            self.0.request = v.into();
4092            self
4093        }
4094
4095        /// Sets all the options, replacing any prior values.
4096        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4097            self.0.options = v.into();
4098            self
4099        }
4100
4101        /// Sends the request.
4102        pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4103            (*self.0.stub)
4104                .create_dns_threat_detector(self.0.request, self.0.options)
4105                .await
4106                .map(crate::Response::into_body)
4107        }
4108
4109        /// Sets the value of [parent][crate::model::CreateDnsThreatDetectorRequest::parent].
4110        ///
4111        /// This is a **required** field for requests.
4112        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4113            self.0.request.parent = v.into();
4114            self
4115        }
4116
4117        /// Sets the value of [dns_threat_detector_id][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector_id].
4118        pub fn set_dns_threat_detector_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4119            self.0.request.dns_threat_detector_id = v.into();
4120            self
4121        }
4122
4123        /// Sets the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
4124        ///
4125        /// This is a **required** field for requests.
4126        pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4127        where
4128            T: std::convert::Into<crate::model::DnsThreatDetector>,
4129        {
4130            self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4131            self
4132        }
4133
4134        /// Sets or clears the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
4135        ///
4136        /// This is a **required** field for requests.
4137        pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4138        where
4139            T: std::convert::Into<crate::model::DnsThreatDetector>,
4140        {
4141            self.0.request.dns_threat_detector = v.map(|x| x.into());
4142            self
4143        }
4144    }
4145
4146    #[doc(hidden)]
4147    impl crate::RequestBuilder for CreateDnsThreatDetector {
4148        fn request_options(&mut self) -> &mut crate::RequestOptions {
4149            &mut self.0.options
4150        }
4151    }
4152
4153    /// The request builder for [DnsThreatDetectorService::update_dns_threat_detector][crate::client::DnsThreatDetectorService::update_dns_threat_detector] calls.
4154    ///
4155    /// # Example
4156    /// ```
4157    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::UpdateDnsThreatDetector;
4158    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4159    ///
4160    /// let builder = prepare_request_builder();
4161    /// let response = builder.send().await?;
4162    /// # Ok(()) }
4163    ///
4164    /// fn prepare_request_builder() -> UpdateDnsThreatDetector {
4165    ///   # panic!();
4166    ///   // ... details omitted ...
4167    /// }
4168    /// ```
4169    #[derive(Clone, Debug)]
4170    pub struct UpdateDnsThreatDetector(
4171        RequestBuilder<crate::model::UpdateDnsThreatDetectorRequest>,
4172    );
4173
4174    impl UpdateDnsThreatDetector {
4175        pub(crate) fn new(
4176            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4177        ) -> Self {
4178            Self(RequestBuilder::new(stub))
4179        }
4180
4181        /// Sets the full request, replacing any prior values.
4182        pub fn with_request<V: Into<crate::model::UpdateDnsThreatDetectorRequest>>(
4183            mut self,
4184            v: V,
4185        ) -> Self {
4186            self.0.request = v.into();
4187            self
4188        }
4189
4190        /// Sets all the options, replacing any prior values.
4191        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4192            self.0.options = v.into();
4193            self
4194        }
4195
4196        /// Sends the request.
4197        pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4198            (*self.0.stub)
4199                .update_dns_threat_detector(self.0.request, self.0.options)
4200                .await
4201                .map(crate::Response::into_body)
4202        }
4203
4204        /// Sets the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
4205        pub fn set_update_mask<T>(mut self, v: T) -> Self
4206        where
4207            T: std::convert::Into<wkt::FieldMask>,
4208        {
4209            self.0.request.update_mask = std::option::Option::Some(v.into());
4210            self
4211        }
4212
4213        /// Sets or clears the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
4214        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4215        where
4216            T: std::convert::Into<wkt::FieldMask>,
4217        {
4218            self.0.request.update_mask = v.map(|x| x.into());
4219            self
4220        }
4221
4222        /// Sets the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
4223        ///
4224        /// This is a **required** field for requests.
4225        pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4226        where
4227            T: std::convert::Into<crate::model::DnsThreatDetector>,
4228        {
4229            self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4230            self
4231        }
4232
4233        /// Sets or clears the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
4234        ///
4235        /// This is a **required** field for requests.
4236        pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4237        where
4238            T: std::convert::Into<crate::model::DnsThreatDetector>,
4239        {
4240            self.0.request.dns_threat_detector = v.map(|x| x.into());
4241            self
4242        }
4243    }
4244
4245    #[doc(hidden)]
4246    impl crate::RequestBuilder for UpdateDnsThreatDetector {
4247        fn request_options(&mut self) -> &mut crate::RequestOptions {
4248            &mut self.0.options
4249        }
4250    }
4251
4252    /// The request builder for [DnsThreatDetectorService::delete_dns_threat_detector][crate::client::DnsThreatDetectorService::delete_dns_threat_detector] calls.
4253    ///
4254    /// # Example
4255    /// ```
4256    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::DeleteDnsThreatDetector;
4257    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4258    ///
4259    /// let builder = prepare_request_builder();
4260    /// let response = builder.send().await?;
4261    /// # Ok(()) }
4262    ///
4263    /// fn prepare_request_builder() -> DeleteDnsThreatDetector {
4264    ///   # panic!();
4265    ///   // ... details omitted ...
4266    /// }
4267    /// ```
4268    #[derive(Clone, Debug)]
4269    pub struct DeleteDnsThreatDetector(
4270        RequestBuilder<crate::model::DeleteDnsThreatDetectorRequest>,
4271    );
4272
4273    impl DeleteDnsThreatDetector {
4274        pub(crate) fn new(
4275            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4276        ) -> Self {
4277            Self(RequestBuilder::new(stub))
4278        }
4279
4280        /// Sets the full request, replacing any prior values.
4281        pub fn with_request<V: Into<crate::model::DeleteDnsThreatDetectorRequest>>(
4282            mut self,
4283            v: V,
4284        ) -> Self {
4285            self.0.request = v.into();
4286            self
4287        }
4288
4289        /// Sets all the options, replacing any prior values.
4290        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4291            self.0.options = v.into();
4292            self
4293        }
4294
4295        /// Sends the request.
4296        pub async fn send(self) -> Result<()> {
4297            (*self.0.stub)
4298                .delete_dns_threat_detector(self.0.request, self.0.options)
4299                .await
4300                .map(crate::Response::into_body)
4301        }
4302
4303        /// Sets the value of [name][crate::model::DeleteDnsThreatDetectorRequest::name].
4304        ///
4305        /// This is a **required** field for requests.
4306        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4307            self.0.request.name = v.into();
4308            self
4309        }
4310    }
4311
4312    #[doc(hidden)]
4313    impl crate::RequestBuilder for DeleteDnsThreatDetector {
4314        fn request_options(&mut self) -> &mut crate::RequestOptions {
4315            &mut self.0.options
4316        }
4317    }
4318
4319    /// The request builder for [DnsThreatDetectorService::list_locations][crate::client::DnsThreatDetectorService::list_locations] calls.
4320    ///
4321    /// # Example
4322    /// ```
4323    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::ListLocations;
4324    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4325    /// use google_cloud_gax::paginator::ItemPaginator;
4326    ///
4327    /// let builder = prepare_request_builder();
4328    /// let mut items = builder.by_item();
4329    /// while let Some(result) = items.next().await {
4330    ///   let item = result?;
4331    /// }
4332    /// # Ok(()) }
4333    ///
4334    /// fn prepare_request_builder() -> ListLocations {
4335    ///   # panic!();
4336    ///   // ... details omitted ...
4337    /// }
4338    /// ```
4339    #[derive(Clone, Debug)]
4340    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4341
4342    impl ListLocations {
4343        pub(crate) fn new(
4344            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4345        ) -> Self {
4346            Self(RequestBuilder::new(stub))
4347        }
4348
4349        /// Sets the full request, replacing any prior values.
4350        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4351            mut self,
4352            v: V,
4353        ) -> Self {
4354            self.0.request = v.into();
4355            self
4356        }
4357
4358        /// Sets all the options, replacing any prior values.
4359        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4360            self.0.options = v.into();
4361            self
4362        }
4363
4364        /// Sends the request.
4365        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4366            (*self.0.stub)
4367                .list_locations(self.0.request, self.0.options)
4368                .await
4369                .map(crate::Response::into_body)
4370        }
4371
4372        /// Streams each page in the collection.
4373        pub fn by_page(
4374            self,
4375        ) -> impl google_cloud_gax::paginator::Paginator<
4376            google_cloud_location::model::ListLocationsResponse,
4377            crate::Error,
4378        > {
4379            use std::clone::Clone;
4380            let token = self.0.request.page_token.clone();
4381            let execute = move |token: String| {
4382                let mut builder = self.clone();
4383                builder.0.request = builder.0.request.set_page_token(token);
4384                builder.send()
4385            };
4386            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4387        }
4388
4389        /// Streams each item in the collection.
4390        pub fn by_item(
4391            self,
4392        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4393            google_cloud_location::model::ListLocationsResponse,
4394            crate::Error,
4395        > {
4396            use google_cloud_gax::paginator::Paginator;
4397            self.by_page().items()
4398        }
4399
4400        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
4401        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4402            self.0.request.name = v.into();
4403            self
4404        }
4405
4406        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
4407        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4408            self.0.request.filter = v.into();
4409            self
4410        }
4411
4412        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
4413        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4414            self.0.request.page_size = v.into();
4415            self
4416        }
4417
4418        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
4419        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4420            self.0.request.page_token = v.into();
4421            self
4422        }
4423    }
4424
4425    #[doc(hidden)]
4426    impl crate::RequestBuilder for ListLocations {
4427        fn request_options(&mut self) -> &mut crate::RequestOptions {
4428            &mut self.0.options
4429        }
4430    }
4431
4432    /// The request builder for [DnsThreatDetectorService::get_location][crate::client::DnsThreatDetectorService::get_location] calls.
4433    ///
4434    /// # Example
4435    /// ```
4436    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetLocation;
4437    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4438    ///
4439    /// let builder = prepare_request_builder();
4440    /// let response = builder.send().await?;
4441    /// # Ok(()) }
4442    ///
4443    /// fn prepare_request_builder() -> GetLocation {
4444    ///   # panic!();
4445    ///   // ... details omitted ...
4446    /// }
4447    /// ```
4448    #[derive(Clone, Debug)]
4449    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4450
4451    impl GetLocation {
4452        pub(crate) fn new(
4453            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4454        ) -> Self {
4455            Self(RequestBuilder::new(stub))
4456        }
4457
4458        /// Sets the full request, replacing any prior values.
4459        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4460            mut self,
4461            v: V,
4462        ) -> Self {
4463            self.0.request = v.into();
4464            self
4465        }
4466
4467        /// Sets all the options, replacing any prior values.
4468        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4469            self.0.options = v.into();
4470            self
4471        }
4472
4473        /// Sends the request.
4474        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4475            (*self.0.stub)
4476                .get_location(self.0.request, self.0.options)
4477                .await
4478                .map(crate::Response::into_body)
4479        }
4480
4481        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
4482        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4483            self.0.request.name = v.into();
4484            self
4485        }
4486    }
4487
4488    #[doc(hidden)]
4489    impl crate::RequestBuilder for GetLocation {
4490        fn request_options(&mut self) -> &mut crate::RequestOptions {
4491            &mut self.0.options
4492        }
4493    }
4494
4495    /// The request builder for [DnsThreatDetectorService::set_iam_policy][crate::client::DnsThreatDetectorService::set_iam_policy] calls.
4496    ///
4497    /// # Example
4498    /// ```
4499    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::SetIamPolicy;
4500    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4501    ///
4502    /// let builder = prepare_request_builder();
4503    /// let response = builder.send().await?;
4504    /// # Ok(()) }
4505    ///
4506    /// fn prepare_request_builder() -> SetIamPolicy {
4507    ///   # panic!();
4508    ///   // ... details omitted ...
4509    /// }
4510    /// ```
4511    #[derive(Clone, Debug)]
4512    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4513
4514    impl SetIamPolicy {
4515        pub(crate) fn new(
4516            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4517        ) -> Self {
4518            Self(RequestBuilder::new(stub))
4519        }
4520
4521        /// Sets the full request, replacing any prior values.
4522        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4523            mut self,
4524            v: V,
4525        ) -> Self {
4526            self.0.request = v.into();
4527            self
4528        }
4529
4530        /// Sets all the options, replacing any prior values.
4531        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4532            self.0.options = v.into();
4533            self
4534        }
4535
4536        /// Sends the request.
4537        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4538            (*self.0.stub)
4539                .set_iam_policy(self.0.request, self.0.options)
4540                .await
4541                .map(crate::Response::into_body)
4542        }
4543
4544        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
4545        ///
4546        /// This is a **required** field for requests.
4547        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4548            self.0.request.resource = v.into();
4549            self
4550        }
4551
4552        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4553        ///
4554        /// This is a **required** field for requests.
4555        pub fn set_policy<T>(mut self, v: T) -> Self
4556        where
4557            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4558        {
4559            self.0.request.policy = std::option::Option::Some(v.into());
4560            self
4561        }
4562
4563        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4564        ///
4565        /// This is a **required** field for requests.
4566        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4567        where
4568            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4569        {
4570            self.0.request.policy = v.map(|x| x.into());
4571            self
4572        }
4573
4574        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4575        pub fn set_update_mask<T>(mut self, v: T) -> Self
4576        where
4577            T: std::convert::Into<wkt::FieldMask>,
4578        {
4579            self.0.request.update_mask = std::option::Option::Some(v.into());
4580            self
4581        }
4582
4583        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4584        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4585        where
4586            T: std::convert::Into<wkt::FieldMask>,
4587        {
4588            self.0.request.update_mask = v.map(|x| x.into());
4589            self
4590        }
4591    }
4592
4593    #[doc(hidden)]
4594    impl crate::RequestBuilder for SetIamPolicy {
4595        fn request_options(&mut self) -> &mut crate::RequestOptions {
4596            &mut self.0.options
4597        }
4598    }
4599
4600    /// The request builder for [DnsThreatDetectorService::get_iam_policy][crate::client::DnsThreatDetectorService::get_iam_policy] calls.
4601    ///
4602    /// # Example
4603    /// ```
4604    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetIamPolicy;
4605    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4606    ///
4607    /// let builder = prepare_request_builder();
4608    /// let response = builder.send().await?;
4609    /// # Ok(()) }
4610    ///
4611    /// fn prepare_request_builder() -> GetIamPolicy {
4612    ///   # panic!();
4613    ///   // ... details omitted ...
4614    /// }
4615    /// ```
4616    #[derive(Clone, Debug)]
4617    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4618
4619    impl GetIamPolicy {
4620        pub(crate) fn new(
4621            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4622        ) -> Self {
4623            Self(RequestBuilder::new(stub))
4624        }
4625
4626        /// Sets the full request, replacing any prior values.
4627        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4628            mut self,
4629            v: V,
4630        ) -> Self {
4631            self.0.request = v.into();
4632            self
4633        }
4634
4635        /// Sets all the options, replacing any prior values.
4636        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4637            self.0.options = v.into();
4638            self
4639        }
4640
4641        /// Sends the request.
4642        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4643            (*self.0.stub)
4644                .get_iam_policy(self.0.request, self.0.options)
4645                .await
4646                .map(crate::Response::into_body)
4647        }
4648
4649        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
4650        ///
4651        /// This is a **required** field for requests.
4652        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4653            self.0.request.resource = v.into();
4654            self
4655        }
4656
4657        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4658        pub fn set_options<T>(mut self, v: T) -> Self
4659        where
4660            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4661        {
4662            self.0.request.options = std::option::Option::Some(v.into());
4663            self
4664        }
4665
4666        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4667        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4668        where
4669            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4670        {
4671            self.0.request.options = v.map(|x| x.into());
4672            self
4673        }
4674    }
4675
4676    #[doc(hidden)]
4677    impl crate::RequestBuilder for GetIamPolicy {
4678        fn request_options(&mut self) -> &mut crate::RequestOptions {
4679            &mut self.0.options
4680        }
4681    }
4682
4683    /// The request builder for [DnsThreatDetectorService::test_iam_permissions][crate::client::DnsThreatDetectorService::test_iam_permissions] calls.
4684    ///
4685    /// # Example
4686    /// ```
4687    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::TestIamPermissions;
4688    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4689    ///
4690    /// let builder = prepare_request_builder();
4691    /// let response = builder.send().await?;
4692    /// # Ok(()) }
4693    ///
4694    /// fn prepare_request_builder() -> TestIamPermissions {
4695    ///   # panic!();
4696    ///   // ... details omitted ...
4697    /// }
4698    /// ```
4699    #[derive(Clone, Debug)]
4700    pub struct TestIamPermissions(
4701        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4702    );
4703
4704    impl TestIamPermissions {
4705        pub(crate) fn new(
4706            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4707        ) -> Self {
4708            Self(RequestBuilder::new(stub))
4709        }
4710
4711        /// Sets the full request, replacing any prior values.
4712        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4713            mut self,
4714            v: V,
4715        ) -> Self {
4716            self.0.request = v.into();
4717            self
4718        }
4719
4720        /// Sets all the options, replacing any prior values.
4721        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4722            self.0.options = v.into();
4723            self
4724        }
4725
4726        /// Sends the request.
4727        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4728            (*self.0.stub)
4729                .test_iam_permissions(self.0.request, self.0.options)
4730                .await
4731                .map(crate::Response::into_body)
4732        }
4733
4734        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
4735        ///
4736        /// This is a **required** field for requests.
4737        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4738            self.0.request.resource = v.into();
4739            self
4740        }
4741
4742        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
4743        ///
4744        /// This is a **required** field for requests.
4745        pub fn set_permissions<T, V>(mut self, v: T) -> Self
4746        where
4747            T: std::iter::IntoIterator<Item = V>,
4748            V: std::convert::Into<std::string::String>,
4749        {
4750            use std::iter::Iterator;
4751            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4752            self
4753        }
4754    }
4755
4756    #[doc(hidden)]
4757    impl crate::RequestBuilder for TestIamPermissions {
4758        fn request_options(&mut self) -> &mut crate::RequestOptions {
4759            &mut self.0.options
4760        }
4761    }
4762
4763    /// The request builder for [DnsThreatDetectorService::list_operations][crate::client::DnsThreatDetectorService::list_operations] calls.
4764    ///
4765    /// # Example
4766    /// ```
4767    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::ListOperations;
4768    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4769    /// use google_cloud_gax::paginator::ItemPaginator;
4770    ///
4771    /// let builder = prepare_request_builder();
4772    /// let mut items = builder.by_item();
4773    /// while let Some(result) = items.next().await {
4774    ///   let item = result?;
4775    /// }
4776    /// # Ok(()) }
4777    ///
4778    /// fn prepare_request_builder() -> ListOperations {
4779    ///   # panic!();
4780    ///   // ... details omitted ...
4781    /// }
4782    /// ```
4783    #[derive(Clone, Debug)]
4784    pub struct ListOperations(
4785        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4786    );
4787
4788    impl ListOperations {
4789        pub(crate) fn new(
4790            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4791        ) -> Self {
4792            Self(RequestBuilder::new(stub))
4793        }
4794
4795        /// Sets the full request, replacing any prior values.
4796        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4797            mut self,
4798            v: V,
4799        ) -> Self {
4800            self.0.request = v.into();
4801            self
4802        }
4803
4804        /// Sets all the options, replacing any prior values.
4805        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4806            self.0.options = v.into();
4807            self
4808        }
4809
4810        /// Sends the request.
4811        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4812            (*self.0.stub)
4813                .list_operations(self.0.request, self.0.options)
4814                .await
4815                .map(crate::Response::into_body)
4816        }
4817
4818        /// Streams each page in the collection.
4819        pub fn by_page(
4820            self,
4821        ) -> impl google_cloud_gax::paginator::Paginator<
4822            google_cloud_longrunning::model::ListOperationsResponse,
4823            crate::Error,
4824        > {
4825            use std::clone::Clone;
4826            let token = self.0.request.page_token.clone();
4827            let execute = move |token: String| {
4828                let mut builder = self.clone();
4829                builder.0.request = builder.0.request.set_page_token(token);
4830                builder.send()
4831            };
4832            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4833        }
4834
4835        /// Streams each item in the collection.
4836        pub fn by_item(
4837            self,
4838        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4839            google_cloud_longrunning::model::ListOperationsResponse,
4840            crate::Error,
4841        > {
4842            use google_cloud_gax::paginator::Paginator;
4843            self.by_page().items()
4844        }
4845
4846        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
4847        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4848            self.0.request.name = v.into();
4849            self
4850        }
4851
4852        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
4853        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4854            self.0.request.filter = v.into();
4855            self
4856        }
4857
4858        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
4859        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4860            self.0.request.page_size = v.into();
4861            self
4862        }
4863
4864        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
4865        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4866            self.0.request.page_token = v.into();
4867            self
4868        }
4869
4870        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
4871        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4872            self.0.request.return_partial_success = v.into();
4873            self
4874        }
4875    }
4876
4877    #[doc(hidden)]
4878    impl crate::RequestBuilder for ListOperations {
4879        fn request_options(&mut self) -> &mut crate::RequestOptions {
4880            &mut self.0.options
4881        }
4882    }
4883
4884    /// The request builder for [DnsThreatDetectorService::get_operation][crate::client::DnsThreatDetectorService::get_operation] calls.
4885    ///
4886    /// # Example
4887    /// ```
4888    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetOperation;
4889    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4890    ///
4891    /// let builder = prepare_request_builder();
4892    /// let response = builder.send().await?;
4893    /// # Ok(()) }
4894    ///
4895    /// fn prepare_request_builder() -> GetOperation {
4896    ///   # panic!();
4897    ///   // ... details omitted ...
4898    /// }
4899    /// ```
4900    #[derive(Clone, Debug)]
4901    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4902
4903    impl GetOperation {
4904        pub(crate) fn new(
4905            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4906        ) -> Self {
4907            Self(RequestBuilder::new(stub))
4908        }
4909
4910        /// Sets the full request, replacing any prior values.
4911        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4912            mut self,
4913            v: V,
4914        ) -> Self {
4915            self.0.request = v.into();
4916            self
4917        }
4918
4919        /// Sets all the options, replacing any prior values.
4920        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4921            self.0.options = v.into();
4922            self
4923        }
4924
4925        /// Sends the request.
4926        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4927            (*self.0.stub)
4928                .get_operation(self.0.request, self.0.options)
4929                .await
4930                .map(crate::Response::into_body)
4931        }
4932
4933        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4934        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4935            self.0.request.name = v.into();
4936            self
4937        }
4938    }
4939
4940    #[doc(hidden)]
4941    impl crate::RequestBuilder for GetOperation {
4942        fn request_options(&mut self) -> &mut crate::RequestOptions {
4943            &mut self.0.options
4944        }
4945    }
4946
4947    /// The request builder for [DnsThreatDetectorService::delete_operation][crate::client::DnsThreatDetectorService::delete_operation] calls.
4948    ///
4949    /// # Example
4950    /// ```
4951    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::DeleteOperation;
4952    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4953    ///
4954    /// let builder = prepare_request_builder();
4955    /// let response = builder.send().await?;
4956    /// # Ok(()) }
4957    ///
4958    /// fn prepare_request_builder() -> DeleteOperation {
4959    ///   # panic!();
4960    ///   // ... details omitted ...
4961    /// }
4962    /// ```
4963    #[derive(Clone, Debug)]
4964    pub struct DeleteOperation(
4965        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4966    );
4967
4968    impl DeleteOperation {
4969        pub(crate) fn new(
4970            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4971        ) -> Self {
4972            Self(RequestBuilder::new(stub))
4973        }
4974
4975        /// Sets the full request, replacing any prior values.
4976        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4977            mut self,
4978            v: V,
4979        ) -> Self {
4980            self.0.request = v.into();
4981            self
4982        }
4983
4984        /// Sets all the options, replacing any prior values.
4985        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4986            self.0.options = v.into();
4987            self
4988        }
4989
4990        /// Sends the request.
4991        pub async fn send(self) -> Result<()> {
4992            (*self.0.stub)
4993                .delete_operation(self.0.request, self.0.options)
4994                .await
4995                .map(crate::Response::into_body)
4996        }
4997
4998        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
4999        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5000            self.0.request.name = v.into();
5001            self
5002        }
5003    }
5004
5005    #[doc(hidden)]
5006    impl crate::RequestBuilder for DeleteOperation {
5007        fn request_options(&mut self) -> &mut crate::RequestOptions {
5008            &mut self.0.options
5009        }
5010    }
5011
5012    /// The request builder for [DnsThreatDetectorService::cancel_operation][crate::client::DnsThreatDetectorService::cancel_operation] calls.
5013    ///
5014    /// # Example
5015    /// ```
5016    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::CancelOperation;
5017    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5018    ///
5019    /// let builder = prepare_request_builder();
5020    /// let response = builder.send().await?;
5021    /// # Ok(()) }
5022    ///
5023    /// fn prepare_request_builder() -> CancelOperation {
5024    ///   # panic!();
5025    ///   // ... details omitted ...
5026    /// }
5027    /// ```
5028    #[derive(Clone, Debug)]
5029    pub struct CancelOperation(
5030        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5031    );
5032
5033    impl CancelOperation {
5034        pub(crate) fn new(
5035            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
5036        ) -> Self {
5037            Self(RequestBuilder::new(stub))
5038        }
5039
5040        /// Sets the full request, replacing any prior values.
5041        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5042            mut self,
5043            v: V,
5044        ) -> Self {
5045            self.0.request = v.into();
5046            self
5047        }
5048
5049        /// Sets all the options, replacing any prior values.
5050        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5051            self.0.options = v.into();
5052            self
5053        }
5054
5055        /// Sends the request.
5056        pub async fn send(self) -> Result<()> {
5057            (*self.0.stub)
5058                .cancel_operation(self.0.request, self.0.options)
5059                .await
5060                .map(crate::Response::into_body)
5061        }
5062
5063        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5064        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5065            self.0.request.name = v.into();
5066            self
5067        }
5068    }
5069
5070    #[doc(hidden)]
5071    impl crate::RequestBuilder for CancelOperation {
5072        fn request_options(&mut self) -> &mut crate::RequestOptions {
5073            &mut self.0.options
5074        }
5075    }
5076}
5077
5078/// Request and client builders for [FirewallActivation][crate::client::FirewallActivation].
5079pub mod firewall_activation {
5080    use crate::Result;
5081
5082    /// A builder for [FirewallActivation][crate::client::FirewallActivation].
5083    ///
5084    /// ```
5085    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5086    /// # use google_cloud_networksecurity_v1::*;
5087    /// # use builder::firewall_activation::ClientBuilder;
5088    /// # use client::FirewallActivation;
5089    /// let builder : ClientBuilder = FirewallActivation::builder();
5090    /// let client = builder
5091    ///     .with_endpoint("https://networksecurity.googleapis.com")
5092    ///     .build().await?;
5093    /// # Ok(()) }
5094    /// ```
5095    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5096
5097    pub(crate) mod client {
5098        use super::super::super::client::FirewallActivation;
5099        pub struct Factory;
5100        impl crate::ClientFactory for Factory {
5101            type Client = FirewallActivation;
5102            type Credentials = gaxi::options::Credentials;
5103            async fn build(
5104                self,
5105                config: gaxi::options::ClientConfig,
5106            ) -> crate::ClientBuilderResult<Self::Client> {
5107                Self::Client::new(config).await
5108            }
5109        }
5110    }
5111
5112    /// Common implementation for [crate::client::FirewallActivation] request builders.
5113    #[derive(Clone, Debug)]
5114    pub(crate) struct RequestBuilder<R: std::default::Default> {
5115        stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5116        request: R,
5117        options: crate::RequestOptions,
5118    }
5119
5120    impl<R> RequestBuilder<R>
5121    where
5122        R: std::default::Default,
5123    {
5124        pub(crate) fn new(
5125            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5126        ) -> Self {
5127            Self {
5128                stub,
5129                request: R::default(),
5130                options: crate::RequestOptions::default(),
5131            }
5132        }
5133    }
5134
5135    /// The request builder for [FirewallActivation::list_firewall_endpoints][crate::client::FirewallActivation::list_firewall_endpoints] calls.
5136    ///
5137    /// # Example
5138    /// ```
5139    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListFirewallEndpoints;
5140    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5141    /// use google_cloud_gax::paginator::ItemPaginator;
5142    ///
5143    /// let builder = prepare_request_builder();
5144    /// let mut items = builder.by_item();
5145    /// while let Some(result) = items.next().await {
5146    ///   let item = result?;
5147    /// }
5148    /// # Ok(()) }
5149    ///
5150    /// fn prepare_request_builder() -> ListFirewallEndpoints {
5151    ///   # panic!();
5152    ///   // ... details omitted ...
5153    /// }
5154    /// ```
5155    #[derive(Clone, Debug)]
5156    pub struct ListFirewallEndpoints(RequestBuilder<crate::model::ListFirewallEndpointsRequest>);
5157
5158    impl ListFirewallEndpoints {
5159        pub(crate) fn new(
5160            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5161        ) -> Self {
5162            Self(RequestBuilder::new(stub))
5163        }
5164
5165        /// Sets the full request, replacing any prior values.
5166        pub fn with_request<V: Into<crate::model::ListFirewallEndpointsRequest>>(
5167            mut self,
5168            v: V,
5169        ) -> Self {
5170            self.0.request = v.into();
5171            self
5172        }
5173
5174        /// Sets all the options, replacing any prior values.
5175        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5176            self.0.options = v.into();
5177            self
5178        }
5179
5180        /// Sends the request.
5181        pub async fn send(self) -> Result<crate::model::ListFirewallEndpointsResponse> {
5182            (*self.0.stub)
5183                .list_firewall_endpoints(self.0.request, self.0.options)
5184                .await
5185                .map(crate::Response::into_body)
5186        }
5187
5188        /// Streams each page in the collection.
5189        pub fn by_page(
5190            self,
5191        ) -> impl google_cloud_gax::paginator::Paginator<
5192            crate::model::ListFirewallEndpointsResponse,
5193            crate::Error,
5194        > {
5195            use std::clone::Clone;
5196            let token = self.0.request.page_token.clone();
5197            let execute = move |token: String| {
5198                let mut builder = self.clone();
5199                builder.0.request = builder.0.request.set_page_token(token);
5200                builder.send()
5201            };
5202            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5203        }
5204
5205        /// Streams each item in the collection.
5206        pub fn by_item(
5207            self,
5208        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5209            crate::model::ListFirewallEndpointsResponse,
5210            crate::Error,
5211        > {
5212            use google_cloud_gax::paginator::Paginator;
5213            self.by_page().items()
5214        }
5215
5216        /// Sets the value of [parent][crate::model::ListFirewallEndpointsRequest::parent].
5217        ///
5218        /// This is a **required** field for requests.
5219        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5220            self.0.request.parent = v.into();
5221            self
5222        }
5223
5224        /// Sets the value of [page_size][crate::model::ListFirewallEndpointsRequest::page_size].
5225        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5226            self.0.request.page_size = v.into();
5227            self
5228        }
5229
5230        /// Sets the value of [page_token][crate::model::ListFirewallEndpointsRequest::page_token].
5231        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5232            self.0.request.page_token = v.into();
5233            self
5234        }
5235
5236        /// Sets the value of [filter][crate::model::ListFirewallEndpointsRequest::filter].
5237        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5238            self.0.request.filter = v.into();
5239            self
5240        }
5241
5242        /// Sets the value of [order_by][crate::model::ListFirewallEndpointsRequest::order_by].
5243        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5244            self.0.request.order_by = v.into();
5245            self
5246        }
5247    }
5248
5249    #[doc(hidden)]
5250    impl crate::RequestBuilder for ListFirewallEndpoints {
5251        fn request_options(&mut self) -> &mut crate::RequestOptions {
5252            &mut self.0.options
5253        }
5254    }
5255
5256    /// The request builder for [FirewallActivation::get_firewall_endpoint][crate::client::FirewallActivation::get_firewall_endpoint] calls.
5257    ///
5258    /// # Example
5259    /// ```
5260    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetFirewallEndpoint;
5261    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5262    ///
5263    /// let builder = prepare_request_builder();
5264    /// let response = builder.send().await?;
5265    /// # Ok(()) }
5266    ///
5267    /// fn prepare_request_builder() -> GetFirewallEndpoint {
5268    ///   # panic!();
5269    ///   // ... details omitted ...
5270    /// }
5271    /// ```
5272    #[derive(Clone, Debug)]
5273    pub struct GetFirewallEndpoint(RequestBuilder<crate::model::GetFirewallEndpointRequest>);
5274
5275    impl GetFirewallEndpoint {
5276        pub(crate) fn new(
5277            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5278        ) -> Self {
5279            Self(RequestBuilder::new(stub))
5280        }
5281
5282        /// Sets the full request, replacing any prior values.
5283        pub fn with_request<V: Into<crate::model::GetFirewallEndpointRequest>>(
5284            mut self,
5285            v: V,
5286        ) -> Self {
5287            self.0.request = v.into();
5288            self
5289        }
5290
5291        /// Sets all the options, replacing any prior values.
5292        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5293            self.0.options = v.into();
5294            self
5295        }
5296
5297        /// Sends the request.
5298        pub async fn send(self) -> Result<crate::model::FirewallEndpoint> {
5299            (*self.0.stub)
5300                .get_firewall_endpoint(self.0.request, self.0.options)
5301                .await
5302                .map(crate::Response::into_body)
5303        }
5304
5305        /// Sets the value of [name][crate::model::GetFirewallEndpointRequest::name].
5306        ///
5307        /// This is a **required** field for requests.
5308        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5309            self.0.request.name = v.into();
5310            self
5311        }
5312    }
5313
5314    #[doc(hidden)]
5315    impl crate::RequestBuilder for GetFirewallEndpoint {
5316        fn request_options(&mut self) -> &mut crate::RequestOptions {
5317            &mut self.0.options
5318        }
5319    }
5320
5321    /// The request builder for [FirewallActivation::create_firewall_endpoint][crate::client::FirewallActivation::create_firewall_endpoint] calls.
5322    ///
5323    /// # Example
5324    /// ```
5325    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::CreateFirewallEndpoint;
5326    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5327    /// use google_cloud_lro::Poller;
5328    ///
5329    /// let builder = prepare_request_builder();
5330    /// let response = builder.poller().until_done().await?;
5331    /// # Ok(()) }
5332    ///
5333    /// fn prepare_request_builder() -> CreateFirewallEndpoint {
5334    ///   # panic!();
5335    ///   // ... details omitted ...
5336    /// }
5337    /// ```
5338    #[derive(Clone, Debug)]
5339    pub struct CreateFirewallEndpoint(RequestBuilder<crate::model::CreateFirewallEndpointRequest>);
5340
5341    impl CreateFirewallEndpoint {
5342        pub(crate) fn new(
5343            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5344        ) -> Self {
5345            Self(RequestBuilder::new(stub))
5346        }
5347
5348        /// Sets the full request, replacing any prior values.
5349        pub fn with_request<V: Into<crate::model::CreateFirewallEndpointRequest>>(
5350            mut self,
5351            v: V,
5352        ) -> Self {
5353            self.0.request = v.into();
5354            self
5355        }
5356
5357        /// Sets all the options, replacing any prior values.
5358        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5359            self.0.options = v.into();
5360            self
5361        }
5362
5363        /// Sends the request.
5364        ///
5365        /// # Long running operations
5366        ///
5367        /// This starts, but does not poll, a longrunning operation. More information
5368        /// on [create_firewall_endpoint][crate::client::FirewallActivation::create_firewall_endpoint].
5369        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5370            (*self.0.stub)
5371                .create_firewall_endpoint(self.0.request, self.0.options)
5372                .await
5373                .map(crate::Response::into_body)
5374        }
5375
5376        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_firewall_endpoint`.
5377        pub fn poller(
5378            self,
5379        ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5380        {
5381            type Operation = google_cloud_lro::internal::Operation<
5382                crate::model::FirewallEndpoint,
5383                crate::model::OperationMetadata,
5384            >;
5385            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5386            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5387
5388            let stub = self.0.stub.clone();
5389            let mut options = self.0.options.clone();
5390            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5391            let query = move |name| {
5392                let stub = stub.clone();
5393                let options = options.clone();
5394                async {
5395                    let op = GetOperation::new(stub)
5396                        .set_name(name)
5397                        .with_options(options)
5398                        .send()
5399                        .await?;
5400                    Ok(Operation::new(op))
5401                }
5402            };
5403
5404            let start = move || async {
5405                let op = self.send().await?;
5406                Ok(Operation::new(op))
5407            };
5408
5409            google_cloud_lro::internal::new_poller(
5410                polling_error_policy,
5411                polling_backoff_policy,
5412                start,
5413                query,
5414            )
5415        }
5416
5417        /// Sets the value of [parent][crate::model::CreateFirewallEndpointRequest::parent].
5418        ///
5419        /// This is a **required** field for requests.
5420        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5421            self.0.request.parent = v.into();
5422            self
5423        }
5424
5425        /// Sets the value of [firewall_endpoint_id][crate::model::CreateFirewallEndpointRequest::firewall_endpoint_id].
5426        ///
5427        /// This is a **required** field for requests.
5428        pub fn set_firewall_endpoint_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5429            self.0.request.firewall_endpoint_id = v.into();
5430            self
5431        }
5432
5433        /// Sets the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
5434        ///
5435        /// This is a **required** field for requests.
5436        pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5437        where
5438            T: std::convert::Into<crate::model::FirewallEndpoint>,
5439        {
5440            self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5441            self
5442        }
5443
5444        /// Sets or clears the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
5445        ///
5446        /// This is a **required** field for requests.
5447        pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5448        where
5449            T: std::convert::Into<crate::model::FirewallEndpoint>,
5450        {
5451            self.0.request.firewall_endpoint = v.map(|x| x.into());
5452            self
5453        }
5454
5455        /// Sets the value of [request_id][crate::model::CreateFirewallEndpointRequest::request_id].
5456        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5457            self.0.request.request_id = v.into();
5458            self
5459        }
5460    }
5461
5462    #[doc(hidden)]
5463    impl crate::RequestBuilder for CreateFirewallEndpoint {
5464        fn request_options(&mut self) -> &mut crate::RequestOptions {
5465            &mut self.0.options
5466        }
5467    }
5468
5469    /// The request builder for [FirewallActivation::delete_firewall_endpoint][crate::client::FirewallActivation::delete_firewall_endpoint] calls.
5470    ///
5471    /// # Example
5472    /// ```
5473    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::DeleteFirewallEndpoint;
5474    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5475    /// use google_cloud_lro::Poller;
5476    ///
5477    /// let builder = prepare_request_builder();
5478    /// let response = builder.poller().until_done().await?;
5479    /// # Ok(()) }
5480    ///
5481    /// fn prepare_request_builder() -> DeleteFirewallEndpoint {
5482    ///   # panic!();
5483    ///   // ... details omitted ...
5484    /// }
5485    /// ```
5486    #[derive(Clone, Debug)]
5487    pub struct DeleteFirewallEndpoint(RequestBuilder<crate::model::DeleteFirewallEndpointRequest>);
5488
5489    impl DeleteFirewallEndpoint {
5490        pub(crate) fn new(
5491            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5492        ) -> Self {
5493            Self(RequestBuilder::new(stub))
5494        }
5495
5496        /// Sets the full request, replacing any prior values.
5497        pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointRequest>>(
5498            mut self,
5499            v: V,
5500        ) -> Self {
5501            self.0.request = v.into();
5502            self
5503        }
5504
5505        /// Sets all the options, replacing any prior values.
5506        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5507            self.0.options = v.into();
5508            self
5509        }
5510
5511        /// Sends the request.
5512        ///
5513        /// # Long running operations
5514        ///
5515        /// This starts, but does not poll, a longrunning operation. More information
5516        /// on [delete_firewall_endpoint][crate::client::FirewallActivation::delete_firewall_endpoint].
5517        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5518            (*self.0.stub)
5519                .delete_firewall_endpoint(self.0.request, self.0.options)
5520                .await
5521                .map(crate::Response::into_body)
5522        }
5523
5524        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_firewall_endpoint`.
5525        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5526            type Operation =
5527                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5528            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5529            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5530
5531            let stub = self.0.stub.clone();
5532            let mut options = self.0.options.clone();
5533            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5534            let query = move |name| {
5535                let stub = stub.clone();
5536                let options = options.clone();
5537                async {
5538                    let op = GetOperation::new(stub)
5539                        .set_name(name)
5540                        .with_options(options)
5541                        .send()
5542                        .await?;
5543                    Ok(Operation::new(op))
5544                }
5545            };
5546
5547            let start = move || async {
5548                let op = self.send().await?;
5549                Ok(Operation::new(op))
5550            };
5551
5552            google_cloud_lro::internal::new_unit_response_poller(
5553                polling_error_policy,
5554                polling_backoff_policy,
5555                start,
5556                query,
5557            )
5558        }
5559
5560        /// Sets the value of [name][crate::model::DeleteFirewallEndpointRequest::name].
5561        ///
5562        /// This is a **required** field for requests.
5563        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5564            self.0.request.name = v.into();
5565            self
5566        }
5567
5568        /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointRequest::request_id].
5569        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5570            self.0.request.request_id = v.into();
5571            self
5572        }
5573    }
5574
5575    #[doc(hidden)]
5576    impl crate::RequestBuilder for DeleteFirewallEndpoint {
5577        fn request_options(&mut self) -> &mut crate::RequestOptions {
5578            &mut self.0.options
5579        }
5580    }
5581
5582    /// The request builder for [FirewallActivation::update_firewall_endpoint][crate::client::FirewallActivation::update_firewall_endpoint] calls.
5583    ///
5584    /// # Example
5585    /// ```
5586    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::UpdateFirewallEndpoint;
5587    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5588    /// use google_cloud_lro::Poller;
5589    ///
5590    /// let builder = prepare_request_builder();
5591    /// let response = builder.poller().until_done().await?;
5592    /// # Ok(()) }
5593    ///
5594    /// fn prepare_request_builder() -> UpdateFirewallEndpoint {
5595    ///   # panic!();
5596    ///   // ... details omitted ...
5597    /// }
5598    /// ```
5599    #[derive(Clone, Debug)]
5600    pub struct UpdateFirewallEndpoint(RequestBuilder<crate::model::UpdateFirewallEndpointRequest>);
5601
5602    impl UpdateFirewallEndpoint {
5603        pub(crate) fn new(
5604            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5605        ) -> Self {
5606            Self(RequestBuilder::new(stub))
5607        }
5608
5609        /// Sets the full request, replacing any prior values.
5610        pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointRequest>>(
5611            mut self,
5612            v: V,
5613        ) -> Self {
5614            self.0.request = v.into();
5615            self
5616        }
5617
5618        /// Sets all the options, replacing any prior values.
5619        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5620            self.0.options = v.into();
5621            self
5622        }
5623
5624        /// Sends the request.
5625        ///
5626        /// # Long running operations
5627        ///
5628        /// This starts, but does not poll, a longrunning operation. More information
5629        /// on [update_firewall_endpoint][crate::client::FirewallActivation::update_firewall_endpoint].
5630        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5631            (*self.0.stub)
5632                .update_firewall_endpoint(self.0.request, self.0.options)
5633                .await
5634                .map(crate::Response::into_body)
5635        }
5636
5637        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_firewall_endpoint`.
5638        pub fn poller(
5639            self,
5640        ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5641        {
5642            type Operation = google_cloud_lro::internal::Operation<
5643                crate::model::FirewallEndpoint,
5644                crate::model::OperationMetadata,
5645            >;
5646            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5647            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5648
5649            let stub = self.0.stub.clone();
5650            let mut options = self.0.options.clone();
5651            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5652            let query = move |name| {
5653                let stub = stub.clone();
5654                let options = options.clone();
5655                async {
5656                    let op = GetOperation::new(stub)
5657                        .set_name(name)
5658                        .with_options(options)
5659                        .send()
5660                        .await?;
5661                    Ok(Operation::new(op))
5662                }
5663            };
5664
5665            let start = move || async {
5666                let op = self.send().await?;
5667                Ok(Operation::new(op))
5668            };
5669
5670            google_cloud_lro::internal::new_poller(
5671                polling_error_policy,
5672                polling_backoff_policy,
5673                start,
5674                query,
5675            )
5676        }
5677
5678        /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
5679        ///
5680        /// This is a **required** field for requests.
5681        pub fn set_update_mask<T>(mut self, v: T) -> Self
5682        where
5683            T: std::convert::Into<wkt::FieldMask>,
5684        {
5685            self.0.request.update_mask = std::option::Option::Some(v.into());
5686            self
5687        }
5688
5689        /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
5690        ///
5691        /// This is a **required** field for requests.
5692        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5693        where
5694            T: std::convert::Into<wkt::FieldMask>,
5695        {
5696            self.0.request.update_mask = v.map(|x| x.into());
5697            self
5698        }
5699
5700        /// Sets the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
5701        ///
5702        /// This is a **required** field for requests.
5703        pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5704        where
5705            T: std::convert::Into<crate::model::FirewallEndpoint>,
5706        {
5707            self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5708            self
5709        }
5710
5711        /// Sets or clears the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
5712        ///
5713        /// This is a **required** field for requests.
5714        pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5715        where
5716            T: std::convert::Into<crate::model::FirewallEndpoint>,
5717        {
5718            self.0.request.firewall_endpoint = v.map(|x| x.into());
5719            self
5720        }
5721
5722        /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointRequest::request_id].
5723        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5724            self.0.request.request_id = v.into();
5725            self
5726        }
5727    }
5728
5729    #[doc(hidden)]
5730    impl crate::RequestBuilder for UpdateFirewallEndpoint {
5731        fn request_options(&mut self) -> &mut crate::RequestOptions {
5732            &mut self.0.options
5733        }
5734    }
5735
5736    /// The request builder for [FirewallActivation::list_firewall_endpoint_associations][crate::client::FirewallActivation::list_firewall_endpoint_associations] calls.
5737    ///
5738    /// # Example
5739    /// ```
5740    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListFirewallEndpointAssociations;
5741    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5742    /// use google_cloud_gax::paginator::ItemPaginator;
5743    ///
5744    /// let builder = prepare_request_builder();
5745    /// let mut items = builder.by_item();
5746    /// while let Some(result) = items.next().await {
5747    ///   let item = result?;
5748    /// }
5749    /// # Ok(()) }
5750    ///
5751    /// fn prepare_request_builder() -> ListFirewallEndpointAssociations {
5752    ///   # panic!();
5753    ///   // ... details omitted ...
5754    /// }
5755    /// ```
5756    #[derive(Clone, Debug)]
5757    pub struct ListFirewallEndpointAssociations(
5758        RequestBuilder<crate::model::ListFirewallEndpointAssociationsRequest>,
5759    );
5760
5761    impl ListFirewallEndpointAssociations {
5762        pub(crate) fn new(
5763            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5764        ) -> Self {
5765            Self(RequestBuilder::new(stub))
5766        }
5767
5768        /// Sets the full request, replacing any prior values.
5769        pub fn with_request<V: Into<crate::model::ListFirewallEndpointAssociationsRequest>>(
5770            mut self,
5771            v: V,
5772        ) -> Self {
5773            self.0.request = v.into();
5774            self
5775        }
5776
5777        /// Sets all the options, replacing any prior values.
5778        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5779            self.0.options = v.into();
5780            self
5781        }
5782
5783        /// Sends the request.
5784        pub async fn send(self) -> Result<crate::model::ListFirewallEndpointAssociationsResponse> {
5785            (*self.0.stub)
5786                .list_firewall_endpoint_associations(self.0.request, self.0.options)
5787                .await
5788                .map(crate::Response::into_body)
5789        }
5790
5791        /// Streams each page in the collection.
5792        pub fn by_page(
5793            self,
5794        ) -> impl google_cloud_gax::paginator::Paginator<
5795            crate::model::ListFirewallEndpointAssociationsResponse,
5796            crate::Error,
5797        > {
5798            use std::clone::Clone;
5799            let token = self.0.request.page_token.clone();
5800            let execute = move |token: String| {
5801                let mut builder = self.clone();
5802                builder.0.request = builder.0.request.set_page_token(token);
5803                builder.send()
5804            };
5805            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5806        }
5807
5808        /// Streams each item in the collection.
5809        pub fn by_item(
5810            self,
5811        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5812            crate::model::ListFirewallEndpointAssociationsResponse,
5813            crate::Error,
5814        > {
5815            use google_cloud_gax::paginator::Paginator;
5816            self.by_page().items()
5817        }
5818
5819        /// Sets the value of [parent][crate::model::ListFirewallEndpointAssociationsRequest::parent].
5820        ///
5821        /// This is a **required** field for requests.
5822        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5823            self.0.request.parent = v.into();
5824            self
5825        }
5826
5827        /// Sets the value of [page_size][crate::model::ListFirewallEndpointAssociationsRequest::page_size].
5828        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5829            self.0.request.page_size = v.into();
5830            self
5831        }
5832
5833        /// Sets the value of [page_token][crate::model::ListFirewallEndpointAssociationsRequest::page_token].
5834        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5835            self.0.request.page_token = v.into();
5836            self
5837        }
5838
5839        /// Sets the value of [filter][crate::model::ListFirewallEndpointAssociationsRequest::filter].
5840        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5841            self.0.request.filter = v.into();
5842            self
5843        }
5844
5845        /// Sets the value of [order_by][crate::model::ListFirewallEndpointAssociationsRequest::order_by].
5846        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5847            self.0.request.order_by = v.into();
5848            self
5849        }
5850    }
5851
5852    #[doc(hidden)]
5853    impl crate::RequestBuilder for ListFirewallEndpointAssociations {
5854        fn request_options(&mut self) -> &mut crate::RequestOptions {
5855            &mut self.0.options
5856        }
5857    }
5858
5859    /// The request builder for [FirewallActivation::get_firewall_endpoint_association][crate::client::FirewallActivation::get_firewall_endpoint_association] calls.
5860    ///
5861    /// # Example
5862    /// ```
5863    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetFirewallEndpointAssociation;
5864    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5865    ///
5866    /// let builder = prepare_request_builder();
5867    /// let response = builder.send().await?;
5868    /// # Ok(()) }
5869    ///
5870    /// fn prepare_request_builder() -> GetFirewallEndpointAssociation {
5871    ///   # panic!();
5872    ///   // ... details omitted ...
5873    /// }
5874    /// ```
5875    #[derive(Clone, Debug)]
5876    pub struct GetFirewallEndpointAssociation(
5877        RequestBuilder<crate::model::GetFirewallEndpointAssociationRequest>,
5878    );
5879
5880    impl GetFirewallEndpointAssociation {
5881        pub(crate) fn new(
5882            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5883        ) -> Self {
5884            Self(RequestBuilder::new(stub))
5885        }
5886
5887        /// Sets the full request, replacing any prior values.
5888        pub fn with_request<V: Into<crate::model::GetFirewallEndpointAssociationRequest>>(
5889            mut self,
5890            v: V,
5891        ) -> Self {
5892            self.0.request = v.into();
5893            self
5894        }
5895
5896        /// Sets all the options, replacing any prior values.
5897        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5898            self.0.options = v.into();
5899            self
5900        }
5901
5902        /// Sends the request.
5903        pub async fn send(self) -> Result<crate::model::FirewallEndpointAssociation> {
5904            (*self.0.stub)
5905                .get_firewall_endpoint_association(self.0.request, self.0.options)
5906                .await
5907                .map(crate::Response::into_body)
5908        }
5909
5910        /// Sets the value of [name][crate::model::GetFirewallEndpointAssociationRequest::name].
5911        ///
5912        /// This is a **required** field for requests.
5913        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5914            self.0.request.name = v.into();
5915            self
5916        }
5917    }
5918
5919    #[doc(hidden)]
5920    impl crate::RequestBuilder for GetFirewallEndpointAssociation {
5921        fn request_options(&mut self) -> &mut crate::RequestOptions {
5922            &mut self.0.options
5923        }
5924    }
5925
5926    /// The request builder for [FirewallActivation::create_firewall_endpoint_association][crate::client::FirewallActivation::create_firewall_endpoint_association] calls.
5927    ///
5928    /// # Example
5929    /// ```
5930    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::CreateFirewallEndpointAssociation;
5931    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5932    /// use google_cloud_lro::Poller;
5933    ///
5934    /// let builder = prepare_request_builder();
5935    /// let response = builder.poller().until_done().await?;
5936    /// # Ok(()) }
5937    ///
5938    /// fn prepare_request_builder() -> CreateFirewallEndpointAssociation {
5939    ///   # panic!();
5940    ///   // ... details omitted ...
5941    /// }
5942    /// ```
5943    #[derive(Clone, Debug)]
5944    pub struct CreateFirewallEndpointAssociation(
5945        RequestBuilder<crate::model::CreateFirewallEndpointAssociationRequest>,
5946    );
5947
5948    impl CreateFirewallEndpointAssociation {
5949        pub(crate) fn new(
5950            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5951        ) -> Self {
5952            Self(RequestBuilder::new(stub))
5953        }
5954
5955        /// Sets the full request, replacing any prior values.
5956        pub fn with_request<V: Into<crate::model::CreateFirewallEndpointAssociationRequest>>(
5957            mut self,
5958            v: V,
5959        ) -> Self {
5960            self.0.request = v.into();
5961            self
5962        }
5963
5964        /// Sets all the options, replacing any prior values.
5965        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5966            self.0.options = v.into();
5967            self
5968        }
5969
5970        /// Sends the request.
5971        ///
5972        /// # Long running operations
5973        ///
5974        /// This starts, but does not poll, a longrunning operation. More information
5975        /// on [create_firewall_endpoint_association][crate::client::FirewallActivation::create_firewall_endpoint_association].
5976        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5977            (*self.0.stub)
5978                .create_firewall_endpoint_association(self.0.request, self.0.options)
5979                .await
5980                .map(crate::Response::into_body)
5981        }
5982
5983        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_firewall_endpoint_association`.
5984        pub fn poller(
5985            self,
5986        ) -> impl google_cloud_lro::Poller<
5987            crate::model::FirewallEndpointAssociation,
5988            crate::model::OperationMetadata,
5989        > {
5990            type Operation = google_cloud_lro::internal::Operation<
5991                crate::model::FirewallEndpointAssociation,
5992                crate::model::OperationMetadata,
5993            >;
5994            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5995            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5996
5997            let stub = self.0.stub.clone();
5998            let mut options = self.0.options.clone();
5999            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6000            let query = move |name| {
6001                let stub = stub.clone();
6002                let options = options.clone();
6003                async {
6004                    let op = GetOperation::new(stub)
6005                        .set_name(name)
6006                        .with_options(options)
6007                        .send()
6008                        .await?;
6009                    Ok(Operation::new(op))
6010                }
6011            };
6012
6013            let start = move || async {
6014                let op = self.send().await?;
6015                Ok(Operation::new(op))
6016            };
6017
6018            google_cloud_lro::internal::new_poller(
6019                polling_error_policy,
6020                polling_backoff_policy,
6021                start,
6022                query,
6023            )
6024        }
6025
6026        /// Sets the value of [parent][crate::model::CreateFirewallEndpointAssociationRequest::parent].
6027        ///
6028        /// This is a **required** field for requests.
6029        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6030            self.0.request.parent = v.into();
6031            self
6032        }
6033
6034        /// Sets the value of [firewall_endpoint_association_id][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association_id].
6035        pub fn set_firewall_endpoint_association_id<T: Into<std::string::String>>(
6036            mut self,
6037            v: T,
6038        ) -> Self {
6039            self.0.request.firewall_endpoint_association_id = v.into();
6040            self
6041        }
6042
6043        /// Sets the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
6044        ///
6045        /// This is a **required** field for requests.
6046        pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
6047        where
6048            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6049        {
6050            self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
6051            self
6052        }
6053
6054        /// Sets or clears the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
6055        ///
6056        /// This is a **required** field for requests.
6057        pub fn set_or_clear_firewall_endpoint_association<T>(
6058            mut self,
6059            v: std::option::Option<T>,
6060        ) -> Self
6061        where
6062            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6063        {
6064            self.0.request.firewall_endpoint_association = v.map(|x| x.into());
6065            self
6066        }
6067
6068        /// Sets the value of [request_id][crate::model::CreateFirewallEndpointAssociationRequest::request_id].
6069        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6070            self.0.request.request_id = v.into();
6071            self
6072        }
6073    }
6074
6075    #[doc(hidden)]
6076    impl crate::RequestBuilder for CreateFirewallEndpointAssociation {
6077        fn request_options(&mut self) -> &mut crate::RequestOptions {
6078            &mut self.0.options
6079        }
6080    }
6081
6082    /// The request builder for [FirewallActivation::delete_firewall_endpoint_association][crate::client::FirewallActivation::delete_firewall_endpoint_association] calls.
6083    ///
6084    /// # Example
6085    /// ```
6086    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::DeleteFirewallEndpointAssociation;
6087    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6088    /// use google_cloud_lro::Poller;
6089    ///
6090    /// let builder = prepare_request_builder();
6091    /// let response = builder.poller().until_done().await?;
6092    /// # Ok(()) }
6093    ///
6094    /// fn prepare_request_builder() -> DeleteFirewallEndpointAssociation {
6095    ///   # panic!();
6096    ///   // ... details omitted ...
6097    /// }
6098    /// ```
6099    #[derive(Clone, Debug)]
6100    pub struct DeleteFirewallEndpointAssociation(
6101        RequestBuilder<crate::model::DeleteFirewallEndpointAssociationRequest>,
6102    );
6103
6104    impl DeleteFirewallEndpointAssociation {
6105        pub(crate) fn new(
6106            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6107        ) -> Self {
6108            Self(RequestBuilder::new(stub))
6109        }
6110
6111        /// Sets the full request, replacing any prior values.
6112        pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointAssociationRequest>>(
6113            mut self,
6114            v: V,
6115        ) -> Self {
6116            self.0.request = v.into();
6117            self
6118        }
6119
6120        /// Sets all the options, replacing any prior values.
6121        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6122            self.0.options = v.into();
6123            self
6124        }
6125
6126        /// Sends the request.
6127        ///
6128        /// # Long running operations
6129        ///
6130        /// This starts, but does not poll, a longrunning operation. More information
6131        /// on [delete_firewall_endpoint_association][crate::client::FirewallActivation::delete_firewall_endpoint_association].
6132        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6133            (*self.0.stub)
6134                .delete_firewall_endpoint_association(self.0.request, self.0.options)
6135                .await
6136                .map(crate::Response::into_body)
6137        }
6138
6139        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_firewall_endpoint_association`.
6140        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6141            type Operation =
6142                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6143            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6144            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6145
6146            let stub = self.0.stub.clone();
6147            let mut options = self.0.options.clone();
6148            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6149            let query = move |name| {
6150                let stub = stub.clone();
6151                let options = options.clone();
6152                async {
6153                    let op = GetOperation::new(stub)
6154                        .set_name(name)
6155                        .with_options(options)
6156                        .send()
6157                        .await?;
6158                    Ok(Operation::new(op))
6159                }
6160            };
6161
6162            let start = move || async {
6163                let op = self.send().await?;
6164                Ok(Operation::new(op))
6165            };
6166
6167            google_cloud_lro::internal::new_unit_response_poller(
6168                polling_error_policy,
6169                polling_backoff_policy,
6170                start,
6171                query,
6172            )
6173        }
6174
6175        /// Sets the value of [name][crate::model::DeleteFirewallEndpointAssociationRequest::name].
6176        ///
6177        /// This is a **required** field for requests.
6178        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6179            self.0.request.name = v.into();
6180            self
6181        }
6182
6183        /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointAssociationRequest::request_id].
6184        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6185            self.0.request.request_id = v.into();
6186            self
6187        }
6188    }
6189
6190    #[doc(hidden)]
6191    impl crate::RequestBuilder for DeleteFirewallEndpointAssociation {
6192        fn request_options(&mut self) -> &mut crate::RequestOptions {
6193            &mut self.0.options
6194        }
6195    }
6196
6197    /// The request builder for [FirewallActivation::update_firewall_endpoint_association][crate::client::FirewallActivation::update_firewall_endpoint_association] calls.
6198    ///
6199    /// # Example
6200    /// ```
6201    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::UpdateFirewallEndpointAssociation;
6202    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6203    /// use google_cloud_lro::Poller;
6204    ///
6205    /// let builder = prepare_request_builder();
6206    /// let response = builder.poller().until_done().await?;
6207    /// # Ok(()) }
6208    ///
6209    /// fn prepare_request_builder() -> UpdateFirewallEndpointAssociation {
6210    ///   # panic!();
6211    ///   // ... details omitted ...
6212    /// }
6213    /// ```
6214    #[derive(Clone, Debug)]
6215    pub struct UpdateFirewallEndpointAssociation(
6216        RequestBuilder<crate::model::UpdateFirewallEndpointAssociationRequest>,
6217    );
6218
6219    impl UpdateFirewallEndpointAssociation {
6220        pub(crate) fn new(
6221            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6222        ) -> Self {
6223            Self(RequestBuilder::new(stub))
6224        }
6225
6226        /// Sets the full request, replacing any prior values.
6227        pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointAssociationRequest>>(
6228            mut self,
6229            v: V,
6230        ) -> Self {
6231            self.0.request = v.into();
6232            self
6233        }
6234
6235        /// Sets all the options, replacing any prior values.
6236        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6237            self.0.options = v.into();
6238            self
6239        }
6240
6241        /// Sends the request.
6242        ///
6243        /// # Long running operations
6244        ///
6245        /// This starts, but does not poll, a longrunning operation. More information
6246        /// on [update_firewall_endpoint_association][crate::client::FirewallActivation::update_firewall_endpoint_association].
6247        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6248            (*self.0.stub)
6249                .update_firewall_endpoint_association(self.0.request, self.0.options)
6250                .await
6251                .map(crate::Response::into_body)
6252        }
6253
6254        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_firewall_endpoint_association`.
6255        pub fn poller(
6256            self,
6257        ) -> impl google_cloud_lro::Poller<
6258            crate::model::FirewallEndpointAssociation,
6259            crate::model::OperationMetadata,
6260        > {
6261            type Operation = google_cloud_lro::internal::Operation<
6262                crate::model::FirewallEndpointAssociation,
6263                crate::model::OperationMetadata,
6264            >;
6265            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6266            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6267
6268            let stub = self.0.stub.clone();
6269            let mut options = self.0.options.clone();
6270            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6271            let query = move |name| {
6272                let stub = stub.clone();
6273                let options = options.clone();
6274                async {
6275                    let op = GetOperation::new(stub)
6276                        .set_name(name)
6277                        .with_options(options)
6278                        .send()
6279                        .await?;
6280                    Ok(Operation::new(op))
6281                }
6282            };
6283
6284            let start = move || async {
6285                let op = self.send().await?;
6286                Ok(Operation::new(op))
6287            };
6288
6289            google_cloud_lro::internal::new_poller(
6290                polling_error_policy,
6291                polling_backoff_policy,
6292                start,
6293                query,
6294            )
6295        }
6296
6297        /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
6298        ///
6299        /// This is a **required** field for requests.
6300        pub fn set_update_mask<T>(mut self, v: T) -> Self
6301        where
6302            T: std::convert::Into<wkt::FieldMask>,
6303        {
6304            self.0.request.update_mask = std::option::Option::Some(v.into());
6305            self
6306        }
6307
6308        /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
6309        ///
6310        /// This is a **required** field for requests.
6311        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6312        where
6313            T: std::convert::Into<wkt::FieldMask>,
6314        {
6315            self.0.request.update_mask = v.map(|x| x.into());
6316            self
6317        }
6318
6319        /// Sets the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
6320        ///
6321        /// This is a **required** field for requests.
6322        pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
6323        where
6324            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6325        {
6326            self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
6327            self
6328        }
6329
6330        /// Sets or clears the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
6331        ///
6332        /// This is a **required** field for requests.
6333        pub fn set_or_clear_firewall_endpoint_association<T>(
6334            mut self,
6335            v: std::option::Option<T>,
6336        ) -> Self
6337        where
6338            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6339        {
6340            self.0.request.firewall_endpoint_association = v.map(|x| x.into());
6341            self
6342        }
6343
6344        /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointAssociationRequest::request_id].
6345        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6346            self.0.request.request_id = v.into();
6347            self
6348        }
6349    }
6350
6351    #[doc(hidden)]
6352    impl crate::RequestBuilder for UpdateFirewallEndpointAssociation {
6353        fn request_options(&mut self) -> &mut crate::RequestOptions {
6354            &mut self.0.options
6355        }
6356    }
6357
6358    /// The request builder for [FirewallActivation::list_locations][crate::client::FirewallActivation::list_locations] calls.
6359    ///
6360    /// # Example
6361    /// ```
6362    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListLocations;
6363    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6364    /// use google_cloud_gax::paginator::ItemPaginator;
6365    ///
6366    /// let builder = prepare_request_builder();
6367    /// let mut items = builder.by_item();
6368    /// while let Some(result) = items.next().await {
6369    ///   let item = result?;
6370    /// }
6371    /// # Ok(()) }
6372    ///
6373    /// fn prepare_request_builder() -> ListLocations {
6374    ///   # panic!();
6375    ///   // ... details omitted ...
6376    /// }
6377    /// ```
6378    #[derive(Clone, Debug)]
6379    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6380
6381    impl ListLocations {
6382        pub(crate) fn new(
6383            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6384        ) -> Self {
6385            Self(RequestBuilder::new(stub))
6386        }
6387
6388        /// Sets the full request, replacing any prior values.
6389        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6390            mut self,
6391            v: V,
6392        ) -> Self {
6393            self.0.request = v.into();
6394            self
6395        }
6396
6397        /// Sets all the options, replacing any prior values.
6398        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6399            self.0.options = v.into();
6400            self
6401        }
6402
6403        /// Sends the request.
6404        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6405            (*self.0.stub)
6406                .list_locations(self.0.request, self.0.options)
6407                .await
6408                .map(crate::Response::into_body)
6409        }
6410
6411        /// Streams each page in the collection.
6412        pub fn by_page(
6413            self,
6414        ) -> impl google_cloud_gax::paginator::Paginator<
6415            google_cloud_location::model::ListLocationsResponse,
6416            crate::Error,
6417        > {
6418            use std::clone::Clone;
6419            let token = self.0.request.page_token.clone();
6420            let execute = move |token: String| {
6421                let mut builder = self.clone();
6422                builder.0.request = builder.0.request.set_page_token(token);
6423                builder.send()
6424            };
6425            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6426        }
6427
6428        /// Streams each item in the collection.
6429        pub fn by_item(
6430            self,
6431        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6432            google_cloud_location::model::ListLocationsResponse,
6433            crate::Error,
6434        > {
6435            use google_cloud_gax::paginator::Paginator;
6436            self.by_page().items()
6437        }
6438
6439        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
6440        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6441            self.0.request.name = v.into();
6442            self
6443        }
6444
6445        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
6446        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6447            self.0.request.filter = v.into();
6448            self
6449        }
6450
6451        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
6452        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6453            self.0.request.page_size = v.into();
6454            self
6455        }
6456
6457        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
6458        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6459            self.0.request.page_token = v.into();
6460            self
6461        }
6462    }
6463
6464    #[doc(hidden)]
6465    impl crate::RequestBuilder for ListLocations {
6466        fn request_options(&mut self) -> &mut crate::RequestOptions {
6467            &mut self.0.options
6468        }
6469    }
6470
6471    /// The request builder for [FirewallActivation::get_location][crate::client::FirewallActivation::get_location] calls.
6472    ///
6473    /// # Example
6474    /// ```
6475    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetLocation;
6476    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6477    ///
6478    /// let builder = prepare_request_builder();
6479    /// let response = builder.send().await?;
6480    /// # Ok(()) }
6481    ///
6482    /// fn prepare_request_builder() -> GetLocation {
6483    ///   # panic!();
6484    ///   // ... details omitted ...
6485    /// }
6486    /// ```
6487    #[derive(Clone, Debug)]
6488    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6489
6490    impl GetLocation {
6491        pub(crate) fn new(
6492            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6493        ) -> Self {
6494            Self(RequestBuilder::new(stub))
6495        }
6496
6497        /// Sets the full request, replacing any prior values.
6498        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6499            mut self,
6500            v: V,
6501        ) -> Self {
6502            self.0.request = v.into();
6503            self
6504        }
6505
6506        /// Sets all the options, replacing any prior values.
6507        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6508            self.0.options = v.into();
6509            self
6510        }
6511
6512        /// Sends the request.
6513        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6514            (*self.0.stub)
6515                .get_location(self.0.request, self.0.options)
6516                .await
6517                .map(crate::Response::into_body)
6518        }
6519
6520        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
6521        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6522            self.0.request.name = v.into();
6523            self
6524        }
6525    }
6526
6527    #[doc(hidden)]
6528    impl crate::RequestBuilder for GetLocation {
6529        fn request_options(&mut self) -> &mut crate::RequestOptions {
6530            &mut self.0.options
6531        }
6532    }
6533
6534    /// The request builder for [FirewallActivation::set_iam_policy][crate::client::FirewallActivation::set_iam_policy] calls.
6535    ///
6536    /// # Example
6537    /// ```
6538    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::SetIamPolicy;
6539    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6540    ///
6541    /// let builder = prepare_request_builder();
6542    /// let response = builder.send().await?;
6543    /// # Ok(()) }
6544    ///
6545    /// fn prepare_request_builder() -> SetIamPolicy {
6546    ///   # panic!();
6547    ///   // ... details omitted ...
6548    /// }
6549    /// ```
6550    #[derive(Clone, Debug)]
6551    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6552
6553    impl SetIamPolicy {
6554        pub(crate) fn new(
6555            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6556        ) -> Self {
6557            Self(RequestBuilder::new(stub))
6558        }
6559
6560        /// Sets the full request, replacing any prior values.
6561        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6562            mut self,
6563            v: V,
6564        ) -> Self {
6565            self.0.request = v.into();
6566            self
6567        }
6568
6569        /// Sets all the options, replacing any prior values.
6570        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6571            self.0.options = v.into();
6572            self
6573        }
6574
6575        /// Sends the request.
6576        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6577            (*self.0.stub)
6578                .set_iam_policy(self.0.request, self.0.options)
6579                .await
6580                .map(crate::Response::into_body)
6581        }
6582
6583        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
6584        ///
6585        /// This is a **required** field for requests.
6586        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6587            self.0.request.resource = v.into();
6588            self
6589        }
6590
6591        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
6592        ///
6593        /// This is a **required** field for requests.
6594        pub fn set_policy<T>(mut self, v: T) -> Self
6595        where
6596            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6597        {
6598            self.0.request.policy = std::option::Option::Some(v.into());
6599            self
6600        }
6601
6602        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
6603        ///
6604        /// This is a **required** field for requests.
6605        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6606        where
6607            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6608        {
6609            self.0.request.policy = v.map(|x| x.into());
6610            self
6611        }
6612
6613        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
6614        pub fn set_update_mask<T>(mut self, v: T) -> Self
6615        where
6616            T: std::convert::Into<wkt::FieldMask>,
6617        {
6618            self.0.request.update_mask = std::option::Option::Some(v.into());
6619            self
6620        }
6621
6622        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
6623        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6624        where
6625            T: std::convert::Into<wkt::FieldMask>,
6626        {
6627            self.0.request.update_mask = v.map(|x| x.into());
6628            self
6629        }
6630    }
6631
6632    #[doc(hidden)]
6633    impl crate::RequestBuilder for SetIamPolicy {
6634        fn request_options(&mut self) -> &mut crate::RequestOptions {
6635            &mut self.0.options
6636        }
6637    }
6638
6639    /// The request builder for [FirewallActivation::get_iam_policy][crate::client::FirewallActivation::get_iam_policy] calls.
6640    ///
6641    /// # Example
6642    /// ```
6643    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetIamPolicy;
6644    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6645    ///
6646    /// let builder = prepare_request_builder();
6647    /// let response = builder.send().await?;
6648    /// # Ok(()) }
6649    ///
6650    /// fn prepare_request_builder() -> GetIamPolicy {
6651    ///   # panic!();
6652    ///   // ... details omitted ...
6653    /// }
6654    /// ```
6655    #[derive(Clone, Debug)]
6656    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
6657
6658    impl GetIamPolicy {
6659        pub(crate) fn new(
6660            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6661        ) -> Self {
6662            Self(RequestBuilder::new(stub))
6663        }
6664
6665        /// Sets the full request, replacing any prior values.
6666        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
6667            mut self,
6668            v: V,
6669        ) -> Self {
6670            self.0.request = v.into();
6671            self
6672        }
6673
6674        /// Sets all the options, replacing any prior values.
6675        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6676            self.0.options = v.into();
6677            self
6678        }
6679
6680        /// Sends the request.
6681        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6682            (*self.0.stub)
6683                .get_iam_policy(self.0.request, self.0.options)
6684                .await
6685                .map(crate::Response::into_body)
6686        }
6687
6688        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
6689        ///
6690        /// This is a **required** field for requests.
6691        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6692            self.0.request.resource = v.into();
6693            self
6694        }
6695
6696        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
6697        pub fn set_options<T>(mut self, v: T) -> Self
6698        where
6699            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6700        {
6701            self.0.request.options = std::option::Option::Some(v.into());
6702            self
6703        }
6704
6705        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
6706        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6707        where
6708            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6709        {
6710            self.0.request.options = v.map(|x| x.into());
6711            self
6712        }
6713    }
6714
6715    #[doc(hidden)]
6716    impl crate::RequestBuilder for GetIamPolicy {
6717        fn request_options(&mut self) -> &mut crate::RequestOptions {
6718            &mut self.0.options
6719        }
6720    }
6721
6722    /// The request builder for [FirewallActivation::test_iam_permissions][crate::client::FirewallActivation::test_iam_permissions] calls.
6723    ///
6724    /// # Example
6725    /// ```
6726    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::TestIamPermissions;
6727    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6728    ///
6729    /// let builder = prepare_request_builder();
6730    /// let response = builder.send().await?;
6731    /// # Ok(()) }
6732    ///
6733    /// fn prepare_request_builder() -> TestIamPermissions {
6734    ///   # panic!();
6735    ///   // ... details omitted ...
6736    /// }
6737    /// ```
6738    #[derive(Clone, Debug)]
6739    pub struct TestIamPermissions(
6740        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6741    );
6742
6743    impl TestIamPermissions {
6744        pub(crate) fn new(
6745            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6746        ) -> Self {
6747            Self(RequestBuilder::new(stub))
6748        }
6749
6750        /// Sets the full request, replacing any prior values.
6751        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
6752            mut self,
6753            v: V,
6754        ) -> Self {
6755            self.0.request = v.into();
6756            self
6757        }
6758
6759        /// Sets all the options, replacing any prior values.
6760        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6761            self.0.options = v.into();
6762            self
6763        }
6764
6765        /// Sends the request.
6766        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6767            (*self.0.stub)
6768                .test_iam_permissions(self.0.request, self.0.options)
6769                .await
6770                .map(crate::Response::into_body)
6771        }
6772
6773        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
6774        ///
6775        /// This is a **required** field for requests.
6776        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6777            self.0.request.resource = v.into();
6778            self
6779        }
6780
6781        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
6782        ///
6783        /// This is a **required** field for requests.
6784        pub fn set_permissions<T, V>(mut self, v: T) -> Self
6785        where
6786            T: std::iter::IntoIterator<Item = V>,
6787            V: std::convert::Into<std::string::String>,
6788        {
6789            use std::iter::Iterator;
6790            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6791            self
6792        }
6793    }
6794
6795    #[doc(hidden)]
6796    impl crate::RequestBuilder for TestIamPermissions {
6797        fn request_options(&mut self) -> &mut crate::RequestOptions {
6798            &mut self.0.options
6799        }
6800    }
6801
6802    /// The request builder for [FirewallActivation::list_operations][crate::client::FirewallActivation::list_operations] calls.
6803    ///
6804    /// # Example
6805    /// ```
6806    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListOperations;
6807    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6808    /// use google_cloud_gax::paginator::ItemPaginator;
6809    ///
6810    /// let builder = prepare_request_builder();
6811    /// let mut items = builder.by_item();
6812    /// while let Some(result) = items.next().await {
6813    ///   let item = result?;
6814    /// }
6815    /// # Ok(()) }
6816    ///
6817    /// fn prepare_request_builder() -> ListOperations {
6818    ///   # panic!();
6819    ///   // ... details omitted ...
6820    /// }
6821    /// ```
6822    #[derive(Clone, Debug)]
6823    pub struct ListOperations(
6824        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6825    );
6826
6827    impl ListOperations {
6828        pub(crate) fn new(
6829            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6830        ) -> Self {
6831            Self(RequestBuilder::new(stub))
6832        }
6833
6834        /// Sets the full request, replacing any prior values.
6835        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6836            mut self,
6837            v: V,
6838        ) -> Self {
6839            self.0.request = v.into();
6840            self
6841        }
6842
6843        /// Sets all the options, replacing any prior values.
6844        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6845            self.0.options = v.into();
6846            self
6847        }
6848
6849        /// Sends the request.
6850        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6851            (*self.0.stub)
6852                .list_operations(self.0.request, self.0.options)
6853                .await
6854                .map(crate::Response::into_body)
6855        }
6856
6857        /// Streams each page in the collection.
6858        pub fn by_page(
6859            self,
6860        ) -> impl google_cloud_gax::paginator::Paginator<
6861            google_cloud_longrunning::model::ListOperationsResponse,
6862            crate::Error,
6863        > {
6864            use std::clone::Clone;
6865            let token = self.0.request.page_token.clone();
6866            let execute = move |token: String| {
6867                let mut builder = self.clone();
6868                builder.0.request = builder.0.request.set_page_token(token);
6869                builder.send()
6870            };
6871            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6872        }
6873
6874        /// Streams each item in the collection.
6875        pub fn by_item(
6876            self,
6877        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6878            google_cloud_longrunning::model::ListOperationsResponse,
6879            crate::Error,
6880        > {
6881            use google_cloud_gax::paginator::Paginator;
6882            self.by_page().items()
6883        }
6884
6885        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
6886        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6887            self.0.request.name = v.into();
6888            self
6889        }
6890
6891        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
6892        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6893            self.0.request.filter = v.into();
6894            self
6895        }
6896
6897        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
6898        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6899            self.0.request.page_size = v.into();
6900            self
6901        }
6902
6903        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
6904        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6905            self.0.request.page_token = v.into();
6906            self
6907        }
6908
6909        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
6910        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6911            self.0.request.return_partial_success = v.into();
6912            self
6913        }
6914    }
6915
6916    #[doc(hidden)]
6917    impl crate::RequestBuilder for ListOperations {
6918        fn request_options(&mut self) -> &mut crate::RequestOptions {
6919            &mut self.0.options
6920        }
6921    }
6922
6923    /// The request builder for [FirewallActivation::get_operation][crate::client::FirewallActivation::get_operation] calls.
6924    ///
6925    /// # Example
6926    /// ```
6927    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetOperation;
6928    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6929    ///
6930    /// let builder = prepare_request_builder();
6931    /// let response = builder.send().await?;
6932    /// # Ok(()) }
6933    ///
6934    /// fn prepare_request_builder() -> GetOperation {
6935    ///   # panic!();
6936    ///   // ... details omitted ...
6937    /// }
6938    /// ```
6939    #[derive(Clone, Debug)]
6940    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6941
6942    impl GetOperation {
6943        pub(crate) fn new(
6944            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6945        ) -> Self {
6946            Self(RequestBuilder::new(stub))
6947        }
6948
6949        /// Sets the full request, replacing any prior values.
6950        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6951            mut self,
6952            v: V,
6953        ) -> Self {
6954            self.0.request = v.into();
6955            self
6956        }
6957
6958        /// Sets all the options, replacing any prior values.
6959        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6960            self.0.options = v.into();
6961            self
6962        }
6963
6964        /// Sends the request.
6965        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6966            (*self.0.stub)
6967                .get_operation(self.0.request, self.0.options)
6968                .await
6969                .map(crate::Response::into_body)
6970        }
6971
6972        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
6973        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6974            self.0.request.name = v.into();
6975            self
6976        }
6977    }
6978
6979    #[doc(hidden)]
6980    impl crate::RequestBuilder for GetOperation {
6981        fn request_options(&mut self) -> &mut crate::RequestOptions {
6982            &mut self.0.options
6983        }
6984    }
6985
6986    /// The request builder for [FirewallActivation::delete_operation][crate::client::FirewallActivation::delete_operation] calls.
6987    ///
6988    /// # Example
6989    /// ```
6990    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::DeleteOperation;
6991    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6992    ///
6993    /// let builder = prepare_request_builder();
6994    /// let response = builder.send().await?;
6995    /// # Ok(()) }
6996    ///
6997    /// fn prepare_request_builder() -> DeleteOperation {
6998    ///   # panic!();
6999    ///   // ... details omitted ...
7000    /// }
7001    /// ```
7002    #[derive(Clone, Debug)]
7003    pub struct DeleteOperation(
7004        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7005    );
7006
7007    impl DeleteOperation {
7008        pub(crate) fn new(
7009            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7010        ) -> Self {
7011            Self(RequestBuilder::new(stub))
7012        }
7013
7014        /// Sets the full request, replacing any prior values.
7015        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7016            mut self,
7017            v: V,
7018        ) -> Self {
7019            self.0.request = v.into();
7020            self
7021        }
7022
7023        /// Sets all the options, replacing any prior values.
7024        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7025            self.0.options = v.into();
7026            self
7027        }
7028
7029        /// Sends the request.
7030        pub async fn send(self) -> Result<()> {
7031            (*self.0.stub)
7032                .delete_operation(self.0.request, self.0.options)
7033                .await
7034                .map(crate::Response::into_body)
7035        }
7036
7037        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
7038        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7039            self.0.request.name = v.into();
7040            self
7041        }
7042    }
7043
7044    #[doc(hidden)]
7045    impl crate::RequestBuilder for DeleteOperation {
7046        fn request_options(&mut self) -> &mut crate::RequestOptions {
7047            &mut self.0.options
7048        }
7049    }
7050
7051    /// The request builder for [FirewallActivation::cancel_operation][crate::client::FirewallActivation::cancel_operation] calls.
7052    ///
7053    /// # Example
7054    /// ```
7055    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::CancelOperation;
7056    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7057    ///
7058    /// let builder = prepare_request_builder();
7059    /// let response = builder.send().await?;
7060    /// # Ok(()) }
7061    ///
7062    /// fn prepare_request_builder() -> CancelOperation {
7063    ///   # panic!();
7064    ///   // ... details omitted ...
7065    /// }
7066    /// ```
7067    #[derive(Clone, Debug)]
7068    pub struct CancelOperation(
7069        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7070    );
7071
7072    impl CancelOperation {
7073        pub(crate) fn new(
7074            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7075        ) -> Self {
7076            Self(RequestBuilder::new(stub))
7077        }
7078
7079        /// Sets the full request, replacing any prior values.
7080        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7081            mut self,
7082            v: V,
7083        ) -> Self {
7084            self.0.request = v.into();
7085            self
7086        }
7087
7088        /// Sets all the options, replacing any prior values.
7089        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7090            self.0.options = v.into();
7091            self
7092        }
7093
7094        /// Sends the request.
7095        pub async fn send(self) -> Result<()> {
7096            (*self.0.stub)
7097                .cancel_operation(self.0.request, self.0.options)
7098                .await
7099                .map(crate::Response::into_body)
7100        }
7101
7102        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
7103        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7104            self.0.request.name = v.into();
7105            self
7106        }
7107    }
7108
7109    #[doc(hidden)]
7110    impl crate::RequestBuilder for CancelOperation {
7111        fn request_options(&mut self) -> &mut crate::RequestOptions {
7112            &mut self.0.options
7113        }
7114    }
7115}
7116
7117/// Request and client builders for [Intercept][crate::client::Intercept].
7118pub mod intercept {
7119    use crate::Result;
7120
7121    /// A builder for [Intercept][crate::client::Intercept].
7122    ///
7123    /// ```
7124    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7125    /// # use google_cloud_networksecurity_v1::*;
7126    /// # use builder::intercept::ClientBuilder;
7127    /// # use client::Intercept;
7128    /// let builder : ClientBuilder = Intercept::builder();
7129    /// let client = builder
7130    ///     .with_endpoint("https://networksecurity.googleapis.com")
7131    ///     .build().await?;
7132    /// # Ok(()) }
7133    /// ```
7134    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7135
7136    pub(crate) mod client {
7137        use super::super::super::client::Intercept;
7138        pub struct Factory;
7139        impl crate::ClientFactory for Factory {
7140            type Client = Intercept;
7141            type Credentials = gaxi::options::Credentials;
7142            async fn build(
7143                self,
7144                config: gaxi::options::ClientConfig,
7145            ) -> crate::ClientBuilderResult<Self::Client> {
7146                Self::Client::new(config).await
7147            }
7148        }
7149    }
7150
7151    /// Common implementation for [crate::client::Intercept] request builders.
7152    #[derive(Clone, Debug)]
7153    pub(crate) struct RequestBuilder<R: std::default::Default> {
7154        stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7155        request: R,
7156        options: crate::RequestOptions,
7157    }
7158
7159    impl<R> RequestBuilder<R>
7160    where
7161        R: std::default::Default,
7162    {
7163        pub(crate) fn new(
7164            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7165        ) -> Self {
7166            Self {
7167                stub,
7168                request: R::default(),
7169                options: crate::RequestOptions::default(),
7170            }
7171        }
7172    }
7173
7174    /// The request builder for [Intercept::list_intercept_endpoint_groups][crate::client::Intercept::list_intercept_endpoint_groups] calls.
7175    ///
7176    /// # Example
7177    /// ```
7178    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptEndpointGroups;
7179    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7180    /// use google_cloud_gax::paginator::ItemPaginator;
7181    ///
7182    /// let builder = prepare_request_builder();
7183    /// let mut items = builder.by_item();
7184    /// while let Some(result) = items.next().await {
7185    ///   let item = result?;
7186    /// }
7187    /// # Ok(()) }
7188    ///
7189    /// fn prepare_request_builder() -> ListInterceptEndpointGroups {
7190    ///   # panic!();
7191    ///   // ... details omitted ...
7192    /// }
7193    /// ```
7194    #[derive(Clone, Debug)]
7195    pub struct ListInterceptEndpointGroups(
7196        RequestBuilder<crate::model::ListInterceptEndpointGroupsRequest>,
7197    );
7198
7199    impl ListInterceptEndpointGroups {
7200        pub(crate) fn new(
7201            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7202        ) -> Self {
7203            Self(RequestBuilder::new(stub))
7204        }
7205
7206        /// Sets the full request, replacing any prior values.
7207        pub fn with_request<V: Into<crate::model::ListInterceptEndpointGroupsRequest>>(
7208            mut self,
7209            v: V,
7210        ) -> Self {
7211            self.0.request = v.into();
7212            self
7213        }
7214
7215        /// Sets all the options, replacing any prior values.
7216        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7217            self.0.options = v.into();
7218            self
7219        }
7220
7221        /// Sends the request.
7222        pub async fn send(self) -> Result<crate::model::ListInterceptEndpointGroupsResponse> {
7223            (*self.0.stub)
7224                .list_intercept_endpoint_groups(self.0.request, self.0.options)
7225                .await
7226                .map(crate::Response::into_body)
7227        }
7228
7229        /// Streams each page in the collection.
7230        pub fn by_page(
7231            self,
7232        ) -> impl google_cloud_gax::paginator::Paginator<
7233            crate::model::ListInterceptEndpointGroupsResponse,
7234            crate::Error,
7235        > {
7236            use std::clone::Clone;
7237            let token = self.0.request.page_token.clone();
7238            let execute = move |token: String| {
7239                let mut builder = self.clone();
7240                builder.0.request = builder.0.request.set_page_token(token);
7241                builder.send()
7242            };
7243            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7244        }
7245
7246        /// Streams each item in the collection.
7247        pub fn by_item(
7248            self,
7249        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7250            crate::model::ListInterceptEndpointGroupsResponse,
7251            crate::Error,
7252        > {
7253            use google_cloud_gax::paginator::Paginator;
7254            self.by_page().items()
7255        }
7256
7257        /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupsRequest::parent].
7258        ///
7259        /// This is a **required** field for requests.
7260        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7261            self.0.request.parent = v.into();
7262            self
7263        }
7264
7265        /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupsRequest::page_size].
7266        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7267            self.0.request.page_size = v.into();
7268            self
7269        }
7270
7271        /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupsRequest::page_token].
7272        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7273            self.0.request.page_token = v.into();
7274            self
7275        }
7276
7277        /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupsRequest::filter].
7278        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7279            self.0.request.filter = v.into();
7280            self
7281        }
7282
7283        /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupsRequest::order_by].
7284        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7285            self.0.request.order_by = v.into();
7286            self
7287        }
7288    }
7289
7290    #[doc(hidden)]
7291    impl crate::RequestBuilder for ListInterceptEndpointGroups {
7292        fn request_options(&mut self) -> &mut crate::RequestOptions {
7293            &mut self.0.options
7294        }
7295    }
7296
7297    /// The request builder for [Intercept::get_intercept_endpoint_group][crate::client::Intercept::get_intercept_endpoint_group] calls.
7298    ///
7299    /// # Example
7300    /// ```
7301    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptEndpointGroup;
7302    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7303    ///
7304    /// let builder = prepare_request_builder();
7305    /// let response = builder.send().await?;
7306    /// # Ok(()) }
7307    ///
7308    /// fn prepare_request_builder() -> GetInterceptEndpointGroup {
7309    ///   # panic!();
7310    ///   // ... details omitted ...
7311    /// }
7312    /// ```
7313    #[derive(Clone, Debug)]
7314    pub struct GetInterceptEndpointGroup(
7315        RequestBuilder<crate::model::GetInterceptEndpointGroupRequest>,
7316    );
7317
7318    impl GetInterceptEndpointGroup {
7319        pub(crate) fn new(
7320            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7321        ) -> Self {
7322            Self(RequestBuilder::new(stub))
7323        }
7324
7325        /// Sets the full request, replacing any prior values.
7326        pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupRequest>>(
7327            mut self,
7328            v: V,
7329        ) -> Self {
7330            self.0.request = v.into();
7331            self
7332        }
7333
7334        /// Sets all the options, replacing any prior values.
7335        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7336            self.0.options = v.into();
7337            self
7338        }
7339
7340        /// Sends the request.
7341        pub async fn send(self) -> Result<crate::model::InterceptEndpointGroup> {
7342            (*self.0.stub)
7343                .get_intercept_endpoint_group(self.0.request, self.0.options)
7344                .await
7345                .map(crate::Response::into_body)
7346        }
7347
7348        /// Sets the value of [name][crate::model::GetInterceptEndpointGroupRequest::name].
7349        ///
7350        /// This is a **required** field for requests.
7351        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7352            self.0.request.name = v.into();
7353            self
7354        }
7355    }
7356
7357    #[doc(hidden)]
7358    impl crate::RequestBuilder for GetInterceptEndpointGroup {
7359        fn request_options(&mut self) -> &mut crate::RequestOptions {
7360            &mut self.0.options
7361        }
7362    }
7363
7364    /// The request builder for [Intercept::create_intercept_endpoint_group][crate::client::Intercept::create_intercept_endpoint_group] calls.
7365    ///
7366    /// # Example
7367    /// ```
7368    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptEndpointGroup;
7369    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7370    /// use google_cloud_lro::Poller;
7371    ///
7372    /// let builder = prepare_request_builder();
7373    /// let response = builder.poller().until_done().await?;
7374    /// # Ok(()) }
7375    ///
7376    /// fn prepare_request_builder() -> CreateInterceptEndpointGroup {
7377    ///   # panic!();
7378    ///   // ... details omitted ...
7379    /// }
7380    /// ```
7381    #[derive(Clone, Debug)]
7382    pub struct CreateInterceptEndpointGroup(
7383        RequestBuilder<crate::model::CreateInterceptEndpointGroupRequest>,
7384    );
7385
7386    impl CreateInterceptEndpointGroup {
7387        pub(crate) fn new(
7388            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7389        ) -> Self {
7390            Self(RequestBuilder::new(stub))
7391        }
7392
7393        /// Sets the full request, replacing any prior values.
7394        pub fn with_request<V: Into<crate::model::CreateInterceptEndpointGroupRequest>>(
7395            mut self,
7396            v: V,
7397        ) -> Self {
7398            self.0.request = v.into();
7399            self
7400        }
7401
7402        /// Sets all the options, replacing any prior values.
7403        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7404            self.0.options = v.into();
7405            self
7406        }
7407
7408        /// Sends the request.
7409        ///
7410        /// # Long running operations
7411        ///
7412        /// This starts, but does not poll, a longrunning operation. More information
7413        /// on [create_intercept_endpoint_group][crate::client::Intercept::create_intercept_endpoint_group].
7414        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7415            (*self.0.stub)
7416                .create_intercept_endpoint_group(self.0.request, self.0.options)
7417                .await
7418                .map(crate::Response::into_body)
7419        }
7420
7421        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_endpoint_group`.
7422        pub fn poller(
7423            self,
7424        ) -> impl google_cloud_lro::Poller<
7425            crate::model::InterceptEndpointGroup,
7426            crate::model::OperationMetadata,
7427        > {
7428            type Operation = google_cloud_lro::internal::Operation<
7429                crate::model::InterceptEndpointGroup,
7430                crate::model::OperationMetadata,
7431            >;
7432            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7433            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7434
7435            let stub = self.0.stub.clone();
7436            let mut options = self.0.options.clone();
7437            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7438            let query = move |name| {
7439                let stub = stub.clone();
7440                let options = options.clone();
7441                async {
7442                    let op = GetOperation::new(stub)
7443                        .set_name(name)
7444                        .with_options(options)
7445                        .send()
7446                        .await?;
7447                    Ok(Operation::new(op))
7448                }
7449            };
7450
7451            let start = move || async {
7452                let op = self.send().await?;
7453                Ok(Operation::new(op))
7454            };
7455
7456            google_cloud_lro::internal::new_poller(
7457                polling_error_policy,
7458                polling_backoff_policy,
7459                start,
7460                query,
7461            )
7462        }
7463
7464        /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupRequest::parent].
7465        ///
7466        /// This is a **required** field for requests.
7467        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7468            self.0.request.parent = v.into();
7469            self
7470        }
7471
7472        /// Sets the value of [intercept_endpoint_group_id][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group_id].
7473        ///
7474        /// This is a **required** field for requests.
7475        pub fn set_intercept_endpoint_group_id<T: Into<std::string::String>>(
7476            mut self,
7477            v: T,
7478        ) -> Self {
7479            self.0.request.intercept_endpoint_group_id = v.into();
7480            self
7481        }
7482
7483        /// Sets the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
7484        ///
7485        /// This is a **required** field for requests.
7486        pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
7487        where
7488            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7489        {
7490            self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
7491            self
7492        }
7493
7494        /// Sets or clears the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
7495        ///
7496        /// This is a **required** field for requests.
7497        pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
7498        where
7499            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7500        {
7501            self.0.request.intercept_endpoint_group = v.map(|x| x.into());
7502            self
7503        }
7504
7505        /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupRequest::request_id].
7506        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7507            self.0.request.request_id = v.into();
7508            self
7509        }
7510    }
7511
7512    #[doc(hidden)]
7513    impl crate::RequestBuilder for CreateInterceptEndpointGroup {
7514        fn request_options(&mut self) -> &mut crate::RequestOptions {
7515            &mut self.0.options
7516        }
7517    }
7518
7519    /// The request builder for [Intercept::update_intercept_endpoint_group][crate::client::Intercept::update_intercept_endpoint_group] calls.
7520    ///
7521    /// # Example
7522    /// ```
7523    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptEndpointGroup;
7524    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7525    /// use google_cloud_lro::Poller;
7526    ///
7527    /// let builder = prepare_request_builder();
7528    /// let response = builder.poller().until_done().await?;
7529    /// # Ok(()) }
7530    ///
7531    /// fn prepare_request_builder() -> UpdateInterceptEndpointGroup {
7532    ///   # panic!();
7533    ///   // ... details omitted ...
7534    /// }
7535    /// ```
7536    #[derive(Clone, Debug)]
7537    pub struct UpdateInterceptEndpointGroup(
7538        RequestBuilder<crate::model::UpdateInterceptEndpointGroupRequest>,
7539    );
7540
7541    impl UpdateInterceptEndpointGroup {
7542        pub(crate) fn new(
7543            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7544        ) -> Self {
7545            Self(RequestBuilder::new(stub))
7546        }
7547
7548        /// Sets the full request, replacing any prior values.
7549        pub fn with_request<V: Into<crate::model::UpdateInterceptEndpointGroupRequest>>(
7550            mut self,
7551            v: V,
7552        ) -> Self {
7553            self.0.request = v.into();
7554            self
7555        }
7556
7557        /// Sets all the options, replacing any prior values.
7558        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7559            self.0.options = v.into();
7560            self
7561        }
7562
7563        /// Sends the request.
7564        ///
7565        /// # Long running operations
7566        ///
7567        /// This starts, but does not poll, a longrunning operation. More information
7568        /// on [update_intercept_endpoint_group][crate::client::Intercept::update_intercept_endpoint_group].
7569        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7570            (*self.0.stub)
7571                .update_intercept_endpoint_group(self.0.request, self.0.options)
7572                .await
7573                .map(crate::Response::into_body)
7574        }
7575
7576        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_endpoint_group`.
7577        pub fn poller(
7578            self,
7579        ) -> impl google_cloud_lro::Poller<
7580            crate::model::InterceptEndpointGroup,
7581            crate::model::OperationMetadata,
7582        > {
7583            type Operation = google_cloud_lro::internal::Operation<
7584                crate::model::InterceptEndpointGroup,
7585                crate::model::OperationMetadata,
7586            >;
7587            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7588            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7589
7590            let stub = self.0.stub.clone();
7591            let mut options = self.0.options.clone();
7592            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7593            let query = move |name| {
7594                let stub = stub.clone();
7595                let options = options.clone();
7596                async {
7597                    let op = GetOperation::new(stub)
7598                        .set_name(name)
7599                        .with_options(options)
7600                        .send()
7601                        .await?;
7602                    Ok(Operation::new(op))
7603                }
7604            };
7605
7606            let start = move || async {
7607                let op = self.send().await?;
7608                Ok(Operation::new(op))
7609            };
7610
7611            google_cloud_lro::internal::new_poller(
7612                polling_error_policy,
7613                polling_backoff_policy,
7614                start,
7615                query,
7616            )
7617        }
7618
7619        /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
7620        pub fn set_update_mask<T>(mut self, v: T) -> Self
7621        where
7622            T: std::convert::Into<wkt::FieldMask>,
7623        {
7624            self.0.request.update_mask = std::option::Option::Some(v.into());
7625            self
7626        }
7627
7628        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
7629        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7630        where
7631            T: std::convert::Into<wkt::FieldMask>,
7632        {
7633            self.0.request.update_mask = v.map(|x| x.into());
7634            self
7635        }
7636
7637        /// Sets the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
7638        ///
7639        /// This is a **required** field for requests.
7640        pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
7641        where
7642            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7643        {
7644            self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
7645            self
7646        }
7647
7648        /// Sets or clears the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
7649        ///
7650        /// This is a **required** field for requests.
7651        pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
7652        where
7653            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7654        {
7655            self.0.request.intercept_endpoint_group = v.map(|x| x.into());
7656            self
7657        }
7658
7659        /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupRequest::request_id].
7660        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7661            self.0.request.request_id = v.into();
7662            self
7663        }
7664    }
7665
7666    #[doc(hidden)]
7667    impl crate::RequestBuilder for UpdateInterceptEndpointGroup {
7668        fn request_options(&mut self) -> &mut crate::RequestOptions {
7669            &mut self.0.options
7670        }
7671    }
7672
7673    /// The request builder for [Intercept::delete_intercept_endpoint_group][crate::client::Intercept::delete_intercept_endpoint_group] calls.
7674    ///
7675    /// # Example
7676    /// ```
7677    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptEndpointGroup;
7678    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7679    /// use google_cloud_lro::Poller;
7680    ///
7681    /// let builder = prepare_request_builder();
7682    /// let response = builder.poller().until_done().await?;
7683    /// # Ok(()) }
7684    ///
7685    /// fn prepare_request_builder() -> DeleteInterceptEndpointGroup {
7686    ///   # panic!();
7687    ///   // ... details omitted ...
7688    /// }
7689    /// ```
7690    #[derive(Clone, Debug)]
7691    pub struct DeleteInterceptEndpointGroup(
7692        RequestBuilder<crate::model::DeleteInterceptEndpointGroupRequest>,
7693    );
7694
7695    impl DeleteInterceptEndpointGroup {
7696        pub(crate) fn new(
7697            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7698        ) -> Self {
7699            Self(RequestBuilder::new(stub))
7700        }
7701
7702        /// Sets the full request, replacing any prior values.
7703        pub fn with_request<V: Into<crate::model::DeleteInterceptEndpointGroupRequest>>(
7704            mut self,
7705            v: V,
7706        ) -> Self {
7707            self.0.request = v.into();
7708            self
7709        }
7710
7711        /// Sets all the options, replacing any prior values.
7712        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7713            self.0.options = v.into();
7714            self
7715        }
7716
7717        /// Sends the request.
7718        ///
7719        /// # Long running operations
7720        ///
7721        /// This starts, but does not poll, a longrunning operation. More information
7722        /// on [delete_intercept_endpoint_group][crate::client::Intercept::delete_intercept_endpoint_group].
7723        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7724            (*self.0.stub)
7725                .delete_intercept_endpoint_group(self.0.request, self.0.options)
7726                .await
7727                .map(crate::Response::into_body)
7728        }
7729
7730        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_endpoint_group`.
7731        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7732            type Operation =
7733                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7734            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7735            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7736
7737            let stub = self.0.stub.clone();
7738            let mut options = self.0.options.clone();
7739            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7740            let query = move |name| {
7741                let stub = stub.clone();
7742                let options = options.clone();
7743                async {
7744                    let op = GetOperation::new(stub)
7745                        .set_name(name)
7746                        .with_options(options)
7747                        .send()
7748                        .await?;
7749                    Ok(Operation::new(op))
7750                }
7751            };
7752
7753            let start = move || async {
7754                let op = self.send().await?;
7755                Ok(Operation::new(op))
7756            };
7757
7758            google_cloud_lro::internal::new_unit_response_poller(
7759                polling_error_policy,
7760                polling_backoff_policy,
7761                start,
7762                query,
7763            )
7764        }
7765
7766        /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupRequest::name].
7767        ///
7768        /// This is a **required** field for requests.
7769        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7770            self.0.request.name = v.into();
7771            self
7772        }
7773
7774        /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupRequest::request_id].
7775        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7776            self.0.request.request_id = v.into();
7777            self
7778        }
7779    }
7780
7781    #[doc(hidden)]
7782    impl crate::RequestBuilder for DeleteInterceptEndpointGroup {
7783        fn request_options(&mut self) -> &mut crate::RequestOptions {
7784            &mut self.0.options
7785        }
7786    }
7787
7788    /// The request builder for [Intercept::list_intercept_endpoint_group_associations][crate::client::Intercept::list_intercept_endpoint_group_associations] calls.
7789    ///
7790    /// # Example
7791    /// ```
7792    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptEndpointGroupAssociations;
7793    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7794    /// use google_cloud_gax::paginator::ItemPaginator;
7795    ///
7796    /// let builder = prepare_request_builder();
7797    /// let mut items = builder.by_item();
7798    /// while let Some(result) = items.next().await {
7799    ///   let item = result?;
7800    /// }
7801    /// # Ok(()) }
7802    ///
7803    /// fn prepare_request_builder() -> ListInterceptEndpointGroupAssociations {
7804    ///   # panic!();
7805    ///   // ... details omitted ...
7806    /// }
7807    /// ```
7808    #[derive(Clone, Debug)]
7809    pub struct ListInterceptEndpointGroupAssociations(
7810        RequestBuilder<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
7811    );
7812
7813    impl ListInterceptEndpointGroupAssociations {
7814        pub(crate) fn new(
7815            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7816        ) -> Self {
7817            Self(RequestBuilder::new(stub))
7818        }
7819
7820        /// Sets the full request, replacing any prior values.
7821        pub fn with_request<
7822            V: Into<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
7823        >(
7824            mut self,
7825            v: V,
7826        ) -> Self {
7827            self.0.request = v.into();
7828            self
7829        }
7830
7831        /// Sets all the options, replacing any prior values.
7832        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7833            self.0.options = v.into();
7834            self
7835        }
7836
7837        /// Sends the request.
7838        pub async fn send(
7839            self,
7840        ) -> Result<crate::model::ListInterceptEndpointGroupAssociationsResponse> {
7841            (*self.0.stub)
7842                .list_intercept_endpoint_group_associations(self.0.request, self.0.options)
7843                .await
7844                .map(crate::Response::into_body)
7845        }
7846
7847        /// Streams each page in the collection.
7848        pub fn by_page(
7849            self,
7850        ) -> impl google_cloud_gax::paginator::Paginator<
7851            crate::model::ListInterceptEndpointGroupAssociationsResponse,
7852            crate::Error,
7853        > {
7854            use std::clone::Clone;
7855            let token = self.0.request.page_token.clone();
7856            let execute = move |token: String| {
7857                let mut builder = self.clone();
7858                builder.0.request = builder.0.request.set_page_token(token);
7859                builder.send()
7860            };
7861            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7862        }
7863
7864        /// Streams each item in the collection.
7865        pub fn by_item(
7866            self,
7867        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7868            crate::model::ListInterceptEndpointGroupAssociationsResponse,
7869            crate::Error,
7870        > {
7871            use google_cloud_gax::paginator::Paginator;
7872            self.by_page().items()
7873        }
7874
7875        /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupAssociationsRequest::parent].
7876        ///
7877        /// This is a **required** field for requests.
7878        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7879            self.0.request.parent = v.into();
7880            self
7881        }
7882
7883        /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_size].
7884        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7885            self.0.request.page_size = v.into();
7886            self
7887        }
7888
7889        /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_token].
7890        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7891            self.0.request.page_token = v.into();
7892            self
7893        }
7894
7895        /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupAssociationsRequest::filter].
7896        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7897            self.0.request.filter = v.into();
7898            self
7899        }
7900
7901        /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupAssociationsRequest::order_by].
7902        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7903            self.0.request.order_by = v.into();
7904            self
7905        }
7906    }
7907
7908    #[doc(hidden)]
7909    impl crate::RequestBuilder for ListInterceptEndpointGroupAssociations {
7910        fn request_options(&mut self) -> &mut crate::RequestOptions {
7911            &mut self.0.options
7912        }
7913    }
7914
7915    /// The request builder for [Intercept::get_intercept_endpoint_group_association][crate::client::Intercept::get_intercept_endpoint_group_association] calls.
7916    ///
7917    /// # Example
7918    /// ```
7919    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptEndpointGroupAssociation;
7920    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7921    ///
7922    /// let builder = prepare_request_builder();
7923    /// let response = builder.send().await?;
7924    /// # Ok(()) }
7925    ///
7926    /// fn prepare_request_builder() -> GetInterceptEndpointGroupAssociation {
7927    ///   # panic!();
7928    ///   // ... details omitted ...
7929    /// }
7930    /// ```
7931    #[derive(Clone, Debug)]
7932    pub struct GetInterceptEndpointGroupAssociation(
7933        RequestBuilder<crate::model::GetInterceptEndpointGroupAssociationRequest>,
7934    );
7935
7936    impl GetInterceptEndpointGroupAssociation {
7937        pub(crate) fn new(
7938            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7939        ) -> Self {
7940            Self(RequestBuilder::new(stub))
7941        }
7942
7943        /// Sets the full request, replacing any prior values.
7944        pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupAssociationRequest>>(
7945            mut self,
7946            v: V,
7947        ) -> Self {
7948            self.0.request = v.into();
7949            self
7950        }
7951
7952        /// Sets all the options, replacing any prior values.
7953        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7954            self.0.options = v.into();
7955            self
7956        }
7957
7958        /// Sends the request.
7959        pub async fn send(self) -> Result<crate::model::InterceptEndpointGroupAssociation> {
7960            (*self.0.stub)
7961                .get_intercept_endpoint_group_association(self.0.request, self.0.options)
7962                .await
7963                .map(crate::Response::into_body)
7964        }
7965
7966        /// Sets the value of [name][crate::model::GetInterceptEndpointGroupAssociationRequest::name].
7967        ///
7968        /// This is a **required** field for requests.
7969        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7970            self.0.request.name = v.into();
7971            self
7972        }
7973    }
7974
7975    #[doc(hidden)]
7976    impl crate::RequestBuilder for GetInterceptEndpointGroupAssociation {
7977        fn request_options(&mut self) -> &mut crate::RequestOptions {
7978            &mut self.0.options
7979        }
7980    }
7981
7982    /// The request builder for [Intercept::create_intercept_endpoint_group_association][crate::client::Intercept::create_intercept_endpoint_group_association] calls.
7983    ///
7984    /// # Example
7985    /// ```
7986    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptEndpointGroupAssociation;
7987    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7988    /// use google_cloud_lro::Poller;
7989    ///
7990    /// let builder = prepare_request_builder();
7991    /// let response = builder.poller().until_done().await?;
7992    /// # Ok(()) }
7993    ///
7994    /// fn prepare_request_builder() -> CreateInterceptEndpointGroupAssociation {
7995    ///   # panic!();
7996    ///   // ... details omitted ...
7997    /// }
7998    /// ```
7999    #[derive(Clone, Debug)]
8000    pub struct CreateInterceptEndpointGroupAssociation(
8001        RequestBuilder<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
8002    );
8003
8004    impl CreateInterceptEndpointGroupAssociation {
8005        pub(crate) fn new(
8006            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8007        ) -> Self {
8008            Self(RequestBuilder::new(stub))
8009        }
8010
8011        /// Sets the full request, replacing any prior values.
8012        pub fn with_request<
8013            V: Into<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
8014        >(
8015            mut self,
8016            v: V,
8017        ) -> Self {
8018            self.0.request = v.into();
8019            self
8020        }
8021
8022        /// Sets all the options, replacing any prior values.
8023        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8024            self.0.options = v.into();
8025            self
8026        }
8027
8028        /// Sends the request.
8029        ///
8030        /// # Long running operations
8031        ///
8032        /// This starts, but does not poll, a longrunning operation. More information
8033        /// on [create_intercept_endpoint_group_association][crate::client::Intercept::create_intercept_endpoint_group_association].
8034        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8035            (*self.0.stub)
8036                .create_intercept_endpoint_group_association(self.0.request, self.0.options)
8037                .await
8038                .map(crate::Response::into_body)
8039        }
8040
8041        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_endpoint_group_association`.
8042        pub fn poller(
8043            self,
8044        ) -> impl google_cloud_lro::Poller<
8045            crate::model::InterceptEndpointGroupAssociation,
8046            crate::model::OperationMetadata,
8047        > {
8048            type Operation = google_cloud_lro::internal::Operation<
8049                crate::model::InterceptEndpointGroupAssociation,
8050                crate::model::OperationMetadata,
8051            >;
8052            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8053            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8054
8055            let stub = self.0.stub.clone();
8056            let mut options = self.0.options.clone();
8057            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8058            let query = move |name| {
8059                let stub = stub.clone();
8060                let options = options.clone();
8061                async {
8062                    let op = GetOperation::new(stub)
8063                        .set_name(name)
8064                        .with_options(options)
8065                        .send()
8066                        .await?;
8067                    Ok(Operation::new(op))
8068                }
8069            };
8070
8071            let start = move || async {
8072                let op = self.send().await?;
8073                Ok(Operation::new(op))
8074            };
8075
8076            google_cloud_lro::internal::new_poller(
8077                polling_error_policy,
8078                polling_backoff_policy,
8079                start,
8080                query,
8081            )
8082        }
8083
8084        /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupAssociationRequest::parent].
8085        ///
8086        /// This is a **required** field for requests.
8087        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8088            self.0.request.parent = v.into();
8089            self
8090        }
8091
8092        /// Sets the value of [intercept_endpoint_group_association_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association_id].
8093        pub fn set_intercept_endpoint_group_association_id<T: Into<std::string::String>>(
8094            mut self,
8095            v: T,
8096        ) -> Self {
8097            self.0.request.intercept_endpoint_group_association_id = v.into();
8098            self
8099        }
8100
8101        /// Sets the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
8102        ///
8103        /// This is a **required** field for requests.
8104        pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
8105        where
8106            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8107        {
8108            self.0.request.intercept_endpoint_group_association =
8109                std::option::Option::Some(v.into());
8110            self
8111        }
8112
8113        /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
8114        ///
8115        /// This is a **required** field for requests.
8116        pub fn set_or_clear_intercept_endpoint_group_association<T>(
8117            mut self,
8118            v: std::option::Option<T>,
8119        ) -> Self
8120        where
8121            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8122        {
8123            self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
8124            self
8125        }
8126
8127        /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::request_id].
8128        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8129            self.0.request.request_id = v.into();
8130            self
8131        }
8132    }
8133
8134    #[doc(hidden)]
8135    impl crate::RequestBuilder for CreateInterceptEndpointGroupAssociation {
8136        fn request_options(&mut self) -> &mut crate::RequestOptions {
8137            &mut self.0.options
8138        }
8139    }
8140
8141    /// The request builder for [Intercept::update_intercept_endpoint_group_association][crate::client::Intercept::update_intercept_endpoint_group_association] calls.
8142    ///
8143    /// # Example
8144    /// ```
8145    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptEndpointGroupAssociation;
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() -> UpdateInterceptEndpointGroupAssociation {
8154    ///   # panic!();
8155    ///   // ... details omitted ...
8156    /// }
8157    /// ```
8158    #[derive(Clone, Debug)]
8159    pub struct UpdateInterceptEndpointGroupAssociation(
8160        RequestBuilder<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8161    );
8162
8163    impl UpdateInterceptEndpointGroupAssociation {
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<
8172            V: Into<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8173        >(
8174            mut self,
8175            v: V,
8176        ) -> Self {
8177            self.0.request = v.into();
8178            self
8179        }
8180
8181        /// Sets all the options, replacing any prior values.
8182        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8183            self.0.options = v.into();
8184            self
8185        }
8186
8187        /// Sends the request.
8188        ///
8189        /// # Long running operations
8190        ///
8191        /// This starts, but does not poll, a longrunning operation. More information
8192        /// on [update_intercept_endpoint_group_association][crate::client::Intercept::update_intercept_endpoint_group_association].
8193        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8194            (*self.0.stub)
8195                .update_intercept_endpoint_group_association(self.0.request, self.0.options)
8196                .await
8197                .map(crate::Response::into_body)
8198        }
8199
8200        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_endpoint_group_association`.
8201        pub fn poller(
8202            self,
8203        ) -> impl google_cloud_lro::Poller<
8204            crate::model::InterceptEndpointGroupAssociation,
8205            crate::model::OperationMetadata,
8206        > {
8207            type Operation = google_cloud_lro::internal::Operation<
8208                crate::model::InterceptEndpointGroupAssociation,
8209                crate::model::OperationMetadata,
8210            >;
8211            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8212            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8213
8214            let stub = self.0.stub.clone();
8215            let mut options = self.0.options.clone();
8216            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8217            let query = move |name| {
8218                let stub = stub.clone();
8219                let options = options.clone();
8220                async {
8221                    let op = GetOperation::new(stub)
8222                        .set_name(name)
8223                        .with_options(options)
8224                        .send()
8225                        .await?;
8226                    Ok(Operation::new(op))
8227                }
8228            };
8229
8230            let start = move || async {
8231                let op = self.send().await?;
8232                Ok(Operation::new(op))
8233            };
8234
8235            google_cloud_lro::internal::new_poller(
8236                polling_error_policy,
8237                polling_backoff_policy,
8238                start,
8239                query,
8240            )
8241        }
8242
8243        /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
8244        pub fn set_update_mask<T>(mut self, v: T) -> Self
8245        where
8246            T: std::convert::Into<wkt::FieldMask>,
8247        {
8248            self.0.request.update_mask = std::option::Option::Some(v.into());
8249            self
8250        }
8251
8252        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
8253        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8254        where
8255            T: std::convert::Into<wkt::FieldMask>,
8256        {
8257            self.0.request.update_mask = v.map(|x| x.into());
8258            self
8259        }
8260
8261        /// Sets the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
8262        ///
8263        /// This is a **required** field for requests.
8264        pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
8265        where
8266            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8267        {
8268            self.0.request.intercept_endpoint_group_association =
8269                std::option::Option::Some(v.into());
8270            self
8271        }
8272
8273        /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
8274        ///
8275        /// This is a **required** field for requests.
8276        pub fn set_or_clear_intercept_endpoint_group_association<T>(
8277            mut self,
8278            v: std::option::Option<T>,
8279        ) -> Self
8280        where
8281            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8282        {
8283            self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
8284            self
8285        }
8286
8287        /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupAssociationRequest::request_id].
8288        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8289            self.0.request.request_id = v.into();
8290            self
8291        }
8292    }
8293
8294    #[doc(hidden)]
8295    impl crate::RequestBuilder for UpdateInterceptEndpointGroupAssociation {
8296        fn request_options(&mut self) -> &mut crate::RequestOptions {
8297            &mut self.0.options
8298        }
8299    }
8300
8301    /// The request builder for [Intercept::delete_intercept_endpoint_group_association][crate::client::Intercept::delete_intercept_endpoint_group_association] calls.
8302    ///
8303    /// # Example
8304    /// ```
8305    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptEndpointGroupAssociation;
8306    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8307    /// use google_cloud_lro::Poller;
8308    ///
8309    /// let builder = prepare_request_builder();
8310    /// let response = builder.poller().until_done().await?;
8311    /// # Ok(()) }
8312    ///
8313    /// fn prepare_request_builder() -> DeleteInterceptEndpointGroupAssociation {
8314    ///   # panic!();
8315    ///   // ... details omitted ...
8316    /// }
8317    /// ```
8318    #[derive(Clone, Debug)]
8319    pub struct DeleteInterceptEndpointGroupAssociation(
8320        RequestBuilder<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
8321    );
8322
8323    impl DeleteInterceptEndpointGroupAssociation {
8324        pub(crate) fn new(
8325            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8326        ) -> Self {
8327            Self(RequestBuilder::new(stub))
8328        }
8329
8330        /// Sets the full request, replacing any prior values.
8331        pub fn with_request<
8332            V: Into<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
8333        >(
8334            mut self,
8335            v: V,
8336        ) -> Self {
8337            self.0.request = v.into();
8338            self
8339        }
8340
8341        /// Sets all the options, replacing any prior values.
8342        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8343            self.0.options = v.into();
8344            self
8345        }
8346
8347        /// Sends the request.
8348        ///
8349        /// # Long running operations
8350        ///
8351        /// This starts, but does not poll, a longrunning operation. More information
8352        /// on [delete_intercept_endpoint_group_association][crate::client::Intercept::delete_intercept_endpoint_group_association].
8353        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8354            (*self.0.stub)
8355                .delete_intercept_endpoint_group_association(self.0.request, self.0.options)
8356                .await
8357                .map(crate::Response::into_body)
8358        }
8359
8360        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_endpoint_group_association`.
8361        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
8362            type Operation =
8363                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8364            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8365            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8366
8367            let stub = self.0.stub.clone();
8368            let mut options = self.0.options.clone();
8369            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8370            let query = move |name| {
8371                let stub = stub.clone();
8372                let options = options.clone();
8373                async {
8374                    let op = GetOperation::new(stub)
8375                        .set_name(name)
8376                        .with_options(options)
8377                        .send()
8378                        .await?;
8379                    Ok(Operation::new(op))
8380                }
8381            };
8382
8383            let start = move || async {
8384                let op = self.send().await?;
8385                Ok(Operation::new(op))
8386            };
8387
8388            google_cloud_lro::internal::new_unit_response_poller(
8389                polling_error_policy,
8390                polling_backoff_policy,
8391                start,
8392                query,
8393            )
8394        }
8395
8396        /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupAssociationRequest::name].
8397        ///
8398        /// This is a **required** field for requests.
8399        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8400            self.0.request.name = v.into();
8401            self
8402        }
8403
8404        /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupAssociationRequest::request_id].
8405        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8406            self.0.request.request_id = v.into();
8407            self
8408        }
8409    }
8410
8411    #[doc(hidden)]
8412    impl crate::RequestBuilder for DeleteInterceptEndpointGroupAssociation {
8413        fn request_options(&mut self) -> &mut crate::RequestOptions {
8414            &mut self.0.options
8415        }
8416    }
8417
8418    /// The request builder for [Intercept::list_intercept_deployment_groups][crate::client::Intercept::list_intercept_deployment_groups] calls.
8419    ///
8420    /// # Example
8421    /// ```
8422    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptDeploymentGroups;
8423    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8424    /// use google_cloud_gax::paginator::ItemPaginator;
8425    ///
8426    /// let builder = prepare_request_builder();
8427    /// let mut items = builder.by_item();
8428    /// while let Some(result) = items.next().await {
8429    ///   let item = result?;
8430    /// }
8431    /// # Ok(()) }
8432    ///
8433    /// fn prepare_request_builder() -> ListInterceptDeploymentGroups {
8434    ///   # panic!();
8435    ///   // ... details omitted ...
8436    /// }
8437    /// ```
8438    #[derive(Clone, Debug)]
8439    pub struct ListInterceptDeploymentGroups(
8440        RequestBuilder<crate::model::ListInterceptDeploymentGroupsRequest>,
8441    );
8442
8443    impl ListInterceptDeploymentGroups {
8444        pub(crate) fn new(
8445            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8446        ) -> Self {
8447            Self(RequestBuilder::new(stub))
8448        }
8449
8450        /// Sets the full request, replacing any prior values.
8451        pub fn with_request<V: Into<crate::model::ListInterceptDeploymentGroupsRequest>>(
8452            mut self,
8453            v: V,
8454        ) -> Self {
8455            self.0.request = v.into();
8456            self
8457        }
8458
8459        /// Sets all the options, replacing any prior values.
8460        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8461            self.0.options = v.into();
8462            self
8463        }
8464
8465        /// Sends the request.
8466        pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentGroupsResponse> {
8467            (*self.0.stub)
8468                .list_intercept_deployment_groups(self.0.request, self.0.options)
8469                .await
8470                .map(crate::Response::into_body)
8471        }
8472
8473        /// Streams each page in the collection.
8474        pub fn by_page(
8475            self,
8476        ) -> impl google_cloud_gax::paginator::Paginator<
8477            crate::model::ListInterceptDeploymentGroupsResponse,
8478            crate::Error,
8479        > {
8480            use std::clone::Clone;
8481            let token = self.0.request.page_token.clone();
8482            let execute = move |token: String| {
8483                let mut builder = self.clone();
8484                builder.0.request = builder.0.request.set_page_token(token);
8485                builder.send()
8486            };
8487            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8488        }
8489
8490        /// Streams each item in the collection.
8491        pub fn by_item(
8492            self,
8493        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8494            crate::model::ListInterceptDeploymentGroupsResponse,
8495            crate::Error,
8496        > {
8497            use google_cloud_gax::paginator::Paginator;
8498            self.by_page().items()
8499        }
8500
8501        /// Sets the value of [parent][crate::model::ListInterceptDeploymentGroupsRequest::parent].
8502        ///
8503        /// This is a **required** field for requests.
8504        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8505            self.0.request.parent = v.into();
8506            self
8507        }
8508
8509        /// Sets the value of [page_size][crate::model::ListInterceptDeploymentGroupsRequest::page_size].
8510        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8511            self.0.request.page_size = v.into();
8512            self
8513        }
8514
8515        /// Sets the value of [page_token][crate::model::ListInterceptDeploymentGroupsRequest::page_token].
8516        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8517            self.0.request.page_token = v.into();
8518            self
8519        }
8520
8521        /// Sets the value of [filter][crate::model::ListInterceptDeploymentGroupsRequest::filter].
8522        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8523            self.0.request.filter = v.into();
8524            self
8525        }
8526
8527        /// Sets the value of [order_by][crate::model::ListInterceptDeploymentGroupsRequest::order_by].
8528        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8529            self.0.request.order_by = v.into();
8530            self
8531        }
8532    }
8533
8534    #[doc(hidden)]
8535    impl crate::RequestBuilder for ListInterceptDeploymentGroups {
8536        fn request_options(&mut self) -> &mut crate::RequestOptions {
8537            &mut self.0.options
8538        }
8539    }
8540
8541    /// The request builder for [Intercept::get_intercept_deployment_group][crate::client::Intercept::get_intercept_deployment_group] calls.
8542    ///
8543    /// # Example
8544    /// ```
8545    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptDeploymentGroup;
8546    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8547    ///
8548    /// let builder = prepare_request_builder();
8549    /// let response = builder.send().await?;
8550    /// # Ok(()) }
8551    ///
8552    /// fn prepare_request_builder() -> GetInterceptDeploymentGroup {
8553    ///   # panic!();
8554    ///   // ... details omitted ...
8555    /// }
8556    /// ```
8557    #[derive(Clone, Debug)]
8558    pub struct GetInterceptDeploymentGroup(
8559        RequestBuilder<crate::model::GetInterceptDeploymentGroupRequest>,
8560    );
8561
8562    impl GetInterceptDeploymentGroup {
8563        pub(crate) fn new(
8564            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8565        ) -> Self {
8566            Self(RequestBuilder::new(stub))
8567        }
8568
8569        /// Sets the full request, replacing any prior values.
8570        pub fn with_request<V: Into<crate::model::GetInterceptDeploymentGroupRequest>>(
8571            mut self,
8572            v: V,
8573        ) -> Self {
8574            self.0.request = v.into();
8575            self
8576        }
8577
8578        /// Sets all the options, replacing any prior values.
8579        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8580            self.0.options = v.into();
8581            self
8582        }
8583
8584        /// Sends the request.
8585        pub async fn send(self) -> Result<crate::model::InterceptDeploymentGroup> {
8586            (*self.0.stub)
8587                .get_intercept_deployment_group(self.0.request, self.0.options)
8588                .await
8589                .map(crate::Response::into_body)
8590        }
8591
8592        /// Sets the value of [name][crate::model::GetInterceptDeploymentGroupRequest::name].
8593        ///
8594        /// This is a **required** field for requests.
8595        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8596            self.0.request.name = v.into();
8597            self
8598        }
8599    }
8600
8601    #[doc(hidden)]
8602    impl crate::RequestBuilder for GetInterceptDeploymentGroup {
8603        fn request_options(&mut self) -> &mut crate::RequestOptions {
8604            &mut self.0.options
8605        }
8606    }
8607
8608    /// The request builder for [Intercept::create_intercept_deployment_group][crate::client::Intercept::create_intercept_deployment_group] calls.
8609    ///
8610    /// # Example
8611    /// ```
8612    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptDeploymentGroup;
8613    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8614    /// use google_cloud_lro::Poller;
8615    ///
8616    /// let builder = prepare_request_builder();
8617    /// let response = builder.poller().until_done().await?;
8618    /// # Ok(()) }
8619    ///
8620    /// fn prepare_request_builder() -> CreateInterceptDeploymentGroup {
8621    ///   # panic!();
8622    ///   // ... details omitted ...
8623    /// }
8624    /// ```
8625    #[derive(Clone, Debug)]
8626    pub struct CreateInterceptDeploymentGroup(
8627        RequestBuilder<crate::model::CreateInterceptDeploymentGroupRequest>,
8628    );
8629
8630    impl CreateInterceptDeploymentGroup {
8631        pub(crate) fn new(
8632            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8633        ) -> Self {
8634            Self(RequestBuilder::new(stub))
8635        }
8636
8637        /// Sets the full request, replacing any prior values.
8638        pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentGroupRequest>>(
8639            mut self,
8640            v: V,
8641        ) -> Self {
8642            self.0.request = v.into();
8643            self
8644        }
8645
8646        /// Sets all the options, replacing any prior values.
8647        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8648            self.0.options = v.into();
8649            self
8650        }
8651
8652        /// Sends the request.
8653        ///
8654        /// # Long running operations
8655        ///
8656        /// This starts, but does not poll, a longrunning operation. More information
8657        /// on [create_intercept_deployment_group][crate::client::Intercept::create_intercept_deployment_group].
8658        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8659            (*self.0.stub)
8660                .create_intercept_deployment_group(self.0.request, self.0.options)
8661                .await
8662                .map(crate::Response::into_body)
8663        }
8664
8665        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_deployment_group`.
8666        pub fn poller(
8667            self,
8668        ) -> impl google_cloud_lro::Poller<
8669            crate::model::InterceptDeploymentGroup,
8670            crate::model::OperationMetadata,
8671        > {
8672            type Operation = google_cloud_lro::internal::Operation<
8673                crate::model::InterceptDeploymentGroup,
8674                crate::model::OperationMetadata,
8675            >;
8676            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8677            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8678
8679            let stub = self.0.stub.clone();
8680            let mut options = self.0.options.clone();
8681            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8682            let query = move |name| {
8683                let stub = stub.clone();
8684                let options = options.clone();
8685                async {
8686                    let op = GetOperation::new(stub)
8687                        .set_name(name)
8688                        .with_options(options)
8689                        .send()
8690                        .await?;
8691                    Ok(Operation::new(op))
8692                }
8693            };
8694
8695            let start = move || async {
8696                let op = self.send().await?;
8697                Ok(Operation::new(op))
8698            };
8699
8700            google_cloud_lro::internal::new_poller(
8701                polling_error_policy,
8702                polling_backoff_policy,
8703                start,
8704                query,
8705            )
8706        }
8707
8708        /// Sets the value of [parent][crate::model::CreateInterceptDeploymentGroupRequest::parent].
8709        ///
8710        /// This is a **required** field for requests.
8711        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8712            self.0.request.parent = v.into();
8713            self
8714        }
8715
8716        /// Sets the value of [intercept_deployment_group_id][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group_id].
8717        ///
8718        /// This is a **required** field for requests.
8719        pub fn set_intercept_deployment_group_id<T: Into<std::string::String>>(
8720            mut self,
8721            v: T,
8722        ) -> Self {
8723            self.0.request.intercept_deployment_group_id = v.into();
8724            self
8725        }
8726
8727        /// Sets the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
8728        ///
8729        /// This is a **required** field for requests.
8730        pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
8731        where
8732            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8733        {
8734            self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
8735            self
8736        }
8737
8738        /// Sets or clears the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
8739        ///
8740        /// This is a **required** field for requests.
8741        pub fn set_or_clear_intercept_deployment_group<T>(
8742            mut self,
8743            v: std::option::Option<T>,
8744        ) -> Self
8745        where
8746            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8747        {
8748            self.0.request.intercept_deployment_group = v.map(|x| x.into());
8749            self
8750        }
8751
8752        /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentGroupRequest::request_id].
8753        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8754            self.0.request.request_id = v.into();
8755            self
8756        }
8757    }
8758
8759    #[doc(hidden)]
8760    impl crate::RequestBuilder for CreateInterceptDeploymentGroup {
8761        fn request_options(&mut self) -> &mut crate::RequestOptions {
8762            &mut self.0.options
8763        }
8764    }
8765
8766    /// The request builder for [Intercept::update_intercept_deployment_group][crate::client::Intercept::update_intercept_deployment_group] calls.
8767    ///
8768    /// # Example
8769    /// ```
8770    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptDeploymentGroup;
8771    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8772    /// use google_cloud_lro::Poller;
8773    ///
8774    /// let builder = prepare_request_builder();
8775    /// let response = builder.poller().until_done().await?;
8776    /// # Ok(()) }
8777    ///
8778    /// fn prepare_request_builder() -> UpdateInterceptDeploymentGroup {
8779    ///   # panic!();
8780    ///   // ... details omitted ...
8781    /// }
8782    /// ```
8783    #[derive(Clone, Debug)]
8784    pub struct UpdateInterceptDeploymentGroup(
8785        RequestBuilder<crate::model::UpdateInterceptDeploymentGroupRequest>,
8786    );
8787
8788    impl UpdateInterceptDeploymentGroup {
8789        pub(crate) fn new(
8790            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8791        ) -> Self {
8792            Self(RequestBuilder::new(stub))
8793        }
8794
8795        /// Sets the full request, replacing any prior values.
8796        pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentGroupRequest>>(
8797            mut self,
8798            v: V,
8799        ) -> Self {
8800            self.0.request = v.into();
8801            self
8802        }
8803
8804        /// Sets all the options, replacing any prior values.
8805        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8806            self.0.options = v.into();
8807            self
8808        }
8809
8810        /// Sends the request.
8811        ///
8812        /// # Long running operations
8813        ///
8814        /// This starts, but does not poll, a longrunning operation. More information
8815        /// on [update_intercept_deployment_group][crate::client::Intercept::update_intercept_deployment_group].
8816        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8817            (*self.0.stub)
8818                .update_intercept_deployment_group(self.0.request, self.0.options)
8819                .await
8820                .map(crate::Response::into_body)
8821        }
8822
8823        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_deployment_group`.
8824        pub fn poller(
8825            self,
8826        ) -> impl google_cloud_lro::Poller<
8827            crate::model::InterceptDeploymentGroup,
8828            crate::model::OperationMetadata,
8829        > {
8830            type Operation = google_cloud_lro::internal::Operation<
8831                crate::model::InterceptDeploymentGroup,
8832                crate::model::OperationMetadata,
8833            >;
8834            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8835            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8836
8837            let stub = self.0.stub.clone();
8838            let mut options = self.0.options.clone();
8839            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8840            let query = move |name| {
8841                let stub = stub.clone();
8842                let options = options.clone();
8843                async {
8844                    let op = GetOperation::new(stub)
8845                        .set_name(name)
8846                        .with_options(options)
8847                        .send()
8848                        .await?;
8849                    Ok(Operation::new(op))
8850                }
8851            };
8852
8853            let start = move || async {
8854                let op = self.send().await?;
8855                Ok(Operation::new(op))
8856            };
8857
8858            google_cloud_lro::internal::new_poller(
8859                polling_error_policy,
8860                polling_backoff_policy,
8861                start,
8862                query,
8863            )
8864        }
8865
8866        /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
8867        pub fn set_update_mask<T>(mut self, v: T) -> Self
8868        where
8869            T: std::convert::Into<wkt::FieldMask>,
8870        {
8871            self.0.request.update_mask = std::option::Option::Some(v.into());
8872            self
8873        }
8874
8875        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
8876        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8877        where
8878            T: std::convert::Into<wkt::FieldMask>,
8879        {
8880            self.0.request.update_mask = v.map(|x| x.into());
8881            self
8882        }
8883
8884        /// Sets the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
8885        ///
8886        /// This is a **required** field for requests.
8887        pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
8888        where
8889            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8890        {
8891            self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
8892            self
8893        }
8894
8895        /// Sets or clears the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
8896        ///
8897        /// This is a **required** field for requests.
8898        pub fn set_or_clear_intercept_deployment_group<T>(
8899            mut self,
8900            v: std::option::Option<T>,
8901        ) -> Self
8902        where
8903            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8904        {
8905            self.0.request.intercept_deployment_group = v.map(|x| x.into());
8906            self
8907        }
8908
8909        /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentGroupRequest::request_id].
8910        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8911            self.0.request.request_id = v.into();
8912            self
8913        }
8914    }
8915
8916    #[doc(hidden)]
8917    impl crate::RequestBuilder for UpdateInterceptDeploymentGroup {
8918        fn request_options(&mut self) -> &mut crate::RequestOptions {
8919            &mut self.0.options
8920        }
8921    }
8922
8923    /// The request builder for [Intercept::delete_intercept_deployment_group][crate::client::Intercept::delete_intercept_deployment_group] calls.
8924    ///
8925    /// # Example
8926    /// ```
8927    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptDeploymentGroup;
8928    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8929    /// use google_cloud_lro::Poller;
8930    ///
8931    /// let builder = prepare_request_builder();
8932    /// let response = builder.poller().until_done().await?;
8933    /// # Ok(()) }
8934    ///
8935    /// fn prepare_request_builder() -> DeleteInterceptDeploymentGroup {
8936    ///   # panic!();
8937    ///   // ... details omitted ...
8938    /// }
8939    /// ```
8940    #[derive(Clone, Debug)]
8941    pub struct DeleteInterceptDeploymentGroup(
8942        RequestBuilder<crate::model::DeleteInterceptDeploymentGroupRequest>,
8943    );
8944
8945    impl DeleteInterceptDeploymentGroup {
8946        pub(crate) fn new(
8947            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8948        ) -> Self {
8949            Self(RequestBuilder::new(stub))
8950        }
8951
8952        /// Sets the full request, replacing any prior values.
8953        pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentGroupRequest>>(
8954            mut self,
8955            v: V,
8956        ) -> Self {
8957            self.0.request = v.into();
8958            self
8959        }
8960
8961        /// Sets all the options, replacing any prior values.
8962        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8963            self.0.options = v.into();
8964            self
8965        }
8966
8967        /// Sends the request.
8968        ///
8969        /// # Long running operations
8970        ///
8971        /// This starts, but does not poll, a longrunning operation. More information
8972        /// on [delete_intercept_deployment_group][crate::client::Intercept::delete_intercept_deployment_group].
8973        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8974            (*self.0.stub)
8975                .delete_intercept_deployment_group(self.0.request, self.0.options)
8976                .await
8977                .map(crate::Response::into_body)
8978        }
8979
8980        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_deployment_group`.
8981        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
8982            type Operation =
8983                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8984            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8985            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8986
8987            let stub = self.0.stub.clone();
8988            let mut options = self.0.options.clone();
8989            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8990            let query = move |name| {
8991                let stub = stub.clone();
8992                let options = options.clone();
8993                async {
8994                    let op = GetOperation::new(stub)
8995                        .set_name(name)
8996                        .with_options(options)
8997                        .send()
8998                        .await?;
8999                    Ok(Operation::new(op))
9000                }
9001            };
9002
9003            let start = move || async {
9004                let op = self.send().await?;
9005                Ok(Operation::new(op))
9006            };
9007
9008            google_cloud_lro::internal::new_unit_response_poller(
9009                polling_error_policy,
9010                polling_backoff_policy,
9011                start,
9012                query,
9013            )
9014        }
9015
9016        /// Sets the value of [name][crate::model::DeleteInterceptDeploymentGroupRequest::name].
9017        ///
9018        /// This is a **required** field for requests.
9019        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9020            self.0.request.name = v.into();
9021            self
9022        }
9023
9024        /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentGroupRequest::request_id].
9025        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9026            self.0.request.request_id = v.into();
9027            self
9028        }
9029    }
9030
9031    #[doc(hidden)]
9032    impl crate::RequestBuilder for DeleteInterceptDeploymentGroup {
9033        fn request_options(&mut self) -> &mut crate::RequestOptions {
9034            &mut self.0.options
9035        }
9036    }
9037
9038    /// The request builder for [Intercept::list_intercept_deployments][crate::client::Intercept::list_intercept_deployments] calls.
9039    ///
9040    /// # Example
9041    /// ```
9042    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptDeployments;
9043    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9044    /// use google_cloud_gax::paginator::ItemPaginator;
9045    ///
9046    /// let builder = prepare_request_builder();
9047    /// let mut items = builder.by_item();
9048    /// while let Some(result) = items.next().await {
9049    ///   let item = result?;
9050    /// }
9051    /// # Ok(()) }
9052    ///
9053    /// fn prepare_request_builder() -> ListInterceptDeployments {
9054    ///   # panic!();
9055    ///   // ... details omitted ...
9056    /// }
9057    /// ```
9058    #[derive(Clone, Debug)]
9059    pub struct ListInterceptDeployments(
9060        RequestBuilder<crate::model::ListInterceptDeploymentsRequest>,
9061    );
9062
9063    impl ListInterceptDeployments {
9064        pub(crate) fn new(
9065            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9066        ) -> Self {
9067            Self(RequestBuilder::new(stub))
9068        }
9069
9070        /// Sets the full request, replacing any prior values.
9071        pub fn with_request<V: Into<crate::model::ListInterceptDeploymentsRequest>>(
9072            mut self,
9073            v: V,
9074        ) -> Self {
9075            self.0.request = v.into();
9076            self
9077        }
9078
9079        /// Sets all the options, replacing any prior values.
9080        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9081            self.0.options = v.into();
9082            self
9083        }
9084
9085        /// Sends the request.
9086        pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentsResponse> {
9087            (*self.0.stub)
9088                .list_intercept_deployments(self.0.request, self.0.options)
9089                .await
9090                .map(crate::Response::into_body)
9091        }
9092
9093        /// Streams each page in the collection.
9094        pub fn by_page(
9095            self,
9096        ) -> impl google_cloud_gax::paginator::Paginator<
9097            crate::model::ListInterceptDeploymentsResponse,
9098            crate::Error,
9099        > {
9100            use std::clone::Clone;
9101            let token = self.0.request.page_token.clone();
9102            let execute = move |token: String| {
9103                let mut builder = self.clone();
9104                builder.0.request = builder.0.request.set_page_token(token);
9105                builder.send()
9106            };
9107            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9108        }
9109
9110        /// Streams each item in the collection.
9111        pub fn by_item(
9112            self,
9113        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9114            crate::model::ListInterceptDeploymentsResponse,
9115            crate::Error,
9116        > {
9117            use google_cloud_gax::paginator::Paginator;
9118            self.by_page().items()
9119        }
9120
9121        /// Sets the value of [parent][crate::model::ListInterceptDeploymentsRequest::parent].
9122        ///
9123        /// This is a **required** field for requests.
9124        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9125            self.0.request.parent = v.into();
9126            self
9127        }
9128
9129        /// Sets the value of [page_size][crate::model::ListInterceptDeploymentsRequest::page_size].
9130        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9131            self.0.request.page_size = v.into();
9132            self
9133        }
9134
9135        /// Sets the value of [page_token][crate::model::ListInterceptDeploymentsRequest::page_token].
9136        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9137            self.0.request.page_token = v.into();
9138            self
9139        }
9140
9141        /// Sets the value of [filter][crate::model::ListInterceptDeploymentsRequest::filter].
9142        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9143            self.0.request.filter = v.into();
9144            self
9145        }
9146
9147        /// Sets the value of [order_by][crate::model::ListInterceptDeploymentsRequest::order_by].
9148        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9149            self.0.request.order_by = v.into();
9150            self
9151        }
9152    }
9153
9154    #[doc(hidden)]
9155    impl crate::RequestBuilder for ListInterceptDeployments {
9156        fn request_options(&mut self) -> &mut crate::RequestOptions {
9157            &mut self.0.options
9158        }
9159    }
9160
9161    /// The request builder for [Intercept::get_intercept_deployment][crate::client::Intercept::get_intercept_deployment] calls.
9162    ///
9163    /// # Example
9164    /// ```
9165    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptDeployment;
9166    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9167    ///
9168    /// let builder = prepare_request_builder();
9169    /// let response = builder.send().await?;
9170    /// # Ok(()) }
9171    ///
9172    /// fn prepare_request_builder() -> GetInterceptDeployment {
9173    ///   # panic!();
9174    ///   // ... details omitted ...
9175    /// }
9176    /// ```
9177    #[derive(Clone, Debug)]
9178    pub struct GetInterceptDeployment(RequestBuilder<crate::model::GetInterceptDeploymentRequest>);
9179
9180    impl GetInterceptDeployment {
9181        pub(crate) fn new(
9182            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9183        ) -> Self {
9184            Self(RequestBuilder::new(stub))
9185        }
9186
9187        /// Sets the full request, replacing any prior values.
9188        pub fn with_request<V: Into<crate::model::GetInterceptDeploymentRequest>>(
9189            mut self,
9190            v: V,
9191        ) -> Self {
9192            self.0.request = v.into();
9193            self
9194        }
9195
9196        /// Sets all the options, replacing any prior values.
9197        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9198            self.0.options = v.into();
9199            self
9200        }
9201
9202        /// Sends the request.
9203        pub async fn send(self) -> Result<crate::model::InterceptDeployment> {
9204            (*self.0.stub)
9205                .get_intercept_deployment(self.0.request, self.0.options)
9206                .await
9207                .map(crate::Response::into_body)
9208        }
9209
9210        /// Sets the value of [name][crate::model::GetInterceptDeploymentRequest::name].
9211        ///
9212        /// This is a **required** field for requests.
9213        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9214            self.0.request.name = v.into();
9215            self
9216        }
9217    }
9218
9219    #[doc(hidden)]
9220    impl crate::RequestBuilder for GetInterceptDeployment {
9221        fn request_options(&mut self) -> &mut crate::RequestOptions {
9222            &mut self.0.options
9223        }
9224    }
9225
9226    /// The request builder for [Intercept::create_intercept_deployment][crate::client::Intercept::create_intercept_deployment] calls.
9227    ///
9228    /// # Example
9229    /// ```
9230    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptDeployment;
9231    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9232    /// use google_cloud_lro::Poller;
9233    ///
9234    /// let builder = prepare_request_builder();
9235    /// let response = builder.poller().until_done().await?;
9236    /// # Ok(()) }
9237    ///
9238    /// fn prepare_request_builder() -> CreateInterceptDeployment {
9239    ///   # panic!();
9240    ///   // ... details omitted ...
9241    /// }
9242    /// ```
9243    #[derive(Clone, Debug)]
9244    pub struct CreateInterceptDeployment(
9245        RequestBuilder<crate::model::CreateInterceptDeploymentRequest>,
9246    );
9247
9248    impl CreateInterceptDeployment {
9249        pub(crate) fn new(
9250            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9251        ) -> Self {
9252            Self(RequestBuilder::new(stub))
9253        }
9254
9255        /// Sets the full request, replacing any prior values.
9256        pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentRequest>>(
9257            mut self,
9258            v: V,
9259        ) -> Self {
9260            self.0.request = v.into();
9261            self
9262        }
9263
9264        /// Sets all the options, replacing any prior values.
9265        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9266            self.0.options = v.into();
9267            self
9268        }
9269
9270        /// Sends the request.
9271        ///
9272        /// # Long running operations
9273        ///
9274        /// This starts, but does not poll, a longrunning operation. More information
9275        /// on [create_intercept_deployment][crate::client::Intercept::create_intercept_deployment].
9276        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9277            (*self.0.stub)
9278                .create_intercept_deployment(self.0.request, self.0.options)
9279                .await
9280                .map(crate::Response::into_body)
9281        }
9282
9283        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_deployment`.
9284        pub fn poller(
9285            self,
9286        ) -> impl google_cloud_lro::Poller<
9287            crate::model::InterceptDeployment,
9288            crate::model::OperationMetadata,
9289        > {
9290            type Operation = google_cloud_lro::internal::Operation<
9291                crate::model::InterceptDeployment,
9292                crate::model::OperationMetadata,
9293            >;
9294            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9295            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9296
9297            let stub = self.0.stub.clone();
9298            let mut options = self.0.options.clone();
9299            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9300            let query = move |name| {
9301                let stub = stub.clone();
9302                let options = options.clone();
9303                async {
9304                    let op = GetOperation::new(stub)
9305                        .set_name(name)
9306                        .with_options(options)
9307                        .send()
9308                        .await?;
9309                    Ok(Operation::new(op))
9310                }
9311            };
9312
9313            let start = move || async {
9314                let op = self.send().await?;
9315                Ok(Operation::new(op))
9316            };
9317
9318            google_cloud_lro::internal::new_poller(
9319                polling_error_policy,
9320                polling_backoff_policy,
9321                start,
9322                query,
9323            )
9324        }
9325
9326        /// Sets the value of [parent][crate::model::CreateInterceptDeploymentRequest::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 [intercept_deployment_id][crate::model::CreateInterceptDeploymentRequest::intercept_deployment_id].
9335        ///
9336        /// This is a **required** field for requests.
9337        pub fn set_intercept_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9338            self.0.request.intercept_deployment_id = v.into();
9339            self
9340        }
9341
9342        /// Sets the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
9343        ///
9344        /// This is a **required** field for requests.
9345        pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
9346        where
9347            T: std::convert::Into<crate::model::InterceptDeployment>,
9348        {
9349            self.0.request.intercept_deployment = std::option::Option::Some(v.into());
9350            self
9351        }
9352
9353        /// Sets or clears the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
9354        ///
9355        /// This is a **required** field for requests.
9356        pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
9357        where
9358            T: std::convert::Into<crate::model::InterceptDeployment>,
9359        {
9360            self.0.request.intercept_deployment = v.map(|x| x.into());
9361            self
9362        }
9363
9364        /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentRequest::request_id].
9365        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9366            self.0.request.request_id = v.into();
9367            self
9368        }
9369    }
9370
9371    #[doc(hidden)]
9372    impl crate::RequestBuilder for CreateInterceptDeployment {
9373        fn request_options(&mut self) -> &mut crate::RequestOptions {
9374            &mut self.0.options
9375        }
9376    }
9377
9378    /// The request builder for [Intercept::update_intercept_deployment][crate::client::Intercept::update_intercept_deployment] calls.
9379    ///
9380    /// # Example
9381    /// ```
9382    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptDeployment;
9383    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9384    /// use google_cloud_lro::Poller;
9385    ///
9386    /// let builder = prepare_request_builder();
9387    /// let response = builder.poller().until_done().await?;
9388    /// # Ok(()) }
9389    ///
9390    /// fn prepare_request_builder() -> UpdateInterceptDeployment {
9391    ///   # panic!();
9392    ///   // ... details omitted ...
9393    /// }
9394    /// ```
9395    #[derive(Clone, Debug)]
9396    pub struct UpdateInterceptDeployment(
9397        RequestBuilder<crate::model::UpdateInterceptDeploymentRequest>,
9398    );
9399
9400    impl UpdateInterceptDeployment {
9401        pub(crate) fn new(
9402            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9403        ) -> Self {
9404            Self(RequestBuilder::new(stub))
9405        }
9406
9407        /// Sets the full request, replacing any prior values.
9408        pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentRequest>>(
9409            mut self,
9410            v: V,
9411        ) -> Self {
9412            self.0.request = v.into();
9413            self
9414        }
9415
9416        /// Sets all the options, replacing any prior values.
9417        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9418            self.0.options = v.into();
9419            self
9420        }
9421
9422        /// Sends the request.
9423        ///
9424        /// # Long running operations
9425        ///
9426        /// This starts, but does not poll, a longrunning operation. More information
9427        /// on [update_intercept_deployment][crate::client::Intercept::update_intercept_deployment].
9428        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9429            (*self.0.stub)
9430                .update_intercept_deployment(self.0.request, self.0.options)
9431                .await
9432                .map(crate::Response::into_body)
9433        }
9434
9435        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_deployment`.
9436        pub fn poller(
9437            self,
9438        ) -> impl google_cloud_lro::Poller<
9439            crate::model::InterceptDeployment,
9440            crate::model::OperationMetadata,
9441        > {
9442            type Operation = google_cloud_lro::internal::Operation<
9443                crate::model::InterceptDeployment,
9444                crate::model::OperationMetadata,
9445            >;
9446            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9447            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9448
9449            let stub = self.0.stub.clone();
9450            let mut options = self.0.options.clone();
9451            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9452            let query = move |name| {
9453                let stub = stub.clone();
9454                let options = options.clone();
9455                async {
9456                    let op = GetOperation::new(stub)
9457                        .set_name(name)
9458                        .with_options(options)
9459                        .send()
9460                        .await?;
9461                    Ok(Operation::new(op))
9462                }
9463            };
9464
9465            let start = move || async {
9466                let op = self.send().await?;
9467                Ok(Operation::new(op))
9468            };
9469
9470            google_cloud_lro::internal::new_poller(
9471                polling_error_policy,
9472                polling_backoff_policy,
9473                start,
9474                query,
9475            )
9476        }
9477
9478        /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
9479        pub fn set_update_mask<T>(mut self, v: T) -> Self
9480        where
9481            T: std::convert::Into<wkt::FieldMask>,
9482        {
9483            self.0.request.update_mask = std::option::Option::Some(v.into());
9484            self
9485        }
9486
9487        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
9488        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9489        where
9490            T: std::convert::Into<wkt::FieldMask>,
9491        {
9492            self.0.request.update_mask = v.map(|x| x.into());
9493            self
9494        }
9495
9496        /// Sets the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
9497        ///
9498        /// This is a **required** field for requests.
9499        pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
9500        where
9501            T: std::convert::Into<crate::model::InterceptDeployment>,
9502        {
9503            self.0.request.intercept_deployment = std::option::Option::Some(v.into());
9504            self
9505        }
9506
9507        /// Sets or clears the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
9508        ///
9509        /// This is a **required** field for requests.
9510        pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
9511        where
9512            T: std::convert::Into<crate::model::InterceptDeployment>,
9513        {
9514            self.0.request.intercept_deployment = v.map(|x| x.into());
9515            self
9516        }
9517
9518        /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentRequest::request_id].
9519        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9520            self.0.request.request_id = v.into();
9521            self
9522        }
9523    }
9524
9525    #[doc(hidden)]
9526    impl crate::RequestBuilder for UpdateInterceptDeployment {
9527        fn request_options(&mut self) -> &mut crate::RequestOptions {
9528            &mut self.0.options
9529        }
9530    }
9531
9532    /// The request builder for [Intercept::delete_intercept_deployment][crate::client::Intercept::delete_intercept_deployment] calls.
9533    ///
9534    /// # Example
9535    /// ```
9536    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptDeployment;
9537    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9538    /// use google_cloud_lro::Poller;
9539    ///
9540    /// let builder = prepare_request_builder();
9541    /// let response = builder.poller().until_done().await?;
9542    /// # Ok(()) }
9543    ///
9544    /// fn prepare_request_builder() -> DeleteInterceptDeployment {
9545    ///   # panic!();
9546    ///   // ... details omitted ...
9547    /// }
9548    /// ```
9549    #[derive(Clone, Debug)]
9550    pub struct DeleteInterceptDeployment(
9551        RequestBuilder<crate::model::DeleteInterceptDeploymentRequest>,
9552    );
9553
9554    impl DeleteInterceptDeployment {
9555        pub(crate) fn new(
9556            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9557        ) -> Self {
9558            Self(RequestBuilder::new(stub))
9559        }
9560
9561        /// Sets the full request, replacing any prior values.
9562        pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentRequest>>(
9563            mut self,
9564            v: V,
9565        ) -> Self {
9566            self.0.request = v.into();
9567            self
9568        }
9569
9570        /// Sets all the options, replacing any prior values.
9571        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9572            self.0.options = v.into();
9573            self
9574        }
9575
9576        /// Sends the request.
9577        ///
9578        /// # Long running operations
9579        ///
9580        /// This starts, but does not poll, a longrunning operation. More information
9581        /// on [delete_intercept_deployment][crate::client::Intercept::delete_intercept_deployment].
9582        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9583            (*self.0.stub)
9584                .delete_intercept_deployment(self.0.request, self.0.options)
9585                .await
9586                .map(crate::Response::into_body)
9587        }
9588
9589        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_deployment`.
9590        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9591            type Operation =
9592                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9593            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9594            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9595
9596            let stub = self.0.stub.clone();
9597            let mut options = self.0.options.clone();
9598            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9599            let query = move |name| {
9600                let stub = stub.clone();
9601                let options = options.clone();
9602                async {
9603                    let op = GetOperation::new(stub)
9604                        .set_name(name)
9605                        .with_options(options)
9606                        .send()
9607                        .await?;
9608                    Ok(Operation::new(op))
9609                }
9610            };
9611
9612            let start = move || async {
9613                let op = self.send().await?;
9614                Ok(Operation::new(op))
9615            };
9616
9617            google_cloud_lro::internal::new_unit_response_poller(
9618                polling_error_policy,
9619                polling_backoff_policy,
9620                start,
9621                query,
9622            )
9623        }
9624
9625        /// Sets the value of [name][crate::model::DeleteInterceptDeploymentRequest::name].
9626        ///
9627        /// This is a **required** field for requests.
9628        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9629            self.0.request.name = v.into();
9630            self
9631        }
9632
9633        /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentRequest::request_id].
9634        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9635            self.0.request.request_id = v.into();
9636            self
9637        }
9638    }
9639
9640    #[doc(hidden)]
9641    impl crate::RequestBuilder for DeleteInterceptDeployment {
9642        fn request_options(&mut self) -> &mut crate::RequestOptions {
9643            &mut self.0.options
9644        }
9645    }
9646
9647    /// The request builder for [Intercept::list_locations][crate::client::Intercept::list_locations] calls.
9648    ///
9649    /// # Example
9650    /// ```
9651    /// # use google_cloud_networksecurity_v1::builder::intercept::ListLocations;
9652    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9653    /// use google_cloud_gax::paginator::ItemPaginator;
9654    ///
9655    /// let builder = prepare_request_builder();
9656    /// let mut items = builder.by_item();
9657    /// while let Some(result) = items.next().await {
9658    ///   let item = result?;
9659    /// }
9660    /// # Ok(()) }
9661    ///
9662    /// fn prepare_request_builder() -> ListLocations {
9663    ///   # panic!();
9664    ///   // ... details omitted ...
9665    /// }
9666    /// ```
9667    #[derive(Clone, Debug)]
9668    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9669
9670    impl ListLocations {
9671        pub(crate) fn new(
9672            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9673        ) -> Self {
9674            Self(RequestBuilder::new(stub))
9675        }
9676
9677        /// Sets the full request, replacing any prior values.
9678        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9679            mut self,
9680            v: V,
9681        ) -> Self {
9682            self.0.request = v.into();
9683            self
9684        }
9685
9686        /// Sets all the options, replacing any prior values.
9687        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9688            self.0.options = v.into();
9689            self
9690        }
9691
9692        /// Sends the request.
9693        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9694            (*self.0.stub)
9695                .list_locations(self.0.request, self.0.options)
9696                .await
9697                .map(crate::Response::into_body)
9698        }
9699
9700        /// Streams each page in the collection.
9701        pub fn by_page(
9702            self,
9703        ) -> impl google_cloud_gax::paginator::Paginator<
9704            google_cloud_location::model::ListLocationsResponse,
9705            crate::Error,
9706        > {
9707            use std::clone::Clone;
9708            let token = self.0.request.page_token.clone();
9709            let execute = move |token: String| {
9710                let mut builder = self.clone();
9711                builder.0.request = builder.0.request.set_page_token(token);
9712                builder.send()
9713            };
9714            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9715        }
9716
9717        /// Streams each item in the collection.
9718        pub fn by_item(
9719            self,
9720        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9721            google_cloud_location::model::ListLocationsResponse,
9722            crate::Error,
9723        > {
9724            use google_cloud_gax::paginator::Paginator;
9725            self.by_page().items()
9726        }
9727
9728        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
9729        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9730            self.0.request.name = v.into();
9731            self
9732        }
9733
9734        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
9735        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9736            self.0.request.filter = v.into();
9737            self
9738        }
9739
9740        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
9741        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9742            self.0.request.page_size = v.into();
9743            self
9744        }
9745
9746        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
9747        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9748            self.0.request.page_token = v.into();
9749            self
9750        }
9751    }
9752
9753    #[doc(hidden)]
9754    impl crate::RequestBuilder for ListLocations {
9755        fn request_options(&mut self) -> &mut crate::RequestOptions {
9756            &mut self.0.options
9757        }
9758    }
9759
9760    /// The request builder for [Intercept::get_location][crate::client::Intercept::get_location] calls.
9761    ///
9762    /// # Example
9763    /// ```
9764    /// # use google_cloud_networksecurity_v1::builder::intercept::GetLocation;
9765    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9766    ///
9767    /// let builder = prepare_request_builder();
9768    /// let response = builder.send().await?;
9769    /// # Ok(()) }
9770    ///
9771    /// fn prepare_request_builder() -> GetLocation {
9772    ///   # panic!();
9773    ///   // ... details omitted ...
9774    /// }
9775    /// ```
9776    #[derive(Clone, Debug)]
9777    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9778
9779    impl GetLocation {
9780        pub(crate) fn new(
9781            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9782        ) -> Self {
9783            Self(RequestBuilder::new(stub))
9784        }
9785
9786        /// Sets the full request, replacing any prior values.
9787        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9788            mut self,
9789            v: V,
9790        ) -> Self {
9791            self.0.request = v.into();
9792            self
9793        }
9794
9795        /// Sets all the options, replacing any prior values.
9796        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9797            self.0.options = v.into();
9798            self
9799        }
9800
9801        /// Sends the request.
9802        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9803            (*self.0.stub)
9804                .get_location(self.0.request, self.0.options)
9805                .await
9806                .map(crate::Response::into_body)
9807        }
9808
9809        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
9810        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9811            self.0.request.name = v.into();
9812            self
9813        }
9814    }
9815
9816    #[doc(hidden)]
9817    impl crate::RequestBuilder for GetLocation {
9818        fn request_options(&mut self) -> &mut crate::RequestOptions {
9819            &mut self.0.options
9820        }
9821    }
9822
9823    /// The request builder for [Intercept::set_iam_policy][crate::client::Intercept::set_iam_policy] calls.
9824    ///
9825    /// # Example
9826    /// ```
9827    /// # use google_cloud_networksecurity_v1::builder::intercept::SetIamPolicy;
9828    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9829    ///
9830    /// let builder = prepare_request_builder();
9831    /// let response = builder.send().await?;
9832    /// # Ok(()) }
9833    ///
9834    /// fn prepare_request_builder() -> SetIamPolicy {
9835    ///   # panic!();
9836    ///   // ... details omitted ...
9837    /// }
9838    /// ```
9839    #[derive(Clone, Debug)]
9840    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
9841
9842    impl SetIamPolicy {
9843        pub(crate) fn new(
9844            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9845        ) -> Self {
9846            Self(RequestBuilder::new(stub))
9847        }
9848
9849        /// Sets the full request, replacing any prior values.
9850        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
9851            mut self,
9852            v: V,
9853        ) -> Self {
9854            self.0.request = v.into();
9855            self
9856        }
9857
9858        /// Sets all the options, replacing any prior values.
9859        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9860            self.0.options = v.into();
9861            self
9862        }
9863
9864        /// Sends the request.
9865        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9866            (*self.0.stub)
9867                .set_iam_policy(self.0.request, self.0.options)
9868                .await
9869                .map(crate::Response::into_body)
9870        }
9871
9872        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
9873        ///
9874        /// This is a **required** field for requests.
9875        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9876            self.0.request.resource = v.into();
9877            self
9878        }
9879
9880        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
9881        ///
9882        /// This is a **required** field for requests.
9883        pub fn set_policy<T>(mut self, v: T) -> Self
9884        where
9885            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9886        {
9887            self.0.request.policy = std::option::Option::Some(v.into());
9888            self
9889        }
9890
9891        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
9892        ///
9893        /// This is a **required** field for requests.
9894        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9895        where
9896            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9897        {
9898            self.0.request.policy = v.map(|x| x.into());
9899            self
9900        }
9901
9902        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
9903        pub fn set_update_mask<T>(mut self, v: T) -> Self
9904        where
9905            T: std::convert::Into<wkt::FieldMask>,
9906        {
9907            self.0.request.update_mask = std::option::Option::Some(v.into());
9908            self
9909        }
9910
9911        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
9912        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9913        where
9914            T: std::convert::Into<wkt::FieldMask>,
9915        {
9916            self.0.request.update_mask = v.map(|x| x.into());
9917            self
9918        }
9919    }
9920
9921    #[doc(hidden)]
9922    impl crate::RequestBuilder for SetIamPolicy {
9923        fn request_options(&mut self) -> &mut crate::RequestOptions {
9924            &mut self.0.options
9925        }
9926    }
9927
9928    /// The request builder for [Intercept::get_iam_policy][crate::client::Intercept::get_iam_policy] calls.
9929    ///
9930    /// # Example
9931    /// ```
9932    /// # use google_cloud_networksecurity_v1::builder::intercept::GetIamPolicy;
9933    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9934    ///
9935    /// let builder = prepare_request_builder();
9936    /// let response = builder.send().await?;
9937    /// # Ok(()) }
9938    ///
9939    /// fn prepare_request_builder() -> GetIamPolicy {
9940    ///   # panic!();
9941    ///   // ... details omitted ...
9942    /// }
9943    /// ```
9944    #[derive(Clone, Debug)]
9945    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
9946
9947    impl GetIamPolicy {
9948        pub(crate) fn new(
9949            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9950        ) -> Self {
9951            Self(RequestBuilder::new(stub))
9952        }
9953
9954        /// Sets the full request, replacing any prior values.
9955        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
9956            mut self,
9957            v: V,
9958        ) -> Self {
9959            self.0.request = v.into();
9960            self
9961        }
9962
9963        /// Sets all the options, replacing any prior values.
9964        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9965            self.0.options = v.into();
9966            self
9967        }
9968
9969        /// Sends the request.
9970        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9971            (*self.0.stub)
9972                .get_iam_policy(self.0.request, self.0.options)
9973                .await
9974                .map(crate::Response::into_body)
9975        }
9976
9977        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
9978        ///
9979        /// This is a **required** field for requests.
9980        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9981            self.0.request.resource = v.into();
9982            self
9983        }
9984
9985        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
9986        pub fn set_options<T>(mut self, v: T) -> Self
9987        where
9988            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9989        {
9990            self.0.request.options = std::option::Option::Some(v.into());
9991            self
9992        }
9993
9994        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
9995        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9996        where
9997            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9998        {
9999            self.0.request.options = v.map(|x| x.into());
10000            self
10001        }
10002    }
10003
10004    #[doc(hidden)]
10005    impl crate::RequestBuilder for GetIamPolicy {
10006        fn request_options(&mut self) -> &mut crate::RequestOptions {
10007            &mut self.0.options
10008        }
10009    }
10010
10011    /// The request builder for [Intercept::test_iam_permissions][crate::client::Intercept::test_iam_permissions] calls.
10012    ///
10013    /// # Example
10014    /// ```
10015    /// # use google_cloud_networksecurity_v1::builder::intercept::TestIamPermissions;
10016    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10017    ///
10018    /// let builder = prepare_request_builder();
10019    /// let response = builder.send().await?;
10020    /// # Ok(()) }
10021    ///
10022    /// fn prepare_request_builder() -> TestIamPermissions {
10023    ///   # panic!();
10024    ///   // ... details omitted ...
10025    /// }
10026    /// ```
10027    #[derive(Clone, Debug)]
10028    pub struct TestIamPermissions(
10029        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
10030    );
10031
10032    impl TestIamPermissions {
10033        pub(crate) fn new(
10034            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10035        ) -> Self {
10036            Self(RequestBuilder::new(stub))
10037        }
10038
10039        /// Sets the full request, replacing any prior values.
10040        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
10041            mut self,
10042            v: V,
10043        ) -> Self {
10044            self.0.request = v.into();
10045            self
10046        }
10047
10048        /// Sets all the options, replacing any prior values.
10049        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10050            self.0.options = v.into();
10051            self
10052        }
10053
10054        /// Sends the request.
10055        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
10056            (*self.0.stub)
10057                .test_iam_permissions(self.0.request, self.0.options)
10058                .await
10059                .map(crate::Response::into_body)
10060        }
10061
10062        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
10063        ///
10064        /// This is a **required** field for requests.
10065        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10066            self.0.request.resource = v.into();
10067            self
10068        }
10069
10070        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
10071        ///
10072        /// This is a **required** field for requests.
10073        pub fn set_permissions<T, V>(mut self, v: T) -> Self
10074        where
10075            T: std::iter::IntoIterator<Item = V>,
10076            V: std::convert::Into<std::string::String>,
10077        {
10078            use std::iter::Iterator;
10079            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10080            self
10081        }
10082    }
10083
10084    #[doc(hidden)]
10085    impl crate::RequestBuilder for TestIamPermissions {
10086        fn request_options(&mut self) -> &mut crate::RequestOptions {
10087            &mut self.0.options
10088        }
10089    }
10090
10091    /// The request builder for [Intercept::list_operations][crate::client::Intercept::list_operations] calls.
10092    ///
10093    /// # Example
10094    /// ```
10095    /// # use google_cloud_networksecurity_v1::builder::intercept::ListOperations;
10096    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10097    /// use google_cloud_gax::paginator::ItemPaginator;
10098    ///
10099    /// let builder = prepare_request_builder();
10100    /// let mut items = builder.by_item();
10101    /// while let Some(result) = items.next().await {
10102    ///   let item = result?;
10103    /// }
10104    /// # Ok(()) }
10105    ///
10106    /// fn prepare_request_builder() -> ListOperations {
10107    ///   # panic!();
10108    ///   // ... details omitted ...
10109    /// }
10110    /// ```
10111    #[derive(Clone, Debug)]
10112    pub struct ListOperations(
10113        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10114    );
10115
10116    impl ListOperations {
10117        pub(crate) fn new(
10118            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10119        ) -> Self {
10120            Self(RequestBuilder::new(stub))
10121        }
10122
10123        /// Sets the full request, replacing any prior values.
10124        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10125            mut self,
10126            v: V,
10127        ) -> Self {
10128            self.0.request = v.into();
10129            self
10130        }
10131
10132        /// Sets all the options, replacing any prior values.
10133        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10134            self.0.options = v.into();
10135            self
10136        }
10137
10138        /// Sends the request.
10139        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
10140            (*self.0.stub)
10141                .list_operations(self.0.request, self.0.options)
10142                .await
10143                .map(crate::Response::into_body)
10144        }
10145
10146        /// Streams each page in the collection.
10147        pub fn by_page(
10148            self,
10149        ) -> impl google_cloud_gax::paginator::Paginator<
10150            google_cloud_longrunning::model::ListOperationsResponse,
10151            crate::Error,
10152        > {
10153            use std::clone::Clone;
10154            let token = self.0.request.page_token.clone();
10155            let execute = move |token: String| {
10156                let mut builder = self.clone();
10157                builder.0.request = builder.0.request.set_page_token(token);
10158                builder.send()
10159            };
10160            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10161        }
10162
10163        /// Streams each item in the collection.
10164        pub fn by_item(
10165            self,
10166        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10167            google_cloud_longrunning::model::ListOperationsResponse,
10168            crate::Error,
10169        > {
10170            use google_cloud_gax::paginator::Paginator;
10171            self.by_page().items()
10172        }
10173
10174        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
10175        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10176            self.0.request.name = v.into();
10177            self
10178        }
10179
10180        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
10181        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10182            self.0.request.filter = v.into();
10183            self
10184        }
10185
10186        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
10187        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10188            self.0.request.page_size = v.into();
10189            self
10190        }
10191
10192        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
10193        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10194            self.0.request.page_token = v.into();
10195            self
10196        }
10197
10198        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
10199        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10200            self.0.request.return_partial_success = v.into();
10201            self
10202        }
10203    }
10204
10205    #[doc(hidden)]
10206    impl crate::RequestBuilder for ListOperations {
10207        fn request_options(&mut self) -> &mut crate::RequestOptions {
10208            &mut self.0.options
10209        }
10210    }
10211
10212    /// The request builder for [Intercept::get_operation][crate::client::Intercept::get_operation] calls.
10213    ///
10214    /// # Example
10215    /// ```
10216    /// # use google_cloud_networksecurity_v1::builder::intercept::GetOperation;
10217    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10218    ///
10219    /// let builder = prepare_request_builder();
10220    /// let response = builder.send().await?;
10221    /// # Ok(()) }
10222    ///
10223    /// fn prepare_request_builder() -> GetOperation {
10224    ///   # panic!();
10225    ///   // ... details omitted ...
10226    /// }
10227    /// ```
10228    #[derive(Clone, Debug)]
10229    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
10230
10231    impl GetOperation {
10232        pub(crate) fn new(
10233            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10234        ) -> Self {
10235            Self(RequestBuilder::new(stub))
10236        }
10237
10238        /// Sets the full request, replacing any prior values.
10239        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
10240            mut self,
10241            v: V,
10242        ) -> Self {
10243            self.0.request = v.into();
10244            self
10245        }
10246
10247        /// Sets all the options, replacing any prior values.
10248        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10249            self.0.options = v.into();
10250            self
10251        }
10252
10253        /// Sends the request.
10254        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10255            (*self.0.stub)
10256                .get_operation(self.0.request, self.0.options)
10257                .await
10258                .map(crate::Response::into_body)
10259        }
10260
10261        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
10262        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10263            self.0.request.name = v.into();
10264            self
10265        }
10266    }
10267
10268    #[doc(hidden)]
10269    impl crate::RequestBuilder for GetOperation {
10270        fn request_options(&mut self) -> &mut crate::RequestOptions {
10271            &mut self.0.options
10272        }
10273    }
10274
10275    /// The request builder for [Intercept::delete_operation][crate::client::Intercept::delete_operation] calls.
10276    ///
10277    /// # Example
10278    /// ```
10279    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteOperation;
10280    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10281    ///
10282    /// let builder = prepare_request_builder();
10283    /// let response = builder.send().await?;
10284    /// # Ok(()) }
10285    ///
10286    /// fn prepare_request_builder() -> DeleteOperation {
10287    ///   # panic!();
10288    ///   // ... details omitted ...
10289    /// }
10290    /// ```
10291    #[derive(Clone, Debug)]
10292    pub struct DeleteOperation(
10293        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
10294    );
10295
10296    impl DeleteOperation {
10297        pub(crate) fn new(
10298            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10299        ) -> Self {
10300            Self(RequestBuilder::new(stub))
10301        }
10302
10303        /// Sets the full request, replacing any prior values.
10304        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
10305            mut self,
10306            v: V,
10307        ) -> Self {
10308            self.0.request = v.into();
10309            self
10310        }
10311
10312        /// Sets all the options, replacing any prior values.
10313        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10314            self.0.options = v.into();
10315            self
10316        }
10317
10318        /// Sends the request.
10319        pub async fn send(self) -> Result<()> {
10320            (*self.0.stub)
10321                .delete_operation(self.0.request, self.0.options)
10322                .await
10323                .map(crate::Response::into_body)
10324        }
10325
10326        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
10327        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10328            self.0.request.name = v.into();
10329            self
10330        }
10331    }
10332
10333    #[doc(hidden)]
10334    impl crate::RequestBuilder for DeleteOperation {
10335        fn request_options(&mut self) -> &mut crate::RequestOptions {
10336            &mut self.0.options
10337        }
10338    }
10339
10340    /// The request builder for [Intercept::cancel_operation][crate::client::Intercept::cancel_operation] calls.
10341    ///
10342    /// # Example
10343    /// ```
10344    /// # use google_cloud_networksecurity_v1::builder::intercept::CancelOperation;
10345    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10346    ///
10347    /// let builder = prepare_request_builder();
10348    /// let response = builder.send().await?;
10349    /// # Ok(()) }
10350    ///
10351    /// fn prepare_request_builder() -> CancelOperation {
10352    ///   # panic!();
10353    ///   // ... details omitted ...
10354    /// }
10355    /// ```
10356    #[derive(Clone, Debug)]
10357    pub struct CancelOperation(
10358        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10359    );
10360
10361    impl CancelOperation {
10362        pub(crate) fn new(
10363            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10364        ) -> Self {
10365            Self(RequestBuilder::new(stub))
10366        }
10367
10368        /// Sets the full request, replacing any prior values.
10369        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10370            mut self,
10371            v: V,
10372        ) -> Self {
10373            self.0.request = v.into();
10374            self
10375        }
10376
10377        /// Sets all the options, replacing any prior values.
10378        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10379            self.0.options = v.into();
10380            self
10381        }
10382
10383        /// Sends the request.
10384        pub async fn send(self) -> Result<()> {
10385            (*self.0.stub)
10386                .cancel_operation(self.0.request, self.0.options)
10387                .await
10388                .map(crate::Response::into_body)
10389        }
10390
10391        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
10392        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10393            self.0.request.name = v.into();
10394            self
10395        }
10396    }
10397
10398    #[doc(hidden)]
10399    impl crate::RequestBuilder for CancelOperation {
10400        fn request_options(&mut self) -> &mut crate::RequestOptions {
10401            &mut self.0.options
10402        }
10403    }
10404}
10405
10406/// Request and client builders for [Mirroring][crate::client::Mirroring].
10407pub mod mirroring {
10408    use crate::Result;
10409
10410    /// A builder for [Mirroring][crate::client::Mirroring].
10411    ///
10412    /// ```
10413    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10414    /// # use google_cloud_networksecurity_v1::*;
10415    /// # use builder::mirroring::ClientBuilder;
10416    /// # use client::Mirroring;
10417    /// let builder : ClientBuilder = Mirroring::builder();
10418    /// let client = builder
10419    ///     .with_endpoint("https://networksecurity.googleapis.com")
10420    ///     .build().await?;
10421    /// # Ok(()) }
10422    /// ```
10423    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10424
10425    pub(crate) mod client {
10426        use super::super::super::client::Mirroring;
10427        pub struct Factory;
10428        impl crate::ClientFactory for Factory {
10429            type Client = Mirroring;
10430            type Credentials = gaxi::options::Credentials;
10431            async fn build(
10432                self,
10433                config: gaxi::options::ClientConfig,
10434            ) -> crate::ClientBuilderResult<Self::Client> {
10435                Self::Client::new(config).await
10436            }
10437        }
10438    }
10439
10440    /// Common implementation for [crate::client::Mirroring] request builders.
10441    #[derive(Clone, Debug)]
10442    pub(crate) struct RequestBuilder<R: std::default::Default> {
10443        stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10444        request: R,
10445        options: crate::RequestOptions,
10446    }
10447
10448    impl<R> RequestBuilder<R>
10449    where
10450        R: std::default::Default,
10451    {
10452        pub(crate) fn new(
10453            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10454        ) -> Self {
10455            Self {
10456                stub,
10457                request: R::default(),
10458                options: crate::RequestOptions::default(),
10459            }
10460        }
10461    }
10462
10463    /// The request builder for [Mirroring::list_mirroring_endpoint_groups][crate::client::Mirroring::list_mirroring_endpoint_groups] calls.
10464    ///
10465    /// # Example
10466    /// ```
10467    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringEndpointGroups;
10468    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10469    /// use google_cloud_gax::paginator::ItemPaginator;
10470    ///
10471    /// let builder = prepare_request_builder();
10472    /// let mut items = builder.by_item();
10473    /// while let Some(result) = items.next().await {
10474    ///   let item = result?;
10475    /// }
10476    /// # Ok(()) }
10477    ///
10478    /// fn prepare_request_builder() -> ListMirroringEndpointGroups {
10479    ///   # panic!();
10480    ///   // ... details omitted ...
10481    /// }
10482    /// ```
10483    #[derive(Clone, Debug)]
10484    pub struct ListMirroringEndpointGroups(
10485        RequestBuilder<crate::model::ListMirroringEndpointGroupsRequest>,
10486    );
10487
10488    impl ListMirroringEndpointGroups {
10489        pub(crate) fn new(
10490            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10491        ) -> Self {
10492            Self(RequestBuilder::new(stub))
10493        }
10494
10495        /// Sets the full request, replacing any prior values.
10496        pub fn with_request<V: Into<crate::model::ListMirroringEndpointGroupsRequest>>(
10497            mut self,
10498            v: V,
10499        ) -> Self {
10500            self.0.request = v.into();
10501            self
10502        }
10503
10504        /// Sets all the options, replacing any prior values.
10505        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10506            self.0.options = v.into();
10507            self
10508        }
10509
10510        /// Sends the request.
10511        pub async fn send(self) -> Result<crate::model::ListMirroringEndpointGroupsResponse> {
10512            (*self.0.stub)
10513                .list_mirroring_endpoint_groups(self.0.request, self.0.options)
10514                .await
10515                .map(crate::Response::into_body)
10516        }
10517
10518        /// Streams each page in the collection.
10519        pub fn by_page(
10520            self,
10521        ) -> impl google_cloud_gax::paginator::Paginator<
10522            crate::model::ListMirroringEndpointGroupsResponse,
10523            crate::Error,
10524        > {
10525            use std::clone::Clone;
10526            let token = self.0.request.page_token.clone();
10527            let execute = move |token: String| {
10528                let mut builder = self.clone();
10529                builder.0.request = builder.0.request.set_page_token(token);
10530                builder.send()
10531            };
10532            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10533        }
10534
10535        /// Streams each item in the collection.
10536        pub fn by_item(
10537            self,
10538        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10539            crate::model::ListMirroringEndpointGroupsResponse,
10540            crate::Error,
10541        > {
10542            use google_cloud_gax::paginator::Paginator;
10543            self.by_page().items()
10544        }
10545
10546        /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupsRequest::parent].
10547        ///
10548        /// This is a **required** field for requests.
10549        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10550            self.0.request.parent = v.into();
10551            self
10552        }
10553
10554        /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupsRequest::page_size].
10555        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10556            self.0.request.page_size = v.into();
10557            self
10558        }
10559
10560        /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupsRequest::page_token].
10561        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10562            self.0.request.page_token = v.into();
10563            self
10564        }
10565
10566        /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupsRequest::filter].
10567        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10568            self.0.request.filter = v.into();
10569            self
10570        }
10571
10572        /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupsRequest::order_by].
10573        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10574            self.0.request.order_by = v.into();
10575            self
10576        }
10577    }
10578
10579    #[doc(hidden)]
10580    impl crate::RequestBuilder for ListMirroringEndpointGroups {
10581        fn request_options(&mut self) -> &mut crate::RequestOptions {
10582            &mut self.0.options
10583        }
10584    }
10585
10586    /// The request builder for [Mirroring::get_mirroring_endpoint_group][crate::client::Mirroring::get_mirroring_endpoint_group] calls.
10587    ///
10588    /// # Example
10589    /// ```
10590    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringEndpointGroup;
10591    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10592    ///
10593    /// let builder = prepare_request_builder();
10594    /// let response = builder.send().await?;
10595    /// # Ok(()) }
10596    ///
10597    /// fn prepare_request_builder() -> GetMirroringEndpointGroup {
10598    ///   # panic!();
10599    ///   // ... details omitted ...
10600    /// }
10601    /// ```
10602    #[derive(Clone, Debug)]
10603    pub struct GetMirroringEndpointGroup(
10604        RequestBuilder<crate::model::GetMirroringEndpointGroupRequest>,
10605    );
10606
10607    impl GetMirroringEndpointGroup {
10608        pub(crate) fn new(
10609            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10610        ) -> Self {
10611            Self(RequestBuilder::new(stub))
10612        }
10613
10614        /// Sets the full request, replacing any prior values.
10615        pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupRequest>>(
10616            mut self,
10617            v: V,
10618        ) -> Self {
10619            self.0.request = v.into();
10620            self
10621        }
10622
10623        /// Sets all the options, replacing any prior values.
10624        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10625            self.0.options = v.into();
10626            self
10627        }
10628
10629        /// Sends the request.
10630        pub async fn send(self) -> Result<crate::model::MirroringEndpointGroup> {
10631            (*self.0.stub)
10632                .get_mirroring_endpoint_group(self.0.request, self.0.options)
10633                .await
10634                .map(crate::Response::into_body)
10635        }
10636
10637        /// Sets the value of [name][crate::model::GetMirroringEndpointGroupRequest::name].
10638        ///
10639        /// This is a **required** field for requests.
10640        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10641            self.0.request.name = v.into();
10642            self
10643        }
10644    }
10645
10646    #[doc(hidden)]
10647    impl crate::RequestBuilder for GetMirroringEndpointGroup {
10648        fn request_options(&mut self) -> &mut crate::RequestOptions {
10649            &mut self.0.options
10650        }
10651    }
10652
10653    /// The request builder for [Mirroring::create_mirroring_endpoint_group][crate::client::Mirroring::create_mirroring_endpoint_group] calls.
10654    ///
10655    /// # Example
10656    /// ```
10657    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringEndpointGroup;
10658    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10659    /// use google_cloud_lro::Poller;
10660    ///
10661    /// let builder = prepare_request_builder();
10662    /// let response = builder.poller().until_done().await?;
10663    /// # Ok(()) }
10664    ///
10665    /// fn prepare_request_builder() -> CreateMirroringEndpointGroup {
10666    ///   # panic!();
10667    ///   // ... details omitted ...
10668    /// }
10669    /// ```
10670    #[derive(Clone, Debug)]
10671    pub struct CreateMirroringEndpointGroup(
10672        RequestBuilder<crate::model::CreateMirroringEndpointGroupRequest>,
10673    );
10674
10675    impl CreateMirroringEndpointGroup {
10676        pub(crate) fn new(
10677            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10678        ) -> Self {
10679            Self(RequestBuilder::new(stub))
10680        }
10681
10682        /// Sets the full request, replacing any prior values.
10683        pub fn with_request<V: Into<crate::model::CreateMirroringEndpointGroupRequest>>(
10684            mut self,
10685            v: V,
10686        ) -> Self {
10687            self.0.request = v.into();
10688            self
10689        }
10690
10691        /// Sets all the options, replacing any prior values.
10692        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10693            self.0.options = v.into();
10694            self
10695        }
10696
10697        /// Sends the request.
10698        ///
10699        /// # Long running operations
10700        ///
10701        /// This starts, but does not poll, a longrunning operation. More information
10702        /// on [create_mirroring_endpoint_group][crate::client::Mirroring::create_mirroring_endpoint_group].
10703        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10704            (*self.0.stub)
10705                .create_mirroring_endpoint_group(self.0.request, self.0.options)
10706                .await
10707                .map(crate::Response::into_body)
10708        }
10709
10710        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_endpoint_group`.
10711        pub fn poller(
10712            self,
10713        ) -> impl google_cloud_lro::Poller<
10714            crate::model::MirroringEndpointGroup,
10715            crate::model::OperationMetadata,
10716        > {
10717            type Operation = google_cloud_lro::internal::Operation<
10718                crate::model::MirroringEndpointGroup,
10719                crate::model::OperationMetadata,
10720            >;
10721            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10722            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10723
10724            let stub = self.0.stub.clone();
10725            let mut options = self.0.options.clone();
10726            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10727            let query = move |name| {
10728                let stub = stub.clone();
10729                let options = options.clone();
10730                async {
10731                    let op = GetOperation::new(stub)
10732                        .set_name(name)
10733                        .with_options(options)
10734                        .send()
10735                        .await?;
10736                    Ok(Operation::new(op))
10737                }
10738            };
10739
10740            let start = move || async {
10741                let op = self.send().await?;
10742                Ok(Operation::new(op))
10743            };
10744
10745            google_cloud_lro::internal::new_poller(
10746                polling_error_policy,
10747                polling_backoff_policy,
10748                start,
10749                query,
10750            )
10751        }
10752
10753        /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupRequest::parent].
10754        ///
10755        /// This is a **required** field for requests.
10756        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10757            self.0.request.parent = v.into();
10758            self
10759        }
10760
10761        /// Sets the value of [mirroring_endpoint_group_id][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group_id].
10762        ///
10763        /// This is a **required** field for requests.
10764        pub fn set_mirroring_endpoint_group_id<T: Into<std::string::String>>(
10765            mut self,
10766            v: T,
10767        ) -> Self {
10768            self.0.request.mirroring_endpoint_group_id = v.into();
10769            self
10770        }
10771
10772        /// Sets the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
10773        ///
10774        /// This is a **required** field for requests.
10775        pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
10776        where
10777            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10778        {
10779            self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
10780            self
10781        }
10782
10783        /// Sets or clears the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
10784        ///
10785        /// This is a **required** field for requests.
10786        pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
10787        where
10788            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10789        {
10790            self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
10791            self
10792        }
10793
10794        /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupRequest::request_id].
10795        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10796            self.0.request.request_id = v.into();
10797            self
10798        }
10799    }
10800
10801    #[doc(hidden)]
10802    impl crate::RequestBuilder for CreateMirroringEndpointGroup {
10803        fn request_options(&mut self) -> &mut crate::RequestOptions {
10804            &mut self.0.options
10805        }
10806    }
10807
10808    /// The request builder for [Mirroring::update_mirroring_endpoint_group][crate::client::Mirroring::update_mirroring_endpoint_group] calls.
10809    ///
10810    /// # Example
10811    /// ```
10812    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringEndpointGroup;
10813    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10814    /// use google_cloud_lro::Poller;
10815    ///
10816    /// let builder = prepare_request_builder();
10817    /// let response = builder.poller().until_done().await?;
10818    /// # Ok(()) }
10819    ///
10820    /// fn prepare_request_builder() -> UpdateMirroringEndpointGroup {
10821    ///   # panic!();
10822    ///   // ... details omitted ...
10823    /// }
10824    /// ```
10825    #[derive(Clone, Debug)]
10826    pub struct UpdateMirroringEndpointGroup(
10827        RequestBuilder<crate::model::UpdateMirroringEndpointGroupRequest>,
10828    );
10829
10830    impl UpdateMirroringEndpointGroup {
10831        pub(crate) fn new(
10832            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10833        ) -> Self {
10834            Self(RequestBuilder::new(stub))
10835        }
10836
10837        /// Sets the full request, replacing any prior values.
10838        pub fn with_request<V: Into<crate::model::UpdateMirroringEndpointGroupRequest>>(
10839            mut self,
10840            v: V,
10841        ) -> Self {
10842            self.0.request = v.into();
10843            self
10844        }
10845
10846        /// Sets all the options, replacing any prior values.
10847        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10848            self.0.options = v.into();
10849            self
10850        }
10851
10852        /// Sends the request.
10853        ///
10854        /// # Long running operations
10855        ///
10856        /// This starts, but does not poll, a longrunning operation. More information
10857        /// on [update_mirroring_endpoint_group][crate::client::Mirroring::update_mirroring_endpoint_group].
10858        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10859            (*self.0.stub)
10860                .update_mirroring_endpoint_group(self.0.request, self.0.options)
10861                .await
10862                .map(crate::Response::into_body)
10863        }
10864
10865        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_endpoint_group`.
10866        pub fn poller(
10867            self,
10868        ) -> impl google_cloud_lro::Poller<
10869            crate::model::MirroringEndpointGroup,
10870            crate::model::OperationMetadata,
10871        > {
10872            type Operation = google_cloud_lro::internal::Operation<
10873                crate::model::MirroringEndpointGroup,
10874                crate::model::OperationMetadata,
10875            >;
10876            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10877            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10878
10879            let stub = self.0.stub.clone();
10880            let mut options = self.0.options.clone();
10881            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10882            let query = move |name| {
10883                let stub = stub.clone();
10884                let options = options.clone();
10885                async {
10886                    let op = GetOperation::new(stub)
10887                        .set_name(name)
10888                        .with_options(options)
10889                        .send()
10890                        .await?;
10891                    Ok(Operation::new(op))
10892                }
10893            };
10894
10895            let start = move || async {
10896                let op = self.send().await?;
10897                Ok(Operation::new(op))
10898            };
10899
10900            google_cloud_lro::internal::new_poller(
10901                polling_error_policy,
10902                polling_backoff_policy,
10903                start,
10904                query,
10905            )
10906        }
10907
10908        /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
10909        pub fn set_update_mask<T>(mut self, v: T) -> Self
10910        where
10911            T: std::convert::Into<wkt::FieldMask>,
10912        {
10913            self.0.request.update_mask = std::option::Option::Some(v.into());
10914            self
10915        }
10916
10917        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
10918        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10919        where
10920            T: std::convert::Into<wkt::FieldMask>,
10921        {
10922            self.0.request.update_mask = v.map(|x| x.into());
10923            self
10924        }
10925
10926        /// Sets the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
10927        ///
10928        /// This is a **required** field for requests.
10929        pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
10930        where
10931            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10932        {
10933            self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
10934            self
10935        }
10936
10937        /// Sets or clears the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
10938        ///
10939        /// This is a **required** field for requests.
10940        pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
10941        where
10942            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10943        {
10944            self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
10945            self
10946        }
10947
10948        /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupRequest::request_id].
10949        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10950            self.0.request.request_id = v.into();
10951            self
10952        }
10953    }
10954
10955    #[doc(hidden)]
10956    impl crate::RequestBuilder for UpdateMirroringEndpointGroup {
10957        fn request_options(&mut self) -> &mut crate::RequestOptions {
10958            &mut self.0.options
10959        }
10960    }
10961
10962    /// The request builder for [Mirroring::delete_mirroring_endpoint_group][crate::client::Mirroring::delete_mirroring_endpoint_group] calls.
10963    ///
10964    /// # Example
10965    /// ```
10966    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringEndpointGroup;
10967    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10968    /// use google_cloud_lro::Poller;
10969    ///
10970    /// let builder = prepare_request_builder();
10971    /// let response = builder.poller().until_done().await?;
10972    /// # Ok(()) }
10973    ///
10974    /// fn prepare_request_builder() -> DeleteMirroringEndpointGroup {
10975    ///   # panic!();
10976    ///   // ... details omitted ...
10977    /// }
10978    /// ```
10979    #[derive(Clone, Debug)]
10980    pub struct DeleteMirroringEndpointGroup(
10981        RequestBuilder<crate::model::DeleteMirroringEndpointGroupRequest>,
10982    );
10983
10984    impl DeleteMirroringEndpointGroup {
10985        pub(crate) fn new(
10986            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10987        ) -> Self {
10988            Self(RequestBuilder::new(stub))
10989        }
10990
10991        /// Sets the full request, replacing any prior values.
10992        pub fn with_request<V: Into<crate::model::DeleteMirroringEndpointGroupRequest>>(
10993            mut self,
10994            v: V,
10995        ) -> Self {
10996            self.0.request = v.into();
10997            self
10998        }
10999
11000        /// Sets all the options, replacing any prior values.
11001        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11002            self.0.options = v.into();
11003            self
11004        }
11005
11006        /// Sends the request.
11007        ///
11008        /// # Long running operations
11009        ///
11010        /// This starts, but does not poll, a longrunning operation. More information
11011        /// on [delete_mirroring_endpoint_group][crate::client::Mirroring::delete_mirroring_endpoint_group].
11012        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11013            (*self.0.stub)
11014                .delete_mirroring_endpoint_group(self.0.request, self.0.options)
11015                .await
11016                .map(crate::Response::into_body)
11017        }
11018
11019        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_endpoint_group`.
11020        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11021            type Operation =
11022                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11023            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11024            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11025
11026            let stub = self.0.stub.clone();
11027            let mut options = self.0.options.clone();
11028            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11029            let query = move |name| {
11030                let stub = stub.clone();
11031                let options = options.clone();
11032                async {
11033                    let op = GetOperation::new(stub)
11034                        .set_name(name)
11035                        .with_options(options)
11036                        .send()
11037                        .await?;
11038                    Ok(Operation::new(op))
11039                }
11040            };
11041
11042            let start = move || async {
11043                let op = self.send().await?;
11044                Ok(Operation::new(op))
11045            };
11046
11047            google_cloud_lro::internal::new_unit_response_poller(
11048                polling_error_policy,
11049                polling_backoff_policy,
11050                start,
11051                query,
11052            )
11053        }
11054
11055        /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupRequest::name].
11056        ///
11057        /// This is a **required** field for requests.
11058        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11059            self.0.request.name = v.into();
11060            self
11061        }
11062
11063        /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupRequest::request_id].
11064        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11065            self.0.request.request_id = v.into();
11066            self
11067        }
11068    }
11069
11070    #[doc(hidden)]
11071    impl crate::RequestBuilder for DeleteMirroringEndpointGroup {
11072        fn request_options(&mut self) -> &mut crate::RequestOptions {
11073            &mut self.0.options
11074        }
11075    }
11076
11077    /// The request builder for [Mirroring::list_mirroring_endpoint_group_associations][crate::client::Mirroring::list_mirroring_endpoint_group_associations] calls.
11078    ///
11079    /// # Example
11080    /// ```
11081    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringEndpointGroupAssociations;
11082    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11083    /// use google_cloud_gax::paginator::ItemPaginator;
11084    ///
11085    /// let builder = prepare_request_builder();
11086    /// let mut items = builder.by_item();
11087    /// while let Some(result) = items.next().await {
11088    ///   let item = result?;
11089    /// }
11090    /// # Ok(()) }
11091    ///
11092    /// fn prepare_request_builder() -> ListMirroringEndpointGroupAssociations {
11093    ///   # panic!();
11094    ///   // ... details omitted ...
11095    /// }
11096    /// ```
11097    #[derive(Clone, Debug)]
11098    pub struct ListMirroringEndpointGroupAssociations(
11099        RequestBuilder<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
11100    );
11101
11102    impl ListMirroringEndpointGroupAssociations {
11103        pub(crate) fn new(
11104            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11105        ) -> Self {
11106            Self(RequestBuilder::new(stub))
11107        }
11108
11109        /// Sets the full request, replacing any prior values.
11110        pub fn with_request<
11111            V: Into<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
11112        >(
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(
11128            self,
11129        ) -> Result<crate::model::ListMirroringEndpointGroupAssociationsResponse> {
11130            (*self.0.stub)
11131                .list_mirroring_endpoint_group_associations(self.0.request, self.0.options)
11132                .await
11133                .map(crate::Response::into_body)
11134        }
11135
11136        /// Streams each page in the collection.
11137        pub fn by_page(
11138            self,
11139        ) -> impl google_cloud_gax::paginator::Paginator<
11140            crate::model::ListMirroringEndpointGroupAssociationsResponse,
11141            crate::Error,
11142        > {
11143            use std::clone::Clone;
11144            let token = self.0.request.page_token.clone();
11145            let execute = move |token: String| {
11146                let mut builder = self.clone();
11147                builder.0.request = builder.0.request.set_page_token(token);
11148                builder.send()
11149            };
11150            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11151        }
11152
11153        /// Streams each item in the collection.
11154        pub fn by_item(
11155            self,
11156        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11157            crate::model::ListMirroringEndpointGroupAssociationsResponse,
11158            crate::Error,
11159        > {
11160            use google_cloud_gax::paginator::Paginator;
11161            self.by_page().items()
11162        }
11163
11164        /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupAssociationsRequest::parent].
11165        ///
11166        /// This is a **required** field for requests.
11167        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11168            self.0.request.parent = v.into();
11169            self
11170        }
11171
11172        /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_size].
11173        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11174            self.0.request.page_size = v.into();
11175            self
11176        }
11177
11178        /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_token].
11179        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11180            self.0.request.page_token = v.into();
11181            self
11182        }
11183
11184        /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupAssociationsRequest::filter].
11185        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11186            self.0.request.filter = v.into();
11187            self
11188        }
11189
11190        /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupAssociationsRequest::order_by].
11191        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11192            self.0.request.order_by = v.into();
11193            self
11194        }
11195    }
11196
11197    #[doc(hidden)]
11198    impl crate::RequestBuilder for ListMirroringEndpointGroupAssociations {
11199        fn request_options(&mut self) -> &mut crate::RequestOptions {
11200            &mut self.0.options
11201        }
11202    }
11203
11204    /// The request builder for [Mirroring::get_mirroring_endpoint_group_association][crate::client::Mirroring::get_mirroring_endpoint_group_association] calls.
11205    ///
11206    /// # Example
11207    /// ```
11208    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringEndpointGroupAssociation;
11209    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11210    ///
11211    /// let builder = prepare_request_builder();
11212    /// let response = builder.send().await?;
11213    /// # Ok(()) }
11214    ///
11215    /// fn prepare_request_builder() -> GetMirroringEndpointGroupAssociation {
11216    ///   # panic!();
11217    ///   // ... details omitted ...
11218    /// }
11219    /// ```
11220    #[derive(Clone, Debug)]
11221    pub struct GetMirroringEndpointGroupAssociation(
11222        RequestBuilder<crate::model::GetMirroringEndpointGroupAssociationRequest>,
11223    );
11224
11225    impl GetMirroringEndpointGroupAssociation {
11226        pub(crate) fn new(
11227            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11228        ) -> Self {
11229            Self(RequestBuilder::new(stub))
11230        }
11231
11232        /// Sets the full request, replacing any prior values.
11233        pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupAssociationRequest>>(
11234            mut self,
11235            v: V,
11236        ) -> Self {
11237            self.0.request = v.into();
11238            self
11239        }
11240
11241        /// Sets all the options, replacing any prior values.
11242        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11243            self.0.options = v.into();
11244            self
11245        }
11246
11247        /// Sends the request.
11248        pub async fn send(self) -> Result<crate::model::MirroringEndpointGroupAssociation> {
11249            (*self.0.stub)
11250                .get_mirroring_endpoint_group_association(self.0.request, self.0.options)
11251                .await
11252                .map(crate::Response::into_body)
11253        }
11254
11255        /// Sets the value of [name][crate::model::GetMirroringEndpointGroupAssociationRequest::name].
11256        ///
11257        /// This is a **required** field for requests.
11258        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11259            self.0.request.name = v.into();
11260            self
11261        }
11262    }
11263
11264    #[doc(hidden)]
11265    impl crate::RequestBuilder for GetMirroringEndpointGroupAssociation {
11266        fn request_options(&mut self) -> &mut crate::RequestOptions {
11267            &mut self.0.options
11268        }
11269    }
11270
11271    /// The request builder for [Mirroring::create_mirroring_endpoint_group_association][crate::client::Mirroring::create_mirroring_endpoint_group_association] calls.
11272    ///
11273    /// # Example
11274    /// ```
11275    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringEndpointGroupAssociation;
11276    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11277    /// use google_cloud_lro::Poller;
11278    ///
11279    /// let builder = prepare_request_builder();
11280    /// let response = builder.poller().until_done().await?;
11281    /// # Ok(()) }
11282    ///
11283    /// fn prepare_request_builder() -> CreateMirroringEndpointGroupAssociation {
11284    ///   # panic!();
11285    ///   // ... details omitted ...
11286    /// }
11287    /// ```
11288    #[derive(Clone, Debug)]
11289    pub struct CreateMirroringEndpointGroupAssociation(
11290        RequestBuilder<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
11291    );
11292
11293    impl CreateMirroringEndpointGroupAssociation {
11294        pub(crate) fn new(
11295            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11296        ) -> Self {
11297            Self(RequestBuilder::new(stub))
11298        }
11299
11300        /// Sets the full request, replacing any prior values.
11301        pub fn with_request<
11302            V: Into<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
11303        >(
11304            mut self,
11305            v: V,
11306        ) -> Self {
11307            self.0.request = v.into();
11308            self
11309        }
11310
11311        /// Sets all the options, replacing any prior values.
11312        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11313            self.0.options = v.into();
11314            self
11315        }
11316
11317        /// Sends the request.
11318        ///
11319        /// # Long running operations
11320        ///
11321        /// This starts, but does not poll, a longrunning operation. More information
11322        /// on [create_mirroring_endpoint_group_association][crate::client::Mirroring::create_mirroring_endpoint_group_association].
11323        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11324            (*self.0.stub)
11325                .create_mirroring_endpoint_group_association(self.0.request, self.0.options)
11326                .await
11327                .map(crate::Response::into_body)
11328        }
11329
11330        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_endpoint_group_association`.
11331        pub fn poller(
11332            self,
11333        ) -> impl google_cloud_lro::Poller<
11334            crate::model::MirroringEndpointGroupAssociation,
11335            crate::model::OperationMetadata,
11336        > {
11337            type Operation = google_cloud_lro::internal::Operation<
11338                crate::model::MirroringEndpointGroupAssociation,
11339                crate::model::OperationMetadata,
11340            >;
11341            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11342            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11343
11344            let stub = self.0.stub.clone();
11345            let mut options = self.0.options.clone();
11346            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11347            let query = move |name| {
11348                let stub = stub.clone();
11349                let options = options.clone();
11350                async {
11351                    let op = GetOperation::new(stub)
11352                        .set_name(name)
11353                        .with_options(options)
11354                        .send()
11355                        .await?;
11356                    Ok(Operation::new(op))
11357                }
11358            };
11359
11360            let start = move || async {
11361                let op = self.send().await?;
11362                Ok(Operation::new(op))
11363            };
11364
11365            google_cloud_lro::internal::new_poller(
11366                polling_error_policy,
11367                polling_backoff_policy,
11368                start,
11369                query,
11370            )
11371        }
11372
11373        /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupAssociationRequest::parent].
11374        ///
11375        /// This is a **required** field for requests.
11376        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11377            self.0.request.parent = v.into();
11378            self
11379        }
11380
11381        /// Sets the value of [mirroring_endpoint_group_association_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association_id].
11382        pub fn set_mirroring_endpoint_group_association_id<T: Into<std::string::String>>(
11383            mut self,
11384            v: T,
11385        ) -> Self {
11386            self.0.request.mirroring_endpoint_group_association_id = v.into();
11387            self
11388        }
11389
11390        /// Sets the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
11391        ///
11392        /// This is a **required** field for requests.
11393        pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
11394        where
11395            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11396        {
11397            self.0.request.mirroring_endpoint_group_association =
11398                std::option::Option::Some(v.into());
11399            self
11400        }
11401
11402        /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
11403        ///
11404        /// This is a **required** field for requests.
11405        pub fn set_or_clear_mirroring_endpoint_group_association<T>(
11406            mut self,
11407            v: std::option::Option<T>,
11408        ) -> Self
11409        where
11410            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11411        {
11412            self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
11413            self
11414        }
11415
11416        /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::request_id].
11417        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11418            self.0.request.request_id = v.into();
11419            self
11420        }
11421    }
11422
11423    #[doc(hidden)]
11424    impl crate::RequestBuilder for CreateMirroringEndpointGroupAssociation {
11425        fn request_options(&mut self) -> &mut crate::RequestOptions {
11426            &mut self.0.options
11427        }
11428    }
11429
11430    /// The request builder for [Mirroring::update_mirroring_endpoint_group_association][crate::client::Mirroring::update_mirroring_endpoint_group_association] calls.
11431    ///
11432    /// # Example
11433    /// ```
11434    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringEndpointGroupAssociation;
11435    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11436    /// use google_cloud_lro::Poller;
11437    ///
11438    /// let builder = prepare_request_builder();
11439    /// let response = builder.poller().until_done().await?;
11440    /// # Ok(()) }
11441    ///
11442    /// fn prepare_request_builder() -> UpdateMirroringEndpointGroupAssociation {
11443    ///   # panic!();
11444    ///   // ... details omitted ...
11445    /// }
11446    /// ```
11447    #[derive(Clone, Debug)]
11448    pub struct UpdateMirroringEndpointGroupAssociation(
11449        RequestBuilder<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
11450    );
11451
11452    impl UpdateMirroringEndpointGroupAssociation {
11453        pub(crate) fn new(
11454            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11455        ) -> Self {
11456            Self(RequestBuilder::new(stub))
11457        }
11458
11459        /// Sets the full request, replacing any prior values.
11460        pub fn with_request<
11461            V: Into<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
11462        >(
11463            mut self,
11464            v: V,
11465        ) -> Self {
11466            self.0.request = v.into();
11467            self
11468        }
11469
11470        /// Sets all the options, replacing any prior values.
11471        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11472            self.0.options = v.into();
11473            self
11474        }
11475
11476        /// Sends the request.
11477        ///
11478        /// # Long running operations
11479        ///
11480        /// This starts, but does not poll, a longrunning operation. More information
11481        /// on [update_mirroring_endpoint_group_association][crate::client::Mirroring::update_mirroring_endpoint_group_association].
11482        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11483            (*self.0.stub)
11484                .update_mirroring_endpoint_group_association(self.0.request, self.0.options)
11485                .await
11486                .map(crate::Response::into_body)
11487        }
11488
11489        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_endpoint_group_association`.
11490        pub fn poller(
11491            self,
11492        ) -> impl google_cloud_lro::Poller<
11493            crate::model::MirroringEndpointGroupAssociation,
11494            crate::model::OperationMetadata,
11495        > {
11496            type Operation = google_cloud_lro::internal::Operation<
11497                crate::model::MirroringEndpointGroupAssociation,
11498                crate::model::OperationMetadata,
11499            >;
11500            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11501            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11502
11503            let stub = self.0.stub.clone();
11504            let mut options = self.0.options.clone();
11505            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11506            let query = move |name| {
11507                let stub = stub.clone();
11508                let options = options.clone();
11509                async {
11510                    let op = GetOperation::new(stub)
11511                        .set_name(name)
11512                        .with_options(options)
11513                        .send()
11514                        .await?;
11515                    Ok(Operation::new(op))
11516                }
11517            };
11518
11519            let start = move || async {
11520                let op = self.send().await?;
11521                Ok(Operation::new(op))
11522            };
11523
11524            google_cloud_lro::internal::new_poller(
11525                polling_error_policy,
11526                polling_backoff_policy,
11527                start,
11528                query,
11529            )
11530        }
11531
11532        /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
11533        pub fn set_update_mask<T>(mut self, v: T) -> Self
11534        where
11535            T: std::convert::Into<wkt::FieldMask>,
11536        {
11537            self.0.request.update_mask = std::option::Option::Some(v.into());
11538            self
11539        }
11540
11541        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
11542        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11543        where
11544            T: std::convert::Into<wkt::FieldMask>,
11545        {
11546            self.0.request.update_mask = v.map(|x| x.into());
11547            self
11548        }
11549
11550        /// Sets the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
11551        ///
11552        /// This is a **required** field for requests.
11553        pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
11554        where
11555            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11556        {
11557            self.0.request.mirroring_endpoint_group_association =
11558                std::option::Option::Some(v.into());
11559            self
11560        }
11561
11562        /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
11563        ///
11564        /// This is a **required** field for requests.
11565        pub fn set_or_clear_mirroring_endpoint_group_association<T>(
11566            mut self,
11567            v: std::option::Option<T>,
11568        ) -> Self
11569        where
11570            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11571        {
11572            self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
11573            self
11574        }
11575
11576        /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupAssociationRequest::request_id].
11577        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11578            self.0.request.request_id = v.into();
11579            self
11580        }
11581    }
11582
11583    #[doc(hidden)]
11584    impl crate::RequestBuilder for UpdateMirroringEndpointGroupAssociation {
11585        fn request_options(&mut self) -> &mut crate::RequestOptions {
11586            &mut self.0.options
11587        }
11588    }
11589
11590    /// The request builder for [Mirroring::delete_mirroring_endpoint_group_association][crate::client::Mirroring::delete_mirroring_endpoint_group_association] calls.
11591    ///
11592    /// # Example
11593    /// ```
11594    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringEndpointGroupAssociation;
11595    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11596    /// use google_cloud_lro::Poller;
11597    ///
11598    /// let builder = prepare_request_builder();
11599    /// let response = builder.poller().until_done().await?;
11600    /// # Ok(()) }
11601    ///
11602    /// fn prepare_request_builder() -> DeleteMirroringEndpointGroupAssociation {
11603    ///   # panic!();
11604    ///   // ... details omitted ...
11605    /// }
11606    /// ```
11607    #[derive(Clone, Debug)]
11608    pub struct DeleteMirroringEndpointGroupAssociation(
11609        RequestBuilder<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
11610    );
11611
11612    impl DeleteMirroringEndpointGroupAssociation {
11613        pub(crate) fn new(
11614            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11615        ) -> Self {
11616            Self(RequestBuilder::new(stub))
11617        }
11618
11619        /// Sets the full request, replacing any prior values.
11620        pub fn with_request<
11621            V: Into<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
11622        >(
11623            mut self,
11624            v: V,
11625        ) -> Self {
11626            self.0.request = v.into();
11627            self
11628        }
11629
11630        /// Sets all the options, replacing any prior values.
11631        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11632            self.0.options = v.into();
11633            self
11634        }
11635
11636        /// Sends the request.
11637        ///
11638        /// # Long running operations
11639        ///
11640        /// This starts, but does not poll, a longrunning operation. More information
11641        /// on [delete_mirroring_endpoint_group_association][crate::client::Mirroring::delete_mirroring_endpoint_group_association].
11642        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11643            (*self.0.stub)
11644                .delete_mirroring_endpoint_group_association(self.0.request, self.0.options)
11645                .await
11646                .map(crate::Response::into_body)
11647        }
11648
11649        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_endpoint_group_association`.
11650        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11651            type Operation =
11652                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11653            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11654            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11655
11656            let stub = self.0.stub.clone();
11657            let mut options = self.0.options.clone();
11658            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11659            let query = move |name| {
11660                let stub = stub.clone();
11661                let options = options.clone();
11662                async {
11663                    let op = GetOperation::new(stub)
11664                        .set_name(name)
11665                        .with_options(options)
11666                        .send()
11667                        .await?;
11668                    Ok(Operation::new(op))
11669                }
11670            };
11671
11672            let start = move || async {
11673                let op = self.send().await?;
11674                Ok(Operation::new(op))
11675            };
11676
11677            google_cloud_lro::internal::new_unit_response_poller(
11678                polling_error_policy,
11679                polling_backoff_policy,
11680                start,
11681                query,
11682            )
11683        }
11684
11685        /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupAssociationRequest::name].
11686        ///
11687        /// This is a **required** field for requests.
11688        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11689            self.0.request.name = v.into();
11690            self
11691        }
11692
11693        /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupAssociationRequest::request_id].
11694        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11695            self.0.request.request_id = v.into();
11696            self
11697        }
11698    }
11699
11700    #[doc(hidden)]
11701    impl crate::RequestBuilder for DeleteMirroringEndpointGroupAssociation {
11702        fn request_options(&mut self) -> &mut crate::RequestOptions {
11703            &mut self.0.options
11704        }
11705    }
11706
11707    /// The request builder for [Mirroring::list_mirroring_deployment_groups][crate::client::Mirroring::list_mirroring_deployment_groups] calls.
11708    ///
11709    /// # Example
11710    /// ```
11711    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringDeploymentGroups;
11712    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11713    /// use google_cloud_gax::paginator::ItemPaginator;
11714    ///
11715    /// let builder = prepare_request_builder();
11716    /// let mut items = builder.by_item();
11717    /// while let Some(result) = items.next().await {
11718    ///   let item = result?;
11719    /// }
11720    /// # Ok(()) }
11721    ///
11722    /// fn prepare_request_builder() -> ListMirroringDeploymentGroups {
11723    ///   # panic!();
11724    ///   // ... details omitted ...
11725    /// }
11726    /// ```
11727    #[derive(Clone, Debug)]
11728    pub struct ListMirroringDeploymentGroups(
11729        RequestBuilder<crate::model::ListMirroringDeploymentGroupsRequest>,
11730    );
11731
11732    impl ListMirroringDeploymentGroups {
11733        pub(crate) fn new(
11734            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11735        ) -> Self {
11736            Self(RequestBuilder::new(stub))
11737        }
11738
11739        /// Sets the full request, replacing any prior values.
11740        pub fn with_request<V: Into<crate::model::ListMirroringDeploymentGroupsRequest>>(
11741            mut self,
11742            v: V,
11743        ) -> Self {
11744            self.0.request = v.into();
11745            self
11746        }
11747
11748        /// Sets all the options, replacing any prior values.
11749        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11750            self.0.options = v.into();
11751            self
11752        }
11753
11754        /// Sends the request.
11755        pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentGroupsResponse> {
11756            (*self.0.stub)
11757                .list_mirroring_deployment_groups(self.0.request, self.0.options)
11758                .await
11759                .map(crate::Response::into_body)
11760        }
11761
11762        /// Streams each page in the collection.
11763        pub fn by_page(
11764            self,
11765        ) -> impl google_cloud_gax::paginator::Paginator<
11766            crate::model::ListMirroringDeploymentGroupsResponse,
11767            crate::Error,
11768        > {
11769            use std::clone::Clone;
11770            let token = self.0.request.page_token.clone();
11771            let execute = move |token: String| {
11772                let mut builder = self.clone();
11773                builder.0.request = builder.0.request.set_page_token(token);
11774                builder.send()
11775            };
11776            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11777        }
11778
11779        /// Streams each item in the collection.
11780        pub fn by_item(
11781            self,
11782        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11783            crate::model::ListMirroringDeploymentGroupsResponse,
11784            crate::Error,
11785        > {
11786            use google_cloud_gax::paginator::Paginator;
11787            self.by_page().items()
11788        }
11789
11790        /// Sets the value of [parent][crate::model::ListMirroringDeploymentGroupsRequest::parent].
11791        ///
11792        /// This is a **required** field for requests.
11793        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11794            self.0.request.parent = v.into();
11795            self
11796        }
11797
11798        /// Sets the value of [page_size][crate::model::ListMirroringDeploymentGroupsRequest::page_size].
11799        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11800            self.0.request.page_size = v.into();
11801            self
11802        }
11803
11804        /// Sets the value of [page_token][crate::model::ListMirroringDeploymentGroupsRequest::page_token].
11805        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11806            self.0.request.page_token = v.into();
11807            self
11808        }
11809
11810        /// Sets the value of [filter][crate::model::ListMirroringDeploymentGroupsRequest::filter].
11811        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11812            self.0.request.filter = v.into();
11813            self
11814        }
11815
11816        /// Sets the value of [order_by][crate::model::ListMirroringDeploymentGroupsRequest::order_by].
11817        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11818            self.0.request.order_by = v.into();
11819            self
11820        }
11821    }
11822
11823    #[doc(hidden)]
11824    impl crate::RequestBuilder for ListMirroringDeploymentGroups {
11825        fn request_options(&mut self) -> &mut crate::RequestOptions {
11826            &mut self.0.options
11827        }
11828    }
11829
11830    /// The request builder for [Mirroring::get_mirroring_deployment_group][crate::client::Mirroring::get_mirroring_deployment_group] calls.
11831    ///
11832    /// # Example
11833    /// ```
11834    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringDeploymentGroup;
11835    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11836    ///
11837    /// let builder = prepare_request_builder();
11838    /// let response = builder.send().await?;
11839    /// # Ok(()) }
11840    ///
11841    /// fn prepare_request_builder() -> GetMirroringDeploymentGroup {
11842    ///   # panic!();
11843    ///   // ... details omitted ...
11844    /// }
11845    /// ```
11846    #[derive(Clone, Debug)]
11847    pub struct GetMirroringDeploymentGroup(
11848        RequestBuilder<crate::model::GetMirroringDeploymentGroupRequest>,
11849    );
11850
11851    impl GetMirroringDeploymentGroup {
11852        pub(crate) fn new(
11853            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11854        ) -> Self {
11855            Self(RequestBuilder::new(stub))
11856        }
11857
11858        /// Sets the full request, replacing any prior values.
11859        pub fn with_request<V: Into<crate::model::GetMirroringDeploymentGroupRequest>>(
11860            mut self,
11861            v: V,
11862        ) -> Self {
11863            self.0.request = v.into();
11864            self
11865        }
11866
11867        /// Sets all the options, replacing any prior values.
11868        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11869            self.0.options = v.into();
11870            self
11871        }
11872
11873        /// Sends the request.
11874        pub async fn send(self) -> Result<crate::model::MirroringDeploymentGroup> {
11875            (*self.0.stub)
11876                .get_mirroring_deployment_group(self.0.request, self.0.options)
11877                .await
11878                .map(crate::Response::into_body)
11879        }
11880
11881        /// Sets the value of [name][crate::model::GetMirroringDeploymentGroupRequest::name].
11882        ///
11883        /// This is a **required** field for requests.
11884        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11885            self.0.request.name = v.into();
11886            self
11887        }
11888    }
11889
11890    #[doc(hidden)]
11891    impl crate::RequestBuilder for GetMirroringDeploymentGroup {
11892        fn request_options(&mut self) -> &mut crate::RequestOptions {
11893            &mut self.0.options
11894        }
11895    }
11896
11897    /// The request builder for [Mirroring::create_mirroring_deployment_group][crate::client::Mirroring::create_mirroring_deployment_group] calls.
11898    ///
11899    /// # Example
11900    /// ```
11901    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringDeploymentGroup;
11902    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11903    /// use google_cloud_lro::Poller;
11904    ///
11905    /// let builder = prepare_request_builder();
11906    /// let response = builder.poller().until_done().await?;
11907    /// # Ok(()) }
11908    ///
11909    /// fn prepare_request_builder() -> CreateMirroringDeploymentGroup {
11910    ///   # panic!();
11911    ///   // ... details omitted ...
11912    /// }
11913    /// ```
11914    #[derive(Clone, Debug)]
11915    pub struct CreateMirroringDeploymentGroup(
11916        RequestBuilder<crate::model::CreateMirroringDeploymentGroupRequest>,
11917    );
11918
11919    impl CreateMirroringDeploymentGroup {
11920        pub(crate) fn new(
11921            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11922        ) -> Self {
11923            Self(RequestBuilder::new(stub))
11924        }
11925
11926        /// Sets the full request, replacing any prior values.
11927        pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentGroupRequest>>(
11928            mut self,
11929            v: V,
11930        ) -> Self {
11931            self.0.request = v.into();
11932            self
11933        }
11934
11935        /// Sets all the options, replacing any prior values.
11936        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11937            self.0.options = v.into();
11938            self
11939        }
11940
11941        /// Sends the request.
11942        ///
11943        /// # Long running operations
11944        ///
11945        /// This starts, but does not poll, a longrunning operation. More information
11946        /// on [create_mirroring_deployment_group][crate::client::Mirroring::create_mirroring_deployment_group].
11947        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11948            (*self.0.stub)
11949                .create_mirroring_deployment_group(self.0.request, self.0.options)
11950                .await
11951                .map(crate::Response::into_body)
11952        }
11953
11954        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_deployment_group`.
11955        pub fn poller(
11956            self,
11957        ) -> impl google_cloud_lro::Poller<
11958            crate::model::MirroringDeploymentGroup,
11959            crate::model::OperationMetadata,
11960        > {
11961            type Operation = google_cloud_lro::internal::Operation<
11962                crate::model::MirroringDeploymentGroup,
11963                crate::model::OperationMetadata,
11964            >;
11965            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11966            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11967
11968            let stub = self.0.stub.clone();
11969            let mut options = self.0.options.clone();
11970            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11971            let query = move |name| {
11972                let stub = stub.clone();
11973                let options = options.clone();
11974                async {
11975                    let op = GetOperation::new(stub)
11976                        .set_name(name)
11977                        .with_options(options)
11978                        .send()
11979                        .await?;
11980                    Ok(Operation::new(op))
11981                }
11982            };
11983
11984            let start = move || async {
11985                let op = self.send().await?;
11986                Ok(Operation::new(op))
11987            };
11988
11989            google_cloud_lro::internal::new_poller(
11990                polling_error_policy,
11991                polling_backoff_policy,
11992                start,
11993                query,
11994            )
11995        }
11996
11997        /// Sets the value of [parent][crate::model::CreateMirroringDeploymentGroupRequest::parent].
11998        ///
11999        /// This is a **required** field for requests.
12000        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12001            self.0.request.parent = v.into();
12002            self
12003        }
12004
12005        /// Sets the value of [mirroring_deployment_group_id][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group_id].
12006        ///
12007        /// This is a **required** field for requests.
12008        pub fn set_mirroring_deployment_group_id<T: Into<std::string::String>>(
12009            mut self,
12010            v: T,
12011        ) -> Self {
12012            self.0.request.mirroring_deployment_group_id = v.into();
12013            self
12014        }
12015
12016        /// Sets the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
12017        ///
12018        /// This is a **required** field for requests.
12019        pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
12020        where
12021            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12022        {
12023            self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
12024            self
12025        }
12026
12027        /// Sets or clears the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
12028        ///
12029        /// This is a **required** field for requests.
12030        pub fn set_or_clear_mirroring_deployment_group<T>(
12031            mut self,
12032            v: std::option::Option<T>,
12033        ) -> Self
12034        where
12035            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12036        {
12037            self.0.request.mirroring_deployment_group = v.map(|x| x.into());
12038            self
12039        }
12040
12041        /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentGroupRequest::request_id].
12042        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12043            self.0.request.request_id = v.into();
12044            self
12045        }
12046    }
12047
12048    #[doc(hidden)]
12049    impl crate::RequestBuilder for CreateMirroringDeploymentGroup {
12050        fn request_options(&mut self) -> &mut crate::RequestOptions {
12051            &mut self.0.options
12052        }
12053    }
12054
12055    /// The request builder for [Mirroring::update_mirroring_deployment_group][crate::client::Mirroring::update_mirroring_deployment_group] calls.
12056    ///
12057    /// # Example
12058    /// ```
12059    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringDeploymentGroup;
12060    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12061    /// use google_cloud_lro::Poller;
12062    ///
12063    /// let builder = prepare_request_builder();
12064    /// let response = builder.poller().until_done().await?;
12065    /// # Ok(()) }
12066    ///
12067    /// fn prepare_request_builder() -> UpdateMirroringDeploymentGroup {
12068    ///   # panic!();
12069    ///   // ... details omitted ...
12070    /// }
12071    /// ```
12072    #[derive(Clone, Debug)]
12073    pub struct UpdateMirroringDeploymentGroup(
12074        RequestBuilder<crate::model::UpdateMirroringDeploymentGroupRequest>,
12075    );
12076
12077    impl UpdateMirroringDeploymentGroup {
12078        pub(crate) fn new(
12079            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12080        ) -> Self {
12081            Self(RequestBuilder::new(stub))
12082        }
12083
12084        /// Sets the full request, replacing any prior values.
12085        pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentGroupRequest>>(
12086            mut self,
12087            v: V,
12088        ) -> Self {
12089            self.0.request = v.into();
12090            self
12091        }
12092
12093        /// Sets all the options, replacing any prior values.
12094        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12095            self.0.options = v.into();
12096            self
12097        }
12098
12099        /// Sends the request.
12100        ///
12101        /// # Long running operations
12102        ///
12103        /// This starts, but does not poll, a longrunning operation. More information
12104        /// on [update_mirroring_deployment_group][crate::client::Mirroring::update_mirroring_deployment_group].
12105        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12106            (*self.0.stub)
12107                .update_mirroring_deployment_group(self.0.request, self.0.options)
12108                .await
12109                .map(crate::Response::into_body)
12110        }
12111
12112        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_deployment_group`.
12113        pub fn poller(
12114            self,
12115        ) -> impl google_cloud_lro::Poller<
12116            crate::model::MirroringDeploymentGroup,
12117            crate::model::OperationMetadata,
12118        > {
12119            type Operation = google_cloud_lro::internal::Operation<
12120                crate::model::MirroringDeploymentGroup,
12121                crate::model::OperationMetadata,
12122            >;
12123            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12124            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12125
12126            let stub = self.0.stub.clone();
12127            let mut options = self.0.options.clone();
12128            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12129            let query = move |name| {
12130                let stub = stub.clone();
12131                let options = options.clone();
12132                async {
12133                    let op = GetOperation::new(stub)
12134                        .set_name(name)
12135                        .with_options(options)
12136                        .send()
12137                        .await?;
12138                    Ok(Operation::new(op))
12139                }
12140            };
12141
12142            let start = move || async {
12143                let op = self.send().await?;
12144                Ok(Operation::new(op))
12145            };
12146
12147            google_cloud_lro::internal::new_poller(
12148                polling_error_policy,
12149                polling_backoff_policy,
12150                start,
12151                query,
12152            )
12153        }
12154
12155        /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
12156        pub fn set_update_mask<T>(mut self, v: T) -> Self
12157        where
12158            T: std::convert::Into<wkt::FieldMask>,
12159        {
12160            self.0.request.update_mask = std::option::Option::Some(v.into());
12161            self
12162        }
12163
12164        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
12165        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12166        where
12167            T: std::convert::Into<wkt::FieldMask>,
12168        {
12169            self.0.request.update_mask = v.map(|x| x.into());
12170            self
12171        }
12172
12173        /// Sets the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
12174        ///
12175        /// This is a **required** field for requests.
12176        pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
12177        where
12178            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12179        {
12180            self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
12181            self
12182        }
12183
12184        /// Sets or clears the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
12185        ///
12186        /// This is a **required** field for requests.
12187        pub fn set_or_clear_mirroring_deployment_group<T>(
12188            mut self,
12189            v: std::option::Option<T>,
12190        ) -> Self
12191        where
12192            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12193        {
12194            self.0.request.mirroring_deployment_group = v.map(|x| x.into());
12195            self
12196        }
12197
12198        /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentGroupRequest::request_id].
12199        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12200            self.0.request.request_id = v.into();
12201            self
12202        }
12203    }
12204
12205    #[doc(hidden)]
12206    impl crate::RequestBuilder for UpdateMirroringDeploymentGroup {
12207        fn request_options(&mut self) -> &mut crate::RequestOptions {
12208            &mut self.0.options
12209        }
12210    }
12211
12212    /// The request builder for [Mirroring::delete_mirroring_deployment_group][crate::client::Mirroring::delete_mirroring_deployment_group] calls.
12213    ///
12214    /// # Example
12215    /// ```
12216    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringDeploymentGroup;
12217    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12218    /// use google_cloud_lro::Poller;
12219    ///
12220    /// let builder = prepare_request_builder();
12221    /// let response = builder.poller().until_done().await?;
12222    /// # Ok(()) }
12223    ///
12224    /// fn prepare_request_builder() -> DeleteMirroringDeploymentGroup {
12225    ///   # panic!();
12226    ///   // ... details omitted ...
12227    /// }
12228    /// ```
12229    #[derive(Clone, Debug)]
12230    pub struct DeleteMirroringDeploymentGroup(
12231        RequestBuilder<crate::model::DeleteMirroringDeploymentGroupRequest>,
12232    );
12233
12234    impl DeleteMirroringDeploymentGroup {
12235        pub(crate) fn new(
12236            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12237        ) -> Self {
12238            Self(RequestBuilder::new(stub))
12239        }
12240
12241        /// Sets the full request, replacing any prior values.
12242        pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentGroupRequest>>(
12243            mut self,
12244            v: V,
12245        ) -> Self {
12246            self.0.request = v.into();
12247            self
12248        }
12249
12250        /// Sets all the options, replacing any prior values.
12251        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12252            self.0.options = v.into();
12253            self
12254        }
12255
12256        /// Sends the request.
12257        ///
12258        /// # Long running operations
12259        ///
12260        /// This starts, but does not poll, a longrunning operation. More information
12261        /// on [delete_mirroring_deployment_group][crate::client::Mirroring::delete_mirroring_deployment_group].
12262        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12263            (*self.0.stub)
12264                .delete_mirroring_deployment_group(self.0.request, self.0.options)
12265                .await
12266                .map(crate::Response::into_body)
12267        }
12268
12269        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_deployment_group`.
12270        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12271            type Operation =
12272                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12273            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12274            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12275
12276            let stub = self.0.stub.clone();
12277            let mut options = self.0.options.clone();
12278            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12279            let query = move |name| {
12280                let stub = stub.clone();
12281                let options = options.clone();
12282                async {
12283                    let op = GetOperation::new(stub)
12284                        .set_name(name)
12285                        .with_options(options)
12286                        .send()
12287                        .await?;
12288                    Ok(Operation::new(op))
12289                }
12290            };
12291
12292            let start = move || async {
12293                let op = self.send().await?;
12294                Ok(Operation::new(op))
12295            };
12296
12297            google_cloud_lro::internal::new_unit_response_poller(
12298                polling_error_policy,
12299                polling_backoff_policy,
12300                start,
12301                query,
12302            )
12303        }
12304
12305        /// Sets the value of [name][crate::model::DeleteMirroringDeploymentGroupRequest::name].
12306        ///
12307        /// This is a **required** field for requests.
12308        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12309            self.0.request.name = v.into();
12310            self
12311        }
12312
12313        /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentGroupRequest::request_id].
12314        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12315            self.0.request.request_id = v.into();
12316            self
12317        }
12318    }
12319
12320    #[doc(hidden)]
12321    impl crate::RequestBuilder for DeleteMirroringDeploymentGroup {
12322        fn request_options(&mut self) -> &mut crate::RequestOptions {
12323            &mut self.0.options
12324        }
12325    }
12326
12327    /// The request builder for [Mirroring::list_mirroring_deployments][crate::client::Mirroring::list_mirroring_deployments] calls.
12328    ///
12329    /// # Example
12330    /// ```
12331    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringDeployments;
12332    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12333    /// use google_cloud_gax::paginator::ItemPaginator;
12334    ///
12335    /// let builder = prepare_request_builder();
12336    /// let mut items = builder.by_item();
12337    /// while let Some(result) = items.next().await {
12338    ///   let item = result?;
12339    /// }
12340    /// # Ok(()) }
12341    ///
12342    /// fn prepare_request_builder() -> ListMirroringDeployments {
12343    ///   # panic!();
12344    ///   // ... details omitted ...
12345    /// }
12346    /// ```
12347    #[derive(Clone, Debug)]
12348    pub struct ListMirroringDeployments(
12349        RequestBuilder<crate::model::ListMirroringDeploymentsRequest>,
12350    );
12351
12352    impl ListMirroringDeployments {
12353        pub(crate) fn new(
12354            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12355        ) -> Self {
12356            Self(RequestBuilder::new(stub))
12357        }
12358
12359        /// Sets the full request, replacing any prior values.
12360        pub fn with_request<V: Into<crate::model::ListMirroringDeploymentsRequest>>(
12361            mut self,
12362            v: V,
12363        ) -> Self {
12364            self.0.request = v.into();
12365            self
12366        }
12367
12368        /// Sets all the options, replacing any prior values.
12369        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12370            self.0.options = v.into();
12371            self
12372        }
12373
12374        /// Sends the request.
12375        pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentsResponse> {
12376            (*self.0.stub)
12377                .list_mirroring_deployments(self.0.request, self.0.options)
12378                .await
12379                .map(crate::Response::into_body)
12380        }
12381
12382        /// Streams each page in the collection.
12383        pub fn by_page(
12384            self,
12385        ) -> impl google_cloud_gax::paginator::Paginator<
12386            crate::model::ListMirroringDeploymentsResponse,
12387            crate::Error,
12388        > {
12389            use std::clone::Clone;
12390            let token = self.0.request.page_token.clone();
12391            let execute = move |token: String| {
12392                let mut builder = self.clone();
12393                builder.0.request = builder.0.request.set_page_token(token);
12394                builder.send()
12395            };
12396            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12397        }
12398
12399        /// Streams each item in the collection.
12400        pub fn by_item(
12401            self,
12402        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12403            crate::model::ListMirroringDeploymentsResponse,
12404            crate::Error,
12405        > {
12406            use google_cloud_gax::paginator::Paginator;
12407            self.by_page().items()
12408        }
12409
12410        /// Sets the value of [parent][crate::model::ListMirroringDeploymentsRequest::parent].
12411        ///
12412        /// This is a **required** field for requests.
12413        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12414            self.0.request.parent = v.into();
12415            self
12416        }
12417
12418        /// Sets the value of [page_size][crate::model::ListMirroringDeploymentsRequest::page_size].
12419        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12420            self.0.request.page_size = v.into();
12421            self
12422        }
12423
12424        /// Sets the value of [page_token][crate::model::ListMirroringDeploymentsRequest::page_token].
12425        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12426            self.0.request.page_token = v.into();
12427            self
12428        }
12429
12430        /// Sets the value of [filter][crate::model::ListMirroringDeploymentsRequest::filter].
12431        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12432            self.0.request.filter = v.into();
12433            self
12434        }
12435
12436        /// Sets the value of [order_by][crate::model::ListMirroringDeploymentsRequest::order_by].
12437        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12438            self.0.request.order_by = v.into();
12439            self
12440        }
12441    }
12442
12443    #[doc(hidden)]
12444    impl crate::RequestBuilder for ListMirroringDeployments {
12445        fn request_options(&mut self) -> &mut crate::RequestOptions {
12446            &mut self.0.options
12447        }
12448    }
12449
12450    /// The request builder for [Mirroring::get_mirroring_deployment][crate::client::Mirroring::get_mirroring_deployment] calls.
12451    ///
12452    /// # Example
12453    /// ```
12454    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringDeployment;
12455    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12456    ///
12457    /// let builder = prepare_request_builder();
12458    /// let response = builder.send().await?;
12459    /// # Ok(()) }
12460    ///
12461    /// fn prepare_request_builder() -> GetMirroringDeployment {
12462    ///   # panic!();
12463    ///   // ... details omitted ...
12464    /// }
12465    /// ```
12466    #[derive(Clone, Debug)]
12467    pub struct GetMirroringDeployment(RequestBuilder<crate::model::GetMirroringDeploymentRequest>);
12468
12469    impl GetMirroringDeployment {
12470        pub(crate) fn new(
12471            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12472        ) -> Self {
12473            Self(RequestBuilder::new(stub))
12474        }
12475
12476        /// Sets the full request, replacing any prior values.
12477        pub fn with_request<V: Into<crate::model::GetMirroringDeploymentRequest>>(
12478            mut self,
12479            v: V,
12480        ) -> Self {
12481            self.0.request = v.into();
12482            self
12483        }
12484
12485        /// Sets all the options, replacing any prior values.
12486        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12487            self.0.options = v.into();
12488            self
12489        }
12490
12491        /// Sends the request.
12492        pub async fn send(self) -> Result<crate::model::MirroringDeployment> {
12493            (*self.0.stub)
12494                .get_mirroring_deployment(self.0.request, self.0.options)
12495                .await
12496                .map(crate::Response::into_body)
12497        }
12498
12499        /// Sets the value of [name][crate::model::GetMirroringDeploymentRequest::name].
12500        ///
12501        /// This is a **required** field for requests.
12502        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12503            self.0.request.name = v.into();
12504            self
12505        }
12506    }
12507
12508    #[doc(hidden)]
12509    impl crate::RequestBuilder for GetMirroringDeployment {
12510        fn request_options(&mut self) -> &mut crate::RequestOptions {
12511            &mut self.0.options
12512        }
12513    }
12514
12515    /// The request builder for [Mirroring::create_mirroring_deployment][crate::client::Mirroring::create_mirroring_deployment] calls.
12516    ///
12517    /// # Example
12518    /// ```
12519    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringDeployment;
12520    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12521    /// use google_cloud_lro::Poller;
12522    ///
12523    /// let builder = prepare_request_builder();
12524    /// let response = builder.poller().until_done().await?;
12525    /// # Ok(()) }
12526    ///
12527    /// fn prepare_request_builder() -> CreateMirroringDeployment {
12528    ///   # panic!();
12529    ///   // ... details omitted ...
12530    /// }
12531    /// ```
12532    #[derive(Clone, Debug)]
12533    pub struct CreateMirroringDeployment(
12534        RequestBuilder<crate::model::CreateMirroringDeploymentRequest>,
12535    );
12536
12537    impl CreateMirroringDeployment {
12538        pub(crate) fn new(
12539            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12540        ) -> Self {
12541            Self(RequestBuilder::new(stub))
12542        }
12543
12544        /// Sets the full request, replacing any prior values.
12545        pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentRequest>>(
12546            mut self,
12547            v: V,
12548        ) -> Self {
12549            self.0.request = v.into();
12550            self
12551        }
12552
12553        /// Sets all the options, replacing any prior values.
12554        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12555            self.0.options = v.into();
12556            self
12557        }
12558
12559        /// Sends the request.
12560        ///
12561        /// # Long running operations
12562        ///
12563        /// This starts, but does not poll, a longrunning operation. More information
12564        /// on [create_mirroring_deployment][crate::client::Mirroring::create_mirroring_deployment].
12565        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12566            (*self.0.stub)
12567                .create_mirroring_deployment(self.0.request, self.0.options)
12568                .await
12569                .map(crate::Response::into_body)
12570        }
12571
12572        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_deployment`.
12573        pub fn poller(
12574            self,
12575        ) -> impl google_cloud_lro::Poller<
12576            crate::model::MirroringDeployment,
12577            crate::model::OperationMetadata,
12578        > {
12579            type Operation = google_cloud_lro::internal::Operation<
12580                crate::model::MirroringDeployment,
12581                crate::model::OperationMetadata,
12582            >;
12583            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12584            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12585
12586            let stub = self.0.stub.clone();
12587            let mut options = self.0.options.clone();
12588            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12589            let query = move |name| {
12590                let stub = stub.clone();
12591                let options = options.clone();
12592                async {
12593                    let op = GetOperation::new(stub)
12594                        .set_name(name)
12595                        .with_options(options)
12596                        .send()
12597                        .await?;
12598                    Ok(Operation::new(op))
12599                }
12600            };
12601
12602            let start = move || async {
12603                let op = self.send().await?;
12604                Ok(Operation::new(op))
12605            };
12606
12607            google_cloud_lro::internal::new_poller(
12608                polling_error_policy,
12609                polling_backoff_policy,
12610                start,
12611                query,
12612            )
12613        }
12614
12615        /// Sets the value of [parent][crate::model::CreateMirroringDeploymentRequest::parent].
12616        ///
12617        /// This is a **required** field for requests.
12618        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12619            self.0.request.parent = v.into();
12620            self
12621        }
12622
12623        /// Sets the value of [mirroring_deployment_id][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment_id].
12624        ///
12625        /// This is a **required** field for requests.
12626        pub fn set_mirroring_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12627            self.0.request.mirroring_deployment_id = v.into();
12628            self
12629        }
12630
12631        /// Sets the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
12632        ///
12633        /// This is a **required** field for requests.
12634        pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
12635        where
12636            T: std::convert::Into<crate::model::MirroringDeployment>,
12637        {
12638            self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
12639            self
12640        }
12641
12642        /// Sets or clears the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
12643        ///
12644        /// This is a **required** field for requests.
12645        pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
12646        where
12647            T: std::convert::Into<crate::model::MirroringDeployment>,
12648        {
12649            self.0.request.mirroring_deployment = v.map(|x| x.into());
12650            self
12651        }
12652
12653        /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentRequest::request_id].
12654        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12655            self.0.request.request_id = v.into();
12656            self
12657        }
12658    }
12659
12660    #[doc(hidden)]
12661    impl crate::RequestBuilder for CreateMirroringDeployment {
12662        fn request_options(&mut self) -> &mut crate::RequestOptions {
12663            &mut self.0.options
12664        }
12665    }
12666
12667    /// The request builder for [Mirroring::update_mirroring_deployment][crate::client::Mirroring::update_mirroring_deployment] calls.
12668    ///
12669    /// # Example
12670    /// ```
12671    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringDeployment;
12672    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12673    /// use google_cloud_lro::Poller;
12674    ///
12675    /// let builder = prepare_request_builder();
12676    /// let response = builder.poller().until_done().await?;
12677    /// # Ok(()) }
12678    ///
12679    /// fn prepare_request_builder() -> UpdateMirroringDeployment {
12680    ///   # panic!();
12681    ///   // ... details omitted ...
12682    /// }
12683    /// ```
12684    #[derive(Clone, Debug)]
12685    pub struct UpdateMirroringDeployment(
12686        RequestBuilder<crate::model::UpdateMirroringDeploymentRequest>,
12687    );
12688
12689    impl UpdateMirroringDeployment {
12690        pub(crate) fn new(
12691            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12692        ) -> Self {
12693            Self(RequestBuilder::new(stub))
12694        }
12695
12696        /// Sets the full request, replacing any prior values.
12697        pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentRequest>>(
12698            mut self,
12699            v: V,
12700        ) -> Self {
12701            self.0.request = v.into();
12702            self
12703        }
12704
12705        /// Sets all the options, replacing any prior values.
12706        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12707            self.0.options = v.into();
12708            self
12709        }
12710
12711        /// Sends the request.
12712        ///
12713        /// # Long running operations
12714        ///
12715        /// This starts, but does not poll, a longrunning operation. More information
12716        /// on [update_mirroring_deployment][crate::client::Mirroring::update_mirroring_deployment].
12717        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12718            (*self.0.stub)
12719                .update_mirroring_deployment(self.0.request, self.0.options)
12720                .await
12721                .map(crate::Response::into_body)
12722        }
12723
12724        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_deployment`.
12725        pub fn poller(
12726            self,
12727        ) -> impl google_cloud_lro::Poller<
12728            crate::model::MirroringDeployment,
12729            crate::model::OperationMetadata,
12730        > {
12731            type Operation = google_cloud_lro::internal::Operation<
12732                crate::model::MirroringDeployment,
12733                crate::model::OperationMetadata,
12734            >;
12735            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12736            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12737
12738            let stub = self.0.stub.clone();
12739            let mut options = self.0.options.clone();
12740            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12741            let query = move |name| {
12742                let stub = stub.clone();
12743                let options = options.clone();
12744                async {
12745                    let op = GetOperation::new(stub)
12746                        .set_name(name)
12747                        .with_options(options)
12748                        .send()
12749                        .await?;
12750                    Ok(Operation::new(op))
12751                }
12752            };
12753
12754            let start = move || async {
12755                let op = self.send().await?;
12756                Ok(Operation::new(op))
12757            };
12758
12759            google_cloud_lro::internal::new_poller(
12760                polling_error_policy,
12761                polling_backoff_policy,
12762                start,
12763                query,
12764            )
12765        }
12766
12767        /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
12768        pub fn set_update_mask<T>(mut self, v: T) -> Self
12769        where
12770            T: std::convert::Into<wkt::FieldMask>,
12771        {
12772            self.0.request.update_mask = std::option::Option::Some(v.into());
12773            self
12774        }
12775
12776        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
12777        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12778        where
12779            T: std::convert::Into<wkt::FieldMask>,
12780        {
12781            self.0.request.update_mask = v.map(|x| x.into());
12782            self
12783        }
12784
12785        /// Sets the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
12786        ///
12787        /// This is a **required** field for requests.
12788        pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
12789        where
12790            T: std::convert::Into<crate::model::MirroringDeployment>,
12791        {
12792            self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
12793            self
12794        }
12795
12796        /// Sets or clears the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
12797        ///
12798        /// This is a **required** field for requests.
12799        pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
12800        where
12801            T: std::convert::Into<crate::model::MirroringDeployment>,
12802        {
12803            self.0.request.mirroring_deployment = v.map(|x| x.into());
12804            self
12805        }
12806
12807        /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentRequest::request_id].
12808        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12809            self.0.request.request_id = v.into();
12810            self
12811        }
12812    }
12813
12814    #[doc(hidden)]
12815    impl crate::RequestBuilder for UpdateMirroringDeployment {
12816        fn request_options(&mut self) -> &mut crate::RequestOptions {
12817            &mut self.0.options
12818        }
12819    }
12820
12821    /// The request builder for [Mirroring::delete_mirroring_deployment][crate::client::Mirroring::delete_mirroring_deployment] calls.
12822    ///
12823    /// # Example
12824    /// ```
12825    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringDeployment;
12826    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12827    /// use google_cloud_lro::Poller;
12828    ///
12829    /// let builder = prepare_request_builder();
12830    /// let response = builder.poller().until_done().await?;
12831    /// # Ok(()) }
12832    ///
12833    /// fn prepare_request_builder() -> DeleteMirroringDeployment {
12834    ///   # panic!();
12835    ///   // ... details omitted ...
12836    /// }
12837    /// ```
12838    #[derive(Clone, Debug)]
12839    pub struct DeleteMirroringDeployment(
12840        RequestBuilder<crate::model::DeleteMirroringDeploymentRequest>,
12841    );
12842
12843    impl DeleteMirroringDeployment {
12844        pub(crate) fn new(
12845            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12846        ) -> Self {
12847            Self(RequestBuilder::new(stub))
12848        }
12849
12850        /// Sets the full request, replacing any prior values.
12851        pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentRequest>>(
12852            mut self,
12853            v: V,
12854        ) -> Self {
12855            self.0.request = v.into();
12856            self
12857        }
12858
12859        /// Sets all the options, replacing any prior values.
12860        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12861            self.0.options = v.into();
12862            self
12863        }
12864
12865        /// Sends the request.
12866        ///
12867        /// # Long running operations
12868        ///
12869        /// This starts, but does not poll, a longrunning operation. More information
12870        /// on [delete_mirroring_deployment][crate::client::Mirroring::delete_mirroring_deployment].
12871        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12872            (*self.0.stub)
12873                .delete_mirroring_deployment(self.0.request, self.0.options)
12874                .await
12875                .map(crate::Response::into_body)
12876        }
12877
12878        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_deployment`.
12879        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12880            type Operation =
12881                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12882            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12883            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12884
12885            let stub = self.0.stub.clone();
12886            let mut options = self.0.options.clone();
12887            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12888            let query = move |name| {
12889                let stub = stub.clone();
12890                let options = options.clone();
12891                async {
12892                    let op = GetOperation::new(stub)
12893                        .set_name(name)
12894                        .with_options(options)
12895                        .send()
12896                        .await?;
12897                    Ok(Operation::new(op))
12898                }
12899            };
12900
12901            let start = move || async {
12902                let op = self.send().await?;
12903                Ok(Operation::new(op))
12904            };
12905
12906            google_cloud_lro::internal::new_unit_response_poller(
12907                polling_error_policy,
12908                polling_backoff_policy,
12909                start,
12910                query,
12911            )
12912        }
12913
12914        /// Sets the value of [name][crate::model::DeleteMirroringDeploymentRequest::name].
12915        ///
12916        /// This is a **required** field for requests.
12917        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12918            self.0.request.name = v.into();
12919            self
12920        }
12921
12922        /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentRequest::request_id].
12923        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12924            self.0.request.request_id = v.into();
12925            self
12926        }
12927    }
12928
12929    #[doc(hidden)]
12930    impl crate::RequestBuilder for DeleteMirroringDeployment {
12931        fn request_options(&mut self) -> &mut crate::RequestOptions {
12932            &mut self.0.options
12933        }
12934    }
12935
12936    /// The request builder for [Mirroring::list_locations][crate::client::Mirroring::list_locations] calls.
12937    ///
12938    /// # Example
12939    /// ```
12940    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListLocations;
12941    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12942    /// use google_cloud_gax::paginator::ItemPaginator;
12943    ///
12944    /// let builder = prepare_request_builder();
12945    /// let mut items = builder.by_item();
12946    /// while let Some(result) = items.next().await {
12947    ///   let item = result?;
12948    /// }
12949    /// # Ok(()) }
12950    ///
12951    /// fn prepare_request_builder() -> ListLocations {
12952    ///   # panic!();
12953    ///   // ... details omitted ...
12954    /// }
12955    /// ```
12956    #[derive(Clone, Debug)]
12957    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
12958
12959    impl ListLocations {
12960        pub(crate) fn new(
12961            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12962        ) -> Self {
12963            Self(RequestBuilder::new(stub))
12964        }
12965
12966        /// Sets the full request, replacing any prior values.
12967        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
12968            mut self,
12969            v: V,
12970        ) -> Self {
12971            self.0.request = v.into();
12972            self
12973        }
12974
12975        /// Sets all the options, replacing any prior values.
12976        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12977            self.0.options = v.into();
12978            self
12979        }
12980
12981        /// Sends the request.
12982        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
12983            (*self.0.stub)
12984                .list_locations(self.0.request, self.0.options)
12985                .await
12986                .map(crate::Response::into_body)
12987        }
12988
12989        /// Streams each page in the collection.
12990        pub fn by_page(
12991            self,
12992        ) -> impl google_cloud_gax::paginator::Paginator<
12993            google_cloud_location::model::ListLocationsResponse,
12994            crate::Error,
12995        > {
12996            use std::clone::Clone;
12997            let token = self.0.request.page_token.clone();
12998            let execute = move |token: String| {
12999                let mut builder = self.clone();
13000                builder.0.request = builder.0.request.set_page_token(token);
13001                builder.send()
13002            };
13003            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13004        }
13005
13006        /// Streams each item in the collection.
13007        pub fn by_item(
13008            self,
13009        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13010            google_cloud_location::model::ListLocationsResponse,
13011            crate::Error,
13012        > {
13013            use google_cloud_gax::paginator::Paginator;
13014            self.by_page().items()
13015        }
13016
13017        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
13018        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13019            self.0.request.name = v.into();
13020            self
13021        }
13022
13023        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
13024        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13025            self.0.request.filter = v.into();
13026            self
13027        }
13028
13029        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
13030        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13031            self.0.request.page_size = v.into();
13032            self
13033        }
13034
13035        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
13036        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13037            self.0.request.page_token = v.into();
13038            self
13039        }
13040    }
13041
13042    #[doc(hidden)]
13043    impl crate::RequestBuilder for ListLocations {
13044        fn request_options(&mut self) -> &mut crate::RequestOptions {
13045            &mut self.0.options
13046        }
13047    }
13048
13049    /// The request builder for [Mirroring::get_location][crate::client::Mirroring::get_location] calls.
13050    ///
13051    /// # Example
13052    /// ```
13053    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetLocation;
13054    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13055    ///
13056    /// let builder = prepare_request_builder();
13057    /// let response = builder.send().await?;
13058    /// # Ok(()) }
13059    ///
13060    /// fn prepare_request_builder() -> GetLocation {
13061    ///   # panic!();
13062    ///   // ... details omitted ...
13063    /// }
13064    /// ```
13065    #[derive(Clone, Debug)]
13066    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13067
13068    impl GetLocation {
13069        pub(crate) fn new(
13070            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13071        ) -> Self {
13072            Self(RequestBuilder::new(stub))
13073        }
13074
13075        /// Sets the full request, replacing any prior values.
13076        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13077            mut self,
13078            v: V,
13079        ) -> Self {
13080            self.0.request = v.into();
13081            self
13082        }
13083
13084        /// Sets all the options, replacing any prior values.
13085        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13086            self.0.options = v.into();
13087            self
13088        }
13089
13090        /// Sends the request.
13091        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13092            (*self.0.stub)
13093                .get_location(self.0.request, self.0.options)
13094                .await
13095                .map(crate::Response::into_body)
13096        }
13097
13098        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
13099        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13100            self.0.request.name = v.into();
13101            self
13102        }
13103    }
13104
13105    #[doc(hidden)]
13106    impl crate::RequestBuilder for GetLocation {
13107        fn request_options(&mut self) -> &mut crate::RequestOptions {
13108            &mut self.0.options
13109        }
13110    }
13111
13112    /// The request builder for [Mirroring::set_iam_policy][crate::client::Mirroring::set_iam_policy] calls.
13113    ///
13114    /// # Example
13115    /// ```
13116    /// # use google_cloud_networksecurity_v1::builder::mirroring::SetIamPolicy;
13117    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13118    ///
13119    /// let builder = prepare_request_builder();
13120    /// let response = builder.send().await?;
13121    /// # Ok(()) }
13122    ///
13123    /// fn prepare_request_builder() -> SetIamPolicy {
13124    ///   # panic!();
13125    ///   // ... details omitted ...
13126    /// }
13127    /// ```
13128    #[derive(Clone, Debug)]
13129    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
13130
13131    impl SetIamPolicy {
13132        pub(crate) fn new(
13133            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13134        ) -> Self {
13135            Self(RequestBuilder::new(stub))
13136        }
13137
13138        /// Sets the full request, replacing any prior values.
13139        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
13140            mut self,
13141            v: V,
13142        ) -> Self {
13143            self.0.request = v.into();
13144            self
13145        }
13146
13147        /// Sets all the options, replacing any prior values.
13148        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13149            self.0.options = v.into();
13150            self
13151        }
13152
13153        /// Sends the request.
13154        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13155            (*self.0.stub)
13156                .set_iam_policy(self.0.request, self.0.options)
13157                .await
13158                .map(crate::Response::into_body)
13159        }
13160
13161        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
13162        ///
13163        /// This is a **required** field for requests.
13164        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13165            self.0.request.resource = v.into();
13166            self
13167        }
13168
13169        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
13170        ///
13171        /// This is a **required** field for requests.
13172        pub fn set_policy<T>(mut self, v: T) -> Self
13173        where
13174            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13175        {
13176            self.0.request.policy = std::option::Option::Some(v.into());
13177            self
13178        }
13179
13180        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
13181        ///
13182        /// This is a **required** field for requests.
13183        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
13184        where
13185            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13186        {
13187            self.0.request.policy = v.map(|x| x.into());
13188            self
13189        }
13190
13191        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
13192        pub fn set_update_mask<T>(mut self, v: T) -> Self
13193        where
13194            T: std::convert::Into<wkt::FieldMask>,
13195        {
13196            self.0.request.update_mask = std::option::Option::Some(v.into());
13197            self
13198        }
13199
13200        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
13201        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13202        where
13203            T: std::convert::Into<wkt::FieldMask>,
13204        {
13205            self.0.request.update_mask = v.map(|x| x.into());
13206            self
13207        }
13208    }
13209
13210    #[doc(hidden)]
13211    impl crate::RequestBuilder for SetIamPolicy {
13212        fn request_options(&mut self) -> &mut crate::RequestOptions {
13213            &mut self.0.options
13214        }
13215    }
13216
13217    /// The request builder for [Mirroring::get_iam_policy][crate::client::Mirroring::get_iam_policy] calls.
13218    ///
13219    /// # Example
13220    /// ```
13221    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetIamPolicy;
13222    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13223    ///
13224    /// let builder = prepare_request_builder();
13225    /// let response = builder.send().await?;
13226    /// # Ok(()) }
13227    ///
13228    /// fn prepare_request_builder() -> GetIamPolicy {
13229    ///   # panic!();
13230    ///   // ... details omitted ...
13231    /// }
13232    /// ```
13233    #[derive(Clone, Debug)]
13234    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
13235
13236    impl GetIamPolicy {
13237        pub(crate) fn new(
13238            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13239        ) -> Self {
13240            Self(RequestBuilder::new(stub))
13241        }
13242
13243        /// Sets the full request, replacing any prior values.
13244        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
13245            mut self,
13246            v: V,
13247        ) -> Self {
13248            self.0.request = v.into();
13249            self
13250        }
13251
13252        /// Sets all the options, replacing any prior values.
13253        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13254            self.0.options = v.into();
13255            self
13256        }
13257
13258        /// Sends the request.
13259        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13260            (*self.0.stub)
13261                .get_iam_policy(self.0.request, self.0.options)
13262                .await
13263                .map(crate::Response::into_body)
13264        }
13265
13266        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
13267        ///
13268        /// This is a **required** field for requests.
13269        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13270            self.0.request.resource = v.into();
13271            self
13272        }
13273
13274        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
13275        pub fn set_options<T>(mut self, v: T) -> Self
13276        where
13277            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13278        {
13279            self.0.request.options = std::option::Option::Some(v.into());
13280            self
13281        }
13282
13283        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
13284        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
13285        where
13286            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13287        {
13288            self.0.request.options = v.map(|x| x.into());
13289            self
13290        }
13291    }
13292
13293    #[doc(hidden)]
13294    impl crate::RequestBuilder for GetIamPolicy {
13295        fn request_options(&mut self) -> &mut crate::RequestOptions {
13296            &mut self.0.options
13297        }
13298    }
13299
13300    /// The request builder for [Mirroring::test_iam_permissions][crate::client::Mirroring::test_iam_permissions] calls.
13301    ///
13302    /// # Example
13303    /// ```
13304    /// # use google_cloud_networksecurity_v1::builder::mirroring::TestIamPermissions;
13305    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13306    ///
13307    /// let builder = prepare_request_builder();
13308    /// let response = builder.send().await?;
13309    /// # Ok(()) }
13310    ///
13311    /// fn prepare_request_builder() -> TestIamPermissions {
13312    ///   # panic!();
13313    ///   // ... details omitted ...
13314    /// }
13315    /// ```
13316    #[derive(Clone, Debug)]
13317    pub struct TestIamPermissions(
13318        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
13319    );
13320
13321    impl TestIamPermissions {
13322        pub(crate) fn new(
13323            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13324        ) -> Self {
13325            Self(RequestBuilder::new(stub))
13326        }
13327
13328        /// Sets the full request, replacing any prior values.
13329        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
13330            mut self,
13331            v: V,
13332        ) -> Self {
13333            self.0.request = v.into();
13334            self
13335        }
13336
13337        /// Sets all the options, replacing any prior values.
13338        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13339            self.0.options = v.into();
13340            self
13341        }
13342
13343        /// Sends the request.
13344        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
13345            (*self.0.stub)
13346                .test_iam_permissions(self.0.request, self.0.options)
13347                .await
13348                .map(crate::Response::into_body)
13349        }
13350
13351        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
13352        ///
13353        /// This is a **required** field for requests.
13354        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13355            self.0.request.resource = v.into();
13356            self
13357        }
13358
13359        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
13360        ///
13361        /// This is a **required** field for requests.
13362        pub fn set_permissions<T, V>(mut self, v: T) -> Self
13363        where
13364            T: std::iter::IntoIterator<Item = V>,
13365            V: std::convert::Into<std::string::String>,
13366        {
13367            use std::iter::Iterator;
13368            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
13369            self
13370        }
13371    }
13372
13373    #[doc(hidden)]
13374    impl crate::RequestBuilder for TestIamPermissions {
13375        fn request_options(&mut self) -> &mut crate::RequestOptions {
13376            &mut self.0.options
13377        }
13378    }
13379
13380    /// The request builder for [Mirroring::list_operations][crate::client::Mirroring::list_operations] calls.
13381    ///
13382    /// # Example
13383    /// ```
13384    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListOperations;
13385    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13386    /// use google_cloud_gax::paginator::ItemPaginator;
13387    ///
13388    /// let builder = prepare_request_builder();
13389    /// let mut items = builder.by_item();
13390    /// while let Some(result) = items.next().await {
13391    ///   let item = result?;
13392    /// }
13393    /// # Ok(()) }
13394    ///
13395    /// fn prepare_request_builder() -> ListOperations {
13396    ///   # panic!();
13397    ///   // ... details omitted ...
13398    /// }
13399    /// ```
13400    #[derive(Clone, Debug)]
13401    pub struct ListOperations(
13402        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13403    );
13404
13405    impl ListOperations {
13406        pub(crate) fn new(
13407            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13408        ) -> Self {
13409            Self(RequestBuilder::new(stub))
13410        }
13411
13412        /// Sets the full request, replacing any prior values.
13413        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13414            mut self,
13415            v: V,
13416        ) -> Self {
13417            self.0.request = v.into();
13418            self
13419        }
13420
13421        /// Sets all the options, replacing any prior values.
13422        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13423            self.0.options = v.into();
13424            self
13425        }
13426
13427        /// Sends the request.
13428        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13429            (*self.0.stub)
13430                .list_operations(self.0.request, self.0.options)
13431                .await
13432                .map(crate::Response::into_body)
13433        }
13434
13435        /// Streams each page in the collection.
13436        pub fn by_page(
13437            self,
13438        ) -> impl google_cloud_gax::paginator::Paginator<
13439            google_cloud_longrunning::model::ListOperationsResponse,
13440            crate::Error,
13441        > {
13442            use std::clone::Clone;
13443            let token = self.0.request.page_token.clone();
13444            let execute = move |token: String| {
13445                let mut builder = self.clone();
13446                builder.0.request = builder.0.request.set_page_token(token);
13447                builder.send()
13448            };
13449            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13450        }
13451
13452        /// Streams each item in the collection.
13453        pub fn by_item(
13454            self,
13455        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13456            google_cloud_longrunning::model::ListOperationsResponse,
13457            crate::Error,
13458        > {
13459            use google_cloud_gax::paginator::Paginator;
13460            self.by_page().items()
13461        }
13462
13463        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
13464        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13465            self.0.request.name = v.into();
13466            self
13467        }
13468
13469        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
13470        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13471            self.0.request.filter = v.into();
13472            self
13473        }
13474
13475        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
13476        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13477            self.0.request.page_size = v.into();
13478            self
13479        }
13480
13481        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
13482        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13483            self.0.request.page_token = v.into();
13484            self
13485        }
13486
13487        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
13488        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13489            self.0.request.return_partial_success = v.into();
13490            self
13491        }
13492    }
13493
13494    #[doc(hidden)]
13495    impl crate::RequestBuilder for ListOperations {
13496        fn request_options(&mut self) -> &mut crate::RequestOptions {
13497            &mut self.0.options
13498        }
13499    }
13500
13501    /// The request builder for [Mirroring::get_operation][crate::client::Mirroring::get_operation] calls.
13502    ///
13503    /// # Example
13504    /// ```
13505    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetOperation;
13506    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13507    ///
13508    /// let builder = prepare_request_builder();
13509    /// let response = builder.send().await?;
13510    /// # Ok(()) }
13511    ///
13512    /// fn prepare_request_builder() -> GetOperation {
13513    ///   # panic!();
13514    ///   // ... details omitted ...
13515    /// }
13516    /// ```
13517    #[derive(Clone, Debug)]
13518    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13519
13520    impl GetOperation {
13521        pub(crate) fn new(
13522            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13523        ) -> Self {
13524            Self(RequestBuilder::new(stub))
13525        }
13526
13527        /// Sets the full request, replacing any prior values.
13528        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13529            mut self,
13530            v: V,
13531        ) -> Self {
13532            self.0.request = v.into();
13533            self
13534        }
13535
13536        /// Sets all the options, replacing any prior values.
13537        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13538            self.0.options = v.into();
13539            self
13540        }
13541
13542        /// Sends the request.
13543        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13544            (*self.0.stub)
13545                .get_operation(self.0.request, self.0.options)
13546                .await
13547                .map(crate::Response::into_body)
13548        }
13549
13550        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
13551        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13552            self.0.request.name = v.into();
13553            self
13554        }
13555    }
13556
13557    #[doc(hidden)]
13558    impl crate::RequestBuilder for GetOperation {
13559        fn request_options(&mut self) -> &mut crate::RequestOptions {
13560            &mut self.0.options
13561        }
13562    }
13563
13564    /// The request builder for [Mirroring::delete_operation][crate::client::Mirroring::delete_operation] calls.
13565    ///
13566    /// # Example
13567    /// ```
13568    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteOperation;
13569    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13570    ///
13571    /// let builder = prepare_request_builder();
13572    /// let response = builder.send().await?;
13573    /// # Ok(()) }
13574    ///
13575    /// fn prepare_request_builder() -> DeleteOperation {
13576    ///   # panic!();
13577    ///   // ... details omitted ...
13578    /// }
13579    /// ```
13580    #[derive(Clone, Debug)]
13581    pub struct DeleteOperation(
13582        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
13583    );
13584
13585    impl DeleteOperation {
13586        pub(crate) fn new(
13587            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13588        ) -> Self {
13589            Self(RequestBuilder::new(stub))
13590        }
13591
13592        /// Sets the full request, replacing any prior values.
13593        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
13594            mut self,
13595            v: V,
13596        ) -> Self {
13597            self.0.request = v.into();
13598            self
13599        }
13600
13601        /// Sets all the options, replacing any prior values.
13602        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13603            self.0.options = v.into();
13604            self
13605        }
13606
13607        /// Sends the request.
13608        pub async fn send(self) -> Result<()> {
13609            (*self.0.stub)
13610                .delete_operation(self.0.request, self.0.options)
13611                .await
13612                .map(crate::Response::into_body)
13613        }
13614
13615        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
13616        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13617            self.0.request.name = v.into();
13618            self
13619        }
13620    }
13621
13622    #[doc(hidden)]
13623    impl crate::RequestBuilder for DeleteOperation {
13624        fn request_options(&mut self) -> &mut crate::RequestOptions {
13625            &mut self.0.options
13626        }
13627    }
13628
13629    /// The request builder for [Mirroring::cancel_operation][crate::client::Mirroring::cancel_operation] calls.
13630    ///
13631    /// # Example
13632    /// ```
13633    /// # use google_cloud_networksecurity_v1::builder::mirroring::CancelOperation;
13634    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13635    ///
13636    /// let builder = prepare_request_builder();
13637    /// let response = builder.send().await?;
13638    /// # Ok(()) }
13639    ///
13640    /// fn prepare_request_builder() -> CancelOperation {
13641    ///   # panic!();
13642    ///   // ... details omitted ...
13643    /// }
13644    /// ```
13645    #[derive(Clone, Debug)]
13646    pub struct CancelOperation(
13647        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13648    );
13649
13650    impl CancelOperation {
13651        pub(crate) fn new(
13652            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13653        ) -> Self {
13654            Self(RequestBuilder::new(stub))
13655        }
13656
13657        /// Sets the full request, replacing any prior values.
13658        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13659            mut self,
13660            v: V,
13661        ) -> Self {
13662            self.0.request = v.into();
13663            self
13664        }
13665
13666        /// Sets all the options, replacing any prior values.
13667        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13668            self.0.options = v.into();
13669            self
13670        }
13671
13672        /// Sends the request.
13673        pub async fn send(self) -> Result<()> {
13674            (*self.0.stub)
13675                .cancel_operation(self.0.request, self.0.options)
13676                .await
13677                .map(crate::Response::into_body)
13678        }
13679
13680        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
13681        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13682            self.0.request.name = v.into();
13683            self
13684        }
13685    }
13686
13687    #[doc(hidden)]
13688    impl crate::RequestBuilder for CancelOperation {
13689        fn request_options(&mut self) -> &mut crate::RequestOptions {
13690            &mut self.0.options
13691        }
13692    }
13693}
13694
13695/// Request and client builders for [NetworkSecurity][crate::client::NetworkSecurity].
13696pub mod network_security {
13697    use crate::Result;
13698
13699    /// A builder for [NetworkSecurity][crate::client::NetworkSecurity].
13700    ///
13701    /// ```
13702    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13703    /// # use google_cloud_networksecurity_v1::*;
13704    /// # use builder::network_security::ClientBuilder;
13705    /// # use client::NetworkSecurity;
13706    /// let builder : ClientBuilder = NetworkSecurity::builder();
13707    /// let client = builder
13708    ///     .with_endpoint("https://networksecurity.googleapis.com")
13709    ///     .build().await?;
13710    /// # Ok(()) }
13711    /// ```
13712    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13713
13714    pub(crate) mod client {
13715        use super::super::super::client::NetworkSecurity;
13716        pub struct Factory;
13717        impl crate::ClientFactory for Factory {
13718            type Client = NetworkSecurity;
13719            type Credentials = gaxi::options::Credentials;
13720            async fn build(
13721                self,
13722                config: gaxi::options::ClientConfig,
13723            ) -> crate::ClientBuilderResult<Self::Client> {
13724                Self::Client::new(config).await
13725            }
13726        }
13727    }
13728
13729    /// Common implementation for [crate::client::NetworkSecurity] request builders.
13730    #[derive(Clone, Debug)]
13731    pub(crate) struct RequestBuilder<R: std::default::Default> {
13732        stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13733        request: R,
13734        options: crate::RequestOptions,
13735    }
13736
13737    impl<R> RequestBuilder<R>
13738    where
13739        R: std::default::Default,
13740    {
13741        pub(crate) fn new(
13742            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13743        ) -> Self {
13744            Self {
13745                stub,
13746                request: R::default(),
13747                options: crate::RequestOptions::default(),
13748            }
13749        }
13750    }
13751
13752    /// The request builder for [NetworkSecurity::list_authorization_policies][crate::client::NetworkSecurity::list_authorization_policies] calls.
13753    ///
13754    /// # Example
13755    /// ```
13756    /// # use google_cloud_networksecurity_v1::builder::network_security::ListAuthorizationPolicies;
13757    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13758    /// use google_cloud_gax::paginator::ItemPaginator;
13759    ///
13760    /// let builder = prepare_request_builder();
13761    /// let mut items = builder.by_item();
13762    /// while let Some(result) = items.next().await {
13763    ///   let item = result?;
13764    /// }
13765    /// # Ok(()) }
13766    ///
13767    /// fn prepare_request_builder() -> ListAuthorizationPolicies {
13768    ///   # panic!();
13769    ///   // ... details omitted ...
13770    /// }
13771    /// ```
13772    #[derive(Clone, Debug)]
13773    pub struct ListAuthorizationPolicies(
13774        RequestBuilder<crate::model::ListAuthorizationPoliciesRequest>,
13775    );
13776
13777    impl ListAuthorizationPolicies {
13778        pub(crate) fn new(
13779            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13780        ) -> Self {
13781            Self(RequestBuilder::new(stub))
13782        }
13783
13784        /// Sets the full request, replacing any prior values.
13785        pub fn with_request<V: Into<crate::model::ListAuthorizationPoliciesRequest>>(
13786            mut self,
13787            v: V,
13788        ) -> Self {
13789            self.0.request = v.into();
13790            self
13791        }
13792
13793        /// Sets all the options, replacing any prior values.
13794        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13795            self.0.options = v.into();
13796            self
13797        }
13798
13799        /// Sends the request.
13800        pub async fn send(self) -> Result<crate::model::ListAuthorizationPoliciesResponse> {
13801            (*self.0.stub)
13802                .list_authorization_policies(self.0.request, self.0.options)
13803                .await
13804                .map(crate::Response::into_body)
13805        }
13806
13807        /// Streams each page in the collection.
13808        pub fn by_page(
13809            self,
13810        ) -> impl google_cloud_gax::paginator::Paginator<
13811            crate::model::ListAuthorizationPoliciesResponse,
13812            crate::Error,
13813        > {
13814            use std::clone::Clone;
13815            let token = self.0.request.page_token.clone();
13816            let execute = move |token: String| {
13817                let mut builder = self.clone();
13818                builder.0.request = builder.0.request.set_page_token(token);
13819                builder.send()
13820            };
13821            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13822        }
13823
13824        /// Streams each item in the collection.
13825        pub fn by_item(
13826            self,
13827        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13828            crate::model::ListAuthorizationPoliciesResponse,
13829            crate::Error,
13830        > {
13831            use google_cloud_gax::paginator::Paginator;
13832            self.by_page().items()
13833        }
13834
13835        /// Sets the value of [parent][crate::model::ListAuthorizationPoliciesRequest::parent].
13836        ///
13837        /// This is a **required** field for requests.
13838        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13839            self.0.request.parent = v.into();
13840            self
13841        }
13842
13843        /// Sets the value of [page_size][crate::model::ListAuthorizationPoliciesRequest::page_size].
13844        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13845            self.0.request.page_size = v.into();
13846            self
13847        }
13848
13849        /// Sets the value of [page_token][crate::model::ListAuthorizationPoliciesRequest::page_token].
13850        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13851            self.0.request.page_token = v.into();
13852            self
13853        }
13854    }
13855
13856    #[doc(hidden)]
13857    impl crate::RequestBuilder for ListAuthorizationPolicies {
13858        fn request_options(&mut self) -> &mut crate::RequestOptions {
13859            &mut self.0.options
13860        }
13861    }
13862
13863    /// The request builder for [NetworkSecurity::get_authorization_policy][crate::client::NetworkSecurity::get_authorization_policy] calls.
13864    ///
13865    /// # Example
13866    /// ```
13867    /// # use google_cloud_networksecurity_v1::builder::network_security::GetAuthorizationPolicy;
13868    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13869    ///
13870    /// let builder = prepare_request_builder();
13871    /// let response = builder.send().await?;
13872    /// # Ok(()) }
13873    ///
13874    /// fn prepare_request_builder() -> GetAuthorizationPolicy {
13875    ///   # panic!();
13876    ///   // ... details omitted ...
13877    /// }
13878    /// ```
13879    #[derive(Clone, Debug)]
13880    pub struct GetAuthorizationPolicy(RequestBuilder<crate::model::GetAuthorizationPolicyRequest>);
13881
13882    impl GetAuthorizationPolicy {
13883        pub(crate) fn new(
13884            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13885        ) -> Self {
13886            Self(RequestBuilder::new(stub))
13887        }
13888
13889        /// Sets the full request, replacing any prior values.
13890        pub fn with_request<V: Into<crate::model::GetAuthorizationPolicyRequest>>(
13891            mut self,
13892            v: V,
13893        ) -> Self {
13894            self.0.request = v.into();
13895            self
13896        }
13897
13898        /// Sets all the options, replacing any prior values.
13899        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13900            self.0.options = v.into();
13901            self
13902        }
13903
13904        /// Sends the request.
13905        pub async fn send(self) -> Result<crate::model::AuthorizationPolicy> {
13906            (*self.0.stub)
13907                .get_authorization_policy(self.0.request, self.0.options)
13908                .await
13909                .map(crate::Response::into_body)
13910        }
13911
13912        /// Sets the value of [name][crate::model::GetAuthorizationPolicyRequest::name].
13913        ///
13914        /// This is a **required** field for requests.
13915        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13916            self.0.request.name = v.into();
13917            self
13918        }
13919    }
13920
13921    #[doc(hidden)]
13922    impl crate::RequestBuilder for GetAuthorizationPolicy {
13923        fn request_options(&mut self) -> &mut crate::RequestOptions {
13924            &mut self.0.options
13925        }
13926    }
13927
13928    /// The request builder for [NetworkSecurity::create_authorization_policy][crate::client::NetworkSecurity::create_authorization_policy] calls.
13929    ///
13930    /// # Example
13931    /// ```
13932    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateAuthorizationPolicy;
13933    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13934    /// use google_cloud_lro::Poller;
13935    ///
13936    /// let builder = prepare_request_builder();
13937    /// let response = builder.poller().until_done().await?;
13938    /// # Ok(()) }
13939    ///
13940    /// fn prepare_request_builder() -> CreateAuthorizationPolicy {
13941    ///   # panic!();
13942    ///   // ... details omitted ...
13943    /// }
13944    /// ```
13945    #[derive(Clone, Debug)]
13946    pub struct CreateAuthorizationPolicy(
13947        RequestBuilder<crate::model::CreateAuthorizationPolicyRequest>,
13948    );
13949
13950    impl CreateAuthorizationPolicy {
13951        pub(crate) fn new(
13952            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13953        ) -> Self {
13954            Self(RequestBuilder::new(stub))
13955        }
13956
13957        /// Sets the full request, replacing any prior values.
13958        pub fn with_request<V: Into<crate::model::CreateAuthorizationPolicyRequest>>(
13959            mut self,
13960            v: V,
13961        ) -> Self {
13962            self.0.request = v.into();
13963            self
13964        }
13965
13966        /// Sets all the options, replacing any prior values.
13967        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13968            self.0.options = v.into();
13969            self
13970        }
13971
13972        /// Sends the request.
13973        ///
13974        /// # Long running operations
13975        ///
13976        /// This starts, but does not poll, a longrunning operation. More information
13977        /// on [create_authorization_policy][crate::client::NetworkSecurity::create_authorization_policy].
13978        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13979            (*self.0.stub)
13980                .create_authorization_policy(self.0.request, self.0.options)
13981                .await
13982                .map(crate::Response::into_body)
13983        }
13984
13985        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_authorization_policy`.
13986        pub fn poller(
13987            self,
13988        ) -> impl google_cloud_lro::Poller<
13989            crate::model::AuthorizationPolicy,
13990            crate::model::OperationMetadata,
13991        > {
13992            type Operation = google_cloud_lro::internal::Operation<
13993                crate::model::AuthorizationPolicy,
13994                crate::model::OperationMetadata,
13995            >;
13996            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13997            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13998
13999            let stub = self.0.stub.clone();
14000            let mut options = self.0.options.clone();
14001            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14002            let query = move |name| {
14003                let stub = stub.clone();
14004                let options = options.clone();
14005                async {
14006                    let op = GetOperation::new(stub)
14007                        .set_name(name)
14008                        .with_options(options)
14009                        .send()
14010                        .await?;
14011                    Ok(Operation::new(op))
14012                }
14013            };
14014
14015            let start = move || async {
14016                let op = self.send().await?;
14017                Ok(Operation::new(op))
14018            };
14019
14020            google_cloud_lro::internal::new_poller(
14021                polling_error_policy,
14022                polling_backoff_policy,
14023                start,
14024                query,
14025            )
14026        }
14027
14028        /// Sets the value of [parent][crate::model::CreateAuthorizationPolicyRequest::parent].
14029        ///
14030        /// This is a **required** field for requests.
14031        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14032            self.0.request.parent = v.into();
14033            self
14034        }
14035
14036        /// Sets the value of [authorization_policy_id][crate::model::CreateAuthorizationPolicyRequest::authorization_policy_id].
14037        ///
14038        /// This is a **required** field for requests.
14039        pub fn set_authorization_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14040            self.0.request.authorization_policy_id = v.into();
14041            self
14042        }
14043
14044        /// Sets the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
14045        ///
14046        /// This is a **required** field for requests.
14047        pub fn set_authorization_policy<T>(mut self, v: T) -> Self
14048        where
14049            T: std::convert::Into<crate::model::AuthorizationPolicy>,
14050        {
14051            self.0.request.authorization_policy = std::option::Option::Some(v.into());
14052            self
14053        }
14054
14055        /// Sets or clears the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
14056        ///
14057        /// This is a **required** field for requests.
14058        pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
14059        where
14060            T: std::convert::Into<crate::model::AuthorizationPolicy>,
14061        {
14062            self.0.request.authorization_policy = v.map(|x| x.into());
14063            self
14064        }
14065    }
14066
14067    #[doc(hidden)]
14068    impl crate::RequestBuilder for CreateAuthorizationPolicy {
14069        fn request_options(&mut self) -> &mut crate::RequestOptions {
14070            &mut self.0.options
14071        }
14072    }
14073
14074    /// The request builder for [NetworkSecurity::update_authorization_policy][crate::client::NetworkSecurity::update_authorization_policy] calls.
14075    ///
14076    /// # Example
14077    /// ```
14078    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateAuthorizationPolicy;
14079    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14080    /// use google_cloud_lro::Poller;
14081    ///
14082    /// let builder = prepare_request_builder();
14083    /// let response = builder.poller().until_done().await?;
14084    /// # Ok(()) }
14085    ///
14086    /// fn prepare_request_builder() -> UpdateAuthorizationPolicy {
14087    ///   # panic!();
14088    ///   // ... details omitted ...
14089    /// }
14090    /// ```
14091    #[derive(Clone, Debug)]
14092    pub struct UpdateAuthorizationPolicy(
14093        RequestBuilder<crate::model::UpdateAuthorizationPolicyRequest>,
14094    );
14095
14096    impl UpdateAuthorizationPolicy {
14097        pub(crate) fn new(
14098            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14099        ) -> Self {
14100            Self(RequestBuilder::new(stub))
14101        }
14102
14103        /// Sets the full request, replacing any prior values.
14104        pub fn with_request<V: Into<crate::model::UpdateAuthorizationPolicyRequest>>(
14105            mut self,
14106            v: V,
14107        ) -> Self {
14108            self.0.request = v.into();
14109            self
14110        }
14111
14112        /// Sets all the options, replacing any prior values.
14113        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14114            self.0.options = v.into();
14115            self
14116        }
14117
14118        /// Sends the request.
14119        ///
14120        /// # Long running operations
14121        ///
14122        /// This starts, but does not poll, a longrunning operation. More information
14123        /// on [update_authorization_policy][crate::client::NetworkSecurity::update_authorization_policy].
14124        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14125            (*self.0.stub)
14126                .update_authorization_policy(self.0.request, self.0.options)
14127                .await
14128                .map(crate::Response::into_body)
14129        }
14130
14131        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_authorization_policy`.
14132        pub fn poller(
14133            self,
14134        ) -> impl google_cloud_lro::Poller<
14135            crate::model::AuthorizationPolicy,
14136            crate::model::OperationMetadata,
14137        > {
14138            type Operation = google_cloud_lro::internal::Operation<
14139                crate::model::AuthorizationPolicy,
14140                crate::model::OperationMetadata,
14141            >;
14142            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14143            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14144
14145            let stub = self.0.stub.clone();
14146            let mut options = self.0.options.clone();
14147            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14148            let query = move |name| {
14149                let stub = stub.clone();
14150                let options = options.clone();
14151                async {
14152                    let op = GetOperation::new(stub)
14153                        .set_name(name)
14154                        .with_options(options)
14155                        .send()
14156                        .await?;
14157                    Ok(Operation::new(op))
14158                }
14159            };
14160
14161            let start = move || async {
14162                let op = self.send().await?;
14163                Ok(Operation::new(op))
14164            };
14165
14166            google_cloud_lro::internal::new_poller(
14167                polling_error_policy,
14168                polling_backoff_policy,
14169                start,
14170                query,
14171            )
14172        }
14173
14174        /// Sets the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
14175        pub fn set_update_mask<T>(mut self, v: T) -> Self
14176        where
14177            T: std::convert::Into<wkt::FieldMask>,
14178        {
14179            self.0.request.update_mask = std::option::Option::Some(v.into());
14180            self
14181        }
14182
14183        /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
14184        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14185        where
14186            T: std::convert::Into<wkt::FieldMask>,
14187        {
14188            self.0.request.update_mask = v.map(|x| x.into());
14189            self
14190        }
14191
14192        /// Sets the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
14193        ///
14194        /// This is a **required** field for requests.
14195        pub fn set_authorization_policy<T>(mut self, v: T) -> Self
14196        where
14197            T: std::convert::Into<crate::model::AuthorizationPolicy>,
14198        {
14199            self.0.request.authorization_policy = std::option::Option::Some(v.into());
14200            self
14201        }
14202
14203        /// Sets or clears the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
14204        ///
14205        /// This is a **required** field for requests.
14206        pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
14207        where
14208            T: std::convert::Into<crate::model::AuthorizationPolicy>,
14209        {
14210            self.0.request.authorization_policy = v.map(|x| x.into());
14211            self
14212        }
14213    }
14214
14215    #[doc(hidden)]
14216    impl crate::RequestBuilder for UpdateAuthorizationPolicy {
14217        fn request_options(&mut self) -> &mut crate::RequestOptions {
14218            &mut self.0.options
14219        }
14220    }
14221
14222    /// The request builder for [NetworkSecurity::delete_authorization_policy][crate::client::NetworkSecurity::delete_authorization_policy] calls.
14223    ///
14224    /// # Example
14225    /// ```
14226    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteAuthorizationPolicy;
14227    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14228    /// use google_cloud_lro::Poller;
14229    ///
14230    /// let builder = prepare_request_builder();
14231    /// let response = builder.poller().until_done().await?;
14232    /// # Ok(()) }
14233    ///
14234    /// fn prepare_request_builder() -> DeleteAuthorizationPolicy {
14235    ///   # panic!();
14236    ///   // ... details omitted ...
14237    /// }
14238    /// ```
14239    #[derive(Clone, Debug)]
14240    pub struct DeleteAuthorizationPolicy(
14241        RequestBuilder<crate::model::DeleteAuthorizationPolicyRequest>,
14242    );
14243
14244    impl DeleteAuthorizationPolicy {
14245        pub(crate) fn new(
14246            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14247        ) -> Self {
14248            Self(RequestBuilder::new(stub))
14249        }
14250
14251        /// Sets the full request, replacing any prior values.
14252        pub fn with_request<V: Into<crate::model::DeleteAuthorizationPolicyRequest>>(
14253            mut self,
14254            v: V,
14255        ) -> Self {
14256            self.0.request = v.into();
14257            self
14258        }
14259
14260        /// Sets all the options, replacing any prior values.
14261        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14262            self.0.options = v.into();
14263            self
14264        }
14265
14266        /// Sends the request.
14267        ///
14268        /// # Long running operations
14269        ///
14270        /// This starts, but does not poll, a longrunning operation. More information
14271        /// on [delete_authorization_policy][crate::client::NetworkSecurity::delete_authorization_policy].
14272        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14273            (*self.0.stub)
14274                .delete_authorization_policy(self.0.request, self.0.options)
14275                .await
14276                .map(crate::Response::into_body)
14277        }
14278
14279        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_authorization_policy`.
14280        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
14281            type Operation =
14282                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14283            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14284            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14285
14286            let stub = self.0.stub.clone();
14287            let mut options = self.0.options.clone();
14288            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14289            let query = move |name| {
14290                let stub = stub.clone();
14291                let options = options.clone();
14292                async {
14293                    let op = GetOperation::new(stub)
14294                        .set_name(name)
14295                        .with_options(options)
14296                        .send()
14297                        .await?;
14298                    Ok(Operation::new(op))
14299                }
14300            };
14301
14302            let start = move || async {
14303                let op = self.send().await?;
14304                Ok(Operation::new(op))
14305            };
14306
14307            google_cloud_lro::internal::new_unit_response_poller(
14308                polling_error_policy,
14309                polling_backoff_policy,
14310                start,
14311                query,
14312            )
14313        }
14314
14315        /// Sets the value of [name][crate::model::DeleteAuthorizationPolicyRequest::name].
14316        ///
14317        /// This is a **required** field for requests.
14318        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14319            self.0.request.name = v.into();
14320            self
14321        }
14322    }
14323
14324    #[doc(hidden)]
14325    impl crate::RequestBuilder for DeleteAuthorizationPolicy {
14326        fn request_options(&mut self) -> &mut crate::RequestOptions {
14327            &mut self.0.options
14328        }
14329    }
14330
14331    /// The request builder for [NetworkSecurity::list_backend_authentication_configs][crate::client::NetworkSecurity::list_backend_authentication_configs] calls.
14332    ///
14333    /// # Example
14334    /// ```
14335    /// # use google_cloud_networksecurity_v1::builder::network_security::ListBackendAuthenticationConfigs;
14336    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14337    /// use google_cloud_gax::paginator::ItemPaginator;
14338    ///
14339    /// let builder = prepare_request_builder();
14340    /// let mut items = builder.by_item();
14341    /// while let Some(result) = items.next().await {
14342    ///   let item = result?;
14343    /// }
14344    /// # Ok(()) }
14345    ///
14346    /// fn prepare_request_builder() -> ListBackendAuthenticationConfigs {
14347    ///   # panic!();
14348    ///   // ... details omitted ...
14349    /// }
14350    /// ```
14351    #[derive(Clone, Debug)]
14352    pub struct ListBackendAuthenticationConfigs(
14353        RequestBuilder<crate::model::ListBackendAuthenticationConfigsRequest>,
14354    );
14355
14356    impl ListBackendAuthenticationConfigs {
14357        pub(crate) fn new(
14358            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14359        ) -> Self {
14360            Self(RequestBuilder::new(stub))
14361        }
14362
14363        /// Sets the full request, replacing any prior values.
14364        pub fn with_request<V: Into<crate::model::ListBackendAuthenticationConfigsRequest>>(
14365            mut self,
14366            v: V,
14367        ) -> Self {
14368            self.0.request = v.into();
14369            self
14370        }
14371
14372        /// Sets all the options, replacing any prior values.
14373        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14374            self.0.options = v.into();
14375            self
14376        }
14377
14378        /// Sends the request.
14379        pub async fn send(self) -> Result<crate::model::ListBackendAuthenticationConfigsResponse> {
14380            (*self.0.stub)
14381                .list_backend_authentication_configs(self.0.request, self.0.options)
14382                .await
14383                .map(crate::Response::into_body)
14384        }
14385
14386        /// Streams each page in the collection.
14387        pub fn by_page(
14388            self,
14389        ) -> impl google_cloud_gax::paginator::Paginator<
14390            crate::model::ListBackendAuthenticationConfigsResponse,
14391            crate::Error,
14392        > {
14393            use std::clone::Clone;
14394            let token = self.0.request.page_token.clone();
14395            let execute = move |token: String| {
14396                let mut builder = self.clone();
14397                builder.0.request = builder.0.request.set_page_token(token);
14398                builder.send()
14399            };
14400            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14401        }
14402
14403        /// Streams each item in the collection.
14404        pub fn by_item(
14405            self,
14406        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14407            crate::model::ListBackendAuthenticationConfigsResponse,
14408            crate::Error,
14409        > {
14410            use google_cloud_gax::paginator::Paginator;
14411            self.by_page().items()
14412        }
14413
14414        /// Sets the value of [parent][crate::model::ListBackendAuthenticationConfigsRequest::parent].
14415        ///
14416        /// This is a **required** field for requests.
14417        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14418            self.0.request.parent = v.into();
14419            self
14420        }
14421
14422        /// Sets the value of [page_size][crate::model::ListBackendAuthenticationConfigsRequest::page_size].
14423        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14424            self.0.request.page_size = v.into();
14425            self
14426        }
14427
14428        /// Sets the value of [page_token][crate::model::ListBackendAuthenticationConfigsRequest::page_token].
14429        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14430            self.0.request.page_token = v.into();
14431            self
14432        }
14433    }
14434
14435    #[doc(hidden)]
14436    impl crate::RequestBuilder for ListBackendAuthenticationConfigs {
14437        fn request_options(&mut self) -> &mut crate::RequestOptions {
14438            &mut self.0.options
14439        }
14440    }
14441
14442    /// The request builder for [NetworkSecurity::get_backend_authentication_config][crate::client::NetworkSecurity::get_backend_authentication_config] calls.
14443    ///
14444    /// # Example
14445    /// ```
14446    /// # use google_cloud_networksecurity_v1::builder::network_security::GetBackendAuthenticationConfig;
14447    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14448    ///
14449    /// let builder = prepare_request_builder();
14450    /// let response = builder.send().await?;
14451    /// # Ok(()) }
14452    ///
14453    /// fn prepare_request_builder() -> GetBackendAuthenticationConfig {
14454    ///   # panic!();
14455    ///   // ... details omitted ...
14456    /// }
14457    /// ```
14458    #[derive(Clone, Debug)]
14459    pub struct GetBackendAuthenticationConfig(
14460        RequestBuilder<crate::model::GetBackendAuthenticationConfigRequest>,
14461    );
14462
14463    impl GetBackendAuthenticationConfig {
14464        pub(crate) fn new(
14465            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14466        ) -> Self {
14467            Self(RequestBuilder::new(stub))
14468        }
14469
14470        /// Sets the full request, replacing any prior values.
14471        pub fn with_request<V: Into<crate::model::GetBackendAuthenticationConfigRequest>>(
14472            mut self,
14473            v: V,
14474        ) -> Self {
14475            self.0.request = v.into();
14476            self
14477        }
14478
14479        /// Sets all the options, replacing any prior values.
14480        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14481            self.0.options = v.into();
14482            self
14483        }
14484
14485        /// Sends the request.
14486        pub async fn send(self) -> Result<crate::model::BackendAuthenticationConfig> {
14487            (*self.0.stub)
14488                .get_backend_authentication_config(self.0.request, self.0.options)
14489                .await
14490                .map(crate::Response::into_body)
14491        }
14492
14493        /// Sets the value of [name][crate::model::GetBackendAuthenticationConfigRequest::name].
14494        ///
14495        /// This is a **required** field for requests.
14496        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14497            self.0.request.name = v.into();
14498            self
14499        }
14500    }
14501
14502    #[doc(hidden)]
14503    impl crate::RequestBuilder for GetBackendAuthenticationConfig {
14504        fn request_options(&mut self) -> &mut crate::RequestOptions {
14505            &mut self.0.options
14506        }
14507    }
14508
14509    /// The request builder for [NetworkSecurity::create_backend_authentication_config][crate::client::NetworkSecurity::create_backend_authentication_config] calls.
14510    ///
14511    /// # Example
14512    /// ```
14513    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateBackendAuthenticationConfig;
14514    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14515    /// use google_cloud_lro::Poller;
14516    ///
14517    /// let builder = prepare_request_builder();
14518    /// let response = builder.poller().until_done().await?;
14519    /// # Ok(()) }
14520    ///
14521    /// fn prepare_request_builder() -> CreateBackendAuthenticationConfig {
14522    ///   # panic!();
14523    ///   // ... details omitted ...
14524    /// }
14525    /// ```
14526    #[derive(Clone, Debug)]
14527    pub struct CreateBackendAuthenticationConfig(
14528        RequestBuilder<crate::model::CreateBackendAuthenticationConfigRequest>,
14529    );
14530
14531    impl CreateBackendAuthenticationConfig {
14532        pub(crate) fn new(
14533            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14534        ) -> Self {
14535            Self(RequestBuilder::new(stub))
14536        }
14537
14538        /// Sets the full request, replacing any prior values.
14539        pub fn with_request<V: Into<crate::model::CreateBackendAuthenticationConfigRequest>>(
14540            mut self,
14541            v: V,
14542        ) -> Self {
14543            self.0.request = v.into();
14544            self
14545        }
14546
14547        /// Sets all the options, replacing any prior values.
14548        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14549            self.0.options = v.into();
14550            self
14551        }
14552
14553        /// Sends the request.
14554        ///
14555        /// # Long running operations
14556        ///
14557        /// This starts, but does not poll, a longrunning operation. More information
14558        /// on [create_backend_authentication_config][crate::client::NetworkSecurity::create_backend_authentication_config].
14559        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14560            (*self.0.stub)
14561                .create_backend_authentication_config(self.0.request, self.0.options)
14562                .await
14563                .map(crate::Response::into_body)
14564        }
14565
14566        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_backend_authentication_config`.
14567        pub fn poller(
14568            self,
14569        ) -> impl google_cloud_lro::Poller<
14570            crate::model::BackendAuthenticationConfig,
14571            crate::model::OperationMetadata,
14572        > {
14573            type Operation = google_cloud_lro::internal::Operation<
14574                crate::model::BackendAuthenticationConfig,
14575                crate::model::OperationMetadata,
14576            >;
14577            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14578            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14579
14580            let stub = self.0.stub.clone();
14581            let mut options = self.0.options.clone();
14582            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14583            let query = move |name| {
14584                let stub = stub.clone();
14585                let options = options.clone();
14586                async {
14587                    let op = GetOperation::new(stub)
14588                        .set_name(name)
14589                        .with_options(options)
14590                        .send()
14591                        .await?;
14592                    Ok(Operation::new(op))
14593                }
14594            };
14595
14596            let start = move || async {
14597                let op = self.send().await?;
14598                Ok(Operation::new(op))
14599            };
14600
14601            google_cloud_lro::internal::new_poller(
14602                polling_error_policy,
14603                polling_backoff_policy,
14604                start,
14605                query,
14606            )
14607        }
14608
14609        /// Sets the value of [parent][crate::model::CreateBackendAuthenticationConfigRequest::parent].
14610        ///
14611        /// This is a **required** field for requests.
14612        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14613            self.0.request.parent = v.into();
14614            self
14615        }
14616
14617        /// Sets the value of [backend_authentication_config_id][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config_id].
14618        ///
14619        /// This is a **required** field for requests.
14620        pub fn set_backend_authentication_config_id<T: Into<std::string::String>>(
14621            mut self,
14622            v: T,
14623        ) -> Self {
14624            self.0.request.backend_authentication_config_id = v.into();
14625            self
14626        }
14627
14628        /// Sets the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
14629        ///
14630        /// This is a **required** field for requests.
14631        pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
14632        where
14633            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14634        {
14635            self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
14636            self
14637        }
14638
14639        /// Sets or clears the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
14640        ///
14641        /// This is a **required** field for requests.
14642        pub fn set_or_clear_backend_authentication_config<T>(
14643            mut self,
14644            v: std::option::Option<T>,
14645        ) -> Self
14646        where
14647            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14648        {
14649            self.0.request.backend_authentication_config = v.map(|x| x.into());
14650            self
14651        }
14652    }
14653
14654    #[doc(hidden)]
14655    impl crate::RequestBuilder for CreateBackendAuthenticationConfig {
14656        fn request_options(&mut self) -> &mut crate::RequestOptions {
14657            &mut self.0.options
14658        }
14659    }
14660
14661    /// The request builder for [NetworkSecurity::update_backend_authentication_config][crate::client::NetworkSecurity::update_backend_authentication_config] calls.
14662    ///
14663    /// # Example
14664    /// ```
14665    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateBackendAuthenticationConfig;
14666    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14667    /// use google_cloud_lro::Poller;
14668    ///
14669    /// let builder = prepare_request_builder();
14670    /// let response = builder.poller().until_done().await?;
14671    /// # Ok(()) }
14672    ///
14673    /// fn prepare_request_builder() -> UpdateBackendAuthenticationConfig {
14674    ///   # panic!();
14675    ///   // ... details omitted ...
14676    /// }
14677    /// ```
14678    #[derive(Clone, Debug)]
14679    pub struct UpdateBackendAuthenticationConfig(
14680        RequestBuilder<crate::model::UpdateBackendAuthenticationConfigRequest>,
14681    );
14682
14683    impl UpdateBackendAuthenticationConfig {
14684        pub(crate) fn new(
14685            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14686        ) -> Self {
14687            Self(RequestBuilder::new(stub))
14688        }
14689
14690        /// Sets the full request, replacing any prior values.
14691        pub fn with_request<V: Into<crate::model::UpdateBackendAuthenticationConfigRequest>>(
14692            mut self,
14693            v: V,
14694        ) -> Self {
14695            self.0.request = v.into();
14696            self
14697        }
14698
14699        /// Sets all the options, replacing any prior values.
14700        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14701            self.0.options = v.into();
14702            self
14703        }
14704
14705        /// Sends the request.
14706        ///
14707        /// # Long running operations
14708        ///
14709        /// This starts, but does not poll, a longrunning operation. More information
14710        /// on [update_backend_authentication_config][crate::client::NetworkSecurity::update_backend_authentication_config].
14711        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14712            (*self.0.stub)
14713                .update_backend_authentication_config(self.0.request, self.0.options)
14714                .await
14715                .map(crate::Response::into_body)
14716        }
14717
14718        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_backend_authentication_config`.
14719        pub fn poller(
14720            self,
14721        ) -> impl google_cloud_lro::Poller<
14722            crate::model::BackendAuthenticationConfig,
14723            crate::model::OperationMetadata,
14724        > {
14725            type Operation = google_cloud_lro::internal::Operation<
14726                crate::model::BackendAuthenticationConfig,
14727                crate::model::OperationMetadata,
14728            >;
14729            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14730            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14731
14732            let stub = self.0.stub.clone();
14733            let mut options = self.0.options.clone();
14734            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14735            let query = move |name| {
14736                let stub = stub.clone();
14737                let options = options.clone();
14738                async {
14739                    let op = GetOperation::new(stub)
14740                        .set_name(name)
14741                        .with_options(options)
14742                        .send()
14743                        .await?;
14744                    Ok(Operation::new(op))
14745                }
14746            };
14747
14748            let start = move || async {
14749                let op = self.send().await?;
14750                Ok(Operation::new(op))
14751            };
14752
14753            google_cloud_lro::internal::new_poller(
14754                polling_error_policy,
14755                polling_backoff_policy,
14756                start,
14757                query,
14758            )
14759        }
14760
14761        /// Sets the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
14762        pub fn set_update_mask<T>(mut self, v: T) -> Self
14763        where
14764            T: std::convert::Into<wkt::FieldMask>,
14765        {
14766            self.0.request.update_mask = std::option::Option::Some(v.into());
14767            self
14768        }
14769
14770        /// Sets or clears the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
14771        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14772        where
14773            T: std::convert::Into<wkt::FieldMask>,
14774        {
14775            self.0.request.update_mask = v.map(|x| x.into());
14776            self
14777        }
14778
14779        /// Sets the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
14780        ///
14781        /// This is a **required** field for requests.
14782        pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
14783        where
14784            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14785        {
14786            self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
14787            self
14788        }
14789
14790        /// Sets or clears the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
14791        ///
14792        /// This is a **required** field for requests.
14793        pub fn set_or_clear_backend_authentication_config<T>(
14794            mut self,
14795            v: std::option::Option<T>,
14796        ) -> Self
14797        where
14798            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14799        {
14800            self.0.request.backend_authentication_config = v.map(|x| x.into());
14801            self
14802        }
14803    }
14804
14805    #[doc(hidden)]
14806    impl crate::RequestBuilder for UpdateBackendAuthenticationConfig {
14807        fn request_options(&mut self) -> &mut crate::RequestOptions {
14808            &mut self.0.options
14809        }
14810    }
14811
14812    /// The request builder for [NetworkSecurity::delete_backend_authentication_config][crate::client::NetworkSecurity::delete_backend_authentication_config] calls.
14813    ///
14814    /// # Example
14815    /// ```
14816    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteBackendAuthenticationConfig;
14817    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14818    /// use google_cloud_lro::Poller;
14819    ///
14820    /// let builder = prepare_request_builder();
14821    /// let response = builder.poller().until_done().await?;
14822    /// # Ok(()) }
14823    ///
14824    /// fn prepare_request_builder() -> DeleteBackendAuthenticationConfig {
14825    ///   # panic!();
14826    ///   // ... details omitted ...
14827    /// }
14828    /// ```
14829    #[derive(Clone, Debug)]
14830    pub struct DeleteBackendAuthenticationConfig(
14831        RequestBuilder<crate::model::DeleteBackendAuthenticationConfigRequest>,
14832    );
14833
14834    impl DeleteBackendAuthenticationConfig {
14835        pub(crate) fn new(
14836            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14837        ) -> Self {
14838            Self(RequestBuilder::new(stub))
14839        }
14840
14841        /// Sets the full request, replacing any prior values.
14842        pub fn with_request<V: Into<crate::model::DeleteBackendAuthenticationConfigRequest>>(
14843            mut self,
14844            v: V,
14845        ) -> Self {
14846            self.0.request = v.into();
14847            self
14848        }
14849
14850        /// Sets all the options, replacing any prior values.
14851        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14852            self.0.options = v.into();
14853            self
14854        }
14855
14856        /// Sends the request.
14857        ///
14858        /// # Long running operations
14859        ///
14860        /// This starts, but does not poll, a longrunning operation. More information
14861        /// on [delete_backend_authentication_config][crate::client::NetworkSecurity::delete_backend_authentication_config].
14862        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14863            (*self.0.stub)
14864                .delete_backend_authentication_config(self.0.request, self.0.options)
14865                .await
14866                .map(crate::Response::into_body)
14867        }
14868
14869        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_backend_authentication_config`.
14870        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
14871            type Operation =
14872                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14873            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14874            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14875
14876            let stub = self.0.stub.clone();
14877            let mut options = self.0.options.clone();
14878            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14879            let query = move |name| {
14880                let stub = stub.clone();
14881                let options = options.clone();
14882                async {
14883                    let op = GetOperation::new(stub)
14884                        .set_name(name)
14885                        .with_options(options)
14886                        .send()
14887                        .await?;
14888                    Ok(Operation::new(op))
14889                }
14890            };
14891
14892            let start = move || async {
14893                let op = self.send().await?;
14894                Ok(Operation::new(op))
14895            };
14896
14897            google_cloud_lro::internal::new_unit_response_poller(
14898                polling_error_policy,
14899                polling_backoff_policy,
14900                start,
14901                query,
14902            )
14903        }
14904
14905        /// Sets the value of [name][crate::model::DeleteBackendAuthenticationConfigRequest::name].
14906        ///
14907        /// This is a **required** field for requests.
14908        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14909            self.0.request.name = v.into();
14910            self
14911        }
14912
14913        /// Sets the value of [etag][crate::model::DeleteBackendAuthenticationConfigRequest::etag].
14914        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
14915            self.0.request.etag = v.into();
14916            self
14917        }
14918    }
14919
14920    #[doc(hidden)]
14921    impl crate::RequestBuilder for DeleteBackendAuthenticationConfig {
14922        fn request_options(&mut self) -> &mut crate::RequestOptions {
14923            &mut self.0.options
14924        }
14925    }
14926
14927    /// The request builder for [NetworkSecurity::list_server_tls_policies][crate::client::NetworkSecurity::list_server_tls_policies] calls.
14928    ///
14929    /// # Example
14930    /// ```
14931    /// # use google_cloud_networksecurity_v1::builder::network_security::ListServerTlsPolicies;
14932    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14933    /// use google_cloud_gax::paginator::ItemPaginator;
14934    ///
14935    /// let builder = prepare_request_builder();
14936    /// let mut items = builder.by_item();
14937    /// while let Some(result) = items.next().await {
14938    ///   let item = result?;
14939    /// }
14940    /// # Ok(()) }
14941    ///
14942    /// fn prepare_request_builder() -> ListServerTlsPolicies {
14943    ///   # panic!();
14944    ///   // ... details omitted ...
14945    /// }
14946    /// ```
14947    #[derive(Clone, Debug)]
14948    pub struct ListServerTlsPolicies(RequestBuilder<crate::model::ListServerTlsPoliciesRequest>);
14949
14950    impl ListServerTlsPolicies {
14951        pub(crate) fn new(
14952            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14953        ) -> Self {
14954            Self(RequestBuilder::new(stub))
14955        }
14956
14957        /// Sets the full request, replacing any prior values.
14958        pub fn with_request<V: Into<crate::model::ListServerTlsPoliciesRequest>>(
14959            mut self,
14960            v: V,
14961        ) -> Self {
14962            self.0.request = v.into();
14963            self
14964        }
14965
14966        /// Sets all the options, replacing any prior values.
14967        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14968            self.0.options = v.into();
14969            self
14970        }
14971
14972        /// Sends the request.
14973        pub async fn send(self) -> Result<crate::model::ListServerTlsPoliciesResponse> {
14974            (*self.0.stub)
14975                .list_server_tls_policies(self.0.request, self.0.options)
14976                .await
14977                .map(crate::Response::into_body)
14978        }
14979
14980        /// Streams each page in the collection.
14981        pub fn by_page(
14982            self,
14983        ) -> impl google_cloud_gax::paginator::Paginator<
14984            crate::model::ListServerTlsPoliciesResponse,
14985            crate::Error,
14986        > {
14987            use std::clone::Clone;
14988            let token = self.0.request.page_token.clone();
14989            let execute = move |token: String| {
14990                let mut builder = self.clone();
14991                builder.0.request = builder.0.request.set_page_token(token);
14992                builder.send()
14993            };
14994            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14995        }
14996
14997        /// Streams each item in the collection.
14998        pub fn by_item(
14999            self,
15000        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15001            crate::model::ListServerTlsPoliciesResponse,
15002            crate::Error,
15003        > {
15004            use google_cloud_gax::paginator::Paginator;
15005            self.by_page().items()
15006        }
15007
15008        /// Sets the value of [parent][crate::model::ListServerTlsPoliciesRequest::parent].
15009        ///
15010        /// This is a **required** field for requests.
15011        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15012            self.0.request.parent = v.into();
15013            self
15014        }
15015
15016        /// Sets the value of [page_size][crate::model::ListServerTlsPoliciesRequest::page_size].
15017        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15018            self.0.request.page_size = v.into();
15019            self
15020        }
15021
15022        /// Sets the value of [page_token][crate::model::ListServerTlsPoliciesRequest::page_token].
15023        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15024            self.0.request.page_token = v.into();
15025            self
15026        }
15027
15028        /// Sets the value of [return_partial_success][crate::model::ListServerTlsPoliciesRequest::return_partial_success].
15029        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15030            self.0.request.return_partial_success = v.into();
15031            self
15032        }
15033    }
15034
15035    #[doc(hidden)]
15036    impl crate::RequestBuilder for ListServerTlsPolicies {
15037        fn request_options(&mut self) -> &mut crate::RequestOptions {
15038            &mut self.0.options
15039        }
15040    }
15041
15042    /// The request builder for [NetworkSecurity::get_server_tls_policy][crate::client::NetworkSecurity::get_server_tls_policy] calls.
15043    ///
15044    /// # Example
15045    /// ```
15046    /// # use google_cloud_networksecurity_v1::builder::network_security::GetServerTlsPolicy;
15047    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15048    ///
15049    /// let builder = prepare_request_builder();
15050    /// let response = builder.send().await?;
15051    /// # Ok(()) }
15052    ///
15053    /// fn prepare_request_builder() -> GetServerTlsPolicy {
15054    ///   # panic!();
15055    ///   // ... details omitted ...
15056    /// }
15057    /// ```
15058    #[derive(Clone, Debug)]
15059    pub struct GetServerTlsPolicy(RequestBuilder<crate::model::GetServerTlsPolicyRequest>);
15060
15061    impl GetServerTlsPolicy {
15062        pub(crate) fn new(
15063            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15064        ) -> Self {
15065            Self(RequestBuilder::new(stub))
15066        }
15067
15068        /// Sets the full request, replacing any prior values.
15069        pub fn with_request<V: Into<crate::model::GetServerTlsPolicyRequest>>(
15070            mut self,
15071            v: V,
15072        ) -> Self {
15073            self.0.request = v.into();
15074            self
15075        }
15076
15077        /// Sets all the options, replacing any prior values.
15078        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15079            self.0.options = v.into();
15080            self
15081        }
15082
15083        /// Sends the request.
15084        pub async fn send(self) -> Result<crate::model::ServerTlsPolicy> {
15085            (*self.0.stub)
15086                .get_server_tls_policy(self.0.request, self.0.options)
15087                .await
15088                .map(crate::Response::into_body)
15089        }
15090
15091        /// Sets the value of [name][crate::model::GetServerTlsPolicyRequest::name].
15092        ///
15093        /// This is a **required** field for requests.
15094        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15095            self.0.request.name = v.into();
15096            self
15097        }
15098    }
15099
15100    #[doc(hidden)]
15101    impl crate::RequestBuilder for GetServerTlsPolicy {
15102        fn request_options(&mut self) -> &mut crate::RequestOptions {
15103            &mut self.0.options
15104        }
15105    }
15106
15107    /// The request builder for [NetworkSecurity::create_server_tls_policy][crate::client::NetworkSecurity::create_server_tls_policy] calls.
15108    ///
15109    /// # Example
15110    /// ```
15111    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateServerTlsPolicy;
15112    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15113    /// use google_cloud_lro::Poller;
15114    ///
15115    /// let builder = prepare_request_builder();
15116    /// let response = builder.poller().until_done().await?;
15117    /// # Ok(()) }
15118    ///
15119    /// fn prepare_request_builder() -> CreateServerTlsPolicy {
15120    ///   # panic!();
15121    ///   // ... details omitted ...
15122    /// }
15123    /// ```
15124    #[derive(Clone, Debug)]
15125    pub struct CreateServerTlsPolicy(RequestBuilder<crate::model::CreateServerTlsPolicyRequest>);
15126
15127    impl CreateServerTlsPolicy {
15128        pub(crate) fn new(
15129            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15130        ) -> Self {
15131            Self(RequestBuilder::new(stub))
15132        }
15133
15134        /// Sets the full request, replacing any prior values.
15135        pub fn with_request<V: Into<crate::model::CreateServerTlsPolicyRequest>>(
15136            mut self,
15137            v: V,
15138        ) -> Self {
15139            self.0.request = v.into();
15140            self
15141        }
15142
15143        /// Sets all the options, replacing any prior values.
15144        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15145            self.0.options = v.into();
15146            self
15147        }
15148
15149        /// Sends the request.
15150        ///
15151        /// # Long running operations
15152        ///
15153        /// This starts, but does not poll, a longrunning operation. More information
15154        /// on [create_server_tls_policy][crate::client::NetworkSecurity::create_server_tls_policy].
15155        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15156            (*self.0.stub)
15157                .create_server_tls_policy(self.0.request, self.0.options)
15158                .await
15159                .map(crate::Response::into_body)
15160        }
15161
15162        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_server_tls_policy`.
15163        pub fn poller(
15164            self,
15165        ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
15166        {
15167            type Operation = google_cloud_lro::internal::Operation<
15168                crate::model::ServerTlsPolicy,
15169                crate::model::OperationMetadata,
15170            >;
15171            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15172            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15173
15174            let stub = self.0.stub.clone();
15175            let mut options = self.0.options.clone();
15176            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15177            let query = move |name| {
15178                let stub = stub.clone();
15179                let options = options.clone();
15180                async {
15181                    let op = GetOperation::new(stub)
15182                        .set_name(name)
15183                        .with_options(options)
15184                        .send()
15185                        .await?;
15186                    Ok(Operation::new(op))
15187                }
15188            };
15189
15190            let start = move || async {
15191                let op = self.send().await?;
15192                Ok(Operation::new(op))
15193            };
15194
15195            google_cloud_lro::internal::new_poller(
15196                polling_error_policy,
15197                polling_backoff_policy,
15198                start,
15199                query,
15200            )
15201        }
15202
15203        /// Sets the value of [parent][crate::model::CreateServerTlsPolicyRequest::parent].
15204        ///
15205        /// This is a **required** field for requests.
15206        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15207            self.0.request.parent = v.into();
15208            self
15209        }
15210
15211        /// Sets the value of [server_tls_policy_id][crate::model::CreateServerTlsPolicyRequest::server_tls_policy_id].
15212        ///
15213        /// This is a **required** field for requests.
15214        pub fn set_server_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15215            self.0.request.server_tls_policy_id = v.into();
15216            self
15217        }
15218
15219        /// Sets the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
15220        ///
15221        /// This is a **required** field for requests.
15222        pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
15223        where
15224            T: std::convert::Into<crate::model::ServerTlsPolicy>,
15225        {
15226            self.0.request.server_tls_policy = std::option::Option::Some(v.into());
15227            self
15228        }
15229
15230        /// Sets or clears the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
15231        ///
15232        /// This is a **required** field for requests.
15233        pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15234        where
15235            T: std::convert::Into<crate::model::ServerTlsPolicy>,
15236        {
15237            self.0.request.server_tls_policy = v.map(|x| x.into());
15238            self
15239        }
15240    }
15241
15242    #[doc(hidden)]
15243    impl crate::RequestBuilder for CreateServerTlsPolicy {
15244        fn request_options(&mut self) -> &mut crate::RequestOptions {
15245            &mut self.0.options
15246        }
15247    }
15248
15249    /// The request builder for [NetworkSecurity::update_server_tls_policy][crate::client::NetworkSecurity::update_server_tls_policy] calls.
15250    ///
15251    /// # Example
15252    /// ```
15253    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateServerTlsPolicy;
15254    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15255    /// use google_cloud_lro::Poller;
15256    ///
15257    /// let builder = prepare_request_builder();
15258    /// let response = builder.poller().until_done().await?;
15259    /// # Ok(()) }
15260    ///
15261    /// fn prepare_request_builder() -> UpdateServerTlsPolicy {
15262    ///   # panic!();
15263    ///   // ... details omitted ...
15264    /// }
15265    /// ```
15266    #[derive(Clone, Debug)]
15267    pub struct UpdateServerTlsPolicy(RequestBuilder<crate::model::UpdateServerTlsPolicyRequest>);
15268
15269    impl UpdateServerTlsPolicy {
15270        pub(crate) fn new(
15271            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15272        ) -> Self {
15273            Self(RequestBuilder::new(stub))
15274        }
15275
15276        /// Sets the full request, replacing any prior values.
15277        pub fn with_request<V: Into<crate::model::UpdateServerTlsPolicyRequest>>(
15278            mut self,
15279            v: V,
15280        ) -> Self {
15281            self.0.request = v.into();
15282            self
15283        }
15284
15285        /// Sets all the options, replacing any prior values.
15286        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15287            self.0.options = v.into();
15288            self
15289        }
15290
15291        /// Sends the request.
15292        ///
15293        /// # Long running operations
15294        ///
15295        /// This starts, but does not poll, a longrunning operation. More information
15296        /// on [update_server_tls_policy][crate::client::NetworkSecurity::update_server_tls_policy].
15297        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15298            (*self.0.stub)
15299                .update_server_tls_policy(self.0.request, self.0.options)
15300                .await
15301                .map(crate::Response::into_body)
15302        }
15303
15304        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_server_tls_policy`.
15305        pub fn poller(
15306            self,
15307        ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
15308        {
15309            type Operation = google_cloud_lro::internal::Operation<
15310                crate::model::ServerTlsPolicy,
15311                crate::model::OperationMetadata,
15312            >;
15313            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15314            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15315
15316            let stub = self.0.stub.clone();
15317            let mut options = self.0.options.clone();
15318            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15319            let query = move |name| {
15320                let stub = stub.clone();
15321                let options = options.clone();
15322                async {
15323                    let op = GetOperation::new(stub)
15324                        .set_name(name)
15325                        .with_options(options)
15326                        .send()
15327                        .await?;
15328                    Ok(Operation::new(op))
15329                }
15330            };
15331
15332            let start = move || async {
15333                let op = self.send().await?;
15334                Ok(Operation::new(op))
15335            };
15336
15337            google_cloud_lro::internal::new_poller(
15338                polling_error_policy,
15339                polling_backoff_policy,
15340                start,
15341                query,
15342            )
15343        }
15344
15345        /// Sets the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
15346        pub fn set_update_mask<T>(mut self, v: T) -> Self
15347        where
15348            T: std::convert::Into<wkt::FieldMask>,
15349        {
15350            self.0.request.update_mask = std::option::Option::Some(v.into());
15351            self
15352        }
15353
15354        /// Sets or clears the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
15355        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15356        where
15357            T: std::convert::Into<wkt::FieldMask>,
15358        {
15359            self.0.request.update_mask = v.map(|x| x.into());
15360            self
15361        }
15362
15363        /// Sets the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
15364        ///
15365        /// This is a **required** field for requests.
15366        pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
15367        where
15368            T: std::convert::Into<crate::model::ServerTlsPolicy>,
15369        {
15370            self.0.request.server_tls_policy = std::option::Option::Some(v.into());
15371            self
15372        }
15373
15374        /// Sets or clears the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
15375        ///
15376        /// This is a **required** field for requests.
15377        pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15378        where
15379            T: std::convert::Into<crate::model::ServerTlsPolicy>,
15380        {
15381            self.0.request.server_tls_policy = v.map(|x| x.into());
15382            self
15383        }
15384    }
15385
15386    #[doc(hidden)]
15387    impl crate::RequestBuilder for UpdateServerTlsPolicy {
15388        fn request_options(&mut self) -> &mut crate::RequestOptions {
15389            &mut self.0.options
15390        }
15391    }
15392
15393    /// The request builder for [NetworkSecurity::delete_server_tls_policy][crate::client::NetworkSecurity::delete_server_tls_policy] calls.
15394    ///
15395    /// # Example
15396    /// ```
15397    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteServerTlsPolicy;
15398    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15399    /// use google_cloud_lro::Poller;
15400    ///
15401    /// let builder = prepare_request_builder();
15402    /// let response = builder.poller().until_done().await?;
15403    /// # Ok(()) }
15404    ///
15405    /// fn prepare_request_builder() -> DeleteServerTlsPolicy {
15406    ///   # panic!();
15407    ///   // ... details omitted ...
15408    /// }
15409    /// ```
15410    #[derive(Clone, Debug)]
15411    pub struct DeleteServerTlsPolicy(RequestBuilder<crate::model::DeleteServerTlsPolicyRequest>);
15412
15413    impl DeleteServerTlsPolicy {
15414        pub(crate) fn new(
15415            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15416        ) -> Self {
15417            Self(RequestBuilder::new(stub))
15418        }
15419
15420        /// Sets the full request, replacing any prior values.
15421        pub fn with_request<V: Into<crate::model::DeleteServerTlsPolicyRequest>>(
15422            mut self,
15423            v: V,
15424        ) -> Self {
15425            self.0.request = v.into();
15426            self
15427        }
15428
15429        /// Sets all the options, replacing any prior values.
15430        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15431            self.0.options = v.into();
15432            self
15433        }
15434
15435        /// Sends the request.
15436        ///
15437        /// # Long running operations
15438        ///
15439        /// This starts, but does not poll, a longrunning operation. More information
15440        /// on [delete_server_tls_policy][crate::client::NetworkSecurity::delete_server_tls_policy].
15441        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15442            (*self.0.stub)
15443                .delete_server_tls_policy(self.0.request, self.0.options)
15444                .await
15445                .map(crate::Response::into_body)
15446        }
15447
15448        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_server_tls_policy`.
15449        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
15450            type Operation =
15451                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15452            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15453            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15454
15455            let stub = self.0.stub.clone();
15456            let mut options = self.0.options.clone();
15457            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15458            let query = move |name| {
15459                let stub = stub.clone();
15460                let options = options.clone();
15461                async {
15462                    let op = GetOperation::new(stub)
15463                        .set_name(name)
15464                        .with_options(options)
15465                        .send()
15466                        .await?;
15467                    Ok(Operation::new(op))
15468                }
15469            };
15470
15471            let start = move || async {
15472                let op = self.send().await?;
15473                Ok(Operation::new(op))
15474            };
15475
15476            google_cloud_lro::internal::new_unit_response_poller(
15477                polling_error_policy,
15478                polling_backoff_policy,
15479                start,
15480                query,
15481            )
15482        }
15483
15484        /// Sets the value of [name][crate::model::DeleteServerTlsPolicyRequest::name].
15485        ///
15486        /// This is a **required** field for requests.
15487        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15488            self.0.request.name = v.into();
15489            self
15490        }
15491    }
15492
15493    #[doc(hidden)]
15494    impl crate::RequestBuilder for DeleteServerTlsPolicy {
15495        fn request_options(&mut self) -> &mut crate::RequestOptions {
15496            &mut self.0.options
15497        }
15498    }
15499
15500    /// The request builder for [NetworkSecurity::list_client_tls_policies][crate::client::NetworkSecurity::list_client_tls_policies] calls.
15501    ///
15502    /// # Example
15503    /// ```
15504    /// # use google_cloud_networksecurity_v1::builder::network_security::ListClientTlsPolicies;
15505    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15506    /// use google_cloud_gax::paginator::ItemPaginator;
15507    ///
15508    /// let builder = prepare_request_builder();
15509    /// let mut items = builder.by_item();
15510    /// while let Some(result) = items.next().await {
15511    ///   let item = result?;
15512    /// }
15513    /// # Ok(()) }
15514    ///
15515    /// fn prepare_request_builder() -> ListClientTlsPolicies {
15516    ///   # panic!();
15517    ///   // ... details omitted ...
15518    /// }
15519    /// ```
15520    #[derive(Clone, Debug)]
15521    pub struct ListClientTlsPolicies(RequestBuilder<crate::model::ListClientTlsPoliciesRequest>);
15522
15523    impl ListClientTlsPolicies {
15524        pub(crate) fn new(
15525            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15526        ) -> Self {
15527            Self(RequestBuilder::new(stub))
15528        }
15529
15530        /// Sets the full request, replacing any prior values.
15531        pub fn with_request<V: Into<crate::model::ListClientTlsPoliciesRequest>>(
15532            mut self,
15533            v: V,
15534        ) -> Self {
15535            self.0.request = v.into();
15536            self
15537        }
15538
15539        /// Sets all the options, replacing any prior values.
15540        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15541            self.0.options = v.into();
15542            self
15543        }
15544
15545        /// Sends the request.
15546        pub async fn send(self) -> Result<crate::model::ListClientTlsPoliciesResponse> {
15547            (*self.0.stub)
15548                .list_client_tls_policies(self.0.request, self.0.options)
15549                .await
15550                .map(crate::Response::into_body)
15551        }
15552
15553        /// Streams each page in the collection.
15554        pub fn by_page(
15555            self,
15556        ) -> impl google_cloud_gax::paginator::Paginator<
15557            crate::model::ListClientTlsPoliciesResponse,
15558            crate::Error,
15559        > {
15560            use std::clone::Clone;
15561            let token = self.0.request.page_token.clone();
15562            let execute = move |token: String| {
15563                let mut builder = self.clone();
15564                builder.0.request = builder.0.request.set_page_token(token);
15565                builder.send()
15566            };
15567            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15568        }
15569
15570        /// Streams each item in the collection.
15571        pub fn by_item(
15572            self,
15573        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15574            crate::model::ListClientTlsPoliciesResponse,
15575            crate::Error,
15576        > {
15577            use google_cloud_gax::paginator::Paginator;
15578            self.by_page().items()
15579        }
15580
15581        /// Sets the value of [parent][crate::model::ListClientTlsPoliciesRequest::parent].
15582        ///
15583        /// This is a **required** field for requests.
15584        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15585            self.0.request.parent = v.into();
15586            self
15587        }
15588
15589        /// Sets the value of [page_size][crate::model::ListClientTlsPoliciesRequest::page_size].
15590        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15591            self.0.request.page_size = v.into();
15592            self
15593        }
15594
15595        /// Sets the value of [page_token][crate::model::ListClientTlsPoliciesRequest::page_token].
15596        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15597            self.0.request.page_token = v.into();
15598            self
15599        }
15600    }
15601
15602    #[doc(hidden)]
15603    impl crate::RequestBuilder for ListClientTlsPolicies {
15604        fn request_options(&mut self) -> &mut crate::RequestOptions {
15605            &mut self.0.options
15606        }
15607    }
15608
15609    /// The request builder for [NetworkSecurity::get_client_tls_policy][crate::client::NetworkSecurity::get_client_tls_policy] calls.
15610    ///
15611    /// # Example
15612    /// ```
15613    /// # use google_cloud_networksecurity_v1::builder::network_security::GetClientTlsPolicy;
15614    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15615    ///
15616    /// let builder = prepare_request_builder();
15617    /// let response = builder.send().await?;
15618    /// # Ok(()) }
15619    ///
15620    /// fn prepare_request_builder() -> GetClientTlsPolicy {
15621    ///   # panic!();
15622    ///   // ... details omitted ...
15623    /// }
15624    /// ```
15625    #[derive(Clone, Debug)]
15626    pub struct GetClientTlsPolicy(RequestBuilder<crate::model::GetClientTlsPolicyRequest>);
15627
15628    impl GetClientTlsPolicy {
15629        pub(crate) fn new(
15630            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15631        ) -> Self {
15632            Self(RequestBuilder::new(stub))
15633        }
15634
15635        /// Sets the full request, replacing any prior values.
15636        pub fn with_request<V: Into<crate::model::GetClientTlsPolicyRequest>>(
15637            mut self,
15638            v: V,
15639        ) -> Self {
15640            self.0.request = v.into();
15641            self
15642        }
15643
15644        /// Sets all the options, replacing any prior values.
15645        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15646            self.0.options = v.into();
15647            self
15648        }
15649
15650        /// Sends the request.
15651        pub async fn send(self) -> Result<crate::model::ClientTlsPolicy> {
15652            (*self.0.stub)
15653                .get_client_tls_policy(self.0.request, self.0.options)
15654                .await
15655                .map(crate::Response::into_body)
15656        }
15657
15658        /// Sets the value of [name][crate::model::GetClientTlsPolicyRequest::name].
15659        ///
15660        /// This is a **required** field for requests.
15661        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15662            self.0.request.name = v.into();
15663            self
15664        }
15665    }
15666
15667    #[doc(hidden)]
15668    impl crate::RequestBuilder for GetClientTlsPolicy {
15669        fn request_options(&mut self) -> &mut crate::RequestOptions {
15670            &mut self.0.options
15671        }
15672    }
15673
15674    /// The request builder for [NetworkSecurity::create_client_tls_policy][crate::client::NetworkSecurity::create_client_tls_policy] calls.
15675    ///
15676    /// # Example
15677    /// ```
15678    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateClientTlsPolicy;
15679    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15680    /// use google_cloud_lro::Poller;
15681    ///
15682    /// let builder = prepare_request_builder();
15683    /// let response = builder.poller().until_done().await?;
15684    /// # Ok(()) }
15685    ///
15686    /// fn prepare_request_builder() -> CreateClientTlsPolicy {
15687    ///   # panic!();
15688    ///   // ... details omitted ...
15689    /// }
15690    /// ```
15691    #[derive(Clone, Debug)]
15692    pub struct CreateClientTlsPolicy(RequestBuilder<crate::model::CreateClientTlsPolicyRequest>);
15693
15694    impl CreateClientTlsPolicy {
15695        pub(crate) fn new(
15696            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15697        ) -> Self {
15698            Self(RequestBuilder::new(stub))
15699        }
15700
15701        /// Sets the full request, replacing any prior values.
15702        pub fn with_request<V: Into<crate::model::CreateClientTlsPolicyRequest>>(
15703            mut self,
15704            v: V,
15705        ) -> Self {
15706            self.0.request = v.into();
15707            self
15708        }
15709
15710        /// Sets all the options, replacing any prior values.
15711        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15712            self.0.options = v.into();
15713            self
15714        }
15715
15716        /// Sends the request.
15717        ///
15718        /// # Long running operations
15719        ///
15720        /// This starts, but does not poll, a longrunning operation. More information
15721        /// on [create_client_tls_policy][crate::client::NetworkSecurity::create_client_tls_policy].
15722        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15723            (*self.0.stub)
15724                .create_client_tls_policy(self.0.request, self.0.options)
15725                .await
15726                .map(crate::Response::into_body)
15727        }
15728
15729        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_client_tls_policy`.
15730        pub fn poller(
15731            self,
15732        ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
15733        {
15734            type Operation = google_cloud_lro::internal::Operation<
15735                crate::model::ClientTlsPolicy,
15736                crate::model::OperationMetadata,
15737            >;
15738            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15739            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15740
15741            let stub = self.0.stub.clone();
15742            let mut options = self.0.options.clone();
15743            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15744            let query = move |name| {
15745                let stub = stub.clone();
15746                let options = options.clone();
15747                async {
15748                    let op = GetOperation::new(stub)
15749                        .set_name(name)
15750                        .with_options(options)
15751                        .send()
15752                        .await?;
15753                    Ok(Operation::new(op))
15754                }
15755            };
15756
15757            let start = move || async {
15758                let op = self.send().await?;
15759                Ok(Operation::new(op))
15760            };
15761
15762            google_cloud_lro::internal::new_poller(
15763                polling_error_policy,
15764                polling_backoff_policy,
15765                start,
15766                query,
15767            )
15768        }
15769
15770        /// Sets the value of [parent][crate::model::CreateClientTlsPolicyRequest::parent].
15771        ///
15772        /// This is a **required** field for requests.
15773        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15774            self.0.request.parent = v.into();
15775            self
15776        }
15777
15778        /// Sets the value of [client_tls_policy_id][crate::model::CreateClientTlsPolicyRequest::client_tls_policy_id].
15779        ///
15780        /// This is a **required** field for requests.
15781        pub fn set_client_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15782            self.0.request.client_tls_policy_id = v.into();
15783            self
15784        }
15785
15786        /// Sets the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
15787        ///
15788        /// This is a **required** field for requests.
15789        pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
15790        where
15791            T: std::convert::Into<crate::model::ClientTlsPolicy>,
15792        {
15793            self.0.request.client_tls_policy = std::option::Option::Some(v.into());
15794            self
15795        }
15796
15797        /// Sets or clears the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
15798        ///
15799        /// This is a **required** field for requests.
15800        pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15801        where
15802            T: std::convert::Into<crate::model::ClientTlsPolicy>,
15803        {
15804            self.0.request.client_tls_policy = v.map(|x| x.into());
15805            self
15806        }
15807    }
15808
15809    #[doc(hidden)]
15810    impl crate::RequestBuilder for CreateClientTlsPolicy {
15811        fn request_options(&mut self) -> &mut crate::RequestOptions {
15812            &mut self.0.options
15813        }
15814    }
15815
15816    /// The request builder for [NetworkSecurity::update_client_tls_policy][crate::client::NetworkSecurity::update_client_tls_policy] calls.
15817    ///
15818    /// # Example
15819    /// ```
15820    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateClientTlsPolicy;
15821    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15822    /// use google_cloud_lro::Poller;
15823    ///
15824    /// let builder = prepare_request_builder();
15825    /// let response = builder.poller().until_done().await?;
15826    /// # Ok(()) }
15827    ///
15828    /// fn prepare_request_builder() -> UpdateClientTlsPolicy {
15829    ///   # panic!();
15830    ///   // ... details omitted ...
15831    /// }
15832    /// ```
15833    #[derive(Clone, Debug)]
15834    pub struct UpdateClientTlsPolicy(RequestBuilder<crate::model::UpdateClientTlsPolicyRequest>);
15835
15836    impl UpdateClientTlsPolicy {
15837        pub(crate) fn new(
15838            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15839        ) -> Self {
15840            Self(RequestBuilder::new(stub))
15841        }
15842
15843        /// Sets the full request, replacing any prior values.
15844        pub fn with_request<V: Into<crate::model::UpdateClientTlsPolicyRequest>>(
15845            mut self,
15846            v: V,
15847        ) -> Self {
15848            self.0.request = v.into();
15849            self
15850        }
15851
15852        /// Sets all the options, replacing any prior values.
15853        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15854            self.0.options = v.into();
15855            self
15856        }
15857
15858        /// Sends the request.
15859        ///
15860        /// # Long running operations
15861        ///
15862        /// This starts, but does not poll, a longrunning operation. More information
15863        /// on [update_client_tls_policy][crate::client::NetworkSecurity::update_client_tls_policy].
15864        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15865            (*self.0.stub)
15866                .update_client_tls_policy(self.0.request, self.0.options)
15867                .await
15868                .map(crate::Response::into_body)
15869        }
15870
15871        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_client_tls_policy`.
15872        pub fn poller(
15873            self,
15874        ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
15875        {
15876            type Operation = google_cloud_lro::internal::Operation<
15877                crate::model::ClientTlsPolicy,
15878                crate::model::OperationMetadata,
15879            >;
15880            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15881            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15882
15883            let stub = self.0.stub.clone();
15884            let mut options = self.0.options.clone();
15885            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15886            let query = move |name| {
15887                let stub = stub.clone();
15888                let options = options.clone();
15889                async {
15890                    let op = GetOperation::new(stub)
15891                        .set_name(name)
15892                        .with_options(options)
15893                        .send()
15894                        .await?;
15895                    Ok(Operation::new(op))
15896                }
15897            };
15898
15899            let start = move || async {
15900                let op = self.send().await?;
15901                Ok(Operation::new(op))
15902            };
15903
15904            google_cloud_lro::internal::new_poller(
15905                polling_error_policy,
15906                polling_backoff_policy,
15907                start,
15908                query,
15909            )
15910        }
15911
15912        /// Sets the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
15913        pub fn set_update_mask<T>(mut self, v: T) -> Self
15914        where
15915            T: std::convert::Into<wkt::FieldMask>,
15916        {
15917            self.0.request.update_mask = std::option::Option::Some(v.into());
15918            self
15919        }
15920
15921        /// Sets or clears the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
15922        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15923        where
15924            T: std::convert::Into<wkt::FieldMask>,
15925        {
15926            self.0.request.update_mask = v.map(|x| x.into());
15927            self
15928        }
15929
15930        /// Sets the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
15931        ///
15932        /// This is a **required** field for requests.
15933        pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
15934        where
15935            T: std::convert::Into<crate::model::ClientTlsPolicy>,
15936        {
15937            self.0.request.client_tls_policy = std::option::Option::Some(v.into());
15938            self
15939        }
15940
15941        /// Sets or clears the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
15942        ///
15943        /// This is a **required** field for requests.
15944        pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15945        where
15946            T: std::convert::Into<crate::model::ClientTlsPolicy>,
15947        {
15948            self.0.request.client_tls_policy = v.map(|x| x.into());
15949            self
15950        }
15951    }
15952
15953    #[doc(hidden)]
15954    impl crate::RequestBuilder for UpdateClientTlsPolicy {
15955        fn request_options(&mut self) -> &mut crate::RequestOptions {
15956            &mut self.0.options
15957        }
15958    }
15959
15960    /// The request builder for [NetworkSecurity::delete_client_tls_policy][crate::client::NetworkSecurity::delete_client_tls_policy] calls.
15961    ///
15962    /// # Example
15963    /// ```
15964    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteClientTlsPolicy;
15965    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15966    /// use google_cloud_lro::Poller;
15967    ///
15968    /// let builder = prepare_request_builder();
15969    /// let response = builder.poller().until_done().await?;
15970    /// # Ok(()) }
15971    ///
15972    /// fn prepare_request_builder() -> DeleteClientTlsPolicy {
15973    ///   # panic!();
15974    ///   // ... details omitted ...
15975    /// }
15976    /// ```
15977    #[derive(Clone, Debug)]
15978    pub struct DeleteClientTlsPolicy(RequestBuilder<crate::model::DeleteClientTlsPolicyRequest>);
15979
15980    impl DeleteClientTlsPolicy {
15981        pub(crate) fn new(
15982            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15983        ) -> Self {
15984            Self(RequestBuilder::new(stub))
15985        }
15986
15987        /// Sets the full request, replacing any prior values.
15988        pub fn with_request<V: Into<crate::model::DeleteClientTlsPolicyRequest>>(
15989            mut self,
15990            v: V,
15991        ) -> Self {
15992            self.0.request = v.into();
15993            self
15994        }
15995
15996        /// Sets all the options, replacing any prior values.
15997        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15998            self.0.options = v.into();
15999            self
16000        }
16001
16002        /// Sends the request.
16003        ///
16004        /// # Long running operations
16005        ///
16006        /// This starts, but does not poll, a longrunning operation. More information
16007        /// on [delete_client_tls_policy][crate::client::NetworkSecurity::delete_client_tls_policy].
16008        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16009            (*self.0.stub)
16010                .delete_client_tls_policy(self.0.request, self.0.options)
16011                .await
16012                .map(crate::Response::into_body)
16013        }
16014
16015        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_client_tls_policy`.
16016        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16017            type Operation =
16018                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16019            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16020            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16021
16022            let stub = self.0.stub.clone();
16023            let mut options = self.0.options.clone();
16024            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16025            let query = move |name| {
16026                let stub = stub.clone();
16027                let options = options.clone();
16028                async {
16029                    let op = GetOperation::new(stub)
16030                        .set_name(name)
16031                        .with_options(options)
16032                        .send()
16033                        .await?;
16034                    Ok(Operation::new(op))
16035                }
16036            };
16037
16038            let start = move || async {
16039                let op = self.send().await?;
16040                Ok(Operation::new(op))
16041            };
16042
16043            google_cloud_lro::internal::new_unit_response_poller(
16044                polling_error_policy,
16045                polling_backoff_policy,
16046                start,
16047                query,
16048            )
16049        }
16050
16051        /// Sets the value of [name][crate::model::DeleteClientTlsPolicyRequest::name].
16052        ///
16053        /// This is a **required** field for requests.
16054        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16055            self.0.request.name = v.into();
16056            self
16057        }
16058    }
16059
16060    #[doc(hidden)]
16061    impl crate::RequestBuilder for DeleteClientTlsPolicy {
16062        fn request_options(&mut self) -> &mut crate::RequestOptions {
16063            &mut self.0.options
16064        }
16065    }
16066
16067    /// The request builder for [NetworkSecurity::list_gateway_security_policies][crate::client::NetworkSecurity::list_gateway_security_policies] calls.
16068    ///
16069    /// # Example
16070    /// ```
16071    /// # use google_cloud_networksecurity_v1::builder::network_security::ListGatewaySecurityPolicies;
16072    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16073    /// use google_cloud_gax::paginator::ItemPaginator;
16074    ///
16075    /// let builder = prepare_request_builder();
16076    /// let mut items = builder.by_item();
16077    /// while let Some(result) = items.next().await {
16078    ///   let item = result?;
16079    /// }
16080    /// # Ok(()) }
16081    ///
16082    /// fn prepare_request_builder() -> ListGatewaySecurityPolicies {
16083    ///   # panic!();
16084    ///   // ... details omitted ...
16085    /// }
16086    /// ```
16087    #[derive(Clone, Debug)]
16088    pub struct ListGatewaySecurityPolicies(
16089        RequestBuilder<crate::model::ListGatewaySecurityPoliciesRequest>,
16090    );
16091
16092    impl ListGatewaySecurityPolicies {
16093        pub(crate) fn new(
16094            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16095        ) -> Self {
16096            Self(RequestBuilder::new(stub))
16097        }
16098
16099        /// Sets the full request, replacing any prior values.
16100        pub fn with_request<V: Into<crate::model::ListGatewaySecurityPoliciesRequest>>(
16101            mut self,
16102            v: V,
16103        ) -> Self {
16104            self.0.request = v.into();
16105            self
16106        }
16107
16108        /// Sets all the options, replacing any prior values.
16109        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16110            self.0.options = v.into();
16111            self
16112        }
16113
16114        /// Sends the request.
16115        pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPoliciesResponse> {
16116            (*self.0.stub)
16117                .list_gateway_security_policies(self.0.request, self.0.options)
16118                .await
16119                .map(crate::Response::into_body)
16120        }
16121
16122        /// Streams each page in the collection.
16123        pub fn by_page(
16124            self,
16125        ) -> impl google_cloud_gax::paginator::Paginator<
16126            crate::model::ListGatewaySecurityPoliciesResponse,
16127            crate::Error,
16128        > {
16129            use std::clone::Clone;
16130            let token = self.0.request.page_token.clone();
16131            let execute = move |token: String| {
16132                let mut builder = self.clone();
16133                builder.0.request = builder.0.request.set_page_token(token);
16134                builder.send()
16135            };
16136            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16137        }
16138
16139        /// Streams each item in the collection.
16140        pub fn by_item(
16141            self,
16142        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16143            crate::model::ListGatewaySecurityPoliciesResponse,
16144            crate::Error,
16145        > {
16146            use google_cloud_gax::paginator::Paginator;
16147            self.by_page().items()
16148        }
16149
16150        /// Sets the value of [parent][crate::model::ListGatewaySecurityPoliciesRequest::parent].
16151        ///
16152        /// This is a **required** field for requests.
16153        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16154            self.0.request.parent = v.into();
16155            self
16156        }
16157
16158        /// Sets the value of [page_size][crate::model::ListGatewaySecurityPoliciesRequest::page_size].
16159        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16160            self.0.request.page_size = v.into();
16161            self
16162        }
16163
16164        /// Sets the value of [page_token][crate::model::ListGatewaySecurityPoliciesRequest::page_token].
16165        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16166            self.0.request.page_token = v.into();
16167            self
16168        }
16169    }
16170
16171    #[doc(hidden)]
16172    impl crate::RequestBuilder for ListGatewaySecurityPolicies {
16173        fn request_options(&mut self) -> &mut crate::RequestOptions {
16174            &mut self.0.options
16175        }
16176    }
16177
16178    /// The request builder for [NetworkSecurity::get_gateway_security_policy][crate::client::NetworkSecurity::get_gateway_security_policy] calls.
16179    ///
16180    /// # Example
16181    /// ```
16182    /// # use google_cloud_networksecurity_v1::builder::network_security::GetGatewaySecurityPolicy;
16183    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16184    ///
16185    /// let builder = prepare_request_builder();
16186    /// let response = builder.send().await?;
16187    /// # Ok(()) }
16188    ///
16189    /// fn prepare_request_builder() -> GetGatewaySecurityPolicy {
16190    ///   # panic!();
16191    ///   // ... details omitted ...
16192    /// }
16193    /// ```
16194    #[derive(Clone, Debug)]
16195    pub struct GetGatewaySecurityPolicy(
16196        RequestBuilder<crate::model::GetGatewaySecurityPolicyRequest>,
16197    );
16198
16199    impl GetGatewaySecurityPolicy {
16200        pub(crate) fn new(
16201            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16202        ) -> Self {
16203            Self(RequestBuilder::new(stub))
16204        }
16205
16206        /// Sets the full request, replacing any prior values.
16207        pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRequest>>(
16208            mut self,
16209            v: V,
16210        ) -> Self {
16211            self.0.request = v.into();
16212            self
16213        }
16214
16215        /// Sets all the options, replacing any prior values.
16216        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16217            self.0.options = v.into();
16218            self
16219        }
16220
16221        /// Sends the request.
16222        pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicy> {
16223            (*self.0.stub)
16224                .get_gateway_security_policy(self.0.request, self.0.options)
16225                .await
16226                .map(crate::Response::into_body)
16227        }
16228
16229        /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRequest::name].
16230        ///
16231        /// This is a **required** field for requests.
16232        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16233            self.0.request.name = v.into();
16234            self
16235        }
16236    }
16237
16238    #[doc(hidden)]
16239    impl crate::RequestBuilder for GetGatewaySecurityPolicy {
16240        fn request_options(&mut self) -> &mut crate::RequestOptions {
16241            &mut self.0.options
16242        }
16243    }
16244
16245    /// The request builder for [NetworkSecurity::create_gateway_security_policy][crate::client::NetworkSecurity::create_gateway_security_policy] calls.
16246    ///
16247    /// # Example
16248    /// ```
16249    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateGatewaySecurityPolicy;
16250    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16251    /// use google_cloud_lro::Poller;
16252    ///
16253    /// let builder = prepare_request_builder();
16254    /// let response = builder.poller().until_done().await?;
16255    /// # Ok(()) }
16256    ///
16257    /// fn prepare_request_builder() -> CreateGatewaySecurityPolicy {
16258    ///   # panic!();
16259    ///   // ... details omitted ...
16260    /// }
16261    /// ```
16262    #[derive(Clone, Debug)]
16263    pub struct CreateGatewaySecurityPolicy(
16264        RequestBuilder<crate::model::CreateGatewaySecurityPolicyRequest>,
16265    );
16266
16267    impl CreateGatewaySecurityPolicy {
16268        pub(crate) fn new(
16269            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16270        ) -> Self {
16271            Self(RequestBuilder::new(stub))
16272        }
16273
16274        /// Sets the full request, replacing any prior values.
16275        pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRequest>>(
16276            mut self,
16277            v: V,
16278        ) -> Self {
16279            self.0.request = v.into();
16280            self
16281        }
16282
16283        /// Sets all the options, replacing any prior values.
16284        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16285            self.0.options = v.into();
16286            self
16287        }
16288
16289        /// Sends the request.
16290        ///
16291        /// # Long running operations
16292        ///
16293        /// This starts, but does not poll, a longrunning operation. More information
16294        /// on [create_gateway_security_policy][crate::client::NetworkSecurity::create_gateway_security_policy].
16295        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16296            (*self.0.stub)
16297                .create_gateway_security_policy(self.0.request, self.0.options)
16298                .await
16299                .map(crate::Response::into_body)
16300        }
16301
16302        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_gateway_security_policy`.
16303        pub fn poller(
16304            self,
16305        ) -> impl google_cloud_lro::Poller<
16306            crate::model::GatewaySecurityPolicy,
16307            crate::model::OperationMetadata,
16308        > {
16309            type Operation = google_cloud_lro::internal::Operation<
16310                crate::model::GatewaySecurityPolicy,
16311                crate::model::OperationMetadata,
16312            >;
16313            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16314            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16315
16316            let stub = self.0.stub.clone();
16317            let mut options = self.0.options.clone();
16318            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16319            let query = move |name| {
16320                let stub = stub.clone();
16321                let options = options.clone();
16322                async {
16323                    let op = GetOperation::new(stub)
16324                        .set_name(name)
16325                        .with_options(options)
16326                        .send()
16327                        .await?;
16328                    Ok(Operation::new(op))
16329                }
16330            };
16331
16332            let start = move || async {
16333                let op = self.send().await?;
16334                Ok(Operation::new(op))
16335            };
16336
16337            google_cloud_lro::internal::new_poller(
16338                polling_error_policy,
16339                polling_backoff_policy,
16340                start,
16341                query,
16342            )
16343        }
16344
16345        /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRequest::parent].
16346        ///
16347        /// This is a **required** field for requests.
16348        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16349            self.0.request.parent = v.into();
16350            self
16351        }
16352
16353        /// Sets the value of [gateway_security_policy_id][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy_id].
16354        ///
16355        /// This is a **required** field for requests.
16356        pub fn set_gateway_security_policy_id<T: Into<std::string::String>>(
16357            mut self,
16358            v: T,
16359        ) -> Self {
16360            self.0.request.gateway_security_policy_id = v.into();
16361            self
16362        }
16363
16364        /// Sets the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
16365        ///
16366        /// This is a **required** field for requests.
16367        pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
16368        where
16369            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16370        {
16371            self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
16372            self
16373        }
16374
16375        /// Sets or clears the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
16376        ///
16377        /// This is a **required** field for requests.
16378        pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
16379        where
16380            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16381        {
16382            self.0.request.gateway_security_policy = v.map(|x| x.into());
16383            self
16384        }
16385    }
16386
16387    #[doc(hidden)]
16388    impl crate::RequestBuilder for CreateGatewaySecurityPolicy {
16389        fn request_options(&mut self) -> &mut crate::RequestOptions {
16390            &mut self.0.options
16391        }
16392    }
16393
16394    /// The request builder for [NetworkSecurity::update_gateway_security_policy][crate::client::NetworkSecurity::update_gateway_security_policy] calls.
16395    ///
16396    /// # Example
16397    /// ```
16398    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateGatewaySecurityPolicy;
16399    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16400    /// use google_cloud_lro::Poller;
16401    ///
16402    /// let builder = prepare_request_builder();
16403    /// let response = builder.poller().until_done().await?;
16404    /// # Ok(()) }
16405    ///
16406    /// fn prepare_request_builder() -> UpdateGatewaySecurityPolicy {
16407    ///   # panic!();
16408    ///   // ... details omitted ...
16409    /// }
16410    /// ```
16411    #[derive(Clone, Debug)]
16412    pub struct UpdateGatewaySecurityPolicy(
16413        RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRequest>,
16414    );
16415
16416    impl UpdateGatewaySecurityPolicy {
16417        pub(crate) fn new(
16418            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16419        ) -> Self {
16420            Self(RequestBuilder::new(stub))
16421        }
16422
16423        /// Sets the full request, replacing any prior values.
16424        pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRequest>>(
16425            mut self,
16426            v: V,
16427        ) -> Self {
16428            self.0.request = v.into();
16429            self
16430        }
16431
16432        /// Sets all the options, replacing any prior values.
16433        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16434            self.0.options = v.into();
16435            self
16436        }
16437
16438        /// Sends the request.
16439        ///
16440        /// # Long running operations
16441        ///
16442        /// This starts, but does not poll, a longrunning operation. More information
16443        /// on [update_gateway_security_policy][crate::client::NetworkSecurity::update_gateway_security_policy].
16444        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16445            (*self.0.stub)
16446                .update_gateway_security_policy(self.0.request, self.0.options)
16447                .await
16448                .map(crate::Response::into_body)
16449        }
16450
16451        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_gateway_security_policy`.
16452        pub fn poller(
16453            self,
16454        ) -> impl google_cloud_lro::Poller<
16455            crate::model::GatewaySecurityPolicy,
16456            crate::model::OperationMetadata,
16457        > {
16458            type Operation = google_cloud_lro::internal::Operation<
16459                crate::model::GatewaySecurityPolicy,
16460                crate::model::OperationMetadata,
16461            >;
16462            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16463            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16464
16465            let stub = self.0.stub.clone();
16466            let mut options = self.0.options.clone();
16467            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16468            let query = move |name| {
16469                let stub = stub.clone();
16470                let options = options.clone();
16471                async {
16472                    let op = GetOperation::new(stub)
16473                        .set_name(name)
16474                        .with_options(options)
16475                        .send()
16476                        .await?;
16477                    Ok(Operation::new(op))
16478                }
16479            };
16480
16481            let start = move || async {
16482                let op = self.send().await?;
16483                Ok(Operation::new(op))
16484            };
16485
16486            google_cloud_lro::internal::new_poller(
16487                polling_error_policy,
16488                polling_backoff_policy,
16489                start,
16490                query,
16491            )
16492        }
16493
16494        /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
16495        pub fn set_update_mask<T>(mut self, v: T) -> Self
16496        where
16497            T: std::convert::Into<wkt::FieldMask>,
16498        {
16499            self.0.request.update_mask = std::option::Option::Some(v.into());
16500            self
16501        }
16502
16503        /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
16504        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16505        where
16506            T: std::convert::Into<wkt::FieldMask>,
16507        {
16508            self.0.request.update_mask = v.map(|x| x.into());
16509            self
16510        }
16511
16512        /// Sets the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
16513        ///
16514        /// This is a **required** field for requests.
16515        pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
16516        where
16517            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16518        {
16519            self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
16520            self
16521        }
16522
16523        /// Sets or clears the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
16524        ///
16525        /// This is a **required** field for requests.
16526        pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
16527        where
16528            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16529        {
16530            self.0.request.gateway_security_policy = v.map(|x| x.into());
16531            self
16532        }
16533    }
16534
16535    #[doc(hidden)]
16536    impl crate::RequestBuilder for UpdateGatewaySecurityPolicy {
16537        fn request_options(&mut self) -> &mut crate::RequestOptions {
16538            &mut self.0.options
16539        }
16540    }
16541
16542    /// The request builder for [NetworkSecurity::delete_gateway_security_policy][crate::client::NetworkSecurity::delete_gateway_security_policy] calls.
16543    ///
16544    /// # Example
16545    /// ```
16546    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteGatewaySecurityPolicy;
16547    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16548    /// use google_cloud_lro::Poller;
16549    ///
16550    /// let builder = prepare_request_builder();
16551    /// let response = builder.poller().until_done().await?;
16552    /// # Ok(()) }
16553    ///
16554    /// fn prepare_request_builder() -> DeleteGatewaySecurityPolicy {
16555    ///   # panic!();
16556    ///   // ... details omitted ...
16557    /// }
16558    /// ```
16559    #[derive(Clone, Debug)]
16560    pub struct DeleteGatewaySecurityPolicy(
16561        RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRequest>,
16562    );
16563
16564    impl DeleteGatewaySecurityPolicy {
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::DeleteGatewaySecurityPolicyRequest>>(
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        ///
16588        /// # Long running operations
16589        ///
16590        /// This starts, but does not poll, a longrunning operation. More information
16591        /// on [delete_gateway_security_policy][crate::client::NetworkSecurity::delete_gateway_security_policy].
16592        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16593            (*self.0.stub)
16594                .delete_gateway_security_policy(self.0.request, self.0.options)
16595                .await
16596                .map(crate::Response::into_body)
16597        }
16598
16599        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_gateway_security_policy`.
16600        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16601            type Operation =
16602                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16603            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16604            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16605
16606            let stub = self.0.stub.clone();
16607            let mut options = self.0.options.clone();
16608            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16609            let query = move |name| {
16610                let stub = stub.clone();
16611                let options = options.clone();
16612                async {
16613                    let op = GetOperation::new(stub)
16614                        .set_name(name)
16615                        .with_options(options)
16616                        .send()
16617                        .await?;
16618                    Ok(Operation::new(op))
16619                }
16620            };
16621
16622            let start = move || async {
16623                let op = self.send().await?;
16624                Ok(Operation::new(op))
16625            };
16626
16627            google_cloud_lro::internal::new_unit_response_poller(
16628                polling_error_policy,
16629                polling_backoff_policy,
16630                start,
16631                query,
16632            )
16633        }
16634
16635        /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRequest::name].
16636        ///
16637        /// This is a **required** field for requests.
16638        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16639            self.0.request.name = v.into();
16640            self
16641        }
16642    }
16643
16644    #[doc(hidden)]
16645    impl crate::RequestBuilder for DeleteGatewaySecurityPolicy {
16646        fn request_options(&mut self) -> &mut crate::RequestOptions {
16647            &mut self.0.options
16648        }
16649    }
16650
16651    /// The request builder for [NetworkSecurity::list_gateway_security_policy_rules][crate::client::NetworkSecurity::list_gateway_security_policy_rules] calls.
16652    ///
16653    /// # Example
16654    /// ```
16655    /// # use google_cloud_networksecurity_v1::builder::network_security::ListGatewaySecurityPolicyRules;
16656    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16657    /// use google_cloud_gax::paginator::ItemPaginator;
16658    ///
16659    /// let builder = prepare_request_builder();
16660    /// let mut items = builder.by_item();
16661    /// while let Some(result) = items.next().await {
16662    ///   let item = result?;
16663    /// }
16664    /// # Ok(()) }
16665    ///
16666    /// fn prepare_request_builder() -> ListGatewaySecurityPolicyRules {
16667    ///   # panic!();
16668    ///   // ... details omitted ...
16669    /// }
16670    /// ```
16671    #[derive(Clone, Debug)]
16672    pub struct ListGatewaySecurityPolicyRules(
16673        RequestBuilder<crate::model::ListGatewaySecurityPolicyRulesRequest>,
16674    );
16675
16676    impl ListGatewaySecurityPolicyRules {
16677        pub(crate) fn new(
16678            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16679        ) -> Self {
16680            Self(RequestBuilder::new(stub))
16681        }
16682
16683        /// Sets the full request, replacing any prior values.
16684        pub fn with_request<V: Into<crate::model::ListGatewaySecurityPolicyRulesRequest>>(
16685            mut self,
16686            v: V,
16687        ) -> Self {
16688            self.0.request = v.into();
16689            self
16690        }
16691
16692        /// Sets all the options, replacing any prior values.
16693        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16694            self.0.options = v.into();
16695            self
16696        }
16697
16698        /// Sends the request.
16699        pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPolicyRulesResponse> {
16700            (*self.0.stub)
16701                .list_gateway_security_policy_rules(self.0.request, self.0.options)
16702                .await
16703                .map(crate::Response::into_body)
16704        }
16705
16706        /// Streams each page in the collection.
16707        pub fn by_page(
16708            self,
16709        ) -> impl google_cloud_gax::paginator::Paginator<
16710            crate::model::ListGatewaySecurityPolicyRulesResponse,
16711            crate::Error,
16712        > {
16713            use std::clone::Clone;
16714            let token = self.0.request.page_token.clone();
16715            let execute = move |token: String| {
16716                let mut builder = self.clone();
16717                builder.0.request = builder.0.request.set_page_token(token);
16718                builder.send()
16719            };
16720            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16721        }
16722
16723        /// Streams each item in the collection.
16724        pub fn by_item(
16725            self,
16726        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16727            crate::model::ListGatewaySecurityPolicyRulesResponse,
16728            crate::Error,
16729        > {
16730            use google_cloud_gax::paginator::Paginator;
16731            self.by_page().items()
16732        }
16733
16734        /// Sets the value of [parent][crate::model::ListGatewaySecurityPolicyRulesRequest::parent].
16735        ///
16736        /// This is a **required** field for requests.
16737        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16738            self.0.request.parent = v.into();
16739            self
16740        }
16741
16742        /// Sets the value of [page_size][crate::model::ListGatewaySecurityPolicyRulesRequest::page_size].
16743        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16744            self.0.request.page_size = v.into();
16745            self
16746        }
16747
16748        /// Sets the value of [page_token][crate::model::ListGatewaySecurityPolicyRulesRequest::page_token].
16749        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16750            self.0.request.page_token = v.into();
16751            self
16752        }
16753    }
16754
16755    #[doc(hidden)]
16756    impl crate::RequestBuilder for ListGatewaySecurityPolicyRules {
16757        fn request_options(&mut self) -> &mut crate::RequestOptions {
16758            &mut self.0.options
16759        }
16760    }
16761
16762    /// The request builder for [NetworkSecurity::get_gateway_security_policy_rule][crate::client::NetworkSecurity::get_gateway_security_policy_rule] calls.
16763    ///
16764    /// # Example
16765    /// ```
16766    /// # use google_cloud_networksecurity_v1::builder::network_security::GetGatewaySecurityPolicyRule;
16767    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16768    ///
16769    /// let builder = prepare_request_builder();
16770    /// let response = builder.send().await?;
16771    /// # Ok(()) }
16772    ///
16773    /// fn prepare_request_builder() -> GetGatewaySecurityPolicyRule {
16774    ///   # panic!();
16775    ///   // ... details omitted ...
16776    /// }
16777    /// ```
16778    #[derive(Clone, Debug)]
16779    pub struct GetGatewaySecurityPolicyRule(
16780        RequestBuilder<crate::model::GetGatewaySecurityPolicyRuleRequest>,
16781    );
16782
16783    impl GetGatewaySecurityPolicyRule {
16784        pub(crate) fn new(
16785            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16786        ) -> Self {
16787            Self(RequestBuilder::new(stub))
16788        }
16789
16790        /// Sets the full request, replacing any prior values.
16791        pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRuleRequest>>(
16792            mut self,
16793            v: V,
16794        ) -> Self {
16795            self.0.request = v.into();
16796            self
16797        }
16798
16799        /// Sets all the options, replacing any prior values.
16800        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16801            self.0.options = v.into();
16802            self
16803        }
16804
16805        /// Sends the request.
16806        pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicyRule> {
16807            (*self.0.stub)
16808                .get_gateway_security_policy_rule(self.0.request, self.0.options)
16809                .await
16810                .map(crate::Response::into_body)
16811        }
16812
16813        /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRuleRequest::name].
16814        ///
16815        /// This is a **required** field for requests.
16816        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16817            self.0.request.name = v.into();
16818            self
16819        }
16820    }
16821
16822    #[doc(hidden)]
16823    impl crate::RequestBuilder for GetGatewaySecurityPolicyRule {
16824        fn request_options(&mut self) -> &mut crate::RequestOptions {
16825            &mut self.0.options
16826        }
16827    }
16828
16829    /// The request builder for [NetworkSecurity::create_gateway_security_policy_rule][crate::client::NetworkSecurity::create_gateway_security_policy_rule] calls.
16830    ///
16831    /// # Example
16832    /// ```
16833    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateGatewaySecurityPolicyRule;
16834    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16835    /// use google_cloud_lro::Poller;
16836    ///
16837    /// let builder = prepare_request_builder();
16838    /// let response = builder.poller().until_done().await?;
16839    /// # Ok(()) }
16840    ///
16841    /// fn prepare_request_builder() -> CreateGatewaySecurityPolicyRule {
16842    ///   # panic!();
16843    ///   // ... details omitted ...
16844    /// }
16845    /// ```
16846    #[derive(Clone, Debug)]
16847    pub struct CreateGatewaySecurityPolicyRule(
16848        RequestBuilder<crate::model::CreateGatewaySecurityPolicyRuleRequest>,
16849    );
16850
16851    impl CreateGatewaySecurityPolicyRule {
16852        pub(crate) fn new(
16853            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16854        ) -> Self {
16855            Self(RequestBuilder::new(stub))
16856        }
16857
16858        /// Sets the full request, replacing any prior values.
16859        pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRuleRequest>>(
16860            mut self,
16861            v: V,
16862        ) -> Self {
16863            self.0.request = v.into();
16864            self
16865        }
16866
16867        /// Sets all the options, replacing any prior values.
16868        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16869            self.0.options = v.into();
16870            self
16871        }
16872
16873        /// Sends the request.
16874        ///
16875        /// # Long running operations
16876        ///
16877        /// This starts, but does not poll, a longrunning operation. More information
16878        /// on [create_gateway_security_policy_rule][crate::client::NetworkSecurity::create_gateway_security_policy_rule].
16879        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16880            (*self.0.stub)
16881                .create_gateway_security_policy_rule(self.0.request, self.0.options)
16882                .await
16883                .map(crate::Response::into_body)
16884        }
16885
16886        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_gateway_security_policy_rule`.
16887        pub fn poller(
16888            self,
16889        ) -> impl google_cloud_lro::Poller<
16890            crate::model::GatewaySecurityPolicyRule,
16891            crate::model::OperationMetadata,
16892        > {
16893            type Operation = google_cloud_lro::internal::Operation<
16894                crate::model::GatewaySecurityPolicyRule,
16895                crate::model::OperationMetadata,
16896            >;
16897            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16898            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16899
16900            let stub = self.0.stub.clone();
16901            let mut options = self.0.options.clone();
16902            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16903            let query = move |name| {
16904                let stub = stub.clone();
16905                let options = options.clone();
16906                async {
16907                    let op = GetOperation::new(stub)
16908                        .set_name(name)
16909                        .with_options(options)
16910                        .send()
16911                        .await?;
16912                    Ok(Operation::new(op))
16913                }
16914            };
16915
16916            let start = move || async {
16917                let op = self.send().await?;
16918                Ok(Operation::new(op))
16919            };
16920
16921            google_cloud_lro::internal::new_poller(
16922                polling_error_policy,
16923                polling_backoff_policy,
16924                start,
16925                query,
16926            )
16927        }
16928
16929        /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRuleRequest::parent].
16930        ///
16931        /// This is a **required** field for requests.
16932        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16933            self.0.request.parent = v.into();
16934            self
16935        }
16936
16937        /// Sets the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
16938        ///
16939        /// This is a **required** field for requests.
16940        pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
16941        where
16942            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
16943        {
16944            self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
16945            self
16946        }
16947
16948        /// Sets or clears the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
16949        ///
16950        /// This is a **required** field for requests.
16951        pub fn set_or_clear_gateway_security_policy_rule<T>(
16952            mut self,
16953            v: std::option::Option<T>,
16954        ) -> Self
16955        where
16956            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
16957        {
16958            self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
16959            self
16960        }
16961
16962        /// Sets the value of [gateway_security_policy_rule_id][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule_id].
16963        pub fn set_gateway_security_policy_rule_id<T: Into<std::string::String>>(
16964            mut self,
16965            v: T,
16966        ) -> Self {
16967            self.0.request.gateway_security_policy_rule_id = v.into();
16968            self
16969        }
16970    }
16971
16972    #[doc(hidden)]
16973    impl crate::RequestBuilder for CreateGatewaySecurityPolicyRule {
16974        fn request_options(&mut self) -> &mut crate::RequestOptions {
16975            &mut self.0.options
16976        }
16977    }
16978
16979    /// The request builder for [NetworkSecurity::update_gateway_security_policy_rule][crate::client::NetworkSecurity::update_gateway_security_policy_rule] calls.
16980    ///
16981    /// # Example
16982    /// ```
16983    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateGatewaySecurityPolicyRule;
16984    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16985    /// use google_cloud_lro::Poller;
16986    ///
16987    /// let builder = prepare_request_builder();
16988    /// let response = builder.poller().until_done().await?;
16989    /// # Ok(()) }
16990    ///
16991    /// fn prepare_request_builder() -> UpdateGatewaySecurityPolicyRule {
16992    ///   # panic!();
16993    ///   // ... details omitted ...
16994    /// }
16995    /// ```
16996    #[derive(Clone, Debug)]
16997    pub struct UpdateGatewaySecurityPolicyRule(
16998        RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRuleRequest>,
16999    );
17000
17001    impl UpdateGatewaySecurityPolicyRule {
17002        pub(crate) fn new(
17003            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17004        ) -> Self {
17005            Self(RequestBuilder::new(stub))
17006        }
17007
17008        /// Sets the full request, replacing any prior values.
17009        pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRuleRequest>>(
17010            mut self,
17011            v: V,
17012        ) -> Self {
17013            self.0.request = v.into();
17014            self
17015        }
17016
17017        /// Sets all the options, replacing any prior values.
17018        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17019            self.0.options = v.into();
17020            self
17021        }
17022
17023        /// Sends the request.
17024        ///
17025        /// # Long running operations
17026        ///
17027        /// This starts, but does not poll, a longrunning operation. More information
17028        /// on [update_gateway_security_policy_rule][crate::client::NetworkSecurity::update_gateway_security_policy_rule].
17029        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17030            (*self.0.stub)
17031                .update_gateway_security_policy_rule(self.0.request, self.0.options)
17032                .await
17033                .map(crate::Response::into_body)
17034        }
17035
17036        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_gateway_security_policy_rule`.
17037        pub fn poller(
17038            self,
17039        ) -> impl google_cloud_lro::Poller<
17040            crate::model::GatewaySecurityPolicyRule,
17041            crate::model::OperationMetadata,
17042        > {
17043            type Operation = google_cloud_lro::internal::Operation<
17044                crate::model::GatewaySecurityPolicyRule,
17045                crate::model::OperationMetadata,
17046            >;
17047            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17048            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17049
17050            let stub = self.0.stub.clone();
17051            let mut options = self.0.options.clone();
17052            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17053            let query = move |name| {
17054                let stub = stub.clone();
17055                let options = options.clone();
17056                async {
17057                    let op = GetOperation::new(stub)
17058                        .set_name(name)
17059                        .with_options(options)
17060                        .send()
17061                        .await?;
17062                    Ok(Operation::new(op))
17063                }
17064            };
17065
17066            let start = move || async {
17067                let op = self.send().await?;
17068                Ok(Operation::new(op))
17069            };
17070
17071            google_cloud_lro::internal::new_poller(
17072                polling_error_policy,
17073                polling_backoff_policy,
17074                start,
17075                query,
17076            )
17077        }
17078
17079        /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
17080        pub fn set_update_mask<T>(mut self, v: T) -> Self
17081        where
17082            T: std::convert::Into<wkt::FieldMask>,
17083        {
17084            self.0.request.update_mask = std::option::Option::Some(v.into());
17085            self
17086        }
17087
17088        /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
17089        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17090        where
17091            T: std::convert::Into<wkt::FieldMask>,
17092        {
17093            self.0.request.update_mask = v.map(|x| x.into());
17094            self
17095        }
17096
17097        /// Sets the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
17098        ///
17099        /// This is a **required** field for requests.
17100        pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
17101        where
17102            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17103        {
17104            self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
17105            self
17106        }
17107
17108        /// Sets or clears the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
17109        ///
17110        /// This is a **required** field for requests.
17111        pub fn set_or_clear_gateway_security_policy_rule<T>(
17112            mut self,
17113            v: std::option::Option<T>,
17114        ) -> Self
17115        where
17116            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17117        {
17118            self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
17119            self
17120        }
17121    }
17122
17123    #[doc(hidden)]
17124    impl crate::RequestBuilder for UpdateGatewaySecurityPolicyRule {
17125        fn request_options(&mut self) -> &mut crate::RequestOptions {
17126            &mut self.0.options
17127        }
17128    }
17129
17130    /// The request builder for [NetworkSecurity::delete_gateway_security_policy_rule][crate::client::NetworkSecurity::delete_gateway_security_policy_rule] calls.
17131    ///
17132    /// # Example
17133    /// ```
17134    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteGatewaySecurityPolicyRule;
17135    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17136    /// use google_cloud_lro::Poller;
17137    ///
17138    /// let builder = prepare_request_builder();
17139    /// let response = builder.poller().until_done().await?;
17140    /// # Ok(()) }
17141    ///
17142    /// fn prepare_request_builder() -> DeleteGatewaySecurityPolicyRule {
17143    ///   # panic!();
17144    ///   // ... details omitted ...
17145    /// }
17146    /// ```
17147    #[derive(Clone, Debug)]
17148    pub struct DeleteGatewaySecurityPolicyRule(
17149        RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRuleRequest>,
17150    );
17151
17152    impl DeleteGatewaySecurityPolicyRule {
17153        pub(crate) fn new(
17154            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17155        ) -> Self {
17156            Self(RequestBuilder::new(stub))
17157        }
17158
17159        /// Sets the full request, replacing any prior values.
17160        pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRuleRequest>>(
17161            mut self,
17162            v: V,
17163        ) -> Self {
17164            self.0.request = v.into();
17165            self
17166        }
17167
17168        /// Sets all the options, replacing any prior values.
17169        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17170            self.0.options = v.into();
17171            self
17172        }
17173
17174        /// Sends the request.
17175        ///
17176        /// # Long running operations
17177        ///
17178        /// This starts, but does not poll, a longrunning operation. More information
17179        /// on [delete_gateway_security_policy_rule][crate::client::NetworkSecurity::delete_gateway_security_policy_rule].
17180        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17181            (*self.0.stub)
17182                .delete_gateway_security_policy_rule(self.0.request, self.0.options)
17183                .await
17184                .map(crate::Response::into_body)
17185        }
17186
17187        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_gateway_security_policy_rule`.
17188        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17189            type Operation =
17190                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17191            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17192            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17193
17194            let stub = self.0.stub.clone();
17195            let mut options = self.0.options.clone();
17196            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17197            let query = move |name| {
17198                let stub = stub.clone();
17199                let options = options.clone();
17200                async {
17201                    let op = GetOperation::new(stub)
17202                        .set_name(name)
17203                        .with_options(options)
17204                        .send()
17205                        .await?;
17206                    Ok(Operation::new(op))
17207                }
17208            };
17209
17210            let start = move || async {
17211                let op = self.send().await?;
17212                Ok(Operation::new(op))
17213            };
17214
17215            google_cloud_lro::internal::new_unit_response_poller(
17216                polling_error_policy,
17217                polling_backoff_policy,
17218                start,
17219                query,
17220            )
17221        }
17222
17223        /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRuleRequest::name].
17224        ///
17225        /// This is a **required** field for requests.
17226        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17227            self.0.request.name = v.into();
17228            self
17229        }
17230    }
17231
17232    #[doc(hidden)]
17233    impl crate::RequestBuilder for DeleteGatewaySecurityPolicyRule {
17234        fn request_options(&mut self) -> &mut crate::RequestOptions {
17235            &mut self.0.options
17236        }
17237    }
17238
17239    /// The request builder for [NetworkSecurity::list_url_lists][crate::client::NetworkSecurity::list_url_lists] calls.
17240    ///
17241    /// # Example
17242    /// ```
17243    /// # use google_cloud_networksecurity_v1::builder::network_security::ListUrlLists;
17244    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17245    /// use google_cloud_gax::paginator::ItemPaginator;
17246    ///
17247    /// let builder = prepare_request_builder();
17248    /// let mut items = builder.by_item();
17249    /// while let Some(result) = items.next().await {
17250    ///   let item = result?;
17251    /// }
17252    /// # Ok(()) }
17253    ///
17254    /// fn prepare_request_builder() -> ListUrlLists {
17255    ///   # panic!();
17256    ///   // ... details omitted ...
17257    /// }
17258    /// ```
17259    #[derive(Clone, Debug)]
17260    pub struct ListUrlLists(RequestBuilder<crate::model::ListUrlListsRequest>);
17261
17262    impl ListUrlLists {
17263        pub(crate) fn new(
17264            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17265        ) -> Self {
17266            Self(RequestBuilder::new(stub))
17267        }
17268
17269        /// Sets the full request, replacing any prior values.
17270        pub fn with_request<V: Into<crate::model::ListUrlListsRequest>>(mut self, v: V) -> Self {
17271            self.0.request = v.into();
17272            self
17273        }
17274
17275        /// Sets all the options, replacing any prior values.
17276        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17277            self.0.options = v.into();
17278            self
17279        }
17280
17281        /// Sends the request.
17282        pub async fn send(self) -> Result<crate::model::ListUrlListsResponse> {
17283            (*self.0.stub)
17284                .list_url_lists(self.0.request, self.0.options)
17285                .await
17286                .map(crate::Response::into_body)
17287        }
17288
17289        /// Streams each page in the collection.
17290        pub fn by_page(
17291            self,
17292        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListUrlListsResponse, crate::Error>
17293        {
17294            use std::clone::Clone;
17295            let token = self.0.request.page_token.clone();
17296            let execute = move |token: String| {
17297                let mut builder = self.clone();
17298                builder.0.request = builder.0.request.set_page_token(token);
17299                builder.send()
17300            };
17301            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17302        }
17303
17304        /// Streams each item in the collection.
17305        pub fn by_item(
17306            self,
17307        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17308            crate::model::ListUrlListsResponse,
17309            crate::Error,
17310        > {
17311            use google_cloud_gax::paginator::Paginator;
17312            self.by_page().items()
17313        }
17314
17315        /// Sets the value of [parent][crate::model::ListUrlListsRequest::parent].
17316        ///
17317        /// This is a **required** field for requests.
17318        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17319            self.0.request.parent = v.into();
17320            self
17321        }
17322
17323        /// Sets the value of [page_size][crate::model::ListUrlListsRequest::page_size].
17324        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17325            self.0.request.page_size = v.into();
17326            self
17327        }
17328
17329        /// Sets the value of [page_token][crate::model::ListUrlListsRequest::page_token].
17330        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17331            self.0.request.page_token = v.into();
17332            self
17333        }
17334    }
17335
17336    #[doc(hidden)]
17337    impl crate::RequestBuilder for ListUrlLists {
17338        fn request_options(&mut self) -> &mut crate::RequestOptions {
17339            &mut self.0.options
17340        }
17341    }
17342
17343    /// The request builder for [NetworkSecurity::get_url_list][crate::client::NetworkSecurity::get_url_list] calls.
17344    ///
17345    /// # Example
17346    /// ```
17347    /// # use google_cloud_networksecurity_v1::builder::network_security::GetUrlList;
17348    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17349    ///
17350    /// let builder = prepare_request_builder();
17351    /// let response = builder.send().await?;
17352    /// # Ok(()) }
17353    ///
17354    /// fn prepare_request_builder() -> GetUrlList {
17355    ///   # panic!();
17356    ///   // ... details omitted ...
17357    /// }
17358    /// ```
17359    #[derive(Clone, Debug)]
17360    pub struct GetUrlList(RequestBuilder<crate::model::GetUrlListRequest>);
17361
17362    impl GetUrlList {
17363        pub(crate) fn new(
17364            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17365        ) -> Self {
17366            Self(RequestBuilder::new(stub))
17367        }
17368
17369        /// Sets the full request, replacing any prior values.
17370        pub fn with_request<V: Into<crate::model::GetUrlListRequest>>(mut self, v: V) -> Self {
17371            self.0.request = v.into();
17372            self
17373        }
17374
17375        /// Sets all the options, replacing any prior values.
17376        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17377            self.0.options = v.into();
17378            self
17379        }
17380
17381        /// Sends the request.
17382        pub async fn send(self) -> Result<crate::model::UrlList> {
17383            (*self.0.stub)
17384                .get_url_list(self.0.request, self.0.options)
17385                .await
17386                .map(crate::Response::into_body)
17387        }
17388
17389        /// Sets the value of [name][crate::model::GetUrlListRequest::name].
17390        ///
17391        /// This is a **required** field for requests.
17392        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17393            self.0.request.name = v.into();
17394            self
17395        }
17396    }
17397
17398    #[doc(hidden)]
17399    impl crate::RequestBuilder for GetUrlList {
17400        fn request_options(&mut self) -> &mut crate::RequestOptions {
17401            &mut self.0.options
17402        }
17403    }
17404
17405    /// The request builder for [NetworkSecurity::create_url_list][crate::client::NetworkSecurity::create_url_list] calls.
17406    ///
17407    /// # Example
17408    /// ```
17409    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateUrlList;
17410    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17411    /// use google_cloud_lro::Poller;
17412    ///
17413    /// let builder = prepare_request_builder();
17414    /// let response = builder.poller().until_done().await?;
17415    /// # Ok(()) }
17416    ///
17417    /// fn prepare_request_builder() -> CreateUrlList {
17418    ///   # panic!();
17419    ///   // ... details omitted ...
17420    /// }
17421    /// ```
17422    #[derive(Clone, Debug)]
17423    pub struct CreateUrlList(RequestBuilder<crate::model::CreateUrlListRequest>);
17424
17425    impl CreateUrlList {
17426        pub(crate) fn new(
17427            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17428        ) -> Self {
17429            Self(RequestBuilder::new(stub))
17430        }
17431
17432        /// Sets the full request, replacing any prior values.
17433        pub fn with_request<V: Into<crate::model::CreateUrlListRequest>>(mut self, v: V) -> Self {
17434            self.0.request = v.into();
17435            self
17436        }
17437
17438        /// Sets all the options, replacing any prior values.
17439        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17440            self.0.options = v.into();
17441            self
17442        }
17443
17444        /// Sends the request.
17445        ///
17446        /// # Long running operations
17447        ///
17448        /// This starts, but does not poll, a longrunning operation. More information
17449        /// on [create_url_list][crate::client::NetworkSecurity::create_url_list].
17450        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17451            (*self.0.stub)
17452                .create_url_list(self.0.request, self.0.options)
17453                .await
17454                .map(crate::Response::into_body)
17455        }
17456
17457        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_url_list`.
17458        pub fn poller(
17459            self,
17460        ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
17461        {
17462            type Operation = google_cloud_lro::internal::Operation<
17463                crate::model::UrlList,
17464                crate::model::OperationMetadata,
17465            >;
17466            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17467            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17468
17469            let stub = self.0.stub.clone();
17470            let mut options = self.0.options.clone();
17471            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17472            let query = move |name| {
17473                let stub = stub.clone();
17474                let options = options.clone();
17475                async {
17476                    let op = GetOperation::new(stub)
17477                        .set_name(name)
17478                        .with_options(options)
17479                        .send()
17480                        .await?;
17481                    Ok(Operation::new(op))
17482                }
17483            };
17484
17485            let start = move || async {
17486                let op = self.send().await?;
17487                Ok(Operation::new(op))
17488            };
17489
17490            google_cloud_lro::internal::new_poller(
17491                polling_error_policy,
17492                polling_backoff_policy,
17493                start,
17494                query,
17495            )
17496        }
17497
17498        /// Sets the value of [parent][crate::model::CreateUrlListRequest::parent].
17499        ///
17500        /// This is a **required** field for requests.
17501        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17502            self.0.request.parent = v.into();
17503            self
17504        }
17505
17506        /// Sets the value of [url_list_id][crate::model::CreateUrlListRequest::url_list_id].
17507        ///
17508        /// This is a **required** field for requests.
17509        pub fn set_url_list_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
17510            self.0.request.url_list_id = v.into();
17511            self
17512        }
17513
17514        /// Sets the value of [url_list][crate::model::CreateUrlListRequest::url_list].
17515        ///
17516        /// This is a **required** field for requests.
17517        pub fn set_url_list<T>(mut self, v: T) -> Self
17518        where
17519            T: std::convert::Into<crate::model::UrlList>,
17520        {
17521            self.0.request.url_list = std::option::Option::Some(v.into());
17522            self
17523        }
17524
17525        /// Sets or clears the value of [url_list][crate::model::CreateUrlListRequest::url_list].
17526        ///
17527        /// This is a **required** field for requests.
17528        pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
17529        where
17530            T: std::convert::Into<crate::model::UrlList>,
17531        {
17532            self.0.request.url_list = v.map(|x| x.into());
17533            self
17534        }
17535    }
17536
17537    #[doc(hidden)]
17538    impl crate::RequestBuilder for CreateUrlList {
17539        fn request_options(&mut self) -> &mut crate::RequestOptions {
17540            &mut self.0.options
17541        }
17542    }
17543
17544    /// The request builder for [NetworkSecurity::update_url_list][crate::client::NetworkSecurity::update_url_list] calls.
17545    ///
17546    /// # Example
17547    /// ```
17548    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateUrlList;
17549    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17550    /// use google_cloud_lro::Poller;
17551    ///
17552    /// let builder = prepare_request_builder();
17553    /// let response = builder.poller().until_done().await?;
17554    /// # Ok(()) }
17555    ///
17556    /// fn prepare_request_builder() -> UpdateUrlList {
17557    ///   # panic!();
17558    ///   // ... details omitted ...
17559    /// }
17560    /// ```
17561    #[derive(Clone, Debug)]
17562    pub struct UpdateUrlList(RequestBuilder<crate::model::UpdateUrlListRequest>);
17563
17564    impl UpdateUrlList {
17565        pub(crate) fn new(
17566            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17567        ) -> Self {
17568            Self(RequestBuilder::new(stub))
17569        }
17570
17571        /// Sets the full request, replacing any prior values.
17572        pub fn with_request<V: Into<crate::model::UpdateUrlListRequest>>(mut self, v: V) -> Self {
17573            self.0.request = v.into();
17574            self
17575        }
17576
17577        /// Sets all the options, replacing any prior values.
17578        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17579            self.0.options = v.into();
17580            self
17581        }
17582
17583        /// Sends the request.
17584        ///
17585        /// # Long running operations
17586        ///
17587        /// This starts, but does not poll, a longrunning operation. More information
17588        /// on [update_url_list][crate::client::NetworkSecurity::update_url_list].
17589        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17590            (*self.0.stub)
17591                .update_url_list(self.0.request, self.0.options)
17592                .await
17593                .map(crate::Response::into_body)
17594        }
17595
17596        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_url_list`.
17597        pub fn poller(
17598            self,
17599        ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
17600        {
17601            type Operation = google_cloud_lro::internal::Operation<
17602                crate::model::UrlList,
17603                crate::model::OperationMetadata,
17604            >;
17605            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17606            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17607
17608            let stub = self.0.stub.clone();
17609            let mut options = self.0.options.clone();
17610            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17611            let query = move |name| {
17612                let stub = stub.clone();
17613                let options = options.clone();
17614                async {
17615                    let op = GetOperation::new(stub)
17616                        .set_name(name)
17617                        .with_options(options)
17618                        .send()
17619                        .await?;
17620                    Ok(Operation::new(op))
17621                }
17622            };
17623
17624            let start = move || async {
17625                let op = self.send().await?;
17626                Ok(Operation::new(op))
17627            };
17628
17629            google_cloud_lro::internal::new_poller(
17630                polling_error_policy,
17631                polling_backoff_policy,
17632                start,
17633                query,
17634            )
17635        }
17636
17637        /// Sets the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
17638        pub fn set_update_mask<T>(mut self, v: T) -> Self
17639        where
17640            T: std::convert::Into<wkt::FieldMask>,
17641        {
17642            self.0.request.update_mask = std::option::Option::Some(v.into());
17643            self
17644        }
17645
17646        /// Sets or clears the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
17647        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17648        where
17649            T: std::convert::Into<wkt::FieldMask>,
17650        {
17651            self.0.request.update_mask = v.map(|x| x.into());
17652            self
17653        }
17654
17655        /// Sets the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
17656        ///
17657        /// This is a **required** field for requests.
17658        pub fn set_url_list<T>(mut self, v: T) -> Self
17659        where
17660            T: std::convert::Into<crate::model::UrlList>,
17661        {
17662            self.0.request.url_list = std::option::Option::Some(v.into());
17663            self
17664        }
17665
17666        /// Sets or clears the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
17667        ///
17668        /// This is a **required** field for requests.
17669        pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
17670        where
17671            T: std::convert::Into<crate::model::UrlList>,
17672        {
17673            self.0.request.url_list = v.map(|x| x.into());
17674            self
17675        }
17676    }
17677
17678    #[doc(hidden)]
17679    impl crate::RequestBuilder for UpdateUrlList {
17680        fn request_options(&mut self) -> &mut crate::RequestOptions {
17681            &mut self.0.options
17682        }
17683    }
17684
17685    /// The request builder for [NetworkSecurity::delete_url_list][crate::client::NetworkSecurity::delete_url_list] calls.
17686    ///
17687    /// # Example
17688    /// ```
17689    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteUrlList;
17690    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17691    /// use google_cloud_lro::Poller;
17692    ///
17693    /// let builder = prepare_request_builder();
17694    /// let response = builder.poller().until_done().await?;
17695    /// # Ok(()) }
17696    ///
17697    /// fn prepare_request_builder() -> DeleteUrlList {
17698    ///   # panic!();
17699    ///   // ... details omitted ...
17700    /// }
17701    /// ```
17702    #[derive(Clone, Debug)]
17703    pub struct DeleteUrlList(RequestBuilder<crate::model::DeleteUrlListRequest>);
17704
17705    impl DeleteUrlList {
17706        pub(crate) fn new(
17707            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17708        ) -> Self {
17709            Self(RequestBuilder::new(stub))
17710        }
17711
17712        /// Sets the full request, replacing any prior values.
17713        pub fn with_request<V: Into<crate::model::DeleteUrlListRequest>>(mut self, v: V) -> Self {
17714            self.0.request = v.into();
17715            self
17716        }
17717
17718        /// Sets all the options, replacing any prior values.
17719        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17720            self.0.options = v.into();
17721            self
17722        }
17723
17724        /// Sends the request.
17725        ///
17726        /// # Long running operations
17727        ///
17728        /// This starts, but does not poll, a longrunning operation. More information
17729        /// on [delete_url_list][crate::client::NetworkSecurity::delete_url_list].
17730        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17731            (*self.0.stub)
17732                .delete_url_list(self.0.request, self.0.options)
17733                .await
17734                .map(crate::Response::into_body)
17735        }
17736
17737        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_url_list`.
17738        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17739            type Operation =
17740                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17741            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17742            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17743
17744            let stub = self.0.stub.clone();
17745            let mut options = self.0.options.clone();
17746            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17747            let query = move |name| {
17748                let stub = stub.clone();
17749                let options = options.clone();
17750                async {
17751                    let op = GetOperation::new(stub)
17752                        .set_name(name)
17753                        .with_options(options)
17754                        .send()
17755                        .await?;
17756                    Ok(Operation::new(op))
17757                }
17758            };
17759
17760            let start = move || async {
17761                let op = self.send().await?;
17762                Ok(Operation::new(op))
17763            };
17764
17765            google_cloud_lro::internal::new_unit_response_poller(
17766                polling_error_policy,
17767                polling_backoff_policy,
17768                start,
17769                query,
17770            )
17771        }
17772
17773        /// Sets the value of [name][crate::model::DeleteUrlListRequest::name].
17774        ///
17775        /// This is a **required** field for requests.
17776        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17777            self.0.request.name = v.into();
17778            self
17779        }
17780    }
17781
17782    #[doc(hidden)]
17783    impl crate::RequestBuilder for DeleteUrlList {
17784        fn request_options(&mut self) -> &mut crate::RequestOptions {
17785            &mut self.0.options
17786        }
17787    }
17788
17789    /// The request builder for [NetworkSecurity::list_tls_inspection_policies][crate::client::NetworkSecurity::list_tls_inspection_policies] calls.
17790    ///
17791    /// # Example
17792    /// ```
17793    /// # use google_cloud_networksecurity_v1::builder::network_security::ListTlsInspectionPolicies;
17794    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17795    /// use google_cloud_gax::paginator::ItemPaginator;
17796    ///
17797    /// let builder = prepare_request_builder();
17798    /// let mut items = builder.by_item();
17799    /// while let Some(result) = items.next().await {
17800    ///   let item = result?;
17801    /// }
17802    /// # Ok(()) }
17803    ///
17804    /// fn prepare_request_builder() -> ListTlsInspectionPolicies {
17805    ///   # panic!();
17806    ///   // ... details omitted ...
17807    /// }
17808    /// ```
17809    #[derive(Clone, Debug)]
17810    pub struct ListTlsInspectionPolicies(
17811        RequestBuilder<crate::model::ListTlsInspectionPoliciesRequest>,
17812    );
17813
17814    impl ListTlsInspectionPolicies {
17815        pub(crate) fn new(
17816            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17817        ) -> Self {
17818            Self(RequestBuilder::new(stub))
17819        }
17820
17821        /// Sets the full request, replacing any prior values.
17822        pub fn with_request<V: Into<crate::model::ListTlsInspectionPoliciesRequest>>(
17823            mut self,
17824            v: V,
17825        ) -> Self {
17826            self.0.request = v.into();
17827            self
17828        }
17829
17830        /// Sets all the options, replacing any prior values.
17831        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17832            self.0.options = v.into();
17833            self
17834        }
17835
17836        /// Sends the request.
17837        pub async fn send(self) -> Result<crate::model::ListTlsInspectionPoliciesResponse> {
17838            (*self.0.stub)
17839                .list_tls_inspection_policies(self.0.request, self.0.options)
17840                .await
17841                .map(crate::Response::into_body)
17842        }
17843
17844        /// Streams each page in the collection.
17845        pub fn by_page(
17846            self,
17847        ) -> impl google_cloud_gax::paginator::Paginator<
17848            crate::model::ListTlsInspectionPoliciesResponse,
17849            crate::Error,
17850        > {
17851            use std::clone::Clone;
17852            let token = self.0.request.page_token.clone();
17853            let execute = move |token: String| {
17854                let mut builder = self.clone();
17855                builder.0.request = builder.0.request.set_page_token(token);
17856                builder.send()
17857            };
17858            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17859        }
17860
17861        /// Streams each item in the collection.
17862        pub fn by_item(
17863            self,
17864        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17865            crate::model::ListTlsInspectionPoliciesResponse,
17866            crate::Error,
17867        > {
17868            use google_cloud_gax::paginator::Paginator;
17869            self.by_page().items()
17870        }
17871
17872        /// Sets the value of [parent][crate::model::ListTlsInspectionPoliciesRequest::parent].
17873        ///
17874        /// This is a **required** field for requests.
17875        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17876            self.0.request.parent = v.into();
17877            self
17878        }
17879
17880        /// Sets the value of [page_size][crate::model::ListTlsInspectionPoliciesRequest::page_size].
17881        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17882            self.0.request.page_size = v.into();
17883            self
17884        }
17885
17886        /// Sets the value of [page_token][crate::model::ListTlsInspectionPoliciesRequest::page_token].
17887        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17888            self.0.request.page_token = v.into();
17889            self
17890        }
17891    }
17892
17893    #[doc(hidden)]
17894    impl crate::RequestBuilder for ListTlsInspectionPolicies {
17895        fn request_options(&mut self) -> &mut crate::RequestOptions {
17896            &mut self.0.options
17897        }
17898    }
17899
17900    /// The request builder for [NetworkSecurity::get_tls_inspection_policy][crate::client::NetworkSecurity::get_tls_inspection_policy] calls.
17901    ///
17902    /// # Example
17903    /// ```
17904    /// # use google_cloud_networksecurity_v1::builder::network_security::GetTlsInspectionPolicy;
17905    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17906    ///
17907    /// let builder = prepare_request_builder();
17908    /// let response = builder.send().await?;
17909    /// # Ok(()) }
17910    ///
17911    /// fn prepare_request_builder() -> GetTlsInspectionPolicy {
17912    ///   # panic!();
17913    ///   // ... details omitted ...
17914    /// }
17915    /// ```
17916    #[derive(Clone, Debug)]
17917    pub struct GetTlsInspectionPolicy(RequestBuilder<crate::model::GetTlsInspectionPolicyRequest>);
17918
17919    impl GetTlsInspectionPolicy {
17920        pub(crate) fn new(
17921            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17922        ) -> Self {
17923            Self(RequestBuilder::new(stub))
17924        }
17925
17926        /// Sets the full request, replacing any prior values.
17927        pub fn with_request<V: Into<crate::model::GetTlsInspectionPolicyRequest>>(
17928            mut self,
17929            v: V,
17930        ) -> Self {
17931            self.0.request = v.into();
17932            self
17933        }
17934
17935        /// Sets all the options, replacing any prior values.
17936        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17937            self.0.options = v.into();
17938            self
17939        }
17940
17941        /// Sends the request.
17942        pub async fn send(self) -> Result<crate::model::TlsInspectionPolicy> {
17943            (*self.0.stub)
17944                .get_tls_inspection_policy(self.0.request, self.0.options)
17945                .await
17946                .map(crate::Response::into_body)
17947        }
17948
17949        /// Sets the value of [name][crate::model::GetTlsInspectionPolicyRequest::name].
17950        ///
17951        /// This is a **required** field for requests.
17952        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17953            self.0.request.name = v.into();
17954            self
17955        }
17956    }
17957
17958    #[doc(hidden)]
17959    impl crate::RequestBuilder for GetTlsInspectionPolicy {
17960        fn request_options(&mut self) -> &mut crate::RequestOptions {
17961            &mut self.0.options
17962        }
17963    }
17964
17965    /// The request builder for [NetworkSecurity::create_tls_inspection_policy][crate::client::NetworkSecurity::create_tls_inspection_policy] calls.
17966    ///
17967    /// # Example
17968    /// ```
17969    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateTlsInspectionPolicy;
17970    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17971    /// use google_cloud_lro::Poller;
17972    ///
17973    /// let builder = prepare_request_builder();
17974    /// let response = builder.poller().until_done().await?;
17975    /// # Ok(()) }
17976    ///
17977    /// fn prepare_request_builder() -> CreateTlsInspectionPolicy {
17978    ///   # panic!();
17979    ///   // ... details omitted ...
17980    /// }
17981    /// ```
17982    #[derive(Clone, Debug)]
17983    pub struct CreateTlsInspectionPolicy(
17984        RequestBuilder<crate::model::CreateTlsInspectionPolicyRequest>,
17985    );
17986
17987    impl CreateTlsInspectionPolicy {
17988        pub(crate) fn new(
17989            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17990        ) -> Self {
17991            Self(RequestBuilder::new(stub))
17992        }
17993
17994        /// Sets the full request, replacing any prior values.
17995        pub fn with_request<V: Into<crate::model::CreateTlsInspectionPolicyRequest>>(
17996            mut self,
17997            v: V,
17998        ) -> Self {
17999            self.0.request = v.into();
18000            self
18001        }
18002
18003        /// Sets all the options, replacing any prior values.
18004        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18005            self.0.options = v.into();
18006            self
18007        }
18008
18009        /// Sends the request.
18010        ///
18011        /// # Long running operations
18012        ///
18013        /// This starts, but does not poll, a longrunning operation. More information
18014        /// on [create_tls_inspection_policy][crate::client::NetworkSecurity::create_tls_inspection_policy].
18015        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18016            (*self.0.stub)
18017                .create_tls_inspection_policy(self.0.request, self.0.options)
18018                .await
18019                .map(crate::Response::into_body)
18020        }
18021
18022        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_tls_inspection_policy`.
18023        pub fn poller(
18024            self,
18025        ) -> impl google_cloud_lro::Poller<
18026            crate::model::TlsInspectionPolicy,
18027            crate::model::OperationMetadata,
18028        > {
18029            type Operation = google_cloud_lro::internal::Operation<
18030                crate::model::TlsInspectionPolicy,
18031                crate::model::OperationMetadata,
18032            >;
18033            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18034            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18035
18036            let stub = self.0.stub.clone();
18037            let mut options = self.0.options.clone();
18038            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18039            let query = move |name| {
18040                let stub = stub.clone();
18041                let options = options.clone();
18042                async {
18043                    let op = GetOperation::new(stub)
18044                        .set_name(name)
18045                        .with_options(options)
18046                        .send()
18047                        .await?;
18048                    Ok(Operation::new(op))
18049                }
18050            };
18051
18052            let start = move || async {
18053                let op = self.send().await?;
18054                Ok(Operation::new(op))
18055            };
18056
18057            google_cloud_lro::internal::new_poller(
18058                polling_error_policy,
18059                polling_backoff_policy,
18060                start,
18061                query,
18062            )
18063        }
18064
18065        /// Sets the value of [parent][crate::model::CreateTlsInspectionPolicyRequest::parent].
18066        ///
18067        /// This is a **required** field for requests.
18068        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18069            self.0.request.parent = v.into();
18070            self
18071        }
18072
18073        /// Sets the value of [tls_inspection_policy_id][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy_id].
18074        ///
18075        /// This is a **required** field for requests.
18076        pub fn set_tls_inspection_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18077            self.0.request.tls_inspection_policy_id = v.into();
18078            self
18079        }
18080
18081        /// Sets the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
18082        ///
18083        /// This is a **required** field for requests.
18084        pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
18085        where
18086            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18087        {
18088            self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
18089            self
18090        }
18091
18092        /// Sets or clears the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
18093        ///
18094        /// This is a **required** field for requests.
18095        pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
18096        where
18097            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18098        {
18099            self.0.request.tls_inspection_policy = v.map(|x| x.into());
18100            self
18101        }
18102    }
18103
18104    #[doc(hidden)]
18105    impl crate::RequestBuilder for CreateTlsInspectionPolicy {
18106        fn request_options(&mut self) -> &mut crate::RequestOptions {
18107            &mut self.0.options
18108        }
18109    }
18110
18111    /// The request builder for [NetworkSecurity::update_tls_inspection_policy][crate::client::NetworkSecurity::update_tls_inspection_policy] calls.
18112    ///
18113    /// # Example
18114    /// ```
18115    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateTlsInspectionPolicy;
18116    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18117    /// use google_cloud_lro::Poller;
18118    ///
18119    /// let builder = prepare_request_builder();
18120    /// let response = builder.poller().until_done().await?;
18121    /// # Ok(()) }
18122    ///
18123    /// fn prepare_request_builder() -> UpdateTlsInspectionPolicy {
18124    ///   # panic!();
18125    ///   // ... details omitted ...
18126    /// }
18127    /// ```
18128    #[derive(Clone, Debug)]
18129    pub struct UpdateTlsInspectionPolicy(
18130        RequestBuilder<crate::model::UpdateTlsInspectionPolicyRequest>,
18131    );
18132
18133    impl UpdateTlsInspectionPolicy {
18134        pub(crate) fn new(
18135            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18136        ) -> Self {
18137            Self(RequestBuilder::new(stub))
18138        }
18139
18140        /// Sets the full request, replacing any prior values.
18141        pub fn with_request<V: Into<crate::model::UpdateTlsInspectionPolicyRequest>>(
18142            mut self,
18143            v: V,
18144        ) -> Self {
18145            self.0.request = v.into();
18146            self
18147        }
18148
18149        /// Sets all the options, replacing any prior values.
18150        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18151            self.0.options = v.into();
18152            self
18153        }
18154
18155        /// Sends the request.
18156        ///
18157        /// # Long running operations
18158        ///
18159        /// This starts, but does not poll, a longrunning operation. More information
18160        /// on [update_tls_inspection_policy][crate::client::NetworkSecurity::update_tls_inspection_policy].
18161        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18162            (*self.0.stub)
18163                .update_tls_inspection_policy(self.0.request, self.0.options)
18164                .await
18165                .map(crate::Response::into_body)
18166        }
18167
18168        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_tls_inspection_policy`.
18169        pub fn poller(
18170            self,
18171        ) -> impl google_cloud_lro::Poller<
18172            crate::model::TlsInspectionPolicy,
18173            crate::model::OperationMetadata,
18174        > {
18175            type Operation = google_cloud_lro::internal::Operation<
18176                crate::model::TlsInspectionPolicy,
18177                crate::model::OperationMetadata,
18178            >;
18179            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18180            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18181
18182            let stub = self.0.stub.clone();
18183            let mut options = self.0.options.clone();
18184            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18185            let query = move |name| {
18186                let stub = stub.clone();
18187                let options = options.clone();
18188                async {
18189                    let op = GetOperation::new(stub)
18190                        .set_name(name)
18191                        .with_options(options)
18192                        .send()
18193                        .await?;
18194                    Ok(Operation::new(op))
18195                }
18196            };
18197
18198            let start = move || async {
18199                let op = self.send().await?;
18200                Ok(Operation::new(op))
18201            };
18202
18203            google_cloud_lro::internal::new_poller(
18204                polling_error_policy,
18205                polling_backoff_policy,
18206                start,
18207                query,
18208            )
18209        }
18210
18211        /// Sets the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
18212        pub fn set_update_mask<T>(mut self, v: T) -> Self
18213        where
18214            T: std::convert::Into<wkt::FieldMask>,
18215        {
18216            self.0.request.update_mask = std::option::Option::Some(v.into());
18217            self
18218        }
18219
18220        /// Sets or clears the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
18221        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18222        where
18223            T: std::convert::Into<wkt::FieldMask>,
18224        {
18225            self.0.request.update_mask = v.map(|x| x.into());
18226            self
18227        }
18228
18229        /// Sets the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
18230        ///
18231        /// This is a **required** field for requests.
18232        pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
18233        where
18234            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18235        {
18236            self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
18237            self
18238        }
18239
18240        /// Sets or clears the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
18241        ///
18242        /// This is a **required** field for requests.
18243        pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
18244        where
18245            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18246        {
18247            self.0.request.tls_inspection_policy = v.map(|x| x.into());
18248            self
18249        }
18250    }
18251
18252    #[doc(hidden)]
18253    impl crate::RequestBuilder for UpdateTlsInspectionPolicy {
18254        fn request_options(&mut self) -> &mut crate::RequestOptions {
18255            &mut self.0.options
18256        }
18257    }
18258
18259    /// The request builder for [NetworkSecurity::delete_tls_inspection_policy][crate::client::NetworkSecurity::delete_tls_inspection_policy] calls.
18260    ///
18261    /// # Example
18262    /// ```
18263    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteTlsInspectionPolicy;
18264    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18265    /// use google_cloud_lro::Poller;
18266    ///
18267    /// let builder = prepare_request_builder();
18268    /// let response = builder.poller().until_done().await?;
18269    /// # Ok(()) }
18270    ///
18271    /// fn prepare_request_builder() -> DeleteTlsInspectionPolicy {
18272    ///   # panic!();
18273    ///   // ... details omitted ...
18274    /// }
18275    /// ```
18276    #[derive(Clone, Debug)]
18277    pub struct DeleteTlsInspectionPolicy(
18278        RequestBuilder<crate::model::DeleteTlsInspectionPolicyRequest>,
18279    );
18280
18281    impl DeleteTlsInspectionPolicy {
18282        pub(crate) fn new(
18283            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18284        ) -> Self {
18285            Self(RequestBuilder::new(stub))
18286        }
18287
18288        /// Sets the full request, replacing any prior values.
18289        pub fn with_request<V: Into<crate::model::DeleteTlsInspectionPolicyRequest>>(
18290            mut self,
18291            v: V,
18292        ) -> Self {
18293            self.0.request = v.into();
18294            self
18295        }
18296
18297        /// Sets all the options, replacing any prior values.
18298        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18299            self.0.options = v.into();
18300            self
18301        }
18302
18303        /// Sends the request.
18304        ///
18305        /// # Long running operations
18306        ///
18307        /// This starts, but does not poll, a longrunning operation. More information
18308        /// on [delete_tls_inspection_policy][crate::client::NetworkSecurity::delete_tls_inspection_policy].
18309        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18310            (*self.0.stub)
18311                .delete_tls_inspection_policy(self.0.request, self.0.options)
18312                .await
18313                .map(crate::Response::into_body)
18314        }
18315
18316        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_tls_inspection_policy`.
18317        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18318            type Operation =
18319                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18320            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18321            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18322
18323            let stub = self.0.stub.clone();
18324            let mut options = self.0.options.clone();
18325            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18326            let query = move |name| {
18327                let stub = stub.clone();
18328                let options = options.clone();
18329                async {
18330                    let op = GetOperation::new(stub)
18331                        .set_name(name)
18332                        .with_options(options)
18333                        .send()
18334                        .await?;
18335                    Ok(Operation::new(op))
18336                }
18337            };
18338
18339            let start = move || async {
18340                let op = self.send().await?;
18341                Ok(Operation::new(op))
18342            };
18343
18344            google_cloud_lro::internal::new_unit_response_poller(
18345                polling_error_policy,
18346                polling_backoff_policy,
18347                start,
18348                query,
18349            )
18350        }
18351
18352        /// Sets the value of [name][crate::model::DeleteTlsInspectionPolicyRequest::name].
18353        ///
18354        /// This is a **required** field for requests.
18355        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18356            self.0.request.name = v.into();
18357            self
18358        }
18359
18360        /// Sets the value of [force][crate::model::DeleteTlsInspectionPolicyRequest::force].
18361        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
18362            self.0.request.force = v.into();
18363            self
18364        }
18365    }
18366
18367    #[doc(hidden)]
18368    impl crate::RequestBuilder for DeleteTlsInspectionPolicy {
18369        fn request_options(&mut self) -> &mut crate::RequestOptions {
18370            &mut self.0.options
18371        }
18372    }
18373
18374    /// The request builder for [NetworkSecurity::list_authz_policies][crate::client::NetworkSecurity::list_authz_policies] calls.
18375    ///
18376    /// # Example
18377    /// ```
18378    /// # use google_cloud_networksecurity_v1::builder::network_security::ListAuthzPolicies;
18379    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18380    /// use google_cloud_gax::paginator::ItemPaginator;
18381    ///
18382    /// let builder = prepare_request_builder();
18383    /// let mut items = builder.by_item();
18384    /// while let Some(result) = items.next().await {
18385    ///   let item = result?;
18386    /// }
18387    /// # Ok(()) }
18388    ///
18389    /// fn prepare_request_builder() -> ListAuthzPolicies {
18390    ///   # panic!();
18391    ///   // ... details omitted ...
18392    /// }
18393    /// ```
18394    #[derive(Clone, Debug)]
18395    pub struct ListAuthzPolicies(RequestBuilder<crate::model::ListAuthzPoliciesRequest>);
18396
18397    impl ListAuthzPolicies {
18398        pub(crate) fn new(
18399            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18400        ) -> Self {
18401            Self(RequestBuilder::new(stub))
18402        }
18403
18404        /// Sets the full request, replacing any prior values.
18405        pub fn with_request<V: Into<crate::model::ListAuthzPoliciesRequest>>(
18406            mut self,
18407            v: V,
18408        ) -> Self {
18409            self.0.request = v.into();
18410            self
18411        }
18412
18413        /// Sets all the options, replacing any prior values.
18414        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18415            self.0.options = v.into();
18416            self
18417        }
18418
18419        /// Sends the request.
18420        pub async fn send(self) -> Result<crate::model::ListAuthzPoliciesResponse> {
18421            (*self.0.stub)
18422                .list_authz_policies(self.0.request, self.0.options)
18423                .await
18424                .map(crate::Response::into_body)
18425        }
18426
18427        /// Streams each page in the collection.
18428        pub fn by_page(
18429            self,
18430        ) -> impl google_cloud_gax::paginator::Paginator<
18431            crate::model::ListAuthzPoliciesResponse,
18432            crate::Error,
18433        > {
18434            use std::clone::Clone;
18435            let token = self.0.request.page_token.clone();
18436            let execute = move |token: String| {
18437                let mut builder = self.clone();
18438                builder.0.request = builder.0.request.set_page_token(token);
18439                builder.send()
18440            };
18441            google_cloud_gax::paginator::internal::new_paginator(token, execute)
18442        }
18443
18444        /// Streams each item in the collection.
18445        pub fn by_item(
18446            self,
18447        ) -> impl google_cloud_gax::paginator::ItemPaginator<
18448            crate::model::ListAuthzPoliciesResponse,
18449            crate::Error,
18450        > {
18451            use google_cloud_gax::paginator::Paginator;
18452            self.by_page().items()
18453        }
18454
18455        /// Sets the value of [parent][crate::model::ListAuthzPoliciesRequest::parent].
18456        ///
18457        /// This is a **required** field for requests.
18458        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18459            self.0.request.parent = v.into();
18460            self
18461        }
18462
18463        /// Sets the value of [page_size][crate::model::ListAuthzPoliciesRequest::page_size].
18464        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18465            self.0.request.page_size = v.into();
18466            self
18467        }
18468
18469        /// Sets the value of [page_token][crate::model::ListAuthzPoliciesRequest::page_token].
18470        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18471            self.0.request.page_token = v.into();
18472            self
18473        }
18474
18475        /// Sets the value of [filter][crate::model::ListAuthzPoliciesRequest::filter].
18476        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18477            self.0.request.filter = v.into();
18478            self
18479        }
18480
18481        /// Sets the value of [order_by][crate::model::ListAuthzPoliciesRequest::order_by].
18482        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
18483            self.0.request.order_by = v.into();
18484            self
18485        }
18486    }
18487
18488    #[doc(hidden)]
18489    impl crate::RequestBuilder for ListAuthzPolicies {
18490        fn request_options(&mut self) -> &mut crate::RequestOptions {
18491            &mut self.0.options
18492        }
18493    }
18494
18495    /// The request builder for [NetworkSecurity::get_authz_policy][crate::client::NetworkSecurity::get_authz_policy] calls.
18496    ///
18497    /// # Example
18498    /// ```
18499    /// # use google_cloud_networksecurity_v1::builder::network_security::GetAuthzPolicy;
18500    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18501    ///
18502    /// let builder = prepare_request_builder();
18503    /// let response = builder.send().await?;
18504    /// # Ok(()) }
18505    ///
18506    /// fn prepare_request_builder() -> GetAuthzPolicy {
18507    ///   # panic!();
18508    ///   // ... details omitted ...
18509    /// }
18510    /// ```
18511    #[derive(Clone, Debug)]
18512    pub struct GetAuthzPolicy(RequestBuilder<crate::model::GetAuthzPolicyRequest>);
18513
18514    impl GetAuthzPolicy {
18515        pub(crate) fn new(
18516            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18517        ) -> Self {
18518            Self(RequestBuilder::new(stub))
18519        }
18520
18521        /// Sets the full request, replacing any prior values.
18522        pub fn with_request<V: Into<crate::model::GetAuthzPolicyRequest>>(mut self, v: V) -> Self {
18523            self.0.request = v.into();
18524            self
18525        }
18526
18527        /// Sets all the options, replacing any prior values.
18528        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18529            self.0.options = v.into();
18530            self
18531        }
18532
18533        /// Sends the request.
18534        pub async fn send(self) -> Result<crate::model::AuthzPolicy> {
18535            (*self.0.stub)
18536                .get_authz_policy(self.0.request, self.0.options)
18537                .await
18538                .map(crate::Response::into_body)
18539        }
18540
18541        /// Sets the value of [name][crate::model::GetAuthzPolicyRequest::name].
18542        ///
18543        /// This is a **required** field for requests.
18544        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18545            self.0.request.name = v.into();
18546            self
18547        }
18548    }
18549
18550    #[doc(hidden)]
18551    impl crate::RequestBuilder for GetAuthzPolicy {
18552        fn request_options(&mut self) -> &mut crate::RequestOptions {
18553            &mut self.0.options
18554        }
18555    }
18556
18557    /// The request builder for [NetworkSecurity::create_authz_policy][crate::client::NetworkSecurity::create_authz_policy] calls.
18558    ///
18559    /// # Example
18560    /// ```
18561    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateAuthzPolicy;
18562    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18563    /// use google_cloud_lro::Poller;
18564    ///
18565    /// let builder = prepare_request_builder();
18566    /// let response = builder.poller().until_done().await?;
18567    /// # Ok(()) }
18568    ///
18569    /// fn prepare_request_builder() -> CreateAuthzPolicy {
18570    ///   # panic!();
18571    ///   // ... details omitted ...
18572    /// }
18573    /// ```
18574    #[derive(Clone, Debug)]
18575    pub struct CreateAuthzPolicy(RequestBuilder<crate::model::CreateAuthzPolicyRequest>);
18576
18577    impl CreateAuthzPolicy {
18578        pub(crate) fn new(
18579            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18580        ) -> Self {
18581            Self(RequestBuilder::new(stub))
18582        }
18583
18584        /// Sets the full request, replacing any prior values.
18585        pub fn with_request<V: Into<crate::model::CreateAuthzPolicyRequest>>(
18586            mut self,
18587            v: V,
18588        ) -> Self {
18589            self.0.request = v.into();
18590            self
18591        }
18592
18593        /// Sets all the options, replacing any prior values.
18594        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18595            self.0.options = v.into();
18596            self
18597        }
18598
18599        /// Sends the request.
18600        ///
18601        /// # Long running operations
18602        ///
18603        /// This starts, but does not poll, a longrunning operation. More information
18604        /// on [create_authz_policy][crate::client::NetworkSecurity::create_authz_policy].
18605        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18606            (*self.0.stub)
18607                .create_authz_policy(self.0.request, self.0.options)
18608                .await
18609                .map(crate::Response::into_body)
18610        }
18611
18612        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_authz_policy`.
18613        pub fn poller(
18614            self,
18615        ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
18616        {
18617            type Operation = google_cloud_lro::internal::Operation<
18618                crate::model::AuthzPolicy,
18619                crate::model::OperationMetadata,
18620            >;
18621            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18622            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18623
18624            let stub = self.0.stub.clone();
18625            let mut options = self.0.options.clone();
18626            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18627            let query = move |name| {
18628                let stub = stub.clone();
18629                let options = options.clone();
18630                async {
18631                    let op = GetOperation::new(stub)
18632                        .set_name(name)
18633                        .with_options(options)
18634                        .send()
18635                        .await?;
18636                    Ok(Operation::new(op))
18637                }
18638            };
18639
18640            let start = move || async {
18641                let op = self.send().await?;
18642                Ok(Operation::new(op))
18643            };
18644
18645            google_cloud_lro::internal::new_poller(
18646                polling_error_policy,
18647                polling_backoff_policy,
18648                start,
18649                query,
18650            )
18651        }
18652
18653        /// Sets the value of [parent][crate::model::CreateAuthzPolicyRequest::parent].
18654        ///
18655        /// This is a **required** field for requests.
18656        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18657            self.0.request.parent = v.into();
18658            self
18659        }
18660
18661        /// Sets the value of [authz_policy_id][crate::model::CreateAuthzPolicyRequest::authz_policy_id].
18662        ///
18663        /// This is a **required** field for requests.
18664        pub fn set_authz_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18665            self.0.request.authz_policy_id = v.into();
18666            self
18667        }
18668
18669        /// Sets the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
18670        ///
18671        /// This is a **required** field for requests.
18672        pub fn set_authz_policy<T>(mut self, v: T) -> Self
18673        where
18674            T: std::convert::Into<crate::model::AuthzPolicy>,
18675        {
18676            self.0.request.authz_policy = std::option::Option::Some(v.into());
18677            self
18678        }
18679
18680        /// Sets or clears the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
18681        ///
18682        /// This is a **required** field for requests.
18683        pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
18684        where
18685            T: std::convert::Into<crate::model::AuthzPolicy>,
18686        {
18687            self.0.request.authz_policy = v.map(|x| x.into());
18688            self
18689        }
18690
18691        /// Sets the value of [request_id][crate::model::CreateAuthzPolicyRequest::request_id].
18692        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18693            self.0.request.request_id = v.into();
18694            self
18695        }
18696    }
18697
18698    #[doc(hidden)]
18699    impl crate::RequestBuilder for CreateAuthzPolicy {
18700        fn request_options(&mut self) -> &mut crate::RequestOptions {
18701            &mut self.0.options
18702        }
18703    }
18704
18705    /// The request builder for [NetworkSecurity::update_authz_policy][crate::client::NetworkSecurity::update_authz_policy] calls.
18706    ///
18707    /// # Example
18708    /// ```
18709    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateAuthzPolicy;
18710    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18711    /// use google_cloud_lro::Poller;
18712    ///
18713    /// let builder = prepare_request_builder();
18714    /// let response = builder.poller().until_done().await?;
18715    /// # Ok(()) }
18716    ///
18717    /// fn prepare_request_builder() -> UpdateAuthzPolicy {
18718    ///   # panic!();
18719    ///   // ... details omitted ...
18720    /// }
18721    /// ```
18722    #[derive(Clone, Debug)]
18723    pub struct UpdateAuthzPolicy(RequestBuilder<crate::model::UpdateAuthzPolicyRequest>);
18724
18725    impl UpdateAuthzPolicy {
18726        pub(crate) fn new(
18727            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18728        ) -> Self {
18729            Self(RequestBuilder::new(stub))
18730        }
18731
18732        /// Sets the full request, replacing any prior values.
18733        pub fn with_request<V: Into<crate::model::UpdateAuthzPolicyRequest>>(
18734            mut self,
18735            v: V,
18736        ) -> Self {
18737            self.0.request = v.into();
18738            self
18739        }
18740
18741        /// Sets all the options, replacing any prior values.
18742        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18743            self.0.options = v.into();
18744            self
18745        }
18746
18747        /// Sends the request.
18748        ///
18749        /// # Long running operations
18750        ///
18751        /// This starts, but does not poll, a longrunning operation. More information
18752        /// on [update_authz_policy][crate::client::NetworkSecurity::update_authz_policy].
18753        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18754            (*self.0.stub)
18755                .update_authz_policy(self.0.request, self.0.options)
18756                .await
18757                .map(crate::Response::into_body)
18758        }
18759
18760        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_authz_policy`.
18761        pub fn poller(
18762            self,
18763        ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
18764        {
18765            type Operation = google_cloud_lro::internal::Operation<
18766                crate::model::AuthzPolicy,
18767                crate::model::OperationMetadata,
18768            >;
18769            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18770            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18771
18772            let stub = self.0.stub.clone();
18773            let mut options = self.0.options.clone();
18774            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18775            let query = move |name| {
18776                let stub = stub.clone();
18777                let options = options.clone();
18778                async {
18779                    let op = GetOperation::new(stub)
18780                        .set_name(name)
18781                        .with_options(options)
18782                        .send()
18783                        .await?;
18784                    Ok(Operation::new(op))
18785                }
18786            };
18787
18788            let start = move || async {
18789                let op = self.send().await?;
18790                Ok(Operation::new(op))
18791            };
18792
18793            google_cloud_lro::internal::new_poller(
18794                polling_error_policy,
18795                polling_backoff_policy,
18796                start,
18797                query,
18798            )
18799        }
18800
18801        /// Sets the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
18802        ///
18803        /// This is a **required** field for requests.
18804        pub fn set_update_mask<T>(mut self, v: T) -> Self
18805        where
18806            T: std::convert::Into<wkt::FieldMask>,
18807        {
18808            self.0.request.update_mask = std::option::Option::Some(v.into());
18809            self
18810        }
18811
18812        /// Sets or clears the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
18813        ///
18814        /// This is a **required** field for requests.
18815        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18816        where
18817            T: std::convert::Into<wkt::FieldMask>,
18818        {
18819            self.0.request.update_mask = v.map(|x| x.into());
18820            self
18821        }
18822
18823        /// Sets the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
18824        ///
18825        /// This is a **required** field for requests.
18826        pub fn set_authz_policy<T>(mut self, v: T) -> Self
18827        where
18828            T: std::convert::Into<crate::model::AuthzPolicy>,
18829        {
18830            self.0.request.authz_policy = std::option::Option::Some(v.into());
18831            self
18832        }
18833
18834        /// Sets or clears the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
18835        ///
18836        /// This is a **required** field for requests.
18837        pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
18838        where
18839            T: std::convert::Into<crate::model::AuthzPolicy>,
18840        {
18841            self.0.request.authz_policy = v.map(|x| x.into());
18842            self
18843        }
18844
18845        /// Sets the value of [request_id][crate::model::UpdateAuthzPolicyRequest::request_id].
18846        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18847            self.0.request.request_id = v.into();
18848            self
18849        }
18850    }
18851
18852    #[doc(hidden)]
18853    impl crate::RequestBuilder for UpdateAuthzPolicy {
18854        fn request_options(&mut self) -> &mut crate::RequestOptions {
18855            &mut self.0.options
18856        }
18857    }
18858
18859    /// The request builder for [NetworkSecurity::delete_authz_policy][crate::client::NetworkSecurity::delete_authz_policy] calls.
18860    ///
18861    /// # Example
18862    /// ```
18863    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteAuthzPolicy;
18864    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18865    /// use google_cloud_lro::Poller;
18866    ///
18867    /// let builder = prepare_request_builder();
18868    /// let response = builder.poller().until_done().await?;
18869    /// # Ok(()) }
18870    ///
18871    /// fn prepare_request_builder() -> DeleteAuthzPolicy {
18872    ///   # panic!();
18873    ///   // ... details omitted ...
18874    /// }
18875    /// ```
18876    #[derive(Clone, Debug)]
18877    pub struct DeleteAuthzPolicy(RequestBuilder<crate::model::DeleteAuthzPolicyRequest>);
18878
18879    impl DeleteAuthzPolicy {
18880        pub(crate) fn new(
18881            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18882        ) -> Self {
18883            Self(RequestBuilder::new(stub))
18884        }
18885
18886        /// Sets the full request, replacing any prior values.
18887        pub fn with_request<V: Into<crate::model::DeleteAuthzPolicyRequest>>(
18888            mut self,
18889            v: V,
18890        ) -> Self {
18891            self.0.request = v.into();
18892            self
18893        }
18894
18895        /// Sets all the options, replacing any prior values.
18896        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18897            self.0.options = v.into();
18898            self
18899        }
18900
18901        /// Sends the request.
18902        ///
18903        /// # Long running operations
18904        ///
18905        /// This starts, but does not poll, a longrunning operation. More information
18906        /// on [delete_authz_policy][crate::client::NetworkSecurity::delete_authz_policy].
18907        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18908            (*self.0.stub)
18909                .delete_authz_policy(self.0.request, self.0.options)
18910                .await
18911                .map(crate::Response::into_body)
18912        }
18913
18914        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_authz_policy`.
18915        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18916            type Operation =
18917                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18918            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18919            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18920
18921            let stub = self.0.stub.clone();
18922            let mut options = self.0.options.clone();
18923            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18924            let query = move |name| {
18925                let stub = stub.clone();
18926                let options = options.clone();
18927                async {
18928                    let op = GetOperation::new(stub)
18929                        .set_name(name)
18930                        .with_options(options)
18931                        .send()
18932                        .await?;
18933                    Ok(Operation::new(op))
18934                }
18935            };
18936
18937            let start = move || async {
18938                let op = self.send().await?;
18939                Ok(Operation::new(op))
18940            };
18941
18942            google_cloud_lro::internal::new_unit_response_poller(
18943                polling_error_policy,
18944                polling_backoff_policy,
18945                start,
18946                query,
18947            )
18948        }
18949
18950        /// Sets the value of [name][crate::model::DeleteAuthzPolicyRequest::name].
18951        ///
18952        /// This is a **required** field for requests.
18953        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18954            self.0.request.name = v.into();
18955            self
18956        }
18957
18958        /// Sets the value of [request_id][crate::model::DeleteAuthzPolicyRequest::request_id].
18959        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18960            self.0.request.request_id = v.into();
18961            self
18962        }
18963    }
18964
18965    #[doc(hidden)]
18966    impl crate::RequestBuilder for DeleteAuthzPolicy {
18967        fn request_options(&mut self) -> &mut crate::RequestOptions {
18968            &mut self.0.options
18969        }
18970    }
18971
18972    /// The request builder for [NetworkSecurity::list_locations][crate::client::NetworkSecurity::list_locations] calls.
18973    ///
18974    /// # Example
18975    /// ```
18976    /// # use google_cloud_networksecurity_v1::builder::network_security::ListLocations;
18977    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18978    /// use google_cloud_gax::paginator::ItemPaginator;
18979    ///
18980    /// let builder = prepare_request_builder();
18981    /// let mut items = builder.by_item();
18982    /// while let Some(result) = items.next().await {
18983    ///   let item = result?;
18984    /// }
18985    /// # Ok(()) }
18986    ///
18987    /// fn prepare_request_builder() -> ListLocations {
18988    ///   # panic!();
18989    ///   // ... details omitted ...
18990    /// }
18991    /// ```
18992    #[derive(Clone, Debug)]
18993    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
18994
18995    impl ListLocations {
18996        pub(crate) fn new(
18997            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18998        ) -> Self {
18999            Self(RequestBuilder::new(stub))
19000        }
19001
19002        /// Sets the full request, replacing any prior values.
19003        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
19004            mut self,
19005            v: V,
19006        ) -> Self {
19007            self.0.request = v.into();
19008            self
19009        }
19010
19011        /// Sets all the options, replacing any prior values.
19012        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19013            self.0.options = v.into();
19014            self
19015        }
19016
19017        /// Sends the request.
19018        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
19019            (*self.0.stub)
19020                .list_locations(self.0.request, self.0.options)
19021                .await
19022                .map(crate::Response::into_body)
19023        }
19024
19025        /// Streams each page in the collection.
19026        pub fn by_page(
19027            self,
19028        ) -> impl google_cloud_gax::paginator::Paginator<
19029            google_cloud_location::model::ListLocationsResponse,
19030            crate::Error,
19031        > {
19032            use std::clone::Clone;
19033            let token = self.0.request.page_token.clone();
19034            let execute = move |token: String| {
19035                let mut builder = self.clone();
19036                builder.0.request = builder.0.request.set_page_token(token);
19037                builder.send()
19038            };
19039            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19040        }
19041
19042        /// Streams each item in the collection.
19043        pub fn by_item(
19044            self,
19045        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19046            google_cloud_location::model::ListLocationsResponse,
19047            crate::Error,
19048        > {
19049            use google_cloud_gax::paginator::Paginator;
19050            self.by_page().items()
19051        }
19052
19053        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
19054        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19055            self.0.request.name = v.into();
19056            self
19057        }
19058
19059        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
19060        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19061            self.0.request.filter = v.into();
19062            self
19063        }
19064
19065        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
19066        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19067            self.0.request.page_size = v.into();
19068            self
19069        }
19070
19071        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
19072        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19073            self.0.request.page_token = v.into();
19074            self
19075        }
19076    }
19077
19078    #[doc(hidden)]
19079    impl crate::RequestBuilder for ListLocations {
19080        fn request_options(&mut self) -> &mut crate::RequestOptions {
19081            &mut self.0.options
19082        }
19083    }
19084
19085    /// The request builder for [NetworkSecurity::get_location][crate::client::NetworkSecurity::get_location] calls.
19086    ///
19087    /// # Example
19088    /// ```
19089    /// # use google_cloud_networksecurity_v1::builder::network_security::GetLocation;
19090    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19091    ///
19092    /// let builder = prepare_request_builder();
19093    /// let response = builder.send().await?;
19094    /// # Ok(()) }
19095    ///
19096    /// fn prepare_request_builder() -> GetLocation {
19097    ///   # panic!();
19098    ///   // ... details omitted ...
19099    /// }
19100    /// ```
19101    #[derive(Clone, Debug)]
19102    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
19103
19104    impl GetLocation {
19105        pub(crate) fn new(
19106            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19107        ) -> Self {
19108            Self(RequestBuilder::new(stub))
19109        }
19110
19111        /// Sets the full request, replacing any prior values.
19112        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
19113            mut self,
19114            v: V,
19115        ) -> Self {
19116            self.0.request = v.into();
19117            self
19118        }
19119
19120        /// Sets all the options, replacing any prior values.
19121        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19122            self.0.options = v.into();
19123            self
19124        }
19125
19126        /// Sends the request.
19127        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
19128            (*self.0.stub)
19129                .get_location(self.0.request, self.0.options)
19130                .await
19131                .map(crate::Response::into_body)
19132        }
19133
19134        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
19135        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19136            self.0.request.name = v.into();
19137            self
19138        }
19139    }
19140
19141    #[doc(hidden)]
19142    impl crate::RequestBuilder for GetLocation {
19143        fn request_options(&mut self) -> &mut crate::RequestOptions {
19144            &mut self.0.options
19145        }
19146    }
19147
19148    /// The request builder for [NetworkSecurity::set_iam_policy][crate::client::NetworkSecurity::set_iam_policy] calls.
19149    ///
19150    /// # Example
19151    /// ```
19152    /// # use google_cloud_networksecurity_v1::builder::network_security::SetIamPolicy;
19153    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19154    ///
19155    /// let builder = prepare_request_builder();
19156    /// let response = builder.send().await?;
19157    /// # Ok(()) }
19158    ///
19159    /// fn prepare_request_builder() -> SetIamPolicy {
19160    ///   # panic!();
19161    ///   // ... details omitted ...
19162    /// }
19163    /// ```
19164    #[derive(Clone, Debug)]
19165    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
19166
19167    impl SetIamPolicy {
19168        pub(crate) fn new(
19169            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19170        ) -> Self {
19171            Self(RequestBuilder::new(stub))
19172        }
19173
19174        /// Sets the full request, replacing any prior values.
19175        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
19176            mut self,
19177            v: V,
19178        ) -> Self {
19179            self.0.request = v.into();
19180            self
19181        }
19182
19183        /// Sets all the options, replacing any prior values.
19184        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19185            self.0.options = v.into();
19186            self
19187        }
19188
19189        /// Sends the request.
19190        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
19191            (*self.0.stub)
19192                .set_iam_policy(self.0.request, self.0.options)
19193                .await
19194                .map(crate::Response::into_body)
19195        }
19196
19197        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
19198        ///
19199        /// This is a **required** field for requests.
19200        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19201            self.0.request.resource = v.into();
19202            self
19203        }
19204
19205        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
19206        ///
19207        /// This is a **required** field for requests.
19208        pub fn set_policy<T>(mut self, v: T) -> Self
19209        where
19210            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
19211        {
19212            self.0.request.policy = std::option::Option::Some(v.into());
19213            self
19214        }
19215
19216        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
19217        ///
19218        /// This is a **required** field for requests.
19219        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
19220        where
19221            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
19222        {
19223            self.0.request.policy = v.map(|x| x.into());
19224            self
19225        }
19226
19227        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
19228        pub fn set_update_mask<T>(mut self, v: T) -> Self
19229        where
19230            T: std::convert::Into<wkt::FieldMask>,
19231        {
19232            self.0.request.update_mask = std::option::Option::Some(v.into());
19233            self
19234        }
19235
19236        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
19237        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19238        where
19239            T: std::convert::Into<wkt::FieldMask>,
19240        {
19241            self.0.request.update_mask = v.map(|x| x.into());
19242            self
19243        }
19244    }
19245
19246    #[doc(hidden)]
19247    impl crate::RequestBuilder for SetIamPolicy {
19248        fn request_options(&mut self) -> &mut crate::RequestOptions {
19249            &mut self.0.options
19250        }
19251    }
19252
19253    /// The request builder for [NetworkSecurity::get_iam_policy][crate::client::NetworkSecurity::get_iam_policy] calls.
19254    ///
19255    /// # Example
19256    /// ```
19257    /// # use google_cloud_networksecurity_v1::builder::network_security::GetIamPolicy;
19258    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19259    ///
19260    /// let builder = prepare_request_builder();
19261    /// let response = builder.send().await?;
19262    /// # Ok(()) }
19263    ///
19264    /// fn prepare_request_builder() -> GetIamPolicy {
19265    ///   # panic!();
19266    ///   // ... details omitted ...
19267    /// }
19268    /// ```
19269    #[derive(Clone, Debug)]
19270    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
19271
19272    impl GetIamPolicy {
19273        pub(crate) fn new(
19274            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19275        ) -> Self {
19276            Self(RequestBuilder::new(stub))
19277        }
19278
19279        /// Sets the full request, replacing any prior values.
19280        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
19281            mut self,
19282            v: V,
19283        ) -> Self {
19284            self.0.request = v.into();
19285            self
19286        }
19287
19288        /// Sets all the options, replacing any prior values.
19289        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19290            self.0.options = v.into();
19291            self
19292        }
19293
19294        /// Sends the request.
19295        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
19296            (*self.0.stub)
19297                .get_iam_policy(self.0.request, self.0.options)
19298                .await
19299                .map(crate::Response::into_body)
19300        }
19301
19302        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
19303        ///
19304        /// This is a **required** field for requests.
19305        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19306            self.0.request.resource = v.into();
19307            self
19308        }
19309
19310        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
19311        pub fn set_options<T>(mut self, v: T) -> Self
19312        where
19313            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
19314        {
19315            self.0.request.options = std::option::Option::Some(v.into());
19316            self
19317        }
19318
19319        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
19320        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
19321        where
19322            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
19323        {
19324            self.0.request.options = v.map(|x| x.into());
19325            self
19326        }
19327    }
19328
19329    #[doc(hidden)]
19330    impl crate::RequestBuilder for GetIamPolicy {
19331        fn request_options(&mut self) -> &mut crate::RequestOptions {
19332            &mut self.0.options
19333        }
19334    }
19335
19336    /// The request builder for [NetworkSecurity::test_iam_permissions][crate::client::NetworkSecurity::test_iam_permissions] calls.
19337    ///
19338    /// # Example
19339    /// ```
19340    /// # use google_cloud_networksecurity_v1::builder::network_security::TestIamPermissions;
19341    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19342    ///
19343    /// let builder = prepare_request_builder();
19344    /// let response = builder.send().await?;
19345    /// # Ok(()) }
19346    ///
19347    /// fn prepare_request_builder() -> TestIamPermissions {
19348    ///   # panic!();
19349    ///   // ... details omitted ...
19350    /// }
19351    /// ```
19352    #[derive(Clone, Debug)]
19353    pub struct TestIamPermissions(
19354        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
19355    );
19356
19357    impl TestIamPermissions {
19358        pub(crate) fn new(
19359            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19360        ) -> Self {
19361            Self(RequestBuilder::new(stub))
19362        }
19363
19364        /// Sets the full request, replacing any prior values.
19365        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
19366            mut self,
19367            v: V,
19368        ) -> Self {
19369            self.0.request = v.into();
19370            self
19371        }
19372
19373        /// Sets all the options, replacing any prior values.
19374        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19375            self.0.options = v.into();
19376            self
19377        }
19378
19379        /// Sends the request.
19380        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
19381            (*self.0.stub)
19382                .test_iam_permissions(self.0.request, self.0.options)
19383                .await
19384                .map(crate::Response::into_body)
19385        }
19386
19387        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
19388        ///
19389        /// This is a **required** field for requests.
19390        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19391            self.0.request.resource = v.into();
19392            self
19393        }
19394
19395        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
19396        ///
19397        /// This is a **required** field for requests.
19398        pub fn set_permissions<T, V>(mut self, v: T) -> Self
19399        where
19400            T: std::iter::IntoIterator<Item = V>,
19401            V: std::convert::Into<std::string::String>,
19402        {
19403            use std::iter::Iterator;
19404            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
19405            self
19406        }
19407    }
19408
19409    #[doc(hidden)]
19410    impl crate::RequestBuilder for TestIamPermissions {
19411        fn request_options(&mut self) -> &mut crate::RequestOptions {
19412            &mut self.0.options
19413        }
19414    }
19415
19416    /// The request builder for [NetworkSecurity::list_operations][crate::client::NetworkSecurity::list_operations] calls.
19417    ///
19418    /// # Example
19419    /// ```
19420    /// # use google_cloud_networksecurity_v1::builder::network_security::ListOperations;
19421    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19422    /// use google_cloud_gax::paginator::ItemPaginator;
19423    ///
19424    /// let builder = prepare_request_builder();
19425    /// let mut items = builder.by_item();
19426    /// while let Some(result) = items.next().await {
19427    ///   let item = result?;
19428    /// }
19429    /// # Ok(()) }
19430    ///
19431    /// fn prepare_request_builder() -> ListOperations {
19432    ///   # panic!();
19433    ///   // ... details omitted ...
19434    /// }
19435    /// ```
19436    #[derive(Clone, Debug)]
19437    pub struct ListOperations(
19438        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
19439    );
19440
19441    impl ListOperations {
19442        pub(crate) fn new(
19443            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19444        ) -> Self {
19445            Self(RequestBuilder::new(stub))
19446        }
19447
19448        /// Sets the full request, replacing any prior values.
19449        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
19450            mut self,
19451            v: V,
19452        ) -> Self {
19453            self.0.request = v.into();
19454            self
19455        }
19456
19457        /// Sets all the options, replacing any prior values.
19458        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19459            self.0.options = v.into();
19460            self
19461        }
19462
19463        /// Sends the request.
19464        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
19465            (*self.0.stub)
19466                .list_operations(self.0.request, self.0.options)
19467                .await
19468                .map(crate::Response::into_body)
19469        }
19470
19471        /// Streams each page in the collection.
19472        pub fn by_page(
19473            self,
19474        ) -> impl google_cloud_gax::paginator::Paginator<
19475            google_cloud_longrunning::model::ListOperationsResponse,
19476            crate::Error,
19477        > {
19478            use std::clone::Clone;
19479            let token = self.0.request.page_token.clone();
19480            let execute = move |token: String| {
19481                let mut builder = self.clone();
19482                builder.0.request = builder.0.request.set_page_token(token);
19483                builder.send()
19484            };
19485            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19486        }
19487
19488        /// Streams each item in the collection.
19489        pub fn by_item(
19490            self,
19491        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19492            google_cloud_longrunning::model::ListOperationsResponse,
19493            crate::Error,
19494        > {
19495            use google_cloud_gax::paginator::Paginator;
19496            self.by_page().items()
19497        }
19498
19499        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
19500        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19501            self.0.request.name = v.into();
19502            self
19503        }
19504
19505        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
19506        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19507            self.0.request.filter = v.into();
19508            self
19509        }
19510
19511        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
19512        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19513            self.0.request.page_size = v.into();
19514            self
19515        }
19516
19517        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
19518        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19519            self.0.request.page_token = v.into();
19520            self
19521        }
19522
19523        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
19524        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19525            self.0.request.return_partial_success = v.into();
19526            self
19527        }
19528    }
19529
19530    #[doc(hidden)]
19531    impl crate::RequestBuilder for ListOperations {
19532        fn request_options(&mut self) -> &mut crate::RequestOptions {
19533            &mut self.0.options
19534        }
19535    }
19536
19537    /// The request builder for [NetworkSecurity::get_operation][crate::client::NetworkSecurity::get_operation] calls.
19538    ///
19539    /// # Example
19540    /// ```
19541    /// # use google_cloud_networksecurity_v1::builder::network_security::GetOperation;
19542    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19543    ///
19544    /// let builder = prepare_request_builder();
19545    /// let response = builder.send().await?;
19546    /// # Ok(()) }
19547    ///
19548    /// fn prepare_request_builder() -> GetOperation {
19549    ///   # panic!();
19550    ///   // ... details omitted ...
19551    /// }
19552    /// ```
19553    #[derive(Clone, Debug)]
19554    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
19555
19556    impl GetOperation {
19557        pub(crate) fn new(
19558            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19559        ) -> Self {
19560            Self(RequestBuilder::new(stub))
19561        }
19562
19563        /// Sets the full request, replacing any prior values.
19564        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19565            mut self,
19566            v: V,
19567        ) -> Self {
19568            self.0.request = v.into();
19569            self
19570        }
19571
19572        /// Sets all the options, replacing any prior values.
19573        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19574            self.0.options = v.into();
19575            self
19576        }
19577
19578        /// Sends the request.
19579        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19580            (*self.0.stub)
19581                .get_operation(self.0.request, self.0.options)
19582                .await
19583                .map(crate::Response::into_body)
19584        }
19585
19586        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
19587        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19588            self.0.request.name = v.into();
19589            self
19590        }
19591    }
19592
19593    #[doc(hidden)]
19594    impl crate::RequestBuilder for GetOperation {
19595        fn request_options(&mut self) -> &mut crate::RequestOptions {
19596            &mut self.0.options
19597        }
19598    }
19599
19600    /// The request builder for [NetworkSecurity::delete_operation][crate::client::NetworkSecurity::delete_operation] calls.
19601    ///
19602    /// # Example
19603    /// ```
19604    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteOperation;
19605    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19606    ///
19607    /// let builder = prepare_request_builder();
19608    /// let response = builder.send().await?;
19609    /// # Ok(()) }
19610    ///
19611    /// fn prepare_request_builder() -> DeleteOperation {
19612    ///   # panic!();
19613    ///   // ... details omitted ...
19614    /// }
19615    /// ```
19616    #[derive(Clone, Debug)]
19617    pub struct DeleteOperation(
19618        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
19619    );
19620
19621    impl DeleteOperation {
19622        pub(crate) fn new(
19623            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19624        ) -> Self {
19625            Self(RequestBuilder::new(stub))
19626        }
19627
19628        /// Sets the full request, replacing any prior values.
19629        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
19630            mut self,
19631            v: V,
19632        ) -> Self {
19633            self.0.request = v.into();
19634            self
19635        }
19636
19637        /// Sets all the options, replacing any prior values.
19638        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19639            self.0.options = v.into();
19640            self
19641        }
19642
19643        /// Sends the request.
19644        pub async fn send(self) -> Result<()> {
19645            (*self.0.stub)
19646                .delete_operation(self.0.request, self.0.options)
19647                .await
19648                .map(crate::Response::into_body)
19649        }
19650
19651        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
19652        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19653            self.0.request.name = v.into();
19654            self
19655        }
19656    }
19657
19658    #[doc(hidden)]
19659    impl crate::RequestBuilder for DeleteOperation {
19660        fn request_options(&mut self) -> &mut crate::RequestOptions {
19661            &mut self.0.options
19662        }
19663    }
19664
19665    /// The request builder for [NetworkSecurity::cancel_operation][crate::client::NetworkSecurity::cancel_operation] calls.
19666    ///
19667    /// # Example
19668    /// ```
19669    /// # use google_cloud_networksecurity_v1::builder::network_security::CancelOperation;
19670    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19671    ///
19672    /// let builder = prepare_request_builder();
19673    /// let response = builder.send().await?;
19674    /// # Ok(()) }
19675    ///
19676    /// fn prepare_request_builder() -> CancelOperation {
19677    ///   # panic!();
19678    ///   // ... details omitted ...
19679    /// }
19680    /// ```
19681    #[derive(Clone, Debug)]
19682    pub struct CancelOperation(
19683        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19684    );
19685
19686    impl CancelOperation {
19687        pub(crate) fn new(
19688            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19689        ) -> Self {
19690            Self(RequestBuilder::new(stub))
19691        }
19692
19693        /// Sets the full request, replacing any prior values.
19694        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19695            mut self,
19696            v: V,
19697        ) -> Self {
19698            self.0.request = v.into();
19699            self
19700        }
19701
19702        /// Sets all the options, replacing any prior values.
19703        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19704            self.0.options = v.into();
19705            self
19706        }
19707
19708        /// Sends the request.
19709        pub async fn send(self) -> Result<()> {
19710            (*self.0.stub)
19711                .cancel_operation(self.0.request, self.0.options)
19712                .await
19713                .map(crate::Response::into_body)
19714        }
19715
19716        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
19717        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19718            self.0.request.name = v.into();
19719            self
19720        }
19721    }
19722
19723    #[doc(hidden)]
19724    impl crate::RequestBuilder for CancelOperation {
19725        fn request_options(&mut self) -> &mut crate::RequestOptions {
19726            &mut self.0.options
19727        }
19728    }
19729}
19730
19731/// Request and client builders for [OrganizationSecurityProfileGroupService][crate::client::OrganizationSecurityProfileGroupService].
19732pub mod organization_security_profile_group_service {
19733    use crate::Result;
19734
19735    /// A builder for [OrganizationSecurityProfileGroupService][crate::client::OrganizationSecurityProfileGroupService].
19736    ///
19737    /// ```
19738    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19739    /// # use google_cloud_networksecurity_v1::*;
19740    /// # use builder::organization_security_profile_group_service::ClientBuilder;
19741    /// # use client::OrganizationSecurityProfileGroupService;
19742    /// let builder : ClientBuilder = OrganizationSecurityProfileGroupService::builder();
19743    /// let client = builder
19744    ///     .with_endpoint("https://networksecurity.googleapis.com")
19745    ///     .build().await?;
19746    /// # Ok(()) }
19747    /// ```
19748    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
19749
19750    pub(crate) mod client {
19751        use super::super::super::client::OrganizationSecurityProfileGroupService;
19752        pub struct Factory;
19753        impl crate::ClientFactory for Factory {
19754            type Client = OrganizationSecurityProfileGroupService;
19755            type Credentials = gaxi::options::Credentials;
19756            async fn build(
19757                self,
19758                config: gaxi::options::ClientConfig,
19759            ) -> crate::ClientBuilderResult<Self::Client> {
19760                Self::Client::new(config).await
19761            }
19762        }
19763    }
19764
19765    /// Common implementation for [crate::client::OrganizationSecurityProfileGroupService] request builders.
19766    #[derive(Clone, Debug)]
19767    pub(crate) struct RequestBuilder<R: std::default::Default> {
19768        stub: std::sync::Arc<
19769            dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19770        >,
19771        request: R,
19772        options: crate::RequestOptions,
19773    }
19774
19775    impl<R> RequestBuilder<R>
19776    where
19777        R: std::default::Default,
19778    {
19779        pub(crate) fn new(
19780            stub: std::sync::Arc<
19781                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19782            >,
19783        ) -> Self {
19784            Self {
19785                stub,
19786                request: R::default(),
19787                options: crate::RequestOptions::default(),
19788            }
19789        }
19790    }
19791
19792    /// The request builder for [OrganizationSecurityProfileGroupService::list_security_profile_groups][crate::client::OrganizationSecurityProfileGroupService::list_security_profile_groups] calls.
19793    ///
19794    /// # Example
19795    /// ```
19796    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListSecurityProfileGroups;
19797    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19798    /// use google_cloud_gax::paginator::ItemPaginator;
19799    ///
19800    /// let builder = prepare_request_builder();
19801    /// let mut items = builder.by_item();
19802    /// while let Some(result) = items.next().await {
19803    ///   let item = result?;
19804    /// }
19805    /// # Ok(()) }
19806    ///
19807    /// fn prepare_request_builder() -> ListSecurityProfileGroups {
19808    ///   # panic!();
19809    ///   // ... details omitted ...
19810    /// }
19811    /// ```
19812    #[derive(Clone, Debug)]
19813    pub struct ListSecurityProfileGroups(
19814        RequestBuilder<crate::model::ListSecurityProfileGroupsRequest>,
19815    );
19816
19817    impl ListSecurityProfileGroups {
19818        pub(crate) fn new(
19819            stub: std::sync::Arc<
19820                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19821            >,
19822        ) -> Self {
19823            Self(RequestBuilder::new(stub))
19824        }
19825
19826        /// Sets the full request, replacing any prior values.
19827        pub fn with_request<V: Into<crate::model::ListSecurityProfileGroupsRequest>>(
19828            mut self,
19829            v: V,
19830        ) -> Self {
19831            self.0.request = v.into();
19832            self
19833        }
19834
19835        /// Sets all the options, replacing any prior values.
19836        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19837            self.0.options = v.into();
19838            self
19839        }
19840
19841        /// Sends the request.
19842        pub async fn send(self) -> Result<crate::model::ListSecurityProfileGroupsResponse> {
19843            (*self.0.stub)
19844                .list_security_profile_groups(self.0.request, self.0.options)
19845                .await
19846                .map(crate::Response::into_body)
19847        }
19848
19849        /// Streams each page in the collection.
19850        pub fn by_page(
19851            self,
19852        ) -> impl google_cloud_gax::paginator::Paginator<
19853            crate::model::ListSecurityProfileGroupsResponse,
19854            crate::Error,
19855        > {
19856            use std::clone::Clone;
19857            let token = self.0.request.page_token.clone();
19858            let execute = move |token: String| {
19859                let mut builder = self.clone();
19860                builder.0.request = builder.0.request.set_page_token(token);
19861                builder.send()
19862            };
19863            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19864        }
19865
19866        /// Streams each item in the collection.
19867        pub fn by_item(
19868            self,
19869        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19870            crate::model::ListSecurityProfileGroupsResponse,
19871            crate::Error,
19872        > {
19873            use google_cloud_gax::paginator::Paginator;
19874            self.by_page().items()
19875        }
19876
19877        /// Sets the value of [parent][crate::model::ListSecurityProfileGroupsRequest::parent].
19878        ///
19879        /// This is a **required** field for requests.
19880        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19881            self.0.request.parent = v.into();
19882            self
19883        }
19884
19885        /// Sets the value of [page_size][crate::model::ListSecurityProfileGroupsRequest::page_size].
19886        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19887            self.0.request.page_size = v.into();
19888            self
19889        }
19890
19891        /// Sets the value of [page_token][crate::model::ListSecurityProfileGroupsRequest::page_token].
19892        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19893            self.0.request.page_token = v.into();
19894            self
19895        }
19896    }
19897
19898    #[doc(hidden)]
19899    impl crate::RequestBuilder for ListSecurityProfileGroups {
19900        fn request_options(&mut self) -> &mut crate::RequestOptions {
19901            &mut self.0.options
19902        }
19903    }
19904
19905    /// The request builder for [OrganizationSecurityProfileGroupService::get_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::get_security_profile_group] calls.
19906    ///
19907    /// # Example
19908    /// ```
19909    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetSecurityProfileGroup;
19910    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19911    ///
19912    /// let builder = prepare_request_builder();
19913    /// let response = builder.send().await?;
19914    /// # Ok(()) }
19915    ///
19916    /// fn prepare_request_builder() -> GetSecurityProfileGroup {
19917    ///   # panic!();
19918    ///   // ... details omitted ...
19919    /// }
19920    /// ```
19921    #[derive(Clone, Debug)]
19922    pub struct GetSecurityProfileGroup(
19923        RequestBuilder<crate::model::GetSecurityProfileGroupRequest>,
19924    );
19925
19926    impl GetSecurityProfileGroup {
19927        pub(crate) fn new(
19928            stub: std::sync::Arc<
19929                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19930            >,
19931        ) -> Self {
19932            Self(RequestBuilder::new(stub))
19933        }
19934
19935        /// Sets the full request, replacing any prior values.
19936        pub fn with_request<V: Into<crate::model::GetSecurityProfileGroupRequest>>(
19937            mut self,
19938            v: V,
19939        ) -> Self {
19940            self.0.request = v.into();
19941            self
19942        }
19943
19944        /// Sets all the options, replacing any prior values.
19945        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19946            self.0.options = v.into();
19947            self
19948        }
19949
19950        /// Sends the request.
19951        pub async fn send(self) -> Result<crate::model::SecurityProfileGroup> {
19952            (*self.0.stub)
19953                .get_security_profile_group(self.0.request, self.0.options)
19954                .await
19955                .map(crate::Response::into_body)
19956        }
19957
19958        /// Sets the value of [name][crate::model::GetSecurityProfileGroupRequest::name].
19959        ///
19960        /// This is a **required** field for requests.
19961        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19962            self.0.request.name = v.into();
19963            self
19964        }
19965    }
19966
19967    #[doc(hidden)]
19968    impl crate::RequestBuilder for GetSecurityProfileGroup {
19969        fn request_options(&mut self) -> &mut crate::RequestOptions {
19970            &mut self.0.options
19971        }
19972    }
19973
19974    /// The request builder for [OrganizationSecurityProfileGroupService::create_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::create_security_profile_group] calls.
19975    ///
19976    /// # Example
19977    /// ```
19978    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::CreateSecurityProfileGroup;
19979    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19980    /// use google_cloud_lro::Poller;
19981    ///
19982    /// let builder = prepare_request_builder();
19983    /// let response = builder.poller().until_done().await?;
19984    /// # Ok(()) }
19985    ///
19986    /// fn prepare_request_builder() -> CreateSecurityProfileGroup {
19987    ///   # panic!();
19988    ///   // ... details omitted ...
19989    /// }
19990    /// ```
19991    #[derive(Clone, Debug)]
19992    pub struct CreateSecurityProfileGroup(
19993        RequestBuilder<crate::model::CreateSecurityProfileGroupRequest>,
19994    );
19995
19996    impl CreateSecurityProfileGroup {
19997        pub(crate) fn new(
19998            stub: std::sync::Arc<
19999                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20000            >,
20001        ) -> Self {
20002            Self(RequestBuilder::new(stub))
20003        }
20004
20005        /// Sets the full request, replacing any prior values.
20006        pub fn with_request<V: Into<crate::model::CreateSecurityProfileGroupRequest>>(
20007            mut self,
20008            v: V,
20009        ) -> Self {
20010            self.0.request = v.into();
20011            self
20012        }
20013
20014        /// Sets all the options, replacing any prior values.
20015        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20016            self.0.options = v.into();
20017            self
20018        }
20019
20020        /// Sends the request.
20021        ///
20022        /// # Long running operations
20023        ///
20024        /// This starts, but does not poll, a longrunning operation. More information
20025        /// on [create_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::create_security_profile_group].
20026        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20027            (*self.0.stub)
20028                .create_security_profile_group(self.0.request, self.0.options)
20029                .await
20030                .map(crate::Response::into_body)
20031        }
20032
20033        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_security_profile_group`.
20034        pub fn poller(
20035            self,
20036        ) -> impl google_cloud_lro::Poller<
20037            crate::model::SecurityProfileGroup,
20038            crate::model::OperationMetadata,
20039        > {
20040            type Operation = google_cloud_lro::internal::Operation<
20041                crate::model::SecurityProfileGroup,
20042                crate::model::OperationMetadata,
20043            >;
20044            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20045            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20046
20047            let stub = self.0.stub.clone();
20048            let mut options = self.0.options.clone();
20049            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20050            let query = move |name| {
20051                let stub = stub.clone();
20052                let options = options.clone();
20053                async {
20054                    let op = GetOperation::new(stub)
20055                        .set_name(name)
20056                        .with_options(options)
20057                        .send()
20058                        .await?;
20059                    Ok(Operation::new(op))
20060                }
20061            };
20062
20063            let start = move || async {
20064                let op = self.send().await?;
20065                Ok(Operation::new(op))
20066            };
20067
20068            google_cloud_lro::internal::new_poller(
20069                polling_error_policy,
20070                polling_backoff_policy,
20071                start,
20072                query,
20073            )
20074        }
20075
20076        /// Sets the value of [parent][crate::model::CreateSecurityProfileGroupRequest::parent].
20077        ///
20078        /// This is a **required** field for requests.
20079        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20080            self.0.request.parent = v.into();
20081            self
20082        }
20083
20084        /// Sets the value of [security_profile_group_id][crate::model::CreateSecurityProfileGroupRequest::security_profile_group_id].
20085        ///
20086        /// This is a **required** field for requests.
20087        pub fn set_security_profile_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
20088            self.0.request.security_profile_group_id = v.into();
20089            self
20090        }
20091
20092        /// Sets the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
20093        ///
20094        /// This is a **required** field for requests.
20095        pub fn set_security_profile_group<T>(mut self, v: T) -> Self
20096        where
20097            T: std::convert::Into<crate::model::SecurityProfileGroup>,
20098        {
20099            self.0.request.security_profile_group = std::option::Option::Some(v.into());
20100            self
20101        }
20102
20103        /// Sets or clears the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
20104        ///
20105        /// This is a **required** field for requests.
20106        pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
20107        where
20108            T: std::convert::Into<crate::model::SecurityProfileGroup>,
20109        {
20110            self.0.request.security_profile_group = v.map(|x| x.into());
20111            self
20112        }
20113    }
20114
20115    #[doc(hidden)]
20116    impl crate::RequestBuilder for CreateSecurityProfileGroup {
20117        fn request_options(&mut self) -> &mut crate::RequestOptions {
20118            &mut self.0.options
20119        }
20120    }
20121
20122    /// The request builder for [OrganizationSecurityProfileGroupService::update_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::update_security_profile_group] calls.
20123    ///
20124    /// # Example
20125    /// ```
20126    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::UpdateSecurityProfileGroup;
20127    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20128    /// use google_cloud_lro::Poller;
20129    ///
20130    /// let builder = prepare_request_builder();
20131    /// let response = builder.poller().until_done().await?;
20132    /// # Ok(()) }
20133    ///
20134    /// fn prepare_request_builder() -> UpdateSecurityProfileGroup {
20135    ///   # panic!();
20136    ///   // ... details omitted ...
20137    /// }
20138    /// ```
20139    #[derive(Clone, Debug)]
20140    pub struct UpdateSecurityProfileGroup(
20141        RequestBuilder<crate::model::UpdateSecurityProfileGroupRequest>,
20142    );
20143
20144    impl UpdateSecurityProfileGroup {
20145        pub(crate) fn new(
20146            stub: std::sync::Arc<
20147                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20148            >,
20149        ) -> Self {
20150            Self(RequestBuilder::new(stub))
20151        }
20152
20153        /// Sets the full request, replacing any prior values.
20154        pub fn with_request<V: Into<crate::model::UpdateSecurityProfileGroupRequest>>(
20155            mut self,
20156            v: V,
20157        ) -> Self {
20158            self.0.request = v.into();
20159            self
20160        }
20161
20162        /// Sets all the options, replacing any prior values.
20163        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20164            self.0.options = v.into();
20165            self
20166        }
20167
20168        /// Sends the request.
20169        ///
20170        /// # Long running operations
20171        ///
20172        /// This starts, but does not poll, a longrunning operation. More information
20173        /// on [update_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::update_security_profile_group].
20174        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20175            (*self.0.stub)
20176                .update_security_profile_group(self.0.request, self.0.options)
20177                .await
20178                .map(crate::Response::into_body)
20179        }
20180
20181        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_security_profile_group`.
20182        pub fn poller(
20183            self,
20184        ) -> impl google_cloud_lro::Poller<
20185            crate::model::SecurityProfileGroup,
20186            crate::model::OperationMetadata,
20187        > {
20188            type Operation = google_cloud_lro::internal::Operation<
20189                crate::model::SecurityProfileGroup,
20190                crate::model::OperationMetadata,
20191            >;
20192            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20193            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20194
20195            let stub = self.0.stub.clone();
20196            let mut options = self.0.options.clone();
20197            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20198            let query = move |name| {
20199                let stub = stub.clone();
20200                let options = options.clone();
20201                async {
20202                    let op = GetOperation::new(stub)
20203                        .set_name(name)
20204                        .with_options(options)
20205                        .send()
20206                        .await?;
20207                    Ok(Operation::new(op))
20208                }
20209            };
20210
20211            let start = move || async {
20212                let op = self.send().await?;
20213                Ok(Operation::new(op))
20214            };
20215
20216            google_cloud_lro::internal::new_poller(
20217                polling_error_policy,
20218                polling_backoff_policy,
20219                start,
20220                query,
20221            )
20222        }
20223
20224        /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
20225        ///
20226        /// This is a **required** field for requests.
20227        pub fn set_update_mask<T>(mut self, v: T) -> Self
20228        where
20229            T: std::convert::Into<wkt::FieldMask>,
20230        {
20231            self.0.request.update_mask = std::option::Option::Some(v.into());
20232            self
20233        }
20234
20235        /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
20236        ///
20237        /// This is a **required** field for requests.
20238        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20239        where
20240            T: std::convert::Into<wkt::FieldMask>,
20241        {
20242            self.0.request.update_mask = v.map(|x| x.into());
20243            self
20244        }
20245
20246        /// Sets the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
20247        ///
20248        /// This is a **required** field for requests.
20249        pub fn set_security_profile_group<T>(mut self, v: T) -> Self
20250        where
20251            T: std::convert::Into<crate::model::SecurityProfileGroup>,
20252        {
20253            self.0.request.security_profile_group = std::option::Option::Some(v.into());
20254            self
20255        }
20256
20257        /// Sets or clears the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
20258        ///
20259        /// This is a **required** field for requests.
20260        pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
20261        where
20262            T: std::convert::Into<crate::model::SecurityProfileGroup>,
20263        {
20264            self.0.request.security_profile_group = v.map(|x| x.into());
20265            self
20266        }
20267    }
20268
20269    #[doc(hidden)]
20270    impl crate::RequestBuilder for UpdateSecurityProfileGroup {
20271        fn request_options(&mut self) -> &mut crate::RequestOptions {
20272            &mut self.0.options
20273        }
20274    }
20275
20276    /// The request builder for [OrganizationSecurityProfileGroupService::delete_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile_group] calls.
20277    ///
20278    /// # Example
20279    /// ```
20280    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::DeleteSecurityProfileGroup;
20281    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20282    /// use google_cloud_lro::Poller;
20283    ///
20284    /// let builder = prepare_request_builder();
20285    /// let response = builder.poller().until_done().await?;
20286    /// # Ok(()) }
20287    ///
20288    /// fn prepare_request_builder() -> DeleteSecurityProfileGroup {
20289    ///   # panic!();
20290    ///   // ... details omitted ...
20291    /// }
20292    /// ```
20293    #[derive(Clone, Debug)]
20294    pub struct DeleteSecurityProfileGroup(
20295        RequestBuilder<crate::model::DeleteSecurityProfileGroupRequest>,
20296    );
20297
20298    impl DeleteSecurityProfileGroup {
20299        pub(crate) fn new(
20300            stub: std::sync::Arc<
20301                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20302            >,
20303        ) -> Self {
20304            Self(RequestBuilder::new(stub))
20305        }
20306
20307        /// Sets the full request, replacing any prior values.
20308        pub fn with_request<V: Into<crate::model::DeleteSecurityProfileGroupRequest>>(
20309            mut self,
20310            v: V,
20311        ) -> Self {
20312            self.0.request = v.into();
20313            self
20314        }
20315
20316        /// Sets all the options, replacing any prior values.
20317        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20318            self.0.options = v.into();
20319            self
20320        }
20321
20322        /// Sends the request.
20323        ///
20324        /// # Long running operations
20325        ///
20326        /// This starts, but does not poll, a longrunning operation. More information
20327        /// on [delete_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile_group].
20328        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20329            (*self.0.stub)
20330                .delete_security_profile_group(self.0.request, self.0.options)
20331                .await
20332                .map(crate::Response::into_body)
20333        }
20334
20335        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_security_profile_group`.
20336        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
20337            type Operation =
20338                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
20339            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20340            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20341
20342            let stub = self.0.stub.clone();
20343            let mut options = self.0.options.clone();
20344            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20345            let query = move |name| {
20346                let stub = stub.clone();
20347                let options = options.clone();
20348                async {
20349                    let op = GetOperation::new(stub)
20350                        .set_name(name)
20351                        .with_options(options)
20352                        .send()
20353                        .await?;
20354                    Ok(Operation::new(op))
20355                }
20356            };
20357
20358            let start = move || async {
20359                let op = self.send().await?;
20360                Ok(Operation::new(op))
20361            };
20362
20363            google_cloud_lro::internal::new_unit_response_poller(
20364                polling_error_policy,
20365                polling_backoff_policy,
20366                start,
20367                query,
20368            )
20369        }
20370
20371        /// Sets the value of [name][crate::model::DeleteSecurityProfileGroupRequest::name].
20372        ///
20373        /// This is a **required** field for requests.
20374        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20375            self.0.request.name = v.into();
20376            self
20377        }
20378
20379        /// Sets the value of [etag][crate::model::DeleteSecurityProfileGroupRequest::etag].
20380        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
20381            self.0.request.etag = v.into();
20382            self
20383        }
20384    }
20385
20386    #[doc(hidden)]
20387    impl crate::RequestBuilder for DeleteSecurityProfileGroup {
20388        fn request_options(&mut self) -> &mut crate::RequestOptions {
20389            &mut self.0.options
20390        }
20391    }
20392
20393    /// The request builder for [OrganizationSecurityProfileGroupService::list_security_profiles][crate::client::OrganizationSecurityProfileGroupService::list_security_profiles] calls.
20394    ///
20395    /// # Example
20396    /// ```
20397    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListSecurityProfiles;
20398    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20399    /// use google_cloud_gax::paginator::ItemPaginator;
20400    ///
20401    /// let builder = prepare_request_builder();
20402    /// let mut items = builder.by_item();
20403    /// while let Some(result) = items.next().await {
20404    ///   let item = result?;
20405    /// }
20406    /// # Ok(()) }
20407    ///
20408    /// fn prepare_request_builder() -> ListSecurityProfiles {
20409    ///   # panic!();
20410    ///   // ... details omitted ...
20411    /// }
20412    /// ```
20413    #[derive(Clone, Debug)]
20414    pub struct ListSecurityProfiles(RequestBuilder<crate::model::ListSecurityProfilesRequest>);
20415
20416    impl ListSecurityProfiles {
20417        pub(crate) fn new(
20418            stub: std::sync::Arc<
20419                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20420            >,
20421        ) -> Self {
20422            Self(RequestBuilder::new(stub))
20423        }
20424
20425        /// Sets the full request, replacing any prior values.
20426        pub fn with_request<V: Into<crate::model::ListSecurityProfilesRequest>>(
20427            mut self,
20428            v: V,
20429        ) -> Self {
20430            self.0.request = v.into();
20431            self
20432        }
20433
20434        /// Sets all the options, replacing any prior values.
20435        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20436            self.0.options = v.into();
20437            self
20438        }
20439
20440        /// Sends the request.
20441        pub async fn send(self) -> Result<crate::model::ListSecurityProfilesResponse> {
20442            (*self.0.stub)
20443                .list_security_profiles(self.0.request, self.0.options)
20444                .await
20445                .map(crate::Response::into_body)
20446        }
20447
20448        /// Streams each page in the collection.
20449        pub fn by_page(
20450            self,
20451        ) -> impl google_cloud_gax::paginator::Paginator<
20452            crate::model::ListSecurityProfilesResponse,
20453            crate::Error,
20454        > {
20455            use std::clone::Clone;
20456            let token = self.0.request.page_token.clone();
20457            let execute = move |token: String| {
20458                let mut builder = self.clone();
20459                builder.0.request = builder.0.request.set_page_token(token);
20460                builder.send()
20461            };
20462            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20463        }
20464
20465        /// Streams each item in the collection.
20466        pub fn by_item(
20467            self,
20468        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20469            crate::model::ListSecurityProfilesResponse,
20470            crate::Error,
20471        > {
20472            use google_cloud_gax::paginator::Paginator;
20473            self.by_page().items()
20474        }
20475
20476        /// Sets the value of [parent][crate::model::ListSecurityProfilesRequest::parent].
20477        ///
20478        /// This is a **required** field for requests.
20479        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20480            self.0.request.parent = v.into();
20481            self
20482        }
20483
20484        /// Sets the value of [page_size][crate::model::ListSecurityProfilesRequest::page_size].
20485        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20486            self.0.request.page_size = v.into();
20487            self
20488        }
20489
20490        /// Sets the value of [page_token][crate::model::ListSecurityProfilesRequest::page_token].
20491        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20492            self.0.request.page_token = v.into();
20493            self
20494        }
20495    }
20496
20497    #[doc(hidden)]
20498    impl crate::RequestBuilder for ListSecurityProfiles {
20499        fn request_options(&mut self) -> &mut crate::RequestOptions {
20500            &mut self.0.options
20501        }
20502    }
20503
20504    /// The request builder for [OrganizationSecurityProfileGroupService::get_security_profile][crate::client::OrganizationSecurityProfileGroupService::get_security_profile] calls.
20505    ///
20506    /// # Example
20507    /// ```
20508    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetSecurityProfile;
20509    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20510    ///
20511    /// let builder = prepare_request_builder();
20512    /// let response = builder.send().await?;
20513    /// # Ok(()) }
20514    ///
20515    /// fn prepare_request_builder() -> GetSecurityProfile {
20516    ///   # panic!();
20517    ///   // ... details omitted ...
20518    /// }
20519    /// ```
20520    #[derive(Clone, Debug)]
20521    pub struct GetSecurityProfile(RequestBuilder<crate::model::GetSecurityProfileRequest>);
20522
20523    impl GetSecurityProfile {
20524        pub(crate) fn new(
20525            stub: std::sync::Arc<
20526                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20527            >,
20528        ) -> Self {
20529            Self(RequestBuilder::new(stub))
20530        }
20531
20532        /// Sets the full request, replacing any prior values.
20533        pub fn with_request<V: Into<crate::model::GetSecurityProfileRequest>>(
20534            mut self,
20535            v: V,
20536        ) -> Self {
20537            self.0.request = v.into();
20538            self
20539        }
20540
20541        /// Sets all the options, replacing any prior values.
20542        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20543            self.0.options = v.into();
20544            self
20545        }
20546
20547        /// Sends the request.
20548        pub async fn send(self) -> Result<crate::model::SecurityProfile> {
20549            (*self.0.stub)
20550                .get_security_profile(self.0.request, self.0.options)
20551                .await
20552                .map(crate::Response::into_body)
20553        }
20554
20555        /// Sets the value of [name][crate::model::GetSecurityProfileRequest::name].
20556        ///
20557        /// This is a **required** field for requests.
20558        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20559            self.0.request.name = v.into();
20560            self
20561        }
20562    }
20563
20564    #[doc(hidden)]
20565    impl crate::RequestBuilder for GetSecurityProfile {
20566        fn request_options(&mut self) -> &mut crate::RequestOptions {
20567            &mut self.0.options
20568        }
20569    }
20570
20571    /// The request builder for [OrganizationSecurityProfileGroupService::create_security_profile][crate::client::OrganizationSecurityProfileGroupService::create_security_profile] calls.
20572    ///
20573    /// # Example
20574    /// ```
20575    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::CreateSecurityProfile;
20576    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20577    /// use google_cloud_lro::Poller;
20578    ///
20579    /// let builder = prepare_request_builder();
20580    /// let response = builder.poller().until_done().await?;
20581    /// # Ok(()) }
20582    ///
20583    /// fn prepare_request_builder() -> CreateSecurityProfile {
20584    ///   # panic!();
20585    ///   // ... details omitted ...
20586    /// }
20587    /// ```
20588    #[derive(Clone, Debug)]
20589    pub struct CreateSecurityProfile(RequestBuilder<crate::model::CreateSecurityProfileRequest>);
20590
20591    impl CreateSecurityProfile {
20592        pub(crate) fn new(
20593            stub: std::sync::Arc<
20594                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20595            >,
20596        ) -> Self {
20597            Self(RequestBuilder::new(stub))
20598        }
20599
20600        /// Sets the full request, replacing any prior values.
20601        pub fn with_request<V: Into<crate::model::CreateSecurityProfileRequest>>(
20602            mut self,
20603            v: V,
20604        ) -> Self {
20605            self.0.request = v.into();
20606            self
20607        }
20608
20609        /// Sets all the options, replacing any prior values.
20610        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20611            self.0.options = v.into();
20612            self
20613        }
20614
20615        /// Sends the request.
20616        ///
20617        /// # Long running operations
20618        ///
20619        /// This starts, but does not poll, a longrunning operation. More information
20620        /// on [create_security_profile][crate::client::OrganizationSecurityProfileGroupService::create_security_profile].
20621        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20622            (*self.0.stub)
20623                .create_security_profile(self.0.request, self.0.options)
20624                .await
20625                .map(crate::Response::into_body)
20626        }
20627
20628        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_security_profile`.
20629        pub fn poller(
20630            self,
20631        ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
20632        {
20633            type Operation = google_cloud_lro::internal::Operation<
20634                crate::model::SecurityProfile,
20635                crate::model::OperationMetadata,
20636            >;
20637            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20638            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20639
20640            let stub = self.0.stub.clone();
20641            let mut options = self.0.options.clone();
20642            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20643            let query = move |name| {
20644                let stub = stub.clone();
20645                let options = options.clone();
20646                async {
20647                    let op = GetOperation::new(stub)
20648                        .set_name(name)
20649                        .with_options(options)
20650                        .send()
20651                        .await?;
20652                    Ok(Operation::new(op))
20653                }
20654            };
20655
20656            let start = move || async {
20657                let op = self.send().await?;
20658                Ok(Operation::new(op))
20659            };
20660
20661            google_cloud_lro::internal::new_poller(
20662                polling_error_policy,
20663                polling_backoff_policy,
20664                start,
20665                query,
20666            )
20667        }
20668
20669        /// Sets the value of [parent][crate::model::CreateSecurityProfileRequest::parent].
20670        ///
20671        /// This is a **required** field for requests.
20672        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20673            self.0.request.parent = v.into();
20674            self
20675        }
20676
20677        /// Sets the value of [security_profile_id][crate::model::CreateSecurityProfileRequest::security_profile_id].
20678        ///
20679        /// This is a **required** field for requests.
20680        pub fn set_security_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
20681            self.0.request.security_profile_id = v.into();
20682            self
20683        }
20684
20685        /// Sets the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
20686        ///
20687        /// This is a **required** field for requests.
20688        pub fn set_security_profile<T>(mut self, v: T) -> Self
20689        where
20690            T: std::convert::Into<crate::model::SecurityProfile>,
20691        {
20692            self.0.request.security_profile = std::option::Option::Some(v.into());
20693            self
20694        }
20695
20696        /// Sets or clears the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
20697        ///
20698        /// This is a **required** field for requests.
20699        pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
20700        where
20701            T: std::convert::Into<crate::model::SecurityProfile>,
20702        {
20703            self.0.request.security_profile = v.map(|x| x.into());
20704            self
20705        }
20706    }
20707
20708    #[doc(hidden)]
20709    impl crate::RequestBuilder for CreateSecurityProfile {
20710        fn request_options(&mut self) -> &mut crate::RequestOptions {
20711            &mut self.0.options
20712        }
20713    }
20714
20715    /// The request builder for [OrganizationSecurityProfileGroupService::update_security_profile][crate::client::OrganizationSecurityProfileGroupService::update_security_profile] calls.
20716    ///
20717    /// # Example
20718    /// ```
20719    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::UpdateSecurityProfile;
20720    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20721    /// use google_cloud_lro::Poller;
20722    ///
20723    /// let builder = prepare_request_builder();
20724    /// let response = builder.poller().until_done().await?;
20725    /// # Ok(()) }
20726    ///
20727    /// fn prepare_request_builder() -> UpdateSecurityProfile {
20728    ///   # panic!();
20729    ///   // ... details omitted ...
20730    /// }
20731    /// ```
20732    #[derive(Clone, Debug)]
20733    pub struct UpdateSecurityProfile(RequestBuilder<crate::model::UpdateSecurityProfileRequest>);
20734
20735    impl UpdateSecurityProfile {
20736        pub(crate) fn new(
20737            stub: std::sync::Arc<
20738                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20739            >,
20740        ) -> Self {
20741            Self(RequestBuilder::new(stub))
20742        }
20743
20744        /// Sets the full request, replacing any prior values.
20745        pub fn with_request<V: Into<crate::model::UpdateSecurityProfileRequest>>(
20746            mut self,
20747            v: V,
20748        ) -> Self {
20749            self.0.request = v.into();
20750            self
20751        }
20752
20753        /// Sets all the options, replacing any prior values.
20754        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20755            self.0.options = v.into();
20756            self
20757        }
20758
20759        /// Sends the request.
20760        ///
20761        /// # Long running operations
20762        ///
20763        /// This starts, but does not poll, a longrunning operation. More information
20764        /// on [update_security_profile][crate::client::OrganizationSecurityProfileGroupService::update_security_profile].
20765        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20766            (*self.0.stub)
20767                .update_security_profile(self.0.request, self.0.options)
20768                .await
20769                .map(crate::Response::into_body)
20770        }
20771
20772        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_security_profile`.
20773        pub fn poller(
20774            self,
20775        ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
20776        {
20777            type Operation = google_cloud_lro::internal::Operation<
20778                crate::model::SecurityProfile,
20779                crate::model::OperationMetadata,
20780            >;
20781            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20782            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20783
20784            let stub = self.0.stub.clone();
20785            let mut options = self.0.options.clone();
20786            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20787            let query = move |name| {
20788                let stub = stub.clone();
20789                let options = options.clone();
20790                async {
20791                    let op = GetOperation::new(stub)
20792                        .set_name(name)
20793                        .with_options(options)
20794                        .send()
20795                        .await?;
20796                    Ok(Operation::new(op))
20797                }
20798            };
20799
20800            let start = move || async {
20801                let op = self.send().await?;
20802                Ok(Operation::new(op))
20803            };
20804
20805            google_cloud_lro::internal::new_poller(
20806                polling_error_policy,
20807                polling_backoff_policy,
20808                start,
20809                query,
20810            )
20811        }
20812
20813        /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
20814        ///
20815        /// This is a **required** field for requests.
20816        pub fn set_update_mask<T>(mut self, v: T) -> Self
20817        where
20818            T: std::convert::Into<wkt::FieldMask>,
20819        {
20820            self.0.request.update_mask = std::option::Option::Some(v.into());
20821            self
20822        }
20823
20824        /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
20825        ///
20826        /// This is a **required** field for requests.
20827        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20828        where
20829            T: std::convert::Into<wkt::FieldMask>,
20830        {
20831            self.0.request.update_mask = v.map(|x| x.into());
20832            self
20833        }
20834
20835        /// Sets the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
20836        ///
20837        /// This is a **required** field for requests.
20838        pub fn set_security_profile<T>(mut self, v: T) -> Self
20839        where
20840            T: std::convert::Into<crate::model::SecurityProfile>,
20841        {
20842            self.0.request.security_profile = std::option::Option::Some(v.into());
20843            self
20844        }
20845
20846        /// Sets or clears the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
20847        ///
20848        /// This is a **required** field for requests.
20849        pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
20850        where
20851            T: std::convert::Into<crate::model::SecurityProfile>,
20852        {
20853            self.0.request.security_profile = v.map(|x| x.into());
20854            self
20855        }
20856    }
20857
20858    #[doc(hidden)]
20859    impl crate::RequestBuilder for UpdateSecurityProfile {
20860        fn request_options(&mut self) -> &mut crate::RequestOptions {
20861            &mut self.0.options
20862        }
20863    }
20864
20865    /// The request builder for [OrganizationSecurityProfileGroupService::delete_security_profile][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile] calls.
20866    ///
20867    /// # Example
20868    /// ```
20869    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::DeleteSecurityProfile;
20870    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20871    /// use google_cloud_lro::Poller;
20872    ///
20873    /// let builder = prepare_request_builder();
20874    /// let response = builder.poller().until_done().await?;
20875    /// # Ok(()) }
20876    ///
20877    /// fn prepare_request_builder() -> DeleteSecurityProfile {
20878    ///   # panic!();
20879    ///   // ... details omitted ...
20880    /// }
20881    /// ```
20882    #[derive(Clone, Debug)]
20883    pub struct DeleteSecurityProfile(RequestBuilder<crate::model::DeleteSecurityProfileRequest>);
20884
20885    impl DeleteSecurityProfile {
20886        pub(crate) fn new(
20887            stub: std::sync::Arc<
20888                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20889            >,
20890        ) -> Self {
20891            Self(RequestBuilder::new(stub))
20892        }
20893
20894        /// Sets the full request, replacing any prior values.
20895        pub fn with_request<V: Into<crate::model::DeleteSecurityProfileRequest>>(
20896            mut self,
20897            v: V,
20898        ) -> Self {
20899            self.0.request = v.into();
20900            self
20901        }
20902
20903        /// Sets all the options, replacing any prior values.
20904        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20905            self.0.options = v.into();
20906            self
20907        }
20908
20909        /// Sends the request.
20910        ///
20911        /// # Long running operations
20912        ///
20913        /// This starts, but does not poll, a longrunning operation. More information
20914        /// on [delete_security_profile][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile].
20915        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20916            (*self.0.stub)
20917                .delete_security_profile(self.0.request, self.0.options)
20918                .await
20919                .map(crate::Response::into_body)
20920        }
20921
20922        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_security_profile`.
20923        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
20924            type Operation =
20925                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
20926            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20927            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20928
20929            let stub = self.0.stub.clone();
20930            let mut options = self.0.options.clone();
20931            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20932            let query = move |name| {
20933                let stub = stub.clone();
20934                let options = options.clone();
20935                async {
20936                    let op = GetOperation::new(stub)
20937                        .set_name(name)
20938                        .with_options(options)
20939                        .send()
20940                        .await?;
20941                    Ok(Operation::new(op))
20942                }
20943            };
20944
20945            let start = move || async {
20946                let op = self.send().await?;
20947                Ok(Operation::new(op))
20948            };
20949
20950            google_cloud_lro::internal::new_unit_response_poller(
20951                polling_error_policy,
20952                polling_backoff_policy,
20953                start,
20954                query,
20955            )
20956        }
20957
20958        /// Sets the value of [name][crate::model::DeleteSecurityProfileRequest::name].
20959        ///
20960        /// This is a **required** field for requests.
20961        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20962            self.0.request.name = v.into();
20963            self
20964        }
20965
20966        /// Sets the value of [etag][crate::model::DeleteSecurityProfileRequest::etag].
20967        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
20968            self.0.request.etag = v.into();
20969            self
20970        }
20971    }
20972
20973    #[doc(hidden)]
20974    impl crate::RequestBuilder for DeleteSecurityProfile {
20975        fn request_options(&mut self) -> &mut crate::RequestOptions {
20976            &mut self.0.options
20977        }
20978    }
20979
20980    /// The request builder for [OrganizationSecurityProfileGroupService::list_locations][crate::client::OrganizationSecurityProfileGroupService::list_locations] calls.
20981    ///
20982    /// # Example
20983    /// ```
20984    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListLocations;
20985    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20986    /// use google_cloud_gax::paginator::ItemPaginator;
20987    ///
20988    /// let builder = prepare_request_builder();
20989    /// let mut items = builder.by_item();
20990    /// while let Some(result) = items.next().await {
20991    ///   let item = result?;
20992    /// }
20993    /// # Ok(()) }
20994    ///
20995    /// fn prepare_request_builder() -> ListLocations {
20996    ///   # panic!();
20997    ///   // ... details omitted ...
20998    /// }
20999    /// ```
21000    #[derive(Clone, Debug)]
21001    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
21002
21003    impl ListLocations {
21004        pub(crate) fn new(
21005            stub: std::sync::Arc<
21006                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21007            >,
21008        ) -> Self {
21009            Self(RequestBuilder::new(stub))
21010        }
21011
21012        /// Sets the full request, replacing any prior values.
21013        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
21014            mut self,
21015            v: V,
21016        ) -> Self {
21017            self.0.request = v.into();
21018            self
21019        }
21020
21021        /// Sets all the options, replacing any prior values.
21022        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21023            self.0.options = v.into();
21024            self
21025        }
21026
21027        /// Sends the request.
21028        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
21029            (*self.0.stub)
21030                .list_locations(self.0.request, self.0.options)
21031                .await
21032                .map(crate::Response::into_body)
21033        }
21034
21035        /// Streams each page in the collection.
21036        pub fn by_page(
21037            self,
21038        ) -> impl google_cloud_gax::paginator::Paginator<
21039            google_cloud_location::model::ListLocationsResponse,
21040            crate::Error,
21041        > {
21042            use std::clone::Clone;
21043            let token = self.0.request.page_token.clone();
21044            let execute = move |token: String| {
21045                let mut builder = self.clone();
21046                builder.0.request = builder.0.request.set_page_token(token);
21047                builder.send()
21048            };
21049            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21050        }
21051
21052        /// Streams each item in the collection.
21053        pub fn by_item(
21054            self,
21055        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21056            google_cloud_location::model::ListLocationsResponse,
21057            crate::Error,
21058        > {
21059            use google_cloud_gax::paginator::Paginator;
21060            self.by_page().items()
21061        }
21062
21063        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
21064        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21065            self.0.request.name = v.into();
21066            self
21067        }
21068
21069        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
21070        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21071            self.0.request.filter = v.into();
21072            self
21073        }
21074
21075        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
21076        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21077            self.0.request.page_size = v.into();
21078            self
21079        }
21080
21081        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
21082        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21083            self.0.request.page_token = v.into();
21084            self
21085        }
21086    }
21087
21088    #[doc(hidden)]
21089    impl crate::RequestBuilder for ListLocations {
21090        fn request_options(&mut self) -> &mut crate::RequestOptions {
21091            &mut self.0.options
21092        }
21093    }
21094
21095    /// The request builder for [OrganizationSecurityProfileGroupService::get_location][crate::client::OrganizationSecurityProfileGroupService::get_location] calls.
21096    ///
21097    /// # Example
21098    /// ```
21099    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetLocation;
21100    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21101    ///
21102    /// let builder = prepare_request_builder();
21103    /// let response = builder.send().await?;
21104    /// # Ok(()) }
21105    ///
21106    /// fn prepare_request_builder() -> GetLocation {
21107    ///   # panic!();
21108    ///   // ... details omitted ...
21109    /// }
21110    /// ```
21111    #[derive(Clone, Debug)]
21112    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
21113
21114    impl GetLocation {
21115        pub(crate) fn new(
21116            stub: std::sync::Arc<
21117                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21118            >,
21119        ) -> Self {
21120            Self(RequestBuilder::new(stub))
21121        }
21122
21123        /// Sets the full request, replacing any prior values.
21124        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
21125            mut self,
21126            v: V,
21127        ) -> Self {
21128            self.0.request = v.into();
21129            self
21130        }
21131
21132        /// Sets all the options, replacing any prior values.
21133        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21134            self.0.options = v.into();
21135            self
21136        }
21137
21138        /// Sends the request.
21139        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
21140            (*self.0.stub)
21141                .get_location(self.0.request, self.0.options)
21142                .await
21143                .map(crate::Response::into_body)
21144        }
21145
21146        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
21147        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21148            self.0.request.name = v.into();
21149            self
21150        }
21151    }
21152
21153    #[doc(hidden)]
21154    impl crate::RequestBuilder for GetLocation {
21155        fn request_options(&mut self) -> &mut crate::RequestOptions {
21156            &mut self.0.options
21157        }
21158    }
21159
21160    /// The request builder for [OrganizationSecurityProfileGroupService::set_iam_policy][crate::client::OrganizationSecurityProfileGroupService::set_iam_policy] calls.
21161    ///
21162    /// # Example
21163    /// ```
21164    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::SetIamPolicy;
21165    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21166    ///
21167    /// let builder = prepare_request_builder();
21168    /// let response = builder.send().await?;
21169    /// # Ok(()) }
21170    ///
21171    /// fn prepare_request_builder() -> SetIamPolicy {
21172    ///   # panic!();
21173    ///   // ... details omitted ...
21174    /// }
21175    /// ```
21176    #[derive(Clone, Debug)]
21177    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
21178
21179    impl SetIamPolicy {
21180        pub(crate) fn new(
21181            stub: std::sync::Arc<
21182                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21183            >,
21184        ) -> Self {
21185            Self(RequestBuilder::new(stub))
21186        }
21187
21188        /// Sets the full request, replacing any prior values.
21189        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
21190            mut self,
21191            v: V,
21192        ) -> Self {
21193            self.0.request = v.into();
21194            self
21195        }
21196
21197        /// Sets all the options, replacing any prior values.
21198        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21199            self.0.options = v.into();
21200            self
21201        }
21202
21203        /// Sends the request.
21204        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
21205            (*self.0.stub)
21206                .set_iam_policy(self.0.request, self.0.options)
21207                .await
21208                .map(crate::Response::into_body)
21209        }
21210
21211        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
21212        ///
21213        /// This is a **required** field for requests.
21214        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21215            self.0.request.resource = v.into();
21216            self
21217        }
21218
21219        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
21220        ///
21221        /// This is a **required** field for requests.
21222        pub fn set_policy<T>(mut self, v: T) -> Self
21223        where
21224            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
21225        {
21226            self.0.request.policy = std::option::Option::Some(v.into());
21227            self
21228        }
21229
21230        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
21231        ///
21232        /// This is a **required** field for requests.
21233        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
21234        where
21235            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
21236        {
21237            self.0.request.policy = v.map(|x| x.into());
21238            self
21239        }
21240
21241        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
21242        pub fn set_update_mask<T>(mut self, v: T) -> Self
21243        where
21244            T: std::convert::Into<wkt::FieldMask>,
21245        {
21246            self.0.request.update_mask = std::option::Option::Some(v.into());
21247            self
21248        }
21249
21250        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
21251        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21252        where
21253            T: std::convert::Into<wkt::FieldMask>,
21254        {
21255            self.0.request.update_mask = v.map(|x| x.into());
21256            self
21257        }
21258    }
21259
21260    #[doc(hidden)]
21261    impl crate::RequestBuilder for SetIamPolicy {
21262        fn request_options(&mut self) -> &mut crate::RequestOptions {
21263            &mut self.0.options
21264        }
21265    }
21266
21267    /// The request builder for [OrganizationSecurityProfileGroupService::get_iam_policy][crate::client::OrganizationSecurityProfileGroupService::get_iam_policy] calls.
21268    ///
21269    /// # Example
21270    /// ```
21271    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetIamPolicy;
21272    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21273    ///
21274    /// let builder = prepare_request_builder();
21275    /// let response = builder.send().await?;
21276    /// # Ok(()) }
21277    ///
21278    /// fn prepare_request_builder() -> GetIamPolicy {
21279    ///   # panic!();
21280    ///   // ... details omitted ...
21281    /// }
21282    /// ```
21283    #[derive(Clone, Debug)]
21284    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
21285
21286    impl GetIamPolicy {
21287        pub(crate) fn new(
21288            stub: std::sync::Arc<
21289                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21290            >,
21291        ) -> Self {
21292            Self(RequestBuilder::new(stub))
21293        }
21294
21295        /// Sets the full request, replacing any prior values.
21296        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
21297            mut self,
21298            v: V,
21299        ) -> Self {
21300            self.0.request = v.into();
21301            self
21302        }
21303
21304        /// Sets all the options, replacing any prior values.
21305        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21306            self.0.options = v.into();
21307            self
21308        }
21309
21310        /// Sends the request.
21311        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
21312            (*self.0.stub)
21313                .get_iam_policy(self.0.request, self.0.options)
21314                .await
21315                .map(crate::Response::into_body)
21316        }
21317
21318        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
21319        ///
21320        /// This is a **required** field for requests.
21321        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21322            self.0.request.resource = v.into();
21323            self
21324        }
21325
21326        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
21327        pub fn set_options<T>(mut self, v: T) -> Self
21328        where
21329            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
21330        {
21331            self.0.request.options = std::option::Option::Some(v.into());
21332            self
21333        }
21334
21335        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
21336        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
21337        where
21338            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
21339        {
21340            self.0.request.options = v.map(|x| x.into());
21341            self
21342        }
21343    }
21344
21345    #[doc(hidden)]
21346    impl crate::RequestBuilder for GetIamPolicy {
21347        fn request_options(&mut self) -> &mut crate::RequestOptions {
21348            &mut self.0.options
21349        }
21350    }
21351
21352    /// The request builder for [OrganizationSecurityProfileGroupService::test_iam_permissions][crate::client::OrganizationSecurityProfileGroupService::test_iam_permissions] calls.
21353    ///
21354    /// # Example
21355    /// ```
21356    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::TestIamPermissions;
21357    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21358    ///
21359    /// let builder = prepare_request_builder();
21360    /// let response = builder.send().await?;
21361    /// # Ok(()) }
21362    ///
21363    /// fn prepare_request_builder() -> TestIamPermissions {
21364    ///   # panic!();
21365    ///   // ... details omitted ...
21366    /// }
21367    /// ```
21368    #[derive(Clone, Debug)]
21369    pub struct TestIamPermissions(
21370        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
21371    );
21372
21373    impl TestIamPermissions {
21374        pub(crate) fn new(
21375            stub: std::sync::Arc<
21376                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21377            >,
21378        ) -> Self {
21379            Self(RequestBuilder::new(stub))
21380        }
21381
21382        /// Sets the full request, replacing any prior values.
21383        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
21384            mut self,
21385            v: V,
21386        ) -> Self {
21387            self.0.request = v.into();
21388            self
21389        }
21390
21391        /// Sets all the options, replacing any prior values.
21392        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21393            self.0.options = v.into();
21394            self
21395        }
21396
21397        /// Sends the request.
21398        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
21399            (*self.0.stub)
21400                .test_iam_permissions(self.0.request, self.0.options)
21401                .await
21402                .map(crate::Response::into_body)
21403        }
21404
21405        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
21406        ///
21407        /// This is a **required** field for requests.
21408        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21409            self.0.request.resource = v.into();
21410            self
21411        }
21412
21413        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
21414        ///
21415        /// This is a **required** field for requests.
21416        pub fn set_permissions<T, V>(mut self, v: T) -> Self
21417        where
21418            T: std::iter::IntoIterator<Item = V>,
21419            V: std::convert::Into<std::string::String>,
21420        {
21421            use std::iter::Iterator;
21422            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
21423            self
21424        }
21425    }
21426
21427    #[doc(hidden)]
21428    impl crate::RequestBuilder for TestIamPermissions {
21429        fn request_options(&mut self) -> &mut crate::RequestOptions {
21430            &mut self.0.options
21431        }
21432    }
21433
21434    /// The request builder for [OrganizationSecurityProfileGroupService::list_operations][crate::client::OrganizationSecurityProfileGroupService::list_operations] calls.
21435    ///
21436    /// # Example
21437    /// ```
21438    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListOperations;
21439    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21440    /// use google_cloud_gax::paginator::ItemPaginator;
21441    ///
21442    /// let builder = prepare_request_builder();
21443    /// let mut items = builder.by_item();
21444    /// while let Some(result) = items.next().await {
21445    ///   let item = result?;
21446    /// }
21447    /// # Ok(()) }
21448    ///
21449    /// fn prepare_request_builder() -> ListOperations {
21450    ///   # panic!();
21451    ///   // ... details omitted ...
21452    /// }
21453    /// ```
21454    #[derive(Clone, Debug)]
21455    pub struct ListOperations(
21456        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
21457    );
21458
21459    impl ListOperations {
21460        pub(crate) fn new(
21461            stub: std::sync::Arc<
21462                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21463            >,
21464        ) -> Self {
21465            Self(RequestBuilder::new(stub))
21466        }
21467
21468        /// Sets the full request, replacing any prior values.
21469        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
21470            mut self,
21471            v: V,
21472        ) -> Self {
21473            self.0.request = v.into();
21474            self
21475        }
21476
21477        /// Sets all the options, replacing any prior values.
21478        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21479            self.0.options = v.into();
21480            self
21481        }
21482
21483        /// Sends the request.
21484        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
21485            (*self.0.stub)
21486                .list_operations(self.0.request, self.0.options)
21487                .await
21488                .map(crate::Response::into_body)
21489        }
21490
21491        /// Streams each page in the collection.
21492        pub fn by_page(
21493            self,
21494        ) -> impl google_cloud_gax::paginator::Paginator<
21495            google_cloud_longrunning::model::ListOperationsResponse,
21496            crate::Error,
21497        > {
21498            use std::clone::Clone;
21499            let token = self.0.request.page_token.clone();
21500            let execute = move |token: String| {
21501                let mut builder = self.clone();
21502                builder.0.request = builder.0.request.set_page_token(token);
21503                builder.send()
21504            };
21505            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21506        }
21507
21508        /// Streams each item in the collection.
21509        pub fn by_item(
21510            self,
21511        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21512            google_cloud_longrunning::model::ListOperationsResponse,
21513            crate::Error,
21514        > {
21515            use google_cloud_gax::paginator::Paginator;
21516            self.by_page().items()
21517        }
21518
21519        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
21520        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21521            self.0.request.name = v.into();
21522            self
21523        }
21524
21525        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
21526        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21527            self.0.request.filter = v.into();
21528            self
21529        }
21530
21531        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
21532        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21533            self.0.request.page_size = v.into();
21534            self
21535        }
21536
21537        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
21538        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21539            self.0.request.page_token = v.into();
21540            self
21541        }
21542
21543        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
21544        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21545            self.0.request.return_partial_success = v.into();
21546            self
21547        }
21548    }
21549
21550    #[doc(hidden)]
21551    impl crate::RequestBuilder for ListOperations {
21552        fn request_options(&mut self) -> &mut crate::RequestOptions {
21553            &mut self.0.options
21554        }
21555    }
21556
21557    /// The request builder for [OrganizationSecurityProfileGroupService::get_operation][crate::client::OrganizationSecurityProfileGroupService::get_operation] calls.
21558    ///
21559    /// # Example
21560    /// ```
21561    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetOperation;
21562    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21563    ///
21564    /// let builder = prepare_request_builder();
21565    /// let response = builder.send().await?;
21566    /// # Ok(()) }
21567    ///
21568    /// fn prepare_request_builder() -> GetOperation {
21569    ///   # panic!();
21570    ///   // ... details omitted ...
21571    /// }
21572    /// ```
21573    #[derive(Clone, Debug)]
21574    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
21575
21576    impl GetOperation {
21577        pub(crate) fn new(
21578            stub: std::sync::Arc<
21579                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21580            >,
21581        ) -> Self {
21582            Self(RequestBuilder::new(stub))
21583        }
21584
21585        /// Sets the full request, replacing any prior values.
21586        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
21587            mut self,
21588            v: V,
21589        ) -> Self {
21590            self.0.request = v.into();
21591            self
21592        }
21593
21594        /// Sets all the options, replacing any prior values.
21595        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21596            self.0.options = v.into();
21597            self
21598        }
21599
21600        /// Sends the request.
21601        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21602            (*self.0.stub)
21603                .get_operation(self.0.request, self.0.options)
21604                .await
21605                .map(crate::Response::into_body)
21606        }
21607
21608        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
21609        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21610            self.0.request.name = v.into();
21611            self
21612        }
21613    }
21614
21615    #[doc(hidden)]
21616    impl crate::RequestBuilder for GetOperation {
21617        fn request_options(&mut self) -> &mut crate::RequestOptions {
21618            &mut self.0.options
21619        }
21620    }
21621
21622    /// The request builder for [OrganizationSecurityProfileGroupService::delete_operation][crate::client::OrganizationSecurityProfileGroupService::delete_operation] calls.
21623    ///
21624    /// # Example
21625    /// ```
21626    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::DeleteOperation;
21627    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21628    ///
21629    /// let builder = prepare_request_builder();
21630    /// let response = builder.send().await?;
21631    /// # Ok(()) }
21632    ///
21633    /// fn prepare_request_builder() -> DeleteOperation {
21634    ///   # panic!();
21635    ///   // ... details omitted ...
21636    /// }
21637    /// ```
21638    #[derive(Clone, Debug)]
21639    pub struct DeleteOperation(
21640        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
21641    );
21642
21643    impl DeleteOperation {
21644        pub(crate) fn new(
21645            stub: std::sync::Arc<
21646                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21647            >,
21648        ) -> Self {
21649            Self(RequestBuilder::new(stub))
21650        }
21651
21652        /// Sets the full request, replacing any prior values.
21653        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
21654            mut self,
21655            v: V,
21656        ) -> Self {
21657            self.0.request = v.into();
21658            self
21659        }
21660
21661        /// Sets all the options, replacing any prior values.
21662        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21663            self.0.options = v.into();
21664            self
21665        }
21666
21667        /// Sends the request.
21668        pub async fn send(self) -> Result<()> {
21669            (*self.0.stub)
21670                .delete_operation(self.0.request, self.0.options)
21671                .await
21672                .map(crate::Response::into_body)
21673        }
21674
21675        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
21676        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21677            self.0.request.name = v.into();
21678            self
21679        }
21680    }
21681
21682    #[doc(hidden)]
21683    impl crate::RequestBuilder for DeleteOperation {
21684        fn request_options(&mut self) -> &mut crate::RequestOptions {
21685            &mut self.0.options
21686        }
21687    }
21688
21689    /// The request builder for [OrganizationSecurityProfileGroupService::cancel_operation][crate::client::OrganizationSecurityProfileGroupService::cancel_operation] calls.
21690    ///
21691    /// # Example
21692    /// ```
21693    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::CancelOperation;
21694    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21695    ///
21696    /// let builder = prepare_request_builder();
21697    /// let response = builder.send().await?;
21698    /// # Ok(()) }
21699    ///
21700    /// fn prepare_request_builder() -> CancelOperation {
21701    ///   # panic!();
21702    ///   // ... details omitted ...
21703    /// }
21704    /// ```
21705    #[derive(Clone, Debug)]
21706    pub struct CancelOperation(
21707        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
21708    );
21709
21710    impl CancelOperation {
21711        pub(crate) fn new(
21712            stub: std::sync::Arc<
21713                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21714            >,
21715        ) -> Self {
21716            Self(RequestBuilder::new(stub))
21717        }
21718
21719        /// Sets the full request, replacing any prior values.
21720        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
21721            mut self,
21722            v: V,
21723        ) -> Self {
21724            self.0.request = v.into();
21725            self
21726        }
21727
21728        /// Sets all the options, replacing any prior values.
21729        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21730            self.0.options = v.into();
21731            self
21732        }
21733
21734        /// Sends the request.
21735        pub async fn send(self) -> Result<()> {
21736            (*self.0.stub)
21737                .cancel_operation(self.0.request, self.0.options)
21738                .await
21739                .map(crate::Response::into_body)
21740        }
21741
21742        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
21743        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21744            self.0.request.name = v.into();
21745            self
21746        }
21747    }
21748
21749    #[doc(hidden)]
21750    impl crate::RequestBuilder for CancelOperation {
21751        fn request_options(&mut self) -> &mut crate::RequestOptions {
21752            &mut self.0.options
21753        }
21754    }
21755}