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
17pub mod address_group_service {
18    use crate::Result;
19
20    /// A builder for [AddressGroupService][crate::client::AddressGroupService].
21    ///
22    /// ```
23    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
24    /// # use google_cloud_networksecurity_v1::*;
25    /// # use builder::address_group_service::ClientBuilder;
26    /// # use client::AddressGroupService;
27    /// let builder : ClientBuilder = AddressGroupService::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://networksecurity.googleapis.com")
30    ///     .build().await?;
31    /// # Ok(()) }
32    /// ```
33    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35    pub(crate) mod client {
36        use super::super::super::client::AddressGroupService;
37        pub struct Factory;
38        impl crate::ClientFactory for Factory {
39            type Client = AddressGroupService;
40            type Credentials = gaxi::options::Credentials;
41            async fn build(
42                self,
43                config: gaxi::options::ClientConfig,
44            ) -> crate::ClientBuilderResult<Self::Client> {
45                Self::Client::new(config).await
46            }
47        }
48    }
49
50    /// Common implementation for [crate::client::AddressGroupService] request builders.
51    #[derive(Clone, Debug)]
52    pub(crate) struct RequestBuilder<R: std::default::Default> {
53        stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
54        request: R,
55        options: crate::RequestOptions,
56    }
57
58    impl<R> RequestBuilder<R>
59    where
60        R: std::default::Default,
61    {
62        pub(crate) fn new(
63            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
64        ) -> Self {
65            Self {
66                stub,
67                request: R::default(),
68                options: crate::RequestOptions::default(),
69            }
70        }
71    }
72
73    /// The request builder for [AddressGroupService::list_address_groups][crate::client::AddressGroupService::list_address_groups] calls.
74    ///
75    /// # Example
76    /// ```
77    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListAddressGroups;
78    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
79    /// use google_cloud_gax::paginator::ItemPaginator;
80    ///
81    /// let builder = prepare_request_builder();
82    /// let mut items = builder.by_item();
83    /// while let Some(result) = items.next().await {
84    ///   let item = result?;
85    /// }
86    /// # Ok(()) }
87    ///
88    /// fn prepare_request_builder() -> ListAddressGroups {
89    ///   # panic!();
90    ///   // ... details omitted ...
91    /// }
92    /// ```
93    #[derive(Clone, Debug)]
94    pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
95
96    impl ListAddressGroups {
97        pub(crate) fn new(
98            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
99        ) -> Self {
100            Self(RequestBuilder::new(stub))
101        }
102
103        /// Sets the full request, replacing any prior values.
104        pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
105            mut self,
106            v: V,
107        ) -> Self {
108            self.0.request = v.into();
109            self
110        }
111
112        /// Sets all the options, replacing any prior values.
113        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
114            self.0.options = v.into();
115            self
116        }
117
118        /// Sends the request.
119        pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
120            (*self.0.stub)
121                .list_address_groups(self.0.request, self.0.options)
122                .await
123                .map(crate::Response::into_body)
124        }
125
126        /// Streams each page in the collection.
127        pub fn by_page(
128            self,
129        ) -> impl google_cloud_gax::paginator::Paginator<
130            crate::model::ListAddressGroupsResponse,
131            crate::Error,
132        > {
133            use std::clone::Clone;
134            let token = self.0.request.page_token.clone();
135            let execute = move |token: String| {
136                let mut builder = self.clone();
137                builder.0.request = builder.0.request.set_page_token(token);
138                builder.send()
139            };
140            google_cloud_gax::paginator::internal::new_paginator(token, execute)
141        }
142
143        /// Streams each item in the collection.
144        pub fn by_item(
145            self,
146        ) -> impl google_cloud_gax::paginator::ItemPaginator<
147            crate::model::ListAddressGroupsResponse,
148            crate::Error,
149        > {
150            use google_cloud_gax::paginator::Paginator;
151            self.by_page().items()
152        }
153
154        /// Sets the value of [parent][crate::model::ListAddressGroupsRequest::parent].
155        ///
156        /// This is a **required** field for requests.
157        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
158            self.0.request.parent = v.into();
159            self
160        }
161
162        /// Sets the value of [page_size][crate::model::ListAddressGroupsRequest::page_size].
163        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
164            self.0.request.page_size = v.into();
165            self
166        }
167
168        /// Sets the value of [page_token][crate::model::ListAddressGroupsRequest::page_token].
169        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
170            self.0.request.page_token = v.into();
171            self
172        }
173
174        /// Sets the value of [return_partial_success][crate::model::ListAddressGroupsRequest::return_partial_success].
175        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
176            self.0.request.return_partial_success = v.into();
177            self
178        }
179    }
180
181    #[doc(hidden)]
182    impl crate::RequestBuilder for ListAddressGroups {
183        fn request_options(&mut self) -> &mut crate::RequestOptions {
184            &mut self.0.options
185        }
186    }
187
188    /// The request builder for [AddressGroupService::get_address_group][crate::client::AddressGroupService::get_address_group] calls.
189    ///
190    /// # Example
191    /// ```
192    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetAddressGroup;
193    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
194    ///
195    /// let builder = prepare_request_builder();
196    /// let response = builder.send().await?;
197    /// # Ok(()) }
198    ///
199    /// fn prepare_request_builder() -> GetAddressGroup {
200    ///   # panic!();
201    ///   // ... details omitted ...
202    /// }
203    /// ```
204    #[derive(Clone, Debug)]
205    pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
206
207    impl GetAddressGroup {
208        pub(crate) fn new(
209            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
210        ) -> Self {
211            Self(RequestBuilder::new(stub))
212        }
213
214        /// Sets the full request, replacing any prior values.
215        pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
216            self.0.request = v.into();
217            self
218        }
219
220        /// Sets all the options, replacing any prior values.
221        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
222            self.0.options = v.into();
223            self
224        }
225
226        /// Sends the request.
227        pub async fn send(self) -> Result<crate::model::AddressGroup> {
228            (*self.0.stub)
229                .get_address_group(self.0.request, self.0.options)
230                .await
231                .map(crate::Response::into_body)
232        }
233
234        /// Sets the value of [name][crate::model::GetAddressGroupRequest::name].
235        ///
236        /// This is a **required** field for requests.
237        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
238            self.0.request.name = v.into();
239            self
240        }
241    }
242
243    #[doc(hidden)]
244    impl crate::RequestBuilder for GetAddressGroup {
245        fn request_options(&mut self) -> &mut crate::RequestOptions {
246            &mut self.0.options
247        }
248    }
249
250    /// The request builder for [AddressGroupService::create_address_group][crate::client::AddressGroupService::create_address_group] calls.
251    ///
252    /// # Example
253    /// ```
254    /// # use google_cloud_networksecurity_v1::builder::address_group_service::CreateAddressGroup;
255    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
256    /// use google_cloud_lro::Poller;
257    ///
258    /// let builder = prepare_request_builder();
259    /// let response = builder.poller().until_done().await?;
260    /// # Ok(()) }
261    ///
262    /// fn prepare_request_builder() -> CreateAddressGroup {
263    ///   # panic!();
264    ///   // ... details omitted ...
265    /// }
266    /// ```
267    #[derive(Clone, Debug)]
268    pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
269
270    impl CreateAddressGroup {
271        pub(crate) fn new(
272            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
273        ) -> Self {
274            Self(RequestBuilder::new(stub))
275        }
276
277        /// Sets the full request, replacing any prior values.
278        pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
279            mut self,
280            v: V,
281        ) -> Self {
282            self.0.request = v.into();
283            self
284        }
285
286        /// Sets all the options, replacing any prior values.
287        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
288            self.0.options = v.into();
289            self
290        }
291
292        /// Sends the request.
293        ///
294        /// # Long running operations
295        ///
296        /// This starts, but does not poll, a longrunning operation. More information
297        /// on [create_address_group][crate::client::AddressGroupService::create_address_group].
298        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
299            (*self.0.stub)
300                .create_address_group(self.0.request, self.0.options)
301                .await
302                .map(crate::Response::into_body)
303        }
304
305        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_address_group`.
306        pub fn poller(
307            self,
308        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
309        {
310            type Operation = google_cloud_lro::internal::Operation<
311                crate::model::AddressGroup,
312                crate::model::OperationMetadata,
313            >;
314            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
315            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
316
317            let stub = self.0.stub.clone();
318            let mut options = self.0.options.clone();
319            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
320            let query = move |name| {
321                let stub = stub.clone();
322                let options = options.clone();
323                async {
324                    let op = GetOperation::new(stub)
325                        .set_name(name)
326                        .with_options(options)
327                        .send()
328                        .await?;
329                    Ok(Operation::new(op))
330                }
331            };
332
333            let start = move || async {
334                let op = self.send().await?;
335                Ok(Operation::new(op))
336            };
337
338            google_cloud_lro::internal::new_poller(
339                polling_error_policy,
340                polling_backoff_policy,
341                start,
342                query,
343            )
344        }
345
346        /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
347        ///
348        /// This is a **required** field for requests.
349        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
350            self.0.request.parent = v.into();
351            self
352        }
353
354        /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
355        ///
356        /// This is a **required** field for requests.
357        pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
358            self.0.request.address_group_id = v.into();
359            self
360        }
361
362        /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
363        ///
364        /// This is a **required** field for requests.
365        pub fn set_address_group<T>(mut self, v: T) -> Self
366        where
367            T: std::convert::Into<crate::model::AddressGroup>,
368        {
369            self.0.request.address_group = std::option::Option::Some(v.into());
370            self
371        }
372
373        /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
374        ///
375        /// This is a **required** field for requests.
376        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
377        where
378            T: std::convert::Into<crate::model::AddressGroup>,
379        {
380            self.0.request.address_group = v.map(|x| x.into());
381            self
382        }
383
384        /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
385        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
386            self.0.request.request_id = v.into();
387            self
388        }
389    }
390
391    #[doc(hidden)]
392    impl crate::RequestBuilder for CreateAddressGroup {
393        fn request_options(&mut self) -> &mut crate::RequestOptions {
394            &mut self.0.options
395        }
396    }
397
398    /// The request builder for [AddressGroupService::update_address_group][crate::client::AddressGroupService::update_address_group] calls.
399    ///
400    /// # Example
401    /// ```
402    /// # use google_cloud_networksecurity_v1::builder::address_group_service::UpdateAddressGroup;
403    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
404    /// use google_cloud_lro::Poller;
405    ///
406    /// let builder = prepare_request_builder();
407    /// let response = builder.poller().until_done().await?;
408    /// # Ok(()) }
409    ///
410    /// fn prepare_request_builder() -> UpdateAddressGroup {
411    ///   # panic!();
412    ///   // ... details omitted ...
413    /// }
414    /// ```
415    #[derive(Clone, Debug)]
416    pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
417
418    impl UpdateAddressGroup {
419        pub(crate) fn new(
420            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
421        ) -> Self {
422            Self(RequestBuilder::new(stub))
423        }
424
425        /// Sets the full request, replacing any prior values.
426        pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
427            mut self,
428            v: V,
429        ) -> Self {
430            self.0.request = v.into();
431            self
432        }
433
434        /// Sets all the options, replacing any prior values.
435        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
436            self.0.options = v.into();
437            self
438        }
439
440        /// Sends the request.
441        ///
442        /// # Long running operations
443        ///
444        /// This starts, but does not poll, a longrunning operation. More information
445        /// on [update_address_group][crate::client::AddressGroupService::update_address_group].
446        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
447            (*self.0.stub)
448                .update_address_group(self.0.request, self.0.options)
449                .await
450                .map(crate::Response::into_body)
451        }
452
453        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_address_group`.
454        pub fn poller(
455            self,
456        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
457        {
458            type Operation = google_cloud_lro::internal::Operation<
459                crate::model::AddressGroup,
460                crate::model::OperationMetadata,
461            >;
462            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
463            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
464
465            let stub = self.0.stub.clone();
466            let mut options = self.0.options.clone();
467            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
468            let query = move |name| {
469                let stub = stub.clone();
470                let options = options.clone();
471                async {
472                    let op = GetOperation::new(stub)
473                        .set_name(name)
474                        .with_options(options)
475                        .send()
476                        .await?;
477                    Ok(Operation::new(op))
478                }
479            };
480
481            let start = move || async {
482                let op = self.send().await?;
483                Ok(Operation::new(op))
484            };
485
486            google_cloud_lro::internal::new_poller(
487                polling_error_policy,
488                polling_backoff_policy,
489                start,
490                query,
491            )
492        }
493
494        /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
495        pub fn set_update_mask<T>(mut self, v: T) -> Self
496        where
497            T: std::convert::Into<wkt::FieldMask>,
498        {
499            self.0.request.update_mask = std::option::Option::Some(v.into());
500            self
501        }
502
503        /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
504        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
505        where
506            T: std::convert::Into<wkt::FieldMask>,
507        {
508            self.0.request.update_mask = v.map(|x| x.into());
509            self
510        }
511
512        /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
513        ///
514        /// This is a **required** field for requests.
515        pub fn set_address_group<T>(mut self, v: T) -> Self
516        where
517            T: std::convert::Into<crate::model::AddressGroup>,
518        {
519            self.0.request.address_group = std::option::Option::Some(v.into());
520            self
521        }
522
523        /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
524        ///
525        /// This is a **required** field for requests.
526        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
527        where
528            T: std::convert::Into<crate::model::AddressGroup>,
529        {
530            self.0.request.address_group = v.map(|x| x.into());
531            self
532        }
533
534        /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
535        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
536            self.0.request.request_id = v.into();
537            self
538        }
539    }
540
541    #[doc(hidden)]
542    impl crate::RequestBuilder for UpdateAddressGroup {
543        fn request_options(&mut self) -> &mut crate::RequestOptions {
544            &mut self.0.options
545        }
546    }
547
548    /// The request builder for [AddressGroupService::add_address_group_items][crate::client::AddressGroupService::add_address_group_items] calls.
549    ///
550    /// # Example
551    /// ```
552    /// # use google_cloud_networksecurity_v1::builder::address_group_service::AddAddressGroupItems;
553    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
554    /// use google_cloud_lro::Poller;
555    ///
556    /// let builder = prepare_request_builder();
557    /// let response = builder.poller().until_done().await?;
558    /// # Ok(()) }
559    ///
560    /// fn prepare_request_builder() -> AddAddressGroupItems {
561    ///   # panic!();
562    ///   // ... details omitted ...
563    /// }
564    /// ```
565    #[derive(Clone, Debug)]
566    pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
567
568    impl AddAddressGroupItems {
569        pub(crate) fn new(
570            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
571        ) -> Self {
572            Self(RequestBuilder::new(stub))
573        }
574
575        /// Sets the full request, replacing any prior values.
576        pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
577            mut self,
578            v: V,
579        ) -> Self {
580            self.0.request = v.into();
581            self
582        }
583
584        /// Sets all the options, replacing any prior values.
585        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
586            self.0.options = v.into();
587            self
588        }
589
590        /// Sends the request.
591        ///
592        /// # Long running operations
593        ///
594        /// This starts, but does not poll, a longrunning operation. More information
595        /// on [add_address_group_items][crate::client::AddressGroupService::add_address_group_items].
596        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
597            (*self.0.stub)
598                .add_address_group_items(self.0.request, self.0.options)
599                .await
600                .map(crate::Response::into_body)
601        }
602
603        /// Creates a [Poller][google_cloud_lro::Poller] to work with `add_address_group_items`.
604        pub fn poller(
605            self,
606        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
607        {
608            type Operation = google_cloud_lro::internal::Operation<
609                crate::model::AddressGroup,
610                crate::model::OperationMetadata,
611            >;
612            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
613            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
614
615            let stub = self.0.stub.clone();
616            let mut options = self.0.options.clone();
617            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
618            let query = move |name| {
619                let stub = stub.clone();
620                let options = options.clone();
621                async {
622                    let op = GetOperation::new(stub)
623                        .set_name(name)
624                        .with_options(options)
625                        .send()
626                        .await?;
627                    Ok(Operation::new(op))
628                }
629            };
630
631            let start = move || async {
632                let op = self.send().await?;
633                Ok(Operation::new(op))
634            };
635
636            google_cloud_lro::internal::new_poller(
637                polling_error_policy,
638                polling_backoff_policy,
639                start,
640                query,
641            )
642        }
643
644        /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
645        ///
646        /// This is a **required** field for requests.
647        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
648            self.0.request.address_group = v.into();
649            self
650        }
651
652        /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
653        ///
654        /// This is a **required** field for requests.
655        pub fn set_items<T, V>(mut self, v: T) -> Self
656        where
657            T: std::iter::IntoIterator<Item = V>,
658            V: std::convert::Into<std::string::String>,
659        {
660            use std::iter::Iterator;
661            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
662            self
663        }
664
665        /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
666        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
667            self.0.request.request_id = v.into();
668            self
669        }
670    }
671
672    #[doc(hidden)]
673    impl crate::RequestBuilder for AddAddressGroupItems {
674        fn request_options(&mut self) -> &mut crate::RequestOptions {
675            &mut self.0.options
676        }
677    }
678
679    /// The request builder for [AddressGroupService::remove_address_group_items][crate::client::AddressGroupService::remove_address_group_items] calls.
680    ///
681    /// # Example
682    /// ```
683    /// # use google_cloud_networksecurity_v1::builder::address_group_service::RemoveAddressGroupItems;
684    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
685    /// use google_cloud_lro::Poller;
686    ///
687    /// let builder = prepare_request_builder();
688    /// let response = builder.poller().until_done().await?;
689    /// # Ok(()) }
690    ///
691    /// fn prepare_request_builder() -> RemoveAddressGroupItems {
692    ///   # panic!();
693    ///   // ... details omitted ...
694    /// }
695    /// ```
696    #[derive(Clone, Debug)]
697    pub struct RemoveAddressGroupItems(
698        RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
699    );
700
701    impl RemoveAddressGroupItems {
702        pub(crate) fn new(
703            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
704        ) -> Self {
705            Self(RequestBuilder::new(stub))
706        }
707
708        /// Sets the full request, replacing any prior values.
709        pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
710            mut self,
711            v: V,
712        ) -> Self {
713            self.0.request = v.into();
714            self
715        }
716
717        /// Sets all the options, replacing any prior values.
718        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
719            self.0.options = v.into();
720            self
721        }
722
723        /// Sends the request.
724        ///
725        /// # Long running operations
726        ///
727        /// This starts, but does not poll, a longrunning operation. More information
728        /// on [remove_address_group_items][crate::client::AddressGroupService::remove_address_group_items].
729        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
730            (*self.0.stub)
731                .remove_address_group_items(self.0.request, self.0.options)
732                .await
733                .map(crate::Response::into_body)
734        }
735
736        /// Creates a [Poller][google_cloud_lro::Poller] to work with `remove_address_group_items`.
737        pub fn poller(
738            self,
739        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
740        {
741            type Operation = google_cloud_lro::internal::Operation<
742                crate::model::AddressGroup,
743                crate::model::OperationMetadata,
744            >;
745            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
746            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
747
748            let stub = self.0.stub.clone();
749            let mut options = self.0.options.clone();
750            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
751            let query = move |name| {
752                let stub = stub.clone();
753                let options = options.clone();
754                async {
755                    let op = GetOperation::new(stub)
756                        .set_name(name)
757                        .with_options(options)
758                        .send()
759                        .await?;
760                    Ok(Operation::new(op))
761                }
762            };
763
764            let start = move || async {
765                let op = self.send().await?;
766                Ok(Operation::new(op))
767            };
768
769            google_cloud_lro::internal::new_poller(
770                polling_error_policy,
771                polling_backoff_policy,
772                start,
773                query,
774            )
775        }
776
777        /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
778        ///
779        /// This is a **required** field for requests.
780        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
781            self.0.request.address_group = v.into();
782            self
783        }
784
785        /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
786        ///
787        /// This is a **required** field for requests.
788        pub fn set_items<T, V>(mut self, v: T) -> Self
789        where
790            T: std::iter::IntoIterator<Item = V>,
791            V: std::convert::Into<std::string::String>,
792        {
793            use std::iter::Iterator;
794            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
795            self
796        }
797
798        /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
799        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
800            self.0.request.request_id = v.into();
801            self
802        }
803    }
804
805    #[doc(hidden)]
806    impl crate::RequestBuilder for RemoveAddressGroupItems {
807        fn request_options(&mut self) -> &mut crate::RequestOptions {
808            &mut self.0.options
809        }
810    }
811
812    /// The request builder for [AddressGroupService::clone_address_group_items][crate::client::AddressGroupService::clone_address_group_items] calls.
813    ///
814    /// # Example
815    /// ```
816    /// # use google_cloud_networksecurity_v1::builder::address_group_service::CloneAddressGroupItems;
817    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
818    /// use google_cloud_lro::Poller;
819    ///
820    /// let builder = prepare_request_builder();
821    /// let response = builder.poller().until_done().await?;
822    /// # Ok(()) }
823    ///
824    /// fn prepare_request_builder() -> CloneAddressGroupItems {
825    ///   # panic!();
826    ///   // ... details omitted ...
827    /// }
828    /// ```
829    #[derive(Clone, Debug)]
830    pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
831
832    impl CloneAddressGroupItems {
833        pub(crate) fn new(
834            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
835        ) -> Self {
836            Self(RequestBuilder::new(stub))
837        }
838
839        /// Sets the full request, replacing any prior values.
840        pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
841            mut self,
842            v: V,
843        ) -> Self {
844            self.0.request = v.into();
845            self
846        }
847
848        /// Sets all the options, replacing any prior values.
849        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
850            self.0.options = v.into();
851            self
852        }
853
854        /// Sends the request.
855        ///
856        /// # Long running operations
857        ///
858        /// This starts, but does not poll, a longrunning operation. More information
859        /// on [clone_address_group_items][crate::client::AddressGroupService::clone_address_group_items].
860        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
861            (*self.0.stub)
862                .clone_address_group_items(self.0.request, self.0.options)
863                .await
864                .map(crate::Response::into_body)
865        }
866
867        /// Creates a [Poller][google_cloud_lro::Poller] to work with `clone_address_group_items`.
868        pub fn poller(
869            self,
870        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
871        {
872            type Operation = google_cloud_lro::internal::Operation<
873                crate::model::AddressGroup,
874                crate::model::OperationMetadata,
875            >;
876            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
877            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
878
879            let stub = self.0.stub.clone();
880            let mut options = self.0.options.clone();
881            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
882            let query = move |name| {
883                let stub = stub.clone();
884                let options = options.clone();
885                async {
886                    let op = GetOperation::new(stub)
887                        .set_name(name)
888                        .with_options(options)
889                        .send()
890                        .await?;
891                    Ok(Operation::new(op))
892                }
893            };
894
895            let start = move || async {
896                let op = self.send().await?;
897                Ok(Operation::new(op))
898            };
899
900            google_cloud_lro::internal::new_poller(
901                polling_error_policy,
902                polling_backoff_policy,
903                start,
904                query,
905            )
906        }
907
908        /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
909        ///
910        /// This is a **required** field for requests.
911        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
912            self.0.request.address_group = v.into();
913            self
914        }
915
916        /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
917        ///
918        /// This is a **required** field for requests.
919        pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
920            self.0.request.source_address_group = v.into();
921            self
922        }
923
924        /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
925        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
926            self.0.request.request_id = v.into();
927            self
928        }
929    }
930
931    #[doc(hidden)]
932    impl crate::RequestBuilder for CloneAddressGroupItems {
933        fn request_options(&mut self) -> &mut crate::RequestOptions {
934            &mut self.0.options
935        }
936    }
937
938    /// The request builder for [AddressGroupService::delete_address_group][crate::client::AddressGroupService::delete_address_group] calls.
939    ///
940    /// # Example
941    /// ```
942    /// # use google_cloud_networksecurity_v1::builder::address_group_service::DeleteAddressGroup;
943    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
944    /// use google_cloud_lro::Poller;
945    ///
946    /// let builder = prepare_request_builder();
947    /// let response = builder.poller().until_done().await?;
948    /// # Ok(()) }
949    ///
950    /// fn prepare_request_builder() -> DeleteAddressGroup {
951    ///   # panic!();
952    ///   // ... details omitted ...
953    /// }
954    /// ```
955    #[derive(Clone, Debug)]
956    pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
957
958    impl DeleteAddressGroup {
959        pub(crate) fn new(
960            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
961        ) -> Self {
962            Self(RequestBuilder::new(stub))
963        }
964
965        /// Sets the full request, replacing any prior values.
966        pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
967            mut self,
968            v: V,
969        ) -> Self {
970            self.0.request = v.into();
971            self
972        }
973
974        /// Sets all the options, replacing any prior values.
975        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
976            self.0.options = v.into();
977            self
978        }
979
980        /// Sends the request.
981        ///
982        /// # Long running operations
983        ///
984        /// This starts, but does not poll, a longrunning operation. More information
985        /// on [delete_address_group][crate::client::AddressGroupService::delete_address_group].
986        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
987            (*self.0.stub)
988                .delete_address_group(self.0.request, self.0.options)
989                .await
990                .map(crate::Response::into_body)
991        }
992
993        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_address_group`.
994        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
995            type Operation =
996                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
997            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
998            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
999
1000            let stub = self.0.stub.clone();
1001            let mut options = self.0.options.clone();
1002            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1003            let query = move |name| {
1004                let stub = stub.clone();
1005                let options = options.clone();
1006                async {
1007                    let op = GetOperation::new(stub)
1008                        .set_name(name)
1009                        .with_options(options)
1010                        .send()
1011                        .await?;
1012                    Ok(Operation::new(op))
1013                }
1014            };
1015
1016            let start = move || async {
1017                let op = self.send().await?;
1018                Ok(Operation::new(op))
1019            };
1020
1021            google_cloud_lro::internal::new_unit_response_poller(
1022                polling_error_policy,
1023                polling_backoff_policy,
1024                start,
1025                query,
1026            )
1027        }
1028
1029        /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
1030        ///
1031        /// This is a **required** field for requests.
1032        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1033            self.0.request.name = v.into();
1034            self
1035        }
1036
1037        /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
1038        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1039            self.0.request.request_id = v.into();
1040            self
1041        }
1042    }
1043
1044    #[doc(hidden)]
1045    impl crate::RequestBuilder for DeleteAddressGroup {
1046        fn request_options(&mut self) -> &mut crate::RequestOptions {
1047            &mut self.0.options
1048        }
1049    }
1050
1051    /// The request builder for [AddressGroupService::list_address_group_references][crate::client::AddressGroupService::list_address_group_references] calls.
1052    ///
1053    /// # Example
1054    /// ```
1055    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListAddressGroupReferences;
1056    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1057    /// use google_cloud_gax::paginator::ItemPaginator;
1058    ///
1059    /// let builder = prepare_request_builder();
1060    /// let mut items = builder.by_item();
1061    /// while let Some(result) = items.next().await {
1062    ///   let item = result?;
1063    /// }
1064    /// # Ok(()) }
1065    ///
1066    /// fn prepare_request_builder() -> ListAddressGroupReferences {
1067    ///   # panic!();
1068    ///   // ... details omitted ...
1069    /// }
1070    /// ```
1071    #[derive(Clone, Debug)]
1072    pub struct ListAddressGroupReferences(
1073        RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
1074    );
1075
1076    impl ListAddressGroupReferences {
1077        pub(crate) fn new(
1078            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1079        ) -> Self {
1080            Self(RequestBuilder::new(stub))
1081        }
1082
1083        /// Sets the full request, replacing any prior values.
1084        pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
1085            mut self,
1086            v: V,
1087        ) -> Self {
1088            self.0.request = v.into();
1089            self
1090        }
1091
1092        /// Sets all the options, replacing any prior values.
1093        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1094            self.0.options = v.into();
1095            self
1096        }
1097
1098        /// Sends the request.
1099        pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
1100            (*self.0.stub)
1101                .list_address_group_references(self.0.request, self.0.options)
1102                .await
1103                .map(crate::Response::into_body)
1104        }
1105
1106        /// Streams each page in the collection.
1107        pub fn by_page(
1108            self,
1109        ) -> impl google_cloud_gax::paginator::Paginator<
1110            crate::model::ListAddressGroupReferencesResponse,
1111            crate::Error,
1112        > {
1113            use std::clone::Clone;
1114            let token = self.0.request.page_token.clone();
1115            let execute = move |token: String| {
1116                let mut builder = self.clone();
1117                builder.0.request = builder.0.request.set_page_token(token);
1118                builder.send()
1119            };
1120            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1121        }
1122
1123        /// Streams each item in the collection.
1124        pub fn by_item(
1125            self,
1126        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1127            crate::model::ListAddressGroupReferencesResponse,
1128            crate::Error,
1129        > {
1130            use google_cloud_gax::paginator::Paginator;
1131            self.by_page().items()
1132        }
1133
1134        /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
1135        ///
1136        /// This is a **required** field for requests.
1137        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
1138            self.0.request.address_group = v.into();
1139            self
1140        }
1141
1142        /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
1143        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1144            self.0.request.page_size = v.into();
1145            self
1146        }
1147
1148        /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
1149        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1150            self.0.request.page_token = v.into();
1151            self
1152        }
1153    }
1154
1155    #[doc(hidden)]
1156    impl crate::RequestBuilder for ListAddressGroupReferences {
1157        fn request_options(&mut self) -> &mut crate::RequestOptions {
1158            &mut self.0.options
1159        }
1160    }
1161
1162    /// The request builder for [AddressGroupService::list_locations][crate::client::AddressGroupService::list_locations] calls.
1163    ///
1164    /// # Example
1165    /// ```
1166    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListLocations;
1167    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1168    /// use google_cloud_gax::paginator::ItemPaginator;
1169    ///
1170    /// let builder = prepare_request_builder();
1171    /// let mut items = builder.by_item();
1172    /// while let Some(result) = items.next().await {
1173    ///   let item = result?;
1174    /// }
1175    /// # Ok(()) }
1176    ///
1177    /// fn prepare_request_builder() -> ListLocations {
1178    ///   # panic!();
1179    ///   // ... details omitted ...
1180    /// }
1181    /// ```
1182    #[derive(Clone, Debug)]
1183    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1184
1185    impl ListLocations {
1186        pub(crate) fn new(
1187            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1188        ) -> Self {
1189            Self(RequestBuilder::new(stub))
1190        }
1191
1192        /// Sets the full request, replacing any prior values.
1193        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1194            mut self,
1195            v: V,
1196        ) -> Self {
1197            self.0.request = v.into();
1198            self
1199        }
1200
1201        /// Sets all the options, replacing any prior values.
1202        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1203            self.0.options = v.into();
1204            self
1205        }
1206
1207        /// Sends the request.
1208        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1209            (*self.0.stub)
1210                .list_locations(self.0.request, self.0.options)
1211                .await
1212                .map(crate::Response::into_body)
1213        }
1214
1215        /// Streams each page in the collection.
1216        pub fn by_page(
1217            self,
1218        ) -> impl google_cloud_gax::paginator::Paginator<
1219            google_cloud_location::model::ListLocationsResponse,
1220            crate::Error,
1221        > {
1222            use std::clone::Clone;
1223            let token = self.0.request.page_token.clone();
1224            let execute = move |token: String| {
1225                let mut builder = self.clone();
1226                builder.0.request = builder.0.request.set_page_token(token);
1227                builder.send()
1228            };
1229            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1230        }
1231
1232        /// Streams each item in the collection.
1233        pub fn by_item(
1234            self,
1235        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1236            google_cloud_location::model::ListLocationsResponse,
1237            crate::Error,
1238        > {
1239            use google_cloud_gax::paginator::Paginator;
1240            self.by_page().items()
1241        }
1242
1243        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1244        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1245            self.0.request.name = v.into();
1246            self
1247        }
1248
1249        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1250        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1251            self.0.request.filter = v.into();
1252            self
1253        }
1254
1255        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1256        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1257            self.0.request.page_size = v.into();
1258            self
1259        }
1260
1261        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1262        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1263            self.0.request.page_token = v.into();
1264            self
1265        }
1266    }
1267
1268    #[doc(hidden)]
1269    impl crate::RequestBuilder for ListLocations {
1270        fn request_options(&mut self) -> &mut crate::RequestOptions {
1271            &mut self.0.options
1272        }
1273    }
1274
1275    /// The request builder for [AddressGroupService::get_location][crate::client::AddressGroupService::get_location] calls.
1276    ///
1277    /// # Example
1278    /// ```
1279    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetLocation;
1280    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1281    ///
1282    /// let builder = prepare_request_builder();
1283    /// let response = builder.send().await?;
1284    /// # Ok(()) }
1285    ///
1286    /// fn prepare_request_builder() -> GetLocation {
1287    ///   # panic!();
1288    ///   // ... details omitted ...
1289    /// }
1290    /// ```
1291    #[derive(Clone, Debug)]
1292    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1293
1294    impl GetLocation {
1295        pub(crate) fn new(
1296            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1297        ) -> Self {
1298            Self(RequestBuilder::new(stub))
1299        }
1300
1301        /// Sets the full request, replacing any prior values.
1302        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1303            mut self,
1304            v: V,
1305        ) -> Self {
1306            self.0.request = v.into();
1307            self
1308        }
1309
1310        /// Sets all the options, replacing any prior values.
1311        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1312            self.0.options = v.into();
1313            self
1314        }
1315
1316        /// Sends the request.
1317        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1318            (*self.0.stub)
1319                .get_location(self.0.request, self.0.options)
1320                .await
1321                .map(crate::Response::into_body)
1322        }
1323
1324        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1325        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1326            self.0.request.name = v.into();
1327            self
1328        }
1329    }
1330
1331    #[doc(hidden)]
1332    impl crate::RequestBuilder for GetLocation {
1333        fn request_options(&mut self) -> &mut crate::RequestOptions {
1334            &mut self.0.options
1335        }
1336    }
1337
1338    /// The request builder for [AddressGroupService::set_iam_policy][crate::client::AddressGroupService::set_iam_policy] calls.
1339    ///
1340    /// # Example
1341    /// ```
1342    /// # use google_cloud_networksecurity_v1::builder::address_group_service::SetIamPolicy;
1343    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1344    ///
1345    /// let builder = prepare_request_builder();
1346    /// let response = builder.send().await?;
1347    /// # Ok(()) }
1348    ///
1349    /// fn prepare_request_builder() -> SetIamPolicy {
1350    ///   # panic!();
1351    ///   // ... details omitted ...
1352    /// }
1353    /// ```
1354    #[derive(Clone, Debug)]
1355    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1356
1357    impl SetIamPolicy {
1358        pub(crate) fn new(
1359            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1360        ) -> Self {
1361            Self(RequestBuilder::new(stub))
1362        }
1363
1364        /// Sets the full request, replacing any prior values.
1365        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1366            mut self,
1367            v: V,
1368        ) -> Self {
1369            self.0.request = v.into();
1370            self
1371        }
1372
1373        /// Sets all the options, replacing any prior values.
1374        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1375            self.0.options = v.into();
1376            self
1377        }
1378
1379        /// Sends the request.
1380        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1381            (*self.0.stub)
1382                .set_iam_policy(self.0.request, self.0.options)
1383                .await
1384                .map(crate::Response::into_body)
1385        }
1386
1387        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
1388        ///
1389        /// This is a **required** field for requests.
1390        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1391            self.0.request.resource = v.into();
1392            self
1393        }
1394
1395        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1396        ///
1397        /// This is a **required** field for requests.
1398        pub fn set_policy<T>(mut self, v: T) -> Self
1399        where
1400            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1401        {
1402            self.0.request.policy = std::option::Option::Some(v.into());
1403            self
1404        }
1405
1406        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1407        ///
1408        /// This is a **required** field for requests.
1409        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1410        where
1411            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1412        {
1413            self.0.request.policy = v.map(|x| x.into());
1414            self
1415        }
1416
1417        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1418        pub fn set_update_mask<T>(mut self, v: T) -> Self
1419        where
1420            T: std::convert::Into<wkt::FieldMask>,
1421        {
1422            self.0.request.update_mask = std::option::Option::Some(v.into());
1423            self
1424        }
1425
1426        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1427        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1428        where
1429            T: std::convert::Into<wkt::FieldMask>,
1430        {
1431            self.0.request.update_mask = v.map(|x| x.into());
1432            self
1433        }
1434    }
1435
1436    #[doc(hidden)]
1437    impl crate::RequestBuilder for SetIamPolicy {
1438        fn request_options(&mut self) -> &mut crate::RequestOptions {
1439            &mut self.0.options
1440        }
1441    }
1442
1443    /// The request builder for [AddressGroupService::get_iam_policy][crate::client::AddressGroupService::get_iam_policy] calls.
1444    ///
1445    /// # Example
1446    /// ```
1447    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetIamPolicy;
1448    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1449    ///
1450    /// let builder = prepare_request_builder();
1451    /// let response = builder.send().await?;
1452    /// # Ok(()) }
1453    ///
1454    /// fn prepare_request_builder() -> GetIamPolicy {
1455    ///   # panic!();
1456    ///   // ... details omitted ...
1457    /// }
1458    /// ```
1459    #[derive(Clone, Debug)]
1460    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1461
1462    impl GetIamPolicy {
1463        pub(crate) fn new(
1464            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1465        ) -> Self {
1466            Self(RequestBuilder::new(stub))
1467        }
1468
1469        /// Sets the full request, replacing any prior values.
1470        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1471            mut self,
1472            v: V,
1473        ) -> Self {
1474            self.0.request = v.into();
1475            self
1476        }
1477
1478        /// Sets all the options, replacing any prior values.
1479        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1480            self.0.options = v.into();
1481            self
1482        }
1483
1484        /// Sends the request.
1485        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1486            (*self.0.stub)
1487                .get_iam_policy(self.0.request, self.0.options)
1488                .await
1489                .map(crate::Response::into_body)
1490        }
1491
1492        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
1493        ///
1494        /// This is a **required** field for requests.
1495        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1496            self.0.request.resource = v.into();
1497            self
1498        }
1499
1500        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1501        pub fn set_options<T>(mut self, v: T) -> Self
1502        where
1503            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1504        {
1505            self.0.request.options = std::option::Option::Some(v.into());
1506            self
1507        }
1508
1509        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1510        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1511        where
1512            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1513        {
1514            self.0.request.options = v.map(|x| x.into());
1515            self
1516        }
1517    }
1518
1519    #[doc(hidden)]
1520    impl crate::RequestBuilder for GetIamPolicy {
1521        fn request_options(&mut self) -> &mut crate::RequestOptions {
1522            &mut self.0.options
1523        }
1524    }
1525
1526    /// The request builder for [AddressGroupService::test_iam_permissions][crate::client::AddressGroupService::test_iam_permissions] calls.
1527    ///
1528    /// # Example
1529    /// ```
1530    /// # use google_cloud_networksecurity_v1::builder::address_group_service::TestIamPermissions;
1531    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1532    ///
1533    /// let builder = prepare_request_builder();
1534    /// let response = builder.send().await?;
1535    /// # Ok(()) }
1536    ///
1537    /// fn prepare_request_builder() -> TestIamPermissions {
1538    ///   # panic!();
1539    ///   // ... details omitted ...
1540    /// }
1541    /// ```
1542    #[derive(Clone, Debug)]
1543    pub struct TestIamPermissions(
1544        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1545    );
1546
1547    impl TestIamPermissions {
1548        pub(crate) fn new(
1549            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1550        ) -> Self {
1551            Self(RequestBuilder::new(stub))
1552        }
1553
1554        /// Sets the full request, replacing any prior values.
1555        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1556            mut self,
1557            v: V,
1558        ) -> Self {
1559            self.0.request = v.into();
1560            self
1561        }
1562
1563        /// Sets all the options, replacing any prior values.
1564        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1565            self.0.options = v.into();
1566            self
1567        }
1568
1569        /// Sends the request.
1570        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1571            (*self.0.stub)
1572                .test_iam_permissions(self.0.request, self.0.options)
1573                .await
1574                .map(crate::Response::into_body)
1575        }
1576
1577        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
1578        ///
1579        /// This is a **required** field for requests.
1580        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1581            self.0.request.resource = v.into();
1582            self
1583        }
1584
1585        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
1586        ///
1587        /// This is a **required** field for requests.
1588        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1589        where
1590            T: std::iter::IntoIterator<Item = V>,
1591            V: std::convert::Into<std::string::String>,
1592        {
1593            use std::iter::Iterator;
1594            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1595            self
1596        }
1597    }
1598
1599    #[doc(hidden)]
1600    impl crate::RequestBuilder for TestIamPermissions {
1601        fn request_options(&mut self) -> &mut crate::RequestOptions {
1602            &mut self.0.options
1603        }
1604    }
1605
1606    /// The request builder for [AddressGroupService::list_operations][crate::client::AddressGroupService::list_operations] calls.
1607    ///
1608    /// # Example
1609    /// ```
1610    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListOperations;
1611    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1612    /// use google_cloud_gax::paginator::ItemPaginator;
1613    ///
1614    /// let builder = prepare_request_builder();
1615    /// let mut items = builder.by_item();
1616    /// while let Some(result) = items.next().await {
1617    ///   let item = result?;
1618    /// }
1619    /// # Ok(()) }
1620    ///
1621    /// fn prepare_request_builder() -> ListOperations {
1622    ///   # panic!();
1623    ///   // ... details omitted ...
1624    /// }
1625    /// ```
1626    #[derive(Clone, Debug)]
1627    pub struct ListOperations(
1628        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1629    );
1630
1631    impl ListOperations {
1632        pub(crate) fn new(
1633            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1634        ) -> Self {
1635            Self(RequestBuilder::new(stub))
1636        }
1637
1638        /// Sets the full request, replacing any prior values.
1639        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1640            mut self,
1641            v: V,
1642        ) -> Self {
1643            self.0.request = v.into();
1644            self
1645        }
1646
1647        /// Sets all the options, replacing any prior values.
1648        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1649            self.0.options = v.into();
1650            self
1651        }
1652
1653        /// Sends the request.
1654        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1655            (*self.0.stub)
1656                .list_operations(self.0.request, self.0.options)
1657                .await
1658                .map(crate::Response::into_body)
1659        }
1660
1661        /// Streams each page in the collection.
1662        pub fn by_page(
1663            self,
1664        ) -> impl google_cloud_gax::paginator::Paginator<
1665            google_cloud_longrunning::model::ListOperationsResponse,
1666            crate::Error,
1667        > {
1668            use std::clone::Clone;
1669            let token = self.0.request.page_token.clone();
1670            let execute = move |token: String| {
1671                let mut builder = self.clone();
1672                builder.0.request = builder.0.request.set_page_token(token);
1673                builder.send()
1674            };
1675            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1676        }
1677
1678        /// Streams each item in the collection.
1679        pub fn by_item(
1680            self,
1681        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1682            google_cloud_longrunning::model::ListOperationsResponse,
1683            crate::Error,
1684        > {
1685            use google_cloud_gax::paginator::Paginator;
1686            self.by_page().items()
1687        }
1688
1689        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1690        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1691            self.0.request.name = v.into();
1692            self
1693        }
1694
1695        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1696        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1697            self.0.request.filter = v.into();
1698            self
1699        }
1700
1701        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1702        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1703            self.0.request.page_size = v.into();
1704            self
1705        }
1706
1707        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1708        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1709            self.0.request.page_token = v.into();
1710            self
1711        }
1712
1713        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1714        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1715            self.0.request.return_partial_success = v.into();
1716            self
1717        }
1718    }
1719
1720    #[doc(hidden)]
1721    impl crate::RequestBuilder for ListOperations {
1722        fn request_options(&mut self) -> &mut crate::RequestOptions {
1723            &mut self.0.options
1724        }
1725    }
1726
1727    /// The request builder for [AddressGroupService::get_operation][crate::client::AddressGroupService::get_operation] calls.
1728    ///
1729    /// # Example
1730    /// ```
1731    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetOperation;
1732    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1733    ///
1734    /// let builder = prepare_request_builder();
1735    /// let response = builder.send().await?;
1736    /// # Ok(()) }
1737    ///
1738    /// fn prepare_request_builder() -> GetOperation {
1739    ///   # panic!();
1740    ///   // ... details omitted ...
1741    /// }
1742    /// ```
1743    #[derive(Clone, Debug)]
1744    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1745
1746    impl GetOperation {
1747        pub(crate) fn new(
1748            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1749        ) -> Self {
1750            Self(RequestBuilder::new(stub))
1751        }
1752
1753        /// Sets the full request, replacing any prior values.
1754        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1755            mut self,
1756            v: V,
1757        ) -> Self {
1758            self.0.request = v.into();
1759            self
1760        }
1761
1762        /// Sets all the options, replacing any prior values.
1763        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1764            self.0.options = v.into();
1765            self
1766        }
1767
1768        /// Sends the request.
1769        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1770            (*self.0.stub)
1771                .get_operation(self.0.request, self.0.options)
1772                .await
1773                .map(crate::Response::into_body)
1774        }
1775
1776        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1777        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1778            self.0.request.name = v.into();
1779            self
1780        }
1781    }
1782
1783    #[doc(hidden)]
1784    impl crate::RequestBuilder for GetOperation {
1785        fn request_options(&mut self) -> &mut crate::RequestOptions {
1786            &mut self.0.options
1787        }
1788    }
1789
1790    /// The request builder for [AddressGroupService::delete_operation][crate::client::AddressGroupService::delete_operation] calls.
1791    ///
1792    /// # Example
1793    /// ```
1794    /// # use google_cloud_networksecurity_v1::builder::address_group_service::DeleteOperation;
1795    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1796    ///
1797    /// let builder = prepare_request_builder();
1798    /// let response = builder.send().await?;
1799    /// # Ok(()) }
1800    ///
1801    /// fn prepare_request_builder() -> DeleteOperation {
1802    ///   # panic!();
1803    ///   // ... details omitted ...
1804    /// }
1805    /// ```
1806    #[derive(Clone, Debug)]
1807    pub struct DeleteOperation(
1808        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1809    );
1810
1811    impl DeleteOperation {
1812        pub(crate) fn new(
1813            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1814        ) -> Self {
1815            Self(RequestBuilder::new(stub))
1816        }
1817
1818        /// Sets the full request, replacing any prior values.
1819        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1820            mut self,
1821            v: V,
1822        ) -> Self {
1823            self.0.request = v.into();
1824            self
1825        }
1826
1827        /// Sets all the options, replacing any prior values.
1828        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1829            self.0.options = v.into();
1830            self
1831        }
1832
1833        /// Sends the request.
1834        pub async fn send(self) -> Result<()> {
1835            (*self.0.stub)
1836                .delete_operation(self.0.request, self.0.options)
1837                .await
1838                .map(crate::Response::into_body)
1839        }
1840
1841        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
1842        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1843            self.0.request.name = v.into();
1844            self
1845        }
1846    }
1847
1848    #[doc(hidden)]
1849    impl crate::RequestBuilder for DeleteOperation {
1850        fn request_options(&mut self) -> &mut crate::RequestOptions {
1851            &mut self.0.options
1852        }
1853    }
1854
1855    /// The request builder for [AddressGroupService::cancel_operation][crate::client::AddressGroupService::cancel_operation] calls.
1856    ///
1857    /// # Example
1858    /// ```
1859    /// # use google_cloud_networksecurity_v1::builder::address_group_service::CancelOperation;
1860    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1861    ///
1862    /// let builder = prepare_request_builder();
1863    /// let response = builder.send().await?;
1864    /// # Ok(()) }
1865    ///
1866    /// fn prepare_request_builder() -> CancelOperation {
1867    ///   # panic!();
1868    ///   // ... details omitted ...
1869    /// }
1870    /// ```
1871    #[derive(Clone, Debug)]
1872    pub struct CancelOperation(
1873        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1874    );
1875
1876    impl CancelOperation {
1877        pub(crate) fn new(
1878            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1879        ) -> Self {
1880            Self(RequestBuilder::new(stub))
1881        }
1882
1883        /// Sets the full request, replacing any prior values.
1884        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1885            mut self,
1886            v: V,
1887        ) -> Self {
1888            self.0.request = v.into();
1889            self
1890        }
1891
1892        /// Sets all the options, replacing any prior values.
1893        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1894            self.0.options = v.into();
1895            self
1896        }
1897
1898        /// Sends the request.
1899        pub async fn send(self) -> Result<()> {
1900            (*self.0.stub)
1901                .cancel_operation(self.0.request, self.0.options)
1902                .await
1903                .map(crate::Response::into_body)
1904        }
1905
1906        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1907        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1908            self.0.request.name = v.into();
1909            self
1910        }
1911    }
1912
1913    #[doc(hidden)]
1914    impl crate::RequestBuilder for CancelOperation {
1915        fn request_options(&mut self) -> &mut crate::RequestOptions {
1916            &mut self.0.options
1917        }
1918    }
1919}
1920
1921pub mod organization_address_group_service {
1922    use crate::Result;
1923
1924    /// A builder for [OrganizationAddressGroupService][crate::client::OrganizationAddressGroupService].
1925    ///
1926    /// ```
1927    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1928    /// # use google_cloud_networksecurity_v1::*;
1929    /// # use builder::organization_address_group_service::ClientBuilder;
1930    /// # use client::OrganizationAddressGroupService;
1931    /// let builder : ClientBuilder = OrganizationAddressGroupService::builder();
1932    /// let client = builder
1933    ///     .with_endpoint("https://networksecurity.googleapis.com")
1934    ///     .build().await?;
1935    /// # Ok(()) }
1936    /// ```
1937    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1938
1939    pub(crate) mod client {
1940        use super::super::super::client::OrganizationAddressGroupService;
1941        pub struct Factory;
1942        impl crate::ClientFactory for Factory {
1943            type Client = OrganizationAddressGroupService;
1944            type Credentials = gaxi::options::Credentials;
1945            async fn build(
1946                self,
1947                config: gaxi::options::ClientConfig,
1948            ) -> crate::ClientBuilderResult<Self::Client> {
1949                Self::Client::new(config).await
1950            }
1951        }
1952    }
1953
1954    /// Common implementation for [crate::client::OrganizationAddressGroupService] request builders.
1955    #[derive(Clone, Debug)]
1956    pub(crate) struct RequestBuilder<R: std::default::Default> {
1957        stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1958        request: R,
1959        options: crate::RequestOptions,
1960    }
1961
1962    impl<R> RequestBuilder<R>
1963    where
1964        R: std::default::Default,
1965    {
1966        pub(crate) fn new(
1967            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1968        ) -> Self {
1969            Self {
1970                stub,
1971                request: R::default(),
1972                options: crate::RequestOptions::default(),
1973            }
1974        }
1975    }
1976
1977    /// The request builder for [OrganizationAddressGroupService::list_address_groups][crate::client::OrganizationAddressGroupService::list_address_groups] calls.
1978    ///
1979    /// # Example
1980    /// ```
1981    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListAddressGroups;
1982    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1983    /// use google_cloud_gax::paginator::ItemPaginator;
1984    ///
1985    /// let builder = prepare_request_builder();
1986    /// let mut items = builder.by_item();
1987    /// while let Some(result) = items.next().await {
1988    ///   let item = result?;
1989    /// }
1990    /// # Ok(()) }
1991    ///
1992    /// fn prepare_request_builder() -> ListAddressGroups {
1993    ///   # panic!();
1994    ///   // ... details omitted ...
1995    /// }
1996    /// ```
1997    #[derive(Clone, Debug)]
1998    pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
1999
2000    impl ListAddressGroups {
2001        pub(crate) fn new(
2002            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2003        ) -> Self {
2004            Self(RequestBuilder::new(stub))
2005        }
2006
2007        /// Sets the full request, replacing any prior values.
2008        pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
2009            mut self,
2010            v: V,
2011        ) -> Self {
2012            self.0.request = v.into();
2013            self
2014        }
2015
2016        /// Sets all the options, replacing any prior values.
2017        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2018            self.0.options = v.into();
2019            self
2020        }
2021
2022        /// Sends the request.
2023        pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
2024            (*self.0.stub)
2025                .list_address_groups(self.0.request, self.0.options)
2026                .await
2027                .map(crate::Response::into_body)
2028        }
2029
2030        /// Streams each page in the collection.
2031        pub fn by_page(
2032            self,
2033        ) -> impl google_cloud_gax::paginator::Paginator<
2034            crate::model::ListAddressGroupsResponse,
2035            crate::Error,
2036        > {
2037            use std::clone::Clone;
2038            let token = self.0.request.page_token.clone();
2039            let execute = move |token: String| {
2040                let mut builder = self.clone();
2041                builder.0.request = builder.0.request.set_page_token(token);
2042                builder.send()
2043            };
2044            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2045        }
2046
2047        /// Streams each item in the collection.
2048        pub fn by_item(
2049            self,
2050        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2051            crate::model::ListAddressGroupsResponse,
2052            crate::Error,
2053        > {
2054            use google_cloud_gax::paginator::Paginator;
2055            self.by_page().items()
2056        }
2057
2058        /// Sets the value of [parent][crate::model::ListAddressGroupsRequest::parent].
2059        ///
2060        /// This is a **required** field for requests.
2061        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2062            self.0.request.parent = v.into();
2063            self
2064        }
2065
2066        /// Sets the value of [page_size][crate::model::ListAddressGroupsRequest::page_size].
2067        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2068            self.0.request.page_size = v.into();
2069            self
2070        }
2071
2072        /// Sets the value of [page_token][crate::model::ListAddressGroupsRequest::page_token].
2073        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2074            self.0.request.page_token = v.into();
2075            self
2076        }
2077
2078        /// Sets the value of [return_partial_success][crate::model::ListAddressGroupsRequest::return_partial_success].
2079        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2080            self.0.request.return_partial_success = v.into();
2081            self
2082        }
2083    }
2084
2085    #[doc(hidden)]
2086    impl crate::RequestBuilder for ListAddressGroups {
2087        fn request_options(&mut self) -> &mut crate::RequestOptions {
2088            &mut self.0.options
2089        }
2090    }
2091
2092    /// The request builder for [OrganizationAddressGroupService::get_address_group][crate::client::OrganizationAddressGroupService::get_address_group] calls.
2093    ///
2094    /// # Example
2095    /// ```
2096    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetAddressGroup;
2097    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2098    ///
2099    /// let builder = prepare_request_builder();
2100    /// let response = builder.send().await?;
2101    /// # Ok(()) }
2102    ///
2103    /// fn prepare_request_builder() -> GetAddressGroup {
2104    ///   # panic!();
2105    ///   // ... details omitted ...
2106    /// }
2107    /// ```
2108    #[derive(Clone, Debug)]
2109    pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
2110
2111    impl GetAddressGroup {
2112        pub(crate) fn new(
2113            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2114        ) -> Self {
2115            Self(RequestBuilder::new(stub))
2116        }
2117
2118        /// Sets the full request, replacing any prior values.
2119        pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
2120            self.0.request = v.into();
2121            self
2122        }
2123
2124        /// Sets all the options, replacing any prior values.
2125        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2126            self.0.options = v.into();
2127            self
2128        }
2129
2130        /// Sends the request.
2131        pub async fn send(self) -> Result<crate::model::AddressGroup> {
2132            (*self.0.stub)
2133                .get_address_group(self.0.request, self.0.options)
2134                .await
2135                .map(crate::Response::into_body)
2136        }
2137
2138        /// Sets the value of [name][crate::model::GetAddressGroupRequest::name].
2139        ///
2140        /// This is a **required** field for requests.
2141        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2142            self.0.request.name = v.into();
2143            self
2144        }
2145    }
2146
2147    #[doc(hidden)]
2148    impl crate::RequestBuilder for GetAddressGroup {
2149        fn request_options(&mut self) -> &mut crate::RequestOptions {
2150            &mut self.0.options
2151        }
2152    }
2153
2154    /// The request builder for [OrganizationAddressGroupService::create_address_group][crate::client::OrganizationAddressGroupService::create_address_group] calls.
2155    ///
2156    /// # Example
2157    /// ```
2158    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::CreateAddressGroup;
2159    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2160    /// use google_cloud_lro::Poller;
2161    ///
2162    /// let builder = prepare_request_builder();
2163    /// let response = builder.poller().until_done().await?;
2164    /// # Ok(()) }
2165    ///
2166    /// fn prepare_request_builder() -> CreateAddressGroup {
2167    ///   # panic!();
2168    ///   // ... details omitted ...
2169    /// }
2170    /// ```
2171    #[derive(Clone, Debug)]
2172    pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
2173
2174    impl CreateAddressGroup {
2175        pub(crate) fn new(
2176            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2177        ) -> Self {
2178            Self(RequestBuilder::new(stub))
2179        }
2180
2181        /// Sets the full request, replacing any prior values.
2182        pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
2183            mut self,
2184            v: V,
2185        ) -> Self {
2186            self.0.request = v.into();
2187            self
2188        }
2189
2190        /// Sets all the options, replacing any prior values.
2191        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2192            self.0.options = v.into();
2193            self
2194        }
2195
2196        /// Sends the request.
2197        ///
2198        /// # Long running operations
2199        ///
2200        /// This starts, but does not poll, a longrunning operation. More information
2201        /// on [create_address_group][crate::client::OrganizationAddressGroupService::create_address_group].
2202        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2203            (*self.0.stub)
2204                .create_address_group(self.0.request, self.0.options)
2205                .await
2206                .map(crate::Response::into_body)
2207        }
2208
2209        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_address_group`.
2210        pub fn poller(
2211            self,
2212        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2213        {
2214            type Operation = google_cloud_lro::internal::Operation<
2215                crate::model::AddressGroup,
2216                crate::model::OperationMetadata,
2217            >;
2218            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2219            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2220
2221            let stub = self.0.stub.clone();
2222            let mut options = self.0.options.clone();
2223            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2224            let query = move |name| {
2225                let stub = stub.clone();
2226                let options = options.clone();
2227                async {
2228                    let op = GetOperation::new(stub)
2229                        .set_name(name)
2230                        .with_options(options)
2231                        .send()
2232                        .await?;
2233                    Ok(Operation::new(op))
2234                }
2235            };
2236
2237            let start = move || async {
2238                let op = self.send().await?;
2239                Ok(Operation::new(op))
2240            };
2241
2242            google_cloud_lro::internal::new_poller(
2243                polling_error_policy,
2244                polling_backoff_policy,
2245                start,
2246                query,
2247            )
2248        }
2249
2250        /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
2251        ///
2252        /// This is a **required** field for requests.
2253        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2254            self.0.request.parent = v.into();
2255            self
2256        }
2257
2258        /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
2259        ///
2260        /// This is a **required** field for requests.
2261        pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2262            self.0.request.address_group_id = v.into();
2263            self
2264        }
2265
2266        /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
2267        ///
2268        /// This is a **required** field for requests.
2269        pub fn set_address_group<T>(mut self, v: T) -> Self
2270        where
2271            T: std::convert::Into<crate::model::AddressGroup>,
2272        {
2273            self.0.request.address_group = std::option::Option::Some(v.into());
2274            self
2275        }
2276
2277        /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
2278        ///
2279        /// This is a **required** field for requests.
2280        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2281        where
2282            T: std::convert::Into<crate::model::AddressGroup>,
2283        {
2284            self.0.request.address_group = v.map(|x| x.into());
2285            self
2286        }
2287
2288        /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
2289        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2290            self.0.request.request_id = v.into();
2291            self
2292        }
2293    }
2294
2295    #[doc(hidden)]
2296    impl crate::RequestBuilder for CreateAddressGroup {
2297        fn request_options(&mut self) -> &mut crate::RequestOptions {
2298            &mut self.0.options
2299        }
2300    }
2301
2302    /// The request builder for [OrganizationAddressGroupService::update_address_group][crate::client::OrganizationAddressGroupService::update_address_group] calls.
2303    ///
2304    /// # Example
2305    /// ```
2306    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::UpdateAddressGroup;
2307    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2308    /// use google_cloud_lro::Poller;
2309    ///
2310    /// let builder = prepare_request_builder();
2311    /// let response = builder.poller().until_done().await?;
2312    /// # Ok(()) }
2313    ///
2314    /// fn prepare_request_builder() -> UpdateAddressGroup {
2315    ///   # panic!();
2316    ///   // ... details omitted ...
2317    /// }
2318    /// ```
2319    #[derive(Clone, Debug)]
2320    pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
2321
2322    impl UpdateAddressGroup {
2323        pub(crate) fn new(
2324            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2325        ) -> Self {
2326            Self(RequestBuilder::new(stub))
2327        }
2328
2329        /// Sets the full request, replacing any prior values.
2330        pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
2331            mut self,
2332            v: V,
2333        ) -> Self {
2334            self.0.request = v.into();
2335            self
2336        }
2337
2338        /// Sets all the options, replacing any prior values.
2339        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2340            self.0.options = v.into();
2341            self
2342        }
2343
2344        /// Sends the request.
2345        ///
2346        /// # Long running operations
2347        ///
2348        /// This starts, but does not poll, a longrunning operation. More information
2349        /// on [update_address_group][crate::client::OrganizationAddressGroupService::update_address_group].
2350        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2351            (*self.0.stub)
2352                .update_address_group(self.0.request, self.0.options)
2353                .await
2354                .map(crate::Response::into_body)
2355        }
2356
2357        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_address_group`.
2358        pub fn poller(
2359            self,
2360        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2361        {
2362            type Operation = google_cloud_lro::internal::Operation<
2363                crate::model::AddressGroup,
2364                crate::model::OperationMetadata,
2365            >;
2366            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2367            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2368
2369            let stub = self.0.stub.clone();
2370            let mut options = self.0.options.clone();
2371            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2372            let query = move |name| {
2373                let stub = stub.clone();
2374                let options = options.clone();
2375                async {
2376                    let op = GetOperation::new(stub)
2377                        .set_name(name)
2378                        .with_options(options)
2379                        .send()
2380                        .await?;
2381                    Ok(Operation::new(op))
2382                }
2383            };
2384
2385            let start = move || async {
2386                let op = self.send().await?;
2387                Ok(Operation::new(op))
2388            };
2389
2390            google_cloud_lro::internal::new_poller(
2391                polling_error_policy,
2392                polling_backoff_policy,
2393                start,
2394                query,
2395            )
2396        }
2397
2398        /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
2399        pub fn set_update_mask<T>(mut self, v: T) -> Self
2400        where
2401            T: std::convert::Into<wkt::FieldMask>,
2402        {
2403            self.0.request.update_mask = std::option::Option::Some(v.into());
2404            self
2405        }
2406
2407        /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
2408        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2409        where
2410            T: std::convert::Into<wkt::FieldMask>,
2411        {
2412            self.0.request.update_mask = v.map(|x| x.into());
2413            self
2414        }
2415
2416        /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
2417        ///
2418        /// This is a **required** field for requests.
2419        pub fn set_address_group<T>(mut self, v: T) -> Self
2420        where
2421            T: std::convert::Into<crate::model::AddressGroup>,
2422        {
2423            self.0.request.address_group = std::option::Option::Some(v.into());
2424            self
2425        }
2426
2427        /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
2428        ///
2429        /// This is a **required** field for requests.
2430        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2431        where
2432            T: std::convert::Into<crate::model::AddressGroup>,
2433        {
2434            self.0.request.address_group = v.map(|x| x.into());
2435            self
2436        }
2437
2438        /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
2439        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2440            self.0.request.request_id = v.into();
2441            self
2442        }
2443    }
2444
2445    #[doc(hidden)]
2446    impl crate::RequestBuilder for UpdateAddressGroup {
2447        fn request_options(&mut self) -> &mut crate::RequestOptions {
2448            &mut self.0.options
2449        }
2450    }
2451
2452    /// The request builder for [OrganizationAddressGroupService::add_address_group_items][crate::client::OrganizationAddressGroupService::add_address_group_items] calls.
2453    ///
2454    /// # Example
2455    /// ```
2456    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::AddAddressGroupItems;
2457    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2458    /// use google_cloud_lro::Poller;
2459    ///
2460    /// let builder = prepare_request_builder();
2461    /// let response = builder.poller().until_done().await?;
2462    /// # Ok(()) }
2463    ///
2464    /// fn prepare_request_builder() -> AddAddressGroupItems {
2465    ///   # panic!();
2466    ///   // ... details omitted ...
2467    /// }
2468    /// ```
2469    #[derive(Clone, Debug)]
2470    pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
2471
2472    impl AddAddressGroupItems {
2473        pub(crate) fn new(
2474            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2475        ) -> Self {
2476            Self(RequestBuilder::new(stub))
2477        }
2478
2479        /// Sets the full request, replacing any prior values.
2480        pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
2481            mut self,
2482            v: V,
2483        ) -> Self {
2484            self.0.request = v.into();
2485            self
2486        }
2487
2488        /// Sets all the options, replacing any prior values.
2489        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2490            self.0.options = v.into();
2491            self
2492        }
2493
2494        /// Sends the request.
2495        ///
2496        /// # Long running operations
2497        ///
2498        /// This starts, but does not poll, a longrunning operation. More information
2499        /// on [add_address_group_items][crate::client::OrganizationAddressGroupService::add_address_group_items].
2500        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2501            (*self.0.stub)
2502                .add_address_group_items(self.0.request, self.0.options)
2503                .await
2504                .map(crate::Response::into_body)
2505        }
2506
2507        /// Creates a [Poller][google_cloud_lro::Poller] to work with `add_address_group_items`.
2508        pub fn poller(
2509            self,
2510        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2511        {
2512            type Operation = google_cloud_lro::internal::Operation<
2513                crate::model::AddressGroup,
2514                crate::model::OperationMetadata,
2515            >;
2516            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2517            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2518
2519            let stub = self.0.stub.clone();
2520            let mut options = self.0.options.clone();
2521            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2522            let query = move |name| {
2523                let stub = stub.clone();
2524                let options = options.clone();
2525                async {
2526                    let op = GetOperation::new(stub)
2527                        .set_name(name)
2528                        .with_options(options)
2529                        .send()
2530                        .await?;
2531                    Ok(Operation::new(op))
2532                }
2533            };
2534
2535            let start = move || async {
2536                let op = self.send().await?;
2537                Ok(Operation::new(op))
2538            };
2539
2540            google_cloud_lro::internal::new_poller(
2541                polling_error_policy,
2542                polling_backoff_policy,
2543                start,
2544                query,
2545            )
2546        }
2547
2548        /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
2549        ///
2550        /// This is a **required** field for requests.
2551        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2552            self.0.request.address_group = v.into();
2553            self
2554        }
2555
2556        /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
2557        ///
2558        /// This is a **required** field for requests.
2559        pub fn set_items<T, V>(mut self, v: T) -> Self
2560        where
2561            T: std::iter::IntoIterator<Item = V>,
2562            V: std::convert::Into<std::string::String>,
2563        {
2564            use std::iter::Iterator;
2565            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2566            self
2567        }
2568
2569        /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
2570        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2571            self.0.request.request_id = v.into();
2572            self
2573        }
2574    }
2575
2576    #[doc(hidden)]
2577    impl crate::RequestBuilder for AddAddressGroupItems {
2578        fn request_options(&mut self) -> &mut crate::RequestOptions {
2579            &mut self.0.options
2580        }
2581    }
2582
2583    /// The request builder for [OrganizationAddressGroupService::remove_address_group_items][crate::client::OrganizationAddressGroupService::remove_address_group_items] calls.
2584    ///
2585    /// # Example
2586    /// ```
2587    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::RemoveAddressGroupItems;
2588    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2589    /// use google_cloud_lro::Poller;
2590    ///
2591    /// let builder = prepare_request_builder();
2592    /// let response = builder.poller().until_done().await?;
2593    /// # Ok(()) }
2594    ///
2595    /// fn prepare_request_builder() -> RemoveAddressGroupItems {
2596    ///   # panic!();
2597    ///   // ... details omitted ...
2598    /// }
2599    /// ```
2600    #[derive(Clone, Debug)]
2601    pub struct RemoveAddressGroupItems(
2602        RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
2603    );
2604
2605    impl RemoveAddressGroupItems {
2606        pub(crate) fn new(
2607            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2608        ) -> Self {
2609            Self(RequestBuilder::new(stub))
2610        }
2611
2612        /// Sets the full request, replacing any prior values.
2613        pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
2614            mut self,
2615            v: V,
2616        ) -> Self {
2617            self.0.request = v.into();
2618            self
2619        }
2620
2621        /// Sets all the options, replacing any prior values.
2622        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2623            self.0.options = v.into();
2624            self
2625        }
2626
2627        /// Sends the request.
2628        ///
2629        /// # Long running operations
2630        ///
2631        /// This starts, but does not poll, a longrunning operation. More information
2632        /// on [remove_address_group_items][crate::client::OrganizationAddressGroupService::remove_address_group_items].
2633        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2634            (*self.0.stub)
2635                .remove_address_group_items(self.0.request, self.0.options)
2636                .await
2637                .map(crate::Response::into_body)
2638        }
2639
2640        /// Creates a [Poller][google_cloud_lro::Poller] to work with `remove_address_group_items`.
2641        pub fn poller(
2642            self,
2643        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2644        {
2645            type Operation = google_cloud_lro::internal::Operation<
2646                crate::model::AddressGroup,
2647                crate::model::OperationMetadata,
2648            >;
2649            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2650            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2651
2652            let stub = self.0.stub.clone();
2653            let mut options = self.0.options.clone();
2654            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2655            let query = move |name| {
2656                let stub = stub.clone();
2657                let options = options.clone();
2658                async {
2659                    let op = GetOperation::new(stub)
2660                        .set_name(name)
2661                        .with_options(options)
2662                        .send()
2663                        .await?;
2664                    Ok(Operation::new(op))
2665                }
2666            };
2667
2668            let start = move || async {
2669                let op = self.send().await?;
2670                Ok(Operation::new(op))
2671            };
2672
2673            google_cloud_lro::internal::new_poller(
2674                polling_error_policy,
2675                polling_backoff_policy,
2676                start,
2677                query,
2678            )
2679        }
2680
2681        /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
2682        ///
2683        /// This is a **required** field for requests.
2684        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2685            self.0.request.address_group = v.into();
2686            self
2687        }
2688
2689        /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
2690        ///
2691        /// This is a **required** field for requests.
2692        pub fn set_items<T, V>(mut self, v: T) -> Self
2693        where
2694            T: std::iter::IntoIterator<Item = V>,
2695            V: std::convert::Into<std::string::String>,
2696        {
2697            use std::iter::Iterator;
2698            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2699            self
2700        }
2701
2702        /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
2703        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2704            self.0.request.request_id = v.into();
2705            self
2706        }
2707    }
2708
2709    #[doc(hidden)]
2710    impl crate::RequestBuilder for RemoveAddressGroupItems {
2711        fn request_options(&mut self) -> &mut crate::RequestOptions {
2712            &mut self.0.options
2713        }
2714    }
2715
2716    /// The request builder for [OrganizationAddressGroupService::clone_address_group_items][crate::client::OrganizationAddressGroupService::clone_address_group_items] calls.
2717    ///
2718    /// # Example
2719    /// ```
2720    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::CloneAddressGroupItems;
2721    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2722    /// use google_cloud_lro::Poller;
2723    ///
2724    /// let builder = prepare_request_builder();
2725    /// let response = builder.poller().until_done().await?;
2726    /// # Ok(()) }
2727    ///
2728    /// fn prepare_request_builder() -> CloneAddressGroupItems {
2729    ///   # panic!();
2730    ///   // ... details omitted ...
2731    /// }
2732    /// ```
2733    #[derive(Clone, Debug)]
2734    pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
2735
2736    impl CloneAddressGroupItems {
2737        pub(crate) fn new(
2738            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2739        ) -> Self {
2740            Self(RequestBuilder::new(stub))
2741        }
2742
2743        /// Sets the full request, replacing any prior values.
2744        pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
2745            mut self,
2746            v: V,
2747        ) -> Self {
2748            self.0.request = v.into();
2749            self
2750        }
2751
2752        /// Sets all the options, replacing any prior values.
2753        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2754            self.0.options = v.into();
2755            self
2756        }
2757
2758        /// Sends the request.
2759        ///
2760        /// # Long running operations
2761        ///
2762        /// This starts, but does not poll, a longrunning operation. More information
2763        /// on [clone_address_group_items][crate::client::OrganizationAddressGroupService::clone_address_group_items].
2764        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2765            (*self.0.stub)
2766                .clone_address_group_items(self.0.request, self.0.options)
2767                .await
2768                .map(crate::Response::into_body)
2769        }
2770
2771        /// Creates a [Poller][google_cloud_lro::Poller] to work with `clone_address_group_items`.
2772        pub fn poller(
2773            self,
2774        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2775        {
2776            type Operation = google_cloud_lro::internal::Operation<
2777                crate::model::AddressGroup,
2778                crate::model::OperationMetadata,
2779            >;
2780            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2781            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2782
2783            let stub = self.0.stub.clone();
2784            let mut options = self.0.options.clone();
2785            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2786            let query = move |name| {
2787                let stub = stub.clone();
2788                let options = options.clone();
2789                async {
2790                    let op = GetOperation::new(stub)
2791                        .set_name(name)
2792                        .with_options(options)
2793                        .send()
2794                        .await?;
2795                    Ok(Operation::new(op))
2796                }
2797            };
2798
2799            let start = move || async {
2800                let op = self.send().await?;
2801                Ok(Operation::new(op))
2802            };
2803
2804            google_cloud_lro::internal::new_poller(
2805                polling_error_policy,
2806                polling_backoff_policy,
2807                start,
2808                query,
2809            )
2810        }
2811
2812        /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
2813        ///
2814        /// This is a **required** field for requests.
2815        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2816            self.0.request.address_group = v.into();
2817            self
2818        }
2819
2820        /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
2821        ///
2822        /// This is a **required** field for requests.
2823        pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2824            self.0.request.source_address_group = v.into();
2825            self
2826        }
2827
2828        /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
2829        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2830            self.0.request.request_id = v.into();
2831            self
2832        }
2833    }
2834
2835    #[doc(hidden)]
2836    impl crate::RequestBuilder for CloneAddressGroupItems {
2837        fn request_options(&mut self) -> &mut crate::RequestOptions {
2838            &mut self.0.options
2839        }
2840    }
2841
2842    /// The request builder for [OrganizationAddressGroupService::delete_address_group][crate::client::OrganizationAddressGroupService::delete_address_group] calls.
2843    ///
2844    /// # Example
2845    /// ```
2846    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::DeleteAddressGroup;
2847    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2848    /// use google_cloud_lro::Poller;
2849    ///
2850    /// let builder = prepare_request_builder();
2851    /// let response = builder.poller().until_done().await?;
2852    /// # Ok(()) }
2853    ///
2854    /// fn prepare_request_builder() -> DeleteAddressGroup {
2855    ///   # panic!();
2856    ///   // ... details omitted ...
2857    /// }
2858    /// ```
2859    #[derive(Clone, Debug)]
2860    pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
2861
2862    impl DeleteAddressGroup {
2863        pub(crate) fn new(
2864            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2865        ) -> Self {
2866            Self(RequestBuilder::new(stub))
2867        }
2868
2869        /// Sets the full request, replacing any prior values.
2870        pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
2871            mut self,
2872            v: V,
2873        ) -> Self {
2874            self.0.request = v.into();
2875            self
2876        }
2877
2878        /// Sets all the options, replacing any prior values.
2879        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2880            self.0.options = v.into();
2881            self
2882        }
2883
2884        /// Sends the request.
2885        ///
2886        /// # Long running operations
2887        ///
2888        /// This starts, but does not poll, a longrunning operation. More information
2889        /// on [delete_address_group][crate::client::OrganizationAddressGroupService::delete_address_group].
2890        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2891            (*self.0.stub)
2892                .delete_address_group(self.0.request, self.0.options)
2893                .await
2894                .map(crate::Response::into_body)
2895        }
2896
2897        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_address_group`.
2898        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2899            type Operation =
2900                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2901            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2902            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2903
2904            let stub = self.0.stub.clone();
2905            let mut options = self.0.options.clone();
2906            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2907            let query = move |name| {
2908                let stub = stub.clone();
2909                let options = options.clone();
2910                async {
2911                    let op = GetOperation::new(stub)
2912                        .set_name(name)
2913                        .with_options(options)
2914                        .send()
2915                        .await?;
2916                    Ok(Operation::new(op))
2917                }
2918            };
2919
2920            let start = move || async {
2921                let op = self.send().await?;
2922                Ok(Operation::new(op))
2923            };
2924
2925            google_cloud_lro::internal::new_unit_response_poller(
2926                polling_error_policy,
2927                polling_backoff_policy,
2928                start,
2929                query,
2930            )
2931        }
2932
2933        /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
2934        ///
2935        /// This is a **required** field for requests.
2936        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2937            self.0.request.name = v.into();
2938            self
2939        }
2940
2941        /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
2942        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2943            self.0.request.request_id = v.into();
2944            self
2945        }
2946    }
2947
2948    #[doc(hidden)]
2949    impl crate::RequestBuilder for DeleteAddressGroup {
2950        fn request_options(&mut self) -> &mut crate::RequestOptions {
2951            &mut self.0.options
2952        }
2953    }
2954
2955    /// The request builder for [OrganizationAddressGroupService::list_address_group_references][crate::client::OrganizationAddressGroupService::list_address_group_references] calls.
2956    ///
2957    /// # Example
2958    /// ```
2959    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListAddressGroupReferences;
2960    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2961    /// use google_cloud_gax::paginator::ItemPaginator;
2962    ///
2963    /// let builder = prepare_request_builder();
2964    /// let mut items = builder.by_item();
2965    /// while let Some(result) = items.next().await {
2966    ///   let item = result?;
2967    /// }
2968    /// # Ok(()) }
2969    ///
2970    /// fn prepare_request_builder() -> ListAddressGroupReferences {
2971    ///   # panic!();
2972    ///   // ... details omitted ...
2973    /// }
2974    /// ```
2975    #[derive(Clone, Debug)]
2976    pub struct ListAddressGroupReferences(
2977        RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
2978    );
2979
2980    impl ListAddressGroupReferences {
2981        pub(crate) fn new(
2982            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2983        ) -> Self {
2984            Self(RequestBuilder::new(stub))
2985        }
2986
2987        /// Sets the full request, replacing any prior values.
2988        pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
2989            mut self,
2990            v: V,
2991        ) -> Self {
2992            self.0.request = v.into();
2993            self
2994        }
2995
2996        /// Sets all the options, replacing any prior values.
2997        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2998            self.0.options = v.into();
2999            self
3000        }
3001
3002        /// Sends the request.
3003        pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
3004            (*self.0.stub)
3005                .list_address_group_references(self.0.request, self.0.options)
3006                .await
3007                .map(crate::Response::into_body)
3008        }
3009
3010        /// Streams each page in the collection.
3011        pub fn by_page(
3012            self,
3013        ) -> impl google_cloud_gax::paginator::Paginator<
3014            crate::model::ListAddressGroupReferencesResponse,
3015            crate::Error,
3016        > {
3017            use std::clone::Clone;
3018            let token = self.0.request.page_token.clone();
3019            let execute = move |token: String| {
3020                let mut builder = self.clone();
3021                builder.0.request = builder.0.request.set_page_token(token);
3022                builder.send()
3023            };
3024            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3025        }
3026
3027        /// Streams each item in the collection.
3028        pub fn by_item(
3029            self,
3030        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3031            crate::model::ListAddressGroupReferencesResponse,
3032            crate::Error,
3033        > {
3034            use google_cloud_gax::paginator::Paginator;
3035            self.by_page().items()
3036        }
3037
3038        /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
3039        ///
3040        /// This is a **required** field for requests.
3041        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
3042            self.0.request.address_group = v.into();
3043            self
3044        }
3045
3046        /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
3047        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3048            self.0.request.page_size = v.into();
3049            self
3050        }
3051
3052        /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
3053        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3054            self.0.request.page_token = v.into();
3055            self
3056        }
3057    }
3058
3059    #[doc(hidden)]
3060    impl crate::RequestBuilder for ListAddressGroupReferences {
3061        fn request_options(&mut self) -> &mut crate::RequestOptions {
3062            &mut self.0.options
3063        }
3064    }
3065
3066    /// The request builder for [OrganizationAddressGroupService::list_locations][crate::client::OrganizationAddressGroupService::list_locations] calls.
3067    ///
3068    /// # Example
3069    /// ```
3070    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListLocations;
3071    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3072    /// use google_cloud_gax::paginator::ItemPaginator;
3073    ///
3074    /// let builder = prepare_request_builder();
3075    /// let mut items = builder.by_item();
3076    /// while let Some(result) = items.next().await {
3077    ///   let item = result?;
3078    /// }
3079    /// # Ok(()) }
3080    ///
3081    /// fn prepare_request_builder() -> ListLocations {
3082    ///   # panic!();
3083    ///   // ... details omitted ...
3084    /// }
3085    /// ```
3086    #[derive(Clone, Debug)]
3087    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3088
3089    impl ListLocations {
3090        pub(crate) fn new(
3091            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3092        ) -> Self {
3093            Self(RequestBuilder::new(stub))
3094        }
3095
3096        /// Sets the full request, replacing any prior values.
3097        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3098            mut self,
3099            v: V,
3100        ) -> Self {
3101            self.0.request = v.into();
3102            self
3103        }
3104
3105        /// Sets all the options, replacing any prior values.
3106        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3107            self.0.options = v.into();
3108            self
3109        }
3110
3111        /// Sends the request.
3112        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3113            (*self.0.stub)
3114                .list_locations(self.0.request, self.0.options)
3115                .await
3116                .map(crate::Response::into_body)
3117        }
3118
3119        /// Streams each page in the collection.
3120        pub fn by_page(
3121            self,
3122        ) -> impl google_cloud_gax::paginator::Paginator<
3123            google_cloud_location::model::ListLocationsResponse,
3124            crate::Error,
3125        > {
3126            use std::clone::Clone;
3127            let token = self.0.request.page_token.clone();
3128            let execute = move |token: String| {
3129                let mut builder = self.clone();
3130                builder.0.request = builder.0.request.set_page_token(token);
3131                builder.send()
3132            };
3133            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3134        }
3135
3136        /// Streams each item in the collection.
3137        pub fn by_item(
3138            self,
3139        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3140            google_cloud_location::model::ListLocationsResponse,
3141            crate::Error,
3142        > {
3143            use google_cloud_gax::paginator::Paginator;
3144            self.by_page().items()
3145        }
3146
3147        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
3148        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3149            self.0.request.name = v.into();
3150            self
3151        }
3152
3153        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
3154        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3155            self.0.request.filter = v.into();
3156            self
3157        }
3158
3159        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
3160        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3161            self.0.request.page_size = v.into();
3162            self
3163        }
3164
3165        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
3166        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3167            self.0.request.page_token = v.into();
3168            self
3169        }
3170    }
3171
3172    #[doc(hidden)]
3173    impl crate::RequestBuilder for ListLocations {
3174        fn request_options(&mut self) -> &mut crate::RequestOptions {
3175            &mut self.0.options
3176        }
3177    }
3178
3179    /// The request builder for [OrganizationAddressGroupService::get_location][crate::client::OrganizationAddressGroupService::get_location] calls.
3180    ///
3181    /// # Example
3182    /// ```
3183    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetLocation;
3184    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3185    ///
3186    /// let builder = prepare_request_builder();
3187    /// let response = builder.send().await?;
3188    /// # Ok(()) }
3189    ///
3190    /// fn prepare_request_builder() -> GetLocation {
3191    ///   # panic!();
3192    ///   // ... details omitted ...
3193    /// }
3194    /// ```
3195    #[derive(Clone, Debug)]
3196    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3197
3198    impl GetLocation {
3199        pub(crate) fn new(
3200            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3201        ) -> Self {
3202            Self(RequestBuilder::new(stub))
3203        }
3204
3205        /// Sets the full request, replacing any prior values.
3206        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3207            mut self,
3208            v: V,
3209        ) -> Self {
3210            self.0.request = v.into();
3211            self
3212        }
3213
3214        /// Sets all the options, replacing any prior values.
3215        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3216            self.0.options = v.into();
3217            self
3218        }
3219
3220        /// Sends the request.
3221        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3222            (*self.0.stub)
3223                .get_location(self.0.request, self.0.options)
3224                .await
3225                .map(crate::Response::into_body)
3226        }
3227
3228        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
3229        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3230            self.0.request.name = v.into();
3231            self
3232        }
3233    }
3234
3235    #[doc(hidden)]
3236    impl crate::RequestBuilder for GetLocation {
3237        fn request_options(&mut self) -> &mut crate::RequestOptions {
3238            &mut self.0.options
3239        }
3240    }
3241
3242    /// The request builder for [OrganizationAddressGroupService::set_iam_policy][crate::client::OrganizationAddressGroupService::set_iam_policy] calls.
3243    ///
3244    /// # Example
3245    /// ```
3246    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::SetIamPolicy;
3247    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3248    ///
3249    /// let builder = prepare_request_builder();
3250    /// let response = builder.send().await?;
3251    /// # Ok(()) }
3252    ///
3253    /// fn prepare_request_builder() -> SetIamPolicy {
3254    ///   # panic!();
3255    ///   // ... details omitted ...
3256    /// }
3257    /// ```
3258    #[derive(Clone, Debug)]
3259    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3260
3261    impl SetIamPolicy {
3262        pub(crate) fn new(
3263            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3264        ) -> Self {
3265            Self(RequestBuilder::new(stub))
3266        }
3267
3268        /// Sets the full request, replacing any prior values.
3269        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3270            mut self,
3271            v: V,
3272        ) -> Self {
3273            self.0.request = v.into();
3274            self
3275        }
3276
3277        /// Sets all the options, replacing any prior values.
3278        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3279            self.0.options = v.into();
3280            self
3281        }
3282
3283        /// Sends the request.
3284        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3285            (*self.0.stub)
3286                .set_iam_policy(self.0.request, self.0.options)
3287                .await
3288                .map(crate::Response::into_body)
3289        }
3290
3291        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
3292        ///
3293        /// This is a **required** field for requests.
3294        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3295            self.0.request.resource = v.into();
3296            self
3297        }
3298
3299        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3300        ///
3301        /// This is a **required** field for requests.
3302        pub fn set_policy<T>(mut self, v: T) -> Self
3303        where
3304            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3305        {
3306            self.0.request.policy = std::option::Option::Some(v.into());
3307            self
3308        }
3309
3310        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3311        ///
3312        /// This is a **required** field for requests.
3313        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3314        where
3315            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3316        {
3317            self.0.request.policy = v.map(|x| x.into());
3318            self
3319        }
3320
3321        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3322        pub fn set_update_mask<T>(mut self, v: T) -> Self
3323        where
3324            T: std::convert::Into<wkt::FieldMask>,
3325        {
3326            self.0.request.update_mask = std::option::Option::Some(v.into());
3327            self
3328        }
3329
3330        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3331        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3332        where
3333            T: std::convert::Into<wkt::FieldMask>,
3334        {
3335            self.0.request.update_mask = v.map(|x| x.into());
3336            self
3337        }
3338    }
3339
3340    #[doc(hidden)]
3341    impl crate::RequestBuilder for SetIamPolicy {
3342        fn request_options(&mut self) -> &mut crate::RequestOptions {
3343            &mut self.0.options
3344        }
3345    }
3346
3347    /// The request builder for [OrganizationAddressGroupService::get_iam_policy][crate::client::OrganizationAddressGroupService::get_iam_policy] calls.
3348    ///
3349    /// # Example
3350    /// ```
3351    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetIamPolicy;
3352    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3353    ///
3354    /// let builder = prepare_request_builder();
3355    /// let response = builder.send().await?;
3356    /// # Ok(()) }
3357    ///
3358    /// fn prepare_request_builder() -> GetIamPolicy {
3359    ///   # panic!();
3360    ///   // ... details omitted ...
3361    /// }
3362    /// ```
3363    #[derive(Clone, Debug)]
3364    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3365
3366    impl GetIamPolicy {
3367        pub(crate) fn new(
3368            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3369        ) -> Self {
3370            Self(RequestBuilder::new(stub))
3371        }
3372
3373        /// Sets the full request, replacing any prior values.
3374        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3375            mut self,
3376            v: V,
3377        ) -> Self {
3378            self.0.request = v.into();
3379            self
3380        }
3381
3382        /// Sets all the options, replacing any prior values.
3383        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3384            self.0.options = v.into();
3385            self
3386        }
3387
3388        /// Sends the request.
3389        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3390            (*self.0.stub)
3391                .get_iam_policy(self.0.request, self.0.options)
3392                .await
3393                .map(crate::Response::into_body)
3394        }
3395
3396        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
3397        ///
3398        /// This is a **required** field for requests.
3399        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3400            self.0.request.resource = v.into();
3401            self
3402        }
3403
3404        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3405        pub fn set_options<T>(mut self, v: T) -> Self
3406        where
3407            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3408        {
3409            self.0.request.options = std::option::Option::Some(v.into());
3410            self
3411        }
3412
3413        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3414        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3415        where
3416            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3417        {
3418            self.0.request.options = v.map(|x| x.into());
3419            self
3420        }
3421    }
3422
3423    #[doc(hidden)]
3424    impl crate::RequestBuilder for GetIamPolicy {
3425        fn request_options(&mut self) -> &mut crate::RequestOptions {
3426            &mut self.0.options
3427        }
3428    }
3429
3430    /// The request builder for [OrganizationAddressGroupService::test_iam_permissions][crate::client::OrganizationAddressGroupService::test_iam_permissions] calls.
3431    ///
3432    /// # Example
3433    /// ```
3434    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::TestIamPermissions;
3435    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3436    ///
3437    /// let builder = prepare_request_builder();
3438    /// let response = builder.send().await?;
3439    /// # Ok(()) }
3440    ///
3441    /// fn prepare_request_builder() -> TestIamPermissions {
3442    ///   # panic!();
3443    ///   // ... details omitted ...
3444    /// }
3445    /// ```
3446    #[derive(Clone, Debug)]
3447    pub struct TestIamPermissions(
3448        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3449    );
3450
3451    impl TestIamPermissions {
3452        pub(crate) fn new(
3453            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3454        ) -> Self {
3455            Self(RequestBuilder::new(stub))
3456        }
3457
3458        /// Sets the full request, replacing any prior values.
3459        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3460            mut self,
3461            v: V,
3462        ) -> Self {
3463            self.0.request = v.into();
3464            self
3465        }
3466
3467        /// Sets all the options, replacing any prior values.
3468        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3469            self.0.options = v.into();
3470            self
3471        }
3472
3473        /// Sends the request.
3474        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3475            (*self.0.stub)
3476                .test_iam_permissions(self.0.request, self.0.options)
3477                .await
3478                .map(crate::Response::into_body)
3479        }
3480
3481        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
3482        ///
3483        /// This is a **required** field for requests.
3484        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3485            self.0.request.resource = v.into();
3486            self
3487        }
3488
3489        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
3490        ///
3491        /// This is a **required** field for requests.
3492        pub fn set_permissions<T, V>(mut self, v: T) -> Self
3493        where
3494            T: std::iter::IntoIterator<Item = V>,
3495            V: std::convert::Into<std::string::String>,
3496        {
3497            use std::iter::Iterator;
3498            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3499            self
3500        }
3501    }
3502
3503    #[doc(hidden)]
3504    impl crate::RequestBuilder for TestIamPermissions {
3505        fn request_options(&mut self) -> &mut crate::RequestOptions {
3506            &mut self.0.options
3507        }
3508    }
3509
3510    /// The request builder for [OrganizationAddressGroupService::list_operations][crate::client::OrganizationAddressGroupService::list_operations] calls.
3511    ///
3512    /// # Example
3513    /// ```
3514    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListOperations;
3515    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3516    /// use google_cloud_gax::paginator::ItemPaginator;
3517    ///
3518    /// let builder = prepare_request_builder();
3519    /// let mut items = builder.by_item();
3520    /// while let Some(result) = items.next().await {
3521    ///   let item = result?;
3522    /// }
3523    /// # Ok(()) }
3524    ///
3525    /// fn prepare_request_builder() -> ListOperations {
3526    ///   # panic!();
3527    ///   // ... details omitted ...
3528    /// }
3529    /// ```
3530    #[derive(Clone, Debug)]
3531    pub struct ListOperations(
3532        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3533    );
3534
3535    impl ListOperations {
3536        pub(crate) fn new(
3537            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3538        ) -> Self {
3539            Self(RequestBuilder::new(stub))
3540        }
3541
3542        /// Sets the full request, replacing any prior values.
3543        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3544            mut self,
3545            v: V,
3546        ) -> Self {
3547            self.0.request = v.into();
3548            self
3549        }
3550
3551        /// Sets all the options, replacing any prior values.
3552        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3553            self.0.options = v.into();
3554            self
3555        }
3556
3557        /// Sends the request.
3558        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3559            (*self.0.stub)
3560                .list_operations(self.0.request, self.0.options)
3561                .await
3562                .map(crate::Response::into_body)
3563        }
3564
3565        /// Streams each page in the collection.
3566        pub fn by_page(
3567            self,
3568        ) -> impl google_cloud_gax::paginator::Paginator<
3569            google_cloud_longrunning::model::ListOperationsResponse,
3570            crate::Error,
3571        > {
3572            use std::clone::Clone;
3573            let token = self.0.request.page_token.clone();
3574            let execute = move |token: String| {
3575                let mut builder = self.clone();
3576                builder.0.request = builder.0.request.set_page_token(token);
3577                builder.send()
3578            };
3579            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3580        }
3581
3582        /// Streams each item in the collection.
3583        pub fn by_item(
3584            self,
3585        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3586            google_cloud_longrunning::model::ListOperationsResponse,
3587            crate::Error,
3588        > {
3589            use google_cloud_gax::paginator::Paginator;
3590            self.by_page().items()
3591        }
3592
3593        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3594        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3595            self.0.request.name = v.into();
3596            self
3597        }
3598
3599        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3600        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3601            self.0.request.filter = v.into();
3602            self
3603        }
3604
3605        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3606        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3607            self.0.request.page_size = v.into();
3608            self
3609        }
3610
3611        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3612        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3613            self.0.request.page_token = v.into();
3614            self
3615        }
3616
3617        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3618        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3619            self.0.request.return_partial_success = v.into();
3620            self
3621        }
3622    }
3623
3624    #[doc(hidden)]
3625    impl crate::RequestBuilder for ListOperations {
3626        fn request_options(&mut self) -> &mut crate::RequestOptions {
3627            &mut self.0.options
3628        }
3629    }
3630
3631    /// The request builder for [OrganizationAddressGroupService::get_operation][crate::client::OrganizationAddressGroupService::get_operation] calls.
3632    ///
3633    /// # Example
3634    /// ```
3635    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetOperation;
3636    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3637    ///
3638    /// let builder = prepare_request_builder();
3639    /// let response = builder.send().await?;
3640    /// # Ok(()) }
3641    ///
3642    /// fn prepare_request_builder() -> GetOperation {
3643    ///   # panic!();
3644    ///   // ... details omitted ...
3645    /// }
3646    /// ```
3647    #[derive(Clone, Debug)]
3648    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3649
3650    impl GetOperation {
3651        pub(crate) fn new(
3652            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3653        ) -> Self {
3654            Self(RequestBuilder::new(stub))
3655        }
3656
3657        /// Sets the full request, replacing any prior values.
3658        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3659            mut self,
3660            v: V,
3661        ) -> Self {
3662            self.0.request = v.into();
3663            self
3664        }
3665
3666        /// Sets all the options, replacing any prior values.
3667        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3668            self.0.options = v.into();
3669            self
3670        }
3671
3672        /// Sends the request.
3673        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3674            (*self.0.stub)
3675                .get_operation(self.0.request, self.0.options)
3676                .await
3677                .map(crate::Response::into_body)
3678        }
3679
3680        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3681        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3682            self.0.request.name = v.into();
3683            self
3684        }
3685    }
3686
3687    #[doc(hidden)]
3688    impl crate::RequestBuilder for GetOperation {
3689        fn request_options(&mut self) -> &mut crate::RequestOptions {
3690            &mut self.0.options
3691        }
3692    }
3693
3694    /// The request builder for [OrganizationAddressGroupService::delete_operation][crate::client::OrganizationAddressGroupService::delete_operation] calls.
3695    ///
3696    /// # Example
3697    /// ```
3698    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::DeleteOperation;
3699    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3700    ///
3701    /// let builder = prepare_request_builder();
3702    /// let response = builder.send().await?;
3703    /// # Ok(()) }
3704    ///
3705    /// fn prepare_request_builder() -> DeleteOperation {
3706    ///   # panic!();
3707    ///   // ... details omitted ...
3708    /// }
3709    /// ```
3710    #[derive(Clone, Debug)]
3711    pub struct DeleteOperation(
3712        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3713    );
3714
3715    impl DeleteOperation {
3716        pub(crate) fn new(
3717            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3718        ) -> Self {
3719            Self(RequestBuilder::new(stub))
3720        }
3721
3722        /// Sets the full request, replacing any prior values.
3723        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3724            mut self,
3725            v: V,
3726        ) -> Self {
3727            self.0.request = v.into();
3728            self
3729        }
3730
3731        /// Sets all the options, replacing any prior values.
3732        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3733            self.0.options = v.into();
3734            self
3735        }
3736
3737        /// Sends the request.
3738        pub async fn send(self) -> Result<()> {
3739            (*self.0.stub)
3740                .delete_operation(self.0.request, self.0.options)
3741                .await
3742                .map(crate::Response::into_body)
3743        }
3744
3745        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3746        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3747            self.0.request.name = v.into();
3748            self
3749        }
3750    }
3751
3752    #[doc(hidden)]
3753    impl crate::RequestBuilder for DeleteOperation {
3754        fn request_options(&mut self) -> &mut crate::RequestOptions {
3755            &mut self.0.options
3756        }
3757    }
3758
3759    /// The request builder for [OrganizationAddressGroupService::cancel_operation][crate::client::OrganizationAddressGroupService::cancel_operation] calls.
3760    ///
3761    /// # Example
3762    /// ```
3763    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::CancelOperation;
3764    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3765    ///
3766    /// let builder = prepare_request_builder();
3767    /// let response = builder.send().await?;
3768    /// # Ok(()) }
3769    ///
3770    /// fn prepare_request_builder() -> CancelOperation {
3771    ///   # panic!();
3772    ///   // ... details omitted ...
3773    /// }
3774    /// ```
3775    #[derive(Clone, Debug)]
3776    pub struct CancelOperation(
3777        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3778    );
3779
3780    impl CancelOperation {
3781        pub(crate) fn new(
3782            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3783        ) -> Self {
3784            Self(RequestBuilder::new(stub))
3785        }
3786
3787        /// Sets the full request, replacing any prior values.
3788        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3789            mut self,
3790            v: V,
3791        ) -> Self {
3792            self.0.request = v.into();
3793            self
3794        }
3795
3796        /// Sets all the options, replacing any prior values.
3797        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3798            self.0.options = v.into();
3799            self
3800        }
3801
3802        /// Sends the request.
3803        pub async fn send(self) -> Result<()> {
3804            (*self.0.stub)
3805                .cancel_operation(self.0.request, self.0.options)
3806                .await
3807                .map(crate::Response::into_body)
3808        }
3809
3810        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3811        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3812            self.0.request.name = v.into();
3813            self
3814        }
3815    }
3816
3817    #[doc(hidden)]
3818    impl crate::RequestBuilder for CancelOperation {
3819        fn request_options(&mut self) -> &mut crate::RequestOptions {
3820            &mut self.0.options
3821        }
3822    }
3823}
3824
3825pub mod dns_threat_detector_service {
3826    use crate::Result;
3827
3828    /// A builder for [DnsThreatDetectorService][crate::client::DnsThreatDetectorService].
3829    ///
3830    /// ```
3831    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3832    /// # use google_cloud_networksecurity_v1::*;
3833    /// # use builder::dns_threat_detector_service::ClientBuilder;
3834    /// # use client::DnsThreatDetectorService;
3835    /// let builder : ClientBuilder = DnsThreatDetectorService::builder();
3836    /// let client = builder
3837    ///     .with_endpoint("https://networksecurity.googleapis.com")
3838    ///     .build().await?;
3839    /// # Ok(()) }
3840    /// ```
3841    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3842
3843    pub(crate) mod client {
3844        use super::super::super::client::DnsThreatDetectorService;
3845        pub struct Factory;
3846        impl crate::ClientFactory for Factory {
3847            type Client = DnsThreatDetectorService;
3848            type Credentials = gaxi::options::Credentials;
3849            async fn build(
3850                self,
3851                config: gaxi::options::ClientConfig,
3852            ) -> crate::ClientBuilderResult<Self::Client> {
3853                Self::Client::new(config).await
3854            }
3855        }
3856    }
3857
3858    /// Common implementation for [crate::client::DnsThreatDetectorService] request builders.
3859    #[derive(Clone, Debug)]
3860    pub(crate) struct RequestBuilder<R: std::default::Default> {
3861        stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3862        request: R,
3863        options: crate::RequestOptions,
3864    }
3865
3866    impl<R> RequestBuilder<R>
3867    where
3868        R: std::default::Default,
3869    {
3870        pub(crate) fn new(
3871            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3872        ) -> Self {
3873            Self {
3874                stub,
3875                request: R::default(),
3876                options: crate::RequestOptions::default(),
3877            }
3878        }
3879    }
3880
3881    /// The request builder for [DnsThreatDetectorService::list_dns_threat_detectors][crate::client::DnsThreatDetectorService::list_dns_threat_detectors] calls.
3882    ///
3883    /// # Example
3884    /// ```
3885    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::ListDnsThreatDetectors;
3886    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3887    /// use google_cloud_gax::paginator::ItemPaginator;
3888    ///
3889    /// let builder = prepare_request_builder();
3890    /// let mut items = builder.by_item();
3891    /// while let Some(result) = items.next().await {
3892    ///   let item = result?;
3893    /// }
3894    /// # Ok(()) }
3895    ///
3896    /// fn prepare_request_builder() -> ListDnsThreatDetectors {
3897    ///   # panic!();
3898    ///   // ... details omitted ...
3899    /// }
3900    /// ```
3901    #[derive(Clone, Debug)]
3902    pub struct ListDnsThreatDetectors(RequestBuilder<crate::model::ListDnsThreatDetectorsRequest>);
3903
3904    impl ListDnsThreatDetectors {
3905        pub(crate) fn new(
3906            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3907        ) -> Self {
3908            Self(RequestBuilder::new(stub))
3909        }
3910
3911        /// Sets the full request, replacing any prior values.
3912        pub fn with_request<V: Into<crate::model::ListDnsThreatDetectorsRequest>>(
3913            mut self,
3914            v: V,
3915        ) -> Self {
3916            self.0.request = v.into();
3917            self
3918        }
3919
3920        /// Sets all the options, replacing any prior values.
3921        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3922            self.0.options = v.into();
3923            self
3924        }
3925
3926        /// Sends the request.
3927        pub async fn send(self) -> Result<crate::model::ListDnsThreatDetectorsResponse> {
3928            (*self.0.stub)
3929                .list_dns_threat_detectors(self.0.request, self.0.options)
3930                .await
3931                .map(crate::Response::into_body)
3932        }
3933
3934        /// Streams each page in the collection.
3935        pub fn by_page(
3936            self,
3937        ) -> impl google_cloud_gax::paginator::Paginator<
3938            crate::model::ListDnsThreatDetectorsResponse,
3939            crate::Error,
3940        > {
3941            use std::clone::Clone;
3942            let token = self.0.request.page_token.clone();
3943            let execute = move |token: String| {
3944                let mut builder = self.clone();
3945                builder.0.request = builder.0.request.set_page_token(token);
3946                builder.send()
3947            };
3948            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3949        }
3950
3951        /// Streams each item in the collection.
3952        pub fn by_item(
3953            self,
3954        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3955            crate::model::ListDnsThreatDetectorsResponse,
3956            crate::Error,
3957        > {
3958            use google_cloud_gax::paginator::Paginator;
3959            self.by_page().items()
3960        }
3961
3962        /// Sets the value of [parent][crate::model::ListDnsThreatDetectorsRequest::parent].
3963        ///
3964        /// This is a **required** field for requests.
3965        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3966            self.0.request.parent = v.into();
3967            self
3968        }
3969
3970        /// Sets the value of [page_size][crate::model::ListDnsThreatDetectorsRequest::page_size].
3971        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3972            self.0.request.page_size = v.into();
3973            self
3974        }
3975
3976        /// Sets the value of [page_token][crate::model::ListDnsThreatDetectorsRequest::page_token].
3977        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3978            self.0.request.page_token = v.into();
3979            self
3980        }
3981    }
3982
3983    #[doc(hidden)]
3984    impl crate::RequestBuilder for ListDnsThreatDetectors {
3985        fn request_options(&mut self) -> &mut crate::RequestOptions {
3986            &mut self.0.options
3987        }
3988    }
3989
3990    /// The request builder for [DnsThreatDetectorService::get_dns_threat_detector][crate::client::DnsThreatDetectorService::get_dns_threat_detector] calls.
3991    ///
3992    /// # Example
3993    /// ```
3994    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetDnsThreatDetector;
3995    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3996    ///
3997    /// let builder = prepare_request_builder();
3998    /// let response = builder.send().await?;
3999    /// # Ok(()) }
4000    ///
4001    /// fn prepare_request_builder() -> GetDnsThreatDetector {
4002    ///   # panic!();
4003    ///   // ... details omitted ...
4004    /// }
4005    /// ```
4006    #[derive(Clone, Debug)]
4007    pub struct GetDnsThreatDetector(RequestBuilder<crate::model::GetDnsThreatDetectorRequest>);
4008
4009    impl GetDnsThreatDetector {
4010        pub(crate) fn new(
4011            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4012        ) -> Self {
4013            Self(RequestBuilder::new(stub))
4014        }
4015
4016        /// Sets the full request, replacing any prior values.
4017        pub fn with_request<V: Into<crate::model::GetDnsThreatDetectorRequest>>(
4018            mut self,
4019            v: V,
4020        ) -> Self {
4021            self.0.request = v.into();
4022            self
4023        }
4024
4025        /// Sets all the options, replacing any prior values.
4026        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4027            self.0.options = v.into();
4028            self
4029        }
4030
4031        /// Sends the request.
4032        pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4033            (*self.0.stub)
4034                .get_dns_threat_detector(self.0.request, self.0.options)
4035                .await
4036                .map(crate::Response::into_body)
4037        }
4038
4039        /// Sets the value of [name][crate::model::GetDnsThreatDetectorRequest::name].
4040        ///
4041        /// This is a **required** field for requests.
4042        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4043            self.0.request.name = v.into();
4044            self
4045        }
4046    }
4047
4048    #[doc(hidden)]
4049    impl crate::RequestBuilder for GetDnsThreatDetector {
4050        fn request_options(&mut self) -> &mut crate::RequestOptions {
4051            &mut self.0.options
4052        }
4053    }
4054
4055    /// The request builder for [DnsThreatDetectorService::create_dns_threat_detector][crate::client::DnsThreatDetectorService::create_dns_threat_detector] calls.
4056    ///
4057    /// # Example
4058    /// ```
4059    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::CreateDnsThreatDetector;
4060    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4061    ///
4062    /// let builder = prepare_request_builder();
4063    /// let response = builder.send().await?;
4064    /// # Ok(()) }
4065    ///
4066    /// fn prepare_request_builder() -> CreateDnsThreatDetector {
4067    ///   # panic!();
4068    ///   // ... details omitted ...
4069    /// }
4070    /// ```
4071    #[derive(Clone, Debug)]
4072    pub struct CreateDnsThreatDetector(
4073        RequestBuilder<crate::model::CreateDnsThreatDetectorRequest>,
4074    );
4075
4076    impl CreateDnsThreatDetector {
4077        pub(crate) fn new(
4078            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4079        ) -> Self {
4080            Self(RequestBuilder::new(stub))
4081        }
4082
4083        /// Sets the full request, replacing any prior values.
4084        pub fn with_request<V: Into<crate::model::CreateDnsThreatDetectorRequest>>(
4085            mut self,
4086            v: V,
4087        ) -> Self {
4088            self.0.request = v.into();
4089            self
4090        }
4091
4092        /// Sets all the options, replacing any prior values.
4093        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4094            self.0.options = v.into();
4095            self
4096        }
4097
4098        /// Sends the request.
4099        pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4100            (*self.0.stub)
4101                .create_dns_threat_detector(self.0.request, self.0.options)
4102                .await
4103                .map(crate::Response::into_body)
4104        }
4105
4106        /// Sets the value of [parent][crate::model::CreateDnsThreatDetectorRequest::parent].
4107        ///
4108        /// This is a **required** field for requests.
4109        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4110            self.0.request.parent = v.into();
4111            self
4112        }
4113
4114        /// Sets the value of [dns_threat_detector_id][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector_id].
4115        pub fn set_dns_threat_detector_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4116            self.0.request.dns_threat_detector_id = v.into();
4117            self
4118        }
4119
4120        /// Sets the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
4121        ///
4122        /// This is a **required** field for requests.
4123        pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4124        where
4125            T: std::convert::Into<crate::model::DnsThreatDetector>,
4126        {
4127            self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4128            self
4129        }
4130
4131        /// Sets or clears the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
4132        ///
4133        /// This is a **required** field for requests.
4134        pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4135        where
4136            T: std::convert::Into<crate::model::DnsThreatDetector>,
4137        {
4138            self.0.request.dns_threat_detector = v.map(|x| x.into());
4139            self
4140        }
4141    }
4142
4143    #[doc(hidden)]
4144    impl crate::RequestBuilder for CreateDnsThreatDetector {
4145        fn request_options(&mut self) -> &mut crate::RequestOptions {
4146            &mut self.0.options
4147        }
4148    }
4149
4150    /// The request builder for [DnsThreatDetectorService::update_dns_threat_detector][crate::client::DnsThreatDetectorService::update_dns_threat_detector] calls.
4151    ///
4152    /// # Example
4153    /// ```
4154    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::UpdateDnsThreatDetector;
4155    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4156    ///
4157    /// let builder = prepare_request_builder();
4158    /// let response = builder.send().await?;
4159    /// # Ok(()) }
4160    ///
4161    /// fn prepare_request_builder() -> UpdateDnsThreatDetector {
4162    ///   # panic!();
4163    ///   // ... details omitted ...
4164    /// }
4165    /// ```
4166    #[derive(Clone, Debug)]
4167    pub struct UpdateDnsThreatDetector(
4168        RequestBuilder<crate::model::UpdateDnsThreatDetectorRequest>,
4169    );
4170
4171    impl UpdateDnsThreatDetector {
4172        pub(crate) fn new(
4173            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4174        ) -> Self {
4175            Self(RequestBuilder::new(stub))
4176        }
4177
4178        /// Sets the full request, replacing any prior values.
4179        pub fn with_request<V: Into<crate::model::UpdateDnsThreatDetectorRequest>>(
4180            mut self,
4181            v: V,
4182        ) -> Self {
4183            self.0.request = v.into();
4184            self
4185        }
4186
4187        /// Sets all the options, replacing any prior values.
4188        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4189            self.0.options = v.into();
4190            self
4191        }
4192
4193        /// Sends the request.
4194        pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4195            (*self.0.stub)
4196                .update_dns_threat_detector(self.0.request, self.0.options)
4197                .await
4198                .map(crate::Response::into_body)
4199        }
4200
4201        /// Sets the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
4202        pub fn set_update_mask<T>(mut self, v: T) -> Self
4203        where
4204            T: std::convert::Into<wkt::FieldMask>,
4205        {
4206            self.0.request.update_mask = std::option::Option::Some(v.into());
4207            self
4208        }
4209
4210        /// Sets or clears the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
4211        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4212        where
4213            T: std::convert::Into<wkt::FieldMask>,
4214        {
4215            self.0.request.update_mask = v.map(|x| x.into());
4216            self
4217        }
4218
4219        /// Sets the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
4220        ///
4221        /// This is a **required** field for requests.
4222        pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4223        where
4224            T: std::convert::Into<crate::model::DnsThreatDetector>,
4225        {
4226            self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4227            self
4228        }
4229
4230        /// Sets or clears the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
4231        ///
4232        /// This is a **required** field for requests.
4233        pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4234        where
4235            T: std::convert::Into<crate::model::DnsThreatDetector>,
4236        {
4237            self.0.request.dns_threat_detector = v.map(|x| x.into());
4238            self
4239        }
4240    }
4241
4242    #[doc(hidden)]
4243    impl crate::RequestBuilder for UpdateDnsThreatDetector {
4244        fn request_options(&mut self) -> &mut crate::RequestOptions {
4245            &mut self.0.options
4246        }
4247    }
4248
4249    /// The request builder for [DnsThreatDetectorService::delete_dns_threat_detector][crate::client::DnsThreatDetectorService::delete_dns_threat_detector] calls.
4250    ///
4251    /// # Example
4252    /// ```
4253    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::DeleteDnsThreatDetector;
4254    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4255    ///
4256    /// let builder = prepare_request_builder();
4257    /// let response = builder.send().await?;
4258    /// # Ok(()) }
4259    ///
4260    /// fn prepare_request_builder() -> DeleteDnsThreatDetector {
4261    ///   # panic!();
4262    ///   // ... details omitted ...
4263    /// }
4264    /// ```
4265    #[derive(Clone, Debug)]
4266    pub struct DeleteDnsThreatDetector(
4267        RequestBuilder<crate::model::DeleteDnsThreatDetectorRequest>,
4268    );
4269
4270    impl DeleteDnsThreatDetector {
4271        pub(crate) fn new(
4272            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4273        ) -> Self {
4274            Self(RequestBuilder::new(stub))
4275        }
4276
4277        /// Sets the full request, replacing any prior values.
4278        pub fn with_request<V: Into<crate::model::DeleteDnsThreatDetectorRequest>>(
4279            mut self,
4280            v: V,
4281        ) -> Self {
4282            self.0.request = v.into();
4283            self
4284        }
4285
4286        /// Sets all the options, replacing any prior values.
4287        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4288            self.0.options = v.into();
4289            self
4290        }
4291
4292        /// Sends the request.
4293        pub async fn send(self) -> Result<()> {
4294            (*self.0.stub)
4295                .delete_dns_threat_detector(self.0.request, self.0.options)
4296                .await
4297                .map(crate::Response::into_body)
4298        }
4299
4300        /// Sets the value of [name][crate::model::DeleteDnsThreatDetectorRequest::name].
4301        ///
4302        /// This is a **required** field for requests.
4303        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4304            self.0.request.name = v.into();
4305            self
4306        }
4307    }
4308
4309    #[doc(hidden)]
4310    impl crate::RequestBuilder for DeleteDnsThreatDetector {
4311        fn request_options(&mut self) -> &mut crate::RequestOptions {
4312            &mut self.0.options
4313        }
4314    }
4315
4316    /// The request builder for [DnsThreatDetectorService::list_locations][crate::client::DnsThreatDetectorService::list_locations] calls.
4317    ///
4318    /// # Example
4319    /// ```
4320    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::ListLocations;
4321    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4322    /// use google_cloud_gax::paginator::ItemPaginator;
4323    ///
4324    /// let builder = prepare_request_builder();
4325    /// let mut items = builder.by_item();
4326    /// while let Some(result) = items.next().await {
4327    ///   let item = result?;
4328    /// }
4329    /// # Ok(()) }
4330    ///
4331    /// fn prepare_request_builder() -> ListLocations {
4332    ///   # panic!();
4333    ///   // ... details omitted ...
4334    /// }
4335    /// ```
4336    #[derive(Clone, Debug)]
4337    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4338
4339    impl ListLocations {
4340        pub(crate) fn new(
4341            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4342        ) -> Self {
4343            Self(RequestBuilder::new(stub))
4344        }
4345
4346        /// Sets the full request, replacing any prior values.
4347        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4348            mut self,
4349            v: V,
4350        ) -> Self {
4351            self.0.request = v.into();
4352            self
4353        }
4354
4355        /// Sets all the options, replacing any prior values.
4356        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4357            self.0.options = v.into();
4358            self
4359        }
4360
4361        /// Sends the request.
4362        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4363            (*self.0.stub)
4364                .list_locations(self.0.request, self.0.options)
4365                .await
4366                .map(crate::Response::into_body)
4367        }
4368
4369        /// Streams each page in the collection.
4370        pub fn by_page(
4371            self,
4372        ) -> impl google_cloud_gax::paginator::Paginator<
4373            google_cloud_location::model::ListLocationsResponse,
4374            crate::Error,
4375        > {
4376            use std::clone::Clone;
4377            let token = self.0.request.page_token.clone();
4378            let execute = move |token: String| {
4379                let mut builder = self.clone();
4380                builder.0.request = builder.0.request.set_page_token(token);
4381                builder.send()
4382            };
4383            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4384        }
4385
4386        /// Streams each item in the collection.
4387        pub fn by_item(
4388            self,
4389        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4390            google_cloud_location::model::ListLocationsResponse,
4391            crate::Error,
4392        > {
4393            use google_cloud_gax::paginator::Paginator;
4394            self.by_page().items()
4395        }
4396
4397        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
4398        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4399            self.0.request.name = v.into();
4400            self
4401        }
4402
4403        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
4404        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4405            self.0.request.filter = v.into();
4406            self
4407        }
4408
4409        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
4410        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4411            self.0.request.page_size = v.into();
4412            self
4413        }
4414
4415        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
4416        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4417            self.0.request.page_token = v.into();
4418            self
4419        }
4420    }
4421
4422    #[doc(hidden)]
4423    impl crate::RequestBuilder for ListLocations {
4424        fn request_options(&mut self) -> &mut crate::RequestOptions {
4425            &mut self.0.options
4426        }
4427    }
4428
4429    /// The request builder for [DnsThreatDetectorService::get_location][crate::client::DnsThreatDetectorService::get_location] calls.
4430    ///
4431    /// # Example
4432    /// ```
4433    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetLocation;
4434    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4435    ///
4436    /// let builder = prepare_request_builder();
4437    /// let response = builder.send().await?;
4438    /// # Ok(()) }
4439    ///
4440    /// fn prepare_request_builder() -> GetLocation {
4441    ///   # panic!();
4442    ///   // ... details omitted ...
4443    /// }
4444    /// ```
4445    #[derive(Clone, Debug)]
4446    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4447
4448    impl GetLocation {
4449        pub(crate) fn new(
4450            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4451        ) -> Self {
4452            Self(RequestBuilder::new(stub))
4453        }
4454
4455        /// Sets the full request, replacing any prior values.
4456        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4457            mut self,
4458            v: V,
4459        ) -> Self {
4460            self.0.request = v.into();
4461            self
4462        }
4463
4464        /// Sets all the options, replacing any prior values.
4465        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4466            self.0.options = v.into();
4467            self
4468        }
4469
4470        /// Sends the request.
4471        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4472            (*self.0.stub)
4473                .get_location(self.0.request, self.0.options)
4474                .await
4475                .map(crate::Response::into_body)
4476        }
4477
4478        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
4479        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4480            self.0.request.name = v.into();
4481            self
4482        }
4483    }
4484
4485    #[doc(hidden)]
4486    impl crate::RequestBuilder for GetLocation {
4487        fn request_options(&mut self) -> &mut crate::RequestOptions {
4488            &mut self.0.options
4489        }
4490    }
4491
4492    /// The request builder for [DnsThreatDetectorService::set_iam_policy][crate::client::DnsThreatDetectorService::set_iam_policy] calls.
4493    ///
4494    /// # Example
4495    /// ```
4496    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::SetIamPolicy;
4497    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4498    ///
4499    /// let builder = prepare_request_builder();
4500    /// let response = builder.send().await?;
4501    /// # Ok(()) }
4502    ///
4503    /// fn prepare_request_builder() -> SetIamPolicy {
4504    ///   # panic!();
4505    ///   // ... details omitted ...
4506    /// }
4507    /// ```
4508    #[derive(Clone, Debug)]
4509    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4510
4511    impl SetIamPolicy {
4512        pub(crate) fn new(
4513            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4514        ) -> Self {
4515            Self(RequestBuilder::new(stub))
4516        }
4517
4518        /// Sets the full request, replacing any prior values.
4519        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4520            mut self,
4521            v: V,
4522        ) -> Self {
4523            self.0.request = v.into();
4524            self
4525        }
4526
4527        /// Sets all the options, replacing any prior values.
4528        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4529            self.0.options = v.into();
4530            self
4531        }
4532
4533        /// Sends the request.
4534        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4535            (*self.0.stub)
4536                .set_iam_policy(self.0.request, self.0.options)
4537                .await
4538                .map(crate::Response::into_body)
4539        }
4540
4541        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
4542        ///
4543        /// This is a **required** field for requests.
4544        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4545            self.0.request.resource = v.into();
4546            self
4547        }
4548
4549        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4550        ///
4551        /// This is a **required** field for requests.
4552        pub fn set_policy<T>(mut self, v: T) -> Self
4553        where
4554            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4555        {
4556            self.0.request.policy = std::option::Option::Some(v.into());
4557            self
4558        }
4559
4560        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4561        ///
4562        /// This is a **required** field for requests.
4563        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4564        where
4565            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4566        {
4567            self.0.request.policy = v.map(|x| x.into());
4568            self
4569        }
4570
4571        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4572        pub fn set_update_mask<T>(mut self, v: T) -> Self
4573        where
4574            T: std::convert::Into<wkt::FieldMask>,
4575        {
4576            self.0.request.update_mask = std::option::Option::Some(v.into());
4577            self
4578        }
4579
4580        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4581        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4582        where
4583            T: std::convert::Into<wkt::FieldMask>,
4584        {
4585            self.0.request.update_mask = v.map(|x| x.into());
4586            self
4587        }
4588    }
4589
4590    #[doc(hidden)]
4591    impl crate::RequestBuilder for SetIamPolicy {
4592        fn request_options(&mut self) -> &mut crate::RequestOptions {
4593            &mut self.0.options
4594        }
4595    }
4596
4597    /// The request builder for [DnsThreatDetectorService::get_iam_policy][crate::client::DnsThreatDetectorService::get_iam_policy] calls.
4598    ///
4599    /// # Example
4600    /// ```
4601    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetIamPolicy;
4602    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4603    ///
4604    /// let builder = prepare_request_builder();
4605    /// let response = builder.send().await?;
4606    /// # Ok(()) }
4607    ///
4608    /// fn prepare_request_builder() -> GetIamPolicy {
4609    ///   # panic!();
4610    ///   // ... details omitted ...
4611    /// }
4612    /// ```
4613    #[derive(Clone, Debug)]
4614    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4615
4616    impl GetIamPolicy {
4617        pub(crate) fn new(
4618            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4619        ) -> Self {
4620            Self(RequestBuilder::new(stub))
4621        }
4622
4623        /// Sets the full request, replacing any prior values.
4624        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4625            mut self,
4626            v: V,
4627        ) -> Self {
4628            self.0.request = v.into();
4629            self
4630        }
4631
4632        /// Sets all the options, replacing any prior values.
4633        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4634            self.0.options = v.into();
4635            self
4636        }
4637
4638        /// Sends the request.
4639        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4640            (*self.0.stub)
4641                .get_iam_policy(self.0.request, self.0.options)
4642                .await
4643                .map(crate::Response::into_body)
4644        }
4645
4646        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
4647        ///
4648        /// This is a **required** field for requests.
4649        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4650            self.0.request.resource = v.into();
4651            self
4652        }
4653
4654        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4655        pub fn set_options<T>(mut self, v: T) -> Self
4656        where
4657            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4658        {
4659            self.0.request.options = std::option::Option::Some(v.into());
4660            self
4661        }
4662
4663        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4664        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4665        where
4666            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4667        {
4668            self.0.request.options = v.map(|x| x.into());
4669            self
4670        }
4671    }
4672
4673    #[doc(hidden)]
4674    impl crate::RequestBuilder for GetIamPolicy {
4675        fn request_options(&mut self) -> &mut crate::RequestOptions {
4676            &mut self.0.options
4677        }
4678    }
4679
4680    /// The request builder for [DnsThreatDetectorService::test_iam_permissions][crate::client::DnsThreatDetectorService::test_iam_permissions] calls.
4681    ///
4682    /// # Example
4683    /// ```
4684    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::TestIamPermissions;
4685    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4686    ///
4687    /// let builder = prepare_request_builder();
4688    /// let response = builder.send().await?;
4689    /// # Ok(()) }
4690    ///
4691    /// fn prepare_request_builder() -> TestIamPermissions {
4692    ///   # panic!();
4693    ///   // ... details omitted ...
4694    /// }
4695    /// ```
4696    #[derive(Clone, Debug)]
4697    pub struct TestIamPermissions(
4698        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4699    );
4700
4701    impl TestIamPermissions {
4702        pub(crate) fn new(
4703            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4704        ) -> Self {
4705            Self(RequestBuilder::new(stub))
4706        }
4707
4708        /// Sets the full request, replacing any prior values.
4709        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4710            mut self,
4711            v: V,
4712        ) -> Self {
4713            self.0.request = v.into();
4714            self
4715        }
4716
4717        /// Sets all the options, replacing any prior values.
4718        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4719            self.0.options = v.into();
4720            self
4721        }
4722
4723        /// Sends the request.
4724        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4725            (*self.0.stub)
4726                .test_iam_permissions(self.0.request, self.0.options)
4727                .await
4728                .map(crate::Response::into_body)
4729        }
4730
4731        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
4732        ///
4733        /// This is a **required** field for requests.
4734        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4735            self.0.request.resource = v.into();
4736            self
4737        }
4738
4739        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
4740        ///
4741        /// This is a **required** field for requests.
4742        pub fn set_permissions<T, V>(mut self, v: T) -> Self
4743        where
4744            T: std::iter::IntoIterator<Item = V>,
4745            V: std::convert::Into<std::string::String>,
4746        {
4747            use std::iter::Iterator;
4748            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4749            self
4750        }
4751    }
4752
4753    #[doc(hidden)]
4754    impl crate::RequestBuilder for TestIamPermissions {
4755        fn request_options(&mut self) -> &mut crate::RequestOptions {
4756            &mut self.0.options
4757        }
4758    }
4759
4760    /// The request builder for [DnsThreatDetectorService::list_operations][crate::client::DnsThreatDetectorService::list_operations] calls.
4761    ///
4762    /// # Example
4763    /// ```
4764    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::ListOperations;
4765    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4766    /// use google_cloud_gax::paginator::ItemPaginator;
4767    ///
4768    /// let builder = prepare_request_builder();
4769    /// let mut items = builder.by_item();
4770    /// while let Some(result) = items.next().await {
4771    ///   let item = result?;
4772    /// }
4773    /// # Ok(()) }
4774    ///
4775    /// fn prepare_request_builder() -> ListOperations {
4776    ///   # panic!();
4777    ///   // ... details omitted ...
4778    /// }
4779    /// ```
4780    #[derive(Clone, Debug)]
4781    pub struct ListOperations(
4782        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4783    );
4784
4785    impl ListOperations {
4786        pub(crate) fn new(
4787            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4788        ) -> Self {
4789            Self(RequestBuilder::new(stub))
4790        }
4791
4792        /// Sets the full request, replacing any prior values.
4793        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4794            mut self,
4795            v: V,
4796        ) -> Self {
4797            self.0.request = v.into();
4798            self
4799        }
4800
4801        /// Sets all the options, replacing any prior values.
4802        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4803            self.0.options = v.into();
4804            self
4805        }
4806
4807        /// Sends the request.
4808        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4809            (*self.0.stub)
4810                .list_operations(self.0.request, self.0.options)
4811                .await
4812                .map(crate::Response::into_body)
4813        }
4814
4815        /// Streams each page in the collection.
4816        pub fn by_page(
4817            self,
4818        ) -> impl google_cloud_gax::paginator::Paginator<
4819            google_cloud_longrunning::model::ListOperationsResponse,
4820            crate::Error,
4821        > {
4822            use std::clone::Clone;
4823            let token = self.0.request.page_token.clone();
4824            let execute = move |token: String| {
4825                let mut builder = self.clone();
4826                builder.0.request = builder.0.request.set_page_token(token);
4827                builder.send()
4828            };
4829            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4830        }
4831
4832        /// Streams each item in the collection.
4833        pub fn by_item(
4834            self,
4835        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4836            google_cloud_longrunning::model::ListOperationsResponse,
4837            crate::Error,
4838        > {
4839            use google_cloud_gax::paginator::Paginator;
4840            self.by_page().items()
4841        }
4842
4843        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
4844        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4845            self.0.request.name = v.into();
4846            self
4847        }
4848
4849        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
4850        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4851            self.0.request.filter = v.into();
4852            self
4853        }
4854
4855        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
4856        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4857            self.0.request.page_size = v.into();
4858            self
4859        }
4860
4861        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
4862        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4863            self.0.request.page_token = v.into();
4864            self
4865        }
4866
4867        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
4868        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4869            self.0.request.return_partial_success = v.into();
4870            self
4871        }
4872    }
4873
4874    #[doc(hidden)]
4875    impl crate::RequestBuilder for ListOperations {
4876        fn request_options(&mut self) -> &mut crate::RequestOptions {
4877            &mut self.0.options
4878        }
4879    }
4880
4881    /// The request builder for [DnsThreatDetectorService::get_operation][crate::client::DnsThreatDetectorService::get_operation] calls.
4882    ///
4883    /// # Example
4884    /// ```
4885    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetOperation;
4886    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4887    ///
4888    /// let builder = prepare_request_builder();
4889    /// let response = builder.send().await?;
4890    /// # Ok(()) }
4891    ///
4892    /// fn prepare_request_builder() -> GetOperation {
4893    ///   # panic!();
4894    ///   // ... details omitted ...
4895    /// }
4896    /// ```
4897    #[derive(Clone, Debug)]
4898    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4899
4900    impl GetOperation {
4901        pub(crate) fn new(
4902            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4903        ) -> Self {
4904            Self(RequestBuilder::new(stub))
4905        }
4906
4907        /// Sets the full request, replacing any prior values.
4908        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4909            mut self,
4910            v: V,
4911        ) -> Self {
4912            self.0.request = v.into();
4913            self
4914        }
4915
4916        /// Sets all the options, replacing any prior values.
4917        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4918            self.0.options = v.into();
4919            self
4920        }
4921
4922        /// Sends the request.
4923        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4924            (*self.0.stub)
4925                .get_operation(self.0.request, self.0.options)
4926                .await
4927                .map(crate::Response::into_body)
4928        }
4929
4930        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4931        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4932            self.0.request.name = v.into();
4933            self
4934        }
4935    }
4936
4937    #[doc(hidden)]
4938    impl crate::RequestBuilder for GetOperation {
4939        fn request_options(&mut self) -> &mut crate::RequestOptions {
4940            &mut self.0.options
4941        }
4942    }
4943
4944    /// The request builder for [DnsThreatDetectorService::delete_operation][crate::client::DnsThreatDetectorService::delete_operation] calls.
4945    ///
4946    /// # Example
4947    /// ```
4948    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::DeleteOperation;
4949    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4950    ///
4951    /// let builder = prepare_request_builder();
4952    /// let response = builder.send().await?;
4953    /// # Ok(()) }
4954    ///
4955    /// fn prepare_request_builder() -> DeleteOperation {
4956    ///   # panic!();
4957    ///   // ... details omitted ...
4958    /// }
4959    /// ```
4960    #[derive(Clone, Debug)]
4961    pub struct DeleteOperation(
4962        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4963    );
4964
4965    impl DeleteOperation {
4966        pub(crate) fn new(
4967            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4968        ) -> Self {
4969            Self(RequestBuilder::new(stub))
4970        }
4971
4972        /// Sets the full request, replacing any prior values.
4973        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4974            mut self,
4975            v: V,
4976        ) -> Self {
4977            self.0.request = v.into();
4978            self
4979        }
4980
4981        /// Sets all the options, replacing any prior values.
4982        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4983            self.0.options = v.into();
4984            self
4985        }
4986
4987        /// Sends the request.
4988        pub async fn send(self) -> Result<()> {
4989            (*self.0.stub)
4990                .delete_operation(self.0.request, self.0.options)
4991                .await
4992                .map(crate::Response::into_body)
4993        }
4994
4995        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
4996        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4997            self.0.request.name = v.into();
4998            self
4999        }
5000    }
5001
5002    #[doc(hidden)]
5003    impl crate::RequestBuilder for DeleteOperation {
5004        fn request_options(&mut self) -> &mut crate::RequestOptions {
5005            &mut self.0.options
5006        }
5007    }
5008
5009    /// The request builder for [DnsThreatDetectorService::cancel_operation][crate::client::DnsThreatDetectorService::cancel_operation] calls.
5010    ///
5011    /// # Example
5012    /// ```
5013    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::CancelOperation;
5014    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5015    ///
5016    /// let builder = prepare_request_builder();
5017    /// let response = builder.send().await?;
5018    /// # Ok(()) }
5019    ///
5020    /// fn prepare_request_builder() -> CancelOperation {
5021    ///   # panic!();
5022    ///   // ... details omitted ...
5023    /// }
5024    /// ```
5025    #[derive(Clone, Debug)]
5026    pub struct CancelOperation(
5027        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5028    );
5029
5030    impl CancelOperation {
5031        pub(crate) fn new(
5032            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
5033        ) -> Self {
5034            Self(RequestBuilder::new(stub))
5035        }
5036
5037        /// Sets the full request, replacing any prior values.
5038        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5039            mut self,
5040            v: V,
5041        ) -> Self {
5042            self.0.request = v.into();
5043            self
5044        }
5045
5046        /// Sets all the options, replacing any prior values.
5047        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5048            self.0.options = v.into();
5049            self
5050        }
5051
5052        /// Sends the request.
5053        pub async fn send(self) -> Result<()> {
5054            (*self.0.stub)
5055                .cancel_operation(self.0.request, self.0.options)
5056                .await
5057                .map(crate::Response::into_body)
5058        }
5059
5060        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5061        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5062            self.0.request.name = v.into();
5063            self
5064        }
5065    }
5066
5067    #[doc(hidden)]
5068    impl crate::RequestBuilder for CancelOperation {
5069        fn request_options(&mut self) -> &mut crate::RequestOptions {
5070            &mut self.0.options
5071        }
5072    }
5073}
5074
5075pub mod firewall_activation {
5076    use crate::Result;
5077
5078    /// A builder for [FirewallActivation][crate::client::FirewallActivation].
5079    ///
5080    /// ```
5081    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5082    /// # use google_cloud_networksecurity_v1::*;
5083    /// # use builder::firewall_activation::ClientBuilder;
5084    /// # use client::FirewallActivation;
5085    /// let builder : ClientBuilder = FirewallActivation::builder();
5086    /// let client = builder
5087    ///     .with_endpoint("https://networksecurity.googleapis.com")
5088    ///     .build().await?;
5089    /// # Ok(()) }
5090    /// ```
5091    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5092
5093    pub(crate) mod client {
5094        use super::super::super::client::FirewallActivation;
5095        pub struct Factory;
5096        impl crate::ClientFactory for Factory {
5097            type Client = FirewallActivation;
5098            type Credentials = gaxi::options::Credentials;
5099            async fn build(
5100                self,
5101                config: gaxi::options::ClientConfig,
5102            ) -> crate::ClientBuilderResult<Self::Client> {
5103                Self::Client::new(config).await
5104            }
5105        }
5106    }
5107
5108    /// Common implementation for [crate::client::FirewallActivation] request builders.
5109    #[derive(Clone, Debug)]
5110    pub(crate) struct RequestBuilder<R: std::default::Default> {
5111        stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5112        request: R,
5113        options: crate::RequestOptions,
5114    }
5115
5116    impl<R> RequestBuilder<R>
5117    where
5118        R: std::default::Default,
5119    {
5120        pub(crate) fn new(
5121            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5122        ) -> Self {
5123            Self {
5124                stub,
5125                request: R::default(),
5126                options: crate::RequestOptions::default(),
5127            }
5128        }
5129    }
5130
5131    /// The request builder for [FirewallActivation::list_firewall_endpoints][crate::client::FirewallActivation::list_firewall_endpoints] calls.
5132    ///
5133    /// # Example
5134    /// ```
5135    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListFirewallEndpoints;
5136    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5137    /// use google_cloud_gax::paginator::ItemPaginator;
5138    ///
5139    /// let builder = prepare_request_builder();
5140    /// let mut items = builder.by_item();
5141    /// while let Some(result) = items.next().await {
5142    ///   let item = result?;
5143    /// }
5144    /// # Ok(()) }
5145    ///
5146    /// fn prepare_request_builder() -> ListFirewallEndpoints {
5147    ///   # panic!();
5148    ///   // ... details omitted ...
5149    /// }
5150    /// ```
5151    #[derive(Clone, Debug)]
5152    pub struct ListFirewallEndpoints(RequestBuilder<crate::model::ListFirewallEndpointsRequest>);
5153
5154    impl ListFirewallEndpoints {
5155        pub(crate) fn new(
5156            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5157        ) -> Self {
5158            Self(RequestBuilder::new(stub))
5159        }
5160
5161        /// Sets the full request, replacing any prior values.
5162        pub fn with_request<V: Into<crate::model::ListFirewallEndpointsRequest>>(
5163            mut self,
5164            v: V,
5165        ) -> Self {
5166            self.0.request = v.into();
5167            self
5168        }
5169
5170        /// Sets all the options, replacing any prior values.
5171        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5172            self.0.options = v.into();
5173            self
5174        }
5175
5176        /// Sends the request.
5177        pub async fn send(self) -> Result<crate::model::ListFirewallEndpointsResponse> {
5178            (*self.0.stub)
5179                .list_firewall_endpoints(self.0.request, self.0.options)
5180                .await
5181                .map(crate::Response::into_body)
5182        }
5183
5184        /// Streams each page in the collection.
5185        pub fn by_page(
5186            self,
5187        ) -> impl google_cloud_gax::paginator::Paginator<
5188            crate::model::ListFirewallEndpointsResponse,
5189            crate::Error,
5190        > {
5191            use std::clone::Clone;
5192            let token = self.0.request.page_token.clone();
5193            let execute = move |token: String| {
5194                let mut builder = self.clone();
5195                builder.0.request = builder.0.request.set_page_token(token);
5196                builder.send()
5197            };
5198            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5199        }
5200
5201        /// Streams each item in the collection.
5202        pub fn by_item(
5203            self,
5204        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5205            crate::model::ListFirewallEndpointsResponse,
5206            crate::Error,
5207        > {
5208            use google_cloud_gax::paginator::Paginator;
5209            self.by_page().items()
5210        }
5211
5212        /// Sets the value of [parent][crate::model::ListFirewallEndpointsRequest::parent].
5213        ///
5214        /// This is a **required** field for requests.
5215        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5216            self.0.request.parent = v.into();
5217            self
5218        }
5219
5220        /// Sets the value of [page_size][crate::model::ListFirewallEndpointsRequest::page_size].
5221        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5222            self.0.request.page_size = v.into();
5223            self
5224        }
5225
5226        /// Sets the value of [page_token][crate::model::ListFirewallEndpointsRequest::page_token].
5227        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5228            self.0.request.page_token = v.into();
5229            self
5230        }
5231
5232        /// Sets the value of [filter][crate::model::ListFirewallEndpointsRequest::filter].
5233        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5234            self.0.request.filter = v.into();
5235            self
5236        }
5237
5238        /// Sets the value of [order_by][crate::model::ListFirewallEndpointsRequest::order_by].
5239        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5240            self.0.request.order_by = v.into();
5241            self
5242        }
5243    }
5244
5245    #[doc(hidden)]
5246    impl crate::RequestBuilder for ListFirewallEndpoints {
5247        fn request_options(&mut self) -> &mut crate::RequestOptions {
5248            &mut self.0.options
5249        }
5250    }
5251
5252    /// The request builder for [FirewallActivation::get_firewall_endpoint][crate::client::FirewallActivation::get_firewall_endpoint] calls.
5253    ///
5254    /// # Example
5255    /// ```
5256    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetFirewallEndpoint;
5257    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5258    ///
5259    /// let builder = prepare_request_builder();
5260    /// let response = builder.send().await?;
5261    /// # Ok(()) }
5262    ///
5263    /// fn prepare_request_builder() -> GetFirewallEndpoint {
5264    ///   # panic!();
5265    ///   // ... details omitted ...
5266    /// }
5267    /// ```
5268    #[derive(Clone, Debug)]
5269    pub struct GetFirewallEndpoint(RequestBuilder<crate::model::GetFirewallEndpointRequest>);
5270
5271    impl GetFirewallEndpoint {
5272        pub(crate) fn new(
5273            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5274        ) -> Self {
5275            Self(RequestBuilder::new(stub))
5276        }
5277
5278        /// Sets the full request, replacing any prior values.
5279        pub fn with_request<V: Into<crate::model::GetFirewallEndpointRequest>>(
5280            mut self,
5281            v: V,
5282        ) -> Self {
5283            self.0.request = v.into();
5284            self
5285        }
5286
5287        /// Sets all the options, replacing any prior values.
5288        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5289            self.0.options = v.into();
5290            self
5291        }
5292
5293        /// Sends the request.
5294        pub async fn send(self) -> Result<crate::model::FirewallEndpoint> {
5295            (*self.0.stub)
5296                .get_firewall_endpoint(self.0.request, self.0.options)
5297                .await
5298                .map(crate::Response::into_body)
5299        }
5300
5301        /// Sets the value of [name][crate::model::GetFirewallEndpointRequest::name].
5302        ///
5303        /// This is a **required** field for requests.
5304        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5305            self.0.request.name = v.into();
5306            self
5307        }
5308    }
5309
5310    #[doc(hidden)]
5311    impl crate::RequestBuilder for GetFirewallEndpoint {
5312        fn request_options(&mut self) -> &mut crate::RequestOptions {
5313            &mut self.0.options
5314        }
5315    }
5316
5317    /// The request builder for [FirewallActivation::create_firewall_endpoint][crate::client::FirewallActivation::create_firewall_endpoint] calls.
5318    ///
5319    /// # Example
5320    /// ```
5321    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::CreateFirewallEndpoint;
5322    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5323    /// use google_cloud_lro::Poller;
5324    ///
5325    /// let builder = prepare_request_builder();
5326    /// let response = builder.poller().until_done().await?;
5327    /// # Ok(()) }
5328    ///
5329    /// fn prepare_request_builder() -> CreateFirewallEndpoint {
5330    ///   # panic!();
5331    ///   // ... details omitted ...
5332    /// }
5333    /// ```
5334    #[derive(Clone, Debug)]
5335    pub struct CreateFirewallEndpoint(RequestBuilder<crate::model::CreateFirewallEndpointRequest>);
5336
5337    impl CreateFirewallEndpoint {
5338        pub(crate) fn new(
5339            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5340        ) -> Self {
5341            Self(RequestBuilder::new(stub))
5342        }
5343
5344        /// Sets the full request, replacing any prior values.
5345        pub fn with_request<V: Into<crate::model::CreateFirewallEndpointRequest>>(
5346            mut self,
5347            v: V,
5348        ) -> Self {
5349            self.0.request = v.into();
5350            self
5351        }
5352
5353        /// Sets all the options, replacing any prior values.
5354        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5355            self.0.options = v.into();
5356            self
5357        }
5358
5359        /// Sends the request.
5360        ///
5361        /// # Long running operations
5362        ///
5363        /// This starts, but does not poll, a longrunning operation. More information
5364        /// on [create_firewall_endpoint][crate::client::FirewallActivation::create_firewall_endpoint].
5365        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5366            (*self.0.stub)
5367                .create_firewall_endpoint(self.0.request, self.0.options)
5368                .await
5369                .map(crate::Response::into_body)
5370        }
5371
5372        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_firewall_endpoint`.
5373        pub fn poller(
5374            self,
5375        ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5376        {
5377            type Operation = google_cloud_lro::internal::Operation<
5378                crate::model::FirewallEndpoint,
5379                crate::model::OperationMetadata,
5380            >;
5381            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5382            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5383
5384            let stub = self.0.stub.clone();
5385            let mut options = self.0.options.clone();
5386            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5387            let query = move |name| {
5388                let stub = stub.clone();
5389                let options = options.clone();
5390                async {
5391                    let op = GetOperation::new(stub)
5392                        .set_name(name)
5393                        .with_options(options)
5394                        .send()
5395                        .await?;
5396                    Ok(Operation::new(op))
5397                }
5398            };
5399
5400            let start = move || async {
5401                let op = self.send().await?;
5402                Ok(Operation::new(op))
5403            };
5404
5405            google_cloud_lro::internal::new_poller(
5406                polling_error_policy,
5407                polling_backoff_policy,
5408                start,
5409                query,
5410            )
5411        }
5412
5413        /// Sets the value of [parent][crate::model::CreateFirewallEndpointRequest::parent].
5414        ///
5415        /// This is a **required** field for requests.
5416        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5417            self.0.request.parent = v.into();
5418            self
5419        }
5420
5421        /// Sets the value of [firewall_endpoint_id][crate::model::CreateFirewallEndpointRequest::firewall_endpoint_id].
5422        ///
5423        /// This is a **required** field for requests.
5424        pub fn set_firewall_endpoint_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5425            self.0.request.firewall_endpoint_id = v.into();
5426            self
5427        }
5428
5429        /// Sets the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
5430        ///
5431        /// This is a **required** field for requests.
5432        pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5433        where
5434            T: std::convert::Into<crate::model::FirewallEndpoint>,
5435        {
5436            self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5437            self
5438        }
5439
5440        /// Sets or clears the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
5441        ///
5442        /// This is a **required** field for requests.
5443        pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5444        where
5445            T: std::convert::Into<crate::model::FirewallEndpoint>,
5446        {
5447            self.0.request.firewall_endpoint = v.map(|x| x.into());
5448            self
5449        }
5450
5451        /// Sets the value of [request_id][crate::model::CreateFirewallEndpointRequest::request_id].
5452        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5453            self.0.request.request_id = v.into();
5454            self
5455        }
5456    }
5457
5458    #[doc(hidden)]
5459    impl crate::RequestBuilder for CreateFirewallEndpoint {
5460        fn request_options(&mut self) -> &mut crate::RequestOptions {
5461            &mut self.0.options
5462        }
5463    }
5464
5465    /// The request builder for [FirewallActivation::delete_firewall_endpoint][crate::client::FirewallActivation::delete_firewall_endpoint] calls.
5466    ///
5467    /// # Example
5468    /// ```
5469    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::DeleteFirewallEndpoint;
5470    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5471    /// use google_cloud_lro::Poller;
5472    ///
5473    /// let builder = prepare_request_builder();
5474    /// let response = builder.poller().until_done().await?;
5475    /// # Ok(()) }
5476    ///
5477    /// fn prepare_request_builder() -> DeleteFirewallEndpoint {
5478    ///   # panic!();
5479    ///   // ... details omitted ...
5480    /// }
5481    /// ```
5482    #[derive(Clone, Debug)]
5483    pub struct DeleteFirewallEndpoint(RequestBuilder<crate::model::DeleteFirewallEndpointRequest>);
5484
5485    impl DeleteFirewallEndpoint {
5486        pub(crate) fn new(
5487            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5488        ) -> Self {
5489            Self(RequestBuilder::new(stub))
5490        }
5491
5492        /// Sets the full request, replacing any prior values.
5493        pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointRequest>>(
5494            mut self,
5495            v: V,
5496        ) -> Self {
5497            self.0.request = v.into();
5498            self
5499        }
5500
5501        /// Sets all the options, replacing any prior values.
5502        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5503            self.0.options = v.into();
5504            self
5505        }
5506
5507        /// Sends the request.
5508        ///
5509        /// # Long running operations
5510        ///
5511        /// This starts, but does not poll, a longrunning operation. More information
5512        /// on [delete_firewall_endpoint][crate::client::FirewallActivation::delete_firewall_endpoint].
5513        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5514            (*self.0.stub)
5515                .delete_firewall_endpoint(self.0.request, self.0.options)
5516                .await
5517                .map(crate::Response::into_body)
5518        }
5519
5520        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_firewall_endpoint`.
5521        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5522            type Operation =
5523                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5524            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5525            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5526
5527            let stub = self.0.stub.clone();
5528            let mut options = self.0.options.clone();
5529            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5530            let query = move |name| {
5531                let stub = stub.clone();
5532                let options = options.clone();
5533                async {
5534                    let op = GetOperation::new(stub)
5535                        .set_name(name)
5536                        .with_options(options)
5537                        .send()
5538                        .await?;
5539                    Ok(Operation::new(op))
5540                }
5541            };
5542
5543            let start = move || async {
5544                let op = self.send().await?;
5545                Ok(Operation::new(op))
5546            };
5547
5548            google_cloud_lro::internal::new_unit_response_poller(
5549                polling_error_policy,
5550                polling_backoff_policy,
5551                start,
5552                query,
5553            )
5554        }
5555
5556        /// Sets the value of [name][crate::model::DeleteFirewallEndpointRequest::name].
5557        ///
5558        /// This is a **required** field for requests.
5559        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5560            self.0.request.name = v.into();
5561            self
5562        }
5563
5564        /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointRequest::request_id].
5565        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5566            self.0.request.request_id = v.into();
5567            self
5568        }
5569    }
5570
5571    #[doc(hidden)]
5572    impl crate::RequestBuilder for DeleteFirewallEndpoint {
5573        fn request_options(&mut self) -> &mut crate::RequestOptions {
5574            &mut self.0.options
5575        }
5576    }
5577
5578    /// The request builder for [FirewallActivation::update_firewall_endpoint][crate::client::FirewallActivation::update_firewall_endpoint] calls.
5579    ///
5580    /// # Example
5581    /// ```
5582    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::UpdateFirewallEndpoint;
5583    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5584    /// use google_cloud_lro::Poller;
5585    ///
5586    /// let builder = prepare_request_builder();
5587    /// let response = builder.poller().until_done().await?;
5588    /// # Ok(()) }
5589    ///
5590    /// fn prepare_request_builder() -> UpdateFirewallEndpoint {
5591    ///   # panic!();
5592    ///   // ... details omitted ...
5593    /// }
5594    /// ```
5595    #[derive(Clone, Debug)]
5596    pub struct UpdateFirewallEndpoint(RequestBuilder<crate::model::UpdateFirewallEndpointRequest>);
5597
5598    impl UpdateFirewallEndpoint {
5599        pub(crate) fn new(
5600            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5601        ) -> Self {
5602            Self(RequestBuilder::new(stub))
5603        }
5604
5605        /// Sets the full request, replacing any prior values.
5606        pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointRequest>>(
5607            mut self,
5608            v: V,
5609        ) -> Self {
5610            self.0.request = v.into();
5611            self
5612        }
5613
5614        /// Sets all the options, replacing any prior values.
5615        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5616            self.0.options = v.into();
5617            self
5618        }
5619
5620        /// Sends the request.
5621        ///
5622        /// # Long running operations
5623        ///
5624        /// This starts, but does not poll, a longrunning operation. More information
5625        /// on [update_firewall_endpoint][crate::client::FirewallActivation::update_firewall_endpoint].
5626        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5627            (*self.0.stub)
5628                .update_firewall_endpoint(self.0.request, self.0.options)
5629                .await
5630                .map(crate::Response::into_body)
5631        }
5632
5633        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_firewall_endpoint`.
5634        pub fn poller(
5635            self,
5636        ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5637        {
5638            type Operation = google_cloud_lro::internal::Operation<
5639                crate::model::FirewallEndpoint,
5640                crate::model::OperationMetadata,
5641            >;
5642            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5643            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5644
5645            let stub = self.0.stub.clone();
5646            let mut options = self.0.options.clone();
5647            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5648            let query = move |name| {
5649                let stub = stub.clone();
5650                let options = options.clone();
5651                async {
5652                    let op = GetOperation::new(stub)
5653                        .set_name(name)
5654                        .with_options(options)
5655                        .send()
5656                        .await?;
5657                    Ok(Operation::new(op))
5658                }
5659            };
5660
5661            let start = move || async {
5662                let op = self.send().await?;
5663                Ok(Operation::new(op))
5664            };
5665
5666            google_cloud_lro::internal::new_poller(
5667                polling_error_policy,
5668                polling_backoff_policy,
5669                start,
5670                query,
5671            )
5672        }
5673
5674        /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
5675        ///
5676        /// This is a **required** field for requests.
5677        pub fn set_update_mask<T>(mut self, v: T) -> Self
5678        where
5679            T: std::convert::Into<wkt::FieldMask>,
5680        {
5681            self.0.request.update_mask = std::option::Option::Some(v.into());
5682            self
5683        }
5684
5685        /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
5686        ///
5687        /// This is a **required** field for requests.
5688        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5689        where
5690            T: std::convert::Into<wkt::FieldMask>,
5691        {
5692            self.0.request.update_mask = v.map(|x| x.into());
5693            self
5694        }
5695
5696        /// Sets the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
5697        ///
5698        /// This is a **required** field for requests.
5699        pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5700        where
5701            T: std::convert::Into<crate::model::FirewallEndpoint>,
5702        {
5703            self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5704            self
5705        }
5706
5707        /// Sets or clears the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
5708        ///
5709        /// This is a **required** field for requests.
5710        pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5711        where
5712            T: std::convert::Into<crate::model::FirewallEndpoint>,
5713        {
5714            self.0.request.firewall_endpoint = v.map(|x| x.into());
5715            self
5716        }
5717
5718        /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointRequest::request_id].
5719        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5720            self.0.request.request_id = v.into();
5721            self
5722        }
5723    }
5724
5725    #[doc(hidden)]
5726    impl crate::RequestBuilder for UpdateFirewallEndpoint {
5727        fn request_options(&mut self) -> &mut crate::RequestOptions {
5728            &mut self.0.options
5729        }
5730    }
5731
5732    /// The request builder for [FirewallActivation::list_firewall_endpoint_associations][crate::client::FirewallActivation::list_firewall_endpoint_associations] calls.
5733    ///
5734    /// # Example
5735    /// ```
5736    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListFirewallEndpointAssociations;
5737    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5738    /// use google_cloud_gax::paginator::ItemPaginator;
5739    ///
5740    /// let builder = prepare_request_builder();
5741    /// let mut items = builder.by_item();
5742    /// while let Some(result) = items.next().await {
5743    ///   let item = result?;
5744    /// }
5745    /// # Ok(()) }
5746    ///
5747    /// fn prepare_request_builder() -> ListFirewallEndpointAssociations {
5748    ///   # panic!();
5749    ///   // ... details omitted ...
5750    /// }
5751    /// ```
5752    #[derive(Clone, Debug)]
5753    pub struct ListFirewallEndpointAssociations(
5754        RequestBuilder<crate::model::ListFirewallEndpointAssociationsRequest>,
5755    );
5756
5757    impl ListFirewallEndpointAssociations {
5758        pub(crate) fn new(
5759            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5760        ) -> Self {
5761            Self(RequestBuilder::new(stub))
5762        }
5763
5764        /// Sets the full request, replacing any prior values.
5765        pub fn with_request<V: Into<crate::model::ListFirewallEndpointAssociationsRequest>>(
5766            mut self,
5767            v: V,
5768        ) -> Self {
5769            self.0.request = v.into();
5770            self
5771        }
5772
5773        /// Sets all the options, replacing any prior values.
5774        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5775            self.0.options = v.into();
5776            self
5777        }
5778
5779        /// Sends the request.
5780        pub async fn send(self) -> Result<crate::model::ListFirewallEndpointAssociationsResponse> {
5781            (*self.0.stub)
5782                .list_firewall_endpoint_associations(self.0.request, self.0.options)
5783                .await
5784                .map(crate::Response::into_body)
5785        }
5786
5787        /// Streams each page in the collection.
5788        pub fn by_page(
5789            self,
5790        ) -> impl google_cloud_gax::paginator::Paginator<
5791            crate::model::ListFirewallEndpointAssociationsResponse,
5792            crate::Error,
5793        > {
5794            use std::clone::Clone;
5795            let token = self.0.request.page_token.clone();
5796            let execute = move |token: String| {
5797                let mut builder = self.clone();
5798                builder.0.request = builder.0.request.set_page_token(token);
5799                builder.send()
5800            };
5801            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5802        }
5803
5804        /// Streams each item in the collection.
5805        pub fn by_item(
5806            self,
5807        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5808            crate::model::ListFirewallEndpointAssociationsResponse,
5809            crate::Error,
5810        > {
5811            use google_cloud_gax::paginator::Paginator;
5812            self.by_page().items()
5813        }
5814
5815        /// Sets the value of [parent][crate::model::ListFirewallEndpointAssociationsRequest::parent].
5816        ///
5817        /// This is a **required** field for requests.
5818        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5819            self.0.request.parent = v.into();
5820            self
5821        }
5822
5823        /// Sets the value of [page_size][crate::model::ListFirewallEndpointAssociationsRequest::page_size].
5824        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5825            self.0.request.page_size = v.into();
5826            self
5827        }
5828
5829        /// Sets the value of [page_token][crate::model::ListFirewallEndpointAssociationsRequest::page_token].
5830        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5831            self.0.request.page_token = v.into();
5832            self
5833        }
5834
5835        /// Sets the value of [filter][crate::model::ListFirewallEndpointAssociationsRequest::filter].
5836        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5837            self.0.request.filter = v.into();
5838            self
5839        }
5840
5841        /// Sets the value of [order_by][crate::model::ListFirewallEndpointAssociationsRequest::order_by].
5842        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5843            self.0.request.order_by = v.into();
5844            self
5845        }
5846    }
5847
5848    #[doc(hidden)]
5849    impl crate::RequestBuilder for ListFirewallEndpointAssociations {
5850        fn request_options(&mut self) -> &mut crate::RequestOptions {
5851            &mut self.0.options
5852        }
5853    }
5854
5855    /// The request builder for [FirewallActivation::get_firewall_endpoint_association][crate::client::FirewallActivation::get_firewall_endpoint_association] calls.
5856    ///
5857    /// # Example
5858    /// ```
5859    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetFirewallEndpointAssociation;
5860    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5861    ///
5862    /// let builder = prepare_request_builder();
5863    /// let response = builder.send().await?;
5864    /// # Ok(()) }
5865    ///
5866    /// fn prepare_request_builder() -> GetFirewallEndpointAssociation {
5867    ///   # panic!();
5868    ///   // ... details omitted ...
5869    /// }
5870    /// ```
5871    #[derive(Clone, Debug)]
5872    pub struct GetFirewallEndpointAssociation(
5873        RequestBuilder<crate::model::GetFirewallEndpointAssociationRequest>,
5874    );
5875
5876    impl GetFirewallEndpointAssociation {
5877        pub(crate) fn new(
5878            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5879        ) -> Self {
5880            Self(RequestBuilder::new(stub))
5881        }
5882
5883        /// Sets the full request, replacing any prior values.
5884        pub fn with_request<V: Into<crate::model::GetFirewallEndpointAssociationRequest>>(
5885            mut self,
5886            v: V,
5887        ) -> Self {
5888            self.0.request = v.into();
5889            self
5890        }
5891
5892        /// Sets all the options, replacing any prior values.
5893        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5894            self.0.options = v.into();
5895            self
5896        }
5897
5898        /// Sends the request.
5899        pub async fn send(self) -> Result<crate::model::FirewallEndpointAssociation> {
5900            (*self.0.stub)
5901                .get_firewall_endpoint_association(self.0.request, self.0.options)
5902                .await
5903                .map(crate::Response::into_body)
5904        }
5905
5906        /// Sets the value of [name][crate::model::GetFirewallEndpointAssociationRequest::name].
5907        ///
5908        /// This is a **required** field for requests.
5909        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5910            self.0.request.name = v.into();
5911            self
5912        }
5913    }
5914
5915    #[doc(hidden)]
5916    impl crate::RequestBuilder for GetFirewallEndpointAssociation {
5917        fn request_options(&mut self) -> &mut crate::RequestOptions {
5918            &mut self.0.options
5919        }
5920    }
5921
5922    /// The request builder for [FirewallActivation::create_firewall_endpoint_association][crate::client::FirewallActivation::create_firewall_endpoint_association] calls.
5923    ///
5924    /// # Example
5925    /// ```
5926    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::CreateFirewallEndpointAssociation;
5927    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5928    /// use google_cloud_lro::Poller;
5929    ///
5930    /// let builder = prepare_request_builder();
5931    /// let response = builder.poller().until_done().await?;
5932    /// # Ok(()) }
5933    ///
5934    /// fn prepare_request_builder() -> CreateFirewallEndpointAssociation {
5935    ///   # panic!();
5936    ///   // ... details omitted ...
5937    /// }
5938    /// ```
5939    #[derive(Clone, Debug)]
5940    pub struct CreateFirewallEndpointAssociation(
5941        RequestBuilder<crate::model::CreateFirewallEndpointAssociationRequest>,
5942    );
5943
5944    impl CreateFirewallEndpointAssociation {
5945        pub(crate) fn new(
5946            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5947        ) -> Self {
5948            Self(RequestBuilder::new(stub))
5949        }
5950
5951        /// Sets the full request, replacing any prior values.
5952        pub fn with_request<V: Into<crate::model::CreateFirewallEndpointAssociationRequest>>(
5953            mut self,
5954            v: V,
5955        ) -> Self {
5956            self.0.request = v.into();
5957            self
5958        }
5959
5960        /// Sets all the options, replacing any prior values.
5961        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5962            self.0.options = v.into();
5963            self
5964        }
5965
5966        /// Sends the request.
5967        ///
5968        /// # Long running operations
5969        ///
5970        /// This starts, but does not poll, a longrunning operation. More information
5971        /// on [create_firewall_endpoint_association][crate::client::FirewallActivation::create_firewall_endpoint_association].
5972        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5973            (*self.0.stub)
5974                .create_firewall_endpoint_association(self.0.request, self.0.options)
5975                .await
5976                .map(crate::Response::into_body)
5977        }
5978
5979        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_firewall_endpoint_association`.
5980        pub fn poller(
5981            self,
5982        ) -> impl google_cloud_lro::Poller<
5983            crate::model::FirewallEndpointAssociation,
5984            crate::model::OperationMetadata,
5985        > {
5986            type Operation = google_cloud_lro::internal::Operation<
5987                crate::model::FirewallEndpointAssociation,
5988                crate::model::OperationMetadata,
5989            >;
5990            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5991            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5992
5993            let stub = self.0.stub.clone();
5994            let mut options = self.0.options.clone();
5995            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5996            let query = move |name| {
5997                let stub = stub.clone();
5998                let options = options.clone();
5999                async {
6000                    let op = GetOperation::new(stub)
6001                        .set_name(name)
6002                        .with_options(options)
6003                        .send()
6004                        .await?;
6005                    Ok(Operation::new(op))
6006                }
6007            };
6008
6009            let start = move || async {
6010                let op = self.send().await?;
6011                Ok(Operation::new(op))
6012            };
6013
6014            google_cloud_lro::internal::new_poller(
6015                polling_error_policy,
6016                polling_backoff_policy,
6017                start,
6018                query,
6019            )
6020        }
6021
6022        /// Sets the value of [parent][crate::model::CreateFirewallEndpointAssociationRequest::parent].
6023        ///
6024        /// This is a **required** field for requests.
6025        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6026            self.0.request.parent = v.into();
6027            self
6028        }
6029
6030        /// Sets the value of [firewall_endpoint_association_id][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association_id].
6031        pub fn set_firewall_endpoint_association_id<T: Into<std::string::String>>(
6032            mut self,
6033            v: T,
6034        ) -> Self {
6035            self.0.request.firewall_endpoint_association_id = v.into();
6036            self
6037        }
6038
6039        /// Sets the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
6040        ///
6041        /// This is a **required** field for requests.
6042        pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
6043        where
6044            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6045        {
6046            self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
6047            self
6048        }
6049
6050        /// Sets or clears the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
6051        ///
6052        /// This is a **required** field for requests.
6053        pub fn set_or_clear_firewall_endpoint_association<T>(
6054            mut self,
6055            v: std::option::Option<T>,
6056        ) -> Self
6057        where
6058            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6059        {
6060            self.0.request.firewall_endpoint_association = v.map(|x| x.into());
6061            self
6062        }
6063
6064        /// Sets the value of [request_id][crate::model::CreateFirewallEndpointAssociationRequest::request_id].
6065        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6066            self.0.request.request_id = v.into();
6067            self
6068        }
6069    }
6070
6071    #[doc(hidden)]
6072    impl crate::RequestBuilder for CreateFirewallEndpointAssociation {
6073        fn request_options(&mut self) -> &mut crate::RequestOptions {
6074            &mut self.0.options
6075        }
6076    }
6077
6078    /// The request builder for [FirewallActivation::delete_firewall_endpoint_association][crate::client::FirewallActivation::delete_firewall_endpoint_association] calls.
6079    ///
6080    /// # Example
6081    /// ```
6082    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::DeleteFirewallEndpointAssociation;
6083    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6084    /// use google_cloud_lro::Poller;
6085    ///
6086    /// let builder = prepare_request_builder();
6087    /// let response = builder.poller().until_done().await?;
6088    /// # Ok(()) }
6089    ///
6090    /// fn prepare_request_builder() -> DeleteFirewallEndpointAssociation {
6091    ///   # panic!();
6092    ///   // ... details omitted ...
6093    /// }
6094    /// ```
6095    #[derive(Clone, Debug)]
6096    pub struct DeleteFirewallEndpointAssociation(
6097        RequestBuilder<crate::model::DeleteFirewallEndpointAssociationRequest>,
6098    );
6099
6100    impl DeleteFirewallEndpointAssociation {
6101        pub(crate) fn new(
6102            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6103        ) -> Self {
6104            Self(RequestBuilder::new(stub))
6105        }
6106
6107        /// Sets the full request, replacing any prior values.
6108        pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointAssociationRequest>>(
6109            mut self,
6110            v: V,
6111        ) -> Self {
6112            self.0.request = v.into();
6113            self
6114        }
6115
6116        /// Sets all the options, replacing any prior values.
6117        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6118            self.0.options = v.into();
6119            self
6120        }
6121
6122        /// Sends the request.
6123        ///
6124        /// # Long running operations
6125        ///
6126        /// This starts, but does not poll, a longrunning operation. More information
6127        /// on [delete_firewall_endpoint_association][crate::client::FirewallActivation::delete_firewall_endpoint_association].
6128        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6129            (*self.0.stub)
6130                .delete_firewall_endpoint_association(self.0.request, self.0.options)
6131                .await
6132                .map(crate::Response::into_body)
6133        }
6134
6135        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_firewall_endpoint_association`.
6136        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6137            type Operation =
6138                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6139            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6140            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6141
6142            let stub = self.0.stub.clone();
6143            let mut options = self.0.options.clone();
6144            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6145            let query = move |name| {
6146                let stub = stub.clone();
6147                let options = options.clone();
6148                async {
6149                    let op = GetOperation::new(stub)
6150                        .set_name(name)
6151                        .with_options(options)
6152                        .send()
6153                        .await?;
6154                    Ok(Operation::new(op))
6155                }
6156            };
6157
6158            let start = move || async {
6159                let op = self.send().await?;
6160                Ok(Operation::new(op))
6161            };
6162
6163            google_cloud_lro::internal::new_unit_response_poller(
6164                polling_error_policy,
6165                polling_backoff_policy,
6166                start,
6167                query,
6168            )
6169        }
6170
6171        /// Sets the value of [name][crate::model::DeleteFirewallEndpointAssociationRequest::name].
6172        ///
6173        /// This is a **required** field for requests.
6174        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6175            self.0.request.name = v.into();
6176            self
6177        }
6178
6179        /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointAssociationRequest::request_id].
6180        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6181            self.0.request.request_id = v.into();
6182            self
6183        }
6184    }
6185
6186    #[doc(hidden)]
6187    impl crate::RequestBuilder for DeleteFirewallEndpointAssociation {
6188        fn request_options(&mut self) -> &mut crate::RequestOptions {
6189            &mut self.0.options
6190        }
6191    }
6192
6193    /// The request builder for [FirewallActivation::update_firewall_endpoint_association][crate::client::FirewallActivation::update_firewall_endpoint_association] calls.
6194    ///
6195    /// # Example
6196    /// ```
6197    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::UpdateFirewallEndpointAssociation;
6198    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6199    /// use google_cloud_lro::Poller;
6200    ///
6201    /// let builder = prepare_request_builder();
6202    /// let response = builder.poller().until_done().await?;
6203    /// # Ok(()) }
6204    ///
6205    /// fn prepare_request_builder() -> UpdateFirewallEndpointAssociation {
6206    ///   # panic!();
6207    ///   // ... details omitted ...
6208    /// }
6209    /// ```
6210    #[derive(Clone, Debug)]
6211    pub struct UpdateFirewallEndpointAssociation(
6212        RequestBuilder<crate::model::UpdateFirewallEndpointAssociationRequest>,
6213    );
6214
6215    impl UpdateFirewallEndpointAssociation {
6216        pub(crate) fn new(
6217            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6218        ) -> Self {
6219            Self(RequestBuilder::new(stub))
6220        }
6221
6222        /// Sets the full request, replacing any prior values.
6223        pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointAssociationRequest>>(
6224            mut self,
6225            v: V,
6226        ) -> Self {
6227            self.0.request = v.into();
6228            self
6229        }
6230
6231        /// Sets all the options, replacing any prior values.
6232        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6233            self.0.options = v.into();
6234            self
6235        }
6236
6237        /// Sends the request.
6238        ///
6239        /// # Long running operations
6240        ///
6241        /// This starts, but does not poll, a longrunning operation. More information
6242        /// on [update_firewall_endpoint_association][crate::client::FirewallActivation::update_firewall_endpoint_association].
6243        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6244            (*self.0.stub)
6245                .update_firewall_endpoint_association(self.0.request, self.0.options)
6246                .await
6247                .map(crate::Response::into_body)
6248        }
6249
6250        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_firewall_endpoint_association`.
6251        pub fn poller(
6252            self,
6253        ) -> impl google_cloud_lro::Poller<
6254            crate::model::FirewallEndpointAssociation,
6255            crate::model::OperationMetadata,
6256        > {
6257            type Operation = google_cloud_lro::internal::Operation<
6258                crate::model::FirewallEndpointAssociation,
6259                crate::model::OperationMetadata,
6260            >;
6261            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6262            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6263
6264            let stub = self.0.stub.clone();
6265            let mut options = self.0.options.clone();
6266            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6267            let query = move |name| {
6268                let stub = stub.clone();
6269                let options = options.clone();
6270                async {
6271                    let op = GetOperation::new(stub)
6272                        .set_name(name)
6273                        .with_options(options)
6274                        .send()
6275                        .await?;
6276                    Ok(Operation::new(op))
6277                }
6278            };
6279
6280            let start = move || async {
6281                let op = self.send().await?;
6282                Ok(Operation::new(op))
6283            };
6284
6285            google_cloud_lro::internal::new_poller(
6286                polling_error_policy,
6287                polling_backoff_policy,
6288                start,
6289                query,
6290            )
6291        }
6292
6293        /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
6294        ///
6295        /// This is a **required** field for requests.
6296        pub fn set_update_mask<T>(mut self, v: T) -> Self
6297        where
6298            T: std::convert::Into<wkt::FieldMask>,
6299        {
6300            self.0.request.update_mask = std::option::Option::Some(v.into());
6301            self
6302        }
6303
6304        /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
6305        ///
6306        /// This is a **required** field for requests.
6307        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6308        where
6309            T: std::convert::Into<wkt::FieldMask>,
6310        {
6311            self.0.request.update_mask = v.map(|x| x.into());
6312            self
6313        }
6314
6315        /// Sets the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
6316        ///
6317        /// This is a **required** field for requests.
6318        pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
6319        where
6320            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6321        {
6322            self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
6323            self
6324        }
6325
6326        /// Sets or clears the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
6327        ///
6328        /// This is a **required** field for requests.
6329        pub fn set_or_clear_firewall_endpoint_association<T>(
6330            mut self,
6331            v: std::option::Option<T>,
6332        ) -> Self
6333        where
6334            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6335        {
6336            self.0.request.firewall_endpoint_association = v.map(|x| x.into());
6337            self
6338        }
6339
6340        /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointAssociationRequest::request_id].
6341        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6342            self.0.request.request_id = v.into();
6343            self
6344        }
6345    }
6346
6347    #[doc(hidden)]
6348    impl crate::RequestBuilder for UpdateFirewallEndpointAssociation {
6349        fn request_options(&mut self) -> &mut crate::RequestOptions {
6350            &mut self.0.options
6351        }
6352    }
6353
6354    /// The request builder for [FirewallActivation::list_locations][crate::client::FirewallActivation::list_locations] calls.
6355    ///
6356    /// # Example
6357    /// ```
6358    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListLocations;
6359    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6360    /// use google_cloud_gax::paginator::ItemPaginator;
6361    ///
6362    /// let builder = prepare_request_builder();
6363    /// let mut items = builder.by_item();
6364    /// while let Some(result) = items.next().await {
6365    ///   let item = result?;
6366    /// }
6367    /// # Ok(()) }
6368    ///
6369    /// fn prepare_request_builder() -> ListLocations {
6370    ///   # panic!();
6371    ///   // ... details omitted ...
6372    /// }
6373    /// ```
6374    #[derive(Clone, Debug)]
6375    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6376
6377    impl ListLocations {
6378        pub(crate) fn new(
6379            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6380        ) -> Self {
6381            Self(RequestBuilder::new(stub))
6382        }
6383
6384        /// Sets the full request, replacing any prior values.
6385        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6386            mut self,
6387            v: V,
6388        ) -> Self {
6389            self.0.request = v.into();
6390            self
6391        }
6392
6393        /// Sets all the options, replacing any prior values.
6394        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6395            self.0.options = v.into();
6396            self
6397        }
6398
6399        /// Sends the request.
6400        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6401            (*self.0.stub)
6402                .list_locations(self.0.request, self.0.options)
6403                .await
6404                .map(crate::Response::into_body)
6405        }
6406
6407        /// Streams each page in the collection.
6408        pub fn by_page(
6409            self,
6410        ) -> impl google_cloud_gax::paginator::Paginator<
6411            google_cloud_location::model::ListLocationsResponse,
6412            crate::Error,
6413        > {
6414            use std::clone::Clone;
6415            let token = self.0.request.page_token.clone();
6416            let execute = move |token: String| {
6417                let mut builder = self.clone();
6418                builder.0.request = builder.0.request.set_page_token(token);
6419                builder.send()
6420            };
6421            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6422        }
6423
6424        /// Streams each item in the collection.
6425        pub fn by_item(
6426            self,
6427        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6428            google_cloud_location::model::ListLocationsResponse,
6429            crate::Error,
6430        > {
6431            use google_cloud_gax::paginator::Paginator;
6432            self.by_page().items()
6433        }
6434
6435        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
6436        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6437            self.0.request.name = v.into();
6438            self
6439        }
6440
6441        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
6442        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6443            self.0.request.filter = v.into();
6444            self
6445        }
6446
6447        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
6448        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6449            self.0.request.page_size = v.into();
6450            self
6451        }
6452
6453        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
6454        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6455            self.0.request.page_token = v.into();
6456            self
6457        }
6458    }
6459
6460    #[doc(hidden)]
6461    impl crate::RequestBuilder for ListLocations {
6462        fn request_options(&mut self) -> &mut crate::RequestOptions {
6463            &mut self.0.options
6464        }
6465    }
6466
6467    /// The request builder for [FirewallActivation::get_location][crate::client::FirewallActivation::get_location] calls.
6468    ///
6469    /// # Example
6470    /// ```
6471    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetLocation;
6472    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6473    ///
6474    /// let builder = prepare_request_builder();
6475    /// let response = builder.send().await?;
6476    /// # Ok(()) }
6477    ///
6478    /// fn prepare_request_builder() -> GetLocation {
6479    ///   # panic!();
6480    ///   // ... details omitted ...
6481    /// }
6482    /// ```
6483    #[derive(Clone, Debug)]
6484    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6485
6486    impl GetLocation {
6487        pub(crate) fn new(
6488            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6489        ) -> Self {
6490            Self(RequestBuilder::new(stub))
6491        }
6492
6493        /// Sets the full request, replacing any prior values.
6494        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6495            mut self,
6496            v: V,
6497        ) -> Self {
6498            self.0.request = v.into();
6499            self
6500        }
6501
6502        /// Sets all the options, replacing any prior values.
6503        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6504            self.0.options = v.into();
6505            self
6506        }
6507
6508        /// Sends the request.
6509        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6510            (*self.0.stub)
6511                .get_location(self.0.request, self.0.options)
6512                .await
6513                .map(crate::Response::into_body)
6514        }
6515
6516        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
6517        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6518            self.0.request.name = v.into();
6519            self
6520        }
6521    }
6522
6523    #[doc(hidden)]
6524    impl crate::RequestBuilder for GetLocation {
6525        fn request_options(&mut self) -> &mut crate::RequestOptions {
6526            &mut self.0.options
6527        }
6528    }
6529
6530    /// The request builder for [FirewallActivation::set_iam_policy][crate::client::FirewallActivation::set_iam_policy] calls.
6531    ///
6532    /// # Example
6533    /// ```
6534    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::SetIamPolicy;
6535    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6536    ///
6537    /// let builder = prepare_request_builder();
6538    /// let response = builder.send().await?;
6539    /// # Ok(()) }
6540    ///
6541    /// fn prepare_request_builder() -> SetIamPolicy {
6542    ///   # panic!();
6543    ///   // ... details omitted ...
6544    /// }
6545    /// ```
6546    #[derive(Clone, Debug)]
6547    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6548
6549    impl SetIamPolicy {
6550        pub(crate) fn new(
6551            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6552        ) -> Self {
6553            Self(RequestBuilder::new(stub))
6554        }
6555
6556        /// Sets the full request, replacing any prior values.
6557        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6558            mut self,
6559            v: V,
6560        ) -> Self {
6561            self.0.request = v.into();
6562            self
6563        }
6564
6565        /// Sets all the options, replacing any prior values.
6566        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6567            self.0.options = v.into();
6568            self
6569        }
6570
6571        /// Sends the request.
6572        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6573            (*self.0.stub)
6574                .set_iam_policy(self.0.request, self.0.options)
6575                .await
6576                .map(crate::Response::into_body)
6577        }
6578
6579        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
6580        ///
6581        /// This is a **required** field for requests.
6582        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6583            self.0.request.resource = v.into();
6584            self
6585        }
6586
6587        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
6588        ///
6589        /// This is a **required** field for requests.
6590        pub fn set_policy<T>(mut self, v: T) -> Self
6591        where
6592            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6593        {
6594            self.0.request.policy = std::option::Option::Some(v.into());
6595            self
6596        }
6597
6598        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
6599        ///
6600        /// This is a **required** field for requests.
6601        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6602        where
6603            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6604        {
6605            self.0.request.policy = v.map(|x| x.into());
6606            self
6607        }
6608
6609        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
6610        pub fn set_update_mask<T>(mut self, v: T) -> Self
6611        where
6612            T: std::convert::Into<wkt::FieldMask>,
6613        {
6614            self.0.request.update_mask = std::option::Option::Some(v.into());
6615            self
6616        }
6617
6618        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
6619        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6620        where
6621            T: std::convert::Into<wkt::FieldMask>,
6622        {
6623            self.0.request.update_mask = v.map(|x| x.into());
6624            self
6625        }
6626    }
6627
6628    #[doc(hidden)]
6629    impl crate::RequestBuilder for SetIamPolicy {
6630        fn request_options(&mut self) -> &mut crate::RequestOptions {
6631            &mut self.0.options
6632        }
6633    }
6634
6635    /// The request builder for [FirewallActivation::get_iam_policy][crate::client::FirewallActivation::get_iam_policy] calls.
6636    ///
6637    /// # Example
6638    /// ```
6639    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetIamPolicy;
6640    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6641    ///
6642    /// let builder = prepare_request_builder();
6643    /// let response = builder.send().await?;
6644    /// # Ok(()) }
6645    ///
6646    /// fn prepare_request_builder() -> GetIamPolicy {
6647    ///   # panic!();
6648    ///   // ... details omitted ...
6649    /// }
6650    /// ```
6651    #[derive(Clone, Debug)]
6652    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
6653
6654    impl GetIamPolicy {
6655        pub(crate) fn new(
6656            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6657        ) -> Self {
6658            Self(RequestBuilder::new(stub))
6659        }
6660
6661        /// Sets the full request, replacing any prior values.
6662        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
6663            mut self,
6664            v: V,
6665        ) -> Self {
6666            self.0.request = v.into();
6667            self
6668        }
6669
6670        /// Sets all the options, replacing any prior values.
6671        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6672            self.0.options = v.into();
6673            self
6674        }
6675
6676        /// Sends the request.
6677        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6678            (*self.0.stub)
6679                .get_iam_policy(self.0.request, self.0.options)
6680                .await
6681                .map(crate::Response::into_body)
6682        }
6683
6684        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
6685        ///
6686        /// This is a **required** field for requests.
6687        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6688            self.0.request.resource = v.into();
6689            self
6690        }
6691
6692        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
6693        pub fn set_options<T>(mut self, v: T) -> Self
6694        where
6695            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6696        {
6697            self.0.request.options = std::option::Option::Some(v.into());
6698            self
6699        }
6700
6701        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
6702        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6703        where
6704            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6705        {
6706            self.0.request.options = v.map(|x| x.into());
6707            self
6708        }
6709    }
6710
6711    #[doc(hidden)]
6712    impl crate::RequestBuilder for GetIamPolicy {
6713        fn request_options(&mut self) -> &mut crate::RequestOptions {
6714            &mut self.0.options
6715        }
6716    }
6717
6718    /// The request builder for [FirewallActivation::test_iam_permissions][crate::client::FirewallActivation::test_iam_permissions] calls.
6719    ///
6720    /// # Example
6721    /// ```
6722    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::TestIamPermissions;
6723    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6724    ///
6725    /// let builder = prepare_request_builder();
6726    /// let response = builder.send().await?;
6727    /// # Ok(()) }
6728    ///
6729    /// fn prepare_request_builder() -> TestIamPermissions {
6730    ///   # panic!();
6731    ///   // ... details omitted ...
6732    /// }
6733    /// ```
6734    #[derive(Clone, Debug)]
6735    pub struct TestIamPermissions(
6736        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6737    );
6738
6739    impl TestIamPermissions {
6740        pub(crate) fn new(
6741            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6742        ) -> Self {
6743            Self(RequestBuilder::new(stub))
6744        }
6745
6746        /// Sets the full request, replacing any prior values.
6747        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
6748            mut self,
6749            v: V,
6750        ) -> Self {
6751            self.0.request = v.into();
6752            self
6753        }
6754
6755        /// Sets all the options, replacing any prior values.
6756        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6757            self.0.options = v.into();
6758            self
6759        }
6760
6761        /// Sends the request.
6762        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6763            (*self.0.stub)
6764                .test_iam_permissions(self.0.request, self.0.options)
6765                .await
6766                .map(crate::Response::into_body)
6767        }
6768
6769        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
6770        ///
6771        /// This is a **required** field for requests.
6772        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6773            self.0.request.resource = v.into();
6774            self
6775        }
6776
6777        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
6778        ///
6779        /// This is a **required** field for requests.
6780        pub fn set_permissions<T, V>(mut self, v: T) -> Self
6781        where
6782            T: std::iter::IntoIterator<Item = V>,
6783            V: std::convert::Into<std::string::String>,
6784        {
6785            use std::iter::Iterator;
6786            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6787            self
6788        }
6789    }
6790
6791    #[doc(hidden)]
6792    impl crate::RequestBuilder for TestIamPermissions {
6793        fn request_options(&mut self) -> &mut crate::RequestOptions {
6794            &mut self.0.options
6795        }
6796    }
6797
6798    /// The request builder for [FirewallActivation::list_operations][crate::client::FirewallActivation::list_operations] calls.
6799    ///
6800    /// # Example
6801    /// ```
6802    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListOperations;
6803    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6804    /// use google_cloud_gax::paginator::ItemPaginator;
6805    ///
6806    /// let builder = prepare_request_builder();
6807    /// let mut items = builder.by_item();
6808    /// while let Some(result) = items.next().await {
6809    ///   let item = result?;
6810    /// }
6811    /// # Ok(()) }
6812    ///
6813    /// fn prepare_request_builder() -> ListOperations {
6814    ///   # panic!();
6815    ///   // ... details omitted ...
6816    /// }
6817    /// ```
6818    #[derive(Clone, Debug)]
6819    pub struct ListOperations(
6820        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6821    );
6822
6823    impl ListOperations {
6824        pub(crate) fn new(
6825            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6826        ) -> Self {
6827            Self(RequestBuilder::new(stub))
6828        }
6829
6830        /// Sets the full request, replacing any prior values.
6831        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6832            mut self,
6833            v: V,
6834        ) -> Self {
6835            self.0.request = v.into();
6836            self
6837        }
6838
6839        /// Sets all the options, replacing any prior values.
6840        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6841            self.0.options = v.into();
6842            self
6843        }
6844
6845        /// Sends the request.
6846        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6847            (*self.0.stub)
6848                .list_operations(self.0.request, self.0.options)
6849                .await
6850                .map(crate::Response::into_body)
6851        }
6852
6853        /// Streams each page in the collection.
6854        pub fn by_page(
6855            self,
6856        ) -> impl google_cloud_gax::paginator::Paginator<
6857            google_cloud_longrunning::model::ListOperationsResponse,
6858            crate::Error,
6859        > {
6860            use std::clone::Clone;
6861            let token = self.0.request.page_token.clone();
6862            let execute = move |token: String| {
6863                let mut builder = self.clone();
6864                builder.0.request = builder.0.request.set_page_token(token);
6865                builder.send()
6866            };
6867            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6868        }
6869
6870        /// Streams each item in the collection.
6871        pub fn by_item(
6872            self,
6873        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6874            google_cloud_longrunning::model::ListOperationsResponse,
6875            crate::Error,
6876        > {
6877            use google_cloud_gax::paginator::Paginator;
6878            self.by_page().items()
6879        }
6880
6881        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
6882        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6883            self.0.request.name = v.into();
6884            self
6885        }
6886
6887        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
6888        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6889            self.0.request.filter = v.into();
6890            self
6891        }
6892
6893        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
6894        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6895            self.0.request.page_size = v.into();
6896            self
6897        }
6898
6899        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
6900        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6901            self.0.request.page_token = v.into();
6902            self
6903        }
6904
6905        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
6906        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6907            self.0.request.return_partial_success = v.into();
6908            self
6909        }
6910    }
6911
6912    #[doc(hidden)]
6913    impl crate::RequestBuilder for ListOperations {
6914        fn request_options(&mut self) -> &mut crate::RequestOptions {
6915            &mut self.0.options
6916        }
6917    }
6918
6919    /// The request builder for [FirewallActivation::get_operation][crate::client::FirewallActivation::get_operation] calls.
6920    ///
6921    /// # Example
6922    /// ```
6923    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetOperation;
6924    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6925    ///
6926    /// let builder = prepare_request_builder();
6927    /// let response = builder.send().await?;
6928    /// # Ok(()) }
6929    ///
6930    /// fn prepare_request_builder() -> GetOperation {
6931    ///   # panic!();
6932    ///   // ... details omitted ...
6933    /// }
6934    /// ```
6935    #[derive(Clone, Debug)]
6936    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6937
6938    impl GetOperation {
6939        pub(crate) fn new(
6940            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6941        ) -> Self {
6942            Self(RequestBuilder::new(stub))
6943        }
6944
6945        /// Sets the full request, replacing any prior values.
6946        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6947            mut self,
6948            v: V,
6949        ) -> Self {
6950            self.0.request = v.into();
6951            self
6952        }
6953
6954        /// Sets all the options, replacing any prior values.
6955        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6956            self.0.options = v.into();
6957            self
6958        }
6959
6960        /// Sends the request.
6961        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6962            (*self.0.stub)
6963                .get_operation(self.0.request, self.0.options)
6964                .await
6965                .map(crate::Response::into_body)
6966        }
6967
6968        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
6969        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6970            self.0.request.name = v.into();
6971            self
6972        }
6973    }
6974
6975    #[doc(hidden)]
6976    impl crate::RequestBuilder for GetOperation {
6977        fn request_options(&mut self) -> &mut crate::RequestOptions {
6978            &mut self.0.options
6979        }
6980    }
6981
6982    /// The request builder for [FirewallActivation::delete_operation][crate::client::FirewallActivation::delete_operation] calls.
6983    ///
6984    /// # Example
6985    /// ```
6986    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::DeleteOperation;
6987    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6988    ///
6989    /// let builder = prepare_request_builder();
6990    /// let response = builder.send().await?;
6991    /// # Ok(()) }
6992    ///
6993    /// fn prepare_request_builder() -> DeleteOperation {
6994    ///   # panic!();
6995    ///   // ... details omitted ...
6996    /// }
6997    /// ```
6998    #[derive(Clone, Debug)]
6999    pub struct DeleteOperation(
7000        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7001    );
7002
7003    impl DeleteOperation {
7004        pub(crate) fn new(
7005            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7006        ) -> Self {
7007            Self(RequestBuilder::new(stub))
7008        }
7009
7010        /// Sets the full request, replacing any prior values.
7011        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7012            mut self,
7013            v: V,
7014        ) -> Self {
7015            self.0.request = v.into();
7016            self
7017        }
7018
7019        /// Sets all the options, replacing any prior values.
7020        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7021            self.0.options = v.into();
7022            self
7023        }
7024
7025        /// Sends the request.
7026        pub async fn send(self) -> Result<()> {
7027            (*self.0.stub)
7028                .delete_operation(self.0.request, self.0.options)
7029                .await
7030                .map(crate::Response::into_body)
7031        }
7032
7033        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
7034        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7035            self.0.request.name = v.into();
7036            self
7037        }
7038    }
7039
7040    #[doc(hidden)]
7041    impl crate::RequestBuilder for DeleteOperation {
7042        fn request_options(&mut self) -> &mut crate::RequestOptions {
7043            &mut self.0.options
7044        }
7045    }
7046
7047    /// The request builder for [FirewallActivation::cancel_operation][crate::client::FirewallActivation::cancel_operation] calls.
7048    ///
7049    /// # Example
7050    /// ```
7051    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::CancelOperation;
7052    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7053    ///
7054    /// let builder = prepare_request_builder();
7055    /// let response = builder.send().await?;
7056    /// # Ok(()) }
7057    ///
7058    /// fn prepare_request_builder() -> CancelOperation {
7059    ///   # panic!();
7060    ///   // ... details omitted ...
7061    /// }
7062    /// ```
7063    #[derive(Clone, Debug)]
7064    pub struct CancelOperation(
7065        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7066    );
7067
7068    impl CancelOperation {
7069        pub(crate) fn new(
7070            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7071        ) -> Self {
7072            Self(RequestBuilder::new(stub))
7073        }
7074
7075        /// Sets the full request, replacing any prior values.
7076        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7077            mut self,
7078            v: V,
7079        ) -> Self {
7080            self.0.request = v.into();
7081            self
7082        }
7083
7084        /// Sets all the options, replacing any prior values.
7085        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7086            self.0.options = v.into();
7087            self
7088        }
7089
7090        /// Sends the request.
7091        pub async fn send(self) -> Result<()> {
7092            (*self.0.stub)
7093                .cancel_operation(self.0.request, self.0.options)
7094                .await
7095                .map(crate::Response::into_body)
7096        }
7097
7098        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
7099        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7100            self.0.request.name = v.into();
7101            self
7102        }
7103    }
7104
7105    #[doc(hidden)]
7106    impl crate::RequestBuilder for CancelOperation {
7107        fn request_options(&mut self) -> &mut crate::RequestOptions {
7108            &mut self.0.options
7109        }
7110    }
7111}
7112
7113pub mod intercept {
7114    use crate::Result;
7115
7116    /// A builder for [Intercept][crate::client::Intercept].
7117    ///
7118    /// ```
7119    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7120    /// # use google_cloud_networksecurity_v1::*;
7121    /// # use builder::intercept::ClientBuilder;
7122    /// # use client::Intercept;
7123    /// let builder : ClientBuilder = Intercept::builder();
7124    /// let client = builder
7125    ///     .with_endpoint("https://networksecurity.googleapis.com")
7126    ///     .build().await?;
7127    /// # Ok(()) }
7128    /// ```
7129    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7130
7131    pub(crate) mod client {
7132        use super::super::super::client::Intercept;
7133        pub struct Factory;
7134        impl crate::ClientFactory for Factory {
7135            type Client = Intercept;
7136            type Credentials = gaxi::options::Credentials;
7137            async fn build(
7138                self,
7139                config: gaxi::options::ClientConfig,
7140            ) -> crate::ClientBuilderResult<Self::Client> {
7141                Self::Client::new(config).await
7142            }
7143        }
7144    }
7145
7146    /// Common implementation for [crate::client::Intercept] request builders.
7147    #[derive(Clone, Debug)]
7148    pub(crate) struct RequestBuilder<R: std::default::Default> {
7149        stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7150        request: R,
7151        options: crate::RequestOptions,
7152    }
7153
7154    impl<R> RequestBuilder<R>
7155    where
7156        R: std::default::Default,
7157    {
7158        pub(crate) fn new(
7159            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7160        ) -> Self {
7161            Self {
7162                stub,
7163                request: R::default(),
7164                options: crate::RequestOptions::default(),
7165            }
7166        }
7167    }
7168
7169    /// The request builder for [Intercept::list_intercept_endpoint_groups][crate::client::Intercept::list_intercept_endpoint_groups] calls.
7170    ///
7171    /// # Example
7172    /// ```
7173    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptEndpointGroups;
7174    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7175    /// use google_cloud_gax::paginator::ItemPaginator;
7176    ///
7177    /// let builder = prepare_request_builder();
7178    /// let mut items = builder.by_item();
7179    /// while let Some(result) = items.next().await {
7180    ///   let item = result?;
7181    /// }
7182    /// # Ok(()) }
7183    ///
7184    /// fn prepare_request_builder() -> ListInterceptEndpointGroups {
7185    ///   # panic!();
7186    ///   // ... details omitted ...
7187    /// }
7188    /// ```
7189    #[derive(Clone, Debug)]
7190    pub struct ListInterceptEndpointGroups(
7191        RequestBuilder<crate::model::ListInterceptEndpointGroupsRequest>,
7192    );
7193
7194    impl ListInterceptEndpointGroups {
7195        pub(crate) fn new(
7196            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7197        ) -> Self {
7198            Self(RequestBuilder::new(stub))
7199        }
7200
7201        /// Sets the full request, replacing any prior values.
7202        pub fn with_request<V: Into<crate::model::ListInterceptEndpointGroupsRequest>>(
7203            mut self,
7204            v: V,
7205        ) -> Self {
7206            self.0.request = v.into();
7207            self
7208        }
7209
7210        /// Sets all the options, replacing any prior values.
7211        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7212            self.0.options = v.into();
7213            self
7214        }
7215
7216        /// Sends the request.
7217        pub async fn send(self) -> Result<crate::model::ListInterceptEndpointGroupsResponse> {
7218            (*self.0.stub)
7219                .list_intercept_endpoint_groups(self.0.request, self.0.options)
7220                .await
7221                .map(crate::Response::into_body)
7222        }
7223
7224        /// Streams each page in the collection.
7225        pub fn by_page(
7226            self,
7227        ) -> impl google_cloud_gax::paginator::Paginator<
7228            crate::model::ListInterceptEndpointGroupsResponse,
7229            crate::Error,
7230        > {
7231            use std::clone::Clone;
7232            let token = self.0.request.page_token.clone();
7233            let execute = move |token: String| {
7234                let mut builder = self.clone();
7235                builder.0.request = builder.0.request.set_page_token(token);
7236                builder.send()
7237            };
7238            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7239        }
7240
7241        /// Streams each item in the collection.
7242        pub fn by_item(
7243            self,
7244        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7245            crate::model::ListInterceptEndpointGroupsResponse,
7246            crate::Error,
7247        > {
7248            use google_cloud_gax::paginator::Paginator;
7249            self.by_page().items()
7250        }
7251
7252        /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupsRequest::parent].
7253        ///
7254        /// This is a **required** field for requests.
7255        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7256            self.0.request.parent = v.into();
7257            self
7258        }
7259
7260        /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupsRequest::page_size].
7261        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7262            self.0.request.page_size = v.into();
7263            self
7264        }
7265
7266        /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupsRequest::page_token].
7267        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7268            self.0.request.page_token = v.into();
7269            self
7270        }
7271
7272        /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupsRequest::filter].
7273        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7274            self.0.request.filter = v.into();
7275            self
7276        }
7277
7278        /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupsRequest::order_by].
7279        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7280            self.0.request.order_by = v.into();
7281            self
7282        }
7283    }
7284
7285    #[doc(hidden)]
7286    impl crate::RequestBuilder for ListInterceptEndpointGroups {
7287        fn request_options(&mut self) -> &mut crate::RequestOptions {
7288            &mut self.0.options
7289        }
7290    }
7291
7292    /// The request builder for [Intercept::get_intercept_endpoint_group][crate::client::Intercept::get_intercept_endpoint_group] calls.
7293    ///
7294    /// # Example
7295    /// ```
7296    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptEndpointGroup;
7297    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7298    ///
7299    /// let builder = prepare_request_builder();
7300    /// let response = builder.send().await?;
7301    /// # Ok(()) }
7302    ///
7303    /// fn prepare_request_builder() -> GetInterceptEndpointGroup {
7304    ///   # panic!();
7305    ///   // ... details omitted ...
7306    /// }
7307    /// ```
7308    #[derive(Clone, Debug)]
7309    pub struct GetInterceptEndpointGroup(
7310        RequestBuilder<crate::model::GetInterceptEndpointGroupRequest>,
7311    );
7312
7313    impl GetInterceptEndpointGroup {
7314        pub(crate) fn new(
7315            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7316        ) -> Self {
7317            Self(RequestBuilder::new(stub))
7318        }
7319
7320        /// Sets the full request, replacing any prior values.
7321        pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupRequest>>(
7322            mut self,
7323            v: V,
7324        ) -> Self {
7325            self.0.request = v.into();
7326            self
7327        }
7328
7329        /// Sets all the options, replacing any prior values.
7330        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7331            self.0.options = v.into();
7332            self
7333        }
7334
7335        /// Sends the request.
7336        pub async fn send(self) -> Result<crate::model::InterceptEndpointGroup> {
7337            (*self.0.stub)
7338                .get_intercept_endpoint_group(self.0.request, self.0.options)
7339                .await
7340                .map(crate::Response::into_body)
7341        }
7342
7343        /// Sets the value of [name][crate::model::GetInterceptEndpointGroupRequest::name].
7344        ///
7345        /// This is a **required** field for requests.
7346        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7347            self.0.request.name = v.into();
7348            self
7349        }
7350    }
7351
7352    #[doc(hidden)]
7353    impl crate::RequestBuilder for GetInterceptEndpointGroup {
7354        fn request_options(&mut self) -> &mut crate::RequestOptions {
7355            &mut self.0.options
7356        }
7357    }
7358
7359    /// The request builder for [Intercept::create_intercept_endpoint_group][crate::client::Intercept::create_intercept_endpoint_group] calls.
7360    ///
7361    /// # Example
7362    /// ```
7363    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptEndpointGroup;
7364    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7365    /// use google_cloud_lro::Poller;
7366    ///
7367    /// let builder = prepare_request_builder();
7368    /// let response = builder.poller().until_done().await?;
7369    /// # Ok(()) }
7370    ///
7371    /// fn prepare_request_builder() -> CreateInterceptEndpointGroup {
7372    ///   # panic!();
7373    ///   // ... details omitted ...
7374    /// }
7375    /// ```
7376    #[derive(Clone, Debug)]
7377    pub struct CreateInterceptEndpointGroup(
7378        RequestBuilder<crate::model::CreateInterceptEndpointGroupRequest>,
7379    );
7380
7381    impl CreateInterceptEndpointGroup {
7382        pub(crate) fn new(
7383            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7384        ) -> Self {
7385            Self(RequestBuilder::new(stub))
7386        }
7387
7388        /// Sets the full request, replacing any prior values.
7389        pub fn with_request<V: Into<crate::model::CreateInterceptEndpointGroupRequest>>(
7390            mut self,
7391            v: V,
7392        ) -> Self {
7393            self.0.request = v.into();
7394            self
7395        }
7396
7397        /// Sets all the options, replacing any prior values.
7398        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7399            self.0.options = v.into();
7400            self
7401        }
7402
7403        /// Sends the request.
7404        ///
7405        /// # Long running operations
7406        ///
7407        /// This starts, but does not poll, a longrunning operation. More information
7408        /// on [create_intercept_endpoint_group][crate::client::Intercept::create_intercept_endpoint_group].
7409        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7410            (*self.0.stub)
7411                .create_intercept_endpoint_group(self.0.request, self.0.options)
7412                .await
7413                .map(crate::Response::into_body)
7414        }
7415
7416        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_endpoint_group`.
7417        pub fn poller(
7418            self,
7419        ) -> impl google_cloud_lro::Poller<
7420            crate::model::InterceptEndpointGroup,
7421            crate::model::OperationMetadata,
7422        > {
7423            type Operation = google_cloud_lro::internal::Operation<
7424                crate::model::InterceptEndpointGroup,
7425                crate::model::OperationMetadata,
7426            >;
7427            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7428            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7429
7430            let stub = self.0.stub.clone();
7431            let mut options = self.0.options.clone();
7432            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7433            let query = move |name| {
7434                let stub = stub.clone();
7435                let options = options.clone();
7436                async {
7437                    let op = GetOperation::new(stub)
7438                        .set_name(name)
7439                        .with_options(options)
7440                        .send()
7441                        .await?;
7442                    Ok(Operation::new(op))
7443                }
7444            };
7445
7446            let start = move || async {
7447                let op = self.send().await?;
7448                Ok(Operation::new(op))
7449            };
7450
7451            google_cloud_lro::internal::new_poller(
7452                polling_error_policy,
7453                polling_backoff_policy,
7454                start,
7455                query,
7456            )
7457        }
7458
7459        /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupRequest::parent].
7460        ///
7461        /// This is a **required** field for requests.
7462        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7463            self.0.request.parent = v.into();
7464            self
7465        }
7466
7467        /// Sets the value of [intercept_endpoint_group_id][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group_id].
7468        ///
7469        /// This is a **required** field for requests.
7470        pub fn set_intercept_endpoint_group_id<T: Into<std::string::String>>(
7471            mut self,
7472            v: T,
7473        ) -> Self {
7474            self.0.request.intercept_endpoint_group_id = v.into();
7475            self
7476        }
7477
7478        /// Sets the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
7479        ///
7480        /// This is a **required** field for requests.
7481        pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
7482        where
7483            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7484        {
7485            self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
7486            self
7487        }
7488
7489        /// Sets or clears the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
7490        ///
7491        /// This is a **required** field for requests.
7492        pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
7493        where
7494            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7495        {
7496            self.0.request.intercept_endpoint_group = v.map(|x| x.into());
7497            self
7498        }
7499
7500        /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupRequest::request_id].
7501        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7502            self.0.request.request_id = v.into();
7503            self
7504        }
7505    }
7506
7507    #[doc(hidden)]
7508    impl crate::RequestBuilder for CreateInterceptEndpointGroup {
7509        fn request_options(&mut self) -> &mut crate::RequestOptions {
7510            &mut self.0.options
7511        }
7512    }
7513
7514    /// The request builder for [Intercept::update_intercept_endpoint_group][crate::client::Intercept::update_intercept_endpoint_group] calls.
7515    ///
7516    /// # Example
7517    /// ```
7518    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptEndpointGroup;
7519    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7520    /// use google_cloud_lro::Poller;
7521    ///
7522    /// let builder = prepare_request_builder();
7523    /// let response = builder.poller().until_done().await?;
7524    /// # Ok(()) }
7525    ///
7526    /// fn prepare_request_builder() -> UpdateInterceptEndpointGroup {
7527    ///   # panic!();
7528    ///   // ... details omitted ...
7529    /// }
7530    /// ```
7531    #[derive(Clone, Debug)]
7532    pub struct UpdateInterceptEndpointGroup(
7533        RequestBuilder<crate::model::UpdateInterceptEndpointGroupRequest>,
7534    );
7535
7536    impl UpdateInterceptEndpointGroup {
7537        pub(crate) fn new(
7538            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7539        ) -> Self {
7540            Self(RequestBuilder::new(stub))
7541        }
7542
7543        /// Sets the full request, replacing any prior values.
7544        pub fn with_request<V: Into<crate::model::UpdateInterceptEndpointGroupRequest>>(
7545            mut self,
7546            v: V,
7547        ) -> Self {
7548            self.0.request = v.into();
7549            self
7550        }
7551
7552        /// Sets all the options, replacing any prior values.
7553        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7554            self.0.options = v.into();
7555            self
7556        }
7557
7558        /// Sends the request.
7559        ///
7560        /// # Long running operations
7561        ///
7562        /// This starts, but does not poll, a longrunning operation. More information
7563        /// on [update_intercept_endpoint_group][crate::client::Intercept::update_intercept_endpoint_group].
7564        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7565            (*self.0.stub)
7566                .update_intercept_endpoint_group(self.0.request, self.0.options)
7567                .await
7568                .map(crate::Response::into_body)
7569        }
7570
7571        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_endpoint_group`.
7572        pub fn poller(
7573            self,
7574        ) -> impl google_cloud_lro::Poller<
7575            crate::model::InterceptEndpointGroup,
7576            crate::model::OperationMetadata,
7577        > {
7578            type Operation = google_cloud_lro::internal::Operation<
7579                crate::model::InterceptEndpointGroup,
7580                crate::model::OperationMetadata,
7581            >;
7582            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7583            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7584
7585            let stub = self.0.stub.clone();
7586            let mut options = self.0.options.clone();
7587            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7588            let query = move |name| {
7589                let stub = stub.clone();
7590                let options = options.clone();
7591                async {
7592                    let op = GetOperation::new(stub)
7593                        .set_name(name)
7594                        .with_options(options)
7595                        .send()
7596                        .await?;
7597                    Ok(Operation::new(op))
7598                }
7599            };
7600
7601            let start = move || async {
7602                let op = self.send().await?;
7603                Ok(Operation::new(op))
7604            };
7605
7606            google_cloud_lro::internal::new_poller(
7607                polling_error_policy,
7608                polling_backoff_policy,
7609                start,
7610                query,
7611            )
7612        }
7613
7614        /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
7615        pub fn set_update_mask<T>(mut self, v: T) -> Self
7616        where
7617            T: std::convert::Into<wkt::FieldMask>,
7618        {
7619            self.0.request.update_mask = std::option::Option::Some(v.into());
7620            self
7621        }
7622
7623        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
7624        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7625        where
7626            T: std::convert::Into<wkt::FieldMask>,
7627        {
7628            self.0.request.update_mask = v.map(|x| x.into());
7629            self
7630        }
7631
7632        /// Sets the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
7633        ///
7634        /// This is a **required** field for requests.
7635        pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
7636        where
7637            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7638        {
7639            self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
7640            self
7641        }
7642
7643        /// Sets or clears the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
7644        ///
7645        /// This is a **required** field for requests.
7646        pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
7647        where
7648            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
7649        {
7650            self.0.request.intercept_endpoint_group = v.map(|x| x.into());
7651            self
7652        }
7653
7654        /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupRequest::request_id].
7655        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7656            self.0.request.request_id = v.into();
7657            self
7658        }
7659    }
7660
7661    #[doc(hidden)]
7662    impl crate::RequestBuilder for UpdateInterceptEndpointGroup {
7663        fn request_options(&mut self) -> &mut crate::RequestOptions {
7664            &mut self.0.options
7665        }
7666    }
7667
7668    /// The request builder for [Intercept::delete_intercept_endpoint_group][crate::client::Intercept::delete_intercept_endpoint_group] calls.
7669    ///
7670    /// # Example
7671    /// ```
7672    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptEndpointGroup;
7673    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7674    /// use google_cloud_lro::Poller;
7675    ///
7676    /// let builder = prepare_request_builder();
7677    /// let response = builder.poller().until_done().await?;
7678    /// # Ok(()) }
7679    ///
7680    /// fn prepare_request_builder() -> DeleteInterceptEndpointGroup {
7681    ///   # panic!();
7682    ///   // ... details omitted ...
7683    /// }
7684    /// ```
7685    #[derive(Clone, Debug)]
7686    pub struct DeleteInterceptEndpointGroup(
7687        RequestBuilder<crate::model::DeleteInterceptEndpointGroupRequest>,
7688    );
7689
7690    impl DeleteInterceptEndpointGroup {
7691        pub(crate) fn new(
7692            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7693        ) -> Self {
7694            Self(RequestBuilder::new(stub))
7695        }
7696
7697        /// Sets the full request, replacing any prior values.
7698        pub fn with_request<V: Into<crate::model::DeleteInterceptEndpointGroupRequest>>(
7699            mut self,
7700            v: V,
7701        ) -> Self {
7702            self.0.request = v.into();
7703            self
7704        }
7705
7706        /// Sets all the options, replacing any prior values.
7707        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7708            self.0.options = v.into();
7709            self
7710        }
7711
7712        /// Sends the request.
7713        ///
7714        /// # Long running operations
7715        ///
7716        /// This starts, but does not poll, a longrunning operation. More information
7717        /// on [delete_intercept_endpoint_group][crate::client::Intercept::delete_intercept_endpoint_group].
7718        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7719            (*self.0.stub)
7720                .delete_intercept_endpoint_group(self.0.request, self.0.options)
7721                .await
7722                .map(crate::Response::into_body)
7723        }
7724
7725        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_endpoint_group`.
7726        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7727            type Operation =
7728                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7729            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7730            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7731
7732            let stub = self.0.stub.clone();
7733            let mut options = self.0.options.clone();
7734            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7735            let query = move |name| {
7736                let stub = stub.clone();
7737                let options = options.clone();
7738                async {
7739                    let op = GetOperation::new(stub)
7740                        .set_name(name)
7741                        .with_options(options)
7742                        .send()
7743                        .await?;
7744                    Ok(Operation::new(op))
7745                }
7746            };
7747
7748            let start = move || async {
7749                let op = self.send().await?;
7750                Ok(Operation::new(op))
7751            };
7752
7753            google_cloud_lro::internal::new_unit_response_poller(
7754                polling_error_policy,
7755                polling_backoff_policy,
7756                start,
7757                query,
7758            )
7759        }
7760
7761        /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupRequest::name].
7762        ///
7763        /// This is a **required** field for requests.
7764        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7765            self.0.request.name = v.into();
7766            self
7767        }
7768
7769        /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupRequest::request_id].
7770        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7771            self.0.request.request_id = v.into();
7772            self
7773        }
7774    }
7775
7776    #[doc(hidden)]
7777    impl crate::RequestBuilder for DeleteInterceptEndpointGroup {
7778        fn request_options(&mut self) -> &mut crate::RequestOptions {
7779            &mut self.0.options
7780        }
7781    }
7782
7783    /// The request builder for [Intercept::list_intercept_endpoint_group_associations][crate::client::Intercept::list_intercept_endpoint_group_associations] calls.
7784    ///
7785    /// # Example
7786    /// ```
7787    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptEndpointGroupAssociations;
7788    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7789    /// use google_cloud_gax::paginator::ItemPaginator;
7790    ///
7791    /// let builder = prepare_request_builder();
7792    /// let mut items = builder.by_item();
7793    /// while let Some(result) = items.next().await {
7794    ///   let item = result?;
7795    /// }
7796    /// # Ok(()) }
7797    ///
7798    /// fn prepare_request_builder() -> ListInterceptEndpointGroupAssociations {
7799    ///   # panic!();
7800    ///   // ... details omitted ...
7801    /// }
7802    /// ```
7803    #[derive(Clone, Debug)]
7804    pub struct ListInterceptEndpointGroupAssociations(
7805        RequestBuilder<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
7806    );
7807
7808    impl ListInterceptEndpointGroupAssociations {
7809        pub(crate) fn new(
7810            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7811        ) -> Self {
7812            Self(RequestBuilder::new(stub))
7813        }
7814
7815        /// Sets the full request, replacing any prior values.
7816        pub fn with_request<
7817            V: Into<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
7818        >(
7819            mut self,
7820            v: V,
7821        ) -> Self {
7822            self.0.request = v.into();
7823            self
7824        }
7825
7826        /// Sets all the options, replacing any prior values.
7827        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7828            self.0.options = v.into();
7829            self
7830        }
7831
7832        /// Sends the request.
7833        pub async fn send(
7834            self,
7835        ) -> Result<crate::model::ListInterceptEndpointGroupAssociationsResponse> {
7836            (*self.0.stub)
7837                .list_intercept_endpoint_group_associations(self.0.request, self.0.options)
7838                .await
7839                .map(crate::Response::into_body)
7840        }
7841
7842        /// Streams each page in the collection.
7843        pub fn by_page(
7844            self,
7845        ) -> impl google_cloud_gax::paginator::Paginator<
7846            crate::model::ListInterceptEndpointGroupAssociationsResponse,
7847            crate::Error,
7848        > {
7849            use std::clone::Clone;
7850            let token = self.0.request.page_token.clone();
7851            let execute = move |token: String| {
7852                let mut builder = self.clone();
7853                builder.0.request = builder.0.request.set_page_token(token);
7854                builder.send()
7855            };
7856            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7857        }
7858
7859        /// Streams each item in the collection.
7860        pub fn by_item(
7861            self,
7862        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7863            crate::model::ListInterceptEndpointGroupAssociationsResponse,
7864            crate::Error,
7865        > {
7866            use google_cloud_gax::paginator::Paginator;
7867            self.by_page().items()
7868        }
7869
7870        /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupAssociationsRequest::parent].
7871        ///
7872        /// This is a **required** field for requests.
7873        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7874            self.0.request.parent = v.into();
7875            self
7876        }
7877
7878        /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_size].
7879        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7880            self.0.request.page_size = v.into();
7881            self
7882        }
7883
7884        /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_token].
7885        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7886            self.0.request.page_token = v.into();
7887            self
7888        }
7889
7890        /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupAssociationsRequest::filter].
7891        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7892            self.0.request.filter = v.into();
7893            self
7894        }
7895
7896        /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupAssociationsRequest::order_by].
7897        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7898            self.0.request.order_by = v.into();
7899            self
7900        }
7901    }
7902
7903    #[doc(hidden)]
7904    impl crate::RequestBuilder for ListInterceptEndpointGroupAssociations {
7905        fn request_options(&mut self) -> &mut crate::RequestOptions {
7906            &mut self.0.options
7907        }
7908    }
7909
7910    /// The request builder for [Intercept::get_intercept_endpoint_group_association][crate::client::Intercept::get_intercept_endpoint_group_association] calls.
7911    ///
7912    /// # Example
7913    /// ```
7914    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptEndpointGroupAssociation;
7915    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7916    ///
7917    /// let builder = prepare_request_builder();
7918    /// let response = builder.send().await?;
7919    /// # Ok(()) }
7920    ///
7921    /// fn prepare_request_builder() -> GetInterceptEndpointGroupAssociation {
7922    ///   # panic!();
7923    ///   // ... details omitted ...
7924    /// }
7925    /// ```
7926    #[derive(Clone, Debug)]
7927    pub struct GetInterceptEndpointGroupAssociation(
7928        RequestBuilder<crate::model::GetInterceptEndpointGroupAssociationRequest>,
7929    );
7930
7931    impl GetInterceptEndpointGroupAssociation {
7932        pub(crate) fn new(
7933            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7934        ) -> Self {
7935            Self(RequestBuilder::new(stub))
7936        }
7937
7938        /// Sets the full request, replacing any prior values.
7939        pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupAssociationRequest>>(
7940            mut self,
7941            v: V,
7942        ) -> Self {
7943            self.0.request = v.into();
7944            self
7945        }
7946
7947        /// Sets all the options, replacing any prior values.
7948        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7949            self.0.options = v.into();
7950            self
7951        }
7952
7953        /// Sends the request.
7954        pub async fn send(self) -> Result<crate::model::InterceptEndpointGroupAssociation> {
7955            (*self.0.stub)
7956                .get_intercept_endpoint_group_association(self.0.request, self.0.options)
7957                .await
7958                .map(crate::Response::into_body)
7959        }
7960
7961        /// Sets the value of [name][crate::model::GetInterceptEndpointGroupAssociationRequest::name].
7962        ///
7963        /// This is a **required** field for requests.
7964        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7965            self.0.request.name = v.into();
7966            self
7967        }
7968    }
7969
7970    #[doc(hidden)]
7971    impl crate::RequestBuilder for GetInterceptEndpointGroupAssociation {
7972        fn request_options(&mut self) -> &mut crate::RequestOptions {
7973            &mut self.0.options
7974        }
7975    }
7976
7977    /// The request builder for [Intercept::create_intercept_endpoint_group_association][crate::client::Intercept::create_intercept_endpoint_group_association] calls.
7978    ///
7979    /// # Example
7980    /// ```
7981    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptEndpointGroupAssociation;
7982    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7983    /// use google_cloud_lro::Poller;
7984    ///
7985    /// let builder = prepare_request_builder();
7986    /// let response = builder.poller().until_done().await?;
7987    /// # Ok(()) }
7988    ///
7989    /// fn prepare_request_builder() -> CreateInterceptEndpointGroupAssociation {
7990    ///   # panic!();
7991    ///   // ... details omitted ...
7992    /// }
7993    /// ```
7994    #[derive(Clone, Debug)]
7995    pub struct CreateInterceptEndpointGroupAssociation(
7996        RequestBuilder<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
7997    );
7998
7999    impl CreateInterceptEndpointGroupAssociation {
8000        pub(crate) fn new(
8001            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8002        ) -> Self {
8003            Self(RequestBuilder::new(stub))
8004        }
8005
8006        /// Sets the full request, replacing any prior values.
8007        pub fn with_request<
8008            V: Into<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
8009        >(
8010            mut self,
8011            v: V,
8012        ) -> Self {
8013            self.0.request = v.into();
8014            self
8015        }
8016
8017        /// Sets all the options, replacing any prior values.
8018        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8019            self.0.options = v.into();
8020            self
8021        }
8022
8023        /// Sends the request.
8024        ///
8025        /// # Long running operations
8026        ///
8027        /// This starts, but does not poll, a longrunning operation. More information
8028        /// on [create_intercept_endpoint_group_association][crate::client::Intercept::create_intercept_endpoint_group_association].
8029        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8030            (*self.0.stub)
8031                .create_intercept_endpoint_group_association(self.0.request, self.0.options)
8032                .await
8033                .map(crate::Response::into_body)
8034        }
8035
8036        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_endpoint_group_association`.
8037        pub fn poller(
8038            self,
8039        ) -> impl google_cloud_lro::Poller<
8040            crate::model::InterceptEndpointGroupAssociation,
8041            crate::model::OperationMetadata,
8042        > {
8043            type Operation = google_cloud_lro::internal::Operation<
8044                crate::model::InterceptEndpointGroupAssociation,
8045                crate::model::OperationMetadata,
8046            >;
8047            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8048            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8049
8050            let stub = self.0.stub.clone();
8051            let mut options = self.0.options.clone();
8052            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8053            let query = move |name| {
8054                let stub = stub.clone();
8055                let options = options.clone();
8056                async {
8057                    let op = GetOperation::new(stub)
8058                        .set_name(name)
8059                        .with_options(options)
8060                        .send()
8061                        .await?;
8062                    Ok(Operation::new(op))
8063                }
8064            };
8065
8066            let start = move || async {
8067                let op = self.send().await?;
8068                Ok(Operation::new(op))
8069            };
8070
8071            google_cloud_lro::internal::new_poller(
8072                polling_error_policy,
8073                polling_backoff_policy,
8074                start,
8075                query,
8076            )
8077        }
8078
8079        /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupAssociationRequest::parent].
8080        ///
8081        /// This is a **required** field for requests.
8082        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8083            self.0.request.parent = v.into();
8084            self
8085        }
8086
8087        /// Sets the value of [intercept_endpoint_group_association_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association_id].
8088        pub fn set_intercept_endpoint_group_association_id<T: Into<std::string::String>>(
8089            mut self,
8090            v: T,
8091        ) -> Self {
8092            self.0.request.intercept_endpoint_group_association_id = v.into();
8093            self
8094        }
8095
8096        /// Sets the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
8097        ///
8098        /// This is a **required** field for requests.
8099        pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
8100        where
8101            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8102        {
8103            self.0.request.intercept_endpoint_group_association =
8104                std::option::Option::Some(v.into());
8105            self
8106        }
8107
8108        /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
8109        ///
8110        /// This is a **required** field for requests.
8111        pub fn set_or_clear_intercept_endpoint_group_association<T>(
8112            mut self,
8113            v: std::option::Option<T>,
8114        ) -> Self
8115        where
8116            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8117        {
8118            self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
8119            self
8120        }
8121
8122        /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::request_id].
8123        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8124            self.0.request.request_id = v.into();
8125            self
8126        }
8127    }
8128
8129    #[doc(hidden)]
8130    impl crate::RequestBuilder for CreateInterceptEndpointGroupAssociation {
8131        fn request_options(&mut self) -> &mut crate::RequestOptions {
8132            &mut self.0.options
8133        }
8134    }
8135
8136    /// The request builder for [Intercept::update_intercept_endpoint_group_association][crate::client::Intercept::update_intercept_endpoint_group_association] calls.
8137    ///
8138    /// # Example
8139    /// ```
8140    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptEndpointGroupAssociation;
8141    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8142    /// use google_cloud_lro::Poller;
8143    ///
8144    /// let builder = prepare_request_builder();
8145    /// let response = builder.poller().until_done().await?;
8146    /// # Ok(()) }
8147    ///
8148    /// fn prepare_request_builder() -> UpdateInterceptEndpointGroupAssociation {
8149    ///   # panic!();
8150    ///   // ... details omitted ...
8151    /// }
8152    /// ```
8153    #[derive(Clone, Debug)]
8154    pub struct UpdateInterceptEndpointGroupAssociation(
8155        RequestBuilder<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8156    );
8157
8158    impl UpdateInterceptEndpointGroupAssociation {
8159        pub(crate) fn new(
8160            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8161        ) -> Self {
8162            Self(RequestBuilder::new(stub))
8163        }
8164
8165        /// Sets the full request, replacing any prior values.
8166        pub fn with_request<
8167            V: Into<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8168        >(
8169            mut self,
8170            v: V,
8171        ) -> Self {
8172            self.0.request = v.into();
8173            self
8174        }
8175
8176        /// Sets all the options, replacing any prior values.
8177        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8178            self.0.options = v.into();
8179            self
8180        }
8181
8182        /// Sends the request.
8183        ///
8184        /// # Long running operations
8185        ///
8186        /// This starts, but does not poll, a longrunning operation. More information
8187        /// on [update_intercept_endpoint_group_association][crate::client::Intercept::update_intercept_endpoint_group_association].
8188        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8189            (*self.0.stub)
8190                .update_intercept_endpoint_group_association(self.0.request, self.0.options)
8191                .await
8192                .map(crate::Response::into_body)
8193        }
8194
8195        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_endpoint_group_association`.
8196        pub fn poller(
8197            self,
8198        ) -> impl google_cloud_lro::Poller<
8199            crate::model::InterceptEndpointGroupAssociation,
8200            crate::model::OperationMetadata,
8201        > {
8202            type Operation = google_cloud_lro::internal::Operation<
8203                crate::model::InterceptEndpointGroupAssociation,
8204                crate::model::OperationMetadata,
8205            >;
8206            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8207            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8208
8209            let stub = self.0.stub.clone();
8210            let mut options = self.0.options.clone();
8211            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8212            let query = move |name| {
8213                let stub = stub.clone();
8214                let options = options.clone();
8215                async {
8216                    let op = GetOperation::new(stub)
8217                        .set_name(name)
8218                        .with_options(options)
8219                        .send()
8220                        .await?;
8221                    Ok(Operation::new(op))
8222                }
8223            };
8224
8225            let start = move || async {
8226                let op = self.send().await?;
8227                Ok(Operation::new(op))
8228            };
8229
8230            google_cloud_lro::internal::new_poller(
8231                polling_error_policy,
8232                polling_backoff_policy,
8233                start,
8234                query,
8235            )
8236        }
8237
8238        /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
8239        pub fn set_update_mask<T>(mut self, v: T) -> Self
8240        where
8241            T: std::convert::Into<wkt::FieldMask>,
8242        {
8243            self.0.request.update_mask = std::option::Option::Some(v.into());
8244            self
8245        }
8246
8247        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
8248        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8249        where
8250            T: std::convert::Into<wkt::FieldMask>,
8251        {
8252            self.0.request.update_mask = v.map(|x| x.into());
8253            self
8254        }
8255
8256        /// Sets the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
8257        ///
8258        /// This is a **required** field for requests.
8259        pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
8260        where
8261            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8262        {
8263            self.0.request.intercept_endpoint_group_association =
8264                std::option::Option::Some(v.into());
8265            self
8266        }
8267
8268        /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
8269        ///
8270        /// This is a **required** field for requests.
8271        pub fn set_or_clear_intercept_endpoint_group_association<T>(
8272            mut self,
8273            v: std::option::Option<T>,
8274        ) -> Self
8275        where
8276            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8277        {
8278            self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
8279            self
8280        }
8281
8282        /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupAssociationRequest::request_id].
8283        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8284            self.0.request.request_id = v.into();
8285            self
8286        }
8287    }
8288
8289    #[doc(hidden)]
8290    impl crate::RequestBuilder for UpdateInterceptEndpointGroupAssociation {
8291        fn request_options(&mut self) -> &mut crate::RequestOptions {
8292            &mut self.0.options
8293        }
8294    }
8295
8296    /// The request builder for [Intercept::delete_intercept_endpoint_group_association][crate::client::Intercept::delete_intercept_endpoint_group_association] calls.
8297    ///
8298    /// # Example
8299    /// ```
8300    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptEndpointGroupAssociation;
8301    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8302    /// use google_cloud_lro::Poller;
8303    ///
8304    /// let builder = prepare_request_builder();
8305    /// let response = builder.poller().until_done().await?;
8306    /// # Ok(()) }
8307    ///
8308    /// fn prepare_request_builder() -> DeleteInterceptEndpointGroupAssociation {
8309    ///   # panic!();
8310    ///   // ... details omitted ...
8311    /// }
8312    /// ```
8313    #[derive(Clone, Debug)]
8314    pub struct DeleteInterceptEndpointGroupAssociation(
8315        RequestBuilder<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
8316    );
8317
8318    impl DeleteInterceptEndpointGroupAssociation {
8319        pub(crate) fn new(
8320            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8321        ) -> Self {
8322            Self(RequestBuilder::new(stub))
8323        }
8324
8325        /// Sets the full request, replacing any prior values.
8326        pub fn with_request<
8327            V: Into<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
8328        >(
8329            mut self,
8330            v: V,
8331        ) -> Self {
8332            self.0.request = v.into();
8333            self
8334        }
8335
8336        /// Sets all the options, replacing any prior values.
8337        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8338            self.0.options = v.into();
8339            self
8340        }
8341
8342        /// Sends the request.
8343        ///
8344        /// # Long running operations
8345        ///
8346        /// This starts, but does not poll, a longrunning operation. More information
8347        /// on [delete_intercept_endpoint_group_association][crate::client::Intercept::delete_intercept_endpoint_group_association].
8348        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8349            (*self.0.stub)
8350                .delete_intercept_endpoint_group_association(self.0.request, self.0.options)
8351                .await
8352                .map(crate::Response::into_body)
8353        }
8354
8355        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_endpoint_group_association`.
8356        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
8357            type Operation =
8358                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8359            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8360            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8361
8362            let stub = self.0.stub.clone();
8363            let mut options = self.0.options.clone();
8364            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8365            let query = move |name| {
8366                let stub = stub.clone();
8367                let options = options.clone();
8368                async {
8369                    let op = GetOperation::new(stub)
8370                        .set_name(name)
8371                        .with_options(options)
8372                        .send()
8373                        .await?;
8374                    Ok(Operation::new(op))
8375                }
8376            };
8377
8378            let start = move || async {
8379                let op = self.send().await?;
8380                Ok(Operation::new(op))
8381            };
8382
8383            google_cloud_lro::internal::new_unit_response_poller(
8384                polling_error_policy,
8385                polling_backoff_policy,
8386                start,
8387                query,
8388            )
8389        }
8390
8391        /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupAssociationRequest::name].
8392        ///
8393        /// This is a **required** field for requests.
8394        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8395            self.0.request.name = v.into();
8396            self
8397        }
8398
8399        /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupAssociationRequest::request_id].
8400        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8401            self.0.request.request_id = v.into();
8402            self
8403        }
8404    }
8405
8406    #[doc(hidden)]
8407    impl crate::RequestBuilder for DeleteInterceptEndpointGroupAssociation {
8408        fn request_options(&mut self) -> &mut crate::RequestOptions {
8409            &mut self.0.options
8410        }
8411    }
8412
8413    /// The request builder for [Intercept::list_intercept_deployment_groups][crate::client::Intercept::list_intercept_deployment_groups] calls.
8414    ///
8415    /// # Example
8416    /// ```
8417    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptDeploymentGroups;
8418    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8419    /// use google_cloud_gax::paginator::ItemPaginator;
8420    ///
8421    /// let builder = prepare_request_builder();
8422    /// let mut items = builder.by_item();
8423    /// while let Some(result) = items.next().await {
8424    ///   let item = result?;
8425    /// }
8426    /// # Ok(()) }
8427    ///
8428    /// fn prepare_request_builder() -> ListInterceptDeploymentGroups {
8429    ///   # panic!();
8430    ///   // ... details omitted ...
8431    /// }
8432    /// ```
8433    #[derive(Clone, Debug)]
8434    pub struct ListInterceptDeploymentGroups(
8435        RequestBuilder<crate::model::ListInterceptDeploymentGroupsRequest>,
8436    );
8437
8438    impl ListInterceptDeploymentGroups {
8439        pub(crate) fn new(
8440            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8441        ) -> Self {
8442            Self(RequestBuilder::new(stub))
8443        }
8444
8445        /// Sets the full request, replacing any prior values.
8446        pub fn with_request<V: Into<crate::model::ListInterceptDeploymentGroupsRequest>>(
8447            mut self,
8448            v: V,
8449        ) -> Self {
8450            self.0.request = v.into();
8451            self
8452        }
8453
8454        /// Sets all the options, replacing any prior values.
8455        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8456            self.0.options = v.into();
8457            self
8458        }
8459
8460        /// Sends the request.
8461        pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentGroupsResponse> {
8462            (*self.0.stub)
8463                .list_intercept_deployment_groups(self.0.request, self.0.options)
8464                .await
8465                .map(crate::Response::into_body)
8466        }
8467
8468        /// Streams each page in the collection.
8469        pub fn by_page(
8470            self,
8471        ) -> impl google_cloud_gax::paginator::Paginator<
8472            crate::model::ListInterceptDeploymentGroupsResponse,
8473            crate::Error,
8474        > {
8475            use std::clone::Clone;
8476            let token = self.0.request.page_token.clone();
8477            let execute = move |token: String| {
8478                let mut builder = self.clone();
8479                builder.0.request = builder.0.request.set_page_token(token);
8480                builder.send()
8481            };
8482            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8483        }
8484
8485        /// Streams each item in the collection.
8486        pub fn by_item(
8487            self,
8488        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8489            crate::model::ListInterceptDeploymentGroupsResponse,
8490            crate::Error,
8491        > {
8492            use google_cloud_gax::paginator::Paginator;
8493            self.by_page().items()
8494        }
8495
8496        /// Sets the value of [parent][crate::model::ListInterceptDeploymentGroupsRequest::parent].
8497        ///
8498        /// This is a **required** field for requests.
8499        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8500            self.0.request.parent = v.into();
8501            self
8502        }
8503
8504        /// Sets the value of [page_size][crate::model::ListInterceptDeploymentGroupsRequest::page_size].
8505        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8506            self.0.request.page_size = v.into();
8507            self
8508        }
8509
8510        /// Sets the value of [page_token][crate::model::ListInterceptDeploymentGroupsRequest::page_token].
8511        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8512            self.0.request.page_token = v.into();
8513            self
8514        }
8515
8516        /// Sets the value of [filter][crate::model::ListInterceptDeploymentGroupsRequest::filter].
8517        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8518            self.0.request.filter = v.into();
8519            self
8520        }
8521
8522        /// Sets the value of [order_by][crate::model::ListInterceptDeploymentGroupsRequest::order_by].
8523        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8524            self.0.request.order_by = v.into();
8525            self
8526        }
8527    }
8528
8529    #[doc(hidden)]
8530    impl crate::RequestBuilder for ListInterceptDeploymentGroups {
8531        fn request_options(&mut self) -> &mut crate::RequestOptions {
8532            &mut self.0.options
8533        }
8534    }
8535
8536    /// The request builder for [Intercept::get_intercept_deployment_group][crate::client::Intercept::get_intercept_deployment_group] calls.
8537    ///
8538    /// # Example
8539    /// ```
8540    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptDeploymentGroup;
8541    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8542    ///
8543    /// let builder = prepare_request_builder();
8544    /// let response = builder.send().await?;
8545    /// # Ok(()) }
8546    ///
8547    /// fn prepare_request_builder() -> GetInterceptDeploymentGroup {
8548    ///   # panic!();
8549    ///   // ... details omitted ...
8550    /// }
8551    /// ```
8552    #[derive(Clone, Debug)]
8553    pub struct GetInterceptDeploymentGroup(
8554        RequestBuilder<crate::model::GetInterceptDeploymentGroupRequest>,
8555    );
8556
8557    impl GetInterceptDeploymentGroup {
8558        pub(crate) fn new(
8559            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8560        ) -> Self {
8561            Self(RequestBuilder::new(stub))
8562        }
8563
8564        /// Sets the full request, replacing any prior values.
8565        pub fn with_request<V: Into<crate::model::GetInterceptDeploymentGroupRequest>>(
8566            mut self,
8567            v: V,
8568        ) -> Self {
8569            self.0.request = v.into();
8570            self
8571        }
8572
8573        /// Sets all the options, replacing any prior values.
8574        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8575            self.0.options = v.into();
8576            self
8577        }
8578
8579        /// Sends the request.
8580        pub async fn send(self) -> Result<crate::model::InterceptDeploymentGroup> {
8581            (*self.0.stub)
8582                .get_intercept_deployment_group(self.0.request, self.0.options)
8583                .await
8584                .map(crate::Response::into_body)
8585        }
8586
8587        /// Sets the value of [name][crate::model::GetInterceptDeploymentGroupRequest::name].
8588        ///
8589        /// This is a **required** field for requests.
8590        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8591            self.0.request.name = v.into();
8592            self
8593        }
8594    }
8595
8596    #[doc(hidden)]
8597    impl crate::RequestBuilder for GetInterceptDeploymentGroup {
8598        fn request_options(&mut self) -> &mut crate::RequestOptions {
8599            &mut self.0.options
8600        }
8601    }
8602
8603    /// The request builder for [Intercept::create_intercept_deployment_group][crate::client::Intercept::create_intercept_deployment_group] calls.
8604    ///
8605    /// # Example
8606    /// ```
8607    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptDeploymentGroup;
8608    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8609    /// use google_cloud_lro::Poller;
8610    ///
8611    /// let builder = prepare_request_builder();
8612    /// let response = builder.poller().until_done().await?;
8613    /// # Ok(()) }
8614    ///
8615    /// fn prepare_request_builder() -> CreateInterceptDeploymentGroup {
8616    ///   # panic!();
8617    ///   // ... details omitted ...
8618    /// }
8619    /// ```
8620    #[derive(Clone, Debug)]
8621    pub struct CreateInterceptDeploymentGroup(
8622        RequestBuilder<crate::model::CreateInterceptDeploymentGroupRequest>,
8623    );
8624
8625    impl CreateInterceptDeploymentGroup {
8626        pub(crate) fn new(
8627            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8628        ) -> Self {
8629            Self(RequestBuilder::new(stub))
8630        }
8631
8632        /// Sets the full request, replacing any prior values.
8633        pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentGroupRequest>>(
8634            mut self,
8635            v: V,
8636        ) -> Self {
8637            self.0.request = v.into();
8638            self
8639        }
8640
8641        /// Sets all the options, replacing any prior values.
8642        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8643            self.0.options = v.into();
8644            self
8645        }
8646
8647        /// Sends the request.
8648        ///
8649        /// # Long running operations
8650        ///
8651        /// This starts, but does not poll, a longrunning operation. More information
8652        /// on [create_intercept_deployment_group][crate::client::Intercept::create_intercept_deployment_group].
8653        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8654            (*self.0.stub)
8655                .create_intercept_deployment_group(self.0.request, self.0.options)
8656                .await
8657                .map(crate::Response::into_body)
8658        }
8659
8660        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_deployment_group`.
8661        pub fn poller(
8662            self,
8663        ) -> impl google_cloud_lro::Poller<
8664            crate::model::InterceptDeploymentGroup,
8665            crate::model::OperationMetadata,
8666        > {
8667            type Operation = google_cloud_lro::internal::Operation<
8668                crate::model::InterceptDeploymentGroup,
8669                crate::model::OperationMetadata,
8670            >;
8671            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8672            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8673
8674            let stub = self.0.stub.clone();
8675            let mut options = self.0.options.clone();
8676            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8677            let query = move |name| {
8678                let stub = stub.clone();
8679                let options = options.clone();
8680                async {
8681                    let op = GetOperation::new(stub)
8682                        .set_name(name)
8683                        .with_options(options)
8684                        .send()
8685                        .await?;
8686                    Ok(Operation::new(op))
8687                }
8688            };
8689
8690            let start = move || async {
8691                let op = self.send().await?;
8692                Ok(Operation::new(op))
8693            };
8694
8695            google_cloud_lro::internal::new_poller(
8696                polling_error_policy,
8697                polling_backoff_policy,
8698                start,
8699                query,
8700            )
8701        }
8702
8703        /// Sets the value of [parent][crate::model::CreateInterceptDeploymentGroupRequest::parent].
8704        ///
8705        /// This is a **required** field for requests.
8706        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8707            self.0.request.parent = v.into();
8708            self
8709        }
8710
8711        /// Sets the value of [intercept_deployment_group_id][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group_id].
8712        ///
8713        /// This is a **required** field for requests.
8714        pub fn set_intercept_deployment_group_id<T: Into<std::string::String>>(
8715            mut self,
8716            v: T,
8717        ) -> Self {
8718            self.0.request.intercept_deployment_group_id = v.into();
8719            self
8720        }
8721
8722        /// Sets the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
8723        ///
8724        /// This is a **required** field for requests.
8725        pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
8726        where
8727            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8728        {
8729            self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
8730            self
8731        }
8732
8733        /// Sets or clears the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
8734        ///
8735        /// This is a **required** field for requests.
8736        pub fn set_or_clear_intercept_deployment_group<T>(
8737            mut self,
8738            v: std::option::Option<T>,
8739        ) -> Self
8740        where
8741            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8742        {
8743            self.0.request.intercept_deployment_group = v.map(|x| x.into());
8744            self
8745        }
8746
8747        /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentGroupRequest::request_id].
8748        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8749            self.0.request.request_id = v.into();
8750            self
8751        }
8752    }
8753
8754    #[doc(hidden)]
8755    impl crate::RequestBuilder for CreateInterceptDeploymentGroup {
8756        fn request_options(&mut self) -> &mut crate::RequestOptions {
8757            &mut self.0.options
8758        }
8759    }
8760
8761    /// The request builder for [Intercept::update_intercept_deployment_group][crate::client::Intercept::update_intercept_deployment_group] calls.
8762    ///
8763    /// # Example
8764    /// ```
8765    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptDeploymentGroup;
8766    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8767    /// use google_cloud_lro::Poller;
8768    ///
8769    /// let builder = prepare_request_builder();
8770    /// let response = builder.poller().until_done().await?;
8771    /// # Ok(()) }
8772    ///
8773    /// fn prepare_request_builder() -> UpdateInterceptDeploymentGroup {
8774    ///   # panic!();
8775    ///   // ... details omitted ...
8776    /// }
8777    /// ```
8778    #[derive(Clone, Debug)]
8779    pub struct UpdateInterceptDeploymentGroup(
8780        RequestBuilder<crate::model::UpdateInterceptDeploymentGroupRequest>,
8781    );
8782
8783    impl UpdateInterceptDeploymentGroup {
8784        pub(crate) fn new(
8785            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8786        ) -> Self {
8787            Self(RequestBuilder::new(stub))
8788        }
8789
8790        /// Sets the full request, replacing any prior values.
8791        pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentGroupRequest>>(
8792            mut self,
8793            v: V,
8794        ) -> Self {
8795            self.0.request = v.into();
8796            self
8797        }
8798
8799        /// Sets all the options, replacing any prior values.
8800        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8801            self.0.options = v.into();
8802            self
8803        }
8804
8805        /// Sends the request.
8806        ///
8807        /// # Long running operations
8808        ///
8809        /// This starts, but does not poll, a longrunning operation. More information
8810        /// on [update_intercept_deployment_group][crate::client::Intercept::update_intercept_deployment_group].
8811        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8812            (*self.0.stub)
8813                .update_intercept_deployment_group(self.0.request, self.0.options)
8814                .await
8815                .map(crate::Response::into_body)
8816        }
8817
8818        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_deployment_group`.
8819        pub fn poller(
8820            self,
8821        ) -> impl google_cloud_lro::Poller<
8822            crate::model::InterceptDeploymentGroup,
8823            crate::model::OperationMetadata,
8824        > {
8825            type Operation = google_cloud_lro::internal::Operation<
8826                crate::model::InterceptDeploymentGroup,
8827                crate::model::OperationMetadata,
8828            >;
8829            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8830            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8831
8832            let stub = self.0.stub.clone();
8833            let mut options = self.0.options.clone();
8834            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8835            let query = move |name| {
8836                let stub = stub.clone();
8837                let options = options.clone();
8838                async {
8839                    let op = GetOperation::new(stub)
8840                        .set_name(name)
8841                        .with_options(options)
8842                        .send()
8843                        .await?;
8844                    Ok(Operation::new(op))
8845                }
8846            };
8847
8848            let start = move || async {
8849                let op = self.send().await?;
8850                Ok(Operation::new(op))
8851            };
8852
8853            google_cloud_lro::internal::new_poller(
8854                polling_error_policy,
8855                polling_backoff_policy,
8856                start,
8857                query,
8858            )
8859        }
8860
8861        /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
8862        pub fn set_update_mask<T>(mut self, v: T) -> Self
8863        where
8864            T: std::convert::Into<wkt::FieldMask>,
8865        {
8866            self.0.request.update_mask = std::option::Option::Some(v.into());
8867            self
8868        }
8869
8870        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
8871        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8872        where
8873            T: std::convert::Into<wkt::FieldMask>,
8874        {
8875            self.0.request.update_mask = v.map(|x| x.into());
8876            self
8877        }
8878
8879        /// Sets the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
8880        ///
8881        /// This is a **required** field for requests.
8882        pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
8883        where
8884            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8885        {
8886            self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
8887            self
8888        }
8889
8890        /// Sets or clears the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
8891        ///
8892        /// This is a **required** field for requests.
8893        pub fn set_or_clear_intercept_deployment_group<T>(
8894            mut self,
8895            v: std::option::Option<T>,
8896        ) -> Self
8897        where
8898            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
8899        {
8900            self.0.request.intercept_deployment_group = v.map(|x| x.into());
8901            self
8902        }
8903
8904        /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentGroupRequest::request_id].
8905        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8906            self.0.request.request_id = v.into();
8907            self
8908        }
8909    }
8910
8911    #[doc(hidden)]
8912    impl crate::RequestBuilder for UpdateInterceptDeploymentGroup {
8913        fn request_options(&mut self) -> &mut crate::RequestOptions {
8914            &mut self.0.options
8915        }
8916    }
8917
8918    /// The request builder for [Intercept::delete_intercept_deployment_group][crate::client::Intercept::delete_intercept_deployment_group] calls.
8919    ///
8920    /// # Example
8921    /// ```
8922    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptDeploymentGroup;
8923    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8924    /// use google_cloud_lro::Poller;
8925    ///
8926    /// let builder = prepare_request_builder();
8927    /// let response = builder.poller().until_done().await?;
8928    /// # Ok(()) }
8929    ///
8930    /// fn prepare_request_builder() -> DeleteInterceptDeploymentGroup {
8931    ///   # panic!();
8932    ///   // ... details omitted ...
8933    /// }
8934    /// ```
8935    #[derive(Clone, Debug)]
8936    pub struct DeleteInterceptDeploymentGroup(
8937        RequestBuilder<crate::model::DeleteInterceptDeploymentGroupRequest>,
8938    );
8939
8940    impl DeleteInterceptDeploymentGroup {
8941        pub(crate) fn new(
8942            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8943        ) -> Self {
8944            Self(RequestBuilder::new(stub))
8945        }
8946
8947        /// Sets the full request, replacing any prior values.
8948        pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentGroupRequest>>(
8949            mut self,
8950            v: V,
8951        ) -> Self {
8952            self.0.request = v.into();
8953            self
8954        }
8955
8956        /// Sets all the options, replacing any prior values.
8957        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8958            self.0.options = v.into();
8959            self
8960        }
8961
8962        /// Sends the request.
8963        ///
8964        /// # Long running operations
8965        ///
8966        /// This starts, but does not poll, a longrunning operation. More information
8967        /// on [delete_intercept_deployment_group][crate::client::Intercept::delete_intercept_deployment_group].
8968        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8969            (*self.0.stub)
8970                .delete_intercept_deployment_group(self.0.request, self.0.options)
8971                .await
8972                .map(crate::Response::into_body)
8973        }
8974
8975        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_deployment_group`.
8976        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
8977            type Operation =
8978                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8979            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8980            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8981
8982            let stub = self.0.stub.clone();
8983            let mut options = self.0.options.clone();
8984            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8985            let query = move |name| {
8986                let stub = stub.clone();
8987                let options = options.clone();
8988                async {
8989                    let op = GetOperation::new(stub)
8990                        .set_name(name)
8991                        .with_options(options)
8992                        .send()
8993                        .await?;
8994                    Ok(Operation::new(op))
8995                }
8996            };
8997
8998            let start = move || async {
8999                let op = self.send().await?;
9000                Ok(Operation::new(op))
9001            };
9002
9003            google_cloud_lro::internal::new_unit_response_poller(
9004                polling_error_policy,
9005                polling_backoff_policy,
9006                start,
9007                query,
9008            )
9009        }
9010
9011        /// Sets the value of [name][crate::model::DeleteInterceptDeploymentGroupRequest::name].
9012        ///
9013        /// This is a **required** field for requests.
9014        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9015            self.0.request.name = v.into();
9016            self
9017        }
9018
9019        /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentGroupRequest::request_id].
9020        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9021            self.0.request.request_id = v.into();
9022            self
9023        }
9024    }
9025
9026    #[doc(hidden)]
9027    impl crate::RequestBuilder for DeleteInterceptDeploymentGroup {
9028        fn request_options(&mut self) -> &mut crate::RequestOptions {
9029            &mut self.0.options
9030        }
9031    }
9032
9033    /// The request builder for [Intercept::list_intercept_deployments][crate::client::Intercept::list_intercept_deployments] calls.
9034    ///
9035    /// # Example
9036    /// ```
9037    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptDeployments;
9038    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9039    /// use google_cloud_gax::paginator::ItemPaginator;
9040    ///
9041    /// let builder = prepare_request_builder();
9042    /// let mut items = builder.by_item();
9043    /// while let Some(result) = items.next().await {
9044    ///   let item = result?;
9045    /// }
9046    /// # Ok(()) }
9047    ///
9048    /// fn prepare_request_builder() -> ListInterceptDeployments {
9049    ///   # panic!();
9050    ///   // ... details omitted ...
9051    /// }
9052    /// ```
9053    #[derive(Clone, Debug)]
9054    pub struct ListInterceptDeployments(
9055        RequestBuilder<crate::model::ListInterceptDeploymentsRequest>,
9056    );
9057
9058    impl ListInterceptDeployments {
9059        pub(crate) fn new(
9060            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9061        ) -> Self {
9062            Self(RequestBuilder::new(stub))
9063        }
9064
9065        /// Sets the full request, replacing any prior values.
9066        pub fn with_request<V: Into<crate::model::ListInterceptDeploymentsRequest>>(
9067            mut self,
9068            v: V,
9069        ) -> Self {
9070            self.0.request = v.into();
9071            self
9072        }
9073
9074        /// Sets all the options, replacing any prior values.
9075        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9076            self.0.options = v.into();
9077            self
9078        }
9079
9080        /// Sends the request.
9081        pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentsResponse> {
9082            (*self.0.stub)
9083                .list_intercept_deployments(self.0.request, self.0.options)
9084                .await
9085                .map(crate::Response::into_body)
9086        }
9087
9088        /// Streams each page in the collection.
9089        pub fn by_page(
9090            self,
9091        ) -> impl google_cloud_gax::paginator::Paginator<
9092            crate::model::ListInterceptDeploymentsResponse,
9093            crate::Error,
9094        > {
9095            use std::clone::Clone;
9096            let token = self.0.request.page_token.clone();
9097            let execute = move |token: String| {
9098                let mut builder = self.clone();
9099                builder.0.request = builder.0.request.set_page_token(token);
9100                builder.send()
9101            };
9102            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9103        }
9104
9105        /// Streams each item in the collection.
9106        pub fn by_item(
9107            self,
9108        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9109            crate::model::ListInterceptDeploymentsResponse,
9110            crate::Error,
9111        > {
9112            use google_cloud_gax::paginator::Paginator;
9113            self.by_page().items()
9114        }
9115
9116        /// Sets the value of [parent][crate::model::ListInterceptDeploymentsRequest::parent].
9117        ///
9118        /// This is a **required** field for requests.
9119        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9120            self.0.request.parent = v.into();
9121            self
9122        }
9123
9124        /// Sets the value of [page_size][crate::model::ListInterceptDeploymentsRequest::page_size].
9125        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9126            self.0.request.page_size = v.into();
9127            self
9128        }
9129
9130        /// Sets the value of [page_token][crate::model::ListInterceptDeploymentsRequest::page_token].
9131        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9132            self.0.request.page_token = v.into();
9133            self
9134        }
9135
9136        /// Sets the value of [filter][crate::model::ListInterceptDeploymentsRequest::filter].
9137        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9138            self.0.request.filter = v.into();
9139            self
9140        }
9141
9142        /// Sets the value of [order_by][crate::model::ListInterceptDeploymentsRequest::order_by].
9143        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9144            self.0.request.order_by = v.into();
9145            self
9146        }
9147    }
9148
9149    #[doc(hidden)]
9150    impl crate::RequestBuilder for ListInterceptDeployments {
9151        fn request_options(&mut self) -> &mut crate::RequestOptions {
9152            &mut self.0.options
9153        }
9154    }
9155
9156    /// The request builder for [Intercept::get_intercept_deployment][crate::client::Intercept::get_intercept_deployment] calls.
9157    ///
9158    /// # Example
9159    /// ```
9160    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptDeployment;
9161    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9162    ///
9163    /// let builder = prepare_request_builder();
9164    /// let response = builder.send().await?;
9165    /// # Ok(()) }
9166    ///
9167    /// fn prepare_request_builder() -> GetInterceptDeployment {
9168    ///   # panic!();
9169    ///   // ... details omitted ...
9170    /// }
9171    /// ```
9172    #[derive(Clone, Debug)]
9173    pub struct GetInterceptDeployment(RequestBuilder<crate::model::GetInterceptDeploymentRequest>);
9174
9175    impl GetInterceptDeployment {
9176        pub(crate) fn new(
9177            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9178        ) -> Self {
9179            Self(RequestBuilder::new(stub))
9180        }
9181
9182        /// Sets the full request, replacing any prior values.
9183        pub fn with_request<V: Into<crate::model::GetInterceptDeploymentRequest>>(
9184            mut self,
9185            v: V,
9186        ) -> Self {
9187            self.0.request = v.into();
9188            self
9189        }
9190
9191        /// Sets all the options, replacing any prior values.
9192        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9193            self.0.options = v.into();
9194            self
9195        }
9196
9197        /// Sends the request.
9198        pub async fn send(self) -> Result<crate::model::InterceptDeployment> {
9199            (*self.0.stub)
9200                .get_intercept_deployment(self.0.request, self.0.options)
9201                .await
9202                .map(crate::Response::into_body)
9203        }
9204
9205        /// Sets the value of [name][crate::model::GetInterceptDeploymentRequest::name].
9206        ///
9207        /// This is a **required** field for requests.
9208        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9209            self.0.request.name = v.into();
9210            self
9211        }
9212    }
9213
9214    #[doc(hidden)]
9215    impl crate::RequestBuilder for GetInterceptDeployment {
9216        fn request_options(&mut self) -> &mut crate::RequestOptions {
9217            &mut self.0.options
9218        }
9219    }
9220
9221    /// The request builder for [Intercept::create_intercept_deployment][crate::client::Intercept::create_intercept_deployment] calls.
9222    ///
9223    /// # Example
9224    /// ```
9225    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptDeployment;
9226    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9227    /// use google_cloud_lro::Poller;
9228    ///
9229    /// let builder = prepare_request_builder();
9230    /// let response = builder.poller().until_done().await?;
9231    /// # Ok(()) }
9232    ///
9233    /// fn prepare_request_builder() -> CreateInterceptDeployment {
9234    ///   # panic!();
9235    ///   // ... details omitted ...
9236    /// }
9237    /// ```
9238    #[derive(Clone, Debug)]
9239    pub struct CreateInterceptDeployment(
9240        RequestBuilder<crate::model::CreateInterceptDeploymentRequest>,
9241    );
9242
9243    impl CreateInterceptDeployment {
9244        pub(crate) fn new(
9245            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9246        ) -> Self {
9247            Self(RequestBuilder::new(stub))
9248        }
9249
9250        /// Sets the full request, replacing any prior values.
9251        pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentRequest>>(
9252            mut self,
9253            v: V,
9254        ) -> Self {
9255            self.0.request = v.into();
9256            self
9257        }
9258
9259        /// Sets all the options, replacing any prior values.
9260        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9261            self.0.options = v.into();
9262            self
9263        }
9264
9265        /// Sends the request.
9266        ///
9267        /// # Long running operations
9268        ///
9269        /// This starts, but does not poll, a longrunning operation. More information
9270        /// on [create_intercept_deployment][crate::client::Intercept::create_intercept_deployment].
9271        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9272            (*self.0.stub)
9273                .create_intercept_deployment(self.0.request, self.0.options)
9274                .await
9275                .map(crate::Response::into_body)
9276        }
9277
9278        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_deployment`.
9279        pub fn poller(
9280            self,
9281        ) -> impl google_cloud_lro::Poller<
9282            crate::model::InterceptDeployment,
9283            crate::model::OperationMetadata,
9284        > {
9285            type Operation = google_cloud_lro::internal::Operation<
9286                crate::model::InterceptDeployment,
9287                crate::model::OperationMetadata,
9288            >;
9289            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9290            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9291
9292            let stub = self.0.stub.clone();
9293            let mut options = self.0.options.clone();
9294            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9295            let query = move |name| {
9296                let stub = stub.clone();
9297                let options = options.clone();
9298                async {
9299                    let op = GetOperation::new(stub)
9300                        .set_name(name)
9301                        .with_options(options)
9302                        .send()
9303                        .await?;
9304                    Ok(Operation::new(op))
9305                }
9306            };
9307
9308            let start = move || async {
9309                let op = self.send().await?;
9310                Ok(Operation::new(op))
9311            };
9312
9313            google_cloud_lro::internal::new_poller(
9314                polling_error_policy,
9315                polling_backoff_policy,
9316                start,
9317                query,
9318            )
9319        }
9320
9321        /// Sets the value of [parent][crate::model::CreateInterceptDeploymentRequest::parent].
9322        ///
9323        /// This is a **required** field for requests.
9324        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9325            self.0.request.parent = v.into();
9326            self
9327        }
9328
9329        /// Sets the value of [intercept_deployment_id][crate::model::CreateInterceptDeploymentRequest::intercept_deployment_id].
9330        ///
9331        /// This is a **required** field for requests.
9332        pub fn set_intercept_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9333            self.0.request.intercept_deployment_id = v.into();
9334            self
9335        }
9336
9337        /// Sets the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
9338        ///
9339        /// This is a **required** field for requests.
9340        pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
9341        where
9342            T: std::convert::Into<crate::model::InterceptDeployment>,
9343        {
9344            self.0.request.intercept_deployment = std::option::Option::Some(v.into());
9345            self
9346        }
9347
9348        /// Sets or clears the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
9349        ///
9350        /// This is a **required** field for requests.
9351        pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
9352        where
9353            T: std::convert::Into<crate::model::InterceptDeployment>,
9354        {
9355            self.0.request.intercept_deployment = v.map(|x| x.into());
9356            self
9357        }
9358
9359        /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentRequest::request_id].
9360        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9361            self.0.request.request_id = v.into();
9362            self
9363        }
9364    }
9365
9366    #[doc(hidden)]
9367    impl crate::RequestBuilder for CreateInterceptDeployment {
9368        fn request_options(&mut self) -> &mut crate::RequestOptions {
9369            &mut self.0.options
9370        }
9371    }
9372
9373    /// The request builder for [Intercept::update_intercept_deployment][crate::client::Intercept::update_intercept_deployment] calls.
9374    ///
9375    /// # Example
9376    /// ```
9377    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptDeployment;
9378    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9379    /// use google_cloud_lro::Poller;
9380    ///
9381    /// let builder = prepare_request_builder();
9382    /// let response = builder.poller().until_done().await?;
9383    /// # Ok(()) }
9384    ///
9385    /// fn prepare_request_builder() -> UpdateInterceptDeployment {
9386    ///   # panic!();
9387    ///   // ... details omitted ...
9388    /// }
9389    /// ```
9390    #[derive(Clone, Debug)]
9391    pub struct UpdateInterceptDeployment(
9392        RequestBuilder<crate::model::UpdateInterceptDeploymentRequest>,
9393    );
9394
9395    impl UpdateInterceptDeployment {
9396        pub(crate) fn new(
9397            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9398        ) -> Self {
9399            Self(RequestBuilder::new(stub))
9400        }
9401
9402        /// Sets the full request, replacing any prior values.
9403        pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentRequest>>(
9404            mut self,
9405            v: V,
9406        ) -> Self {
9407            self.0.request = v.into();
9408            self
9409        }
9410
9411        /// Sets all the options, replacing any prior values.
9412        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9413            self.0.options = v.into();
9414            self
9415        }
9416
9417        /// Sends the request.
9418        ///
9419        /// # Long running operations
9420        ///
9421        /// This starts, but does not poll, a longrunning operation. More information
9422        /// on [update_intercept_deployment][crate::client::Intercept::update_intercept_deployment].
9423        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9424            (*self.0.stub)
9425                .update_intercept_deployment(self.0.request, self.0.options)
9426                .await
9427                .map(crate::Response::into_body)
9428        }
9429
9430        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_deployment`.
9431        pub fn poller(
9432            self,
9433        ) -> impl google_cloud_lro::Poller<
9434            crate::model::InterceptDeployment,
9435            crate::model::OperationMetadata,
9436        > {
9437            type Operation = google_cloud_lro::internal::Operation<
9438                crate::model::InterceptDeployment,
9439                crate::model::OperationMetadata,
9440            >;
9441            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9442            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9443
9444            let stub = self.0.stub.clone();
9445            let mut options = self.0.options.clone();
9446            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9447            let query = move |name| {
9448                let stub = stub.clone();
9449                let options = options.clone();
9450                async {
9451                    let op = GetOperation::new(stub)
9452                        .set_name(name)
9453                        .with_options(options)
9454                        .send()
9455                        .await?;
9456                    Ok(Operation::new(op))
9457                }
9458            };
9459
9460            let start = move || async {
9461                let op = self.send().await?;
9462                Ok(Operation::new(op))
9463            };
9464
9465            google_cloud_lro::internal::new_poller(
9466                polling_error_policy,
9467                polling_backoff_policy,
9468                start,
9469                query,
9470            )
9471        }
9472
9473        /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
9474        pub fn set_update_mask<T>(mut self, v: T) -> Self
9475        where
9476            T: std::convert::Into<wkt::FieldMask>,
9477        {
9478            self.0.request.update_mask = std::option::Option::Some(v.into());
9479            self
9480        }
9481
9482        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
9483        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9484        where
9485            T: std::convert::Into<wkt::FieldMask>,
9486        {
9487            self.0.request.update_mask = v.map(|x| x.into());
9488            self
9489        }
9490
9491        /// Sets the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
9492        ///
9493        /// This is a **required** field for requests.
9494        pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
9495        where
9496            T: std::convert::Into<crate::model::InterceptDeployment>,
9497        {
9498            self.0.request.intercept_deployment = std::option::Option::Some(v.into());
9499            self
9500        }
9501
9502        /// Sets or clears the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
9503        ///
9504        /// This is a **required** field for requests.
9505        pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
9506        where
9507            T: std::convert::Into<crate::model::InterceptDeployment>,
9508        {
9509            self.0.request.intercept_deployment = v.map(|x| x.into());
9510            self
9511        }
9512
9513        /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentRequest::request_id].
9514        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9515            self.0.request.request_id = v.into();
9516            self
9517        }
9518    }
9519
9520    #[doc(hidden)]
9521    impl crate::RequestBuilder for UpdateInterceptDeployment {
9522        fn request_options(&mut self) -> &mut crate::RequestOptions {
9523            &mut self.0.options
9524        }
9525    }
9526
9527    /// The request builder for [Intercept::delete_intercept_deployment][crate::client::Intercept::delete_intercept_deployment] calls.
9528    ///
9529    /// # Example
9530    /// ```
9531    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptDeployment;
9532    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9533    /// use google_cloud_lro::Poller;
9534    ///
9535    /// let builder = prepare_request_builder();
9536    /// let response = builder.poller().until_done().await?;
9537    /// # Ok(()) }
9538    ///
9539    /// fn prepare_request_builder() -> DeleteInterceptDeployment {
9540    ///   # panic!();
9541    ///   // ... details omitted ...
9542    /// }
9543    /// ```
9544    #[derive(Clone, Debug)]
9545    pub struct DeleteInterceptDeployment(
9546        RequestBuilder<crate::model::DeleteInterceptDeploymentRequest>,
9547    );
9548
9549    impl DeleteInterceptDeployment {
9550        pub(crate) fn new(
9551            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9552        ) -> Self {
9553            Self(RequestBuilder::new(stub))
9554        }
9555
9556        /// Sets the full request, replacing any prior values.
9557        pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentRequest>>(
9558            mut self,
9559            v: V,
9560        ) -> Self {
9561            self.0.request = v.into();
9562            self
9563        }
9564
9565        /// Sets all the options, replacing any prior values.
9566        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9567            self.0.options = v.into();
9568            self
9569        }
9570
9571        /// Sends the request.
9572        ///
9573        /// # Long running operations
9574        ///
9575        /// This starts, but does not poll, a longrunning operation. More information
9576        /// on [delete_intercept_deployment][crate::client::Intercept::delete_intercept_deployment].
9577        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9578            (*self.0.stub)
9579                .delete_intercept_deployment(self.0.request, self.0.options)
9580                .await
9581                .map(crate::Response::into_body)
9582        }
9583
9584        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_deployment`.
9585        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9586            type Operation =
9587                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9588            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9589            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9590
9591            let stub = self.0.stub.clone();
9592            let mut options = self.0.options.clone();
9593            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9594            let query = move |name| {
9595                let stub = stub.clone();
9596                let options = options.clone();
9597                async {
9598                    let op = GetOperation::new(stub)
9599                        .set_name(name)
9600                        .with_options(options)
9601                        .send()
9602                        .await?;
9603                    Ok(Operation::new(op))
9604                }
9605            };
9606
9607            let start = move || async {
9608                let op = self.send().await?;
9609                Ok(Operation::new(op))
9610            };
9611
9612            google_cloud_lro::internal::new_unit_response_poller(
9613                polling_error_policy,
9614                polling_backoff_policy,
9615                start,
9616                query,
9617            )
9618        }
9619
9620        /// Sets the value of [name][crate::model::DeleteInterceptDeploymentRequest::name].
9621        ///
9622        /// This is a **required** field for requests.
9623        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9624            self.0.request.name = v.into();
9625            self
9626        }
9627
9628        /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentRequest::request_id].
9629        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9630            self.0.request.request_id = v.into();
9631            self
9632        }
9633    }
9634
9635    #[doc(hidden)]
9636    impl crate::RequestBuilder for DeleteInterceptDeployment {
9637        fn request_options(&mut self) -> &mut crate::RequestOptions {
9638            &mut self.0.options
9639        }
9640    }
9641
9642    /// The request builder for [Intercept::list_locations][crate::client::Intercept::list_locations] calls.
9643    ///
9644    /// # Example
9645    /// ```
9646    /// # use google_cloud_networksecurity_v1::builder::intercept::ListLocations;
9647    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9648    /// use google_cloud_gax::paginator::ItemPaginator;
9649    ///
9650    /// let builder = prepare_request_builder();
9651    /// let mut items = builder.by_item();
9652    /// while let Some(result) = items.next().await {
9653    ///   let item = result?;
9654    /// }
9655    /// # Ok(()) }
9656    ///
9657    /// fn prepare_request_builder() -> ListLocations {
9658    ///   # panic!();
9659    ///   // ... details omitted ...
9660    /// }
9661    /// ```
9662    #[derive(Clone, Debug)]
9663    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9664
9665    impl ListLocations {
9666        pub(crate) fn new(
9667            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9668        ) -> Self {
9669            Self(RequestBuilder::new(stub))
9670        }
9671
9672        /// Sets the full request, replacing any prior values.
9673        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9674            mut self,
9675            v: V,
9676        ) -> Self {
9677            self.0.request = v.into();
9678            self
9679        }
9680
9681        /// Sets all the options, replacing any prior values.
9682        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9683            self.0.options = v.into();
9684            self
9685        }
9686
9687        /// Sends the request.
9688        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9689            (*self.0.stub)
9690                .list_locations(self.0.request, self.0.options)
9691                .await
9692                .map(crate::Response::into_body)
9693        }
9694
9695        /// Streams each page in the collection.
9696        pub fn by_page(
9697            self,
9698        ) -> impl google_cloud_gax::paginator::Paginator<
9699            google_cloud_location::model::ListLocationsResponse,
9700            crate::Error,
9701        > {
9702            use std::clone::Clone;
9703            let token = self.0.request.page_token.clone();
9704            let execute = move |token: String| {
9705                let mut builder = self.clone();
9706                builder.0.request = builder.0.request.set_page_token(token);
9707                builder.send()
9708            };
9709            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9710        }
9711
9712        /// Streams each item in the collection.
9713        pub fn by_item(
9714            self,
9715        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9716            google_cloud_location::model::ListLocationsResponse,
9717            crate::Error,
9718        > {
9719            use google_cloud_gax::paginator::Paginator;
9720            self.by_page().items()
9721        }
9722
9723        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
9724        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9725            self.0.request.name = v.into();
9726            self
9727        }
9728
9729        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
9730        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9731            self.0.request.filter = v.into();
9732            self
9733        }
9734
9735        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
9736        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9737            self.0.request.page_size = v.into();
9738            self
9739        }
9740
9741        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
9742        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9743            self.0.request.page_token = v.into();
9744            self
9745        }
9746    }
9747
9748    #[doc(hidden)]
9749    impl crate::RequestBuilder for ListLocations {
9750        fn request_options(&mut self) -> &mut crate::RequestOptions {
9751            &mut self.0.options
9752        }
9753    }
9754
9755    /// The request builder for [Intercept::get_location][crate::client::Intercept::get_location] calls.
9756    ///
9757    /// # Example
9758    /// ```
9759    /// # use google_cloud_networksecurity_v1::builder::intercept::GetLocation;
9760    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9761    ///
9762    /// let builder = prepare_request_builder();
9763    /// let response = builder.send().await?;
9764    /// # Ok(()) }
9765    ///
9766    /// fn prepare_request_builder() -> GetLocation {
9767    ///   # panic!();
9768    ///   // ... details omitted ...
9769    /// }
9770    /// ```
9771    #[derive(Clone, Debug)]
9772    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9773
9774    impl GetLocation {
9775        pub(crate) fn new(
9776            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9777        ) -> Self {
9778            Self(RequestBuilder::new(stub))
9779        }
9780
9781        /// Sets the full request, replacing any prior values.
9782        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9783            mut self,
9784            v: V,
9785        ) -> Self {
9786            self.0.request = v.into();
9787            self
9788        }
9789
9790        /// Sets all the options, replacing any prior values.
9791        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9792            self.0.options = v.into();
9793            self
9794        }
9795
9796        /// Sends the request.
9797        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9798            (*self.0.stub)
9799                .get_location(self.0.request, self.0.options)
9800                .await
9801                .map(crate::Response::into_body)
9802        }
9803
9804        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
9805        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9806            self.0.request.name = v.into();
9807            self
9808        }
9809    }
9810
9811    #[doc(hidden)]
9812    impl crate::RequestBuilder for GetLocation {
9813        fn request_options(&mut self) -> &mut crate::RequestOptions {
9814            &mut self.0.options
9815        }
9816    }
9817
9818    /// The request builder for [Intercept::set_iam_policy][crate::client::Intercept::set_iam_policy] calls.
9819    ///
9820    /// # Example
9821    /// ```
9822    /// # use google_cloud_networksecurity_v1::builder::intercept::SetIamPolicy;
9823    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9824    ///
9825    /// let builder = prepare_request_builder();
9826    /// let response = builder.send().await?;
9827    /// # Ok(()) }
9828    ///
9829    /// fn prepare_request_builder() -> SetIamPolicy {
9830    ///   # panic!();
9831    ///   // ... details omitted ...
9832    /// }
9833    /// ```
9834    #[derive(Clone, Debug)]
9835    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
9836
9837    impl SetIamPolicy {
9838        pub(crate) fn new(
9839            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9840        ) -> Self {
9841            Self(RequestBuilder::new(stub))
9842        }
9843
9844        /// Sets the full request, replacing any prior values.
9845        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
9846            mut self,
9847            v: V,
9848        ) -> Self {
9849            self.0.request = v.into();
9850            self
9851        }
9852
9853        /// Sets all the options, replacing any prior values.
9854        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9855            self.0.options = v.into();
9856            self
9857        }
9858
9859        /// Sends the request.
9860        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9861            (*self.0.stub)
9862                .set_iam_policy(self.0.request, self.0.options)
9863                .await
9864                .map(crate::Response::into_body)
9865        }
9866
9867        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
9868        ///
9869        /// This is a **required** field for requests.
9870        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9871            self.0.request.resource = v.into();
9872            self
9873        }
9874
9875        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
9876        ///
9877        /// This is a **required** field for requests.
9878        pub fn set_policy<T>(mut self, v: T) -> Self
9879        where
9880            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9881        {
9882            self.0.request.policy = std::option::Option::Some(v.into());
9883            self
9884        }
9885
9886        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
9887        ///
9888        /// This is a **required** field for requests.
9889        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9890        where
9891            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9892        {
9893            self.0.request.policy = v.map(|x| x.into());
9894            self
9895        }
9896
9897        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
9898        pub fn set_update_mask<T>(mut self, v: T) -> Self
9899        where
9900            T: std::convert::Into<wkt::FieldMask>,
9901        {
9902            self.0.request.update_mask = std::option::Option::Some(v.into());
9903            self
9904        }
9905
9906        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
9907        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9908        where
9909            T: std::convert::Into<wkt::FieldMask>,
9910        {
9911            self.0.request.update_mask = v.map(|x| x.into());
9912            self
9913        }
9914    }
9915
9916    #[doc(hidden)]
9917    impl crate::RequestBuilder for SetIamPolicy {
9918        fn request_options(&mut self) -> &mut crate::RequestOptions {
9919            &mut self.0.options
9920        }
9921    }
9922
9923    /// The request builder for [Intercept::get_iam_policy][crate::client::Intercept::get_iam_policy] calls.
9924    ///
9925    /// # Example
9926    /// ```
9927    /// # use google_cloud_networksecurity_v1::builder::intercept::GetIamPolicy;
9928    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9929    ///
9930    /// let builder = prepare_request_builder();
9931    /// let response = builder.send().await?;
9932    /// # Ok(()) }
9933    ///
9934    /// fn prepare_request_builder() -> GetIamPolicy {
9935    ///   # panic!();
9936    ///   // ... details omitted ...
9937    /// }
9938    /// ```
9939    #[derive(Clone, Debug)]
9940    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
9941
9942    impl GetIamPolicy {
9943        pub(crate) fn new(
9944            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9945        ) -> Self {
9946            Self(RequestBuilder::new(stub))
9947        }
9948
9949        /// Sets the full request, replacing any prior values.
9950        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
9951            mut self,
9952            v: V,
9953        ) -> Self {
9954            self.0.request = v.into();
9955            self
9956        }
9957
9958        /// Sets all the options, replacing any prior values.
9959        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9960            self.0.options = v.into();
9961            self
9962        }
9963
9964        /// Sends the request.
9965        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9966            (*self.0.stub)
9967                .get_iam_policy(self.0.request, self.0.options)
9968                .await
9969                .map(crate::Response::into_body)
9970        }
9971
9972        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
9973        ///
9974        /// This is a **required** field for requests.
9975        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9976            self.0.request.resource = v.into();
9977            self
9978        }
9979
9980        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
9981        pub fn set_options<T>(mut self, v: T) -> Self
9982        where
9983            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9984        {
9985            self.0.request.options = std::option::Option::Some(v.into());
9986            self
9987        }
9988
9989        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
9990        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9991        where
9992            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9993        {
9994            self.0.request.options = v.map(|x| x.into());
9995            self
9996        }
9997    }
9998
9999    #[doc(hidden)]
10000    impl crate::RequestBuilder for GetIamPolicy {
10001        fn request_options(&mut self) -> &mut crate::RequestOptions {
10002            &mut self.0.options
10003        }
10004    }
10005
10006    /// The request builder for [Intercept::test_iam_permissions][crate::client::Intercept::test_iam_permissions] calls.
10007    ///
10008    /// # Example
10009    /// ```
10010    /// # use google_cloud_networksecurity_v1::builder::intercept::TestIamPermissions;
10011    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10012    ///
10013    /// let builder = prepare_request_builder();
10014    /// let response = builder.send().await?;
10015    /// # Ok(()) }
10016    ///
10017    /// fn prepare_request_builder() -> TestIamPermissions {
10018    ///   # panic!();
10019    ///   // ... details omitted ...
10020    /// }
10021    /// ```
10022    #[derive(Clone, Debug)]
10023    pub struct TestIamPermissions(
10024        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
10025    );
10026
10027    impl TestIamPermissions {
10028        pub(crate) fn new(
10029            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10030        ) -> Self {
10031            Self(RequestBuilder::new(stub))
10032        }
10033
10034        /// Sets the full request, replacing any prior values.
10035        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
10036            mut self,
10037            v: V,
10038        ) -> Self {
10039            self.0.request = v.into();
10040            self
10041        }
10042
10043        /// Sets all the options, replacing any prior values.
10044        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10045            self.0.options = v.into();
10046            self
10047        }
10048
10049        /// Sends the request.
10050        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
10051            (*self.0.stub)
10052                .test_iam_permissions(self.0.request, self.0.options)
10053                .await
10054                .map(crate::Response::into_body)
10055        }
10056
10057        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
10058        ///
10059        /// This is a **required** field for requests.
10060        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10061            self.0.request.resource = v.into();
10062            self
10063        }
10064
10065        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
10066        ///
10067        /// This is a **required** field for requests.
10068        pub fn set_permissions<T, V>(mut self, v: T) -> Self
10069        where
10070            T: std::iter::IntoIterator<Item = V>,
10071            V: std::convert::Into<std::string::String>,
10072        {
10073            use std::iter::Iterator;
10074            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10075            self
10076        }
10077    }
10078
10079    #[doc(hidden)]
10080    impl crate::RequestBuilder for TestIamPermissions {
10081        fn request_options(&mut self) -> &mut crate::RequestOptions {
10082            &mut self.0.options
10083        }
10084    }
10085
10086    /// The request builder for [Intercept::list_operations][crate::client::Intercept::list_operations] calls.
10087    ///
10088    /// # Example
10089    /// ```
10090    /// # use google_cloud_networksecurity_v1::builder::intercept::ListOperations;
10091    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10092    /// use google_cloud_gax::paginator::ItemPaginator;
10093    ///
10094    /// let builder = prepare_request_builder();
10095    /// let mut items = builder.by_item();
10096    /// while let Some(result) = items.next().await {
10097    ///   let item = result?;
10098    /// }
10099    /// # Ok(()) }
10100    ///
10101    /// fn prepare_request_builder() -> ListOperations {
10102    ///   # panic!();
10103    ///   // ... details omitted ...
10104    /// }
10105    /// ```
10106    #[derive(Clone, Debug)]
10107    pub struct ListOperations(
10108        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10109    );
10110
10111    impl ListOperations {
10112        pub(crate) fn new(
10113            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10114        ) -> Self {
10115            Self(RequestBuilder::new(stub))
10116        }
10117
10118        /// Sets the full request, replacing any prior values.
10119        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10120            mut self,
10121            v: V,
10122        ) -> Self {
10123            self.0.request = v.into();
10124            self
10125        }
10126
10127        /// Sets all the options, replacing any prior values.
10128        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10129            self.0.options = v.into();
10130            self
10131        }
10132
10133        /// Sends the request.
10134        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
10135            (*self.0.stub)
10136                .list_operations(self.0.request, self.0.options)
10137                .await
10138                .map(crate::Response::into_body)
10139        }
10140
10141        /// Streams each page in the collection.
10142        pub fn by_page(
10143            self,
10144        ) -> impl google_cloud_gax::paginator::Paginator<
10145            google_cloud_longrunning::model::ListOperationsResponse,
10146            crate::Error,
10147        > {
10148            use std::clone::Clone;
10149            let token = self.0.request.page_token.clone();
10150            let execute = move |token: String| {
10151                let mut builder = self.clone();
10152                builder.0.request = builder.0.request.set_page_token(token);
10153                builder.send()
10154            };
10155            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10156        }
10157
10158        /// Streams each item in the collection.
10159        pub fn by_item(
10160            self,
10161        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10162            google_cloud_longrunning::model::ListOperationsResponse,
10163            crate::Error,
10164        > {
10165            use google_cloud_gax::paginator::Paginator;
10166            self.by_page().items()
10167        }
10168
10169        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
10170        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10171            self.0.request.name = v.into();
10172            self
10173        }
10174
10175        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
10176        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10177            self.0.request.filter = v.into();
10178            self
10179        }
10180
10181        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
10182        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10183            self.0.request.page_size = v.into();
10184            self
10185        }
10186
10187        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
10188        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10189            self.0.request.page_token = v.into();
10190            self
10191        }
10192
10193        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
10194        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10195            self.0.request.return_partial_success = v.into();
10196            self
10197        }
10198    }
10199
10200    #[doc(hidden)]
10201    impl crate::RequestBuilder for ListOperations {
10202        fn request_options(&mut self) -> &mut crate::RequestOptions {
10203            &mut self.0.options
10204        }
10205    }
10206
10207    /// The request builder for [Intercept::get_operation][crate::client::Intercept::get_operation] calls.
10208    ///
10209    /// # Example
10210    /// ```
10211    /// # use google_cloud_networksecurity_v1::builder::intercept::GetOperation;
10212    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10213    ///
10214    /// let builder = prepare_request_builder();
10215    /// let response = builder.send().await?;
10216    /// # Ok(()) }
10217    ///
10218    /// fn prepare_request_builder() -> GetOperation {
10219    ///   # panic!();
10220    ///   // ... details omitted ...
10221    /// }
10222    /// ```
10223    #[derive(Clone, Debug)]
10224    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
10225
10226    impl GetOperation {
10227        pub(crate) fn new(
10228            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10229        ) -> Self {
10230            Self(RequestBuilder::new(stub))
10231        }
10232
10233        /// Sets the full request, replacing any prior values.
10234        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
10235            mut self,
10236            v: V,
10237        ) -> Self {
10238            self.0.request = v.into();
10239            self
10240        }
10241
10242        /// Sets all the options, replacing any prior values.
10243        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10244            self.0.options = v.into();
10245            self
10246        }
10247
10248        /// Sends the request.
10249        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10250            (*self.0.stub)
10251                .get_operation(self.0.request, self.0.options)
10252                .await
10253                .map(crate::Response::into_body)
10254        }
10255
10256        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
10257        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10258            self.0.request.name = v.into();
10259            self
10260        }
10261    }
10262
10263    #[doc(hidden)]
10264    impl crate::RequestBuilder for GetOperation {
10265        fn request_options(&mut self) -> &mut crate::RequestOptions {
10266            &mut self.0.options
10267        }
10268    }
10269
10270    /// The request builder for [Intercept::delete_operation][crate::client::Intercept::delete_operation] calls.
10271    ///
10272    /// # Example
10273    /// ```
10274    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteOperation;
10275    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10276    ///
10277    /// let builder = prepare_request_builder();
10278    /// let response = builder.send().await?;
10279    /// # Ok(()) }
10280    ///
10281    /// fn prepare_request_builder() -> DeleteOperation {
10282    ///   # panic!();
10283    ///   // ... details omitted ...
10284    /// }
10285    /// ```
10286    #[derive(Clone, Debug)]
10287    pub struct DeleteOperation(
10288        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
10289    );
10290
10291    impl DeleteOperation {
10292        pub(crate) fn new(
10293            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10294        ) -> Self {
10295            Self(RequestBuilder::new(stub))
10296        }
10297
10298        /// Sets the full request, replacing any prior values.
10299        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
10300            mut self,
10301            v: V,
10302        ) -> Self {
10303            self.0.request = v.into();
10304            self
10305        }
10306
10307        /// Sets all the options, replacing any prior values.
10308        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10309            self.0.options = v.into();
10310            self
10311        }
10312
10313        /// Sends the request.
10314        pub async fn send(self) -> Result<()> {
10315            (*self.0.stub)
10316                .delete_operation(self.0.request, self.0.options)
10317                .await
10318                .map(crate::Response::into_body)
10319        }
10320
10321        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
10322        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10323            self.0.request.name = v.into();
10324            self
10325        }
10326    }
10327
10328    #[doc(hidden)]
10329    impl crate::RequestBuilder for DeleteOperation {
10330        fn request_options(&mut self) -> &mut crate::RequestOptions {
10331            &mut self.0.options
10332        }
10333    }
10334
10335    /// The request builder for [Intercept::cancel_operation][crate::client::Intercept::cancel_operation] calls.
10336    ///
10337    /// # Example
10338    /// ```
10339    /// # use google_cloud_networksecurity_v1::builder::intercept::CancelOperation;
10340    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10341    ///
10342    /// let builder = prepare_request_builder();
10343    /// let response = builder.send().await?;
10344    /// # Ok(()) }
10345    ///
10346    /// fn prepare_request_builder() -> CancelOperation {
10347    ///   # panic!();
10348    ///   // ... details omitted ...
10349    /// }
10350    /// ```
10351    #[derive(Clone, Debug)]
10352    pub struct CancelOperation(
10353        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10354    );
10355
10356    impl CancelOperation {
10357        pub(crate) fn new(
10358            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10359        ) -> Self {
10360            Self(RequestBuilder::new(stub))
10361        }
10362
10363        /// Sets the full request, replacing any prior values.
10364        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10365            mut self,
10366            v: V,
10367        ) -> Self {
10368            self.0.request = v.into();
10369            self
10370        }
10371
10372        /// Sets all the options, replacing any prior values.
10373        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10374            self.0.options = v.into();
10375            self
10376        }
10377
10378        /// Sends the request.
10379        pub async fn send(self) -> Result<()> {
10380            (*self.0.stub)
10381                .cancel_operation(self.0.request, self.0.options)
10382                .await
10383                .map(crate::Response::into_body)
10384        }
10385
10386        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
10387        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10388            self.0.request.name = v.into();
10389            self
10390        }
10391    }
10392
10393    #[doc(hidden)]
10394    impl crate::RequestBuilder for CancelOperation {
10395        fn request_options(&mut self) -> &mut crate::RequestOptions {
10396            &mut self.0.options
10397        }
10398    }
10399}
10400
10401pub mod mirroring {
10402    use crate::Result;
10403
10404    /// A builder for [Mirroring][crate::client::Mirroring].
10405    ///
10406    /// ```
10407    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10408    /// # use google_cloud_networksecurity_v1::*;
10409    /// # use builder::mirroring::ClientBuilder;
10410    /// # use client::Mirroring;
10411    /// let builder : ClientBuilder = Mirroring::builder();
10412    /// let client = builder
10413    ///     .with_endpoint("https://networksecurity.googleapis.com")
10414    ///     .build().await?;
10415    /// # Ok(()) }
10416    /// ```
10417    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10418
10419    pub(crate) mod client {
10420        use super::super::super::client::Mirroring;
10421        pub struct Factory;
10422        impl crate::ClientFactory for Factory {
10423            type Client = Mirroring;
10424            type Credentials = gaxi::options::Credentials;
10425            async fn build(
10426                self,
10427                config: gaxi::options::ClientConfig,
10428            ) -> crate::ClientBuilderResult<Self::Client> {
10429                Self::Client::new(config).await
10430            }
10431        }
10432    }
10433
10434    /// Common implementation for [crate::client::Mirroring] request builders.
10435    #[derive(Clone, Debug)]
10436    pub(crate) struct RequestBuilder<R: std::default::Default> {
10437        stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10438        request: R,
10439        options: crate::RequestOptions,
10440    }
10441
10442    impl<R> RequestBuilder<R>
10443    where
10444        R: std::default::Default,
10445    {
10446        pub(crate) fn new(
10447            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10448        ) -> Self {
10449            Self {
10450                stub,
10451                request: R::default(),
10452                options: crate::RequestOptions::default(),
10453            }
10454        }
10455    }
10456
10457    /// The request builder for [Mirroring::list_mirroring_endpoint_groups][crate::client::Mirroring::list_mirroring_endpoint_groups] calls.
10458    ///
10459    /// # Example
10460    /// ```
10461    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringEndpointGroups;
10462    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10463    /// use google_cloud_gax::paginator::ItemPaginator;
10464    ///
10465    /// let builder = prepare_request_builder();
10466    /// let mut items = builder.by_item();
10467    /// while let Some(result) = items.next().await {
10468    ///   let item = result?;
10469    /// }
10470    /// # Ok(()) }
10471    ///
10472    /// fn prepare_request_builder() -> ListMirroringEndpointGroups {
10473    ///   # panic!();
10474    ///   // ... details omitted ...
10475    /// }
10476    /// ```
10477    #[derive(Clone, Debug)]
10478    pub struct ListMirroringEndpointGroups(
10479        RequestBuilder<crate::model::ListMirroringEndpointGroupsRequest>,
10480    );
10481
10482    impl ListMirroringEndpointGroups {
10483        pub(crate) fn new(
10484            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10485        ) -> Self {
10486            Self(RequestBuilder::new(stub))
10487        }
10488
10489        /// Sets the full request, replacing any prior values.
10490        pub fn with_request<V: Into<crate::model::ListMirroringEndpointGroupsRequest>>(
10491            mut self,
10492            v: V,
10493        ) -> Self {
10494            self.0.request = v.into();
10495            self
10496        }
10497
10498        /// Sets all the options, replacing any prior values.
10499        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10500            self.0.options = v.into();
10501            self
10502        }
10503
10504        /// Sends the request.
10505        pub async fn send(self) -> Result<crate::model::ListMirroringEndpointGroupsResponse> {
10506            (*self.0.stub)
10507                .list_mirroring_endpoint_groups(self.0.request, self.0.options)
10508                .await
10509                .map(crate::Response::into_body)
10510        }
10511
10512        /// Streams each page in the collection.
10513        pub fn by_page(
10514            self,
10515        ) -> impl google_cloud_gax::paginator::Paginator<
10516            crate::model::ListMirroringEndpointGroupsResponse,
10517            crate::Error,
10518        > {
10519            use std::clone::Clone;
10520            let token = self.0.request.page_token.clone();
10521            let execute = move |token: String| {
10522                let mut builder = self.clone();
10523                builder.0.request = builder.0.request.set_page_token(token);
10524                builder.send()
10525            };
10526            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10527        }
10528
10529        /// Streams each item in the collection.
10530        pub fn by_item(
10531            self,
10532        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10533            crate::model::ListMirroringEndpointGroupsResponse,
10534            crate::Error,
10535        > {
10536            use google_cloud_gax::paginator::Paginator;
10537            self.by_page().items()
10538        }
10539
10540        /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupsRequest::parent].
10541        ///
10542        /// This is a **required** field for requests.
10543        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10544            self.0.request.parent = v.into();
10545            self
10546        }
10547
10548        /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupsRequest::page_size].
10549        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10550            self.0.request.page_size = v.into();
10551            self
10552        }
10553
10554        /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupsRequest::page_token].
10555        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10556            self.0.request.page_token = v.into();
10557            self
10558        }
10559
10560        /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupsRequest::filter].
10561        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10562            self.0.request.filter = v.into();
10563            self
10564        }
10565
10566        /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupsRequest::order_by].
10567        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10568            self.0.request.order_by = v.into();
10569            self
10570        }
10571    }
10572
10573    #[doc(hidden)]
10574    impl crate::RequestBuilder for ListMirroringEndpointGroups {
10575        fn request_options(&mut self) -> &mut crate::RequestOptions {
10576            &mut self.0.options
10577        }
10578    }
10579
10580    /// The request builder for [Mirroring::get_mirroring_endpoint_group][crate::client::Mirroring::get_mirroring_endpoint_group] calls.
10581    ///
10582    /// # Example
10583    /// ```
10584    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringEndpointGroup;
10585    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10586    ///
10587    /// let builder = prepare_request_builder();
10588    /// let response = builder.send().await?;
10589    /// # Ok(()) }
10590    ///
10591    /// fn prepare_request_builder() -> GetMirroringEndpointGroup {
10592    ///   # panic!();
10593    ///   // ... details omitted ...
10594    /// }
10595    /// ```
10596    #[derive(Clone, Debug)]
10597    pub struct GetMirroringEndpointGroup(
10598        RequestBuilder<crate::model::GetMirroringEndpointGroupRequest>,
10599    );
10600
10601    impl GetMirroringEndpointGroup {
10602        pub(crate) fn new(
10603            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10604        ) -> Self {
10605            Self(RequestBuilder::new(stub))
10606        }
10607
10608        /// Sets the full request, replacing any prior values.
10609        pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupRequest>>(
10610            mut self,
10611            v: V,
10612        ) -> Self {
10613            self.0.request = v.into();
10614            self
10615        }
10616
10617        /// Sets all the options, replacing any prior values.
10618        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10619            self.0.options = v.into();
10620            self
10621        }
10622
10623        /// Sends the request.
10624        pub async fn send(self) -> Result<crate::model::MirroringEndpointGroup> {
10625            (*self.0.stub)
10626                .get_mirroring_endpoint_group(self.0.request, self.0.options)
10627                .await
10628                .map(crate::Response::into_body)
10629        }
10630
10631        /// Sets the value of [name][crate::model::GetMirroringEndpointGroupRequest::name].
10632        ///
10633        /// This is a **required** field for requests.
10634        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10635            self.0.request.name = v.into();
10636            self
10637        }
10638    }
10639
10640    #[doc(hidden)]
10641    impl crate::RequestBuilder for GetMirroringEndpointGroup {
10642        fn request_options(&mut self) -> &mut crate::RequestOptions {
10643            &mut self.0.options
10644        }
10645    }
10646
10647    /// The request builder for [Mirroring::create_mirroring_endpoint_group][crate::client::Mirroring::create_mirroring_endpoint_group] calls.
10648    ///
10649    /// # Example
10650    /// ```
10651    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringEndpointGroup;
10652    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10653    /// use google_cloud_lro::Poller;
10654    ///
10655    /// let builder = prepare_request_builder();
10656    /// let response = builder.poller().until_done().await?;
10657    /// # Ok(()) }
10658    ///
10659    /// fn prepare_request_builder() -> CreateMirroringEndpointGroup {
10660    ///   # panic!();
10661    ///   // ... details omitted ...
10662    /// }
10663    /// ```
10664    #[derive(Clone, Debug)]
10665    pub struct CreateMirroringEndpointGroup(
10666        RequestBuilder<crate::model::CreateMirroringEndpointGroupRequest>,
10667    );
10668
10669    impl CreateMirroringEndpointGroup {
10670        pub(crate) fn new(
10671            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10672        ) -> Self {
10673            Self(RequestBuilder::new(stub))
10674        }
10675
10676        /// Sets the full request, replacing any prior values.
10677        pub fn with_request<V: Into<crate::model::CreateMirroringEndpointGroupRequest>>(
10678            mut self,
10679            v: V,
10680        ) -> Self {
10681            self.0.request = v.into();
10682            self
10683        }
10684
10685        /// Sets all the options, replacing any prior values.
10686        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10687            self.0.options = v.into();
10688            self
10689        }
10690
10691        /// Sends the request.
10692        ///
10693        /// # Long running operations
10694        ///
10695        /// This starts, but does not poll, a longrunning operation. More information
10696        /// on [create_mirroring_endpoint_group][crate::client::Mirroring::create_mirroring_endpoint_group].
10697        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10698            (*self.0.stub)
10699                .create_mirroring_endpoint_group(self.0.request, self.0.options)
10700                .await
10701                .map(crate::Response::into_body)
10702        }
10703
10704        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_endpoint_group`.
10705        pub fn poller(
10706            self,
10707        ) -> impl google_cloud_lro::Poller<
10708            crate::model::MirroringEndpointGroup,
10709            crate::model::OperationMetadata,
10710        > {
10711            type Operation = google_cloud_lro::internal::Operation<
10712                crate::model::MirroringEndpointGroup,
10713                crate::model::OperationMetadata,
10714            >;
10715            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10716            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10717
10718            let stub = self.0.stub.clone();
10719            let mut options = self.0.options.clone();
10720            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10721            let query = move |name| {
10722                let stub = stub.clone();
10723                let options = options.clone();
10724                async {
10725                    let op = GetOperation::new(stub)
10726                        .set_name(name)
10727                        .with_options(options)
10728                        .send()
10729                        .await?;
10730                    Ok(Operation::new(op))
10731                }
10732            };
10733
10734            let start = move || async {
10735                let op = self.send().await?;
10736                Ok(Operation::new(op))
10737            };
10738
10739            google_cloud_lro::internal::new_poller(
10740                polling_error_policy,
10741                polling_backoff_policy,
10742                start,
10743                query,
10744            )
10745        }
10746
10747        /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupRequest::parent].
10748        ///
10749        /// This is a **required** field for requests.
10750        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10751            self.0.request.parent = v.into();
10752            self
10753        }
10754
10755        /// Sets the value of [mirroring_endpoint_group_id][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group_id].
10756        ///
10757        /// This is a **required** field for requests.
10758        pub fn set_mirroring_endpoint_group_id<T: Into<std::string::String>>(
10759            mut self,
10760            v: T,
10761        ) -> Self {
10762            self.0.request.mirroring_endpoint_group_id = v.into();
10763            self
10764        }
10765
10766        /// Sets the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
10767        ///
10768        /// This is a **required** field for requests.
10769        pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
10770        where
10771            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10772        {
10773            self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
10774            self
10775        }
10776
10777        /// Sets or clears the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
10778        ///
10779        /// This is a **required** field for requests.
10780        pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
10781        where
10782            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10783        {
10784            self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
10785            self
10786        }
10787
10788        /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupRequest::request_id].
10789        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10790            self.0.request.request_id = v.into();
10791            self
10792        }
10793    }
10794
10795    #[doc(hidden)]
10796    impl crate::RequestBuilder for CreateMirroringEndpointGroup {
10797        fn request_options(&mut self) -> &mut crate::RequestOptions {
10798            &mut self.0.options
10799        }
10800    }
10801
10802    /// The request builder for [Mirroring::update_mirroring_endpoint_group][crate::client::Mirroring::update_mirroring_endpoint_group] calls.
10803    ///
10804    /// # Example
10805    /// ```
10806    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringEndpointGroup;
10807    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10808    /// use google_cloud_lro::Poller;
10809    ///
10810    /// let builder = prepare_request_builder();
10811    /// let response = builder.poller().until_done().await?;
10812    /// # Ok(()) }
10813    ///
10814    /// fn prepare_request_builder() -> UpdateMirroringEndpointGroup {
10815    ///   # panic!();
10816    ///   // ... details omitted ...
10817    /// }
10818    /// ```
10819    #[derive(Clone, Debug)]
10820    pub struct UpdateMirroringEndpointGroup(
10821        RequestBuilder<crate::model::UpdateMirroringEndpointGroupRequest>,
10822    );
10823
10824    impl UpdateMirroringEndpointGroup {
10825        pub(crate) fn new(
10826            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10827        ) -> Self {
10828            Self(RequestBuilder::new(stub))
10829        }
10830
10831        /// Sets the full request, replacing any prior values.
10832        pub fn with_request<V: Into<crate::model::UpdateMirroringEndpointGroupRequest>>(
10833            mut self,
10834            v: V,
10835        ) -> Self {
10836            self.0.request = v.into();
10837            self
10838        }
10839
10840        /// Sets all the options, replacing any prior values.
10841        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10842            self.0.options = v.into();
10843            self
10844        }
10845
10846        /// Sends the request.
10847        ///
10848        /// # Long running operations
10849        ///
10850        /// This starts, but does not poll, a longrunning operation. More information
10851        /// on [update_mirroring_endpoint_group][crate::client::Mirroring::update_mirroring_endpoint_group].
10852        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10853            (*self.0.stub)
10854                .update_mirroring_endpoint_group(self.0.request, self.0.options)
10855                .await
10856                .map(crate::Response::into_body)
10857        }
10858
10859        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_endpoint_group`.
10860        pub fn poller(
10861            self,
10862        ) -> impl google_cloud_lro::Poller<
10863            crate::model::MirroringEndpointGroup,
10864            crate::model::OperationMetadata,
10865        > {
10866            type Operation = google_cloud_lro::internal::Operation<
10867                crate::model::MirroringEndpointGroup,
10868                crate::model::OperationMetadata,
10869            >;
10870            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10871            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10872
10873            let stub = self.0.stub.clone();
10874            let mut options = self.0.options.clone();
10875            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10876            let query = move |name| {
10877                let stub = stub.clone();
10878                let options = options.clone();
10879                async {
10880                    let op = GetOperation::new(stub)
10881                        .set_name(name)
10882                        .with_options(options)
10883                        .send()
10884                        .await?;
10885                    Ok(Operation::new(op))
10886                }
10887            };
10888
10889            let start = move || async {
10890                let op = self.send().await?;
10891                Ok(Operation::new(op))
10892            };
10893
10894            google_cloud_lro::internal::new_poller(
10895                polling_error_policy,
10896                polling_backoff_policy,
10897                start,
10898                query,
10899            )
10900        }
10901
10902        /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
10903        pub fn set_update_mask<T>(mut self, v: T) -> Self
10904        where
10905            T: std::convert::Into<wkt::FieldMask>,
10906        {
10907            self.0.request.update_mask = std::option::Option::Some(v.into());
10908            self
10909        }
10910
10911        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
10912        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10913        where
10914            T: std::convert::Into<wkt::FieldMask>,
10915        {
10916            self.0.request.update_mask = v.map(|x| x.into());
10917            self
10918        }
10919
10920        /// Sets the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
10921        ///
10922        /// This is a **required** field for requests.
10923        pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
10924        where
10925            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10926        {
10927            self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
10928            self
10929        }
10930
10931        /// Sets or clears the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
10932        ///
10933        /// This is a **required** field for requests.
10934        pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
10935        where
10936            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
10937        {
10938            self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
10939            self
10940        }
10941
10942        /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupRequest::request_id].
10943        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10944            self.0.request.request_id = v.into();
10945            self
10946        }
10947    }
10948
10949    #[doc(hidden)]
10950    impl crate::RequestBuilder for UpdateMirroringEndpointGroup {
10951        fn request_options(&mut self) -> &mut crate::RequestOptions {
10952            &mut self.0.options
10953        }
10954    }
10955
10956    /// The request builder for [Mirroring::delete_mirroring_endpoint_group][crate::client::Mirroring::delete_mirroring_endpoint_group] calls.
10957    ///
10958    /// # Example
10959    /// ```
10960    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringEndpointGroup;
10961    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10962    /// use google_cloud_lro::Poller;
10963    ///
10964    /// let builder = prepare_request_builder();
10965    /// let response = builder.poller().until_done().await?;
10966    /// # Ok(()) }
10967    ///
10968    /// fn prepare_request_builder() -> DeleteMirroringEndpointGroup {
10969    ///   # panic!();
10970    ///   // ... details omitted ...
10971    /// }
10972    /// ```
10973    #[derive(Clone, Debug)]
10974    pub struct DeleteMirroringEndpointGroup(
10975        RequestBuilder<crate::model::DeleteMirroringEndpointGroupRequest>,
10976    );
10977
10978    impl DeleteMirroringEndpointGroup {
10979        pub(crate) fn new(
10980            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
10981        ) -> Self {
10982            Self(RequestBuilder::new(stub))
10983        }
10984
10985        /// Sets the full request, replacing any prior values.
10986        pub fn with_request<V: Into<crate::model::DeleteMirroringEndpointGroupRequest>>(
10987            mut self,
10988            v: V,
10989        ) -> Self {
10990            self.0.request = v.into();
10991            self
10992        }
10993
10994        /// Sets all the options, replacing any prior values.
10995        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10996            self.0.options = v.into();
10997            self
10998        }
10999
11000        /// Sends the request.
11001        ///
11002        /// # Long running operations
11003        ///
11004        /// This starts, but does not poll, a longrunning operation. More information
11005        /// on [delete_mirroring_endpoint_group][crate::client::Mirroring::delete_mirroring_endpoint_group].
11006        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11007            (*self.0.stub)
11008                .delete_mirroring_endpoint_group(self.0.request, self.0.options)
11009                .await
11010                .map(crate::Response::into_body)
11011        }
11012
11013        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_endpoint_group`.
11014        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11015            type Operation =
11016                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11017            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11018            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11019
11020            let stub = self.0.stub.clone();
11021            let mut options = self.0.options.clone();
11022            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11023            let query = move |name| {
11024                let stub = stub.clone();
11025                let options = options.clone();
11026                async {
11027                    let op = GetOperation::new(stub)
11028                        .set_name(name)
11029                        .with_options(options)
11030                        .send()
11031                        .await?;
11032                    Ok(Operation::new(op))
11033                }
11034            };
11035
11036            let start = move || async {
11037                let op = self.send().await?;
11038                Ok(Operation::new(op))
11039            };
11040
11041            google_cloud_lro::internal::new_unit_response_poller(
11042                polling_error_policy,
11043                polling_backoff_policy,
11044                start,
11045                query,
11046            )
11047        }
11048
11049        /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupRequest::name].
11050        ///
11051        /// This is a **required** field for requests.
11052        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11053            self.0.request.name = v.into();
11054            self
11055        }
11056
11057        /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupRequest::request_id].
11058        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11059            self.0.request.request_id = v.into();
11060            self
11061        }
11062    }
11063
11064    #[doc(hidden)]
11065    impl crate::RequestBuilder for DeleteMirroringEndpointGroup {
11066        fn request_options(&mut self) -> &mut crate::RequestOptions {
11067            &mut self.0.options
11068        }
11069    }
11070
11071    /// The request builder for [Mirroring::list_mirroring_endpoint_group_associations][crate::client::Mirroring::list_mirroring_endpoint_group_associations] calls.
11072    ///
11073    /// # Example
11074    /// ```
11075    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringEndpointGroupAssociations;
11076    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11077    /// use google_cloud_gax::paginator::ItemPaginator;
11078    ///
11079    /// let builder = prepare_request_builder();
11080    /// let mut items = builder.by_item();
11081    /// while let Some(result) = items.next().await {
11082    ///   let item = result?;
11083    /// }
11084    /// # Ok(()) }
11085    ///
11086    /// fn prepare_request_builder() -> ListMirroringEndpointGroupAssociations {
11087    ///   # panic!();
11088    ///   // ... details omitted ...
11089    /// }
11090    /// ```
11091    #[derive(Clone, Debug)]
11092    pub struct ListMirroringEndpointGroupAssociations(
11093        RequestBuilder<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
11094    );
11095
11096    impl ListMirroringEndpointGroupAssociations {
11097        pub(crate) fn new(
11098            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11099        ) -> Self {
11100            Self(RequestBuilder::new(stub))
11101        }
11102
11103        /// Sets the full request, replacing any prior values.
11104        pub fn with_request<
11105            V: Into<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
11106        >(
11107            mut self,
11108            v: V,
11109        ) -> Self {
11110            self.0.request = v.into();
11111            self
11112        }
11113
11114        /// Sets all the options, replacing any prior values.
11115        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11116            self.0.options = v.into();
11117            self
11118        }
11119
11120        /// Sends the request.
11121        pub async fn send(
11122            self,
11123        ) -> Result<crate::model::ListMirroringEndpointGroupAssociationsResponse> {
11124            (*self.0.stub)
11125                .list_mirroring_endpoint_group_associations(self.0.request, self.0.options)
11126                .await
11127                .map(crate::Response::into_body)
11128        }
11129
11130        /// Streams each page in the collection.
11131        pub fn by_page(
11132            self,
11133        ) -> impl google_cloud_gax::paginator::Paginator<
11134            crate::model::ListMirroringEndpointGroupAssociationsResponse,
11135            crate::Error,
11136        > {
11137            use std::clone::Clone;
11138            let token = self.0.request.page_token.clone();
11139            let execute = move |token: String| {
11140                let mut builder = self.clone();
11141                builder.0.request = builder.0.request.set_page_token(token);
11142                builder.send()
11143            };
11144            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11145        }
11146
11147        /// Streams each item in the collection.
11148        pub fn by_item(
11149            self,
11150        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11151            crate::model::ListMirroringEndpointGroupAssociationsResponse,
11152            crate::Error,
11153        > {
11154            use google_cloud_gax::paginator::Paginator;
11155            self.by_page().items()
11156        }
11157
11158        /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupAssociationsRequest::parent].
11159        ///
11160        /// This is a **required** field for requests.
11161        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11162            self.0.request.parent = v.into();
11163            self
11164        }
11165
11166        /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_size].
11167        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11168            self.0.request.page_size = v.into();
11169            self
11170        }
11171
11172        /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_token].
11173        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11174            self.0.request.page_token = v.into();
11175            self
11176        }
11177
11178        /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupAssociationsRequest::filter].
11179        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11180            self.0.request.filter = v.into();
11181            self
11182        }
11183
11184        /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupAssociationsRequest::order_by].
11185        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11186            self.0.request.order_by = v.into();
11187            self
11188        }
11189    }
11190
11191    #[doc(hidden)]
11192    impl crate::RequestBuilder for ListMirroringEndpointGroupAssociations {
11193        fn request_options(&mut self) -> &mut crate::RequestOptions {
11194            &mut self.0.options
11195        }
11196    }
11197
11198    /// The request builder for [Mirroring::get_mirroring_endpoint_group_association][crate::client::Mirroring::get_mirroring_endpoint_group_association] calls.
11199    ///
11200    /// # Example
11201    /// ```
11202    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringEndpointGroupAssociation;
11203    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11204    ///
11205    /// let builder = prepare_request_builder();
11206    /// let response = builder.send().await?;
11207    /// # Ok(()) }
11208    ///
11209    /// fn prepare_request_builder() -> GetMirroringEndpointGroupAssociation {
11210    ///   # panic!();
11211    ///   // ... details omitted ...
11212    /// }
11213    /// ```
11214    #[derive(Clone, Debug)]
11215    pub struct GetMirroringEndpointGroupAssociation(
11216        RequestBuilder<crate::model::GetMirroringEndpointGroupAssociationRequest>,
11217    );
11218
11219    impl GetMirroringEndpointGroupAssociation {
11220        pub(crate) fn new(
11221            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11222        ) -> Self {
11223            Self(RequestBuilder::new(stub))
11224        }
11225
11226        /// Sets the full request, replacing any prior values.
11227        pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupAssociationRequest>>(
11228            mut self,
11229            v: V,
11230        ) -> Self {
11231            self.0.request = v.into();
11232            self
11233        }
11234
11235        /// Sets all the options, replacing any prior values.
11236        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11237            self.0.options = v.into();
11238            self
11239        }
11240
11241        /// Sends the request.
11242        pub async fn send(self) -> Result<crate::model::MirroringEndpointGroupAssociation> {
11243            (*self.0.stub)
11244                .get_mirroring_endpoint_group_association(self.0.request, self.0.options)
11245                .await
11246                .map(crate::Response::into_body)
11247        }
11248
11249        /// Sets the value of [name][crate::model::GetMirroringEndpointGroupAssociationRequest::name].
11250        ///
11251        /// This is a **required** field for requests.
11252        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11253            self.0.request.name = v.into();
11254            self
11255        }
11256    }
11257
11258    #[doc(hidden)]
11259    impl crate::RequestBuilder for GetMirroringEndpointGroupAssociation {
11260        fn request_options(&mut self) -> &mut crate::RequestOptions {
11261            &mut self.0.options
11262        }
11263    }
11264
11265    /// The request builder for [Mirroring::create_mirroring_endpoint_group_association][crate::client::Mirroring::create_mirroring_endpoint_group_association] calls.
11266    ///
11267    /// # Example
11268    /// ```
11269    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringEndpointGroupAssociation;
11270    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11271    /// use google_cloud_lro::Poller;
11272    ///
11273    /// let builder = prepare_request_builder();
11274    /// let response = builder.poller().until_done().await?;
11275    /// # Ok(()) }
11276    ///
11277    /// fn prepare_request_builder() -> CreateMirroringEndpointGroupAssociation {
11278    ///   # panic!();
11279    ///   // ... details omitted ...
11280    /// }
11281    /// ```
11282    #[derive(Clone, Debug)]
11283    pub struct CreateMirroringEndpointGroupAssociation(
11284        RequestBuilder<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
11285    );
11286
11287    impl CreateMirroringEndpointGroupAssociation {
11288        pub(crate) fn new(
11289            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11290        ) -> Self {
11291            Self(RequestBuilder::new(stub))
11292        }
11293
11294        /// Sets the full request, replacing any prior values.
11295        pub fn with_request<
11296            V: Into<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
11297        >(
11298            mut self,
11299            v: V,
11300        ) -> Self {
11301            self.0.request = v.into();
11302            self
11303        }
11304
11305        /// Sets all the options, replacing any prior values.
11306        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11307            self.0.options = v.into();
11308            self
11309        }
11310
11311        /// Sends the request.
11312        ///
11313        /// # Long running operations
11314        ///
11315        /// This starts, but does not poll, a longrunning operation. More information
11316        /// on [create_mirroring_endpoint_group_association][crate::client::Mirroring::create_mirroring_endpoint_group_association].
11317        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11318            (*self.0.stub)
11319                .create_mirroring_endpoint_group_association(self.0.request, self.0.options)
11320                .await
11321                .map(crate::Response::into_body)
11322        }
11323
11324        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_endpoint_group_association`.
11325        pub fn poller(
11326            self,
11327        ) -> impl google_cloud_lro::Poller<
11328            crate::model::MirroringEndpointGroupAssociation,
11329            crate::model::OperationMetadata,
11330        > {
11331            type Operation = google_cloud_lro::internal::Operation<
11332                crate::model::MirroringEndpointGroupAssociation,
11333                crate::model::OperationMetadata,
11334            >;
11335            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11336            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11337
11338            let stub = self.0.stub.clone();
11339            let mut options = self.0.options.clone();
11340            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11341            let query = move |name| {
11342                let stub = stub.clone();
11343                let options = options.clone();
11344                async {
11345                    let op = GetOperation::new(stub)
11346                        .set_name(name)
11347                        .with_options(options)
11348                        .send()
11349                        .await?;
11350                    Ok(Operation::new(op))
11351                }
11352            };
11353
11354            let start = move || async {
11355                let op = self.send().await?;
11356                Ok(Operation::new(op))
11357            };
11358
11359            google_cloud_lro::internal::new_poller(
11360                polling_error_policy,
11361                polling_backoff_policy,
11362                start,
11363                query,
11364            )
11365        }
11366
11367        /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupAssociationRequest::parent].
11368        ///
11369        /// This is a **required** field for requests.
11370        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11371            self.0.request.parent = v.into();
11372            self
11373        }
11374
11375        /// Sets the value of [mirroring_endpoint_group_association_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association_id].
11376        pub fn set_mirroring_endpoint_group_association_id<T: Into<std::string::String>>(
11377            mut self,
11378            v: T,
11379        ) -> Self {
11380            self.0.request.mirroring_endpoint_group_association_id = v.into();
11381            self
11382        }
11383
11384        /// Sets the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
11385        ///
11386        /// This is a **required** field for requests.
11387        pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
11388        where
11389            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11390        {
11391            self.0.request.mirroring_endpoint_group_association =
11392                std::option::Option::Some(v.into());
11393            self
11394        }
11395
11396        /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
11397        ///
11398        /// This is a **required** field for requests.
11399        pub fn set_or_clear_mirroring_endpoint_group_association<T>(
11400            mut self,
11401            v: std::option::Option<T>,
11402        ) -> Self
11403        where
11404            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11405        {
11406            self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
11407            self
11408        }
11409
11410        /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::request_id].
11411        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11412            self.0.request.request_id = v.into();
11413            self
11414        }
11415    }
11416
11417    #[doc(hidden)]
11418    impl crate::RequestBuilder for CreateMirroringEndpointGroupAssociation {
11419        fn request_options(&mut self) -> &mut crate::RequestOptions {
11420            &mut self.0.options
11421        }
11422    }
11423
11424    /// The request builder for [Mirroring::update_mirroring_endpoint_group_association][crate::client::Mirroring::update_mirroring_endpoint_group_association] calls.
11425    ///
11426    /// # Example
11427    /// ```
11428    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringEndpointGroupAssociation;
11429    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11430    /// use google_cloud_lro::Poller;
11431    ///
11432    /// let builder = prepare_request_builder();
11433    /// let response = builder.poller().until_done().await?;
11434    /// # Ok(()) }
11435    ///
11436    /// fn prepare_request_builder() -> UpdateMirroringEndpointGroupAssociation {
11437    ///   # panic!();
11438    ///   // ... details omitted ...
11439    /// }
11440    /// ```
11441    #[derive(Clone, Debug)]
11442    pub struct UpdateMirroringEndpointGroupAssociation(
11443        RequestBuilder<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
11444    );
11445
11446    impl UpdateMirroringEndpointGroupAssociation {
11447        pub(crate) fn new(
11448            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11449        ) -> Self {
11450            Self(RequestBuilder::new(stub))
11451        }
11452
11453        /// Sets the full request, replacing any prior values.
11454        pub fn with_request<
11455            V: Into<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
11456        >(
11457            mut self,
11458            v: V,
11459        ) -> Self {
11460            self.0.request = v.into();
11461            self
11462        }
11463
11464        /// Sets all the options, replacing any prior values.
11465        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11466            self.0.options = v.into();
11467            self
11468        }
11469
11470        /// Sends the request.
11471        ///
11472        /// # Long running operations
11473        ///
11474        /// This starts, but does not poll, a longrunning operation. More information
11475        /// on [update_mirroring_endpoint_group_association][crate::client::Mirroring::update_mirroring_endpoint_group_association].
11476        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11477            (*self.0.stub)
11478                .update_mirroring_endpoint_group_association(self.0.request, self.0.options)
11479                .await
11480                .map(crate::Response::into_body)
11481        }
11482
11483        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_endpoint_group_association`.
11484        pub fn poller(
11485            self,
11486        ) -> impl google_cloud_lro::Poller<
11487            crate::model::MirroringEndpointGroupAssociation,
11488            crate::model::OperationMetadata,
11489        > {
11490            type Operation = google_cloud_lro::internal::Operation<
11491                crate::model::MirroringEndpointGroupAssociation,
11492                crate::model::OperationMetadata,
11493            >;
11494            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11495            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11496
11497            let stub = self.0.stub.clone();
11498            let mut options = self.0.options.clone();
11499            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11500            let query = move |name| {
11501                let stub = stub.clone();
11502                let options = options.clone();
11503                async {
11504                    let op = GetOperation::new(stub)
11505                        .set_name(name)
11506                        .with_options(options)
11507                        .send()
11508                        .await?;
11509                    Ok(Operation::new(op))
11510                }
11511            };
11512
11513            let start = move || async {
11514                let op = self.send().await?;
11515                Ok(Operation::new(op))
11516            };
11517
11518            google_cloud_lro::internal::new_poller(
11519                polling_error_policy,
11520                polling_backoff_policy,
11521                start,
11522                query,
11523            )
11524        }
11525
11526        /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
11527        pub fn set_update_mask<T>(mut self, v: T) -> Self
11528        where
11529            T: std::convert::Into<wkt::FieldMask>,
11530        {
11531            self.0.request.update_mask = std::option::Option::Some(v.into());
11532            self
11533        }
11534
11535        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
11536        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11537        where
11538            T: std::convert::Into<wkt::FieldMask>,
11539        {
11540            self.0.request.update_mask = v.map(|x| x.into());
11541            self
11542        }
11543
11544        /// Sets the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
11545        ///
11546        /// This is a **required** field for requests.
11547        pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
11548        where
11549            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11550        {
11551            self.0.request.mirroring_endpoint_group_association =
11552                std::option::Option::Some(v.into());
11553            self
11554        }
11555
11556        /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
11557        ///
11558        /// This is a **required** field for requests.
11559        pub fn set_or_clear_mirroring_endpoint_group_association<T>(
11560            mut self,
11561            v: std::option::Option<T>,
11562        ) -> Self
11563        where
11564            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
11565        {
11566            self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
11567            self
11568        }
11569
11570        /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupAssociationRequest::request_id].
11571        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11572            self.0.request.request_id = v.into();
11573            self
11574        }
11575    }
11576
11577    #[doc(hidden)]
11578    impl crate::RequestBuilder for UpdateMirroringEndpointGroupAssociation {
11579        fn request_options(&mut self) -> &mut crate::RequestOptions {
11580            &mut self.0.options
11581        }
11582    }
11583
11584    /// The request builder for [Mirroring::delete_mirroring_endpoint_group_association][crate::client::Mirroring::delete_mirroring_endpoint_group_association] calls.
11585    ///
11586    /// # Example
11587    /// ```
11588    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringEndpointGroupAssociation;
11589    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11590    /// use google_cloud_lro::Poller;
11591    ///
11592    /// let builder = prepare_request_builder();
11593    /// let response = builder.poller().until_done().await?;
11594    /// # Ok(()) }
11595    ///
11596    /// fn prepare_request_builder() -> DeleteMirroringEndpointGroupAssociation {
11597    ///   # panic!();
11598    ///   // ... details omitted ...
11599    /// }
11600    /// ```
11601    #[derive(Clone, Debug)]
11602    pub struct DeleteMirroringEndpointGroupAssociation(
11603        RequestBuilder<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
11604    );
11605
11606    impl DeleteMirroringEndpointGroupAssociation {
11607        pub(crate) fn new(
11608            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11609        ) -> Self {
11610            Self(RequestBuilder::new(stub))
11611        }
11612
11613        /// Sets the full request, replacing any prior values.
11614        pub fn with_request<
11615            V: Into<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
11616        >(
11617            mut self,
11618            v: V,
11619        ) -> Self {
11620            self.0.request = v.into();
11621            self
11622        }
11623
11624        /// Sets all the options, replacing any prior values.
11625        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11626            self.0.options = v.into();
11627            self
11628        }
11629
11630        /// Sends the request.
11631        ///
11632        /// # Long running operations
11633        ///
11634        /// This starts, but does not poll, a longrunning operation. More information
11635        /// on [delete_mirroring_endpoint_group_association][crate::client::Mirroring::delete_mirroring_endpoint_group_association].
11636        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11637            (*self.0.stub)
11638                .delete_mirroring_endpoint_group_association(self.0.request, self.0.options)
11639                .await
11640                .map(crate::Response::into_body)
11641        }
11642
11643        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_endpoint_group_association`.
11644        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11645            type Operation =
11646                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11647            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11648            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11649
11650            let stub = self.0.stub.clone();
11651            let mut options = self.0.options.clone();
11652            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11653            let query = move |name| {
11654                let stub = stub.clone();
11655                let options = options.clone();
11656                async {
11657                    let op = GetOperation::new(stub)
11658                        .set_name(name)
11659                        .with_options(options)
11660                        .send()
11661                        .await?;
11662                    Ok(Operation::new(op))
11663                }
11664            };
11665
11666            let start = move || async {
11667                let op = self.send().await?;
11668                Ok(Operation::new(op))
11669            };
11670
11671            google_cloud_lro::internal::new_unit_response_poller(
11672                polling_error_policy,
11673                polling_backoff_policy,
11674                start,
11675                query,
11676            )
11677        }
11678
11679        /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupAssociationRequest::name].
11680        ///
11681        /// This is a **required** field for requests.
11682        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11683            self.0.request.name = v.into();
11684            self
11685        }
11686
11687        /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupAssociationRequest::request_id].
11688        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11689            self.0.request.request_id = v.into();
11690            self
11691        }
11692    }
11693
11694    #[doc(hidden)]
11695    impl crate::RequestBuilder for DeleteMirroringEndpointGroupAssociation {
11696        fn request_options(&mut self) -> &mut crate::RequestOptions {
11697            &mut self.0.options
11698        }
11699    }
11700
11701    /// The request builder for [Mirroring::list_mirroring_deployment_groups][crate::client::Mirroring::list_mirroring_deployment_groups] calls.
11702    ///
11703    /// # Example
11704    /// ```
11705    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringDeploymentGroups;
11706    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11707    /// use google_cloud_gax::paginator::ItemPaginator;
11708    ///
11709    /// let builder = prepare_request_builder();
11710    /// let mut items = builder.by_item();
11711    /// while let Some(result) = items.next().await {
11712    ///   let item = result?;
11713    /// }
11714    /// # Ok(()) }
11715    ///
11716    /// fn prepare_request_builder() -> ListMirroringDeploymentGroups {
11717    ///   # panic!();
11718    ///   // ... details omitted ...
11719    /// }
11720    /// ```
11721    #[derive(Clone, Debug)]
11722    pub struct ListMirroringDeploymentGroups(
11723        RequestBuilder<crate::model::ListMirroringDeploymentGroupsRequest>,
11724    );
11725
11726    impl ListMirroringDeploymentGroups {
11727        pub(crate) fn new(
11728            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11729        ) -> Self {
11730            Self(RequestBuilder::new(stub))
11731        }
11732
11733        /// Sets the full request, replacing any prior values.
11734        pub fn with_request<V: Into<crate::model::ListMirroringDeploymentGroupsRequest>>(
11735            mut self,
11736            v: V,
11737        ) -> Self {
11738            self.0.request = v.into();
11739            self
11740        }
11741
11742        /// Sets all the options, replacing any prior values.
11743        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11744            self.0.options = v.into();
11745            self
11746        }
11747
11748        /// Sends the request.
11749        pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentGroupsResponse> {
11750            (*self.0.stub)
11751                .list_mirroring_deployment_groups(self.0.request, self.0.options)
11752                .await
11753                .map(crate::Response::into_body)
11754        }
11755
11756        /// Streams each page in the collection.
11757        pub fn by_page(
11758            self,
11759        ) -> impl google_cloud_gax::paginator::Paginator<
11760            crate::model::ListMirroringDeploymentGroupsResponse,
11761            crate::Error,
11762        > {
11763            use std::clone::Clone;
11764            let token = self.0.request.page_token.clone();
11765            let execute = move |token: String| {
11766                let mut builder = self.clone();
11767                builder.0.request = builder.0.request.set_page_token(token);
11768                builder.send()
11769            };
11770            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11771        }
11772
11773        /// Streams each item in the collection.
11774        pub fn by_item(
11775            self,
11776        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11777            crate::model::ListMirroringDeploymentGroupsResponse,
11778            crate::Error,
11779        > {
11780            use google_cloud_gax::paginator::Paginator;
11781            self.by_page().items()
11782        }
11783
11784        /// Sets the value of [parent][crate::model::ListMirroringDeploymentGroupsRequest::parent].
11785        ///
11786        /// This is a **required** field for requests.
11787        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11788            self.0.request.parent = v.into();
11789            self
11790        }
11791
11792        /// Sets the value of [page_size][crate::model::ListMirroringDeploymentGroupsRequest::page_size].
11793        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11794            self.0.request.page_size = v.into();
11795            self
11796        }
11797
11798        /// Sets the value of [page_token][crate::model::ListMirroringDeploymentGroupsRequest::page_token].
11799        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11800            self.0.request.page_token = v.into();
11801            self
11802        }
11803
11804        /// Sets the value of [filter][crate::model::ListMirroringDeploymentGroupsRequest::filter].
11805        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11806            self.0.request.filter = v.into();
11807            self
11808        }
11809
11810        /// Sets the value of [order_by][crate::model::ListMirroringDeploymentGroupsRequest::order_by].
11811        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11812            self.0.request.order_by = v.into();
11813            self
11814        }
11815    }
11816
11817    #[doc(hidden)]
11818    impl crate::RequestBuilder for ListMirroringDeploymentGroups {
11819        fn request_options(&mut self) -> &mut crate::RequestOptions {
11820            &mut self.0.options
11821        }
11822    }
11823
11824    /// The request builder for [Mirroring::get_mirroring_deployment_group][crate::client::Mirroring::get_mirroring_deployment_group] calls.
11825    ///
11826    /// # Example
11827    /// ```
11828    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringDeploymentGroup;
11829    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11830    ///
11831    /// let builder = prepare_request_builder();
11832    /// let response = builder.send().await?;
11833    /// # Ok(()) }
11834    ///
11835    /// fn prepare_request_builder() -> GetMirroringDeploymentGroup {
11836    ///   # panic!();
11837    ///   // ... details omitted ...
11838    /// }
11839    /// ```
11840    #[derive(Clone, Debug)]
11841    pub struct GetMirroringDeploymentGroup(
11842        RequestBuilder<crate::model::GetMirroringDeploymentGroupRequest>,
11843    );
11844
11845    impl GetMirroringDeploymentGroup {
11846        pub(crate) fn new(
11847            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11848        ) -> Self {
11849            Self(RequestBuilder::new(stub))
11850        }
11851
11852        /// Sets the full request, replacing any prior values.
11853        pub fn with_request<V: Into<crate::model::GetMirroringDeploymentGroupRequest>>(
11854            mut self,
11855            v: V,
11856        ) -> Self {
11857            self.0.request = v.into();
11858            self
11859        }
11860
11861        /// Sets all the options, replacing any prior values.
11862        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11863            self.0.options = v.into();
11864            self
11865        }
11866
11867        /// Sends the request.
11868        pub async fn send(self) -> Result<crate::model::MirroringDeploymentGroup> {
11869            (*self.0.stub)
11870                .get_mirroring_deployment_group(self.0.request, self.0.options)
11871                .await
11872                .map(crate::Response::into_body)
11873        }
11874
11875        /// Sets the value of [name][crate::model::GetMirroringDeploymentGroupRequest::name].
11876        ///
11877        /// This is a **required** field for requests.
11878        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11879            self.0.request.name = v.into();
11880            self
11881        }
11882    }
11883
11884    #[doc(hidden)]
11885    impl crate::RequestBuilder for GetMirroringDeploymentGroup {
11886        fn request_options(&mut self) -> &mut crate::RequestOptions {
11887            &mut self.0.options
11888        }
11889    }
11890
11891    /// The request builder for [Mirroring::create_mirroring_deployment_group][crate::client::Mirroring::create_mirroring_deployment_group] calls.
11892    ///
11893    /// # Example
11894    /// ```
11895    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringDeploymentGroup;
11896    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11897    /// use google_cloud_lro::Poller;
11898    ///
11899    /// let builder = prepare_request_builder();
11900    /// let response = builder.poller().until_done().await?;
11901    /// # Ok(()) }
11902    ///
11903    /// fn prepare_request_builder() -> CreateMirroringDeploymentGroup {
11904    ///   # panic!();
11905    ///   // ... details omitted ...
11906    /// }
11907    /// ```
11908    #[derive(Clone, Debug)]
11909    pub struct CreateMirroringDeploymentGroup(
11910        RequestBuilder<crate::model::CreateMirroringDeploymentGroupRequest>,
11911    );
11912
11913    impl CreateMirroringDeploymentGroup {
11914        pub(crate) fn new(
11915            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11916        ) -> Self {
11917            Self(RequestBuilder::new(stub))
11918        }
11919
11920        /// Sets the full request, replacing any prior values.
11921        pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentGroupRequest>>(
11922            mut self,
11923            v: V,
11924        ) -> Self {
11925            self.0.request = v.into();
11926            self
11927        }
11928
11929        /// Sets all the options, replacing any prior values.
11930        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11931            self.0.options = v.into();
11932            self
11933        }
11934
11935        /// Sends the request.
11936        ///
11937        /// # Long running operations
11938        ///
11939        /// This starts, but does not poll, a longrunning operation. More information
11940        /// on [create_mirroring_deployment_group][crate::client::Mirroring::create_mirroring_deployment_group].
11941        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11942            (*self.0.stub)
11943                .create_mirroring_deployment_group(self.0.request, self.0.options)
11944                .await
11945                .map(crate::Response::into_body)
11946        }
11947
11948        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_deployment_group`.
11949        pub fn poller(
11950            self,
11951        ) -> impl google_cloud_lro::Poller<
11952            crate::model::MirroringDeploymentGroup,
11953            crate::model::OperationMetadata,
11954        > {
11955            type Operation = google_cloud_lro::internal::Operation<
11956                crate::model::MirroringDeploymentGroup,
11957                crate::model::OperationMetadata,
11958            >;
11959            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11960            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11961
11962            let stub = self.0.stub.clone();
11963            let mut options = self.0.options.clone();
11964            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11965            let query = move |name| {
11966                let stub = stub.clone();
11967                let options = options.clone();
11968                async {
11969                    let op = GetOperation::new(stub)
11970                        .set_name(name)
11971                        .with_options(options)
11972                        .send()
11973                        .await?;
11974                    Ok(Operation::new(op))
11975                }
11976            };
11977
11978            let start = move || async {
11979                let op = self.send().await?;
11980                Ok(Operation::new(op))
11981            };
11982
11983            google_cloud_lro::internal::new_poller(
11984                polling_error_policy,
11985                polling_backoff_policy,
11986                start,
11987                query,
11988            )
11989        }
11990
11991        /// Sets the value of [parent][crate::model::CreateMirroringDeploymentGroupRequest::parent].
11992        ///
11993        /// This is a **required** field for requests.
11994        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11995            self.0.request.parent = v.into();
11996            self
11997        }
11998
11999        /// Sets the value of [mirroring_deployment_group_id][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group_id].
12000        ///
12001        /// This is a **required** field for requests.
12002        pub fn set_mirroring_deployment_group_id<T: Into<std::string::String>>(
12003            mut self,
12004            v: T,
12005        ) -> Self {
12006            self.0.request.mirroring_deployment_group_id = v.into();
12007            self
12008        }
12009
12010        /// Sets the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
12011        ///
12012        /// This is a **required** field for requests.
12013        pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
12014        where
12015            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12016        {
12017            self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
12018            self
12019        }
12020
12021        /// Sets or clears the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
12022        ///
12023        /// This is a **required** field for requests.
12024        pub fn set_or_clear_mirroring_deployment_group<T>(
12025            mut self,
12026            v: std::option::Option<T>,
12027        ) -> Self
12028        where
12029            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12030        {
12031            self.0.request.mirroring_deployment_group = v.map(|x| x.into());
12032            self
12033        }
12034
12035        /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentGroupRequest::request_id].
12036        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12037            self.0.request.request_id = v.into();
12038            self
12039        }
12040    }
12041
12042    #[doc(hidden)]
12043    impl crate::RequestBuilder for CreateMirroringDeploymentGroup {
12044        fn request_options(&mut self) -> &mut crate::RequestOptions {
12045            &mut self.0.options
12046        }
12047    }
12048
12049    /// The request builder for [Mirroring::update_mirroring_deployment_group][crate::client::Mirroring::update_mirroring_deployment_group] calls.
12050    ///
12051    /// # Example
12052    /// ```
12053    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringDeploymentGroup;
12054    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12055    /// use google_cloud_lro::Poller;
12056    ///
12057    /// let builder = prepare_request_builder();
12058    /// let response = builder.poller().until_done().await?;
12059    /// # Ok(()) }
12060    ///
12061    /// fn prepare_request_builder() -> UpdateMirroringDeploymentGroup {
12062    ///   # panic!();
12063    ///   // ... details omitted ...
12064    /// }
12065    /// ```
12066    #[derive(Clone, Debug)]
12067    pub struct UpdateMirroringDeploymentGroup(
12068        RequestBuilder<crate::model::UpdateMirroringDeploymentGroupRequest>,
12069    );
12070
12071    impl UpdateMirroringDeploymentGroup {
12072        pub(crate) fn new(
12073            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12074        ) -> Self {
12075            Self(RequestBuilder::new(stub))
12076        }
12077
12078        /// Sets the full request, replacing any prior values.
12079        pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentGroupRequest>>(
12080            mut self,
12081            v: V,
12082        ) -> Self {
12083            self.0.request = v.into();
12084            self
12085        }
12086
12087        /// Sets all the options, replacing any prior values.
12088        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12089            self.0.options = v.into();
12090            self
12091        }
12092
12093        /// Sends the request.
12094        ///
12095        /// # Long running operations
12096        ///
12097        /// This starts, but does not poll, a longrunning operation. More information
12098        /// on [update_mirroring_deployment_group][crate::client::Mirroring::update_mirroring_deployment_group].
12099        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12100            (*self.0.stub)
12101                .update_mirroring_deployment_group(self.0.request, self.0.options)
12102                .await
12103                .map(crate::Response::into_body)
12104        }
12105
12106        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_deployment_group`.
12107        pub fn poller(
12108            self,
12109        ) -> impl google_cloud_lro::Poller<
12110            crate::model::MirroringDeploymentGroup,
12111            crate::model::OperationMetadata,
12112        > {
12113            type Operation = google_cloud_lro::internal::Operation<
12114                crate::model::MirroringDeploymentGroup,
12115                crate::model::OperationMetadata,
12116            >;
12117            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12118            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12119
12120            let stub = self.0.stub.clone();
12121            let mut options = self.0.options.clone();
12122            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12123            let query = move |name| {
12124                let stub = stub.clone();
12125                let options = options.clone();
12126                async {
12127                    let op = GetOperation::new(stub)
12128                        .set_name(name)
12129                        .with_options(options)
12130                        .send()
12131                        .await?;
12132                    Ok(Operation::new(op))
12133                }
12134            };
12135
12136            let start = move || async {
12137                let op = self.send().await?;
12138                Ok(Operation::new(op))
12139            };
12140
12141            google_cloud_lro::internal::new_poller(
12142                polling_error_policy,
12143                polling_backoff_policy,
12144                start,
12145                query,
12146            )
12147        }
12148
12149        /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
12150        pub fn set_update_mask<T>(mut self, v: T) -> Self
12151        where
12152            T: std::convert::Into<wkt::FieldMask>,
12153        {
12154            self.0.request.update_mask = std::option::Option::Some(v.into());
12155            self
12156        }
12157
12158        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
12159        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12160        where
12161            T: std::convert::Into<wkt::FieldMask>,
12162        {
12163            self.0.request.update_mask = v.map(|x| x.into());
12164            self
12165        }
12166
12167        /// Sets the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
12168        ///
12169        /// This is a **required** field for requests.
12170        pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
12171        where
12172            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12173        {
12174            self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
12175            self
12176        }
12177
12178        /// Sets or clears the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
12179        ///
12180        /// This is a **required** field for requests.
12181        pub fn set_or_clear_mirroring_deployment_group<T>(
12182            mut self,
12183            v: std::option::Option<T>,
12184        ) -> Self
12185        where
12186            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12187        {
12188            self.0.request.mirroring_deployment_group = v.map(|x| x.into());
12189            self
12190        }
12191
12192        /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentGroupRequest::request_id].
12193        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12194            self.0.request.request_id = v.into();
12195            self
12196        }
12197    }
12198
12199    #[doc(hidden)]
12200    impl crate::RequestBuilder for UpdateMirroringDeploymentGroup {
12201        fn request_options(&mut self) -> &mut crate::RequestOptions {
12202            &mut self.0.options
12203        }
12204    }
12205
12206    /// The request builder for [Mirroring::delete_mirroring_deployment_group][crate::client::Mirroring::delete_mirroring_deployment_group] calls.
12207    ///
12208    /// # Example
12209    /// ```
12210    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringDeploymentGroup;
12211    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12212    /// use google_cloud_lro::Poller;
12213    ///
12214    /// let builder = prepare_request_builder();
12215    /// let response = builder.poller().until_done().await?;
12216    /// # Ok(()) }
12217    ///
12218    /// fn prepare_request_builder() -> DeleteMirroringDeploymentGroup {
12219    ///   # panic!();
12220    ///   // ... details omitted ...
12221    /// }
12222    /// ```
12223    #[derive(Clone, Debug)]
12224    pub struct DeleteMirroringDeploymentGroup(
12225        RequestBuilder<crate::model::DeleteMirroringDeploymentGroupRequest>,
12226    );
12227
12228    impl DeleteMirroringDeploymentGroup {
12229        pub(crate) fn new(
12230            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12231        ) -> Self {
12232            Self(RequestBuilder::new(stub))
12233        }
12234
12235        /// Sets the full request, replacing any prior values.
12236        pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentGroupRequest>>(
12237            mut self,
12238            v: V,
12239        ) -> Self {
12240            self.0.request = v.into();
12241            self
12242        }
12243
12244        /// Sets all the options, replacing any prior values.
12245        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12246            self.0.options = v.into();
12247            self
12248        }
12249
12250        /// Sends the request.
12251        ///
12252        /// # Long running operations
12253        ///
12254        /// This starts, but does not poll, a longrunning operation. More information
12255        /// on [delete_mirroring_deployment_group][crate::client::Mirroring::delete_mirroring_deployment_group].
12256        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12257            (*self.0.stub)
12258                .delete_mirroring_deployment_group(self.0.request, self.0.options)
12259                .await
12260                .map(crate::Response::into_body)
12261        }
12262
12263        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_deployment_group`.
12264        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12265            type Operation =
12266                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12267            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12268            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12269
12270            let stub = self.0.stub.clone();
12271            let mut options = self.0.options.clone();
12272            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12273            let query = move |name| {
12274                let stub = stub.clone();
12275                let options = options.clone();
12276                async {
12277                    let op = GetOperation::new(stub)
12278                        .set_name(name)
12279                        .with_options(options)
12280                        .send()
12281                        .await?;
12282                    Ok(Operation::new(op))
12283                }
12284            };
12285
12286            let start = move || async {
12287                let op = self.send().await?;
12288                Ok(Operation::new(op))
12289            };
12290
12291            google_cloud_lro::internal::new_unit_response_poller(
12292                polling_error_policy,
12293                polling_backoff_policy,
12294                start,
12295                query,
12296            )
12297        }
12298
12299        /// Sets the value of [name][crate::model::DeleteMirroringDeploymentGroupRequest::name].
12300        ///
12301        /// This is a **required** field for requests.
12302        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12303            self.0.request.name = v.into();
12304            self
12305        }
12306
12307        /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentGroupRequest::request_id].
12308        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12309            self.0.request.request_id = v.into();
12310            self
12311        }
12312    }
12313
12314    #[doc(hidden)]
12315    impl crate::RequestBuilder for DeleteMirroringDeploymentGroup {
12316        fn request_options(&mut self) -> &mut crate::RequestOptions {
12317            &mut self.0.options
12318        }
12319    }
12320
12321    /// The request builder for [Mirroring::list_mirroring_deployments][crate::client::Mirroring::list_mirroring_deployments] calls.
12322    ///
12323    /// # Example
12324    /// ```
12325    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringDeployments;
12326    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12327    /// use google_cloud_gax::paginator::ItemPaginator;
12328    ///
12329    /// let builder = prepare_request_builder();
12330    /// let mut items = builder.by_item();
12331    /// while let Some(result) = items.next().await {
12332    ///   let item = result?;
12333    /// }
12334    /// # Ok(()) }
12335    ///
12336    /// fn prepare_request_builder() -> ListMirroringDeployments {
12337    ///   # panic!();
12338    ///   // ... details omitted ...
12339    /// }
12340    /// ```
12341    #[derive(Clone, Debug)]
12342    pub struct ListMirroringDeployments(
12343        RequestBuilder<crate::model::ListMirroringDeploymentsRequest>,
12344    );
12345
12346    impl ListMirroringDeployments {
12347        pub(crate) fn new(
12348            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12349        ) -> Self {
12350            Self(RequestBuilder::new(stub))
12351        }
12352
12353        /// Sets the full request, replacing any prior values.
12354        pub fn with_request<V: Into<crate::model::ListMirroringDeploymentsRequest>>(
12355            mut self,
12356            v: V,
12357        ) -> Self {
12358            self.0.request = v.into();
12359            self
12360        }
12361
12362        /// Sets all the options, replacing any prior values.
12363        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12364            self.0.options = v.into();
12365            self
12366        }
12367
12368        /// Sends the request.
12369        pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentsResponse> {
12370            (*self.0.stub)
12371                .list_mirroring_deployments(self.0.request, self.0.options)
12372                .await
12373                .map(crate::Response::into_body)
12374        }
12375
12376        /// Streams each page in the collection.
12377        pub fn by_page(
12378            self,
12379        ) -> impl google_cloud_gax::paginator::Paginator<
12380            crate::model::ListMirroringDeploymentsResponse,
12381            crate::Error,
12382        > {
12383            use std::clone::Clone;
12384            let token = self.0.request.page_token.clone();
12385            let execute = move |token: String| {
12386                let mut builder = self.clone();
12387                builder.0.request = builder.0.request.set_page_token(token);
12388                builder.send()
12389            };
12390            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12391        }
12392
12393        /// Streams each item in the collection.
12394        pub fn by_item(
12395            self,
12396        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12397            crate::model::ListMirroringDeploymentsResponse,
12398            crate::Error,
12399        > {
12400            use google_cloud_gax::paginator::Paginator;
12401            self.by_page().items()
12402        }
12403
12404        /// Sets the value of [parent][crate::model::ListMirroringDeploymentsRequest::parent].
12405        ///
12406        /// This is a **required** field for requests.
12407        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12408            self.0.request.parent = v.into();
12409            self
12410        }
12411
12412        /// Sets the value of [page_size][crate::model::ListMirroringDeploymentsRequest::page_size].
12413        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12414            self.0.request.page_size = v.into();
12415            self
12416        }
12417
12418        /// Sets the value of [page_token][crate::model::ListMirroringDeploymentsRequest::page_token].
12419        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12420            self.0.request.page_token = v.into();
12421            self
12422        }
12423
12424        /// Sets the value of [filter][crate::model::ListMirroringDeploymentsRequest::filter].
12425        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12426            self.0.request.filter = v.into();
12427            self
12428        }
12429
12430        /// Sets the value of [order_by][crate::model::ListMirroringDeploymentsRequest::order_by].
12431        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12432            self.0.request.order_by = v.into();
12433            self
12434        }
12435    }
12436
12437    #[doc(hidden)]
12438    impl crate::RequestBuilder for ListMirroringDeployments {
12439        fn request_options(&mut self) -> &mut crate::RequestOptions {
12440            &mut self.0.options
12441        }
12442    }
12443
12444    /// The request builder for [Mirroring::get_mirroring_deployment][crate::client::Mirroring::get_mirroring_deployment] calls.
12445    ///
12446    /// # Example
12447    /// ```
12448    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringDeployment;
12449    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12450    ///
12451    /// let builder = prepare_request_builder();
12452    /// let response = builder.send().await?;
12453    /// # Ok(()) }
12454    ///
12455    /// fn prepare_request_builder() -> GetMirroringDeployment {
12456    ///   # panic!();
12457    ///   // ... details omitted ...
12458    /// }
12459    /// ```
12460    #[derive(Clone, Debug)]
12461    pub struct GetMirroringDeployment(RequestBuilder<crate::model::GetMirroringDeploymentRequest>);
12462
12463    impl GetMirroringDeployment {
12464        pub(crate) fn new(
12465            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12466        ) -> Self {
12467            Self(RequestBuilder::new(stub))
12468        }
12469
12470        /// Sets the full request, replacing any prior values.
12471        pub fn with_request<V: Into<crate::model::GetMirroringDeploymentRequest>>(
12472            mut self,
12473            v: V,
12474        ) -> Self {
12475            self.0.request = v.into();
12476            self
12477        }
12478
12479        /// Sets all the options, replacing any prior values.
12480        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12481            self.0.options = v.into();
12482            self
12483        }
12484
12485        /// Sends the request.
12486        pub async fn send(self) -> Result<crate::model::MirroringDeployment> {
12487            (*self.0.stub)
12488                .get_mirroring_deployment(self.0.request, self.0.options)
12489                .await
12490                .map(crate::Response::into_body)
12491        }
12492
12493        /// Sets the value of [name][crate::model::GetMirroringDeploymentRequest::name].
12494        ///
12495        /// This is a **required** field for requests.
12496        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12497            self.0.request.name = v.into();
12498            self
12499        }
12500    }
12501
12502    #[doc(hidden)]
12503    impl crate::RequestBuilder for GetMirroringDeployment {
12504        fn request_options(&mut self) -> &mut crate::RequestOptions {
12505            &mut self.0.options
12506        }
12507    }
12508
12509    /// The request builder for [Mirroring::create_mirroring_deployment][crate::client::Mirroring::create_mirroring_deployment] calls.
12510    ///
12511    /// # Example
12512    /// ```
12513    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringDeployment;
12514    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12515    /// use google_cloud_lro::Poller;
12516    ///
12517    /// let builder = prepare_request_builder();
12518    /// let response = builder.poller().until_done().await?;
12519    /// # Ok(()) }
12520    ///
12521    /// fn prepare_request_builder() -> CreateMirroringDeployment {
12522    ///   # panic!();
12523    ///   // ... details omitted ...
12524    /// }
12525    /// ```
12526    #[derive(Clone, Debug)]
12527    pub struct CreateMirroringDeployment(
12528        RequestBuilder<crate::model::CreateMirroringDeploymentRequest>,
12529    );
12530
12531    impl CreateMirroringDeployment {
12532        pub(crate) fn new(
12533            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12534        ) -> Self {
12535            Self(RequestBuilder::new(stub))
12536        }
12537
12538        /// Sets the full request, replacing any prior values.
12539        pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentRequest>>(
12540            mut self,
12541            v: V,
12542        ) -> Self {
12543            self.0.request = v.into();
12544            self
12545        }
12546
12547        /// Sets all the options, replacing any prior values.
12548        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12549            self.0.options = v.into();
12550            self
12551        }
12552
12553        /// Sends the request.
12554        ///
12555        /// # Long running operations
12556        ///
12557        /// This starts, but does not poll, a longrunning operation. More information
12558        /// on [create_mirroring_deployment][crate::client::Mirroring::create_mirroring_deployment].
12559        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12560            (*self.0.stub)
12561                .create_mirroring_deployment(self.0.request, self.0.options)
12562                .await
12563                .map(crate::Response::into_body)
12564        }
12565
12566        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_deployment`.
12567        pub fn poller(
12568            self,
12569        ) -> impl google_cloud_lro::Poller<
12570            crate::model::MirroringDeployment,
12571            crate::model::OperationMetadata,
12572        > {
12573            type Operation = google_cloud_lro::internal::Operation<
12574                crate::model::MirroringDeployment,
12575                crate::model::OperationMetadata,
12576            >;
12577            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12578            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12579
12580            let stub = self.0.stub.clone();
12581            let mut options = self.0.options.clone();
12582            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12583            let query = move |name| {
12584                let stub = stub.clone();
12585                let options = options.clone();
12586                async {
12587                    let op = GetOperation::new(stub)
12588                        .set_name(name)
12589                        .with_options(options)
12590                        .send()
12591                        .await?;
12592                    Ok(Operation::new(op))
12593                }
12594            };
12595
12596            let start = move || async {
12597                let op = self.send().await?;
12598                Ok(Operation::new(op))
12599            };
12600
12601            google_cloud_lro::internal::new_poller(
12602                polling_error_policy,
12603                polling_backoff_policy,
12604                start,
12605                query,
12606            )
12607        }
12608
12609        /// Sets the value of [parent][crate::model::CreateMirroringDeploymentRequest::parent].
12610        ///
12611        /// This is a **required** field for requests.
12612        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12613            self.0.request.parent = v.into();
12614            self
12615        }
12616
12617        /// Sets the value of [mirroring_deployment_id][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment_id].
12618        ///
12619        /// This is a **required** field for requests.
12620        pub fn set_mirroring_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12621            self.0.request.mirroring_deployment_id = v.into();
12622            self
12623        }
12624
12625        /// Sets the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
12626        ///
12627        /// This is a **required** field for requests.
12628        pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
12629        where
12630            T: std::convert::Into<crate::model::MirroringDeployment>,
12631        {
12632            self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
12633            self
12634        }
12635
12636        /// Sets or clears the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
12637        ///
12638        /// This is a **required** field for requests.
12639        pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
12640        where
12641            T: std::convert::Into<crate::model::MirroringDeployment>,
12642        {
12643            self.0.request.mirroring_deployment = v.map(|x| x.into());
12644            self
12645        }
12646
12647        /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentRequest::request_id].
12648        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12649            self.0.request.request_id = v.into();
12650            self
12651        }
12652    }
12653
12654    #[doc(hidden)]
12655    impl crate::RequestBuilder for CreateMirroringDeployment {
12656        fn request_options(&mut self) -> &mut crate::RequestOptions {
12657            &mut self.0.options
12658        }
12659    }
12660
12661    /// The request builder for [Mirroring::update_mirroring_deployment][crate::client::Mirroring::update_mirroring_deployment] calls.
12662    ///
12663    /// # Example
12664    /// ```
12665    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringDeployment;
12666    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12667    /// use google_cloud_lro::Poller;
12668    ///
12669    /// let builder = prepare_request_builder();
12670    /// let response = builder.poller().until_done().await?;
12671    /// # Ok(()) }
12672    ///
12673    /// fn prepare_request_builder() -> UpdateMirroringDeployment {
12674    ///   # panic!();
12675    ///   // ... details omitted ...
12676    /// }
12677    /// ```
12678    #[derive(Clone, Debug)]
12679    pub struct UpdateMirroringDeployment(
12680        RequestBuilder<crate::model::UpdateMirroringDeploymentRequest>,
12681    );
12682
12683    impl UpdateMirroringDeployment {
12684        pub(crate) fn new(
12685            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12686        ) -> Self {
12687            Self(RequestBuilder::new(stub))
12688        }
12689
12690        /// Sets the full request, replacing any prior values.
12691        pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentRequest>>(
12692            mut self,
12693            v: V,
12694        ) -> Self {
12695            self.0.request = v.into();
12696            self
12697        }
12698
12699        /// Sets all the options, replacing any prior values.
12700        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12701            self.0.options = v.into();
12702            self
12703        }
12704
12705        /// Sends the request.
12706        ///
12707        /// # Long running operations
12708        ///
12709        /// This starts, but does not poll, a longrunning operation. More information
12710        /// on [update_mirroring_deployment][crate::client::Mirroring::update_mirroring_deployment].
12711        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12712            (*self.0.stub)
12713                .update_mirroring_deployment(self.0.request, self.0.options)
12714                .await
12715                .map(crate::Response::into_body)
12716        }
12717
12718        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_deployment`.
12719        pub fn poller(
12720            self,
12721        ) -> impl google_cloud_lro::Poller<
12722            crate::model::MirroringDeployment,
12723            crate::model::OperationMetadata,
12724        > {
12725            type Operation = google_cloud_lro::internal::Operation<
12726                crate::model::MirroringDeployment,
12727                crate::model::OperationMetadata,
12728            >;
12729            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12730            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12731
12732            let stub = self.0.stub.clone();
12733            let mut options = self.0.options.clone();
12734            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12735            let query = move |name| {
12736                let stub = stub.clone();
12737                let options = options.clone();
12738                async {
12739                    let op = GetOperation::new(stub)
12740                        .set_name(name)
12741                        .with_options(options)
12742                        .send()
12743                        .await?;
12744                    Ok(Operation::new(op))
12745                }
12746            };
12747
12748            let start = move || async {
12749                let op = self.send().await?;
12750                Ok(Operation::new(op))
12751            };
12752
12753            google_cloud_lro::internal::new_poller(
12754                polling_error_policy,
12755                polling_backoff_policy,
12756                start,
12757                query,
12758            )
12759        }
12760
12761        /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
12762        pub fn set_update_mask<T>(mut self, v: T) -> Self
12763        where
12764            T: std::convert::Into<wkt::FieldMask>,
12765        {
12766            self.0.request.update_mask = std::option::Option::Some(v.into());
12767            self
12768        }
12769
12770        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
12771        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12772        where
12773            T: std::convert::Into<wkt::FieldMask>,
12774        {
12775            self.0.request.update_mask = v.map(|x| x.into());
12776            self
12777        }
12778
12779        /// Sets the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
12780        ///
12781        /// This is a **required** field for requests.
12782        pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
12783        where
12784            T: std::convert::Into<crate::model::MirroringDeployment>,
12785        {
12786            self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
12787            self
12788        }
12789
12790        /// Sets or clears the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
12791        ///
12792        /// This is a **required** field for requests.
12793        pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
12794        where
12795            T: std::convert::Into<crate::model::MirroringDeployment>,
12796        {
12797            self.0.request.mirroring_deployment = v.map(|x| x.into());
12798            self
12799        }
12800
12801        /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentRequest::request_id].
12802        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12803            self.0.request.request_id = v.into();
12804            self
12805        }
12806    }
12807
12808    #[doc(hidden)]
12809    impl crate::RequestBuilder for UpdateMirroringDeployment {
12810        fn request_options(&mut self) -> &mut crate::RequestOptions {
12811            &mut self.0.options
12812        }
12813    }
12814
12815    /// The request builder for [Mirroring::delete_mirroring_deployment][crate::client::Mirroring::delete_mirroring_deployment] calls.
12816    ///
12817    /// # Example
12818    /// ```
12819    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringDeployment;
12820    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12821    /// use google_cloud_lro::Poller;
12822    ///
12823    /// let builder = prepare_request_builder();
12824    /// let response = builder.poller().until_done().await?;
12825    /// # Ok(()) }
12826    ///
12827    /// fn prepare_request_builder() -> DeleteMirroringDeployment {
12828    ///   # panic!();
12829    ///   // ... details omitted ...
12830    /// }
12831    /// ```
12832    #[derive(Clone, Debug)]
12833    pub struct DeleteMirroringDeployment(
12834        RequestBuilder<crate::model::DeleteMirroringDeploymentRequest>,
12835    );
12836
12837    impl DeleteMirroringDeployment {
12838        pub(crate) fn new(
12839            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12840        ) -> Self {
12841            Self(RequestBuilder::new(stub))
12842        }
12843
12844        /// Sets the full request, replacing any prior values.
12845        pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentRequest>>(
12846            mut self,
12847            v: V,
12848        ) -> Self {
12849            self.0.request = v.into();
12850            self
12851        }
12852
12853        /// Sets all the options, replacing any prior values.
12854        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12855            self.0.options = v.into();
12856            self
12857        }
12858
12859        /// Sends the request.
12860        ///
12861        /// # Long running operations
12862        ///
12863        /// This starts, but does not poll, a longrunning operation. More information
12864        /// on [delete_mirroring_deployment][crate::client::Mirroring::delete_mirroring_deployment].
12865        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12866            (*self.0.stub)
12867                .delete_mirroring_deployment(self.0.request, self.0.options)
12868                .await
12869                .map(crate::Response::into_body)
12870        }
12871
12872        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_deployment`.
12873        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12874            type Operation =
12875                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12876            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12877            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12878
12879            let stub = self.0.stub.clone();
12880            let mut options = self.0.options.clone();
12881            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12882            let query = move |name| {
12883                let stub = stub.clone();
12884                let options = options.clone();
12885                async {
12886                    let op = GetOperation::new(stub)
12887                        .set_name(name)
12888                        .with_options(options)
12889                        .send()
12890                        .await?;
12891                    Ok(Operation::new(op))
12892                }
12893            };
12894
12895            let start = move || async {
12896                let op = self.send().await?;
12897                Ok(Operation::new(op))
12898            };
12899
12900            google_cloud_lro::internal::new_unit_response_poller(
12901                polling_error_policy,
12902                polling_backoff_policy,
12903                start,
12904                query,
12905            )
12906        }
12907
12908        /// Sets the value of [name][crate::model::DeleteMirroringDeploymentRequest::name].
12909        ///
12910        /// This is a **required** field for requests.
12911        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12912            self.0.request.name = v.into();
12913            self
12914        }
12915
12916        /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentRequest::request_id].
12917        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12918            self.0.request.request_id = v.into();
12919            self
12920        }
12921    }
12922
12923    #[doc(hidden)]
12924    impl crate::RequestBuilder for DeleteMirroringDeployment {
12925        fn request_options(&mut self) -> &mut crate::RequestOptions {
12926            &mut self.0.options
12927        }
12928    }
12929
12930    /// The request builder for [Mirroring::list_locations][crate::client::Mirroring::list_locations] calls.
12931    ///
12932    /// # Example
12933    /// ```
12934    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListLocations;
12935    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12936    /// use google_cloud_gax::paginator::ItemPaginator;
12937    ///
12938    /// let builder = prepare_request_builder();
12939    /// let mut items = builder.by_item();
12940    /// while let Some(result) = items.next().await {
12941    ///   let item = result?;
12942    /// }
12943    /// # Ok(()) }
12944    ///
12945    /// fn prepare_request_builder() -> ListLocations {
12946    ///   # panic!();
12947    ///   // ... details omitted ...
12948    /// }
12949    /// ```
12950    #[derive(Clone, Debug)]
12951    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
12952
12953    impl ListLocations {
12954        pub(crate) fn new(
12955            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12956        ) -> Self {
12957            Self(RequestBuilder::new(stub))
12958        }
12959
12960        /// Sets the full request, replacing any prior values.
12961        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
12962            mut self,
12963            v: V,
12964        ) -> Self {
12965            self.0.request = v.into();
12966            self
12967        }
12968
12969        /// Sets all the options, replacing any prior values.
12970        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12971            self.0.options = v.into();
12972            self
12973        }
12974
12975        /// Sends the request.
12976        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
12977            (*self.0.stub)
12978                .list_locations(self.0.request, self.0.options)
12979                .await
12980                .map(crate::Response::into_body)
12981        }
12982
12983        /// Streams each page in the collection.
12984        pub fn by_page(
12985            self,
12986        ) -> impl google_cloud_gax::paginator::Paginator<
12987            google_cloud_location::model::ListLocationsResponse,
12988            crate::Error,
12989        > {
12990            use std::clone::Clone;
12991            let token = self.0.request.page_token.clone();
12992            let execute = move |token: String| {
12993                let mut builder = self.clone();
12994                builder.0.request = builder.0.request.set_page_token(token);
12995                builder.send()
12996            };
12997            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12998        }
12999
13000        /// Streams each item in the collection.
13001        pub fn by_item(
13002            self,
13003        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13004            google_cloud_location::model::ListLocationsResponse,
13005            crate::Error,
13006        > {
13007            use google_cloud_gax::paginator::Paginator;
13008            self.by_page().items()
13009        }
13010
13011        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
13012        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13013            self.0.request.name = v.into();
13014            self
13015        }
13016
13017        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
13018        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13019            self.0.request.filter = v.into();
13020            self
13021        }
13022
13023        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
13024        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13025            self.0.request.page_size = v.into();
13026            self
13027        }
13028
13029        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
13030        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13031            self.0.request.page_token = v.into();
13032            self
13033        }
13034    }
13035
13036    #[doc(hidden)]
13037    impl crate::RequestBuilder for ListLocations {
13038        fn request_options(&mut self) -> &mut crate::RequestOptions {
13039            &mut self.0.options
13040        }
13041    }
13042
13043    /// The request builder for [Mirroring::get_location][crate::client::Mirroring::get_location] calls.
13044    ///
13045    /// # Example
13046    /// ```
13047    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetLocation;
13048    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13049    ///
13050    /// let builder = prepare_request_builder();
13051    /// let response = builder.send().await?;
13052    /// # Ok(()) }
13053    ///
13054    /// fn prepare_request_builder() -> GetLocation {
13055    ///   # panic!();
13056    ///   // ... details omitted ...
13057    /// }
13058    /// ```
13059    #[derive(Clone, Debug)]
13060    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13061
13062    impl GetLocation {
13063        pub(crate) fn new(
13064            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13065        ) -> Self {
13066            Self(RequestBuilder::new(stub))
13067        }
13068
13069        /// Sets the full request, replacing any prior values.
13070        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13071            mut self,
13072            v: V,
13073        ) -> Self {
13074            self.0.request = v.into();
13075            self
13076        }
13077
13078        /// Sets all the options, replacing any prior values.
13079        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13080            self.0.options = v.into();
13081            self
13082        }
13083
13084        /// Sends the request.
13085        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13086            (*self.0.stub)
13087                .get_location(self.0.request, self.0.options)
13088                .await
13089                .map(crate::Response::into_body)
13090        }
13091
13092        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
13093        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13094            self.0.request.name = v.into();
13095            self
13096        }
13097    }
13098
13099    #[doc(hidden)]
13100    impl crate::RequestBuilder for GetLocation {
13101        fn request_options(&mut self) -> &mut crate::RequestOptions {
13102            &mut self.0.options
13103        }
13104    }
13105
13106    /// The request builder for [Mirroring::set_iam_policy][crate::client::Mirroring::set_iam_policy] calls.
13107    ///
13108    /// # Example
13109    /// ```
13110    /// # use google_cloud_networksecurity_v1::builder::mirroring::SetIamPolicy;
13111    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13112    ///
13113    /// let builder = prepare_request_builder();
13114    /// let response = builder.send().await?;
13115    /// # Ok(()) }
13116    ///
13117    /// fn prepare_request_builder() -> SetIamPolicy {
13118    ///   # panic!();
13119    ///   // ... details omitted ...
13120    /// }
13121    /// ```
13122    #[derive(Clone, Debug)]
13123    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
13124
13125    impl SetIamPolicy {
13126        pub(crate) fn new(
13127            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13128        ) -> Self {
13129            Self(RequestBuilder::new(stub))
13130        }
13131
13132        /// Sets the full request, replacing any prior values.
13133        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
13134            mut self,
13135            v: V,
13136        ) -> Self {
13137            self.0.request = v.into();
13138            self
13139        }
13140
13141        /// Sets all the options, replacing any prior values.
13142        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13143            self.0.options = v.into();
13144            self
13145        }
13146
13147        /// Sends the request.
13148        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13149            (*self.0.stub)
13150                .set_iam_policy(self.0.request, self.0.options)
13151                .await
13152                .map(crate::Response::into_body)
13153        }
13154
13155        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
13156        ///
13157        /// This is a **required** field for requests.
13158        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13159            self.0.request.resource = v.into();
13160            self
13161        }
13162
13163        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
13164        ///
13165        /// This is a **required** field for requests.
13166        pub fn set_policy<T>(mut self, v: T) -> Self
13167        where
13168            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13169        {
13170            self.0.request.policy = std::option::Option::Some(v.into());
13171            self
13172        }
13173
13174        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
13175        ///
13176        /// This is a **required** field for requests.
13177        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
13178        where
13179            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13180        {
13181            self.0.request.policy = v.map(|x| x.into());
13182            self
13183        }
13184
13185        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
13186        pub fn set_update_mask<T>(mut self, v: T) -> Self
13187        where
13188            T: std::convert::Into<wkt::FieldMask>,
13189        {
13190            self.0.request.update_mask = std::option::Option::Some(v.into());
13191            self
13192        }
13193
13194        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
13195        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13196        where
13197            T: std::convert::Into<wkt::FieldMask>,
13198        {
13199            self.0.request.update_mask = v.map(|x| x.into());
13200            self
13201        }
13202    }
13203
13204    #[doc(hidden)]
13205    impl crate::RequestBuilder for SetIamPolicy {
13206        fn request_options(&mut self) -> &mut crate::RequestOptions {
13207            &mut self.0.options
13208        }
13209    }
13210
13211    /// The request builder for [Mirroring::get_iam_policy][crate::client::Mirroring::get_iam_policy] calls.
13212    ///
13213    /// # Example
13214    /// ```
13215    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetIamPolicy;
13216    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13217    ///
13218    /// let builder = prepare_request_builder();
13219    /// let response = builder.send().await?;
13220    /// # Ok(()) }
13221    ///
13222    /// fn prepare_request_builder() -> GetIamPolicy {
13223    ///   # panic!();
13224    ///   // ... details omitted ...
13225    /// }
13226    /// ```
13227    #[derive(Clone, Debug)]
13228    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
13229
13230    impl GetIamPolicy {
13231        pub(crate) fn new(
13232            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13233        ) -> Self {
13234            Self(RequestBuilder::new(stub))
13235        }
13236
13237        /// Sets the full request, replacing any prior values.
13238        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
13239            mut self,
13240            v: V,
13241        ) -> Self {
13242            self.0.request = v.into();
13243            self
13244        }
13245
13246        /// Sets all the options, replacing any prior values.
13247        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13248            self.0.options = v.into();
13249            self
13250        }
13251
13252        /// Sends the request.
13253        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13254            (*self.0.stub)
13255                .get_iam_policy(self.0.request, self.0.options)
13256                .await
13257                .map(crate::Response::into_body)
13258        }
13259
13260        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
13261        ///
13262        /// This is a **required** field for requests.
13263        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13264            self.0.request.resource = v.into();
13265            self
13266        }
13267
13268        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
13269        pub fn set_options<T>(mut self, v: T) -> Self
13270        where
13271            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13272        {
13273            self.0.request.options = std::option::Option::Some(v.into());
13274            self
13275        }
13276
13277        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
13278        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
13279        where
13280            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13281        {
13282            self.0.request.options = v.map(|x| x.into());
13283            self
13284        }
13285    }
13286
13287    #[doc(hidden)]
13288    impl crate::RequestBuilder for GetIamPolicy {
13289        fn request_options(&mut self) -> &mut crate::RequestOptions {
13290            &mut self.0.options
13291        }
13292    }
13293
13294    /// The request builder for [Mirroring::test_iam_permissions][crate::client::Mirroring::test_iam_permissions] calls.
13295    ///
13296    /// # Example
13297    /// ```
13298    /// # use google_cloud_networksecurity_v1::builder::mirroring::TestIamPermissions;
13299    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13300    ///
13301    /// let builder = prepare_request_builder();
13302    /// let response = builder.send().await?;
13303    /// # Ok(()) }
13304    ///
13305    /// fn prepare_request_builder() -> TestIamPermissions {
13306    ///   # panic!();
13307    ///   // ... details omitted ...
13308    /// }
13309    /// ```
13310    #[derive(Clone, Debug)]
13311    pub struct TestIamPermissions(
13312        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
13313    );
13314
13315    impl TestIamPermissions {
13316        pub(crate) fn new(
13317            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13318        ) -> Self {
13319            Self(RequestBuilder::new(stub))
13320        }
13321
13322        /// Sets the full request, replacing any prior values.
13323        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
13324            mut self,
13325            v: V,
13326        ) -> Self {
13327            self.0.request = v.into();
13328            self
13329        }
13330
13331        /// Sets all the options, replacing any prior values.
13332        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13333            self.0.options = v.into();
13334            self
13335        }
13336
13337        /// Sends the request.
13338        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
13339            (*self.0.stub)
13340                .test_iam_permissions(self.0.request, self.0.options)
13341                .await
13342                .map(crate::Response::into_body)
13343        }
13344
13345        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
13346        ///
13347        /// This is a **required** field for requests.
13348        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13349            self.0.request.resource = v.into();
13350            self
13351        }
13352
13353        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
13354        ///
13355        /// This is a **required** field for requests.
13356        pub fn set_permissions<T, V>(mut self, v: T) -> Self
13357        where
13358            T: std::iter::IntoIterator<Item = V>,
13359            V: std::convert::Into<std::string::String>,
13360        {
13361            use std::iter::Iterator;
13362            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
13363            self
13364        }
13365    }
13366
13367    #[doc(hidden)]
13368    impl crate::RequestBuilder for TestIamPermissions {
13369        fn request_options(&mut self) -> &mut crate::RequestOptions {
13370            &mut self.0.options
13371        }
13372    }
13373
13374    /// The request builder for [Mirroring::list_operations][crate::client::Mirroring::list_operations] calls.
13375    ///
13376    /// # Example
13377    /// ```
13378    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListOperations;
13379    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13380    /// use google_cloud_gax::paginator::ItemPaginator;
13381    ///
13382    /// let builder = prepare_request_builder();
13383    /// let mut items = builder.by_item();
13384    /// while let Some(result) = items.next().await {
13385    ///   let item = result?;
13386    /// }
13387    /// # Ok(()) }
13388    ///
13389    /// fn prepare_request_builder() -> ListOperations {
13390    ///   # panic!();
13391    ///   // ... details omitted ...
13392    /// }
13393    /// ```
13394    #[derive(Clone, Debug)]
13395    pub struct ListOperations(
13396        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13397    );
13398
13399    impl ListOperations {
13400        pub(crate) fn new(
13401            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13402        ) -> Self {
13403            Self(RequestBuilder::new(stub))
13404        }
13405
13406        /// Sets the full request, replacing any prior values.
13407        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13408            mut self,
13409            v: V,
13410        ) -> Self {
13411            self.0.request = v.into();
13412            self
13413        }
13414
13415        /// Sets all the options, replacing any prior values.
13416        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13417            self.0.options = v.into();
13418            self
13419        }
13420
13421        /// Sends the request.
13422        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13423            (*self.0.stub)
13424                .list_operations(self.0.request, self.0.options)
13425                .await
13426                .map(crate::Response::into_body)
13427        }
13428
13429        /// Streams each page in the collection.
13430        pub fn by_page(
13431            self,
13432        ) -> impl google_cloud_gax::paginator::Paginator<
13433            google_cloud_longrunning::model::ListOperationsResponse,
13434            crate::Error,
13435        > {
13436            use std::clone::Clone;
13437            let token = self.0.request.page_token.clone();
13438            let execute = move |token: String| {
13439                let mut builder = self.clone();
13440                builder.0.request = builder.0.request.set_page_token(token);
13441                builder.send()
13442            };
13443            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13444        }
13445
13446        /// Streams each item in the collection.
13447        pub fn by_item(
13448            self,
13449        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13450            google_cloud_longrunning::model::ListOperationsResponse,
13451            crate::Error,
13452        > {
13453            use google_cloud_gax::paginator::Paginator;
13454            self.by_page().items()
13455        }
13456
13457        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
13458        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13459            self.0.request.name = v.into();
13460            self
13461        }
13462
13463        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
13464        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13465            self.0.request.filter = v.into();
13466            self
13467        }
13468
13469        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
13470        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13471            self.0.request.page_size = v.into();
13472            self
13473        }
13474
13475        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
13476        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13477            self.0.request.page_token = v.into();
13478            self
13479        }
13480
13481        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
13482        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13483            self.0.request.return_partial_success = v.into();
13484            self
13485        }
13486    }
13487
13488    #[doc(hidden)]
13489    impl crate::RequestBuilder for ListOperations {
13490        fn request_options(&mut self) -> &mut crate::RequestOptions {
13491            &mut self.0.options
13492        }
13493    }
13494
13495    /// The request builder for [Mirroring::get_operation][crate::client::Mirroring::get_operation] calls.
13496    ///
13497    /// # Example
13498    /// ```
13499    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetOperation;
13500    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13501    ///
13502    /// let builder = prepare_request_builder();
13503    /// let response = builder.send().await?;
13504    /// # Ok(()) }
13505    ///
13506    /// fn prepare_request_builder() -> GetOperation {
13507    ///   # panic!();
13508    ///   // ... details omitted ...
13509    /// }
13510    /// ```
13511    #[derive(Clone, Debug)]
13512    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13513
13514    impl GetOperation {
13515        pub(crate) fn new(
13516            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13517        ) -> Self {
13518            Self(RequestBuilder::new(stub))
13519        }
13520
13521        /// Sets the full request, replacing any prior values.
13522        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13523            mut self,
13524            v: V,
13525        ) -> Self {
13526            self.0.request = v.into();
13527            self
13528        }
13529
13530        /// Sets all the options, replacing any prior values.
13531        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13532            self.0.options = v.into();
13533            self
13534        }
13535
13536        /// Sends the request.
13537        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13538            (*self.0.stub)
13539                .get_operation(self.0.request, self.0.options)
13540                .await
13541                .map(crate::Response::into_body)
13542        }
13543
13544        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
13545        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13546            self.0.request.name = v.into();
13547            self
13548        }
13549    }
13550
13551    #[doc(hidden)]
13552    impl crate::RequestBuilder for GetOperation {
13553        fn request_options(&mut self) -> &mut crate::RequestOptions {
13554            &mut self.0.options
13555        }
13556    }
13557
13558    /// The request builder for [Mirroring::delete_operation][crate::client::Mirroring::delete_operation] calls.
13559    ///
13560    /// # Example
13561    /// ```
13562    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteOperation;
13563    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13564    ///
13565    /// let builder = prepare_request_builder();
13566    /// let response = builder.send().await?;
13567    /// # Ok(()) }
13568    ///
13569    /// fn prepare_request_builder() -> DeleteOperation {
13570    ///   # panic!();
13571    ///   // ... details omitted ...
13572    /// }
13573    /// ```
13574    #[derive(Clone, Debug)]
13575    pub struct DeleteOperation(
13576        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
13577    );
13578
13579    impl DeleteOperation {
13580        pub(crate) fn new(
13581            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13582        ) -> Self {
13583            Self(RequestBuilder::new(stub))
13584        }
13585
13586        /// Sets the full request, replacing any prior values.
13587        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
13588            mut self,
13589            v: V,
13590        ) -> Self {
13591            self.0.request = v.into();
13592            self
13593        }
13594
13595        /// Sets all the options, replacing any prior values.
13596        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13597            self.0.options = v.into();
13598            self
13599        }
13600
13601        /// Sends the request.
13602        pub async fn send(self) -> Result<()> {
13603            (*self.0.stub)
13604                .delete_operation(self.0.request, self.0.options)
13605                .await
13606                .map(crate::Response::into_body)
13607        }
13608
13609        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
13610        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13611            self.0.request.name = v.into();
13612            self
13613        }
13614    }
13615
13616    #[doc(hidden)]
13617    impl crate::RequestBuilder for DeleteOperation {
13618        fn request_options(&mut self) -> &mut crate::RequestOptions {
13619            &mut self.0.options
13620        }
13621    }
13622
13623    /// The request builder for [Mirroring::cancel_operation][crate::client::Mirroring::cancel_operation] calls.
13624    ///
13625    /// # Example
13626    /// ```
13627    /// # use google_cloud_networksecurity_v1::builder::mirroring::CancelOperation;
13628    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13629    ///
13630    /// let builder = prepare_request_builder();
13631    /// let response = builder.send().await?;
13632    /// # Ok(()) }
13633    ///
13634    /// fn prepare_request_builder() -> CancelOperation {
13635    ///   # panic!();
13636    ///   // ... details omitted ...
13637    /// }
13638    /// ```
13639    #[derive(Clone, Debug)]
13640    pub struct CancelOperation(
13641        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13642    );
13643
13644    impl CancelOperation {
13645        pub(crate) fn new(
13646            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13647        ) -> Self {
13648            Self(RequestBuilder::new(stub))
13649        }
13650
13651        /// Sets the full request, replacing any prior values.
13652        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13653            mut self,
13654            v: V,
13655        ) -> Self {
13656            self.0.request = v.into();
13657            self
13658        }
13659
13660        /// Sets all the options, replacing any prior values.
13661        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13662            self.0.options = v.into();
13663            self
13664        }
13665
13666        /// Sends the request.
13667        pub async fn send(self) -> Result<()> {
13668            (*self.0.stub)
13669                .cancel_operation(self.0.request, self.0.options)
13670                .await
13671                .map(crate::Response::into_body)
13672        }
13673
13674        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
13675        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13676            self.0.request.name = v.into();
13677            self
13678        }
13679    }
13680
13681    #[doc(hidden)]
13682    impl crate::RequestBuilder for CancelOperation {
13683        fn request_options(&mut self) -> &mut crate::RequestOptions {
13684            &mut self.0.options
13685        }
13686    }
13687}
13688
13689pub mod network_security {
13690    use crate::Result;
13691
13692    /// A builder for [NetworkSecurity][crate::client::NetworkSecurity].
13693    ///
13694    /// ```
13695    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13696    /// # use google_cloud_networksecurity_v1::*;
13697    /// # use builder::network_security::ClientBuilder;
13698    /// # use client::NetworkSecurity;
13699    /// let builder : ClientBuilder = NetworkSecurity::builder();
13700    /// let client = builder
13701    ///     .with_endpoint("https://networksecurity.googleapis.com")
13702    ///     .build().await?;
13703    /// # Ok(()) }
13704    /// ```
13705    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13706
13707    pub(crate) mod client {
13708        use super::super::super::client::NetworkSecurity;
13709        pub struct Factory;
13710        impl crate::ClientFactory for Factory {
13711            type Client = NetworkSecurity;
13712            type Credentials = gaxi::options::Credentials;
13713            async fn build(
13714                self,
13715                config: gaxi::options::ClientConfig,
13716            ) -> crate::ClientBuilderResult<Self::Client> {
13717                Self::Client::new(config).await
13718            }
13719        }
13720    }
13721
13722    /// Common implementation for [crate::client::NetworkSecurity] request builders.
13723    #[derive(Clone, Debug)]
13724    pub(crate) struct RequestBuilder<R: std::default::Default> {
13725        stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13726        request: R,
13727        options: crate::RequestOptions,
13728    }
13729
13730    impl<R> RequestBuilder<R>
13731    where
13732        R: std::default::Default,
13733    {
13734        pub(crate) fn new(
13735            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13736        ) -> Self {
13737            Self {
13738                stub,
13739                request: R::default(),
13740                options: crate::RequestOptions::default(),
13741            }
13742        }
13743    }
13744
13745    /// The request builder for [NetworkSecurity::list_authorization_policies][crate::client::NetworkSecurity::list_authorization_policies] calls.
13746    ///
13747    /// # Example
13748    /// ```
13749    /// # use google_cloud_networksecurity_v1::builder::network_security::ListAuthorizationPolicies;
13750    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13751    /// use google_cloud_gax::paginator::ItemPaginator;
13752    ///
13753    /// let builder = prepare_request_builder();
13754    /// let mut items = builder.by_item();
13755    /// while let Some(result) = items.next().await {
13756    ///   let item = result?;
13757    /// }
13758    /// # Ok(()) }
13759    ///
13760    /// fn prepare_request_builder() -> ListAuthorizationPolicies {
13761    ///   # panic!();
13762    ///   // ... details omitted ...
13763    /// }
13764    /// ```
13765    #[derive(Clone, Debug)]
13766    pub struct ListAuthorizationPolicies(
13767        RequestBuilder<crate::model::ListAuthorizationPoliciesRequest>,
13768    );
13769
13770    impl ListAuthorizationPolicies {
13771        pub(crate) fn new(
13772            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13773        ) -> Self {
13774            Self(RequestBuilder::new(stub))
13775        }
13776
13777        /// Sets the full request, replacing any prior values.
13778        pub fn with_request<V: Into<crate::model::ListAuthorizationPoliciesRequest>>(
13779            mut self,
13780            v: V,
13781        ) -> Self {
13782            self.0.request = v.into();
13783            self
13784        }
13785
13786        /// Sets all the options, replacing any prior values.
13787        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13788            self.0.options = v.into();
13789            self
13790        }
13791
13792        /// Sends the request.
13793        pub async fn send(self) -> Result<crate::model::ListAuthorizationPoliciesResponse> {
13794            (*self.0.stub)
13795                .list_authorization_policies(self.0.request, self.0.options)
13796                .await
13797                .map(crate::Response::into_body)
13798        }
13799
13800        /// Streams each page in the collection.
13801        pub fn by_page(
13802            self,
13803        ) -> impl google_cloud_gax::paginator::Paginator<
13804            crate::model::ListAuthorizationPoliciesResponse,
13805            crate::Error,
13806        > {
13807            use std::clone::Clone;
13808            let token = self.0.request.page_token.clone();
13809            let execute = move |token: String| {
13810                let mut builder = self.clone();
13811                builder.0.request = builder.0.request.set_page_token(token);
13812                builder.send()
13813            };
13814            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13815        }
13816
13817        /// Streams each item in the collection.
13818        pub fn by_item(
13819            self,
13820        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13821            crate::model::ListAuthorizationPoliciesResponse,
13822            crate::Error,
13823        > {
13824            use google_cloud_gax::paginator::Paginator;
13825            self.by_page().items()
13826        }
13827
13828        /// Sets the value of [parent][crate::model::ListAuthorizationPoliciesRequest::parent].
13829        ///
13830        /// This is a **required** field for requests.
13831        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13832            self.0.request.parent = v.into();
13833            self
13834        }
13835
13836        /// Sets the value of [page_size][crate::model::ListAuthorizationPoliciesRequest::page_size].
13837        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13838            self.0.request.page_size = v.into();
13839            self
13840        }
13841
13842        /// Sets the value of [page_token][crate::model::ListAuthorizationPoliciesRequest::page_token].
13843        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13844            self.0.request.page_token = v.into();
13845            self
13846        }
13847    }
13848
13849    #[doc(hidden)]
13850    impl crate::RequestBuilder for ListAuthorizationPolicies {
13851        fn request_options(&mut self) -> &mut crate::RequestOptions {
13852            &mut self.0.options
13853        }
13854    }
13855
13856    /// The request builder for [NetworkSecurity::get_authorization_policy][crate::client::NetworkSecurity::get_authorization_policy] calls.
13857    ///
13858    /// # Example
13859    /// ```
13860    /// # use google_cloud_networksecurity_v1::builder::network_security::GetAuthorizationPolicy;
13861    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13862    ///
13863    /// let builder = prepare_request_builder();
13864    /// let response = builder.send().await?;
13865    /// # Ok(()) }
13866    ///
13867    /// fn prepare_request_builder() -> GetAuthorizationPolicy {
13868    ///   # panic!();
13869    ///   // ... details omitted ...
13870    /// }
13871    /// ```
13872    #[derive(Clone, Debug)]
13873    pub struct GetAuthorizationPolicy(RequestBuilder<crate::model::GetAuthorizationPolicyRequest>);
13874
13875    impl GetAuthorizationPolicy {
13876        pub(crate) fn new(
13877            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13878        ) -> Self {
13879            Self(RequestBuilder::new(stub))
13880        }
13881
13882        /// Sets the full request, replacing any prior values.
13883        pub fn with_request<V: Into<crate::model::GetAuthorizationPolicyRequest>>(
13884            mut self,
13885            v: V,
13886        ) -> Self {
13887            self.0.request = v.into();
13888            self
13889        }
13890
13891        /// Sets all the options, replacing any prior values.
13892        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13893            self.0.options = v.into();
13894            self
13895        }
13896
13897        /// Sends the request.
13898        pub async fn send(self) -> Result<crate::model::AuthorizationPolicy> {
13899            (*self.0.stub)
13900                .get_authorization_policy(self.0.request, self.0.options)
13901                .await
13902                .map(crate::Response::into_body)
13903        }
13904
13905        /// Sets the value of [name][crate::model::GetAuthorizationPolicyRequest::name].
13906        ///
13907        /// This is a **required** field for requests.
13908        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13909            self.0.request.name = v.into();
13910            self
13911        }
13912    }
13913
13914    #[doc(hidden)]
13915    impl crate::RequestBuilder for GetAuthorizationPolicy {
13916        fn request_options(&mut self) -> &mut crate::RequestOptions {
13917            &mut self.0.options
13918        }
13919    }
13920
13921    /// The request builder for [NetworkSecurity::create_authorization_policy][crate::client::NetworkSecurity::create_authorization_policy] calls.
13922    ///
13923    /// # Example
13924    /// ```
13925    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateAuthorizationPolicy;
13926    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13927    /// use google_cloud_lro::Poller;
13928    ///
13929    /// let builder = prepare_request_builder();
13930    /// let response = builder.poller().until_done().await?;
13931    /// # Ok(()) }
13932    ///
13933    /// fn prepare_request_builder() -> CreateAuthorizationPolicy {
13934    ///   # panic!();
13935    ///   // ... details omitted ...
13936    /// }
13937    /// ```
13938    #[derive(Clone, Debug)]
13939    pub struct CreateAuthorizationPolicy(
13940        RequestBuilder<crate::model::CreateAuthorizationPolicyRequest>,
13941    );
13942
13943    impl CreateAuthorizationPolicy {
13944        pub(crate) fn new(
13945            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
13946        ) -> Self {
13947            Self(RequestBuilder::new(stub))
13948        }
13949
13950        /// Sets the full request, replacing any prior values.
13951        pub fn with_request<V: Into<crate::model::CreateAuthorizationPolicyRequest>>(
13952            mut self,
13953            v: V,
13954        ) -> Self {
13955            self.0.request = v.into();
13956            self
13957        }
13958
13959        /// Sets all the options, replacing any prior values.
13960        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13961            self.0.options = v.into();
13962            self
13963        }
13964
13965        /// Sends the request.
13966        ///
13967        /// # Long running operations
13968        ///
13969        /// This starts, but does not poll, a longrunning operation. More information
13970        /// on [create_authorization_policy][crate::client::NetworkSecurity::create_authorization_policy].
13971        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13972            (*self.0.stub)
13973                .create_authorization_policy(self.0.request, self.0.options)
13974                .await
13975                .map(crate::Response::into_body)
13976        }
13977
13978        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_authorization_policy`.
13979        pub fn poller(
13980            self,
13981        ) -> impl google_cloud_lro::Poller<
13982            crate::model::AuthorizationPolicy,
13983            crate::model::OperationMetadata,
13984        > {
13985            type Operation = google_cloud_lro::internal::Operation<
13986                crate::model::AuthorizationPolicy,
13987                crate::model::OperationMetadata,
13988            >;
13989            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13990            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13991
13992            let stub = self.0.stub.clone();
13993            let mut options = self.0.options.clone();
13994            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13995            let query = move |name| {
13996                let stub = stub.clone();
13997                let options = options.clone();
13998                async {
13999                    let op = GetOperation::new(stub)
14000                        .set_name(name)
14001                        .with_options(options)
14002                        .send()
14003                        .await?;
14004                    Ok(Operation::new(op))
14005                }
14006            };
14007
14008            let start = move || async {
14009                let op = self.send().await?;
14010                Ok(Operation::new(op))
14011            };
14012
14013            google_cloud_lro::internal::new_poller(
14014                polling_error_policy,
14015                polling_backoff_policy,
14016                start,
14017                query,
14018            )
14019        }
14020
14021        /// Sets the value of [parent][crate::model::CreateAuthorizationPolicyRequest::parent].
14022        ///
14023        /// This is a **required** field for requests.
14024        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14025            self.0.request.parent = v.into();
14026            self
14027        }
14028
14029        /// Sets the value of [authorization_policy_id][crate::model::CreateAuthorizationPolicyRequest::authorization_policy_id].
14030        ///
14031        /// This is a **required** field for requests.
14032        pub fn set_authorization_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14033            self.0.request.authorization_policy_id = v.into();
14034            self
14035        }
14036
14037        /// Sets the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
14038        ///
14039        /// This is a **required** field for requests.
14040        pub fn set_authorization_policy<T>(mut self, v: T) -> Self
14041        where
14042            T: std::convert::Into<crate::model::AuthorizationPolicy>,
14043        {
14044            self.0.request.authorization_policy = std::option::Option::Some(v.into());
14045            self
14046        }
14047
14048        /// Sets or clears the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
14049        ///
14050        /// This is a **required** field for requests.
14051        pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
14052        where
14053            T: std::convert::Into<crate::model::AuthorizationPolicy>,
14054        {
14055            self.0.request.authorization_policy = v.map(|x| x.into());
14056            self
14057        }
14058    }
14059
14060    #[doc(hidden)]
14061    impl crate::RequestBuilder for CreateAuthorizationPolicy {
14062        fn request_options(&mut self) -> &mut crate::RequestOptions {
14063            &mut self.0.options
14064        }
14065    }
14066
14067    /// The request builder for [NetworkSecurity::update_authorization_policy][crate::client::NetworkSecurity::update_authorization_policy] calls.
14068    ///
14069    /// # Example
14070    /// ```
14071    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateAuthorizationPolicy;
14072    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14073    /// use google_cloud_lro::Poller;
14074    ///
14075    /// let builder = prepare_request_builder();
14076    /// let response = builder.poller().until_done().await?;
14077    /// # Ok(()) }
14078    ///
14079    /// fn prepare_request_builder() -> UpdateAuthorizationPolicy {
14080    ///   # panic!();
14081    ///   // ... details omitted ...
14082    /// }
14083    /// ```
14084    #[derive(Clone, Debug)]
14085    pub struct UpdateAuthorizationPolicy(
14086        RequestBuilder<crate::model::UpdateAuthorizationPolicyRequest>,
14087    );
14088
14089    impl UpdateAuthorizationPolicy {
14090        pub(crate) fn new(
14091            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14092        ) -> Self {
14093            Self(RequestBuilder::new(stub))
14094        }
14095
14096        /// Sets the full request, replacing any prior values.
14097        pub fn with_request<V: Into<crate::model::UpdateAuthorizationPolicyRequest>>(
14098            mut self,
14099            v: V,
14100        ) -> Self {
14101            self.0.request = v.into();
14102            self
14103        }
14104
14105        /// Sets all the options, replacing any prior values.
14106        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14107            self.0.options = v.into();
14108            self
14109        }
14110
14111        /// Sends the request.
14112        ///
14113        /// # Long running operations
14114        ///
14115        /// This starts, but does not poll, a longrunning operation. More information
14116        /// on [update_authorization_policy][crate::client::NetworkSecurity::update_authorization_policy].
14117        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14118            (*self.0.stub)
14119                .update_authorization_policy(self.0.request, self.0.options)
14120                .await
14121                .map(crate::Response::into_body)
14122        }
14123
14124        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_authorization_policy`.
14125        pub fn poller(
14126            self,
14127        ) -> impl google_cloud_lro::Poller<
14128            crate::model::AuthorizationPolicy,
14129            crate::model::OperationMetadata,
14130        > {
14131            type Operation = google_cloud_lro::internal::Operation<
14132                crate::model::AuthorizationPolicy,
14133                crate::model::OperationMetadata,
14134            >;
14135            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14136            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14137
14138            let stub = self.0.stub.clone();
14139            let mut options = self.0.options.clone();
14140            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14141            let query = move |name| {
14142                let stub = stub.clone();
14143                let options = options.clone();
14144                async {
14145                    let op = GetOperation::new(stub)
14146                        .set_name(name)
14147                        .with_options(options)
14148                        .send()
14149                        .await?;
14150                    Ok(Operation::new(op))
14151                }
14152            };
14153
14154            let start = move || async {
14155                let op = self.send().await?;
14156                Ok(Operation::new(op))
14157            };
14158
14159            google_cloud_lro::internal::new_poller(
14160                polling_error_policy,
14161                polling_backoff_policy,
14162                start,
14163                query,
14164            )
14165        }
14166
14167        /// Sets the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
14168        pub fn set_update_mask<T>(mut self, v: T) -> Self
14169        where
14170            T: std::convert::Into<wkt::FieldMask>,
14171        {
14172            self.0.request.update_mask = std::option::Option::Some(v.into());
14173            self
14174        }
14175
14176        /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
14177        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14178        where
14179            T: std::convert::Into<wkt::FieldMask>,
14180        {
14181            self.0.request.update_mask = v.map(|x| x.into());
14182            self
14183        }
14184
14185        /// Sets the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
14186        ///
14187        /// This is a **required** field for requests.
14188        pub fn set_authorization_policy<T>(mut self, v: T) -> Self
14189        where
14190            T: std::convert::Into<crate::model::AuthorizationPolicy>,
14191        {
14192            self.0.request.authorization_policy = std::option::Option::Some(v.into());
14193            self
14194        }
14195
14196        /// Sets or clears the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
14197        ///
14198        /// This is a **required** field for requests.
14199        pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
14200        where
14201            T: std::convert::Into<crate::model::AuthorizationPolicy>,
14202        {
14203            self.0.request.authorization_policy = v.map(|x| x.into());
14204            self
14205        }
14206    }
14207
14208    #[doc(hidden)]
14209    impl crate::RequestBuilder for UpdateAuthorizationPolicy {
14210        fn request_options(&mut self) -> &mut crate::RequestOptions {
14211            &mut self.0.options
14212        }
14213    }
14214
14215    /// The request builder for [NetworkSecurity::delete_authorization_policy][crate::client::NetworkSecurity::delete_authorization_policy] calls.
14216    ///
14217    /// # Example
14218    /// ```
14219    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteAuthorizationPolicy;
14220    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14221    /// use google_cloud_lro::Poller;
14222    ///
14223    /// let builder = prepare_request_builder();
14224    /// let response = builder.poller().until_done().await?;
14225    /// # Ok(()) }
14226    ///
14227    /// fn prepare_request_builder() -> DeleteAuthorizationPolicy {
14228    ///   # panic!();
14229    ///   // ... details omitted ...
14230    /// }
14231    /// ```
14232    #[derive(Clone, Debug)]
14233    pub struct DeleteAuthorizationPolicy(
14234        RequestBuilder<crate::model::DeleteAuthorizationPolicyRequest>,
14235    );
14236
14237    impl DeleteAuthorizationPolicy {
14238        pub(crate) fn new(
14239            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14240        ) -> Self {
14241            Self(RequestBuilder::new(stub))
14242        }
14243
14244        /// Sets the full request, replacing any prior values.
14245        pub fn with_request<V: Into<crate::model::DeleteAuthorizationPolicyRequest>>(
14246            mut self,
14247            v: V,
14248        ) -> Self {
14249            self.0.request = v.into();
14250            self
14251        }
14252
14253        /// Sets all the options, replacing any prior values.
14254        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14255            self.0.options = v.into();
14256            self
14257        }
14258
14259        /// Sends the request.
14260        ///
14261        /// # Long running operations
14262        ///
14263        /// This starts, but does not poll, a longrunning operation. More information
14264        /// on [delete_authorization_policy][crate::client::NetworkSecurity::delete_authorization_policy].
14265        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14266            (*self.0.stub)
14267                .delete_authorization_policy(self.0.request, self.0.options)
14268                .await
14269                .map(crate::Response::into_body)
14270        }
14271
14272        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_authorization_policy`.
14273        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
14274            type Operation =
14275                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14276            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14277            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14278
14279            let stub = self.0.stub.clone();
14280            let mut options = self.0.options.clone();
14281            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14282            let query = move |name| {
14283                let stub = stub.clone();
14284                let options = options.clone();
14285                async {
14286                    let op = GetOperation::new(stub)
14287                        .set_name(name)
14288                        .with_options(options)
14289                        .send()
14290                        .await?;
14291                    Ok(Operation::new(op))
14292                }
14293            };
14294
14295            let start = move || async {
14296                let op = self.send().await?;
14297                Ok(Operation::new(op))
14298            };
14299
14300            google_cloud_lro::internal::new_unit_response_poller(
14301                polling_error_policy,
14302                polling_backoff_policy,
14303                start,
14304                query,
14305            )
14306        }
14307
14308        /// Sets the value of [name][crate::model::DeleteAuthorizationPolicyRequest::name].
14309        ///
14310        /// This is a **required** field for requests.
14311        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14312            self.0.request.name = v.into();
14313            self
14314        }
14315    }
14316
14317    #[doc(hidden)]
14318    impl crate::RequestBuilder for DeleteAuthorizationPolicy {
14319        fn request_options(&mut self) -> &mut crate::RequestOptions {
14320            &mut self.0.options
14321        }
14322    }
14323
14324    /// The request builder for [NetworkSecurity::list_backend_authentication_configs][crate::client::NetworkSecurity::list_backend_authentication_configs] calls.
14325    ///
14326    /// # Example
14327    /// ```
14328    /// # use google_cloud_networksecurity_v1::builder::network_security::ListBackendAuthenticationConfigs;
14329    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14330    /// use google_cloud_gax::paginator::ItemPaginator;
14331    ///
14332    /// let builder = prepare_request_builder();
14333    /// let mut items = builder.by_item();
14334    /// while let Some(result) = items.next().await {
14335    ///   let item = result?;
14336    /// }
14337    /// # Ok(()) }
14338    ///
14339    /// fn prepare_request_builder() -> ListBackendAuthenticationConfigs {
14340    ///   # panic!();
14341    ///   // ... details omitted ...
14342    /// }
14343    /// ```
14344    #[derive(Clone, Debug)]
14345    pub struct ListBackendAuthenticationConfigs(
14346        RequestBuilder<crate::model::ListBackendAuthenticationConfigsRequest>,
14347    );
14348
14349    impl ListBackendAuthenticationConfigs {
14350        pub(crate) fn new(
14351            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14352        ) -> Self {
14353            Self(RequestBuilder::new(stub))
14354        }
14355
14356        /// Sets the full request, replacing any prior values.
14357        pub fn with_request<V: Into<crate::model::ListBackendAuthenticationConfigsRequest>>(
14358            mut self,
14359            v: V,
14360        ) -> Self {
14361            self.0.request = v.into();
14362            self
14363        }
14364
14365        /// Sets all the options, replacing any prior values.
14366        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14367            self.0.options = v.into();
14368            self
14369        }
14370
14371        /// Sends the request.
14372        pub async fn send(self) -> Result<crate::model::ListBackendAuthenticationConfigsResponse> {
14373            (*self.0.stub)
14374                .list_backend_authentication_configs(self.0.request, self.0.options)
14375                .await
14376                .map(crate::Response::into_body)
14377        }
14378
14379        /// Streams each page in the collection.
14380        pub fn by_page(
14381            self,
14382        ) -> impl google_cloud_gax::paginator::Paginator<
14383            crate::model::ListBackendAuthenticationConfigsResponse,
14384            crate::Error,
14385        > {
14386            use std::clone::Clone;
14387            let token = self.0.request.page_token.clone();
14388            let execute = move |token: String| {
14389                let mut builder = self.clone();
14390                builder.0.request = builder.0.request.set_page_token(token);
14391                builder.send()
14392            };
14393            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14394        }
14395
14396        /// Streams each item in the collection.
14397        pub fn by_item(
14398            self,
14399        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14400            crate::model::ListBackendAuthenticationConfigsResponse,
14401            crate::Error,
14402        > {
14403            use google_cloud_gax::paginator::Paginator;
14404            self.by_page().items()
14405        }
14406
14407        /// Sets the value of [parent][crate::model::ListBackendAuthenticationConfigsRequest::parent].
14408        ///
14409        /// This is a **required** field for requests.
14410        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14411            self.0.request.parent = v.into();
14412            self
14413        }
14414
14415        /// Sets the value of [page_size][crate::model::ListBackendAuthenticationConfigsRequest::page_size].
14416        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14417            self.0.request.page_size = v.into();
14418            self
14419        }
14420
14421        /// Sets the value of [page_token][crate::model::ListBackendAuthenticationConfigsRequest::page_token].
14422        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14423            self.0.request.page_token = v.into();
14424            self
14425        }
14426    }
14427
14428    #[doc(hidden)]
14429    impl crate::RequestBuilder for ListBackendAuthenticationConfigs {
14430        fn request_options(&mut self) -> &mut crate::RequestOptions {
14431            &mut self.0.options
14432        }
14433    }
14434
14435    /// The request builder for [NetworkSecurity::get_backend_authentication_config][crate::client::NetworkSecurity::get_backend_authentication_config] calls.
14436    ///
14437    /// # Example
14438    /// ```
14439    /// # use google_cloud_networksecurity_v1::builder::network_security::GetBackendAuthenticationConfig;
14440    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14441    ///
14442    /// let builder = prepare_request_builder();
14443    /// let response = builder.send().await?;
14444    /// # Ok(()) }
14445    ///
14446    /// fn prepare_request_builder() -> GetBackendAuthenticationConfig {
14447    ///   # panic!();
14448    ///   // ... details omitted ...
14449    /// }
14450    /// ```
14451    #[derive(Clone, Debug)]
14452    pub struct GetBackendAuthenticationConfig(
14453        RequestBuilder<crate::model::GetBackendAuthenticationConfigRequest>,
14454    );
14455
14456    impl GetBackendAuthenticationConfig {
14457        pub(crate) fn new(
14458            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14459        ) -> Self {
14460            Self(RequestBuilder::new(stub))
14461        }
14462
14463        /// Sets the full request, replacing any prior values.
14464        pub fn with_request<V: Into<crate::model::GetBackendAuthenticationConfigRequest>>(
14465            mut self,
14466            v: V,
14467        ) -> Self {
14468            self.0.request = v.into();
14469            self
14470        }
14471
14472        /// Sets all the options, replacing any prior values.
14473        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14474            self.0.options = v.into();
14475            self
14476        }
14477
14478        /// Sends the request.
14479        pub async fn send(self) -> Result<crate::model::BackendAuthenticationConfig> {
14480            (*self.0.stub)
14481                .get_backend_authentication_config(self.0.request, self.0.options)
14482                .await
14483                .map(crate::Response::into_body)
14484        }
14485
14486        /// Sets the value of [name][crate::model::GetBackendAuthenticationConfigRequest::name].
14487        ///
14488        /// This is a **required** field for requests.
14489        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14490            self.0.request.name = v.into();
14491            self
14492        }
14493    }
14494
14495    #[doc(hidden)]
14496    impl crate::RequestBuilder for GetBackendAuthenticationConfig {
14497        fn request_options(&mut self) -> &mut crate::RequestOptions {
14498            &mut self.0.options
14499        }
14500    }
14501
14502    /// The request builder for [NetworkSecurity::create_backend_authentication_config][crate::client::NetworkSecurity::create_backend_authentication_config] calls.
14503    ///
14504    /// # Example
14505    /// ```
14506    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateBackendAuthenticationConfig;
14507    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14508    /// use google_cloud_lro::Poller;
14509    ///
14510    /// let builder = prepare_request_builder();
14511    /// let response = builder.poller().until_done().await?;
14512    /// # Ok(()) }
14513    ///
14514    /// fn prepare_request_builder() -> CreateBackendAuthenticationConfig {
14515    ///   # panic!();
14516    ///   // ... details omitted ...
14517    /// }
14518    /// ```
14519    #[derive(Clone, Debug)]
14520    pub struct CreateBackendAuthenticationConfig(
14521        RequestBuilder<crate::model::CreateBackendAuthenticationConfigRequest>,
14522    );
14523
14524    impl CreateBackendAuthenticationConfig {
14525        pub(crate) fn new(
14526            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14527        ) -> Self {
14528            Self(RequestBuilder::new(stub))
14529        }
14530
14531        /// Sets the full request, replacing any prior values.
14532        pub fn with_request<V: Into<crate::model::CreateBackendAuthenticationConfigRequest>>(
14533            mut self,
14534            v: V,
14535        ) -> Self {
14536            self.0.request = v.into();
14537            self
14538        }
14539
14540        /// Sets all the options, replacing any prior values.
14541        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14542            self.0.options = v.into();
14543            self
14544        }
14545
14546        /// Sends the request.
14547        ///
14548        /// # Long running operations
14549        ///
14550        /// This starts, but does not poll, a longrunning operation. More information
14551        /// on [create_backend_authentication_config][crate::client::NetworkSecurity::create_backend_authentication_config].
14552        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14553            (*self.0.stub)
14554                .create_backend_authentication_config(self.0.request, self.0.options)
14555                .await
14556                .map(crate::Response::into_body)
14557        }
14558
14559        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_backend_authentication_config`.
14560        pub fn poller(
14561            self,
14562        ) -> impl google_cloud_lro::Poller<
14563            crate::model::BackendAuthenticationConfig,
14564            crate::model::OperationMetadata,
14565        > {
14566            type Operation = google_cloud_lro::internal::Operation<
14567                crate::model::BackendAuthenticationConfig,
14568                crate::model::OperationMetadata,
14569            >;
14570            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14571            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14572
14573            let stub = self.0.stub.clone();
14574            let mut options = self.0.options.clone();
14575            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14576            let query = move |name| {
14577                let stub = stub.clone();
14578                let options = options.clone();
14579                async {
14580                    let op = GetOperation::new(stub)
14581                        .set_name(name)
14582                        .with_options(options)
14583                        .send()
14584                        .await?;
14585                    Ok(Operation::new(op))
14586                }
14587            };
14588
14589            let start = move || async {
14590                let op = self.send().await?;
14591                Ok(Operation::new(op))
14592            };
14593
14594            google_cloud_lro::internal::new_poller(
14595                polling_error_policy,
14596                polling_backoff_policy,
14597                start,
14598                query,
14599            )
14600        }
14601
14602        /// Sets the value of [parent][crate::model::CreateBackendAuthenticationConfigRequest::parent].
14603        ///
14604        /// This is a **required** field for requests.
14605        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14606            self.0.request.parent = v.into();
14607            self
14608        }
14609
14610        /// Sets the value of [backend_authentication_config_id][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config_id].
14611        ///
14612        /// This is a **required** field for requests.
14613        pub fn set_backend_authentication_config_id<T: Into<std::string::String>>(
14614            mut self,
14615            v: T,
14616        ) -> Self {
14617            self.0.request.backend_authentication_config_id = v.into();
14618            self
14619        }
14620
14621        /// Sets the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
14622        ///
14623        /// This is a **required** field for requests.
14624        pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
14625        where
14626            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14627        {
14628            self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
14629            self
14630        }
14631
14632        /// Sets or clears the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
14633        ///
14634        /// This is a **required** field for requests.
14635        pub fn set_or_clear_backend_authentication_config<T>(
14636            mut self,
14637            v: std::option::Option<T>,
14638        ) -> Self
14639        where
14640            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14641        {
14642            self.0.request.backend_authentication_config = v.map(|x| x.into());
14643            self
14644        }
14645    }
14646
14647    #[doc(hidden)]
14648    impl crate::RequestBuilder for CreateBackendAuthenticationConfig {
14649        fn request_options(&mut self) -> &mut crate::RequestOptions {
14650            &mut self.0.options
14651        }
14652    }
14653
14654    /// The request builder for [NetworkSecurity::update_backend_authentication_config][crate::client::NetworkSecurity::update_backend_authentication_config] calls.
14655    ///
14656    /// # Example
14657    /// ```
14658    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateBackendAuthenticationConfig;
14659    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14660    /// use google_cloud_lro::Poller;
14661    ///
14662    /// let builder = prepare_request_builder();
14663    /// let response = builder.poller().until_done().await?;
14664    /// # Ok(()) }
14665    ///
14666    /// fn prepare_request_builder() -> UpdateBackendAuthenticationConfig {
14667    ///   # panic!();
14668    ///   // ... details omitted ...
14669    /// }
14670    /// ```
14671    #[derive(Clone, Debug)]
14672    pub struct UpdateBackendAuthenticationConfig(
14673        RequestBuilder<crate::model::UpdateBackendAuthenticationConfigRequest>,
14674    );
14675
14676    impl UpdateBackendAuthenticationConfig {
14677        pub(crate) fn new(
14678            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14679        ) -> Self {
14680            Self(RequestBuilder::new(stub))
14681        }
14682
14683        /// Sets the full request, replacing any prior values.
14684        pub fn with_request<V: Into<crate::model::UpdateBackendAuthenticationConfigRequest>>(
14685            mut self,
14686            v: V,
14687        ) -> Self {
14688            self.0.request = v.into();
14689            self
14690        }
14691
14692        /// Sets all the options, replacing any prior values.
14693        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14694            self.0.options = v.into();
14695            self
14696        }
14697
14698        /// Sends the request.
14699        ///
14700        /// # Long running operations
14701        ///
14702        /// This starts, but does not poll, a longrunning operation. More information
14703        /// on [update_backend_authentication_config][crate::client::NetworkSecurity::update_backend_authentication_config].
14704        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14705            (*self.0.stub)
14706                .update_backend_authentication_config(self.0.request, self.0.options)
14707                .await
14708                .map(crate::Response::into_body)
14709        }
14710
14711        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_backend_authentication_config`.
14712        pub fn poller(
14713            self,
14714        ) -> impl google_cloud_lro::Poller<
14715            crate::model::BackendAuthenticationConfig,
14716            crate::model::OperationMetadata,
14717        > {
14718            type Operation = google_cloud_lro::internal::Operation<
14719                crate::model::BackendAuthenticationConfig,
14720                crate::model::OperationMetadata,
14721            >;
14722            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14723            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14724
14725            let stub = self.0.stub.clone();
14726            let mut options = self.0.options.clone();
14727            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14728            let query = move |name| {
14729                let stub = stub.clone();
14730                let options = options.clone();
14731                async {
14732                    let op = GetOperation::new(stub)
14733                        .set_name(name)
14734                        .with_options(options)
14735                        .send()
14736                        .await?;
14737                    Ok(Operation::new(op))
14738                }
14739            };
14740
14741            let start = move || async {
14742                let op = self.send().await?;
14743                Ok(Operation::new(op))
14744            };
14745
14746            google_cloud_lro::internal::new_poller(
14747                polling_error_policy,
14748                polling_backoff_policy,
14749                start,
14750                query,
14751            )
14752        }
14753
14754        /// Sets the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
14755        pub fn set_update_mask<T>(mut self, v: T) -> Self
14756        where
14757            T: std::convert::Into<wkt::FieldMask>,
14758        {
14759            self.0.request.update_mask = std::option::Option::Some(v.into());
14760            self
14761        }
14762
14763        /// Sets or clears the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
14764        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14765        where
14766            T: std::convert::Into<wkt::FieldMask>,
14767        {
14768            self.0.request.update_mask = v.map(|x| x.into());
14769            self
14770        }
14771
14772        /// Sets the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
14773        ///
14774        /// This is a **required** field for requests.
14775        pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
14776        where
14777            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14778        {
14779            self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
14780            self
14781        }
14782
14783        /// Sets or clears the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
14784        ///
14785        /// This is a **required** field for requests.
14786        pub fn set_or_clear_backend_authentication_config<T>(
14787            mut self,
14788            v: std::option::Option<T>,
14789        ) -> Self
14790        where
14791            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
14792        {
14793            self.0.request.backend_authentication_config = v.map(|x| x.into());
14794            self
14795        }
14796    }
14797
14798    #[doc(hidden)]
14799    impl crate::RequestBuilder for UpdateBackendAuthenticationConfig {
14800        fn request_options(&mut self) -> &mut crate::RequestOptions {
14801            &mut self.0.options
14802        }
14803    }
14804
14805    /// The request builder for [NetworkSecurity::delete_backend_authentication_config][crate::client::NetworkSecurity::delete_backend_authentication_config] calls.
14806    ///
14807    /// # Example
14808    /// ```
14809    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteBackendAuthenticationConfig;
14810    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14811    /// use google_cloud_lro::Poller;
14812    ///
14813    /// let builder = prepare_request_builder();
14814    /// let response = builder.poller().until_done().await?;
14815    /// # Ok(()) }
14816    ///
14817    /// fn prepare_request_builder() -> DeleteBackendAuthenticationConfig {
14818    ///   # panic!();
14819    ///   // ... details omitted ...
14820    /// }
14821    /// ```
14822    #[derive(Clone, Debug)]
14823    pub struct DeleteBackendAuthenticationConfig(
14824        RequestBuilder<crate::model::DeleteBackendAuthenticationConfigRequest>,
14825    );
14826
14827    impl DeleteBackendAuthenticationConfig {
14828        pub(crate) fn new(
14829            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14830        ) -> Self {
14831            Self(RequestBuilder::new(stub))
14832        }
14833
14834        /// Sets the full request, replacing any prior values.
14835        pub fn with_request<V: Into<crate::model::DeleteBackendAuthenticationConfigRequest>>(
14836            mut self,
14837            v: V,
14838        ) -> Self {
14839            self.0.request = v.into();
14840            self
14841        }
14842
14843        /// Sets all the options, replacing any prior values.
14844        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14845            self.0.options = v.into();
14846            self
14847        }
14848
14849        /// Sends the request.
14850        ///
14851        /// # Long running operations
14852        ///
14853        /// This starts, but does not poll, a longrunning operation. More information
14854        /// on [delete_backend_authentication_config][crate::client::NetworkSecurity::delete_backend_authentication_config].
14855        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14856            (*self.0.stub)
14857                .delete_backend_authentication_config(self.0.request, self.0.options)
14858                .await
14859                .map(crate::Response::into_body)
14860        }
14861
14862        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_backend_authentication_config`.
14863        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
14864            type Operation =
14865                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14866            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14867            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14868
14869            let stub = self.0.stub.clone();
14870            let mut options = self.0.options.clone();
14871            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14872            let query = move |name| {
14873                let stub = stub.clone();
14874                let options = options.clone();
14875                async {
14876                    let op = GetOperation::new(stub)
14877                        .set_name(name)
14878                        .with_options(options)
14879                        .send()
14880                        .await?;
14881                    Ok(Operation::new(op))
14882                }
14883            };
14884
14885            let start = move || async {
14886                let op = self.send().await?;
14887                Ok(Operation::new(op))
14888            };
14889
14890            google_cloud_lro::internal::new_unit_response_poller(
14891                polling_error_policy,
14892                polling_backoff_policy,
14893                start,
14894                query,
14895            )
14896        }
14897
14898        /// Sets the value of [name][crate::model::DeleteBackendAuthenticationConfigRequest::name].
14899        ///
14900        /// This is a **required** field for requests.
14901        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14902            self.0.request.name = v.into();
14903            self
14904        }
14905
14906        /// Sets the value of [etag][crate::model::DeleteBackendAuthenticationConfigRequest::etag].
14907        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
14908            self.0.request.etag = v.into();
14909            self
14910        }
14911    }
14912
14913    #[doc(hidden)]
14914    impl crate::RequestBuilder for DeleteBackendAuthenticationConfig {
14915        fn request_options(&mut self) -> &mut crate::RequestOptions {
14916            &mut self.0.options
14917        }
14918    }
14919
14920    /// The request builder for [NetworkSecurity::list_server_tls_policies][crate::client::NetworkSecurity::list_server_tls_policies] calls.
14921    ///
14922    /// # Example
14923    /// ```
14924    /// # use google_cloud_networksecurity_v1::builder::network_security::ListServerTlsPolicies;
14925    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14926    /// use google_cloud_gax::paginator::ItemPaginator;
14927    ///
14928    /// let builder = prepare_request_builder();
14929    /// let mut items = builder.by_item();
14930    /// while let Some(result) = items.next().await {
14931    ///   let item = result?;
14932    /// }
14933    /// # Ok(()) }
14934    ///
14935    /// fn prepare_request_builder() -> ListServerTlsPolicies {
14936    ///   # panic!();
14937    ///   // ... details omitted ...
14938    /// }
14939    /// ```
14940    #[derive(Clone, Debug)]
14941    pub struct ListServerTlsPolicies(RequestBuilder<crate::model::ListServerTlsPoliciesRequest>);
14942
14943    impl ListServerTlsPolicies {
14944        pub(crate) fn new(
14945            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14946        ) -> Self {
14947            Self(RequestBuilder::new(stub))
14948        }
14949
14950        /// Sets the full request, replacing any prior values.
14951        pub fn with_request<V: Into<crate::model::ListServerTlsPoliciesRequest>>(
14952            mut self,
14953            v: V,
14954        ) -> Self {
14955            self.0.request = v.into();
14956            self
14957        }
14958
14959        /// Sets all the options, replacing any prior values.
14960        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14961            self.0.options = v.into();
14962            self
14963        }
14964
14965        /// Sends the request.
14966        pub async fn send(self) -> Result<crate::model::ListServerTlsPoliciesResponse> {
14967            (*self.0.stub)
14968                .list_server_tls_policies(self.0.request, self.0.options)
14969                .await
14970                .map(crate::Response::into_body)
14971        }
14972
14973        /// Streams each page in the collection.
14974        pub fn by_page(
14975            self,
14976        ) -> impl google_cloud_gax::paginator::Paginator<
14977            crate::model::ListServerTlsPoliciesResponse,
14978            crate::Error,
14979        > {
14980            use std::clone::Clone;
14981            let token = self.0.request.page_token.clone();
14982            let execute = move |token: String| {
14983                let mut builder = self.clone();
14984                builder.0.request = builder.0.request.set_page_token(token);
14985                builder.send()
14986            };
14987            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14988        }
14989
14990        /// Streams each item in the collection.
14991        pub fn by_item(
14992            self,
14993        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14994            crate::model::ListServerTlsPoliciesResponse,
14995            crate::Error,
14996        > {
14997            use google_cloud_gax::paginator::Paginator;
14998            self.by_page().items()
14999        }
15000
15001        /// Sets the value of [parent][crate::model::ListServerTlsPoliciesRequest::parent].
15002        ///
15003        /// This is a **required** field for requests.
15004        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15005            self.0.request.parent = v.into();
15006            self
15007        }
15008
15009        /// Sets the value of [page_size][crate::model::ListServerTlsPoliciesRequest::page_size].
15010        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15011            self.0.request.page_size = v.into();
15012            self
15013        }
15014
15015        /// Sets the value of [page_token][crate::model::ListServerTlsPoliciesRequest::page_token].
15016        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15017            self.0.request.page_token = v.into();
15018            self
15019        }
15020
15021        /// Sets the value of [return_partial_success][crate::model::ListServerTlsPoliciesRequest::return_partial_success].
15022        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15023            self.0.request.return_partial_success = v.into();
15024            self
15025        }
15026    }
15027
15028    #[doc(hidden)]
15029    impl crate::RequestBuilder for ListServerTlsPolicies {
15030        fn request_options(&mut self) -> &mut crate::RequestOptions {
15031            &mut self.0.options
15032        }
15033    }
15034
15035    /// The request builder for [NetworkSecurity::get_server_tls_policy][crate::client::NetworkSecurity::get_server_tls_policy] calls.
15036    ///
15037    /// # Example
15038    /// ```
15039    /// # use google_cloud_networksecurity_v1::builder::network_security::GetServerTlsPolicy;
15040    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15041    ///
15042    /// let builder = prepare_request_builder();
15043    /// let response = builder.send().await?;
15044    /// # Ok(()) }
15045    ///
15046    /// fn prepare_request_builder() -> GetServerTlsPolicy {
15047    ///   # panic!();
15048    ///   // ... details omitted ...
15049    /// }
15050    /// ```
15051    #[derive(Clone, Debug)]
15052    pub struct GetServerTlsPolicy(RequestBuilder<crate::model::GetServerTlsPolicyRequest>);
15053
15054    impl GetServerTlsPolicy {
15055        pub(crate) fn new(
15056            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15057        ) -> Self {
15058            Self(RequestBuilder::new(stub))
15059        }
15060
15061        /// Sets the full request, replacing any prior values.
15062        pub fn with_request<V: Into<crate::model::GetServerTlsPolicyRequest>>(
15063            mut self,
15064            v: V,
15065        ) -> Self {
15066            self.0.request = v.into();
15067            self
15068        }
15069
15070        /// Sets all the options, replacing any prior values.
15071        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15072            self.0.options = v.into();
15073            self
15074        }
15075
15076        /// Sends the request.
15077        pub async fn send(self) -> Result<crate::model::ServerTlsPolicy> {
15078            (*self.0.stub)
15079                .get_server_tls_policy(self.0.request, self.0.options)
15080                .await
15081                .map(crate::Response::into_body)
15082        }
15083
15084        /// Sets the value of [name][crate::model::GetServerTlsPolicyRequest::name].
15085        ///
15086        /// This is a **required** field for requests.
15087        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15088            self.0.request.name = v.into();
15089            self
15090        }
15091    }
15092
15093    #[doc(hidden)]
15094    impl crate::RequestBuilder for GetServerTlsPolicy {
15095        fn request_options(&mut self) -> &mut crate::RequestOptions {
15096            &mut self.0.options
15097        }
15098    }
15099
15100    /// The request builder for [NetworkSecurity::create_server_tls_policy][crate::client::NetworkSecurity::create_server_tls_policy] calls.
15101    ///
15102    /// # Example
15103    /// ```
15104    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateServerTlsPolicy;
15105    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15106    /// use google_cloud_lro::Poller;
15107    ///
15108    /// let builder = prepare_request_builder();
15109    /// let response = builder.poller().until_done().await?;
15110    /// # Ok(()) }
15111    ///
15112    /// fn prepare_request_builder() -> CreateServerTlsPolicy {
15113    ///   # panic!();
15114    ///   // ... details omitted ...
15115    /// }
15116    /// ```
15117    #[derive(Clone, Debug)]
15118    pub struct CreateServerTlsPolicy(RequestBuilder<crate::model::CreateServerTlsPolicyRequest>);
15119
15120    impl CreateServerTlsPolicy {
15121        pub(crate) fn new(
15122            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15123        ) -> Self {
15124            Self(RequestBuilder::new(stub))
15125        }
15126
15127        /// Sets the full request, replacing any prior values.
15128        pub fn with_request<V: Into<crate::model::CreateServerTlsPolicyRequest>>(
15129            mut self,
15130            v: V,
15131        ) -> Self {
15132            self.0.request = v.into();
15133            self
15134        }
15135
15136        /// Sets all the options, replacing any prior values.
15137        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15138            self.0.options = v.into();
15139            self
15140        }
15141
15142        /// Sends the request.
15143        ///
15144        /// # Long running operations
15145        ///
15146        /// This starts, but does not poll, a longrunning operation. More information
15147        /// on [create_server_tls_policy][crate::client::NetworkSecurity::create_server_tls_policy].
15148        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15149            (*self.0.stub)
15150                .create_server_tls_policy(self.0.request, self.0.options)
15151                .await
15152                .map(crate::Response::into_body)
15153        }
15154
15155        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_server_tls_policy`.
15156        pub fn poller(
15157            self,
15158        ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
15159        {
15160            type Operation = google_cloud_lro::internal::Operation<
15161                crate::model::ServerTlsPolicy,
15162                crate::model::OperationMetadata,
15163            >;
15164            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15165            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15166
15167            let stub = self.0.stub.clone();
15168            let mut options = self.0.options.clone();
15169            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15170            let query = move |name| {
15171                let stub = stub.clone();
15172                let options = options.clone();
15173                async {
15174                    let op = GetOperation::new(stub)
15175                        .set_name(name)
15176                        .with_options(options)
15177                        .send()
15178                        .await?;
15179                    Ok(Operation::new(op))
15180                }
15181            };
15182
15183            let start = move || async {
15184                let op = self.send().await?;
15185                Ok(Operation::new(op))
15186            };
15187
15188            google_cloud_lro::internal::new_poller(
15189                polling_error_policy,
15190                polling_backoff_policy,
15191                start,
15192                query,
15193            )
15194        }
15195
15196        /// Sets the value of [parent][crate::model::CreateServerTlsPolicyRequest::parent].
15197        ///
15198        /// This is a **required** field for requests.
15199        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15200            self.0.request.parent = v.into();
15201            self
15202        }
15203
15204        /// Sets the value of [server_tls_policy_id][crate::model::CreateServerTlsPolicyRequest::server_tls_policy_id].
15205        ///
15206        /// This is a **required** field for requests.
15207        pub fn set_server_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15208            self.0.request.server_tls_policy_id = v.into();
15209            self
15210        }
15211
15212        /// Sets the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
15213        ///
15214        /// This is a **required** field for requests.
15215        pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
15216        where
15217            T: std::convert::Into<crate::model::ServerTlsPolicy>,
15218        {
15219            self.0.request.server_tls_policy = std::option::Option::Some(v.into());
15220            self
15221        }
15222
15223        /// Sets or clears the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
15224        ///
15225        /// This is a **required** field for requests.
15226        pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15227        where
15228            T: std::convert::Into<crate::model::ServerTlsPolicy>,
15229        {
15230            self.0.request.server_tls_policy = v.map(|x| x.into());
15231            self
15232        }
15233    }
15234
15235    #[doc(hidden)]
15236    impl crate::RequestBuilder for CreateServerTlsPolicy {
15237        fn request_options(&mut self) -> &mut crate::RequestOptions {
15238            &mut self.0.options
15239        }
15240    }
15241
15242    /// The request builder for [NetworkSecurity::update_server_tls_policy][crate::client::NetworkSecurity::update_server_tls_policy] calls.
15243    ///
15244    /// # Example
15245    /// ```
15246    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateServerTlsPolicy;
15247    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15248    /// use google_cloud_lro::Poller;
15249    ///
15250    /// let builder = prepare_request_builder();
15251    /// let response = builder.poller().until_done().await?;
15252    /// # Ok(()) }
15253    ///
15254    /// fn prepare_request_builder() -> UpdateServerTlsPolicy {
15255    ///   # panic!();
15256    ///   // ... details omitted ...
15257    /// }
15258    /// ```
15259    #[derive(Clone, Debug)]
15260    pub struct UpdateServerTlsPolicy(RequestBuilder<crate::model::UpdateServerTlsPolicyRequest>);
15261
15262    impl UpdateServerTlsPolicy {
15263        pub(crate) fn new(
15264            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15265        ) -> Self {
15266            Self(RequestBuilder::new(stub))
15267        }
15268
15269        /// Sets the full request, replacing any prior values.
15270        pub fn with_request<V: Into<crate::model::UpdateServerTlsPolicyRequest>>(
15271            mut self,
15272            v: V,
15273        ) -> Self {
15274            self.0.request = v.into();
15275            self
15276        }
15277
15278        /// Sets all the options, replacing any prior values.
15279        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15280            self.0.options = v.into();
15281            self
15282        }
15283
15284        /// Sends the request.
15285        ///
15286        /// # Long running operations
15287        ///
15288        /// This starts, but does not poll, a longrunning operation. More information
15289        /// on [update_server_tls_policy][crate::client::NetworkSecurity::update_server_tls_policy].
15290        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15291            (*self.0.stub)
15292                .update_server_tls_policy(self.0.request, self.0.options)
15293                .await
15294                .map(crate::Response::into_body)
15295        }
15296
15297        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_server_tls_policy`.
15298        pub fn poller(
15299            self,
15300        ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
15301        {
15302            type Operation = google_cloud_lro::internal::Operation<
15303                crate::model::ServerTlsPolicy,
15304                crate::model::OperationMetadata,
15305            >;
15306            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15307            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15308
15309            let stub = self.0.stub.clone();
15310            let mut options = self.0.options.clone();
15311            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15312            let query = move |name| {
15313                let stub = stub.clone();
15314                let options = options.clone();
15315                async {
15316                    let op = GetOperation::new(stub)
15317                        .set_name(name)
15318                        .with_options(options)
15319                        .send()
15320                        .await?;
15321                    Ok(Operation::new(op))
15322                }
15323            };
15324
15325            let start = move || async {
15326                let op = self.send().await?;
15327                Ok(Operation::new(op))
15328            };
15329
15330            google_cloud_lro::internal::new_poller(
15331                polling_error_policy,
15332                polling_backoff_policy,
15333                start,
15334                query,
15335            )
15336        }
15337
15338        /// Sets the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
15339        pub fn set_update_mask<T>(mut self, v: T) -> Self
15340        where
15341            T: std::convert::Into<wkt::FieldMask>,
15342        {
15343            self.0.request.update_mask = std::option::Option::Some(v.into());
15344            self
15345        }
15346
15347        /// Sets or clears the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
15348        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15349        where
15350            T: std::convert::Into<wkt::FieldMask>,
15351        {
15352            self.0.request.update_mask = v.map(|x| x.into());
15353            self
15354        }
15355
15356        /// Sets the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
15357        ///
15358        /// This is a **required** field for requests.
15359        pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
15360        where
15361            T: std::convert::Into<crate::model::ServerTlsPolicy>,
15362        {
15363            self.0.request.server_tls_policy = std::option::Option::Some(v.into());
15364            self
15365        }
15366
15367        /// Sets or clears the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
15368        ///
15369        /// This is a **required** field for requests.
15370        pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15371        where
15372            T: std::convert::Into<crate::model::ServerTlsPolicy>,
15373        {
15374            self.0.request.server_tls_policy = v.map(|x| x.into());
15375            self
15376        }
15377    }
15378
15379    #[doc(hidden)]
15380    impl crate::RequestBuilder for UpdateServerTlsPolicy {
15381        fn request_options(&mut self) -> &mut crate::RequestOptions {
15382            &mut self.0.options
15383        }
15384    }
15385
15386    /// The request builder for [NetworkSecurity::delete_server_tls_policy][crate::client::NetworkSecurity::delete_server_tls_policy] calls.
15387    ///
15388    /// # Example
15389    /// ```
15390    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteServerTlsPolicy;
15391    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15392    /// use google_cloud_lro::Poller;
15393    ///
15394    /// let builder = prepare_request_builder();
15395    /// let response = builder.poller().until_done().await?;
15396    /// # Ok(()) }
15397    ///
15398    /// fn prepare_request_builder() -> DeleteServerTlsPolicy {
15399    ///   # panic!();
15400    ///   // ... details omitted ...
15401    /// }
15402    /// ```
15403    #[derive(Clone, Debug)]
15404    pub struct DeleteServerTlsPolicy(RequestBuilder<crate::model::DeleteServerTlsPolicyRequest>);
15405
15406    impl DeleteServerTlsPolicy {
15407        pub(crate) fn new(
15408            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15409        ) -> Self {
15410            Self(RequestBuilder::new(stub))
15411        }
15412
15413        /// Sets the full request, replacing any prior values.
15414        pub fn with_request<V: Into<crate::model::DeleteServerTlsPolicyRequest>>(
15415            mut self,
15416            v: V,
15417        ) -> Self {
15418            self.0.request = v.into();
15419            self
15420        }
15421
15422        /// Sets all the options, replacing any prior values.
15423        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15424            self.0.options = v.into();
15425            self
15426        }
15427
15428        /// Sends the request.
15429        ///
15430        /// # Long running operations
15431        ///
15432        /// This starts, but does not poll, a longrunning operation. More information
15433        /// on [delete_server_tls_policy][crate::client::NetworkSecurity::delete_server_tls_policy].
15434        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15435            (*self.0.stub)
15436                .delete_server_tls_policy(self.0.request, self.0.options)
15437                .await
15438                .map(crate::Response::into_body)
15439        }
15440
15441        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_server_tls_policy`.
15442        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
15443            type Operation =
15444                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15445            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15446            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15447
15448            let stub = self.0.stub.clone();
15449            let mut options = self.0.options.clone();
15450            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15451            let query = move |name| {
15452                let stub = stub.clone();
15453                let options = options.clone();
15454                async {
15455                    let op = GetOperation::new(stub)
15456                        .set_name(name)
15457                        .with_options(options)
15458                        .send()
15459                        .await?;
15460                    Ok(Operation::new(op))
15461                }
15462            };
15463
15464            let start = move || async {
15465                let op = self.send().await?;
15466                Ok(Operation::new(op))
15467            };
15468
15469            google_cloud_lro::internal::new_unit_response_poller(
15470                polling_error_policy,
15471                polling_backoff_policy,
15472                start,
15473                query,
15474            )
15475        }
15476
15477        /// Sets the value of [name][crate::model::DeleteServerTlsPolicyRequest::name].
15478        ///
15479        /// This is a **required** field for requests.
15480        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15481            self.0.request.name = v.into();
15482            self
15483        }
15484    }
15485
15486    #[doc(hidden)]
15487    impl crate::RequestBuilder for DeleteServerTlsPolicy {
15488        fn request_options(&mut self) -> &mut crate::RequestOptions {
15489            &mut self.0.options
15490        }
15491    }
15492
15493    /// The request builder for [NetworkSecurity::list_client_tls_policies][crate::client::NetworkSecurity::list_client_tls_policies] calls.
15494    ///
15495    /// # Example
15496    /// ```
15497    /// # use google_cloud_networksecurity_v1::builder::network_security::ListClientTlsPolicies;
15498    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15499    /// use google_cloud_gax::paginator::ItemPaginator;
15500    ///
15501    /// let builder = prepare_request_builder();
15502    /// let mut items = builder.by_item();
15503    /// while let Some(result) = items.next().await {
15504    ///   let item = result?;
15505    /// }
15506    /// # Ok(()) }
15507    ///
15508    /// fn prepare_request_builder() -> ListClientTlsPolicies {
15509    ///   # panic!();
15510    ///   // ... details omitted ...
15511    /// }
15512    /// ```
15513    #[derive(Clone, Debug)]
15514    pub struct ListClientTlsPolicies(RequestBuilder<crate::model::ListClientTlsPoliciesRequest>);
15515
15516    impl ListClientTlsPolicies {
15517        pub(crate) fn new(
15518            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15519        ) -> Self {
15520            Self(RequestBuilder::new(stub))
15521        }
15522
15523        /// Sets the full request, replacing any prior values.
15524        pub fn with_request<V: Into<crate::model::ListClientTlsPoliciesRequest>>(
15525            mut self,
15526            v: V,
15527        ) -> Self {
15528            self.0.request = v.into();
15529            self
15530        }
15531
15532        /// Sets all the options, replacing any prior values.
15533        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15534            self.0.options = v.into();
15535            self
15536        }
15537
15538        /// Sends the request.
15539        pub async fn send(self) -> Result<crate::model::ListClientTlsPoliciesResponse> {
15540            (*self.0.stub)
15541                .list_client_tls_policies(self.0.request, self.0.options)
15542                .await
15543                .map(crate::Response::into_body)
15544        }
15545
15546        /// Streams each page in the collection.
15547        pub fn by_page(
15548            self,
15549        ) -> impl google_cloud_gax::paginator::Paginator<
15550            crate::model::ListClientTlsPoliciesResponse,
15551            crate::Error,
15552        > {
15553            use std::clone::Clone;
15554            let token = self.0.request.page_token.clone();
15555            let execute = move |token: String| {
15556                let mut builder = self.clone();
15557                builder.0.request = builder.0.request.set_page_token(token);
15558                builder.send()
15559            };
15560            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15561        }
15562
15563        /// Streams each item in the collection.
15564        pub fn by_item(
15565            self,
15566        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15567            crate::model::ListClientTlsPoliciesResponse,
15568            crate::Error,
15569        > {
15570            use google_cloud_gax::paginator::Paginator;
15571            self.by_page().items()
15572        }
15573
15574        /// Sets the value of [parent][crate::model::ListClientTlsPoliciesRequest::parent].
15575        ///
15576        /// This is a **required** field for requests.
15577        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15578            self.0.request.parent = v.into();
15579            self
15580        }
15581
15582        /// Sets the value of [page_size][crate::model::ListClientTlsPoliciesRequest::page_size].
15583        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15584            self.0.request.page_size = v.into();
15585            self
15586        }
15587
15588        /// Sets the value of [page_token][crate::model::ListClientTlsPoliciesRequest::page_token].
15589        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15590            self.0.request.page_token = v.into();
15591            self
15592        }
15593    }
15594
15595    #[doc(hidden)]
15596    impl crate::RequestBuilder for ListClientTlsPolicies {
15597        fn request_options(&mut self) -> &mut crate::RequestOptions {
15598            &mut self.0.options
15599        }
15600    }
15601
15602    /// The request builder for [NetworkSecurity::get_client_tls_policy][crate::client::NetworkSecurity::get_client_tls_policy] calls.
15603    ///
15604    /// # Example
15605    /// ```
15606    /// # use google_cloud_networksecurity_v1::builder::network_security::GetClientTlsPolicy;
15607    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15608    ///
15609    /// let builder = prepare_request_builder();
15610    /// let response = builder.send().await?;
15611    /// # Ok(()) }
15612    ///
15613    /// fn prepare_request_builder() -> GetClientTlsPolicy {
15614    ///   # panic!();
15615    ///   // ... details omitted ...
15616    /// }
15617    /// ```
15618    #[derive(Clone, Debug)]
15619    pub struct GetClientTlsPolicy(RequestBuilder<crate::model::GetClientTlsPolicyRequest>);
15620
15621    impl GetClientTlsPolicy {
15622        pub(crate) fn new(
15623            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15624        ) -> Self {
15625            Self(RequestBuilder::new(stub))
15626        }
15627
15628        /// Sets the full request, replacing any prior values.
15629        pub fn with_request<V: Into<crate::model::GetClientTlsPolicyRequest>>(
15630            mut self,
15631            v: V,
15632        ) -> Self {
15633            self.0.request = v.into();
15634            self
15635        }
15636
15637        /// Sets all the options, replacing any prior values.
15638        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15639            self.0.options = v.into();
15640            self
15641        }
15642
15643        /// Sends the request.
15644        pub async fn send(self) -> Result<crate::model::ClientTlsPolicy> {
15645            (*self.0.stub)
15646                .get_client_tls_policy(self.0.request, self.0.options)
15647                .await
15648                .map(crate::Response::into_body)
15649        }
15650
15651        /// Sets the value of [name][crate::model::GetClientTlsPolicyRequest::name].
15652        ///
15653        /// This is a **required** field for requests.
15654        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15655            self.0.request.name = v.into();
15656            self
15657        }
15658    }
15659
15660    #[doc(hidden)]
15661    impl crate::RequestBuilder for GetClientTlsPolicy {
15662        fn request_options(&mut self) -> &mut crate::RequestOptions {
15663            &mut self.0.options
15664        }
15665    }
15666
15667    /// The request builder for [NetworkSecurity::create_client_tls_policy][crate::client::NetworkSecurity::create_client_tls_policy] calls.
15668    ///
15669    /// # Example
15670    /// ```
15671    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateClientTlsPolicy;
15672    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15673    /// use google_cloud_lro::Poller;
15674    ///
15675    /// let builder = prepare_request_builder();
15676    /// let response = builder.poller().until_done().await?;
15677    /// # Ok(()) }
15678    ///
15679    /// fn prepare_request_builder() -> CreateClientTlsPolicy {
15680    ///   # panic!();
15681    ///   // ... details omitted ...
15682    /// }
15683    /// ```
15684    #[derive(Clone, Debug)]
15685    pub struct CreateClientTlsPolicy(RequestBuilder<crate::model::CreateClientTlsPolicyRequest>);
15686
15687    impl CreateClientTlsPolicy {
15688        pub(crate) fn new(
15689            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15690        ) -> Self {
15691            Self(RequestBuilder::new(stub))
15692        }
15693
15694        /// Sets the full request, replacing any prior values.
15695        pub fn with_request<V: Into<crate::model::CreateClientTlsPolicyRequest>>(
15696            mut self,
15697            v: V,
15698        ) -> Self {
15699            self.0.request = v.into();
15700            self
15701        }
15702
15703        /// Sets all the options, replacing any prior values.
15704        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15705            self.0.options = v.into();
15706            self
15707        }
15708
15709        /// Sends the request.
15710        ///
15711        /// # Long running operations
15712        ///
15713        /// This starts, but does not poll, a longrunning operation. More information
15714        /// on [create_client_tls_policy][crate::client::NetworkSecurity::create_client_tls_policy].
15715        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15716            (*self.0.stub)
15717                .create_client_tls_policy(self.0.request, self.0.options)
15718                .await
15719                .map(crate::Response::into_body)
15720        }
15721
15722        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_client_tls_policy`.
15723        pub fn poller(
15724            self,
15725        ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
15726        {
15727            type Operation = google_cloud_lro::internal::Operation<
15728                crate::model::ClientTlsPolicy,
15729                crate::model::OperationMetadata,
15730            >;
15731            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15732            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15733
15734            let stub = self.0.stub.clone();
15735            let mut options = self.0.options.clone();
15736            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15737            let query = move |name| {
15738                let stub = stub.clone();
15739                let options = options.clone();
15740                async {
15741                    let op = GetOperation::new(stub)
15742                        .set_name(name)
15743                        .with_options(options)
15744                        .send()
15745                        .await?;
15746                    Ok(Operation::new(op))
15747                }
15748            };
15749
15750            let start = move || async {
15751                let op = self.send().await?;
15752                Ok(Operation::new(op))
15753            };
15754
15755            google_cloud_lro::internal::new_poller(
15756                polling_error_policy,
15757                polling_backoff_policy,
15758                start,
15759                query,
15760            )
15761        }
15762
15763        /// Sets the value of [parent][crate::model::CreateClientTlsPolicyRequest::parent].
15764        ///
15765        /// This is a **required** field for requests.
15766        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15767            self.0.request.parent = v.into();
15768            self
15769        }
15770
15771        /// Sets the value of [client_tls_policy_id][crate::model::CreateClientTlsPolicyRequest::client_tls_policy_id].
15772        ///
15773        /// This is a **required** field for requests.
15774        pub fn set_client_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15775            self.0.request.client_tls_policy_id = v.into();
15776            self
15777        }
15778
15779        /// Sets the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
15780        ///
15781        /// This is a **required** field for requests.
15782        pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
15783        where
15784            T: std::convert::Into<crate::model::ClientTlsPolicy>,
15785        {
15786            self.0.request.client_tls_policy = std::option::Option::Some(v.into());
15787            self
15788        }
15789
15790        /// Sets or clears the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
15791        ///
15792        /// This is a **required** field for requests.
15793        pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15794        where
15795            T: std::convert::Into<crate::model::ClientTlsPolicy>,
15796        {
15797            self.0.request.client_tls_policy = v.map(|x| x.into());
15798            self
15799        }
15800    }
15801
15802    #[doc(hidden)]
15803    impl crate::RequestBuilder for CreateClientTlsPolicy {
15804        fn request_options(&mut self) -> &mut crate::RequestOptions {
15805            &mut self.0.options
15806        }
15807    }
15808
15809    /// The request builder for [NetworkSecurity::update_client_tls_policy][crate::client::NetworkSecurity::update_client_tls_policy] calls.
15810    ///
15811    /// # Example
15812    /// ```
15813    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateClientTlsPolicy;
15814    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15815    /// use google_cloud_lro::Poller;
15816    ///
15817    /// let builder = prepare_request_builder();
15818    /// let response = builder.poller().until_done().await?;
15819    /// # Ok(()) }
15820    ///
15821    /// fn prepare_request_builder() -> UpdateClientTlsPolicy {
15822    ///   # panic!();
15823    ///   // ... details omitted ...
15824    /// }
15825    /// ```
15826    #[derive(Clone, Debug)]
15827    pub struct UpdateClientTlsPolicy(RequestBuilder<crate::model::UpdateClientTlsPolicyRequest>);
15828
15829    impl UpdateClientTlsPolicy {
15830        pub(crate) fn new(
15831            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15832        ) -> Self {
15833            Self(RequestBuilder::new(stub))
15834        }
15835
15836        /// Sets the full request, replacing any prior values.
15837        pub fn with_request<V: Into<crate::model::UpdateClientTlsPolicyRequest>>(
15838            mut self,
15839            v: V,
15840        ) -> Self {
15841            self.0.request = v.into();
15842            self
15843        }
15844
15845        /// Sets all the options, replacing any prior values.
15846        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15847            self.0.options = v.into();
15848            self
15849        }
15850
15851        /// Sends the request.
15852        ///
15853        /// # Long running operations
15854        ///
15855        /// This starts, but does not poll, a longrunning operation. More information
15856        /// on [update_client_tls_policy][crate::client::NetworkSecurity::update_client_tls_policy].
15857        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15858            (*self.0.stub)
15859                .update_client_tls_policy(self.0.request, self.0.options)
15860                .await
15861                .map(crate::Response::into_body)
15862        }
15863
15864        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_client_tls_policy`.
15865        pub fn poller(
15866            self,
15867        ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
15868        {
15869            type Operation = google_cloud_lro::internal::Operation<
15870                crate::model::ClientTlsPolicy,
15871                crate::model::OperationMetadata,
15872            >;
15873            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15874            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15875
15876            let stub = self.0.stub.clone();
15877            let mut options = self.0.options.clone();
15878            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15879            let query = move |name| {
15880                let stub = stub.clone();
15881                let options = options.clone();
15882                async {
15883                    let op = GetOperation::new(stub)
15884                        .set_name(name)
15885                        .with_options(options)
15886                        .send()
15887                        .await?;
15888                    Ok(Operation::new(op))
15889                }
15890            };
15891
15892            let start = move || async {
15893                let op = self.send().await?;
15894                Ok(Operation::new(op))
15895            };
15896
15897            google_cloud_lro::internal::new_poller(
15898                polling_error_policy,
15899                polling_backoff_policy,
15900                start,
15901                query,
15902            )
15903        }
15904
15905        /// Sets the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
15906        pub fn set_update_mask<T>(mut self, v: T) -> Self
15907        where
15908            T: std::convert::Into<wkt::FieldMask>,
15909        {
15910            self.0.request.update_mask = std::option::Option::Some(v.into());
15911            self
15912        }
15913
15914        /// Sets or clears the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
15915        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15916        where
15917            T: std::convert::Into<wkt::FieldMask>,
15918        {
15919            self.0.request.update_mask = v.map(|x| x.into());
15920            self
15921        }
15922
15923        /// Sets the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
15924        ///
15925        /// This is a **required** field for requests.
15926        pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
15927        where
15928            T: std::convert::Into<crate::model::ClientTlsPolicy>,
15929        {
15930            self.0.request.client_tls_policy = std::option::Option::Some(v.into());
15931            self
15932        }
15933
15934        /// Sets or clears the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
15935        ///
15936        /// This is a **required** field for requests.
15937        pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15938        where
15939            T: std::convert::Into<crate::model::ClientTlsPolicy>,
15940        {
15941            self.0.request.client_tls_policy = v.map(|x| x.into());
15942            self
15943        }
15944    }
15945
15946    #[doc(hidden)]
15947    impl crate::RequestBuilder for UpdateClientTlsPolicy {
15948        fn request_options(&mut self) -> &mut crate::RequestOptions {
15949            &mut self.0.options
15950        }
15951    }
15952
15953    /// The request builder for [NetworkSecurity::delete_client_tls_policy][crate::client::NetworkSecurity::delete_client_tls_policy] calls.
15954    ///
15955    /// # Example
15956    /// ```
15957    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteClientTlsPolicy;
15958    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15959    /// use google_cloud_lro::Poller;
15960    ///
15961    /// let builder = prepare_request_builder();
15962    /// let response = builder.poller().until_done().await?;
15963    /// # Ok(()) }
15964    ///
15965    /// fn prepare_request_builder() -> DeleteClientTlsPolicy {
15966    ///   # panic!();
15967    ///   // ... details omitted ...
15968    /// }
15969    /// ```
15970    #[derive(Clone, Debug)]
15971    pub struct DeleteClientTlsPolicy(RequestBuilder<crate::model::DeleteClientTlsPolicyRequest>);
15972
15973    impl DeleteClientTlsPolicy {
15974        pub(crate) fn new(
15975            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15976        ) -> Self {
15977            Self(RequestBuilder::new(stub))
15978        }
15979
15980        /// Sets the full request, replacing any prior values.
15981        pub fn with_request<V: Into<crate::model::DeleteClientTlsPolicyRequest>>(
15982            mut self,
15983            v: V,
15984        ) -> Self {
15985            self.0.request = v.into();
15986            self
15987        }
15988
15989        /// Sets all the options, replacing any prior values.
15990        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15991            self.0.options = v.into();
15992            self
15993        }
15994
15995        /// Sends the request.
15996        ///
15997        /// # Long running operations
15998        ///
15999        /// This starts, but does not poll, a longrunning operation. More information
16000        /// on [delete_client_tls_policy][crate::client::NetworkSecurity::delete_client_tls_policy].
16001        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16002            (*self.0.stub)
16003                .delete_client_tls_policy(self.0.request, self.0.options)
16004                .await
16005                .map(crate::Response::into_body)
16006        }
16007
16008        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_client_tls_policy`.
16009        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16010            type Operation =
16011                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16012            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16013            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16014
16015            let stub = self.0.stub.clone();
16016            let mut options = self.0.options.clone();
16017            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16018            let query = move |name| {
16019                let stub = stub.clone();
16020                let options = options.clone();
16021                async {
16022                    let op = GetOperation::new(stub)
16023                        .set_name(name)
16024                        .with_options(options)
16025                        .send()
16026                        .await?;
16027                    Ok(Operation::new(op))
16028                }
16029            };
16030
16031            let start = move || async {
16032                let op = self.send().await?;
16033                Ok(Operation::new(op))
16034            };
16035
16036            google_cloud_lro::internal::new_unit_response_poller(
16037                polling_error_policy,
16038                polling_backoff_policy,
16039                start,
16040                query,
16041            )
16042        }
16043
16044        /// Sets the value of [name][crate::model::DeleteClientTlsPolicyRequest::name].
16045        ///
16046        /// This is a **required** field for requests.
16047        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16048            self.0.request.name = v.into();
16049            self
16050        }
16051    }
16052
16053    #[doc(hidden)]
16054    impl crate::RequestBuilder for DeleteClientTlsPolicy {
16055        fn request_options(&mut self) -> &mut crate::RequestOptions {
16056            &mut self.0.options
16057        }
16058    }
16059
16060    /// The request builder for [NetworkSecurity::list_gateway_security_policies][crate::client::NetworkSecurity::list_gateway_security_policies] calls.
16061    ///
16062    /// # Example
16063    /// ```
16064    /// # use google_cloud_networksecurity_v1::builder::network_security::ListGatewaySecurityPolicies;
16065    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16066    /// use google_cloud_gax::paginator::ItemPaginator;
16067    ///
16068    /// let builder = prepare_request_builder();
16069    /// let mut items = builder.by_item();
16070    /// while let Some(result) = items.next().await {
16071    ///   let item = result?;
16072    /// }
16073    /// # Ok(()) }
16074    ///
16075    /// fn prepare_request_builder() -> ListGatewaySecurityPolicies {
16076    ///   # panic!();
16077    ///   // ... details omitted ...
16078    /// }
16079    /// ```
16080    #[derive(Clone, Debug)]
16081    pub struct ListGatewaySecurityPolicies(
16082        RequestBuilder<crate::model::ListGatewaySecurityPoliciesRequest>,
16083    );
16084
16085    impl ListGatewaySecurityPolicies {
16086        pub(crate) fn new(
16087            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16088        ) -> Self {
16089            Self(RequestBuilder::new(stub))
16090        }
16091
16092        /// Sets the full request, replacing any prior values.
16093        pub fn with_request<V: Into<crate::model::ListGatewaySecurityPoliciesRequest>>(
16094            mut self,
16095            v: V,
16096        ) -> Self {
16097            self.0.request = v.into();
16098            self
16099        }
16100
16101        /// Sets all the options, replacing any prior values.
16102        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16103            self.0.options = v.into();
16104            self
16105        }
16106
16107        /// Sends the request.
16108        pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPoliciesResponse> {
16109            (*self.0.stub)
16110                .list_gateway_security_policies(self.0.request, self.0.options)
16111                .await
16112                .map(crate::Response::into_body)
16113        }
16114
16115        /// Streams each page in the collection.
16116        pub fn by_page(
16117            self,
16118        ) -> impl google_cloud_gax::paginator::Paginator<
16119            crate::model::ListGatewaySecurityPoliciesResponse,
16120            crate::Error,
16121        > {
16122            use std::clone::Clone;
16123            let token = self.0.request.page_token.clone();
16124            let execute = move |token: String| {
16125                let mut builder = self.clone();
16126                builder.0.request = builder.0.request.set_page_token(token);
16127                builder.send()
16128            };
16129            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16130        }
16131
16132        /// Streams each item in the collection.
16133        pub fn by_item(
16134            self,
16135        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16136            crate::model::ListGatewaySecurityPoliciesResponse,
16137            crate::Error,
16138        > {
16139            use google_cloud_gax::paginator::Paginator;
16140            self.by_page().items()
16141        }
16142
16143        /// Sets the value of [parent][crate::model::ListGatewaySecurityPoliciesRequest::parent].
16144        ///
16145        /// This is a **required** field for requests.
16146        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16147            self.0.request.parent = v.into();
16148            self
16149        }
16150
16151        /// Sets the value of [page_size][crate::model::ListGatewaySecurityPoliciesRequest::page_size].
16152        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16153            self.0.request.page_size = v.into();
16154            self
16155        }
16156
16157        /// Sets the value of [page_token][crate::model::ListGatewaySecurityPoliciesRequest::page_token].
16158        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16159            self.0.request.page_token = v.into();
16160            self
16161        }
16162    }
16163
16164    #[doc(hidden)]
16165    impl crate::RequestBuilder for ListGatewaySecurityPolicies {
16166        fn request_options(&mut self) -> &mut crate::RequestOptions {
16167            &mut self.0.options
16168        }
16169    }
16170
16171    /// The request builder for [NetworkSecurity::get_gateway_security_policy][crate::client::NetworkSecurity::get_gateway_security_policy] calls.
16172    ///
16173    /// # Example
16174    /// ```
16175    /// # use google_cloud_networksecurity_v1::builder::network_security::GetGatewaySecurityPolicy;
16176    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16177    ///
16178    /// let builder = prepare_request_builder();
16179    /// let response = builder.send().await?;
16180    /// # Ok(()) }
16181    ///
16182    /// fn prepare_request_builder() -> GetGatewaySecurityPolicy {
16183    ///   # panic!();
16184    ///   // ... details omitted ...
16185    /// }
16186    /// ```
16187    #[derive(Clone, Debug)]
16188    pub struct GetGatewaySecurityPolicy(
16189        RequestBuilder<crate::model::GetGatewaySecurityPolicyRequest>,
16190    );
16191
16192    impl GetGatewaySecurityPolicy {
16193        pub(crate) fn new(
16194            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16195        ) -> Self {
16196            Self(RequestBuilder::new(stub))
16197        }
16198
16199        /// Sets the full request, replacing any prior values.
16200        pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRequest>>(
16201            mut self,
16202            v: V,
16203        ) -> Self {
16204            self.0.request = v.into();
16205            self
16206        }
16207
16208        /// Sets all the options, replacing any prior values.
16209        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16210            self.0.options = v.into();
16211            self
16212        }
16213
16214        /// Sends the request.
16215        pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicy> {
16216            (*self.0.stub)
16217                .get_gateway_security_policy(self.0.request, self.0.options)
16218                .await
16219                .map(crate::Response::into_body)
16220        }
16221
16222        /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRequest::name].
16223        ///
16224        /// This is a **required** field for requests.
16225        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16226            self.0.request.name = v.into();
16227            self
16228        }
16229    }
16230
16231    #[doc(hidden)]
16232    impl crate::RequestBuilder for GetGatewaySecurityPolicy {
16233        fn request_options(&mut self) -> &mut crate::RequestOptions {
16234            &mut self.0.options
16235        }
16236    }
16237
16238    /// The request builder for [NetworkSecurity::create_gateway_security_policy][crate::client::NetworkSecurity::create_gateway_security_policy] calls.
16239    ///
16240    /// # Example
16241    /// ```
16242    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateGatewaySecurityPolicy;
16243    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16244    /// use google_cloud_lro::Poller;
16245    ///
16246    /// let builder = prepare_request_builder();
16247    /// let response = builder.poller().until_done().await?;
16248    /// # Ok(()) }
16249    ///
16250    /// fn prepare_request_builder() -> CreateGatewaySecurityPolicy {
16251    ///   # panic!();
16252    ///   // ... details omitted ...
16253    /// }
16254    /// ```
16255    #[derive(Clone, Debug)]
16256    pub struct CreateGatewaySecurityPolicy(
16257        RequestBuilder<crate::model::CreateGatewaySecurityPolicyRequest>,
16258    );
16259
16260    impl CreateGatewaySecurityPolicy {
16261        pub(crate) fn new(
16262            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16263        ) -> Self {
16264            Self(RequestBuilder::new(stub))
16265        }
16266
16267        /// Sets the full request, replacing any prior values.
16268        pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRequest>>(
16269            mut self,
16270            v: V,
16271        ) -> Self {
16272            self.0.request = v.into();
16273            self
16274        }
16275
16276        /// Sets all the options, replacing any prior values.
16277        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16278            self.0.options = v.into();
16279            self
16280        }
16281
16282        /// Sends the request.
16283        ///
16284        /// # Long running operations
16285        ///
16286        /// This starts, but does not poll, a longrunning operation. More information
16287        /// on [create_gateway_security_policy][crate::client::NetworkSecurity::create_gateway_security_policy].
16288        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16289            (*self.0.stub)
16290                .create_gateway_security_policy(self.0.request, self.0.options)
16291                .await
16292                .map(crate::Response::into_body)
16293        }
16294
16295        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_gateway_security_policy`.
16296        pub fn poller(
16297            self,
16298        ) -> impl google_cloud_lro::Poller<
16299            crate::model::GatewaySecurityPolicy,
16300            crate::model::OperationMetadata,
16301        > {
16302            type Operation = google_cloud_lro::internal::Operation<
16303                crate::model::GatewaySecurityPolicy,
16304                crate::model::OperationMetadata,
16305            >;
16306            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16307            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16308
16309            let stub = self.0.stub.clone();
16310            let mut options = self.0.options.clone();
16311            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16312            let query = move |name| {
16313                let stub = stub.clone();
16314                let options = options.clone();
16315                async {
16316                    let op = GetOperation::new(stub)
16317                        .set_name(name)
16318                        .with_options(options)
16319                        .send()
16320                        .await?;
16321                    Ok(Operation::new(op))
16322                }
16323            };
16324
16325            let start = move || async {
16326                let op = self.send().await?;
16327                Ok(Operation::new(op))
16328            };
16329
16330            google_cloud_lro::internal::new_poller(
16331                polling_error_policy,
16332                polling_backoff_policy,
16333                start,
16334                query,
16335            )
16336        }
16337
16338        /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRequest::parent].
16339        ///
16340        /// This is a **required** field for requests.
16341        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16342            self.0.request.parent = v.into();
16343            self
16344        }
16345
16346        /// Sets the value of [gateway_security_policy_id][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy_id].
16347        ///
16348        /// This is a **required** field for requests.
16349        pub fn set_gateway_security_policy_id<T: Into<std::string::String>>(
16350            mut self,
16351            v: T,
16352        ) -> Self {
16353            self.0.request.gateway_security_policy_id = v.into();
16354            self
16355        }
16356
16357        /// Sets the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
16358        ///
16359        /// This is a **required** field for requests.
16360        pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
16361        where
16362            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16363        {
16364            self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
16365            self
16366        }
16367
16368        /// Sets or clears the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
16369        ///
16370        /// This is a **required** field for requests.
16371        pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
16372        where
16373            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16374        {
16375            self.0.request.gateway_security_policy = v.map(|x| x.into());
16376            self
16377        }
16378    }
16379
16380    #[doc(hidden)]
16381    impl crate::RequestBuilder for CreateGatewaySecurityPolicy {
16382        fn request_options(&mut self) -> &mut crate::RequestOptions {
16383            &mut self.0.options
16384        }
16385    }
16386
16387    /// The request builder for [NetworkSecurity::update_gateway_security_policy][crate::client::NetworkSecurity::update_gateway_security_policy] calls.
16388    ///
16389    /// # Example
16390    /// ```
16391    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateGatewaySecurityPolicy;
16392    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16393    /// use google_cloud_lro::Poller;
16394    ///
16395    /// let builder = prepare_request_builder();
16396    /// let response = builder.poller().until_done().await?;
16397    /// # Ok(()) }
16398    ///
16399    /// fn prepare_request_builder() -> UpdateGatewaySecurityPolicy {
16400    ///   # panic!();
16401    ///   // ... details omitted ...
16402    /// }
16403    /// ```
16404    #[derive(Clone, Debug)]
16405    pub struct UpdateGatewaySecurityPolicy(
16406        RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRequest>,
16407    );
16408
16409    impl UpdateGatewaySecurityPolicy {
16410        pub(crate) fn new(
16411            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16412        ) -> Self {
16413            Self(RequestBuilder::new(stub))
16414        }
16415
16416        /// Sets the full request, replacing any prior values.
16417        pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRequest>>(
16418            mut self,
16419            v: V,
16420        ) -> Self {
16421            self.0.request = v.into();
16422            self
16423        }
16424
16425        /// Sets all the options, replacing any prior values.
16426        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16427            self.0.options = v.into();
16428            self
16429        }
16430
16431        /// Sends the request.
16432        ///
16433        /// # Long running operations
16434        ///
16435        /// This starts, but does not poll, a longrunning operation. More information
16436        /// on [update_gateway_security_policy][crate::client::NetworkSecurity::update_gateway_security_policy].
16437        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16438            (*self.0.stub)
16439                .update_gateway_security_policy(self.0.request, self.0.options)
16440                .await
16441                .map(crate::Response::into_body)
16442        }
16443
16444        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_gateway_security_policy`.
16445        pub fn poller(
16446            self,
16447        ) -> impl google_cloud_lro::Poller<
16448            crate::model::GatewaySecurityPolicy,
16449            crate::model::OperationMetadata,
16450        > {
16451            type Operation = google_cloud_lro::internal::Operation<
16452                crate::model::GatewaySecurityPolicy,
16453                crate::model::OperationMetadata,
16454            >;
16455            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16456            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16457
16458            let stub = self.0.stub.clone();
16459            let mut options = self.0.options.clone();
16460            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16461            let query = move |name| {
16462                let stub = stub.clone();
16463                let options = options.clone();
16464                async {
16465                    let op = GetOperation::new(stub)
16466                        .set_name(name)
16467                        .with_options(options)
16468                        .send()
16469                        .await?;
16470                    Ok(Operation::new(op))
16471                }
16472            };
16473
16474            let start = move || async {
16475                let op = self.send().await?;
16476                Ok(Operation::new(op))
16477            };
16478
16479            google_cloud_lro::internal::new_poller(
16480                polling_error_policy,
16481                polling_backoff_policy,
16482                start,
16483                query,
16484            )
16485        }
16486
16487        /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
16488        pub fn set_update_mask<T>(mut self, v: T) -> Self
16489        where
16490            T: std::convert::Into<wkt::FieldMask>,
16491        {
16492            self.0.request.update_mask = std::option::Option::Some(v.into());
16493            self
16494        }
16495
16496        /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
16497        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16498        where
16499            T: std::convert::Into<wkt::FieldMask>,
16500        {
16501            self.0.request.update_mask = v.map(|x| x.into());
16502            self
16503        }
16504
16505        /// Sets the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
16506        ///
16507        /// This is a **required** field for requests.
16508        pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
16509        where
16510            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16511        {
16512            self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
16513            self
16514        }
16515
16516        /// Sets or clears the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
16517        ///
16518        /// This is a **required** field for requests.
16519        pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
16520        where
16521            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16522        {
16523            self.0.request.gateway_security_policy = v.map(|x| x.into());
16524            self
16525        }
16526    }
16527
16528    #[doc(hidden)]
16529    impl crate::RequestBuilder for UpdateGatewaySecurityPolicy {
16530        fn request_options(&mut self) -> &mut crate::RequestOptions {
16531            &mut self.0.options
16532        }
16533    }
16534
16535    /// The request builder for [NetworkSecurity::delete_gateway_security_policy][crate::client::NetworkSecurity::delete_gateway_security_policy] calls.
16536    ///
16537    /// # Example
16538    /// ```
16539    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteGatewaySecurityPolicy;
16540    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16541    /// use google_cloud_lro::Poller;
16542    ///
16543    /// let builder = prepare_request_builder();
16544    /// let response = builder.poller().until_done().await?;
16545    /// # Ok(()) }
16546    ///
16547    /// fn prepare_request_builder() -> DeleteGatewaySecurityPolicy {
16548    ///   # panic!();
16549    ///   // ... details omitted ...
16550    /// }
16551    /// ```
16552    #[derive(Clone, Debug)]
16553    pub struct DeleteGatewaySecurityPolicy(
16554        RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRequest>,
16555    );
16556
16557    impl DeleteGatewaySecurityPolicy {
16558        pub(crate) fn new(
16559            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16560        ) -> Self {
16561            Self(RequestBuilder::new(stub))
16562        }
16563
16564        /// Sets the full request, replacing any prior values.
16565        pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRequest>>(
16566            mut self,
16567            v: V,
16568        ) -> Self {
16569            self.0.request = v.into();
16570            self
16571        }
16572
16573        /// Sets all the options, replacing any prior values.
16574        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16575            self.0.options = v.into();
16576            self
16577        }
16578
16579        /// Sends the request.
16580        ///
16581        /// # Long running operations
16582        ///
16583        /// This starts, but does not poll, a longrunning operation. More information
16584        /// on [delete_gateway_security_policy][crate::client::NetworkSecurity::delete_gateway_security_policy].
16585        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16586            (*self.0.stub)
16587                .delete_gateway_security_policy(self.0.request, self.0.options)
16588                .await
16589                .map(crate::Response::into_body)
16590        }
16591
16592        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_gateway_security_policy`.
16593        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16594            type Operation =
16595                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16596            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16597            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16598
16599            let stub = self.0.stub.clone();
16600            let mut options = self.0.options.clone();
16601            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16602            let query = move |name| {
16603                let stub = stub.clone();
16604                let options = options.clone();
16605                async {
16606                    let op = GetOperation::new(stub)
16607                        .set_name(name)
16608                        .with_options(options)
16609                        .send()
16610                        .await?;
16611                    Ok(Operation::new(op))
16612                }
16613            };
16614
16615            let start = move || async {
16616                let op = self.send().await?;
16617                Ok(Operation::new(op))
16618            };
16619
16620            google_cloud_lro::internal::new_unit_response_poller(
16621                polling_error_policy,
16622                polling_backoff_policy,
16623                start,
16624                query,
16625            )
16626        }
16627
16628        /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRequest::name].
16629        ///
16630        /// This is a **required** field for requests.
16631        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16632            self.0.request.name = v.into();
16633            self
16634        }
16635    }
16636
16637    #[doc(hidden)]
16638    impl crate::RequestBuilder for DeleteGatewaySecurityPolicy {
16639        fn request_options(&mut self) -> &mut crate::RequestOptions {
16640            &mut self.0.options
16641        }
16642    }
16643
16644    /// The request builder for [NetworkSecurity::list_gateway_security_policy_rules][crate::client::NetworkSecurity::list_gateway_security_policy_rules] calls.
16645    ///
16646    /// # Example
16647    /// ```
16648    /// # use google_cloud_networksecurity_v1::builder::network_security::ListGatewaySecurityPolicyRules;
16649    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16650    /// use google_cloud_gax::paginator::ItemPaginator;
16651    ///
16652    /// let builder = prepare_request_builder();
16653    /// let mut items = builder.by_item();
16654    /// while let Some(result) = items.next().await {
16655    ///   let item = result?;
16656    /// }
16657    /// # Ok(()) }
16658    ///
16659    /// fn prepare_request_builder() -> ListGatewaySecurityPolicyRules {
16660    ///   # panic!();
16661    ///   // ... details omitted ...
16662    /// }
16663    /// ```
16664    #[derive(Clone, Debug)]
16665    pub struct ListGatewaySecurityPolicyRules(
16666        RequestBuilder<crate::model::ListGatewaySecurityPolicyRulesRequest>,
16667    );
16668
16669    impl ListGatewaySecurityPolicyRules {
16670        pub(crate) fn new(
16671            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16672        ) -> Self {
16673            Self(RequestBuilder::new(stub))
16674        }
16675
16676        /// Sets the full request, replacing any prior values.
16677        pub fn with_request<V: Into<crate::model::ListGatewaySecurityPolicyRulesRequest>>(
16678            mut self,
16679            v: V,
16680        ) -> Self {
16681            self.0.request = v.into();
16682            self
16683        }
16684
16685        /// Sets all the options, replacing any prior values.
16686        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16687            self.0.options = v.into();
16688            self
16689        }
16690
16691        /// Sends the request.
16692        pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPolicyRulesResponse> {
16693            (*self.0.stub)
16694                .list_gateway_security_policy_rules(self.0.request, self.0.options)
16695                .await
16696                .map(crate::Response::into_body)
16697        }
16698
16699        /// Streams each page in the collection.
16700        pub fn by_page(
16701            self,
16702        ) -> impl google_cloud_gax::paginator::Paginator<
16703            crate::model::ListGatewaySecurityPolicyRulesResponse,
16704            crate::Error,
16705        > {
16706            use std::clone::Clone;
16707            let token = self.0.request.page_token.clone();
16708            let execute = move |token: String| {
16709                let mut builder = self.clone();
16710                builder.0.request = builder.0.request.set_page_token(token);
16711                builder.send()
16712            };
16713            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16714        }
16715
16716        /// Streams each item in the collection.
16717        pub fn by_item(
16718            self,
16719        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16720            crate::model::ListGatewaySecurityPolicyRulesResponse,
16721            crate::Error,
16722        > {
16723            use google_cloud_gax::paginator::Paginator;
16724            self.by_page().items()
16725        }
16726
16727        /// Sets the value of [parent][crate::model::ListGatewaySecurityPolicyRulesRequest::parent].
16728        ///
16729        /// This is a **required** field for requests.
16730        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16731            self.0.request.parent = v.into();
16732            self
16733        }
16734
16735        /// Sets the value of [page_size][crate::model::ListGatewaySecurityPolicyRulesRequest::page_size].
16736        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16737            self.0.request.page_size = v.into();
16738            self
16739        }
16740
16741        /// Sets the value of [page_token][crate::model::ListGatewaySecurityPolicyRulesRequest::page_token].
16742        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16743            self.0.request.page_token = v.into();
16744            self
16745        }
16746    }
16747
16748    #[doc(hidden)]
16749    impl crate::RequestBuilder for ListGatewaySecurityPolicyRules {
16750        fn request_options(&mut self) -> &mut crate::RequestOptions {
16751            &mut self.0.options
16752        }
16753    }
16754
16755    /// The request builder for [NetworkSecurity::get_gateway_security_policy_rule][crate::client::NetworkSecurity::get_gateway_security_policy_rule] calls.
16756    ///
16757    /// # Example
16758    /// ```
16759    /// # use google_cloud_networksecurity_v1::builder::network_security::GetGatewaySecurityPolicyRule;
16760    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16761    ///
16762    /// let builder = prepare_request_builder();
16763    /// let response = builder.send().await?;
16764    /// # Ok(()) }
16765    ///
16766    /// fn prepare_request_builder() -> GetGatewaySecurityPolicyRule {
16767    ///   # panic!();
16768    ///   // ... details omitted ...
16769    /// }
16770    /// ```
16771    #[derive(Clone, Debug)]
16772    pub struct GetGatewaySecurityPolicyRule(
16773        RequestBuilder<crate::model::GetGatewaySecurityPolicyRuleRequest>,
16774    );
16775
16776    impl GetGatewaySecurityPolicyRule {
16777        pub(crate) fn new(
16778            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16779        ) -> Self {
16780            Self(RequestBuilder::new(stub))
16781        }
16782
16783        /// Sets the full request, replacing any prior values.
16784        pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRuleRequest>>(
16785            mut self,
16786            v: V,
16787        ) -> Self {
16788            self.0.request = v.into();
16789            self
16790        }
16791
16792        /// Sets all the options, replacing any prior values.
16793        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16794            self.0.options = v.into();
16795            self
16796        }
16797
16798        /// Sends the request.
16799        pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicyRule> {
16800            (*self.0.stub)
16801                .get_gateway_security_policy_rule(self.0.request, self.0.options)
16802                .await
16803                .map(crate::Response::into_body)
16804        }
16805
16806        /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRuleRequest::name].
16807        ///
16808        /// This is a **required** field for requests.
16809        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16810            self.0.request.name = v.into();
16811            self
16812        }
16813    }
16814
16815    #[doc(hidden)]
16816    impl crate::RequestBuilder for GetGatewaySecurityPolicyRule {
16817        fn request_options(&mut self) -> &mut crate::RequestOptions {
16818            &mut self.0.options
16819        }
16820    }
16821
16822    /// The request builder for [NetworkSecurity::create_gateway_security_policy_rule][crate::client::NetworkSecurity::create_gateway_security_policy_rule] calls.
16823    ///
16824    /// # Example
16825    /// ```
16826    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateGatewaySecurityPolicyRule;
16827    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16828    /// use google_cloud_lro::Poller;
16829    ///
16830    /// let builder = prepare_request_builder();
16831    /// let response = builder.poller().until_done().await?;
16832    /// # Ok(()) }
16833    ///
16834    /// fn prepare_request_builder() -> CreateGatewaySecurityPolicyRule {
16835    ///   # panic!();
16836    ///   // ... details omitted ...
16837    /// }
16838    /// ```
16839    #[derive(Clone, Debug)]
16840    pub struct CreateGatewaySecurityPolicyRule(
16841        RequestBuilder<crate::model::CreateGatewaySecurityPolicyRuleRequest>,
16842    );
16843
16844    impl CreateGatewaySecurityPolicyRule {
16845        pub(crate) fn new(
16846            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16847        ) -> Self {
16848            Self(RequestBuilder::new(stub))
16849        }
16850
16851        /// Sets the full request, replacing any prior values.
16852        pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRuleRequest>>(
16853            mut self,
16854            v: V,
16855        ) -> Self {
16856            self.0.request = v.into();
16857            self
16858        }
16859
16860        /// Sets all the options, replacing any prior values.
16861        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16862            self.0.options = v.into();
16863            self
16864        }
16865
16866        /// Sends the request.
16867        ///
16868        /// # Long running operations
16869        ///
16870        /// This starts, but does not poll, a longrunning operation. More information
16871        /// on [create_gateway_security_policy_rule][crate::client::NetworkSecurity::create_gateway_security_policy_rule].
16872        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16873            (*self.0.stub)
16874                .create_gateway_security_policy_rule(self.0.request, self.0.options)
16875                .await
16876                .map(crate::Response::into_body)
16877        }
16878
16879        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_gateway_security_policy_rule`.
16880        pub fn poller(
16881            self,
16882        ) -> impl google_cloud_lro::Poller<
16883            crate::model::GatewaySecurityPolicyRule,
16884            crate::model::OperationMetadata,
16885        > {
16886            type Operation = google_cloud_lro::internal::Operation<
16887                crate::model::GatewaySecurityPolicyRule,
16888                crate::model::OperationMetadata,
16889            >;
16890            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16891            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16892
16893            let stub = self.0.stub.clone();
16894            let mut options = self.0.options.clone();
16895            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16896            let query = move |name| {
16897                let stub = stub.clone();
16898                let options = options.clone();
16899                async {
16900                    let op = GetOperation::new(stub)
16901                        .set_name(name)
16902                        .with_options(options)
16903                        .send()
16904                        .await?;
16905                    Ok(Operation::new(op))
16906                }
16907            };
16908
16909            let start = move || async {
16910                let op = self.send().await?;
16911                Ok(Operation::new(op))
16912            };
16913
16914            google_cloud_lro::internal::new_poller(
16915                polling_error_policy,
16916                polling_backoff_policy,
16917                start,
16918                query,
16919            )
16920        }
16921
16922        /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRuleRequest::parent].
16923        ///
16924        /// This is a **required** field for requests.
16925        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16926            self.0.request.parent = v.into();
16927            self
16928        }
16929
16930        /// Sets the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
16931        ///
16932        /// This is a **required** field for requests.
16933        pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
16934        where
16935            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
16936        {
16937            self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
16938            self
16939        }
16940
16941        /// Sets or clears the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
16942        ///
16943        /// This is a **required** field for requests.
16944        pub fn set_or_clear_gateway_security_policy_rule<T>(
16945            mut self,
16946            v: std::option::Option<T>,
16947        ) -> Self
16948        where
16949            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
16950        {
16951            self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
16952            self
16953        }
16954
16955        /// Sets the value of [gateway_security_policy_rule_id][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule_id].
16956        pub fn set_gateway_security_policy_rule_id<T: Into<std::string::String>>(
16957            mut self,
16958            v: T,
16959        ) -> Self {
16960            self.0.request.gateway_security_policy_rule_id = v.into();
16961            self
16962        }
16963    }
16964
16965    #[doc(hidden)]
16966    impl crate::RequestBuilder for CreateGatewaySecurityPolicyRule {
16967        fn request_options(&mut self) -> &mut crate::RequestOptions {
16968            &mut self.0.options
16969        }
16970    }
16971
16972    /// The request builder for [NetworkSecurity::update_gateway_security_policy_rule][crate::client::NetworkSecurity::update_gateway_security_policy_rule] calls.
16973    ///
16974    /// # Example
16975    /// ```
16976    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateGatewaySecurityPolicyRule;
16977    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16978    /// use google_cloud_lro::Poller;
16979    ///
16980    /// let builder = prepare_request_builder();
16981    /// let response = builder.poller().until_done().await?;
16982    /// # Ok(()) }
16983    ///
16984    /// fn prepare_request_builder() -> UpdateGatewaySecurityPolicyRule {
16985    ///   # panic!();
16986    ///   // ... details omitted ...
16987    /// }
16988    /// ```
16989    #[derive(Clone, Debug)]
16990    pub struct UpdateGatewaySecurityPolicyRule(
16991        RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRuleRequest>,
16992    );
16993
16994    impl UpdateGatewaySecurityPolicyRule {
16995        pub(crate) fn new(
16996            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16997        ) -> Self {
16998            Self(RequestBuilder::new(stub))
16999        }
17000
17001        /// Sets the full request, replacing any prior values.
17002        pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRuleRequest>>(
17003            mut self,
17004            v: V,
17005        ) -> Self {
17006            self.0.request = v.into();
17007            self
17008        }
17009
17010        /// Sets all the options, replacing any prior values.
17011        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17012            self.0.options = v.into();
17013            self
17014        }
17015
17016        /// Sends the request.
17017        ///
17018        /// # Long running operations
17019        ///
17020        /// This starts, but does not poll, a longrunning operation. More information
17021        /// on [update_gateway_security_policy_rule][crate::client::NetworkSecurity::update_gateway_security_policy_rule].
17022        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17023            (*self.0.stub)
17024                .update_gateway_security_policy_rule(self.0.request, self.0.options)
17025                .await
17026                .map(crate::Response::into_body)
17027        }
17028
17029        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_gateway_security_policy_rule`.
17030        pub fn poller(
17031            self,
17032        ) -> impl google_cloud_lro::Poller<
17033            crate::model::GatewaySecurityPolicyRule,
17034            crate::model::OperationMetadata,
17035        > {
17036            type Operation = google_cloud_lro::internal::Operation<
17037                crate::model::GatewaySecurityPolicyRule,
17038                crate::model::OperationMetadata,
17039            >;
17040            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17041            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17042
17043            let stub = self.0.stub.clone();
17044            let mut options = self.0.options.clone();
17045            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17046            let query = move |name| {
17047                let stub = stub.clone();
17048                let options = options.clone();
17049                async {
17050                    let op = GetOperation::new(stub)
17051                        .set_name(name)
17052                        .with_options(options)
17053                        .send()
17054                        .await?;
17055                    Ok(Operation::new(op))
17056                }
17057            };
17058
17059            let start = move || async {
17060                let op = self.send().await?;
17061                Ok(Operation::new(op))
17062            };
17063
17064            google_cloud_lro::internal::new_poller(
17065                polling_error_policy,
17066                polling_backoff_policy,
17067                start,
17068                query,
17069            )
17070        }
17071
17072        /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
17073        pub fn set_update_mask<T>(mut self, v: T) -> Self
17074        where
17075            T: std::convert::Into<wkt::FieldMask>,
17076        {
17077            self.0.request.update_mask = std::option::Option::Some(v.into());
17078            self
17079        }
17080
17081        /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
17082        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17083        where
17084            T: std::convert::Into<wkt::FieldMask>,
17085        {
17086            self.0.request.update_mask = v.map(|x| x.into());
17087            self
17088        }
17089
17090        /// Sets the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
17091        ///
17092        /// This is a **required** field for requests.
17093        pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
17094        where
17095            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17096        {
17097            self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
17098            self
17099        }
17100
17101        /// Sets or clears the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
17102        ///
17103        /// This is a **required** field for requests.
17104        pub fn set_or_clear_gateway_security_policy_rule<T>(
17105            mut self,
17106            v: std::option::Option<T>,
17107        ) -> Self
17108        where
17109            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17110        {
17111            self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
17112            self
17113        }
17114    }
17115
17116    #[doc(hidden)]
17117    impl crate::RequestBuilder for UpdateGatewaySecurityPolicyRule {
17118        fn request_options(&mut self) -> &mut crate::RequestOptions {
17119            &mut self.0.options
17120        }
17121    }
17122
17123    /// The request builder for [NetworkSecurity::delete_gateway_security_policy_rule][crate::client::NetworkSecurity::delete_gateway_security_policy_rule] calls.
17124    ///
17125    /// # Example
17126    /// ```
17127    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteGatewaySecurityPolicyRule;
17128    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17129    /// use google_cloud_lro::Poller;
17130    ///
17131    /// let builder = prepare_request_builder();
17132    /// let response = builder.poller().until_done().await?;
17133    /// # Ok(()) }
17134    ///
17135    /// fn prepare_request_builder() -> DeleteGatewaySecurityPolicyRule {
17136    ///   # panic!();
17137    ///   // ... details omitted ...
17138    /// }
17139    /// ```
17140    #[derive(Clone, Debug)]
17141    pub struct DeleteGatewaySecurityPolicyRule(
17142        RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRuleRequest>,
17143    );
17144
17145    impl DeleteGatewaySecurityPolicyRule {
17146        pub(crate) fn new(
17147            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17148        ) -> Self {
17149            Self(RequestBuilder::new(stub))
17150        }
17151
17152        /// Sets the full request, replacing any prior values.
17153        pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRuleRequest>>(
17154            mut self,
17155            v: V,
17156        ) -> Self {
17157            self.0.request = v.into();
17158            self
17159        }
17160
17161        /// Sets all the options, replacing any prior values.
17162        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17163            self.0.options = v.into();
17164            self
17165        }
17166
17167        /// Sends the request.
17168        ///
17169        /// # Long running operations
17170        ///
17171        /// This starts, but does not poll, a longrunning operation. More information
17172        /// on [delete_gateway_security_policy_rule][crate::client::NetworkSecurity::delete_gateway_security_policy_rule].
17173        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17174            (*self.0.stub)
17175                .delete_gateway_security_policy_rule(self.0.request, self.0.options)
17176                .await
17177                .map(crate::Response::into_body)
17178        }
17179
17180        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_gateway_security_policy_rule`.
17181        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17182            type Operation =
17183                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17184            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17185            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17186
17187            let stub = self.0.stub.clone();
17188            let mut options = self.0.options.clone();
17189            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17190            let query = move |name| {
17191                let stub = stub.clone();
17192                let options = options.clone();
17193                async {
17194                    let op = GetOperation::new(stub)
17195                        .set_name(name)
17196                        .with_options(options)
17197                        .send()
17198                        .await?;
17199                    Ok(Operation::new(op))
17200                }
17201            };
17202
17203            let start = move || async {
17204                let op = self.send().await?;
17205                Ok(Operation::new(op))
17206            };
17207
17208            google_cloud_lro::internal::new_unit_response_poller(
17209                polling_error_policy,
17210                polling_backoff_policy,
17211                start,
17212                query,
17213            )
17214        }
17215
17216        /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRuleRequest::name].
17217        ///
17218        /// This is a **required** field for requests.
17219        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17220            self.0.request.name = v.into();
17221            self
17222        }
17223    }
17224
17225    #[doc(hidden)]
17226    impl crate::RequestBuilder for DeleteGatewaySecurityPolicyRule {
17227        fn request_options(&mut self) -> &mut crate::RequestOptions {
17228            &mut self.0.options
17229        }
17230    }
17231
17232    /// The request builder for [NetworkSecurity::list_url_lists][crate::client::NetworkSecurity::list_url_lists] calls.
17233    ///
17234    /// # Example
17235    /// ```
17236    /// # use google_cloud_networksecurity_v1::builder::network_security::ListUrlLists;
17237    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17238    /// use google_cloud_gax::paginator::ItemPaginator;
17239    ///
17240    /// let builder = prepare_request_builder();
17241    /// let mut items = builder.by_item();
17242    /// while let Some(result) = items.next().await {
17243    ///   let item = result?;
17244    /// }
17245    /// # Ok(()) }
17246    ///
17247    /// fn prepare_request_builder() -> ListUrlLists {
17248    ///   # panic!();
17249    ///   // ... details omitted ...
17250    /// }
17251    /// ```
17252    #[derive(Clone, Debug)]
17253    pub struct ListUrlLists(RequestBuilder<crate::model::ListUrlListsRequest>);
17254
17255    impl ListUrlLists {
17256        pub(crate) fn new(
17257            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17258        ) -> Self {
17259            Self(RequestBuilder::new(stub))
17260        }
17261
17262        /// Sets the full request, replacing any prior values.
17263        pub fn with_request<V: Into<crate::model::ListUrlListsRequest>>(mut self, v: V) -> Self {
17264            self.0.request = v.into();
17265            self
17266        }
17267
17268        /// Sets all the options, replacing any prior values.
17269        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17270            self.0.options = v.into();
17271            self
17272        }
17273
17274        /// Sends the request.
17275        pub async fn send(self) -> Result<crate::model::ListUrlListsResponse> {
17276            (*self.0.stub)
17277                .list_url_lists(self.0.request, self.0.options)
17278                .await
17279                .map(crate::Response::into_body)
17280        }
17281
17282        /// Streams each page in the collection.
17283        pub fn by_page(
17284            self,
17285        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListUrlListsResponse, crate::Error>
17286        {
17287            use std::clone::Clone;
17288            let token = self.0.request.page_token.clone();
17289            let execute = move |token: String| {
17290                let mut builder = self.clone();
17291                builder.0.request = builder.0.request.set_page_token(token);
17292                builder.send()
17293            };
17294            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17295        }
17296
17297        /// Streams each item in the collection.
17298        pub fn by_item(
17299            self,
17300        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17301            crate::model::ListUrlListsResponse,
17302            crate::Error,
17303        > {
17304            use google_cloud_gax::paginator::Paginator;
17305            self.by_page().items()
17306        }
17307
17308        /// Sets the value of [parent][crate::model::ListUrlListsRequest::parent].
17309        ///
17310        /// This is a **required** field for requests.
17311        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17312            self.0.request.parent = v.into();
17313            self
17314        }
17315
17316        /// Sets the value of [page_size][crate::model::ListUrlListsRequest::page_size].
17317        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17318            self.0.request.page_size = v.into();
17319            self
17320        }
17321
17322        /// Sets the value of [page_token][crate::model::ListUrlListsRequest::page_token].
17323        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17324            self.0.request.page_token = v.into();
17325            self
17326        }
17327    }
17328
17329    #[doc(hidden)]
17330    impl crate::RequestBuilder for ListUrlLists {
17331        fn request_options(&mut self) -> &mut crate::RequestOptions {
17332            &mut self.0.options
17333        }
17334    }
17335
17336    /// The request builder for [NetworkSecurity::get_url_list][crate::client::NetworkSecurity::get_url_list] calls.
17337    ///
17338    /// # Example
17339    /// ```
17340    /// # use google_cloud_networksecurity_v1::builder::network_security::GetUrlList;
17341    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17342    ///
17343    /// let builder = prepare_request_builder();
17344    /// let response = builder.send().await?;
17345    /// # Ok(()) }
17346    ///
17347    /// fn prepare_request_builder() -> GetUrlList {
17348    ///   # panic!();
17349    ///   // ... details omitted ...
17350    /// }
17351    /// ```
17352    #[derive(Clone, Debug)]
17353    pub struct GetUrlList(RequestBuilder<crate::model::GetUrlListRequest>);
17354
17355    impl GetUrlList {
17356        pub(crate) fn new(
17357            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17358        ) -> Self {
17359            Self(RequestBuilder::new(stub))
17360        }
17361
17362        /// Sets the full request, replacing any prior values.
17363        pub fn with_request<V: Into<crate::model::GetUrlListRequest>>(mut self, v: V) -> Self {
17364            self.0.request = v.into();
17365            self
17366        }
17367
17368        /// Sets all the options, replacing any prior values.
17369        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17370            self.0.options = v.into();
17371            self
17372        }
17373
17374        /// Sends the request.
17375        pub async fn send(self) -> Result<crate::model::UrlList> {
17376            (*self.0.stub)
17377                .get_url_list(self.0.request, self.0.options)
17378                .await
17379                .map(crate::Response::into_body)
17380        }
17381
17382        /// Sets the value of [name][crate::model::GetUrlListRequest::name].
17383        ///
17384        /// This is a **required** field for requests.
17385        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17386            self.0.request.name = v.into();
17387            self
17388        }
17389    }
17390
17391    #[doc(hidden)]
17392    impl crate::RequestBuilder for GetUrlList {
17393        fn request_options(&mut self) -> &mut crate::RequestOptions {
17394            &mut self.0.options
17395        }
17396    }
17397
17398    /// The request builder for [NetworkSecurity::create_url_list][crate::client::NetworkSecurity::create_url_list] calls.
17399    ///
17400    /// # Example
17401    /// ```
17402    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateUrlList;
17403    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17404    /// use google_cloud_lro::Poller;
17405    ///
17406    /// let builder = prepare_request_builder();
17407    /// let response = builder.poller().until_done().await?;
17408    /// # Ok(()) }
17409    ///
17410    /// fn prepare_request_builder() -> CreateUrlList {
17411    ///   # panic!();
17412    ///   // ... details omitted ...
17413    /// }
17414    /// ```
17415    #[derive(Clone, Debug)]
17416    pub struct CreateUrlList(RequestBuilder<crate::model::CreateUrlListRequest>);
17417
17418    impl CreateUrlList {
17419        pub(crate) fn new(
17420            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17421        ) -> Self {
17422            Self(RequestBuilder::new(stub))
17423        }
17424
17425        /// Sets the full request, replacing any prior values.
17426        pub fn with_request<V: Into<crate::model::CreateUrlListRequest>>(mut self, v: V) -> Self {
17427            self.0.request = v.into();
17428            self
17429        }
17430
17431        /// Sets all the options, replacing any prior values.
17432        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17433            self.0.options = v.into();
17434            self
17435        }
17436
17437        /// Sends the request.
17438        ///
17439        /// # Long running operations
17440        ///
17441        /// This starts, but does not poll, a longrunning operation. More information
17442        /// on [create_url_list][crate::client::NetworkSecurity::create_url_list].
17443        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17444            (*self.0.stub)
17445                .create_url_list(self.0.request, self.0.options)
17446                .await
17447                .map(crate::Response::into_body)
17448        }
17449
17450        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_url_list`.
17451        pub fn poller(
17452            self,
17453        ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
17454        {
17455            type Operation = google_cloud_lro::internal::Operation<
17456                crate::model::UrlList,
17457                crate::model::OperationMetadata,
17458            >;
17459            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17460            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17461
17462            let stub = self.0.stub.clone();
17463            let mut options = self.0.options.clone();
17464            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17465            let query = move |name| {
17466                let stub = stub.clone();
17467                let options = options.clone();
17468                async {
17469                    let op = GetOperation::new(stub)
17470                        .set_name(name)
17471                        .with_options(options)
17472                        .send()
17473                        .await?;
17474                    Ok(Operation::new(op))
17475                }
17476            };
17477
17478            let start = move || async {
17479                let op = self.send().await?;
17480                Ok(Operation::new(op))
17481            };
17482
17483            google_cloud_lro::internal::new_poller(
17484                polling_error_policy,
17485                polling_backoff_policy,
17486                start,
17487                query,
17488            )
17489        }
17490
17491        /// Sets the value of [parent][crate::model::CreateUrlListRequest::parent].
17492        ///
17493        /// This is a **required** field for requests.
17494        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17495            self.0.request.parent = v.into();
17496            self
17497        }
17498
17499        /// Sets the value of [url_list_id][crate::model::CreateUrlListRequest::url_list_id].
17500        ///
17501        /// This is a **required** field for requests.
17502        pub fn set_url_list_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
17503            self.0.request.url_list_id = v.into();
17504            self
17505        }
17506
17507        /// Sets the value of [url_list][crate::model::CreateUrlListRequest::url_list].
17508        ///
17509        /// This is a **required** field for requests.
17510        pub fn set_url_list<T>(mut self, v: T) -> Self
17511        where
17512            T: std::convert::Into<crate::model::UrlList>,
17513        {
17514            self.0.request.url_list = std::option::Option::Some(v.into());
17515            self
17516        }
17517
17518        /// Sets or clears the value of [url_list][crate::model::CreateUrlListRequest::url_list].
17519        ///
17520        /// This is a **required** field for requests.
17521        pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
17522        where
17523            T: std::convert::Into<crate::model::UrlList>,
17524        {
17525            self.0.request.url_list = v.map(|x| x.into());
17526            self
17527        }
17528    }
17529
17530    #[doc(hidden)]
17531    impl crate::RequestBuilder for CreateUrlList {
17532        fn request_options(&mut self) -> &mut crate::RequestOptions {
17533            &mut self.0.options
17534        }
17535    }
17536
17537    /// The request builder for [NetworkSecurity::update_url_list][crate::client::NetworkSecurity::update_url_list] calls.
17538    ///
17539    /// # Example
17540    /// ```
17541    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateUrlList;
17542    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17543    /// use google_cloud_lro::Poller;
17544    ///
17545    /// let builder = prepare_request_builder();
17546    /// let response = builder.poller().until_done().await?;
17547    /// # Ok(()) }
17548    ///
17549    /// fn prepare_request_builder() -> UpdateUrlList {
17550    ///   # panic!();
17551    ///   // ... details omitted ...
17552    /// }
17553    /// ```
17554    #[derive(Clone, Debug)]
17555    pub struct UpdateUrlList(RequestBuilder<crate::model::UpdateUrlListRequest>);
17556
17557    impl UpdateUrlList {
17558        pub(crate) fn new(
17559            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17560        ) -> Self {
17561            Self(RequestBuilder::new(stub))
17562        }
17563
17564        /// Sets the full request, replacing any prior values.
17565        pub fn with_request<V: Into<crate::model::UpdateUrlListRequest>>(mut self, v: V) -> Self {
17566            self.0.request = v.into();
17567            self
17568        }
17569
17570        /// Sets all the options, replacing any prior values.
17571        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17572            self.0.options = v.into();
17573            self
17574        }
17575
17576        /// Sends the request.
17577        ///
17578        /// # Long running operations
17579        ///
17580        /// This starts, but does not poll, a longrunning operation. More information
17581        /// on [update_url_list][crate::client::NetworkSecurity::update_url_list].
17582        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17583            (*self.0.stub)
17584                .update_url_list(self.0.request, self.0.options)
17585                .await
17586                .map(crate::Response::into_body)
17587        }
17588
17589        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_url_list`.
17590        pub fn poller(
17591            self,
17592        ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
17593        {
17594            type Operation = google_cloud_lro::internal::Operation<
17595                crate::model::UrlList,
17596                crate::model::OperationMetadata,
17597            >;
17598            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17599            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17600
17601            let stub = self.0.stub.clone();
17602            let mut options = self.0.options.clone();
17603            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17604            let query = move |name| {
17605                let stub = stub.clone();
17606                let options = options.clone();
17607                async {
17608                    let op = GetOperation::new(stub)
17609                        .set_name(name)
17610                        .with_options(options)
17611                        .send()
17612                        .await?;
17613                    Ok(Operation::new(op))
17614                }
17615            };
17616
17617            let start = move || async {
17618                let op = self.send().await?;
17619                Ok(Operation::new(op))
17620            };
17621
17622            google_cloud_lro::internal::new_poller(
17623                polling_error_policy,
17624                polling_backoff_policy,
17625                start,
17626                query,
17627            )
17628        }
17629
17630        /// Sets the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
17631        pub fn set_update_mask<T>(mut self, v: T) -> Self
17632        where
17633            T: std::convert::Into<wkt::FieldMask>,
17634        {
17635            self.0.request.update_mask = std::option::Option::Some(v.into());
17636            self
17637        }
17638
17639        /// Sets or clears the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
17640        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17641        where
17642            T: std::convert::Into<wkt::FieldMask>,
17643        {
17644            self.0.request.update_mask = v.map(|x| x.into());
17645            self
17646        }
17647
17648        /// Sets the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
17649        ///
17650        /// This is a **required** field for requests.
17651        pub fn set_url_list<T>(mut self, v: T) -> Self
17652        where
17653            T: std::convert::Into<crate::model::UrlList>,
17654        {
17655            self.0.request.url_list = std::option::Option::Some(v.into());
17656            self
17657        }
17658
17659        /// Sets or clears the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
17660        ///
17661        /// This is a **required** field for requests.
17662        pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
17663        where
17664            T: std::convert::Into<crate::model::UrlList>,
17665        {
17666            self.0.request.url_list = v.map(|x| x.into());
17667            self
17668        }
17669    }
17670
17671    #[doc(hidden)]
17672    impl crate::RequestBuilder for UpdateUrlList {
17673        fn request_options(&mut self) -> &mut crate::RequestOptions {
17674            &mut self.0.options
17675        }
17676    }
17677
17678    /// The request builder for [NetworkSecurity::delete_url_list][crate::client::NetworkSecurity::delete_url_list] calls.
17679    ///
17680    /// # Example
17681    /// ```
17682    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteUrlList;
17683    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17684    /// use google_cloud_lro::Poller;
17685    ///
17686    /// let builder = prepare_request_builder();
17687    /// let response = builder.poller().until_done().await?;
17688    /// # Ok(()) }
17689    ///
17690    /// fn prepare_request_builder() -> DeleteUrlList {
17691    ///   # panic!();
17692    ///   // ... details omitted ...
17693    /// }
17694    /// ```
17695    #[derive(Clone, Debug)]
17696    pub struct DeleteUrlList(RequestBuilder<crate::model::DeleteUrlListRequest>);
17697
17698    impl DeleteUrlList {
17699        pub(crate) fn new(
17700            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17701        ) -> Self {
17702            Self(RequestBuilder::new(stub))
17703        }
17704
17705        /// Sets the full request, replacing any prior values.
17706        pub fn with_request<V: Into<crate::model::DeleteUrlListRequest>>(mut self, v: V) -> Self {
17707            self.0.request = v.into();
17708            self
17709        }
17710
17711        /// Sets all the options, replacing any prior values.
17712        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17713            self.0.options = v.into();
17714            self
17715        }
17716
17717        /// Sends the request.
17718        ///
17719        /// # Long running operations
17720        ///
17721        /// This starts, but does not poll, a longrunning operation. More information
17722        /// on [delete_url_list][crate::client::NetworkSecurity::delete_url_list].
17723        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17724            (*self.0.stub)
17725                .delete_url_list(self.0.request, self.0.options)
17726                .await
17727                .map(crate::Response::into_body)
17728        }
17729
17730        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_url_list`.
17731        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17732            type Operation =
17733                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17734            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17735            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17736
17737            let stub = self.0.stub.clone();
17738            let mut options = self.0.options.clone();
17739            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17740            let query = move |name| {
17741                let stub = stub.clone();
17742                let options = options.clone();
17743                async {
17744                    let op = GetOperation::new(stub)
17745                        .set_name(name)
17746                        .with_options(options)
17747                        .send()
17748                        .await?;
17749                    Ok(Operation::new(op))
17750                }
17751            };
17752
17753            let start = move || async {
17754                let op = self.send().await?;
17755                Ok(Operation::new(op))
17756            };
17757
17758            google_cloud_lro::internal::new_unit_response_poller(
17759                polling_error_policy,
17760                polling_backoff_policy,
17761                start,
17762                query,
17763            )
17764        }
17765
17766        /// Sets the value of [name][crate::model::DeleteUrlListRequest::name].
17767        ///
17768        /// This is a **required** field for requests.
17769        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17770            self.0.request.name = v.into();
17771            self
17772        }
17773    }
17774
17775    #[doc(hidden)]
17776    impl crate::RequestBuilder for DeleteUrlList {
17777        fn request_options(&mut self) -> &mut crate::RequestOptions {
17778            &mut self.0.options
17779        }
17780    }
17781
17782    /// The request builder for [NetworkSecurity::list_tls_inspection_policies][crate::client::NetworkSecurity::list_tls_inspection_policies] calls.
17783    ///
17784    /// # Example
17785    /// ```
17786    /// # use google_cloud_networksecurity_v1::builder::network_security::ListTlsInspectionPolicies;
17787    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17788    /// use google_cloud_gax::paginator::ItemPaginator;
17789    ///
17790    /// let builder = prepare_request_builder();
17791    /// let mut items = builder.by_item();
17792    /// while let Some(result) = items.next().await {
17793    ///   let item = result?;
17794    /// }
17795    /// # Ok(()) }
17796    ///
17797    /// fn prepare_request_builder() -> ListTlsInspectionPolicies {
17798    ///   # panic!();
17799    ///   // ... details omitted ...
17800    /// }
17801    /// ```
17802    #[derive(Clone, Debug)]
17803    pub struct ListTlsInspectionPolicies(
17804        RequestBuilder<crate::model::ListTlsInspectionPoliciesRequest>,
17805    );
17806
17807    impl ListTlsInspectionPolicies {
17808        pub(crate) fn new(
17809            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17810        ) -> Self {
17811            Self(RequestBuilder::new(stub))
17812        }
17813
17814        /// Sets the full request, replacing any prior values.
17815        pub fn with_request<V: Into<crate::model::ListTlsInspectionPoliciesRequest>>(
17816            mut self,
17817            v: V,
17818        ) -> Self {
17819            self.0.request = v.into();
17820            self
17821        }
17822
17823        /// Sets all the options, replacing any prior values.
17824        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17825            self.0.options = v.into();
17826            self
17827        }
17828
17829        /// Sends the request.
17830        pub async fn send(self) -> Result<crate::model::ListTlsInspectionPoliciesResponse> {
17831            (*self.0.stub)
17832                .list_tls_inspection_policies(self.0.request, self.0.options)
17833                .await
17834                .map(crate::Response::into_body)
17835        }
17836
17837        /// Streams each page in the collection.
17838        pub fn by_page(
17839            self,
17840        ) -> impl google_cloud_gax::paginator::Paginator<
17841            crate::model::ListTlsInspectionPoliciesResponse,
17842            crate::Error,
17843        > {
17844            use std::clone::Clone;
17845            let token = self.0.request.page_token.clone();
17846            let execute = move |token: String| {
17847                let mut builder = self.clone();
17848                builder.0.request = builder.0.request.set_page_token(token);
17849                builder.send()
17850            };
17851            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17852        }
17853
17854        /// Streams each item in the collection.
17855        pub fn by_item(
17856            self,
17857        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17858            crate::model::ListTlsInspectionPoliciesResponse,
17859            crate::Error,
17860        > {
17861            use google_cloud_gax::paginator::Paginator;
17862            self.by_page().items()
17863        }
17864
17865        /// Sets the value of [parent][crate::model::ListTlsInspectionPoliciesRequest::parent].
17866        ///
17867        /// This is a **required** field for requests.
17868        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17869            self.0.request.parent = v.into();
17870            self
17871        }
17872
17873        /// Sets the value of [page_size][crate::model::ListTlsInspectionPoliciesRequest::page_size].
17874        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17875            self.0.request.page_size = v.into();
17876            self
17877        }
17878
17879        /// Sets the value of [page_token][crate::model::ListTlsInspectionPoliciesRequest::page_token].
17880        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17881            self.0.request.page_token = v.into();
17882            self
17883        }
17884    }
17885
17886    #[doc(hidden)]
17887    impl crate::RequestBuilder for ListTlsInspectionPolicies {
17888        fn request_options(&mut self) -> &mut crate::RequestOptions {
17889            &mut self.0.options
17890        }
17891    }
17892
17893    /// The request builder for [NetworkSecurity::get_tls_inspection_policy][crate::client::NetworkSecurity::get_tls_inspection_policy] calls.
17894    ///
17895    /// # Example
17896    /// ```
17897    /// # use google_cloud_networksecurity_v1::builder::network_security::GetTlsInspectionPolicy;
17898    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17899    ///
17900    /// let builder = prepare_request_builder();
17901    /// let response = builder.send().await?;
17902    /// # Ok(()) }
17903    ///
17904    /// fn prepare_request_builder() -> GetTlsInspectionPolicy {
17905    ///   # panic!();
17906    ///   // ... details omitted ...
17907    /// }
17908    /// ```
17909    #[derive(Clone, Debug)]
17910    pub struct GetTlsInspectionPolicy(RequestBuilder<crate::model::GetTlsInspectionPolicyRequest>);
17911
17912    impl GetTlsInspectionPolicy {
17913        pub(crate) fn new(
17914            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17915        ) -> Self {
17916            Self(RequestBuilder::new(stub))
17917        }
17918
17919        /// Sets the full request, replacing any prior values.
17920        pub fn with_request<V: Into<crate::model::GetTlsInspectionPolicyRequest>>(
17921            mut self,
17922            v: V,
17923        ) -> Self {
17924            self.0.request = v.into();
17925            self
17926        }
17927
17928        /// Sets all the options, replacing any prior values.
17929        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17930            self.0.options = v.into();
17931            self
17932        }
17933
17934        /// Sends the request.
17935        pub async fn send(self) -> Result<crate::model::TlsInspectionPolicy> {
17936            (*self.0.stub)
17937                .get_tls_inspection_policy(self.0.request, self.0.options)
17938                .await
17939                .map(crate::Response::into_body)
17940        }
17941
17942        /// Sets the value of [name][crate::model::GetTlsInspectionPolicyRequest::name].
17943        ///
17944        /// This is a **required** field for requests.
17945        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17946            self.0.request.name = v.into();
17947            self
17948        }
17949    }
17950
17951    #[doc(hidden)]
17952    impl crate::RequestBuilder for GetTlsInspectionPolicy {
17953        fn request_options(&mut self) -> &mut crate::RequestOptions {
17954            &mut self.0.options
17955        }
17956    }
17957
17958    /// The request builder for [NetworkSecurity::create_tls_inspection_policy][crate::client::NetworkSecurity::create_tls_inspection_policy] calls.
17959    ///
17960    /// # Example
17961    /// ```
17962    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateTlsInspectionPolicy;
17963    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17964    /// use google_cloud_lro::Poller;
17965    ///
17966    /// let builder = prepare_request_builder();
17967    /// let response = builder.poller().until_done().await?;
17968    /// # Ok(()) }
17969    ///
17970    /// fn prepare_request_builder() -> CreateTlsInspectionPolicy {
17971    ///   # panic!();
17972    ///   // ... details omitted ...
17973    /// }
17974    /// ```
17975    #[derive(Clone, Debug)]
17976    pub struct CreateTlsInspectionPolicy(
17977        RequestBuilder<crate::model::CreateTlsInspectionPolicyRequest>,
17978    );
17979
17980    impl CreateTlsInspectionPolicy {
17981        pub(crate) fn new(
17982            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17983        ) -> Self {
17984            Self(RequestBuilder::new(stub))
17985        }
17986
17987        /// Sets the full request, replacing any prior values.
17988        pub fn with_request<V: Into<crate::model::CreateTlsInspectionPolicyRequest>>(
17989            mut self,
17990            v: V,
17991        ) -> Self {
17992            self.0.request = v.into();
17993            self
17994        }
17995
17996        /// Sets all the options, replacing any prior values.
17997        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17998            self.0.options = v.into();
17999            self
18000        }
18001
18002        /// Sends the request.
18003        ///
18004        /// # Long running operations
18005        ///
18006        /// This starts, but does not poll, a longrunning operation. More information
18007        /// on [create_tls_inspection_policy][crate::client::NetworkSecurity::create_tls_inspection_policy].
18008        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18009            (*self.0.stub)
18010                .create_tls_inspection_policy(self.0.request, self.0.options)
18011                .await
18012                .map(crate::Response::into_body)
18013        }
18014
18015        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_tls_inspection_policy`.
18016        pub fn poller(
18017            self,
18018        ) -> impl google_cloud_lro::Poller<
18019            crate::model::TlsInspectionPolicy,
18020            crate::model::OperationMetadata,
18021        > {
18022            type Operation = google_cloud_lro::internal::Operation<
18023                crate::model::TlsInspectionPolicy,
18024                crate::model::OperationMetadata,
18025            >;
18026            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18027            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18028
18029            let stub = self.0.stub.clone();
18030            let mut options = self.0.options.clone();
18031            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18032            let query = move |name| {
18033                let stub = stub.clone();
18034                let options = options.clone();
18035                async {
18036                    let op = GetOperation::new(stub)
18037                        .set_name(name)
18038                        .with_options(options)
18039                        .send()
18040                        .await?;
18041                    Ok(Operation::new(op))
18042                }
18043            };
18044
18045            let start = move || async {
18046                let op = self.send().await?;
18047                Ok(Operation::new(op))
18048            };
18049
18050            google_cloud_lro::internal::new_poller(
18051                polling_error_policy,
18052                polling_backoff_policy,
18053                start,
18054                query,
18055            )
18056        }
18057
18058        /// Sets the value of [parent][crate::model::CreateTlsInspectionPolicyRequest::parent].
18059        ///
18060        /// This is a **required** field for requests.
18061        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18062            self.0.request.parent = v.into();
18063            self
18064        }
18065
18066        /// Sets the value of [tls_inspection_policy_id][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy_id].
18067        ///
18068        /// This is a **required** field for requests.
18069        pub fn set_tls_inspection_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18070            self.0.request.tls_inspection_policy_id = v.into();
18071            self
18072        }
18073
18074        /// Sets the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
18075        ///
18076        /// This is a **required** field for requests.
18077        pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
18078        where
18079            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18080        {
18081            self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
18082            self
18083        }
18084
18085        /// Sets or clears the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
18086        ///
18087        /// This is a **required** field for requests.
18088        pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
18089        where
18090            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18091        {
18092            self.0.request.tls_inspection_policy = v.map(|x| x.into());
18093            self
18094        }
18095    }
18096
18097    #[doc(hidden)]
18098    impl crate::RequestBuilder for CreateTlsInspectionPolicy {
18099        fn request_options(&mut self) -> &mut crate::RequestOptions {
18100            &mut self.0.options
18101        }
18102    }
18103
18104    /// The request builder for [NetworkSecurity::update_tls_inspection_policy][crate::client::NetworkSecurity::update_tls_inspection_policy] calls.
18105    ///
18106    /// # Example
18107    /// ```
18108    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateTlsInspectionPolicy;
18109    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18110    /// use google_cloud_lro::Poller;
18111    ///
18112    /// let builder = prepare_request_builder();
18113    /// let response = builder.poller().until_done().await?;
18114    /// # Ok(()) }
18115    ///
18116    /// fn prepare_request_builder() -> UpdateTlsInspectionPolicy {
18117    ///   # panic!();
18118    ///   // ... details omitted ...
18119    /// }
18120    /// ```
18121    #[derive(Clone, Debug)]
18122    pub struct UpdateTlsInspectionPolicy(
18123        RequestBuilder<crate::model::UpdateTlsInspectionPolicyRequest>,
18124    );
18125
18126    impl UpdateTlsInspectionPolicy {
18127        pub(crate) fn new(
18128            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18129        ) -> Self {
18130            Self(RequestBuilder::new(stub))
18131        }
18132
18133        /// Sets the full request, replacing any prior values.
18134        pub fn with_request<V: Into<crate::model::UpdateTlsInspectionPolicyRequest>>(
18135            mut self,
18136            v: V,
18137        ) -> Self {
18138            self.0.request = v.into();
18139            self
18140        }
18141
18142        /// Sets all the options, replacing any prior values.
18143        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18144            self.0.options = v.into();
18145            self
18146        }
18147
18148        /// Sends the request.
18149        ///
18150        /// # Long running operations
18151        ///
18152        /// This starts, but does not poll, a longrunning operation. More information
18153        /// on [update_tls_inspection_policy][crate::client::NetworkSecurity::update_tls_inspection_policy].
18154        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18155            (*self.0.stub)
18156                .update_tls_inspection_policy(self.0.request, self.0.options)
18157                .await
18158                .map(crate::Response::into_body)
18159        }
18160
18161        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_tls_inspection_policy`.
18162        pub fn poller(
18163            self,
18164        ) -> impl google_cloud_lro::Poller<
18165            crate::model::TlsInspectionPolicy,
18166            crate::model::OperationMetadata,
18167        > {
18168            type Operation = google_cloud_lro::internal::Operation<
18169                crate::model::TlsInspectionPolicy,
18170                crate::model::OperationMetadata,
18171            >;
18172            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18173            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18174
18175            let stub = self.0.stub.clone();
18176            let mut options = self.0.options.clone();
18177            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18178            let query = move |name| {
18179                let stub = stub.clone();
18180                let options = options.clone();
18181                async {
18182                    let op = GetOperation::new(stub)
18183                        .set_name(name)
18184                        .with_options(options)
18185                        .send()
18186                        .await?;
18187                    Ok(Operation::new(op))
18188                }
18189            };
18190
18191            let start = move || async {
18192                let op = self.send().await?;
18193                Ok(Operation::new(op))
18194            };
18195
18196            google_cloud_lro::internal::new_poller(
18197                polling_error_policy,
18198                polling_backoff_policy,
18199                start,
18200                query,
18201            )
18202        }
18203
18204        /// Sets the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
18205        pub fn set_update_mask<T>(mut self, v: T) -> Self
18206        where
18207            T: std::convert::Into<wkt::FieldMask>,
18208        {
18209            self.0.request.update_mask = std::option::Option::Some(v.into());
18210            self
18211        }
18212
18213        /// Sets or clears the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
18214        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18215        where
18216            T: std::convert::Into<wkt::FieldMask>,
18217        {
18218            self.0.request.update_mask = v.map(|x| x.into());
18219            self
18220        }
18221
18222        /// Sets the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
18223        ///
18224        /// This is a **required** field for requests.
18225        pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
18226        where
18227            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18228        {
18229            self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
18230            self
18231        }
18232
18233        /// Sets or clears the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
18234        ///
18235        /// This is a **required** field for requests.
18236        pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
18237        where
18238            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18239        {
18240            self.0.request.tls_inspection_policy = v.map(|x| x.into());
18241            self
18242        }
18243    }
18244
18245    #[doc(hidden)]
18246    impl crate::RequestBuilder for UpdateTlsInspectionPolicy {
18247        fn request_options(&mut self) -> &mut crate::RequestOptions {
18248            &mut self.0.options
18249        }
18250    }
18251
18252    /// The request builder for [NetworkSecurity::delete_tls_inspection_policy][crate::client::NetworkSecurity::delete_tls_inspection_policy] calls.
18253    ///
18254    /// # Example
18255    /// ```
18256    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteTlsInspectionPolicy;
18257    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18258    /// use google_cloud_lro::Poller;
18259    ///
18260    /// let builder = prepare_request_builder();
18261    /// let response = builder.poller().until_done().await?;
18262    /// # Ok(()) }
18263    ///
18264    /// fn prepare_request_builder() -> DeleteTlsInspectionPolicy {
18265    ///   # panic!();
18266    ///   // ... details omitted ...
18267    /// }
18268    /// ```
18269    #[derive(Clone, Debug)]
18270    pub struct DeleteTlsInspectionPolicy(
18271        RequestBuilder<crate::model::DeleteTlsInspectionPolicyRequest>,
18272    );
18273
18274    impl DeleteTlsInspectionPolicy {
18275        pub(crate) fn new(
18276            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18277        ) -> Self {
18278            Self(RequestBuilder::new(stub))
18279        }
18280
18281        /// Sets the full request, replacing any prior values.
18282        pub fn with_request<V: Into<crate::model::DeleteTlsInspectionPolicyRequest>>(
18283            mut self,
18284            v: V,
18285        ) -> Self {
18286            self.0.request = v.into();
18287            self
18288        }
18289
18290        /// Sets all the options, replacing any prior values.
18291        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18292            self.0.options = v.into();
18293            self
18294        }
18295
18296        /// Sends the request.
18297        ///
18298        /// # Long running operations
18299        ///
18300        /// This starts, but does not poll, a longrunning operation. More information
18301        /// on [delete_tls_inspection_policy][crate::client::NetworkSecurity::delete_tls_inspection_policy].
18302        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18303            (*self.0.stub)
18304                .delete_tls_inspection_policy(self.0.request, self.0.options)
18305                .await
18306                .map(crate::Response::into_body)
18307        }
18308
18309        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_tls_inspection_policy`.
18310        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18311            type Operation =
18312                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18313            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18314            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18315
18316            let stub = self.0.stub.clone();
18317            let mut options = self.0.options.clone();
18318            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18319            let query = move |name| {
18320                let stub = stub.clone();
18321                let options = options.clone();
18322                async {
18323                    let op = GetOperation::new(stub)
18324                        .set_name(name)
18325                        .with_options(options)
18326                        .send()
18327                        .await?;
18328                    Ok(Operation::new(op))
18329                }
18330            };
18331
18332            let start = move || async {
18333                let op = self.send().await?;
18334                Ok(Operation::new(op))
18335            };
18336
18337            google_cloud_lro::internal::new_unit_response_poller(
18338                polling_error_policy,
18339                polling_backoff_policy,
18340                start,
18341                query,
18342            )
18343        }
18344
18345        /// Sets the value of [name][crate::model::DeleteTlsInspectionPolicyRequest::name].
18346        ///
18347        /// This is a **required** field for requests.
18348        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18349            self.0.request.name = v.into();
18350            self
18351        }
18352
18353        /// Sets the value of [force][crate::model::DeleteTlsInspectionPolicyRequest::force].
18354        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
18355            self.0.request.force = v.into();
18356            self
18357        }
18358    }
18359
18360    #[doc(hidden)]
18361    impl crate::RequestBuilder for DeleteTlsInspectionPolicy {
18362        fn request_options(&mut self) -> &mut crate::RequestOptions {
18363            &mut self.0.options
18364        }
18365    }
18366
18367    /// The request builder for [NetworkSecurity::list_authz_policies][crate::client::NetworkSecurity::list_authz_policies] calls.
18368    ///
18369    /// # Example
18370    /// ```
18371    /// # use google_cloud_networksecurity_v1::builder::network_security::ListAuthzPolicies;
18372    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18373    /// use google_cloud_gax::paginator::ItemPaginator;
18374    ///
18375    /// let builder = prepare_request_builder();
18376    /// let mut items = builder.by_item();
18377    /// while let Some(result) = items.next().await {
18378    ///   let item = result?;
18379    /// }
18380    /// # Ok(()) }
18381    ///
18382    /// fn prepare_request_builder() -> ListAuthzPolicies {
18383    ///   # panic!();
18384    ///   // ... details omitted ...
18385    /// }
18386    /// ```
18387    #[derive(Clone, Debug)]
18388    pub struct ListAuthzPolicies(RequestBuilder<crate::model::ListAuthzPoliciesRequest>);
18389
18390    impl ListAuthzPolicies {
18391        pub(crate) fn new(
18392            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18393        ) -> Self {
18394            Self(RequestBuilder::new(stub))
18395        }
18396
18397        /// Sets the full request, replacing any prior values.
18398        pub fn with_request<V: Into<crate::model::ListAuthzPoliciesRequest>>(
18399            mut self,
18400            v: V,
18401        ) -> Self {
18402            self.0.request = v.into();
18403            self
18404        }
18405
18406        /// Sets all the options, replacing any prior values.
18407        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18408            self.0.options = v.into();
18409            self
18410        }
18411
18412        /// Sends the request.
18413        pub async fn send(self) -> Result<crate::model::ListAuthzPoliciesResponse> {
18414            (*self.0.stub)
18415                .list_authz_policies(self.0.request, self.0.options)
18416                .await
18417                .map(crate::Response::into_body)
18418        }
18419
18420        /// Streams each page in the collection.
18421        pub fn by_page(
18422            self,
18423        ) -> impl google_cloud_gax::paginator::Paginator<
18424            crate::model::ListAuthzPoliciesResponse,
18425            crate::Error,
18426        > {
18427            use std::clone::Clone;
18428            let token = self.0.request.page_token.clone();
18429            let execute = move |token: String| {
18430                let mut builder = self.clone();
18431                builder.0.request = builder.0.request.set_page_token(token);
18432                builder.send()
18433            };
18434            google_cloud_gax::paginator::internal::new_paginator(token, execute)
18435        }
18436
18437        /// Streams each item in the collection.
18438        pub fn by_item(
18439            self,
18440        ) -> impl google_cloud_gax::paginator::ItemPaginator<
18441            crate::model::ListAuthzPoliciesResponse,
18442            crate::Error,
18443        > {
18444            use google_cloud_gax::paginator::Paginator;
18445            self.by_page().items()
18446        }
18447
18448        /// Sets the value of [parent][crate::model::ListAuthzPoliciesRequest::parent].
18449        ///
18450        /// This is a **required** field for requests.
18451        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18452            self.0.request.parent = v.into();
18453            self
18454        }
18455
18456        /// Sets the value of [page_size][crate::model::ListAuthzPoliciesRequest::page_size].
18457        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18458            self.0.request.page_size = v.into();
18459            self
18460        }
18461
18462        /// Sets the value of [page_token][crate::model::ListAuthzPoliciesRequest::page_token].
18463        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18464            self.0.request.page_token = v.into();
18465            self
18466        }
18467
18468        /// Sets the value of [filter][crate::model::ListAuthzPoliciesRequest::filter].
18469        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18470            self.0.request.filter = v.into();
18471            self
18472        }
18473
18474        /// Sets the value of [order_by][crate::model::ListAuthzPoliciesRequest::order_by].
18475        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
18476            self.0.request.order_by = v.into();
18477            self
18478        }
18479    }
18480
18481    #[doc(hidden)]
18482    impl crate::RequestBuilder for ListAuthzPolicies {
18483        fn request_options(&mut self) -> &mut crate::RequestOptions {
18484            &mut self.0.options
18485        }
18486    }
18487
18488    /// The request builder for [NetworkSecurity::get_authz_policy][crate::client::NetworkSecurity::get_authz_policy] calls.
18489    ///
18490    /// # Example
18491    /// ```
18492    /// # use google_cloud_networksecurity_v1::builder::network_security::GetAuthzPolicy;
18493    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18494    ///
18495    /// let builder = prepare_request_builder();
18496    /// let response = builder.send().await?;
18497    /// # Ok(()) }
18498    ///
18499    /// fn prepare_request_builder() -> GetAuthzPolicy {
18500    ///   # panic!();
18501    ///   // ... details omitted ...
18502    /// }
18503    /// ```
18504    #[derive(Clone, Debug)]
18505    pub struct GetAuthzPolicy(RequestBuilder<crate::model::GetAuthzPolicyRequest>);
18506
18507    impl GetAuthzPolicy {
18508        pub(crate) fn new(
18509            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18510        ) -> Self {
18511            Self(RequestBuilder::new(stub))
18512        }
18513
18514        /// Sets the full request, replacing any prior values.
18515        pub fn with_request<V: Into<crate::model::GetAuthzPolicyRequest>>(mut self, v: V) -> Self {
18516            self.0.request = v.into();
18517            self
18518        }
18519
18520        /// Sets all the options, replacing any prior values.
18521        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18522            self.0.options = v.into();
18523            self
18524        }
18525
18526        /// Sends the request.
18527        pub async fn send(self) -> Result<crate::model::AuthzPolicy> {
18528            (*self.0.stub)
18529                .get_authz_policy(self.0.request, self.0.options)
18530                .await
18531                .map(crate::Response::into_body)
18532        }
18533
18534        /// Sets the value of [name][crate::model::GetAuthzPolicyRequest::name].
18535        ///
18536        /// This is a **required** field for requests.
18537        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18538            self.0.request.name = v.into();
18539            self
18540        }
18541    }
18542
18543    #[doc(hidden)]
18544    impl crate::RequestBuilder for GetAuthzPolicy {
18545        fn request_options(&mut self) -> &mut crate::RequestOptions {
18546            &mut self.0.options
18547        }
18548    }
18549
18550    /// The request builder for [NetworkSecurity::create_authz_policy][crate::client::NetworkSecurity::create_authz_policy] calls.
18551    ///
18552    /// # Example
18553    /// ```
18554    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateAuthzPolicy;
18555    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18556    /// use google_cloud_lro::Poller;
18557    ///
18558    /// let builder = prepare_request_builder();
18559    /// let response = builder.poller().until_done().await?;
18560    /// # Ok(()) }
18561    ///
18562    /// fn prepare_request_builder() -> CreateAuthzPolicy {
18563    ///   # panic!();
18564    ///   // ... details omitted ...
18565    /// }
18566    /// ```
18567    #[derive(Clone, Debug)]
18568    pub struct CreateAuthzPolicy(RequestBuilder<crate::model::CreateAuthzPolicyRequest>);
18569
18570    impl CreateAuthzPolicy {
18571        pub(crate) fn new(
18572            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18573        ) -> Self {
18574            Self(RequestBuilder::new(stub))
18575        }
18576
18577        /// Sets the full request, replacing any prior values.
18578        pub fn with_request<V: Into<crate::model::CreateAuthzPolicyRequest>>(
18579            mut self,
18580            v: V,
18581        ) -> Self {
18582            self.0.request = v.into();
18583            self
18584        }
18585
18586        /// Sets all the options, replacing any prior values.
18587        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18588            self.0.options = v.into();
18589            self
18590        }
18591
18592        /// Sends the request.
18593        ///
18594        /// # Long running operations
18595        ///
18596        /// This starts, but does not poll, a longrunning operation. More information
18597        /// on [create_authz_policy][crate::client::NetworkSecurity::create_authz_policy].
18598        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18599            (*self.0.stub)
18600                .create_authz_policy(self.0.request, self.0.options)
18601                .await
18602                .map(crate::Response::into_body)
18603        }
18604
18605        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_authz_policy`.
18606        pub fn poller(
18607            self,
18608        ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
18609        {
18610            type Operation = google_cloud_lro::internal::Operation<
18611                crate::model::AuthzPolicy,
18612                crate::model::OperationMetadata,
18613            >;
18614            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18615            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18616
18617            let stub = self.0.stub.clone();
18618            let mut options = self.0.options.clone();
18619            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18620            let query = move |name| {
18621                let stub = stub.clone();
18622                let options = options.clone();
18623                async {
18624                    let op = GetOperation::new(stub)
18625                        .set_name(name)
18626                        .with_options(options)
18627                        .send()
18628                        .await?;
18629                    Ok(Operation::new(op))
18630                }
18631            };
18632
18633            let start = move || async {
18634                let op = self.send().await?;
18635                Ok(Operation::new(op))
18636            };
18637
18638            google_cloud_lro::internal::new_poller(
18639                polling_error_policy,
18640                polling_backoff_policy,
18641                start,
18642                query,
18643            )
18644        }
18645
18646        /// Sets the value of [parent][crate::model::CreateAuthzPolicyRequest::parent].
18647        ///
18648        /// This is a **required** field for requests.
18649        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18650            self.0.request.parent = v.into();
18651            self
18652        }
18653
18654        /// Sets the value of [authz_policy_id][crate::model::CreateAuthzPolicyRequest::authz_policy_id].
18655        ///
18656        /// This is a **required** field for requests.
18657        pub fn set_authz_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18658            self.0.request.authz_policy_id = v.into();
18659            self
18660        }
18661
18662        /// Sets the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
18663        ///
18664        /// This is a **required** field for requests.
18665        pub fn set_authz_policy<T>(mut self, v: T) -> Self
18666        where
18667            T: std::convert::Into<crate::model::AuthzPolicy>,
18668        {
18669            self.0.request.authz_policy = std::option::Option::Some(v.into());
18670            self
18671        }
18672
18673        /// Sets or clears the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
18674        ///
18675        /// This is a **required** field for requests.
18676        pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
18677        where
18678            T: std::convert::Into<crate::model::AuthzPolicy>,
18679        {
18680            self.0.request.authz_policy = v.map(|x| x.into());
18681            self
18682        }
18683
18684        /// Sets the value of [request_id][crate::model::CreateAuthzPolicyRequest::request_id].
18685        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18686            self.0.request.request_id = v.into();
18687            self
18688        }
18689    }
18690
18691    #[doc(hidden)]
18692    impl crate::RequestBuilder for CreateAuthzPolicy {
18693        fn request_options(&mut self) -> &mut crate::RequestOptions {
18694            &mut self.0.options
18695        }
18696    }
18697
18698    /// The request builder for [NetworkSecurity::update_authz_policy][crate::client::NetworkSecurity::update_authz_policy] calls.
18699    ///
18700    /// # Example
18701    /// ```
18702    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateAuthzPolicy;
18703    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18704    /// use google_cloud_lro::Poller;
18705    ///
18706    /// let builder = prepare_request_builder();
18707    /// let response = builder.poller().until_done().await?;
18708    /// # Ok(()) }
18709    ///
18710    /// fn prepare_request_builder() -> UpdateAuthzPolicy {
18711    ///   # panic!();
18712    ///   // ... details omitted ...
18713    /// }
18714    /// ```
18715    #[derive(Clone, Debug)]
18716    pub struct UpdateAuthzPolicy(RequestBuilder<crate::model::UpdateAuthzPolicyRequest>);
18717
18718    impl UpdateAuthzPolicy {
18719        pub(crate) fn new(
18720            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18721        ) -> Self {
18722            Self(RequestBuilder::new(stub))
18723        }
18724
18725        /// Sets the full request, replacing any prior values.
18726        pub fn with_request<V: Into<crate::model::UpdateAuthzPolicyRequest>>(
18727            mut self,
18728            v: V,
18729        ) -> Self {
18730            self.0.request = v.into();
18731            self
18732        }
18733
18734        /// Sets all the options, replacing any prior values.
18735        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18736            self.0.options = v.into();
18737            self
18738        }
18739
18740        /// Sends the request.
18741        ///
18742        /// # Long running operations
18743        ///
18744        /// This starts, but does not poll, a longrunning operation. More information
18745        /// on [update_authz_policy][crate::client::NetworkSecurity::update_authz_policy].
18746        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18747            (*self.0.stub)
18748                .update_authz_policy(self.0.request, self.0.options)
18749                .await
18750                .map(crate::Response::into_body)
18751        }
18752
18753        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_authz_policy`.
18754        pub fn poller(
18755            self,
18756        ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
18757        {
18758            type Operation = google_cloud_lro::internal::Operation<
18759                crate::model::AuthzPolicy,
18760                crate::model::OperationMetadata,
18761            >;
18762            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18763            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18764
18765            let stub = self.0.stub.clone();
18766            let mut options = self.0.options.clone();
18767            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18768            let query = move |name| {
18769                let stub = stub.clone();
18770                let options = options.clone();
18771                async {
18772                    let op = GetOperation::new(stub)
18773                        .set_name(name)
18774                        .with_options(options)
18775                        .send()
18776                        .await?;
18777                    Ok(Operation::new(op))
18778                }
18779            };
18780
18781            let start = move || async {
18782                let op = self.send().await?;
18783                Ok(Operation::new(op))
18784            };
18785
18786            google_cloud_lro::internal::new_poller(
18787                polling_error_policy,
18788                polling_backoff_policy,
18789                start,
18790                query,
18791            )
18792        }
18793
18794        /// Sets the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
18795        ///
18796        /// This is a **required** field for requests.
18797        pub fn set_update_mask<T>(mut self, v: T) -> Self
18798        where
18799            T: std::convert::Into<wkt::FieldMask>,
18800        {
18801            self.0.request.update_mask = std::option::Option::Some(v.into());
18802            self
18803        }
18804
18805        /// Sets or clears the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
18806        ///
18807        /// This is a **required** field for requests.
18808        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18809        where
18810            T: std::convert::Into<wkt::FieldMask>,
18811        {
18812            self.0.request.update_mask = v.map(|x| x.into());
18813            self
18814        }
18815
18816        /// Sets the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
18817        ///
18818        /// This is a **required** field for requests.
18819        pub fn set_authz_policy<T>(mut self, v: T) -> Self
18820        where
18821            T: std::convert::Into<crate::model::AuthzPolicy>,
18822        {
18823            self.0.request.authz_policy = std::option::Option::Some(v.into());
18824            self
18825        }
18826
18827        /// Sets or clears the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
18828        ///
18829        /// This is a **required** field for requests.
18830        pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
18831        where
18832            T: std::convert::Into<crate::model::AuthzPolicy>,
18833        {
18834            self.0.request.authz_policy = v.map(|x| x.into());
18835            self
18836        }
18837
18838        /// Sets the value of [request_id][crate::model::UpdateAuthzPolicyRequest::request_id].
18839        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18840            self.0.request.request_id = v.into();
18841            self
18842        }
18843    }
18844
18845    #[doc(hidden)]
18846    impl crate::RequestBuilder for UpdateAuthzPolicy {
18847        fn request_options(&mut self) -> &mut crate::RequestOptions {
18848            &mut self.0.options
18849        }
18850    }
18851
18852    /// The request builder for [NetworkSecurity::delete_authz_policy][crate::client::NetworkSecurity::delete_authz_policy] calls.
18853    ///
18854    /// # Example
18855    /// ```
18856    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteAuthzPolicy;
18857    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18858    /// use google_cloud_lro::Poller;
18859    ///
18860    /// let builder = prepare_request_builder();
18861    /// let response = builder.poller().until_done().await?;
18862    /// # Ok(()) }
18863    ///
18864    /// fn prepare_request_builder() -> DeleteAuthzPolicy {
18865    ///   # panic!();
18866    ///   // ... details omitted ...
18867    /// }
18868    /// ```
18869    #[derive(Clone, Debug)]
18870    pub struct DeleteAuthzPolicy(RequestBuilder<crate::model::DeleteAuthzPolicyRequest>);
18871
18872    impl DeleteAuthzPolicy {
18873        pub(crate) fn new(
18874            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18875        ) -> Self {
18876            Self(RequestBuilder::new(stub))
18877        }
18878
18879        /// Sets the full request, replacing any prior values.
18880        pub fn with_request<V: Into<crate::model::DeleteAuthzPolicyRequest>>(
18881            mut self,
18882            v: V,
18883        ) -> Self {
18884            self.0.request = v.into();
18885            self
18886        }
18887
18888        /// Sets all the options, replacing any prior values.
18889        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18890            self.0.options = v.into();
18891            self
18892        }
18893
18894        /// Sends the request.
18895        ///
18896        /// # Long running operations
18897        ///
18898        /// This starts, but does not poll, a longrunning operation. More information
18899        /// on [delete_authz_policy][crate::client::NetworkSecurity::delete_authz_policy].
18900        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18901            (*self.0.stub)
18902                .delete_authz_policy(self.0.request, self.0.options)
18903                .await
18904                .map(crate::Response::into_body)
18905        }
18906
18907        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_authz_policy`.
18908        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18909            type Operation =
18910                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18911            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18912            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18913
18914            let stub = self.0.stub.clone();
18915            let mut options = self.0.options.clone();
18916            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18917            let query = move |name| {
18918                let stub = stub.clone();
18919                let options = options.clone();
18920                async {
18921                    let op = GetOperation::new(stub)
18922                        .set_name(name)
18923                        .with_options(options)
18924                        .send()
18925                        .await?;
18926                    Ok(Operation::new(op))
18927                }
18928            };
18929
18930            let start = move || async {
18931                let op = self.send().await?;
18932                Ok(Operation::new(op))
18933            };
18934
18935            google_cloud_lro::internal::new_unit_response_poller(
18936                polling_error_policy,
18937                polling_backoff_policy,
18938                start,
18939                query,
18940            )
18941        }
18942
18943        /// Sets the value of [name][crate::model::DeleteAuthzPolicyRequest::name].
18944        ///
18945        /// This is a **required** field for requests.
18946        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18947            self.0.request.name = v.into();
18948            self
18949        }
18950
18951        /// Sets the value of [request_id][crate::model::DeleteAuthzPolicyRequest::request_id].
18952        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18953            self.0.request.request_id = v.into();
18954            self
18955        }
18956    }
18957
18958    #[doc(hidden)]
18959    impl crate::RequestBuilder for DeleteAuthzPolicy {
18960        fn request_options(&mut self) -> &mut crate::RequestOptions {
18961            &mut self.0.options
18962        }
18963    }
18964
18965    /// The request builder for [NetworkSecurity::list_locations][crate::client::NetworkSecurity::list_locations] calls.
18966    ///
18967    /// # Example
18968    /// ```
18969    /// # use google_cloud_networksecurity_v1::builder::network_security::ListLocations;
18970    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18971    /// use google_cloud_gax::paginator::ItemPaginator;
18972    ///
18973    /// let builder = prepare_request_builder();
18974    /// let mut items = builder.by_item();
18975    /// while let Some(result) = items.next().await {
18976    ///   let item = result?;
18977    /// }
18978    /// # Ok(()) }
18979    ///
18980    /// fn prepare_request_builder() -> ListLocations {
18981    ///   # panic!();
18982    ///   // ... details omitted ...
18983    /// }
18984    /// ```
18985    #[derive(Clone, Debug)]
18986    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
18987
18988    impl ListLocations {
18989        pub(crate) fn new(
18990            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18991        ) -> Self {
18992            Self(RequestBuilder::new(stub))
18993        }
18994
18995        /// Sets the full request, replacing any prior values.
18996        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
18997            mut self,
18998            v: V,
18999        ) -> Self {
19000            self.0.request = v.into();
19001            self
19002        }
19003
19004        /// Sets all the options, replacing any prior values.
19005        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19006            self.0.options = v.into();
19007            self
19008        }
19009
19010        /// Sends the request.
19011        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
19012            (*self.0.stub)
19013                .list_locations(self.0.request, self.0.options)
19014                .await
19015                .map(crate::Response::into_body)
19016        }
19017
19018        /// Streams each page in the collection.
19019        pub fn by_page(
19020            self,
19021        ) -> impl google_cloud_gax::paginator::Paginator<
19022            google_cloud_location::model::ListLocationsResponse,
19023            crate::Error,
19024        > {
19025            use std::clone::Clone;
19026            let token = self.0.request.page_token.clone();
19027            let execute = move |token: String| {
19028                let mut builder = self.clone();
19029                builder.0.request = builder.0.request.set_page_token(token);
19030                builder.send()
19031            };
19032            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19033        }
19034
19035        /// Streams each item in the collection.
19036        pub fn by_item(
19037            self,
19038        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19039            google_cloud_location::model::ListLocationsResponse,
19040            crate::Error,
19041        > {
19042            use google_cloud_gax::paginator::Paginator;
19043            self.by_page().items()
19044        }
19045
19046        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
19047        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19048            self.0.request.name = v.into();
19049            self
19050        }
19051
19052        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
19053        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19054            self.0.request.filter = v.into();
19055            self
19056        }
19057
19058        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
19059        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19060            self.0.request.page_size = v.into();
19061            self
19062        }
19063
19064        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
19065        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19066            self.0.request.page_token = v.into();
19067            self
19068        }
19069    }
19070
19071    #[doc(hidden)]
19072    impl crate::RequestBuilder for ListLocations {
19073        fn request_options(&mut self) -> &mut crate::RequestOptions {
19074            &mut self.0.options
19075        }
19076    }
19077
19078    /// The request builder for [NetworkSecurity::get_location][crate::client::NetworkSecurity::get_location] calls.
19079    ///
19080    /// # Example
19081    /// ```
19082    /// # use google_cloud_networksecurity_v1::builder::network_security::GetLocation;
19083    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19084    ///
19085    /// let builder = prepare_request_builder();
19086    /// let response = builder.send().await?;
19087    /// # Ok(()) }
19088    ///
19089    /// fn prepare_request_builder() -> GetLocation {
19090    ///   # panic!();
19091    ///   // ... details omitted ...
19092    /// }
19093    /// ```
19094    #[derive(Clone, Debug)]
19095    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
19096
19097    impl GetLocation {
19098        pub(crate) fn new(
19099            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19100        ) -> Self {
19101            Self(RequestBuilder::new(stub))
19102        }
19103
19104        /// Sets the full request, replacing any prior values.
19105        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
19106            mut self,
19107            v: V,
19108        ) -> Self {
19109            self.0.request = v.into();
19110            self
19111        }
19112
19113        /// Sets all the options, replacing any prior values.
19114        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19115            self.0.options = v.into();
19116            self
19117        }
19118
19119        /// Sends the request.
19120        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
19121            (*self.0.stub)
19122                .get_location(self.0.request, self.0.options)
19123                .await
19124                .map(crate::Response::into_body)
19125        }
19126
19127        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
19128        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19129            self.0.request.name = v.into();
19130            self
19131        }
19132    }
19133
19134    #[doc(hidden)]
19135    impl crate::RequestBuilder for GetLocation {
19136        fn request_options(&mut self) -> &mut crate::RequestOptions {
19137            &mut self.0.options
19138        }
19139    }
19140
19141    /// The request builder for [NetworkSecurity::set_iam_policy][crate::client::NetworkSecurity::set_iam_policy] calls.
19142    ///
19143    /// # Example
19144    /// ```
19145    /// # use google_cloud_networksecurity_v1::builder::network_security::SetIamPolicy;
19146    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19147    ///
19148    /// let builder = prepare_request_builder();
19149    /// let response = builder.send().await?;
19150    /// # Ok(()) }
19151    ///
19152    /// fn prepare_request_builder() -> SetIamPolicy {
19153    ///   # panic!();
19154    ///   // ... details omitted ...
19155    /// }
19156    /// ```
19157    #[derive(Clone, Debug)]
19158    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
19159
19160    impl SetIamPolicy {
19161        pub(crate) fn new(
19162            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19163        ) -> Self {
19164            Self(RequestBuilder::new(stub))
19165        }
19166
19167        /// Sets the full request, replacing any prior values.
19168        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
19169            mut self,
19170            v: V,
19171        ) -> Self {
19172            self.0.request = v.into();
19173            self
19174        }
19175
19176        /// Sets all the options, replacing any prior values.
19177        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19178            self.0.options = v.into();
19179            self
19180        }
19181
19182        /// Sends the request.
19183        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
19184            (*self.0.stub)
19185                .set_iam_policy(self.0.request, self.0.options)
19186                .await
19187                .map(crate::Response::into_body)
19188        }
19189
19190        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
19191        ///
19192        /// This is a **required** field for requests.
19193        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19194            self.0.request.resource = v.into();
19195            self
19196        }
19197
19198        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
19199        ///
19200        /// This is a **required** field for requests.
19201        pub fn set_policy<T>(mut self, v: T) -> Self
19202        where
19203            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
19204        {
19205            self.0.request.policy = std::option::Option::Some(v.into());
19206            self
19207        }
19208
19209        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
19210        ///
19211        /// This is a **required** field for requests.
19212        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
19213        where
19214            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
19215        {
19216            self.0.request.policy = v.map(|x| x.into());
19217            self
19218        }
19219
19220        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
19221        pub fn set_update_mask<T>(mut self, v: T) -> Self
19222        where
19223            T: std::convert::Into<wkt::FieldMask>,
19224        {
19225            self.0.request.update_mask = std::option::Option::Some(v.into());
19226            self
19227        }
19228
19229        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
19230        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19231        where
19232            T: std::convert::Into<wkt::FieldMask>,
19233        {
19234            self.0.request.update_mask = v.map(|x| x.into());
19235            self
19236        }
19237    }
19238
19239    #[doc(hidden)]
19240    impl crate::RequestBuilder for SetIamPolicy {
19241        fn request_options(&mut self) -> &mut crate::RequestOptions {
19242            &mut self.0.options
19243        }
19244    }
19245
19246    /// The request builder for [NetworkSecurity::get_iam_policy][crate::client::NetworkSecurity::get_iam_policy] calls.
19247    ///
19248    /// # Example
19249    /// ```
19250    /// # use google_cloud_networksecurity_v1::builder::network_security::GetIamPolicy;
19251    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19252    ///
19253    /// let builder = prepare_request_builder();
19254    /// let response = builder.send().await?;
19255    /// # Ok(()) }
19256    ///
19257    /// fn prepare_request_builder() -> GetIamPolicy {
19258    ///   # panic!();
19259    ///   // ... details omitted ...
19260    /// }
19261    /// ```
19262    #[derive(Clone, Debug)]
19263    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
19264
19265    impl GetIamPolicy {
19266        pub(crate) fn new(
19267            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19268        ) -> Self {
19269            Self(RequestBuilder::new(stub))
19270        }
19271
19272        /// Sets the full request, replacing any prior values.
19273        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
19274            mut self,
19275            v: V,
19276        ) -> Self {
19277            self.0.request = v.into();
19278            self
19279        }
19280
19281        /// Sets all the options, replacing any prior values.
19282        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19283            self.0.options = v.into();
19284            self
19285        }
19286
19287        /// Sends the request.
19288        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
19289            (*self.0.stub)
19290                .get_iam_policy(self.0.request, self.0.options)
19291                .await
19292                .map(crate::Response::into_body)
19293        }
19294
19295        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
19296        ///
19297        /// This is a **required** field for requests.
19298        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19299            self.0.request.resource = v.into();
19300            self
19301        }
19302
19303        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
19304        pub fn set_options<T>(mut self, v: T) -> Self
19305        where
19306            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
19307        {
19308            self.0.request.options = std::option::Option::Some(v.into());
19309            self
19310        }
19311
19312        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
19313        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
19314        where
19315            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
19316        {
19317            self.0.request.options = v.map(|x| x.into());
19318            self
19319        }
19320    }
19321
19322    #[doc(hidden)]
19323    impl crate::RequestBuilder for GetIamPolicy {
19324        fn request_options(&mut self) -> &mut crate::RequestOptions {
19325            &mut self.0.options
19326        }
19327    }
19328
19329    /// The request builder for [NetworkSecurity::test_iam_permissions][crate::client::NetworkSecurity::test_iam_permissions] calls.
19330    ///
19331    /// # Example
19332    /// ```
19333    /// # use google_cloud_networksecurity_v1::builder::network_security::TestIamPermissions;
19334    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19335    ///
19336    /// let builder = prepare_request_builder();
19337    /// let response = builder.send().await?;
19338    /// # Ok(()) }
19339    ///
19340    /// fn prepare_request_builder() -> TestIamPermissions {
19341    ///   # panic!();
19342    ///   // ... details omitted ...
19343    /// }
19344    /// ```
19345    #[derive(Clone, Debug)]
19346    pub struct TestIamPermissions(
19347        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
19348    );
19349
19350    impl TestIamPermissions {
19351        pub(crate) fn new(
19352            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19353        ) -> Self {
19354            Self(RequestBuilder::new(stub))
19355        }
19356
19357        /// Sets the full request, replacing any prior values.
19358        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
19359            mut self,
19360            v: V,
19361        ) -> Self {
19362            self.0.request = v.into();
19363            self
19364        }
19365
19366        /// Sets all the options, replacing any prior values.
19367        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19368            self.0.options = v.into();
19369            self
19370        }
19371
19372        /// Sends the request.
19373        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
19374            (*self.0.stub)
19375                .test_iam_permissions(self.0.request, self.0.options)
19376                .await
19377                .map(crate::Response::into_body)
19378        }
19379
19380        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
19381        ///
19382        /// This is a **required** field for requests.
19383        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19384            self.0.request.resource = v.into();
19385            self
19386        }
19387
19388        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
19389        ///
19390        /// This is a **required** field for requests.
19391        pub fn set_permissions<T, V>(mut self, v: T) -> Self
19392        where
19393            T: std::iter::IntoIterator<Item = V>,
19394            V: std::convert::Into<std::string::String>,
19395        {
19396            use std::iter::Iterator;
19397            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
19398            self
19399        }
19400    }
19401
19402    #[doc(hidden)]
19403    impl crate::RequestBuilder for TestIamPermissions {
19404        fn request_options(&mut self) -> &mut crate::RequestOptions {
19405            &mut self.0.options
19406        }
19407    }
19408
19409    /// The request builder for [NetworkSecurity::list_operations][crate::client::NetworkSecurity::list_operations] calls.
19410    ///
19411    /// # Example
19412    /// ```
19413    /// # use google_cloud_networksecurity_v1::builder::network_security::ListOperations;
19414    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19415    /// use google_cloud_gax::paginator::ItemPaginator;
19416    ///
19417    /// let builder = prepare_request_builder();
19418    /// let mut items = builder.by_item();
19419    /// while let Some(result) = items.next().await {
19420    ///   let item = result?;
19421    /// }
19422    /// # Ok(()) }
19423    ///
19424    /// fn prepare_request_builder() -> ListOperations {
19425    ///   # panic!();
19426    ///   // ... details omitted ...
19427    /// }
19428    /// ```
19429    #[derive(Clone, Debug)]
19430    pub struct ListOperations(
19431        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
19432    );
19433
19434    impl ListOperations {
19435        pub(crate) fn new(
19436            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19437        ) -> Self {
19438            Self(RequestBuilder::new(stub))
19439        }
19440
19441        /// Sets the full request, replacing any prior values.
19442        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
19443            mut self,
19444            v: V,
19445        ) -> Self {
19446            self.0.request = v.into();
19447            self
19448        }
19449
19450        /// Sets all the options, replacing any prior values.
19451        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19452            self.0.options = v.into();
19453            self
19454        }
19455
19456        /// Sends the request.
19457        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
19458            (*self.0.stub)
19459                .list_operations(self.0.request, self.0.options)
19460                .await
19461                .map(crate::Response::into_body)
19462        }
19463
19464        /// Streams each page in the collection.
19465        pub fn by_page(
19466            self,
19467        ) -> impl google_cloud_gax::paginator::Paginator<
19468            google_cloud_longrunning::model::ListOperationsResponse,
19469            crate::Error,
19470        > {
19471            use std::clone::Clone;
19472            let token = self.0.request.page_token.clone();
19473            let execute = move |token: String| {
19474                let mut builder = self.clone();
19475                builder.0.request = builder.0.request.set_page_token(token);
19476                builder.send()
19477            };
19478            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19479        }
19480
19481        /// Streams each item in the collection.
19482        pub fn by_item(
19483            self,
19484        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19485            google_cloud_longrunning::model::ListOperationsResponse,
19486            crate::Error,
19487        > {
19488            use google_cloud_gax::paginator::Paginator;
19489            self.by_page().items()
19490        }
19491
19492        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
19493        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19494            self.0.request.name = v.into();
19495            self
19496        }
19497
19498        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
19499        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19500            self.0.request.filter = v.into();
19501            self
19502        }
19503
19504        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
19505        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19506            self.0.request.page_size = v.into();
19507            self
19508        }
19509
19510        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
19511        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19512            self.0.request.page_token = v.into();
19513            self
19514        }
19515
19516        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
19517        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19518            self.0.request.return_partial_success = v.into();
19519            self
19520        }
19521    }
19522
19523    #[doc(hidden)]
19524    impl crate::RequestBuilder for ListOperations {
19525        fn request_options(&mut self) -> &mut crate::RequestOptions {
19526            &mut self.0.options
19527        }
19528    }
19529
19530    /// The request builder for [NetworkSecurity::get_operation][crate::client::NetworkSecurity::get_operation] calls.
19531    ///
19532    /// # Example
19533    /// ```
19534    /// # use google_cloud_networksecurity_v1::builder::network_security::GetOperation;
19535    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19536    ///
19537    /// let builder = prepare_request_builder();
19538    /// let response = builder.send().await?;
19539    /// # Ok(()) }
19540    ///
19541    /// fn prepare_request_builder() -> GetOperation {
19542    ///   # panic!();
19543    ///   // ... details omitted ...
19544    /// }
19545    /// ```
19546    #[derive(Clone, Debug)]
19547    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
19548
19549    impl GetOperation {
19550        pub(crate) fn new(
19551            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19552        ) -> Self {
19553            Self(RequestBuilder::new(stub))
19554        }
19555
19556        /// Sets the full request, replacing any prior values.
19557        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19558            mut self,
19559            v: V,
19560        ) -> Self {
19561            self.0.request = v.into();
19562            self
19563        }
19564
19565        /// Sets all the options, replacing any prior values.
19566        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19567            self.0.options = v.into();
19568            self
19569        }
19570
19571        /// Sends the request.
19572        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19573            (*self.0.stub)
19574                .get_operation(self.0.request, self.0.options)
19575                .await
19576                .map(crate::Response::into_body)
19577        }
19578
19579        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
19580        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19581            self.0.request.name = v.into();
19582            self
19583        }
19584    }
19585
19586    #[doc(hidden)]
19587    impl crate::RequestBuilder for GetOperation {
19588        fn request_options(&mut self) -> &mut crate::RequestOptions {
19589            &mut self.0.options
19590        }
19591    }
19592
19593    /// The request builder for [NetworkSecurity::delete_operation][crate::client::NetworkSecurity::delete_operation] calls.
19594    ///
19595    /// # Example
19596    /// ```
19597    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteOperation;
19598    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19599    ///
19600    /// let builder = prepare_request_builder();
19601    /// let response = builder.send().await?;
19602    /// # Ok(()) }
19603    ///
19604    /// fn prepare_request_builder() -> DeleteOperation {
19605    ///   # panic!();
19606    ///   // ... details omitted ...
19607    /// }
19608    /// ```
19609    #[derive(Clone, Debug)]
19610    pub struct DeleteOperation(
19611        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
19612    );
19613
19614    impl DeleteOperation {
19615        pub(crate) fn new(
19616            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19617        ) -> Self {
19618            Self(RequestBuilder::new(stub))
19619        }
19620
19621        /// Sets the full request, replacing any prior values.
19622        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
19623            mut self,
19624            v: V,
19625        ) -> Self {
19626            self.0.request = v.into();
19627            self
19628        }
19629
19630        /// Sets all the options, replacing any prior values.
19631        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19632            self.0.options = v.into();
19633            self
19634        }
19635
19636        /// Sends the request.
19637        pub async fn send(self) -> Result<()> {
19638            (*self.0.stub)
19639                .delete_operation(self.0.request, self.0.options)
19640                .await
19641                .map(crate::Response::into_body)
19642        }
19643
19644        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
19645        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19646            self.0.request.name = v.into();
19647            self
19648        }
19649    }
19650
19651    #[doc(hidden)]
19652    impl crate::RequestBuilder for DeleteOperation {
19653        fn request_options(&mut self) -> &mut crate::RequestOptions {
19654            &mut self.0.options
19655        }
19656    }
19657
19658    /// The request builder for [NetworkSecurity::cancel_operation][crate::client::NetworkSecurity::cancel_operation] calls.
19659    ///
19660    /// # Example
19661    /// ```
19662    /// # use google_cloud_networksecurity_v1::builder::network_security::CancelOperation;
19663    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19664    ///
19665    /// let builder = prepare_request_builder();
19666    /// let response = builder.send().await?;
19667    /// # Ok(()) }
19668    ///
19669    /// fn prepare_request_builder() -> CancelOperation {
19670    ///   # panic!();
19671    ///   // ... details omitted ...
19672    /// }
19673    /// ```
19674    #[derive(Clone, Debug)]
19675    pub struct CancelOperation(
19676        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19677    );
19678
19679    impl CancelOperation {
19680        pub(crate) fn new(
19681            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19682        ) -> Self {
19683            Self(RequestBuilder::new(stub))
19684        }
19685
19686        /// Sets the full request, replacing any prior values.
19687        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19688            mut self,
19689            v: V,
19690        ) -> Self {
19691            self.0.request = v.into();
19692            self
19693        }
19694
19695        /// Sets all the options, replacing any prior values.
19696        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19697            self.0.options = v.into();
19698            self
19699        }
19700
19701        /// Sends the request.
19702        pub async fn send(self) -> Result<()> {
19703            (*self.0.stub)
19704                .cancel_operation(self.0.request, self.0.options)
19705                .await
19706                .map(crate::Response::into_body)
19707        }
19708
19709        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
19710        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19711            self.0.request.name = v.into();
19712            self
19713        }
19714    }
19715
19716    #[doc(hidden)]
19717    impl crate::RequestBuilder for CancelOperation {
19718        fn request_options(&mut self) -> &mut crate::RequestOptions {
19719            &mut self.0.options
19720        }
19721    }
19722}
19723
19724pub mod organization_security_profile_group_service {
19725    use crate::Result;
19726
19727    /// A builder for [OrganizationSecurityProfileGroupService][crate::client::OrganizationSecurityProfileGroupService].
19728    ///
19729    /// ```
19730    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19731    /// # use google_cloud_networksecurity_v1::*;
19732    /// # use builder::organization_security_profile_group_service::ClientBuilder;
19733    /// # use client::OrganizationSecurityProfileGroupService;
19734    /// let builder : ClientBuilder = OrganizationSecurityProfileGroupService::builder();
19735    /// let client = builder
19736    ///     .with_endpoint("https://networksecurity.googleapis.com")
19737    ///     .build().await?;
19738    /// # Ok(()) }
19739    /// ```
19740    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
19741
19742    pub(crate) mod client {
19743        use super::super::super::client::OrganizationSecurityProfileGroupService;
19744        pub struct Factory;
19745        impl crate::ClientFactory for Factory {
19746            type Client = OrganizationSecurityProfileGroupService;
19747            type Credentials = gaxi::options::Credentials;
19748            async fn build(
19749                self,
19750                config: gaxi::options::ClientConfig,
19751            ) -> crate::ClientBuilderResult<Self::Client> {
19752                Self::Client::new(config).await
19753            }
19754        }
19755    }
19756
19757    /// Common implementation for [crate::client::OrganizationSecurityProfileGroupService] request builders.
19758    #[derive(Clone, Debug)]
19759    pub(crate) struct RequestBuilder<R: std::default::Default> {
19760        stub: std::sync::Arc<
19761            dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19762        >,
19763        request: R,
19764        options: crate::RequestOptions,
19765    }
19766
19767    impl<R> RequestBuilder<R>
19768    where
19769        R: std::default::Default,
19770    {
19771        pub(crate) fn new(
19772            stub: std::sync::Arc<
19773                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19774            >,
19775        ) -> Self {
19776            Self {
19777                stub,
19778                request: R::default(),
19779                options: crate::RequestOptions::default(),
19780            }
19781        }
19782    }
19783
19784    /// The request builder for [OrganizationSecurityProfileGroupService::list_security_profile_groups][crate::client::OrganizationSecurityProfileGroupService::list_security_profile_groups] calls.
19785    ///
19786    /// # Example
19787    /// ```
19788    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListSecurityProfileGroups;
19789    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19790    /// use google_cloud_gax::paginator::ItemPaginator;
19791    ///
19792    /// let builder = prepare_request_builder();
19793    /// let mut items = builder.by_item();
19794    /// while let Some(result) = items.next().await {
19795    ///   let item = result?;
19796    /// }
19797    /// # Ok(()) }
19798    ///
19799    /// fn prepare_request_builder() -> ListSecurityProfileGroups {
19800    ///   # panic!();
19801    ///   // ... details omitted ...
19802    /// }
19803    /// ```
19804    #[derive(Clone, Debug)]
19805    pub struct ListSecurityProfileGroups(
19806        RequestBuilder<crate::model::ListSecurityProfileGroupsRequest>,
19807    );
19808
19809    impl ListSecurityProfileGroups {
19810        pub(crate) fn new(
19811            stub: std::sync::Arc<
19812                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19813            >,
19814        ) -> Self {
19815            Self(RequestBuilder::new(stub))
19816        }
19817
19818        /// Sets the full request, replacing any prior values.
19819        pub fn with_request<V: Into<crate::model::ListSecurityProfileGroupsRequest>>(
19820            mut self,
19821            v: V,
19822        ) -> Self {
19823            self.0.request = v.into();
19824            self
19825        }
19826
19827        /// Sets all the options, replacing any prior values.
19828        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19829            self.0.options = v.into();
19830            self
19831        }
19832
19833        /// Sends the request.
19834        pub async fn send(self) -> Result<crate::model::ListSecurityProfileGroupsResponse> {
19835            (*self.0.stub)
19836                .list_security_profile_groups(self.0.request, self.0.options)
19837                .await
19838                .map(crate::Response::into_body)
19839        }
19840
19841        /// Streams each page in the collection.
19842        pub fn by_page(
19843            self,
19844        ) -> impl google_cloud_gax::paginator::Paginator<
19845            crate::model::ListSecurityProfileGroupsResponse,
19846            crate::Error,
19847        > {
19848            use std::clone::Clone;
19849            let token = self.0.request.page_token.clone();
19850            let execute = move |token: String| {
19851                let mut builder = self.clone();
19852                builder.0.request = builder.0.request.set_page_token(token);
19853                builder.send()
19854            };
19855            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19856        }
19857
19858        /// Streams each item in the collection.
19859        pub fn by_item(
19860            self,
19861        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19862            crate::model::ListSecurityProfileGroupsResponse,
19863            crate::Error,
19864        > {
19865            use google_cloud_gax::paginator::Paginator;
19866            self.by_page().items()
19867        }
19868
19869        /// Sets the value of [parent][crate::model::ListSecurityProfileGroupsRequest::parent].
19870        ///
19871        /// This is a **required** field for requests.
19872        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19873            self.0.request.parent = v.into();
19874            self
19875        }
19876
19877        /// Sets the value of [page_size][crate::model::ListSecurityProfileGroupsRequest::page_size].
19878        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19879            self.0.request.page_size = v.into();
19880            self
19881        }
19882
19883        /// Sets the value of [page_token][crate::model::ListSecurityProfileGroupsRequest::page_token].
19884        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19885            self.0.request.page_token = v.into();
19886            self
19887        }
19888    }
19889
19890    #[doc(hidden)]
19891    impl crate::RequestBuilder for ListSecurityProfileGroups {
19892        fn request_options(&mut self) -> &mut crate::RequestOptions {
19893            &mut self.0.options
19894        }
19895    }
19896
19897    /// The request builder for [OrganizationSecurityProfileGroupService::get_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::get_security_profile_group] calls.
19898    ///
19899    /// # Example
19900    /// ```
19901    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetSecurityProfileGroup;
19902    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19903    ///
19904    /// let builder = prepare_request_builder();
19905    /// let response = builder.send().await?;
19906    /// # Ok(()) }
19907    ///
19908    /// fn prepare_request_builder() -> GetSecurityProfileGroup {
19909    ///   # panic!();
19910    ///   // ... details omitted ...
19911    /// }
19912    /// ```
19913    #[derive(Clone, Debug)]
19914    pub struct GetSecurityProfileGroup(
19915        RequestBuilder<crate::model::GetSecurityProfileGroupRequest>,
19916    );
19917
19918    impl GetSecurityProfileGroup {
19919        pub(crate) fn new(
19920            stub: std::sync::Arc<
19921                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19922            >,
19923        ) -> Self {
19924            Self(RequestBuilder::new(stub))
19925        }
19926
19927        /// Sets the full request, replacing any prior values.
19928        pub fn with_request<V: Into<crate::model::GetSecurityProfileGroupRequest>>(
19929            mut self,
19930            v: V,
19931        ) -> Self {
19932            self.0.request = v.into();
19933            self
19934        }
19935
19936        /// Sets all the options, replacing any prior values.
19937        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19938            self.0.options = v.into();
19939            self
19940        }
19941
19942        /// Sends the request.
19943        pub async fn send(self) -> Result<crate::model::SecurityProfileGroup> {
19944            (*self.0.stub)
19945                .get_security_profile_group(self.0.request, self.0.options)
19946                .await
19947                .map(crate::Response::into_body)
19948        }
19949
19950        /// Sets the value of [name][crate::model::GetSecurityProfileGroupRequest::name].
19951        ///
19952        /// This is a **required** field for requests.
19953        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19954            self.0.request.name = v.into();
19955            self
19956        }
19957    }
19958
19959    #[doc(hidden)]
19960    impl crate::RequestBuilder for GetSecurityProfileGroup {
19961        fn request_options(&mut self) -> &mut crate::RequestOptions {
19962            &mut self.0.options
19963        }
19964    }
19965
19966    /// The request builder for [OrganizationSecurityProfileGroupService::create_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::create_security_profile_group] calls.
19967    ///
19968    /// # Example
19969    /// ```
19970    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::CreateSecurityProfileGroup;
19971    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19972    /// use google_cloud_lro::Poller;
19973    ///
19974    /// let builder = prepare_request_builder();
19975    /// let response = builder.poller().until_done().await?;
19976    /// # Ok(()) }
19977    ///
19978    /// fn prepare_request_builder() -> CreateSecurityProfileGroup {
19979    ///   # panic!();
19980    ///   // ... details omitted ...
19981    /// }
19982    /// ```
19983    #[derive(Clone, Debug)]
19984    pub struct CreateSecurityProfileGroup(
19985        RequestBuilder<crate::model::CreateSecurityProfileGroupRequest>,
19986    );
19987
19988    impl CreateSecurityProfileGroup {
19989        pub(crate) fn new(
19990            stub: std::sync::Arc<
19991                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
19992            >,
19993        ) -> Self {
19994            Self(RequestBuilder::new(stub))
19995        }
19996
19997        /// Sets the full request, replacing any prior values.
19998        pub fn with_request<V: Into<crate::model::CreateSecurityProfileGroupRequest>>(
19999            mut self,
20000            v: V,
20001        ) -> Self {
20002            self.0.request = v.into();
20003            self
20004        }
20005
20006        /// Sets all the options, replacing any prior values.
20007        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20008            self.0.options = v.into();
20009            self
20010        }
20011
20012        /// Sends the request.
20013        ///
20014        /// # Long running operations
20015        ///
20016        /// This starts, but does not poll, a longrunning operation. More information
20017        /// on [create_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::create_security_profile_group].
20018        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20019            (*self.0.stub)
20020                .create_security_profile_group(self.0.request, self.0.options)
20021                .await
20022                .map(crate::Response::into_body)
20023        }
20024
20025        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_security_profile_group`.
20026        pub fn poller(
20027            self,
20028        ) -> impl google_cloud_lro::Poller<
20029            crate::model::SecurityProfileGroup,
20030            crate::model::OperationMetadata,
20031        > {
20032            type Operation = google_cloud_lro::internal::Operation<
20033                crate::model::SecurityProfileGroup,
20034                crate::model::OperationMetadata,
20035            >;
20036            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20037            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20038
20039            let stub = self.0.stub.clone();
20040            let mut options = self.0.options.clone();
20041            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20042            let query = move |name| {
20043                let stub = stub.clone();
20044                let options = options.clone();
20045                async {
20046                    let op = GetOperation::new(stub)
20047                        .set_name(name)
20048                        .with_options(options)
20049                        .send()
20050                        .await?;
20051                    Ok(Operation::new(op))
20052                }
20053            };
20054
20055            let start = move || async {
20056                let op = self.send().await?;
20057                Ok(Operation::new(op))
20058            };
20059
20060            google_cloud_lro::internal::new_poller(
20061                polling_error_policy,
20062                polling_backoff_policy,
20063                start,
20064                query,
20065            )
20066        }
20067
20068        /// Sets the value of [parent][crate::model::CreateSecurityProfileGroupRequest::parent].
20069        ///
20070        /// This is a **required** field for requests.
20071        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20072            self.0.request.parent = v.into();
20073            self
20074        }
20075
20076        /// Sets the value of [security_profile_group_id][crate::model::CreateSecurityProfileGroupRequest::security_profile_group_id].
20077        ///
20078        /// This is a **required** field for requests.
20079        pub fn set_security_profile_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
20080            self.0.request.security_profile_group_id = v.into();
20081            self
20082        }
20083
20084        /// Sets the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
20085        ///
20086        /// This is a **required** field for requests.
20087        pub fn set_security_profile_group<T>(mut self, v: T) -> Self
20088        where
20089            T: std::convert::Into<crate::model::SecurityProfileGroup>,
20090        {
20091            self.0.request.security_profile_group = std::option::Option::Some(v.into());
20092            self
20093        }
20094
20095        /// Sets or clears the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
20096        ///
20097        /// This is a **required** field for requests.
20098        pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
20099        where
20100            T: std::convert::Into<crate::model::SecurityProfileGroup>,
20101        {
20102            self.0.request.security_profile_group = v.map(|x| x.into());
20103            self
20104        }
20105    }
20106
20107    #[doc(hidden)]
20108    impl crate::RequestBuilder for CreateSecurityProfileGroup {
20109        fn request_options(&mut self) -> &mut crate::RequestOptions {
20110            &mut self.0.options
20111        }
20112    }
20113
20114    /// The request builder for [OrganizationSecurityProfileGroupService::update_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::update_security_profile_group] calls.
20115    ///
20116    /// # Example
20117    /// ```
20118    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::UpdateSecurityProfileGroup;
20119    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20120    /// use google_cloud_lro::Poller;
20121    ///
20122    /// let builder = prepare_request_builder();
20123    /// let response = builder.poller().until_done().await?;
20124    /// # Ok(()) }
20125    ///
20126    /// fn prepare_request_builder() -> UpdateSecurityProfileGroup {
20127    ///   # panic!();
20128    ///   // ... details omitted ...
20129    /// }
20130    /// ```
20131    #[derive(Clone, Debug)]
20132    pub struct UpdateSecurityProfileGroup(
20133        RequestBuilder<crate::model::UpdateSecurityProfileGroupRequest>,
20134    );
20135
20136    impl UpdateSecurityProfileGroup {
20137        pub(crate) fn new(
20138            stub: std::sync::Arc<
20139                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20140            >,
20141        ) -> Self {
20142            Self(RequestBuilder::new(stub))
20143        }
20144
20145        /// Sets the full request, replacing any prior values.
20146        pub fn with_request<V: Into<crate::model::UpdateSecurityProfileGroupRequest>>(
20147            mut self,
20148            v: V,
20149        ) -> Self {
20150            self.0.request = v.into();
20151            self
20152        }
20153
20154        /// Sets all the options, replacing any prior values.
20155        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20156            self.0.options = v.into();
20157            self
20158        }
20159
20160        /// Sends the request.
20161        ///
20162        /// # Long running operations
20163        ///
20164        /// This starts, but does not poll, a longrunning operation. More information
20165        /// on [update_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::update_security_profile_group].
20166        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20167            (*self.0.stub)
20168                .update_security_profile_group(self.0.request, self.0.options)
20169                .await
20170                .map(crate::Response::into_body)
20171        }
20172
20173        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_security_profile_group`.
20174        pub fn poller(
20175            self,
20176        ) -> impl google_cloud_lro::Poller<
20177            crate::model::SecurityProfileGroup,
20178            crate::model::OperationMetadata,
20179        > {
20180            type Operation = google_cloud_lro::internal::Operation<
20181                crate::model::SecurityProfileGroup,
20182                crate::model::OperationMetadata,
20183            >;
20184            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20185            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20186
20187            let stub = self.0.stub.clone();
20188            let mut options = self.0.options.clone();
20189            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20190            let query = move |name| {
20191                let stub = stub.clone();
20192                let options = options.clone();
20193                async {
20194                    let op = GetOperation::new(stub)
20195                        .set_name(name)
20196                        .with_options(options)
20197                        .send()
20198                        .await?;
20199                    Ok(Operation::new(op))
20200                }
20201            };
20202
20203            let start = move || async {
20204                let op = self.send().await?;
20205                Ok(Operation::new(op))
20206            };
20207
20208            google_cloud_lro::internal::new_poller(
20209                polling_error_policy,
20210                polling_backoff_policy,
20211                start,
20212                query,
20213            )
20214        }
20215
20216        /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
20217        ///
20218        /// This is a **required** field for requests.
20219        pub fn set_update_mask<T>(mut self, v: T) -> Self
20220        where
20221            T: std::convert::Into<wkt::FieldMask>,
20222        {
20223            self.0.request.update_mask = std::option::Option::Some(v.into());
20224            self
20225        }
20226
20227        /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
20228        ///
20229        /// This is a **required** field for requests.
20230        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20231        where
20232            T: std::convert::Into<wkt::FieldMask>,
20233        {
20234            self.0.request.update_mask = v.map(|x| x.into());
20235            self
20236        }
20237
20238        /// Sets the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
20239        ///
20240        /// This is a **required** field for requests.
20241        pub fn set_security_profile_group<T>(mut self, v: T) -> Self
20242        where
20243            T: std::convert::Into<crate::model::SecurityProfileGroup>,
20244        {
20245            self.0.request.security_profile_group = std::option::Option::Some(v.into());
20246            self
20247        }
20248
20249        /// Sets or clears the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
20250        ///
20251        /// This is a **required** field for requests.
20252        pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
20253        where
20254            T: std::convert::Into<crate::model::SecurityProfileGroup>,
20255        {
20256            self.0.request.security_profile_group = v.map(|x| x.into());
20257            self
20258        }
20259    }
20260
20261    #[doc(hidden)]
20262    impl crate::RequestBuilder for UpdateSecurityProfileGroup {
20263        fn request_options(&mut self) -> &mut crate::RequestOptions {
20264            &mut self.0.options
20265        }
20266    }
20267
20268    /// The request builder for [OrganizationSecurityProfileGroupService::delete_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile_group] calls.
20269    ///
20270    /// # Example
20271    /// ```
20272    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::DeleteSecurityProfileGroup;
20273    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20274    /// use google_cloud_lro::Poller;
20275    ///
20276    /// let builder = prepare_request_builder();
20277    /// let response = builder.poller().until_done().await?;
20278    /// # Ok(()) }
20279    ///
20280    /// fn prepare_request_builder() -> DeleteSecurityProfileGroup {
20281    ///   # panic!();
20282    ///   // ... details omitted ...
20283    /// }
20284    /// ```
20285    #[derive(Clone, Debug)]
20286    pub struct DeleteSecurityProfileGroup(
20287        RequestBuilder<crate::model::DeleteSecurityProfileGroupRequest>,
20288    );
20289
20290    impl DeleteSecurityProfileGroup {
20291        pub(crate) fn new(
20292            stub: std::sync::Arc<
20293                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20294            >,
20295        ) -> Self {
20296            Self(RequestBuilder::new(stub))
20297        }
20298
20299        /// Sets the full request, replacing any prior values.
20300        pub fn with_request<V: Into<crate::model::DeleteSecurityProfileGroupRequest>>(
20301            mut self,
20302            v: V,
20303        ) -> Self {
20304            self.0.request = v.into();
20305            self
20306        }
20307
20308        /// Sets all the options, replacing any prior values.
20309        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20310            self.0.options = v.into();
20311            self
20312        }
20313
20314        /// Sends the request.
20315        ///
20316        /// # Long running operations
20317        ///
20318        /// This starts, but does not poll, a longrunning operation. More information
20319        /// on [delete_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile_group].
20320        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20321            (*self.0.stub)
20322                .delete_security_profile_group(self.0.request, self.0.options)
20323                .await
20324                .map(crate::Response::into_body)
20325        }
20326
20327        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_security_profile_group`.
20328        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
20329            type Operation =
20330                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
20331            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20332            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20333
20334            let stub = self.0.stub.clone();
20335            let mut options = self.0.options.clone();
20336            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20337            let query = move |name| {
20338                let stub = stub.clone();
20339                let options = options.clone();
20340                async {
20341                    let op = GetOperation::new(stub)
20342                        .set_name(name)
20343                        .with_options(options)
20344                        .send()
20345                        .await?;
20346                    Ok(Operation::new(op))
20347                }
20348            };
20349
20350            let start = move || async {
20351                let op = self.send().await?;
20352                Ok(Operation::new(op))
20353            };
20354
20355            google_cloud_lro::internal::new_unit_response_poller(
20356                polling_error_policy,
20357                polling_backoff_policy,
20358                start,
20359                query,
20360            )
20361        }
20362
20363        /// Sets the value of [name][crate::model::DeleteSecurityProfileGroupRequest::name].
20364        ///
20365        /// This is a **required** field for requests.
20366        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20367            self.0.request.name = v.into();
20368            self
20369        }
20370
20371        /// Sets the value of [etag][crate::model::DeleteSecurityProfileGroupRequest::etag].
20372        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
20373            self.0.request.etag = v.into();
20374            self
20375        }
20376    }
20377
20378    #[doc(hidden)]
20379    impl crate::RequestBuilder for DeleteSecurityProfileGroup {
20380        fn request_options(&mut self) -> &mut crate::RequestOptions {
20381            &mut self.0.options
20382        }
20383    }
20384
20385    /// The request builder for [OrganizationSecurityProfileGroupService::list_security_profiles][crate::client::OrganizationSecurityProfileGroupService::list_security_profiles] calls.
20386    ///
20387    /// # Example
20388    /// ```
20389    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListSecurityProfiles;
20390    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20391    /// use google_cloud_gax::paginator::ItemPaginator;
20392    ///
20393    /// let builder = prepare_request_builder();
20394    /// let mut items = builder.by_item();
20395    /// while let Some(result) = items.next().await {
20396    ///   let item = result?;
20397    /// }
20398    /// # Ok(()) }
20399    ///
20400    /// fn prepare_request_builder() -> ListSecurityProfiles {
20401    ///   # panic!();
20402    ///   // ... details omitted ...
20403    /// }
20404    /// ```
20405    #[derive(Clone, Debug)]
20406    pub struct ListSecurityProfiles(RequestBuilder<crate::model::ListSecurityProfilesRequest>);
20407
20408    impl ListSecurityProfiles {
20409        pub(crate) fn new(
20410            stub: std::sync::Arc<
20411                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20412            >,
20413        ) -> Self {
20414            Self(RequestBuilder::new(stub))
20415        }
20416
20417        /// Sets the full request, replacing any prior values.
20418        pub fn with_request<V: Into<crate::model::ListSecurityProfilesRequest>>(
20419            mut self,
20420            v: V,
20421        ) -> Self {
20422            self.0.request = v.into();
20423            self
20424        }
20425
20426        /// Sets all the options, replacing any prior values.
20427        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20428            self.0.options = v.into();
20429            self
20430        }
20431
20432        /// Sends the request.
20433        pub async fn send(self) -> Result<crate::model::ListSecurityProfilesResponse> {
20434            (*self.0.stub)
20435                .list_security_profiles(self.0.request, self.0.options)
20436                .await
20437                .map(crate::Response::into_body)
20438        }
20439
20440        /// Streams each page in the collection.
20441        pub fn by_page(
20442            self,
20443        ) -> impl google_cloud_gax::paginator::Paginator<
20444            crate::model::ListSecurityProfilesResponse,
20445            crate::Error,
20446        > {
20447            use std::clone::Clone;
20448            let token = self.0.request.page_token.clone();
20449            let execute = move |token: String| {
20450                let mut builder = self.clone();
20451                builder.0.request = builder.0.request.set_page_token(token);
20452                builder.send()
20453            };
20454            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20455        }
20456
20457        /// Streams each item in the collection.
20458        pub fn by_item(
20459            self,
20460        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20461            crate::model::ListSecurityProfilesResponse,
20462            crate::Error,
20463        > {
20464            use google_cloud_gax::paginator::Paginator;
20465            self.by_page().items()
20466        }
20467
20468        /// Sets the value of [parent][crate::model::ListSecurityProfilesRequest::parent].
20469        ///
20470        /// This is a **required** field for requests.
20471        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20472            self.0.request.parent = v.into();
20473            self
20474        }
20475
20476        /// Sets the value of [page_size][crate::model::ListSecurityProfilesRequest::page_size].
20477        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20478            self.0.request.page_size = v.into();
20479            self
20480        }
20481
20482        /// Sets the value of [page_token][crate::model::ListSecurityProfilesRequest::page_token].
20483        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20484            self.0.request.page_token = v.into();
20485            self
20486        }
20487    }
20488
20489    #[doc(hidden)]
20490    impl crate::RequestBuilder for ListSecurityProfiles {
20491        fn request_options(&mut self) -> &mut crate::RequestOptions {
20492            &mut self.0.options
20493        }
20494    }
20495
20496    /// The request builder for [OrganizationSecurityProfileGroupService::get_security_profile][crate::client::OrganizationSecurityProfileGroupService::get_security_profile] calls.
20497    ///
20498    /// # Example
20499    /// ```
20500    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetSecurityProfile;
20501    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20502    ///
20503    /// let builder = prepare_request_builder();
20504    /// let response = builder.send().await?;
20505    /// # Ok(()) }
20506    ///
20507    /// fn prepare_request_builder() -> GetSecurityProfile {
20508    ///   # panic!();
20509    ///   // ... details omitted ...
20510    /// }
20511    /// ```
20512    #[derive(Clone, Debug)]
20513    pub struct GetSecurityProfile(RequestBuilder<crate::model::GetSecurityProfileRequest>);
20514
20515    impl GetSecurityProfile {
20516        pub(crate) fn new(
20517            stub: std::sync::Arc<
20518                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20519            >,
20520        ) -> Self {
20521            Self(RequestBuilder::new(stub))
20522        }
20523
20524        /// Sets the full request, replacing any prior values.
20525        pub fn with_request<V: Into<crate::model::GetSecurityProfileRequest>>(
20526            mut self,
20527            v: V,
20528        ) -> Self {
20529            self.0.request = v.into();
20530            self
20531        }
20532
20533        /// Sets all the options, replacing any prior values.
20534        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20535            self.0.options = v.into();
20536            self
20537        }
20538
20539        /// Sends the request.
20540        pub async fn send(self) -> Result<crate::model::SecurityProfile> {
20541            (*self.0.stub)
20542                .get_security_profile(self.0.request, self.0.options)
20543                .await
20544                .map(crate::Response::into_body)
20545        }
20546
20547        /// Sets the value of [name][crate::model::GetSecurityProfileRequest::name].
20548        ///
20549        /// This is a **required** field for requests.
20550        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20551            self.0.request.name = v.into();
20552            self
20553        }
20554    }
20555
20556    #[doc(hidden)]
20557    impl crate::RequestBuilder for GetSecurityProfile {
20558        fn request_options(&mut self) -> &mut crate::RequestOptions {
20559            &mut self.0.options
20560        }
20561    }
20562
20563    /// The request builder for [OrganizationSecurityProfileGroupService::create_security_profile][crate::client::OrganizationSecurityProfileGroupService::create_security_profile] calls.
20564    ///
20565    /// # Example
20566    /// ```
20567    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::CreateSecurityProfile;
20568    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20569    /// use google_cloud_lro::Poller;
20570    ///
20571    /// let builder = prepare_request_builder();
20572    /// let response = builder.poller().until_done().await?;
20573    /// # Ok(()) }
20574    ///
20575    /// fn prepare_request_builder() -> CreateSecurityProfile {
20576    ///   # panic!();
20577    ///   // ... details omitted ...
20578    /// }
20579    /// ```
20580    #[derive(Clone, Debug)]
20581    pub struct CreateSecurityProfile(RequestBuilder<crate::model::CreateSecurityProfileRequest>);
20582
20583    impl CreateSecurityProfile {
20584        pub(crate) fn new(
20585            stub: std::sync::Arc<
20586                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20587            >,
20588        ) -> Self {
20589            Self(RequestBuilder::new(stub))
20590        }
20591
20592        /// Sets the full request, replacing any prior values.
20593        pub fn with_request<V: Into<crate::model::CreateSecurityProfileRequest>>(
20594            mut self,
20595            v: V,
20596        ) -> Self {
20597            self.0.request = v.into();
20598            self
20599        }
20600
20601        /// Sets all the options, replacing any prior values.
20602        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20603            self.0.options = v.into();
20604            self
20605        }
20606
20607        /// Sends the request.
20608        ///
20609        /// # Long running operations
20610        ///
20611        /// This starts, but does not poll, a longrunning operation. More information
20612        /// on [create_security_profile][crate::client::OrganizationSecurityProfileGroupService::create_security_profile].
20613        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20614            (*self.0.stub)
20615                .create_security_profile(self.0.request, self.0.options)
20616                .await
20617                .map(crate::Response::into_body)
20618        }
20619
20620        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_security_profile`.
20621        pub fn poller(
20622            self,
20623        ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
20624        {
20625            type Operation = google_cloud_lro::internal::Operation<
20626                crate::model::SecurityProfile,
20627                crate::model::OperationMetadata,
20628            >;
20629            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20630            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20631
20632            let stub = self.0.stub.clone();
20633            let mut options = self.0.options.clone();
20634            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20635            let query = move |name| {
20636                let stub = stub.clone();
20637                let options = options.clone();
20638                async {
20639                    let op = GetOperation::new(stub)
20640                        .set_name(name)
20641                        .with_options(options)
20642                        .send()
20643                        .await?;
20644                    Ok(Operation::new(op))
20645                }
20646            };
20647
20648            let start = move || async {
20649                let op = self.send().await?;
20650                Ok(Operation::new(op))
20651            };
20652
20653            google_cloud_lro::internal::new_poller(
20654                polling_error_policy,
20655                polling_backoff_policy,
20656                start,
20657                query,
20658            )
20659        }
20660
20661        /// Sets the value of [parent][crate::model::CreateSecurityProfileRequest::parent].
20662        ///
20663        /// This is a **required** field for requests.
20664        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20665            self.0.request.parent = v.into();
20666            self
20667        }
20668
20669        /// Sets the value of [security_profile_id][crate::model::CreateSecurityProfileRequest::security_profile_id].
20670        ///
20671        /// This is a **required** field for requests.
20672        pub fn set_security_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
20673            self.0.request.security_profile_id = v.into();
20674            self
20675        }
20676
20677        /// Sets the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
20678        ///
20679        /// This is a **required** field for requests.
20680        pub fn set_security_profile<T>(mut self, v: T) -> Self
20681        where
20682            T: std::convert::Into<crate::model::SecurityProfile>,
20683        {
20684            self.0.request.security_profile = std::option::Option::Some(v.into());
20685            self
20686        }
20687
20688        /// Sets or clears the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
20689        ///
20690        /// This is a **required** field for requests.
20691        pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
20692        where
20693            T: std::convert::Into<crate::model::SecurityProfile>,
20694        {
20695            self.0.request.security_profile = v.map(|x| x.into());
20696            self
20697        }
20698    }
20699
20700    #[doc(hidden)]
20701    impl crate::RequestBuilder for CreateSecurityProfile {
20702        fn request_options(&mut self) -> &mut crate::RequestOptions {
20703            &mut self.0.options
20704        }
20705    }
20706
20707    /// The request builder for [OrganizationSecurityProfileGroupService::update_security_profile][crate::client::OrganizationSecurityProfileGroupService::update_security_profile] calls.
20708    ///
20709    /// # Example
20710    /// ```
20711    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::UpdateSecurityProfile;
20712    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20713    /// use google_cloud_lro::Poller;
20714    ///
20715    /// let builder = prepare_request_builder();
20716    /// let response = builder.poller().until_done().await?;
20717    /// # Ok(()) }
20718    ///
20719    /// fn prepare_request_builder() -> UpdateSecurityProfile {
20720    ///   # panic!();
20721    ///   // ... details omitted ...
20722    /// }
20723    /// ```
20724    #[derive(Clone, Debug)]
20725    pub struct UpdateSecurityProfile(RequestBuilder<crate::model::UpdateSecurityProfileRequest>);
20726
20727    impl UpdateSecurityProfile {
20728        pub(crate) fn new(
20729            stub: std::sync::Arc<
20730                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20731            >,
20732        ) -> Self {
20733            Self(RequestBuilder::new(stub))
20734        }
20735
20736        /// Sets the full request, replacing any prior values.
20737        pub fn with_request<V: Into<crate::model::UpdateSecurityProfileRequest>>(
20738            mut self,
20739            v: V,
20740        ) -> Self {
20741            self.0.request = v.into();
20742            self
20743        }
20744
20745        /// Sets all the options, replacing any prior values.
20746        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20747            self.0.options = v.into();
20748            self
20749        }
20750
20751        /// Sends the request.
20752        ///
20753        /// # Long running operations
20754        ///
20755        /// This starts, but does not poll, a longrunning operation. More information
20756        /// on [update_security_profile][crate::client::OrganizationSecurityProfileGroupService::update_security_profile].
20757        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20758            (*self.0.stub)
20759                .update_security_profile(self.0.request, self.0.options)
20760                .await
20761                .map(crate::Response::into_body)
20762        }
20763
20764        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_security_profile`.
20765        pub fn poller(
20766            self,
20767        ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
20768        {
20769            type Operation = google_cloud_lro::internal::Operation<
20770                crate::model::SecurityProfile,
20771                crate::model::OperationMetadata,
20772            >;
20773            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20774            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20775
20776            let stub = self.0.stub.clone();
20777            let mut options = self.0.options.clone();
20778            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20779            let query = move |name| {
20780                let stub = stub.clone();
20781                let options = options.clone();
20782                async {
20783                    let op = GetOperation::new(stub)
20784                        .set_name(name)
20785                        .with_options(options)
20786                        .send()
20787                        .await?;
20788                    Ok(Operation::new(op))
20789                }
20790            };
20791
20792            let start = move || async {
20793                let op = self.send().await?;
20794                Ok(Operation::new(op))
20795            };
20796
20797            google_cloud_lro::internal::new_poller(
20798                polling_error_policy,
20799                polling_backoff_policy,
20800                start,
20801                query,
20802            )
20803        }
20804
20805        /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
20806        ///
20807        /// This is a **required** field for requests.
20808        pub fn set_update_mask<T>(mut self, v: T) -> Self
20809        where
20810            T: std::convert::Into<wkt::FieldMask>,
20811        {
20812            self.0.request.update_mask = std::option::Option::Some(v.into());
20813            self
20814        }
20815
20816        /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
20817        ///
20818        /// This is a **required** field for requests.
20819        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20820        where
20821            T: std::convert::Into<wkt::FieldMask>,
20822        {
20823            self.0.request.update_mask = v.map(|x| x.into());
20824            self
20825        }
20826
20827        /// Sets the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
20828        ///
20829        /// This is a **required** field for requests.
20830        pub fn set_security_profile<T>(mut self, v: T) -> Self
20831        where
20832            T: std::convert::Into<crate::model::SecurityProfile>,
20833        {
20834            self.0.request.security_profile = std::option::Option::Some(v.into());
20835            self
20836        }
20837
20838        /// Sets or clears the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
20839        ///
20840        /// This is a **required** field for requests.
20841        pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
20842        where
20843            T: std::convert::Into<crate::model::SecurityProfile>,
20844        {
20845            self.0.request.security_profile = v.map(|x| x.into());
20846            self
20847        }
20848    }
20849
20850    #[doc(hidden)]
20851    impl crate::RequestBuilder for UpdateSecurityProfile {
20852        fn request_options(&mut self) -> &mut crate::RequestOptions {
20853            &mut self.0.options
20854        }
20855    }
20856
20857    /// The request builder for [OrganizationSecurityProfileGroupService::delete_security_profile][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile] calls.
20858    ///
20859    /// # Example
20860    /// ```
20861    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::DeleteSecurityProfile;
20862    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20863    /// use google_cloud_lro::Poller;
20864    ///
20865    /// let builder = prepare_request_builder();
20866    /// let response = builder.poller().until_done().await?;
20867    /// # Ok(()) }
20868    ///
20869    /// fn prepare_request_builder() -> DeleteSecurityProfile {
20870    ///   # panic!();
20871    ///   // ... details omitted ...
20872    /// }
20873    /// ```
20874    #[derive(Clone, Debug)]
20875    pub struct DeleteSecurityProfile(RequestBuilder<crate::model::DeleteSecurityProfileRequest>);
20876
20877    impl DeleteSecurityProfile {
20878        pub(crate) fn new(
20879            stub: std::sync::Arc<
20880                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20881            >,
20882        ) -> Self {
20883            Self(RequestBuilder::new(stub))
20884        }
20885
20886        /// Sets the full request, replacing any prior values.
20887        pub fn with_request<V: Into<crate::model::DeleteSecurityProfileRequest>>(
20888            mut self,
20889            v: V,
20890        ) -> Self {
20891            self.0.request = v.into();
20892            self
20893        }
20894
20895        /// Sets all the options, replacing any prior values.
20896        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20897            self.0.options = v.into();
20898            self
20899        }
20900
20901        /// Sends the request.
20902        ///
20903        /// # Long running operations
20904        ///
20905        /// This starts, but does not poll, a longrunning operation. More information
20906        /// on [delete_security_profile][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile].
20907        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20908            (*self.0.stub)
20909                .delete_security_profile(self.0.request, self.0.options)
20910                .await
20911                .map(crate::Response::into_body)
20912        }
20913
20914        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_security_profile`.
20915        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
20916            type Operation =
20917                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
20918            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20919            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20920
20921            let stub = self.0.stub.clone();
20922            let mut options = self.0.options.clone();
20923            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20924            let query = move |name| {
20925                let stub = stub.clone();
20926                let options = options.clone();
20927                async {
20928                    let op = GetOperation::new(stub)
20929                        .set_name(name)
20930                        .with_options(options)
20931                        .send()
20932                        .await?;
20933                    Ok(Operation::new(op))
20934                }
20935            };
20936
20937            let start = move || async {
20938                let op = self.send().await?;
20939                Ok(Operation::new(op))
20940            };
20941
20942            google_cloud_lro::internal::new_unit_response_poller(
20943                polling_error_policy,
20944                polling_backoff_policy,
20945                start,
20946                query,
20947            )
20948        }
20949
20950        /// Sets the value of [name][crate::model::DeleteSecurityProfileRequest::name].
20951        ///
20952        /// This is a **required** field for requests.
20953        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20954            self.0.request.name = v.into();
20955            self
20956        }
20957
20958        /// Sets the value of [etag][crate::model::DeleteSecurityProfileRequest::etag].
20959        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
20960            self.0.request.etag = v.into();
20961            self
20962        }
20963    }
20964
20965    #[doc(hidden)]
20966    impl crate::RequestBuilder for DeleteSecurityProfile {
20967        fn request_options(&mut self) -> &mut crate::RequestOptions {
20968            &mut self.0.options
20969        }
20970    }
20971
20972    /// The request builder for [OrganizationSecurityProfileGroupService::list_locations][crate::client::OrganizationSecurityProfileGroupService::list_locations] calls.
20973    ///
20974    /// # Example
20975    /// ```
20976    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListLocations;
20977    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20978    /// use google_cloud_gax::paginator::ItemPaginator;
20979    ///
20980    /// let builder = prepare_request_builder();
20981    /// let mut items = builder.by_item();
20982    /// while let Some(result) = items.next().await {
20983    ///   let item = result?;
20984    /// }
20985    /// # Ok(()) }
20986    ///
20987    /// fn prepare_request_builder() -> ListLocations {
20988    ///   # panic!();
20989    ///   // ... details omitted ...
20990    /// }
20991    /// ```
20992    #[derive(Clone, Debug)]
20993    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
20994
20995    impl ListLocations {
20996        pub(crate) fn new(
20997            stub: std::sync::Arc<
20998                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
20999            >,
21000        ) -> Self {
21001            Self(RequestBuilder::new(stub))
21002        }
21003
21004        /// Sets the full request, replacing any prior values.
21005        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
21006            mut self,
21007            v: V,
21008        ) -> Self {
21009            self.0.request = v.into();
21010            self
21011        }
21012
21013        /// Sets all the options, replacing any prior values.
21014        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21015            self.0.options = v.into();
21016            self
21017        }
21018
21019        /// Sends the request.
21020        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
21021            (*self.0.stub)
21022                .list_locations(self.0.request, self.0.options)
21023                .await
21024                .map(crate::Response::into_body)
21025        }
21026
21027        /// Streams each page in the collection.
21028        pub fn by_page(
21029            self,
21030        ) -> impl google_cloud_gax::paginator::Paginator<
21031            google_cloud_location::model::ListLocationsResponse,
21032            crate::Error,
21033        > {
21034            use std::clone::Clone;
21035            let token = self.0.request.page_token.clone();
21036            let execute = move |token: String| {
21037                let mut builder = self.clone();
21038                builder.0.request = builder.0.request.set_page_token(token);
21039                builder.send()
21040            };
21041            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21042        }
21043
21044        /// Streams each item in the collection.
21045        pub fn by_item(
21046            self,
21047        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21048            google_cloud_location::model::ListLocationsResponse,
21049            crate::Error,
21050        > {
21051            use google_cloud_gax::paginator::Paginator;
21052            self.by_page().items()
21053        }
21054
21055        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
21056        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21057            self.0.request.name = v.into();
21058            self
21059        }
21060
21061        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
21062        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21063            self.0.request.filter = v.into();
21064            self
21065        }
21066
21067        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
21068        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21069            self.0.request.page_size = v.into();
21070            self
21071        }
21072
21073        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
21074        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21075            self.0.request.page_token = v.into();
21076            self
21077        }
21078    }
21079
21080    #[doc(hidden)]
21081    impl crate::RequestBuilder for ListLocations {
21082        fn request_options(&mut self) -> &mut crate::RequestOptions {
21083            &mut self.0.options
21084        }
21085    }
21086
21087    /// The request builder for [OrganizationSecurityProfileGroupService::get_location][crate::client::OrganizationSecurityProfileGroupService::get_location] calls.
21088    ///
21089    /// # Example
21090    /// ```
21091    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetLocation;
21092    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21093    ///
21094    /// let builder = prepare_request_builder();
21095    /// let response = builder.send().await?;
21096    /// # Ok(()) }
21097    ///
21098    /// fn prepare_request_builder() -> GetLocation {
21099    ///   # panic!();
21100    ///   // ... details omitted ...
21101    /// }
21102    /// ```
21103    #[derive(Clone, Debug)]
21104    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
21105
21106    impl GetLocation {
21107        pub(crate) fn new(
21108            stub: std::sync::Arc<
21109                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21110            >,
21111        ) -> Self {
21112            Self(RequestBuilder::new(stub))
21113        }
21114
21115        /// Sets the full request, replacing any prior values.
21116        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
21117            mut self,
21118            v: V,
21119        ) -> Self {
21120            self.0.request = v.into();
21121            self
21122        }
21123
21124        /// Sets all the options, replacing any prior values.
21125        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21126            self.0.options = v.into();
21127            self
21128        }
21129
21130        /// Sends the request.
21131        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
21132            (*self.0.stub)
21133                .get_location(self.0.request, self.0.options)
21134                .await
21135                .map(crate::Response::into_body)
21136        }
21137
21138        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
21139        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21140            self.0.request.name = v.into();
21141            self
21142        }
21143    }
21144
21145    #[doc(hidden)]
21146    impl crate::RequestBuilder for GetLocation {
21147        fn request_options(&mut self) -> &mut crate::RequestOptions {
21148            &mut self.0.options
21149        }
21150    }
21151
21152    /// The request builder for [OrganizationSecurityProfileGroupService::set_iam_policy][crate::client::OrganizationSecurityProfileGroupService::set_iam_policy] calls.
21153    ///
21154    /// # Example
21155    /// ```
21156    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::SetIamPolicy;
21157    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21158    ///
21159    /// let builder = prepare_request_builder();
21160    /// let response = builder.send().await?;
21161    /// # Ok(()) }
21162    ///
21163    /// fn prepare_request_builder() -> SetIamPolicy {
21164    ///   # panic!();
21165    ///   // ... details omitted ...
21166    /// }
21167    /// ```
21168    #[derive(Clone, Debug)]
21169    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
21170
21171    impl SetIamPolicy {
21172        pub(crate) fn new(
21173            stub: std::sync::Arc<
21174                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21175            >,
21176        ) -> Self {
21177            Self(RequestBuilder::new(stub))
21178        }
21179
21180        /// Sets the full request, replacing any prior values.
21181        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
21182            mut self,
21183            v: V,
21184        ) -> Self {
21185            self.0.request = v.into();
21186            self
21187        }
21188
21189        /// Sets all the options, replacing any prior values.
21190        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21191            self.0.options = v.into();
21192            self
21193        }
21194
21195        /// Sends the request.
21196        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
21197            (*self.0.stub)
21198                .set_iam_policy(self.0.request, self.0.options)
21199                .await
21200                .map(crate::Response::into_body)
21201        }
21202
21203        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
21204        ///
21205        /// This is a **required** field for requests.
21206        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21207            self.0.request.resource = v.into();
21208            self
21209        }
21210
21211        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
21212        ///
21213        /// This is a **required** field for requests.
21214        pub fn set_policy<T>(mut self, v: T) -> Self
21215        where
21216            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
21217        {
21218            self.0.request.policy = std::option::Option::Some(v.into());
21219            self
21220        }
21221
21222        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
21223        ///
21224        /// This is a **required** field for requests.
21225        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
21226        where
21227            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
21228        {
21229            self.0.request.policy = v.map(|x| x.into());
21230            self
21231        }
21232
21233        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
21234        pub fn set_update_mask<T>(mut self, v: T) -> Self
21235        where
21236            T: std::convert::Into<wkt::FieldMask>,
21237        {
21238            self.0.request.update_mask = std::option::Option::Some(v.into());
21239            self
21240        }
21241
21242        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
21243        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21244        where
21245            T: std::convert::Into<wkt::FieldMask>,
21246        {
21247            self.0.request.update_mask = v.map(|x| x.into());
21248            self
21249        }
21250    }
21251
21252    #[doc(hidden)]
21253    impl crate::RequestBuilder for SetIamPolicy {
21254        fn request_options(&mut self) -> &mut crate::RequestOptions {
21255            &mut self.0.options
21256        }
21257    }
21258
21259    /// The request builder for [OrganizationSecurityProfileGroupService::get_iam_policy][crate::client::OrganizationSecurityProfileGroupService::get_iam_policy] calls.
21260    ///
21261    /// # Example
21262    /// ```
21263    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetIamPolicy;
21264    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21265    ///
21266    /// let builder = prepare_request_builder();
21267    /// let response = builder.send().await?;
21268    /// # Ok(()) }
21269    ///
21270    /// fn prepare_request_builder() -> GetIamPolicy {
21271    ///   # panic!();
21272    ///   // ... details omitted ...
21273    /// }
21274    /// ```
21275    #[derive(Clone, Debug)]
21276    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
21277
21278    impl GetIamPolicy {
21279        pub(crate) fn new(
21280            stub: std::sync::Arc<
21281                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21282            >,
21283        ) -> Self {
21284            Self(RequestBuilder::new(stub))
21285        }
21286
21287        /// Sets the full request, replacing any prior values.
21288        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
21289            mut self,
21290            v: V,
21291        ) -> Self {
21292            self.0.request = v.into();
21293            self
21294        }
21295
21296        /// Sets all the options, replacing any prior values.
21297        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21298            self.0.options = v.into();
21299            self
21300        }
21301
21302        /// Sends the request.
21303        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
21304            (*self.0.stub)
21305                .get_iam_policy(self.0.request, self.0.options)
21306                .await
21307                .map(crate::Response::into_body)
21308        }
21309
21310        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
21311        ///
21312        /// This is a **required** field for requests.
21313        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21314            self.0.request.resource = v.into();
21315            self
21316        }
21317
21318        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
21319        pub fn set_options<T>(mut self, v: T) -> Self
21320        where
21321            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
21322        {
21323            self.0.request.options = std::option::Option::Some(v.into());
21324            self
21325        }
21326
21327        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
21328        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
21329        where
21330            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
21331        {
21332            self.0.request.options = v.map(|x| x.into());
21333            self
21334        }
21335    }
21336
21337    #[doc(hidden)]
21338    impl crate::RequestBuilder for GetIamPolicy {
21339        fn request_options(&mut self) -> &mut crate::RequestOptions {
21340            &mut self.0.options
21341        }
21342    }
21343
21344    /// The request builder for [OrganizationSecurityProfileGroupService::test_iam_permissions][crate::client::OrganizationSecurityProfileGroupService::test_iam_permissions] calls.
21345    ///
21346    /// # Example
21347    /// ```
21348    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::TestIamPermissions;
21349    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21350    ///
21351    /// let builder = prepare_request_builder();
21352    /// let response = builder.send().await?;
21353    /// # Ok(()) }
21354    ///
21355    /// fn prepare_request_builder() -> TestIamPermissions {
21356    ///   # panic!();
21357    ///   // ... details omitted ...
21358    /// }
21359    /// ```
21360    #[derive(Clone, Debug)]
21361    pub struct TestIamPermissions(
21362        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
21363    );
21364
21365    impl TestIamPermissions {
21366        pub(crate) fn new(
21367            stub: std::sync::Arc<
21368                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21369            >,
21370        ) -> Self {
21371            Self(RequestBuilder::new(stub))
21372        }
21373
21374        /// Sets the full request, replacing any prior values.
21375        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
21376            mut self,
21377            v: V,
21378        ) -> Self {
21379            self.0.request = v.into();
21380            self
21381        }
21382
21383        /// Sets all the options, replacing any prior values.
21384        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21385            self.0.options = v.into();
21386            self
21387        }
21388
21389        /// Sends the request.
21390        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
21391            (*self.0.stub)
21392                .test_iam_permissions(self.0.request, self.0.options)
21393                .await
21394                .map(crate::Response::into_body)
21395        }
21396
21397        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
21398        ///
21399        /// This is a **required** field for requests.
21400        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21401            self.0.request.resource = v.into();
21402            self
21403        }
21404
21405        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
21406        ///
21407        /// This is a **required** field for requests.
21408        pub fn set_permissions<T, V>(mut self, v: T) -> Self
21409        where
21410            T: std::iter::IntoIterator<Item = V>,
21411            V: std::convert::Into<std::string::String>,
21412        {
21413            use std::iter::Iterator;
21414            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
21415            self
21416        }
21417    }
21418
21419    #[doc(hidden)]
21420    impl crate::RequestBuilder for TestIamPermissions {
21421        fn request_options(&mut self) -> &mut crate::RequestOptions {
21422            &mut self.0.options
21423        }
21424    }
21425
21426    /// The request builder for [OrganizationSecurityProfileGroupService::list_operations][crate::client::OrganizationSecurityProfileGroupService::list_operations] calls.
21427    ///
21428    /// # Example
21429    /// ```
21430    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListOperations;
21431    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21432    /// use google_cloud_gax::paginator::ItemPaginator;
21433    ///
21434    /// let builder = prepare_request_builder();
21435    /// let mut items = builder.by_item();
21436    /// while let Some(result) = items.next().await {
21437    ///   let item = result?;
21438    /// }
21439    /// # Ok(()) }
21440    ///
21441    /// fn prepare_request_builder() -> ListOperations {
21442    ///   # panic!();
21443    ///   // ... details omitted ...
21444    /// }
21445    /// ```
21446    #[derive(Clone, Debug)]
21447    pub struct ListOperations(
21448        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
21449    );
21450
21451    impl ListOperations {
21452        pub(crate) fn new(
21453            stub: std::sync::Arc<
21454                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21455            >,
21456        ) -> Self {
21457            Self(RequestBuilder::new(stub))
21458        }
21459
21460        /// Sets the full request, replacing any prior values.
21461        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
21462            mut self,
21463            v: V,
21464        ) -> Self {
21465            self.0.request = v.into();
21466            self
21467        }
21468
21469        /// Sets all the options, replacing any prior values.
21470        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21471            self.0.options = v.into();
21472            self
21473        }
21474
21475        /// Sends the request.
21476        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
21477            (*self.0.stub)
21478                .list_operations(self.0.request, self.0.options)
21479                .await
21480                .map(crate::Response::into_body)
21481        }
21482
21483        /// Streams each page in the collection.
21484        pub fn by_page(
21485            self,
21486        ) -> impl google_cloud_gax::paginator::Paginator<
21487            google_cloud_longrunning::model::ListOperationsResponse,
21488            crate::Error,
21489        > {
21490            use std::clone::Clone;
21491            let token = self.0.request.page_token.clone();
21492            let execute = move |token: String| {
21493                let mut builder = self.clone();
21494                builder.0.request = builder.0.request.set_page_token(token);
21495                builder.send()
21496            };
21497            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21498        }
21499
21500        /// Streams each item in the collection.
21501        pub fn by_item(
21502            self,
21503        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21504            google_cloud_longrunning::model::ListOperationsResponse,
21505            crate::Error,
21506        > {
21507            use google_cloud_gax::paginator::Paginator;
21508            self.by_page().items()
21509        }
21510
21511        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
21512        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21513            self.0.request.name = v.into();
21514            self
21515        }
21516
21517        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
21518        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21519            self.0.request.filter = v.into();
21520            self
21521        }
21522
21523        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
21524        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21525            self.0.request.page_size = v.into();
21526            self
21527        }
21528
21529        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
21530        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21531            self.0.request.page_token = v.into();
21532            self
21533        }
21534
21535        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
21536        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21537            self.0.request.return_partial_success = v.into();
21538            self
21539        }
21540    }
21541
21542    #[doc(hidden)]
21543    impl crate::RequestBuilder for ListOperations {
21544        fn request_options(&mut self) -> &mut crate::RequestOptions {
21545            &mut self.0.options
21546        }
21547    }
21548
21549    /// The request builder for [OrganizationSecurityProfileGroupService::get_operation][crate::client::OrganizationSecurityProfileGroupService::get_operation] calls.
21550    ///
21551    /// # Example
21552    /// ```
21553    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetOperation;
21554    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21555    ///
21556    /// let builder = prepare_request_builder();
21557    /// let response = builder.send().await?;
21558    /// # Ok(()) }
21559    ///
21560    /// fn prepare_request_builder() -> GetOperation {
21561    ///   # panic!();
21562    ///   // ... details omitted ...
21563    /// }
21564    /// ```
21565    #[derive(Clone, Debug)]
21566    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
21567
21568    impl GetOperation {
21569        pub(crate) fn new(
21570            stub: std::sync::Arc<
21571                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21572            >,
21573        ) -> Self {
21574            Self(RequestBuilder::new(stub))
21575        }
21576
21577        /// Sets the full request, replacing any prior values.
21578        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
21579            mut self,
21580            v: V,
21581        ) -> Self {
21582            self.0.request = v.into();
21583            self
21584        }
21585
21586        /// Sets all the options, replacing any prior values.
21587        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21588            self.0.options = v.into();
21589            self
21590        }
21591
21592        /// Sends the request.
21593        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21594            (*self.0.stub)
21595                .get_operation(self.0.request, self.0.options)
21596                .await
21597                .map(crate::Response::into_body)
21598        }
21599
21600        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
21601        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21602            self.0.request.name = v.into();
21603            self
21604        }
21605    }
21606
21607    #[doc(hidden)]
21608    impl crate::RequestBuilder for GetOperation {
21609        fn request_options(&mut self) -> &mut crate::RequestOptions {
21610            &mut self.0.options
21611        }
21612    }
21613
21614    /// The request builder for [OrganizationSecurityProfileGroupService::delete_operation][crate::client::OrganizationSecurityProfileGroupService::delete_operation] calls.
21615    ///
21616    /// # Example
21617    /// ```
21618    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::DeleteOperation;
21619    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21620    ///
21621    /// let builder = prepare_request_builder();
21622    /// let response = builder.send().await?;
21623    /// # Ok(()) }
21624    ///
21625    /// fn prepare_request_builder() -> DeleteOperation {
21626    ///   # panic!();
21627    ///   // ... details omitted ...
21628    /// }
21629    /// ```
21630    #[derive(Clone, Debug)]
21631    pub struct DeleteOperation(
21632        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
21633    );
21634
21635    impl DeleteOperation {
21636        pub(crate) fn new(
21637            stub: std::sync::Arc<
21638                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21639            >,
21640        ) -> Self {
21641            Self(RequestBuilder::new(stub))
21642        }
21643
21644        /// Sets the full request, replacing any prior values.
21645        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
21646            mut self,
21647            v: V,
21648        ) -> Self {
21649            self.0.request = v.into();
21650            self
21651        }
21652
21653        /// Sets all the options, replacing any prior values.
21654        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21655            self.0.options = v.into();
21656            self
21657        }
21658
21659        /// Sends the request.
21660        pub async fn send(self) -> Result<()> {
21661            (*self.0.stub)
21662                .delete_operation(self.0.request, self.0.options)
21663                .await
21664                .map(crate::Response::into_body)
21665        }
21666
21667        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
21668        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21669            self.0.request.name = v.into();
21670            self
21671        }
21672    }
21673
21674    #[doc(hidden)]
21675    impl crate::RequestBuilder for DeleteOperation {
21676        fn request_options(&mut self) -> &mut crate::RequestOptions {
21677            &mut self.0.options
21678        }
21679    }
21680
21681    /// The request builder for [OrganizationSecurityProfileGroupService::cancel_operation][crate::client::OrganizationSecurityProfileGroupService::cancel_operation] calls.
21682    ///
21683    /// # Example
21684    /// ```
21685    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::CancelOperation;
21686    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21687    ///
21688    /// let builder = prepare_request_builder();
21689    /// let response = builder.send().await?;
21690    /// # Ok(()) }
21691    ///
21692    /// fn prepare_request_builder() -> CancelOperation {
21693    ///   # panic!();
21694    ///   // ... details omitted ...
21695    /// }
21696    /// ```
21697    #[derive(Clone, Debug)]
21698    pub struct CancelOperation(
21699        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
21700    );
21701
21702    impl CancelOperation {
21703        pub(crate) fn new(
21704            stub: std::sync::Arc<
21705                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
21706            >,
21707        ) -> Self {
21708            Self(RequestBuilder::new(stub))
21709        }
21710
21711        /// Sets the full request, replacing any prior values.
21712        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
21713            mut self,
21714            v: V,
21715        ) -> Self {
21716            self.0.request = v.into();
21717            self
21718        }
21719
21720        /// Sets all the options, replacing any prior values.
21721        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21722            self.0.options = v.into();
21723            self
21724        }
21725
21726        /// Sends the request.
21727        pub async fn send(self) -> Result<()> {
21728            (*self.0.stub)
21729                .cancel_operation(self.0.request, self.0.options)
21730                .await
21731                .map(crate::Response::into_body)
21732        }
21733
21734        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
21735        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21736            self.0.request.name = v.into();
21737            self
21738        }
21739    }
21740
21741    #[doc(hidden)]
21742    impl crate::RequestBuilder for CancelOperation {
21743        fn request_options(&mut self) -> &mut crate::RequestOptions {
21744            &mut self.0.options
21745        }
21746    }
21747}