Skip to main content

google_cloud_networksecurity_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17/// Request and client builders for [AddressGroupService][crate::client::AddressGroupService].
18pub mod address_group_service {
19    use crate::Result;
20
21    /// A builder for [AddressGroupService][crate::client::AddressGroupService].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_networksecurity_v1::*;
26    /// # use builder::address_group_service::ClientBuilder;
27    /// # use client::AddressGroupService;
28    /// let builder : ClientBuilder = AddressGroupService::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://networksecurity.googleapis.com")
31    ///     .build().await?;
32    /// # Ok(()) }
33    /// ```
34    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::AddressGroupService;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = AddressGroupService;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> crate::ClientBuilderResult<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::AddressGroupService] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
55        request: R,
56        options: crate::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [AddressGroupService::list_address_groups][crate::client::AddressGroupService::list_address_groups] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListAddressGroups;
79    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
80    /// use google_cloud_gax::paginator::ItemPaginator;
81    ///
82    /// let builder = prepare_request_builder();
83    /// let mut items = builder.by_item();
84    /// while let Some(result) = items.next().await {
85    ///   let item = result?;
86    /// }
87    /// # Ok(()) }
88    ///
89    /// fn prepare_request_builder() -> ListAddressGroups {
90    ///   # panic!();
91    ///   // ... details omitted ...
92    /// }
93    /// ```
94    #[derive(Clone, Debug)]
95    pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
96
97    impl ListAddressGroups {
98        pub(crate) fn new(
99            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
100        ) -> Self {
101            Self(RequestBuilder::new(stub))
102        }
103
104        /// Sets the full request, replacing any prior values.
105        pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
106            mut self,
107            v: V,
108        ) -> Self {
109            self.0.request = v.into();
110            self
111        }
112
113        /// Sets all the options, replacing any prior values.
114        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
115            self.0.options = v.into();
116            self
117        }
118
119        /// Sends the request.
120        pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
121            (*self.0.stub)
122                .list_address_groups(self.0.request, self.0.options)
123                .await
124                .map(crate::Response::into_body)
125        }
126
127        /// Streams each page in the collection.
128        pub fn by_page(
129            self,
130        ) -> impl google_cloud_gax::paginator::Paginator<
131            crate::model::ListAddressGroupsResponse,
132            crate::Error,
133        > {
134            use std::clone::Clone;
135            let token = self.0.request.page_token.clone();
136            let execute = move |token: String| {
137                let mut builder = self.clone();
138                builder.0.request = builder.0.request.set_page_token(token);
139                builder.send()
140            };
141            google_cloud_gax::paginator::internal::new_paginator(token, execute)
142        }
143
144        /// Streams each item in the collection.
145        pub fn by_item(
146            self,
147        ) -> impl google_cloud_gax::paginator::ItemPaginator<
148            crate::model::ListAddressGroupsResponse,
149            crate::Error,
150        > {
151            use google_cloud_gax::paginator::Paginator;
152            self.by_page().items()
153        }
154
155        /// Sets the value of [parent][crate::model::ListAddressGroupsRequest::parent].
156        ///
157        /// This is a **required** field for requests.
158        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
159            self.0.request.parent = v.into();
160            self
161        }
162
163        /// Sets the value of [page_size][crate::model::ListAddressGroupsRequest::page_size].
164        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
165            self.0.request.page_size = v.into();
166            self
167        }
168
169        /// Sets the value of [page_token][crate::model::ListAddressGroupsRequest::page_token].
170        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
171            self.0.request.page_token = v.into();
172            self
173        }
174
175        /// Sets the value of [return_partial_success][crate::model::ListAddressGroupsRequest::return_partial_success].
176        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
177            self.0.request.return_partial_success = v.into();
178            self
179        }
180    }
181
182    #[doc(hidden)]
183    impl crate::RequestBuilder for ListAddressGroups {
184        fn request_options(&mut self) -> &mut crate::RequestOptions {
185            &mut self.0.options
186        }
187    }
188
189    /// The request builder for [AddressGroupService::get_address_group][crate::client::AddressGroupService::get_address_group] calls.
190    ///
191    /// # Example
192    /// ```
193    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetAddressGroup;
194    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
195    ///
196    /// let builder = prepare_request_builder();
197    /// let response = builder.send().await?;
198    /// # Ok(()) }
199    ///
200    /// fn prepare_request_builder() -> GetAddressGroup {
201    ///   # panic!();
202    ///   // ... details omitted ...
203    /// }
204    /// ```
205    #[derive(Clone, Debug)]
206    pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
207
208    impl GetAddressGroup {
209        pub(crate) fn new(
210            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
211        ) -> Self {
212            Self(RequestBuilder::new(stub))
213        }
214
215        /// Sets the full request, replacing any prior values.
216        pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
217            self.0.request = v.into();
218            self
219        }
220
221        /// Sets all the options, replacing any prior values.
222        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
223            self.0.options = v.into();
224            self
225        }
226
227        /// Sends the request.
228        pub async fn send(self) -> Result<crate::model::AddressGroup> {
229            (*self.0.stub)
230                .get_address_group(self.0.request, self.0.options)
231                .await
232                .map(crate::Response::into_body)
233        }
234
235        /// Sets the value of [name][crate::model::GetAddressGroupRequest::name].
236        ///
237        /// This is a **required** field for requests.
238        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
239            self.0.request.name = v.into();
240            self
241        }
242    }
243
244    #[doc(hidden)]
245    impl crate::RequestBuilder for GetAddressGroup {
246        fn request_options(&mut self) -> &mut crate::RequestOptions {
247            &mut self.0.options
248        }
249    }
250
251    /// The request builder for [AddressGroupService::create_address_group][crate::client::AddressGroupService::create_address_group] calls.
252    ///
253    /// # Example
254    /// ```
255    /// # use google_cloud_networksecurity_v1::builder::address_group_service::CreateAddressGroup;
256    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
257    /// use google_cloud_lro::Poller;
258    ///
259    /// let builder = prepare_request_builder();
260    /// let response = builder.poller().until_done().await?;
261    /// # Ok(()) }
262    ///
263    /// fn prepare_request_builder() -> CreateAddressGroup {
264    ///   # panic!();
265    ///   // ... details omitted ...
266    /// }
267    /// ```
268    #[derive(Clone, Debug)]
269    pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
270
271    impl CreateAddressGroup {
272        pub(crate) fn new(
273            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
274        ) -> Self {
275            Self(RequestBuilder::new(stub))
276        }
277
278        /// Sets the full request, replacing any prior values.
279        pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
280            mut self,
281            v: V,
282        ) -> Self {
283            self.0.request = v.into();
284            self
285        }
286
287        /// Sets all the options, replacing any prior values.
288        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
289            self.0.options = v.into();
290            self
291        }
292
293        /// Sends the request.
294        ///
295        /// # Long running operations
296        ///
297        /// This starts, but does not poll, a longrunning operation. More information
298        /// on [create_address_group][crate::client::AddressGroupService::create_address_group].
299        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
300            (*self.0.stub)
301                .create_address_group(self.0.request, self.0.options)
302                .await
303                .map(crate::Response::into_body)
304        }
305
306        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_address_group`.
307        pub fn poller(
308            self,
309        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
310        {
311            type Operation = google_cloud_lro::internal::Operation<
312                crate::model::AddressGroup,
313                crate::model::OperationMetadata,
314            >;
315            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
316            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
317
318            let stub = self.0.stub.clone();
319            let mut options = self.0.options.clone();
320            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
321            let query = move |name| {
322                let stub = stub.clone();
323                let options = options.clone();
324                async {
325                    let op = GetOperation::new(stub)
326                        .set_name(name)
327                        .with_options(options)
328                        .send()
329                        .await?;
330                    Ok(Operation::new(op))
331                }
332            };
333
334            let start = move || async {
335                let op = self.send().await?;
336                Ok(Operation::new(op))
337            };
338
339            google_cloud_lro::internal::new_poller(
340                polling_error_policy,
341                polling_backoff_policy,
342                start,
343                query,
344            )
345        }
346
347        /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
348        ///
349        /// This is a **required** field for requests.
350        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
351            self.0.request.parent = v.into();
352            self
353        }
354
355        /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
356        ///
357        /// This is a **required** field for requests.
358        pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
359            self.0.request.address_group_id = v.into();
360            self
361        }
362
363        /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
364        ///
365        /// This is a **required** field for requests.
366        pub fn set_address_group<T>(mut self, v: T) -> Self
367        where
368            T: std::convert::Into<crate::model::AddressGroup>,
369        {
370            self.0.request.address_group = std::option::Option::Some(v.into());
371            self
372        }
373
374        /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
375        ///
376        /// This is a **required** field for requests.
377        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
378        where
379            T: std::convert::Into<crate::model::AddressGroup>,
380        {
381            self.0.request.address_group = v.map(|x| x.into());
382            self
383        }
384
385        /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
386        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
387            self.0.request.request_id = v.into();
388            self
389        }
390    }
391
392    #[doc(hidden)]
393    impl crate::RequestBuilder for CreateAddressGroup {
394        fn request_options(&mut self) -> &mut crate::RequestOptions {
395            &mut self.0.options
396        }
397    }
398
399    /// The request builder for [AddressGroupService::update_address_group][crate::client::AddressGroupService::update_address_group] calls.
400    ///
401    /// # Example
402    /// ```
403    /// # use google_cloud_networksecurity_v1::builder::address_group_service::UpdateAddressGroup;
404    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
405    /// use google_cloud_lro::Poller;
406    ///
407    /// let builder = prepare_request_builder();
408    /// let response = builder.poller().until_done().await?;
409    /// # Ok(()) }
410    ///
411    /// fn prepare_request_builder() -> UpdateAddressGroup {
412    ///   # panic!();
413    ///   // ... details omitted ...
414    /// }
415    /// ```
416    #[derive(Clone, Debug)]
417    pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
418
419    impl UpdateAddressGroup {
420        pub(crate) fn new(
421            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
422        ) -> Self {
423            Self(RequestBuilder::new(stub))
424        }
425
426        /// Sets the full request, replacing any prior values.
427        pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
428            mut self,
429            v: V,
430        ) -> Self {
431            self.0.request = v.into();
432            self
433        }
434
435        /// Sets all the options, replacing any prior values.
436        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
437            self.0.options = v.into();
438            self
439        }
440
441        /// Sends the request.
442        ///
443        /// # Long running operations
444        ///
445        /// This starts, but does not poll, a longrunning operation. More information
446        /// on [update_address_group][crate::client::AddressGroupService::update_address_group].
447        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
448            (*self.0.stub)
449                .update_address_group(self.0.request, self.0.options)
450                .await
451                .map(crate::Response::into_body)
452        }
453
454        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_address_group`.
455        pub fn poller(
456            self,
457        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
458        {
459            type Operation = google_cloud_lro::internal::Operation<
460                crate::model::AddressGroup,
461                crate::model::OperationMetadata,
462            >;
463            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
464            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
465
466            let stub = self.0.stub.clone();
467            let mut options = self.0.options.clone();
468            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
469            let query = move |name| {
470                let stub = stub.clone();
471                let options = options.clone();
472                async {
473                    let op = GetOperation::new(stub)
474                        .set_name(name)
475                        .with_options(options)
476                        .send()
477                        .await?;
478                    Ok(Operation::new(op))
479                }
480            };
481
482            let start = move || async {
483                let op = self.send().await?;
484                Ok(Operation::new(op))
485            };
486
487            google_cloud_lro::internal::new_poller(
488                polling_error_policy,
489                polling_backoff_policy,
490                start,
491                query,
492            )
493        }
494
495        /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
496        pub fn set_update_mask<T>(mut self, v: T) -> Self
497        where
498            T: std::convert::Into<wkt::FieldMask>,
499        {
500            self.0.request.update_mask = std::option::Option::Some(v.into());
501            self
502        }
503
504        /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
505        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
506        where
507            T: std::convert::Into<wkt::FieldMask>,
508        {
509            self.0.request.update_mask = v.map(|x| x.into());
510            self
511        }
512
513        /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
514        ///
515        /// This is a **required** field for requests.
516        pub fn set_address_group<T>(mut self, v: T) -> Self
517        where
518            T: std::convert::Into<crate::model::AddressGroup>,
519        {
520            self.0.request.address_group = std::option::Option::Some(v.into());
521            self
522        }
523
524        /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
525        ///
526        /// This is a **required** field for requests.
527        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
528        where
529            T: std::convert::Into<crate::model::AddressGroup>,
530        {
531            self.0.request.address_group = v.map(|x| x.into());
532            self
533        }
534
535        /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
536        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
537            self.0.request.request_id = v.into();
538            self
539        }
540    }
541
542    #[doc(hidden)]
543    impl crate::RequestBuilder for UpdateAddressGroup {
544        fn request_options(&mut self) -> &mut crate::RequestOptions {
545            &mut self.0.options
546        }
547    }
548
549    /// The request builder for [AddressGroupService::add_address_group_items][crate::client::AddressGroupService::add_address_group_items] calls.
550    ///
551    /// # Example
552    /// ```
553    /// # use google_cloud_networksecurity_v1::builder::address_group_service::AddAddressGroupItems;
554    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
555    /// use google_cloud_lro::Poller;
556    ///
557    /// let builder = prepare_request_builder();
558    /// let response = builder.poller().until_done().await?;
559    /// # Ok(()) }
560    ///
561    /// fn prepare_request_builder() -> AddAddressGroupItems {
562    ///   # panic!();
563    ///   // ... details omitted ...
564    /// }
565    /// ```
566    #[derive(Clone, Debug)]
567    pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
568
569    impl AddAddressGroupItems {
570        pub(crate) fn new(
571            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
572        ) -> Self {
573            Self(RequestBuilder::new(stub))
574        }
575
576        /// Sets the full request, replacing any prior values.
577        pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
578            mut self,
579            v: V,
580        ) -> Self {
581            self.0.request = v.into();
582            self
583        }
584
585        /// Sets all the options, replacing any prior values.
586        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
587            self.0.options = v.into();
588            self
589        }
590
591        /// Sends the request.
592        ///
593        /// # Long running operations
594        ///
595        /// This starts, but does not poll, a longrunning operation. More information
596        /// on [add_address_group_items][crate::client::AddressGroupService::add_address_group_items].
597        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
598            (*self.0.stub)
599                .add_address_group_items(self.0.request, self.0.options)
600                .await
601                .map(crate::Response::into_body)
602        }
603
604        /// Creates a [Poller][google_cloud_lro::Poller] to work with `add_address_group_items`.
605        pub fn poller(
606            self,
607        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
608        {
609            type Operation = google_cloud_lro::internal::Operation<
610                crate::model::AddressGroup,
611                crate::model::OperationMetadata,
612            >;
613            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
614            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
615
616            let stub = self.0.stub.clone();
617            let mut options = self.0.options.clone();
618            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
619            let query = move |name| {
620                let stub = stub.clone();
621                let options = options.clone();
622                async {
623                    let op = GetOperation::new(stub)
624                        .set_name(name)
625                        .with_options(options)
626                        .send()
627                        .await?;
628                    Ok(Operation::new(op))
629                }
630            };
631
632            let start = move || async {
633                let op = self.send().await?;
634                Ok(Operation::new(op))
635            };
636
637            google_cloud_lro::internal::new_poller(
638                polling_error_policy,
639                polling_backoff_policy,
640                start,
641                query,
642            )
643        }
644
645        /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
646        ///
647        /// This is a **required** field for requests.
648        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
649            self.0.request.address_group = v.into();
650            self
651        }
652
653        /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
654        ///
655        /// This is a **required** field for requests.
656        pub fn set_items<T, V>(mut self, v: T) -> Self
657        where
658            T: std::iter::IntoIterator<Item = V>,
659            V: std::convert::Into<std::string::String>,
660        {
661            use std::iter::Iterator;
662            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
663            self
664        }
665
666        /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
667        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
668            self.0.request.request_id = v.into();
669            self
670        }
671    }
672
673    #[doc(hidden)]
674    impl crate::RequestBuilder for AddAddressGroupItems {
675        fn request_options(&mut self) -> &mut crate::RequestOptions {
676            &mut self.0.options
677        }
678    }
679
680    /// The request builder for [AddressGroupService::remove_address_group_items][crate::client::AddressGroupService::remove_address_group_items] calls.
681    ///
682    /// # Example
683    /// ```
684    /// # use google_cloud_networksecurity_v1::builder::address_group_service::RemoveAddressGroupItems;
685    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
686    /// use google_cloud_lro::Poller;
687    ///
688    /// let builder = prepare_request_builder();
689    /// let response = builder.poller().until_done().await?;
690    /// # Ok(()) }
691    ///
692    /// fn prepare_request_builder() -> RemoveAddressGroupItems {
693    ///   # panic!();
694    ///   // ... details omitted ...
695    /// }
696    /// ```
697    #[derive(Clone, Debug)]
698    pub struct RemoveAddressGroupItems(
699        RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
700    );
701
702    impl RemoveAddressGroupItems {
703        pub(crate) fn new(
704            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
705        ) -> Self {
706            Self(RequestBuilder::new(stub))
707        }
708
709        /// Sets the full request, replacing any prior values.
710        pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
711            mut self,
712            v: V,
713        ) -> Self {
714            self.0.request = v.into();
715            self
716        }
717
718        /// Sets all the options, replacing any prior values.
719        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
720            self.0.options = v.into();
721            self
722        }
723
724        /// Sends the request.
725        ///
726        /// # Long running operations
727        ///
728        /// This starts, but does not poll, a longrunning operation. More information
729        /// on [remove_address_group_items][crate::client::AddressGroupService::remove_address_group_items].
730        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
731            (*self.0.stub)
732                .remove_address_group_items(self.0.request, self.0.options)
733                .await
734                .map(crate::Response::into_body)
735        }
736
737        /// Creates a [Poller][google_cloud_lro::Poller] to work with `remove_address_group_items`.
738        pub fn poller(
739            self,
740        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
741        {
742            type Operation = google_cloud_lro::internal::Operation<
743                crate::model::AddressGroup,
744                crate::model::OperationMetadata,
745            >;
746            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
747            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
748
749            let stub = self.0.stub.clone();
750            let mut options = self.0.options.clone();
751            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
752            let query = move |name| {
753                let stub = stub.clone();
754                let options = options.clone();
755                async {
756                    let op = GetOperation::new(stub)
757                        .set_name(name)
758                        .with_options(options)
759                        .send()
760                        .await?;
761                    Ok(Operation::new(op))
762                }
763            };
764
765            let start = move || async {
766                let op = self.send().await?;
767                Ok(Operation::new(op))
768            };
769
770            google_cloud_lro::internal::new_poller(
771                polling_error_policy,
772                polling_backoff_policy,
773                start,
774                query,
775            )
776        }
777
778        /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
779        ///
780        /// This is a **required** field for requests.
781        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
782            self.0.request.address_group = v.into();
783            self
784        }
785
786        /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
787        ///
788        /// This is a **required** field for requests.
789        pub fn set_items<T, V>(mut self, v: T) -> Self
790        where
791            T: std::iter::IntoIterator<Item = V>,
792            V: std::convert::Into<std::string::String>,
793        {
794            use std::iter::Iterator;
795            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
796            self
797        }
798
799        /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
800        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
801            self.0.request.request_id = v.into();
802            self
803        }
804    }
805
806    #[doc(hidden)]
807    impl crate::RequestBuilder for RemoveAddressGroupItems {
808        fn request_options(&mut self) -> &mut crate::RequestOptions {
809            &mut self.0.options
810        }
811    }
812
813    /// The request builder for [AddressGroupService::clone_address_group_items][crate::client::AddressGroupService::clone_address_group_items] calls.
814    ///
815    /// # Example
816    /// ```
817    /// # use google_cloud_networksecurity_v1::builder::address_group_service::CloneAddressGroupItems;
818    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
819    /// use google_cloud_lro::Poller;
820    ///
821    /// let builder = prepare_request_builder();
822    /// let response = builder.poller().until_done().await?;
823    /// # Ok(()) }
824    ///
825    /// fn prepare_request_builder() -> CloneAddressGroupItems {
826    ///   # panic!();
827    ///   // ... details omitted ...
828    /// }
829    /// ```
830    #[derive(Clone, Debug)]
831    pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
832
833    impl CloneAddressGroupItems {
834        pub(crate) fn new(
835            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
836        ) -> Self {
837            Self(RequestBuilder::new(stub))
838        }
839
840        /// Sets the full request, replacing any prior values.
841        pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
842            mut self,
843            v: V,
844        ) -> Self {
845            self.0.request = v.into();
846            self
847        }
848
849        /// Sets all the options, replacing any prior values.
850        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
851            self.0.options = v.into();
852            self
853        }
854
855        /// Sends the request.
856        ///
857        /// # Long running operations
858        ///
859        /// This starts, but does not poll, a longrunning operation. More information
860        /// on [clone_address_group_items][crate::client::AddressGroupService::clone_address_group_items].
861        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
862            (*self.0.stub)
863                .clone_address_group_items(self.0.request, self.0.options)
864                .await
865                .map(crate::Response::into_body)
866        }
867
868        /// Creates a [Poller][google_cloud_lro::Poller] to work with `clone_address_group_items`.
869        pub fn poller(
870            self,
871        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
872        {
873            type Operation = google_cloud_lro::internal::Operation<
874                crate::model::AddressGroup,
875                crate::model::OperationMetadata,
876            >;
877            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
878            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
879
880            let stub = self.0.stub.clone();
881            let mut options = self.0.options.clone();
882            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
883            let query = move |name| {
884                let stub = stub.clone();
885                let options = options.clone();
886                async {
887                    let op = GetOperation::new(stub)
888                        .set_name(name)
889                        .with_options(options)
890                        .send()
891                        .await?;
892                    Ok(Operation::new(op))
893                }
894            };
895
896            let start = move || async {
897                let op = self.send().await?;
898                Ok(Operation::new(op))
899            };
900
901            google_cloud_lro::internal::new_poller(
902                polling_error_policy,
903                polling_backoff_policy,
904                start,
905                query,
906            )
907        }
908
909        /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
910        ///
911        /// This is a **required** field for requests.
912        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
913            self.0.request.address_group = v.into();
914            self
915        }
916
917        /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
918        ///
919        /// This is a **required** field for requests.
920        pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
921            self.0.request.source_address_group = v.into();
922            self
923        }
924
925        /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
926        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
927            self.0.request.request_id = v.into();
928            self
929        }
930    }
931
932    #[doc(hidden)]
933    impl crate::RequestBuilder for CloneAddressGroupItems {
934        fn request_options(&mut self) -> &mut crate::RequestOptions {
935            &mut self.0.options
936        }
937    }
938
939    /// The request builder for [AddressGroupService::delete_address_group][crate::client::AddressGroupService::delete_address_group] calls.
940    ///
941    /// # Example
942    /// ```
943    /// # use google_cloud_networksecurity_v1::builder::address_group_service::DeleteAddressGroup;
944    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
945    /// use google_cloud_lro::Poller;
946    ///
947    /// let builder = prepare_request_builder();
948    /// let response = builder.poller().until_done().await?;
949    /// # Ok(()) }
950    ///
951    /// fn prepare_request_builder() -> DeleteAddressGroup {
952    ///   # panic!();
953    ///   // ... details omitted ...
954    /// }
955    /// ```
956    #[derive(Clone, Debug)]
957    pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
958
959    impl DeleteAddressGroup {
960        pub(crate) fn new(
961            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
962        ) -> Self {
963            Self(RequestBuilder::new(stub))
964        }
965
966        /// Sets the full request, replacing any prior values.
967        pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
968            mut self,
969            v: V,
970        ) -> Self {
971            self.0.request = v.into();
972            self
973        }
974
975        /// Sets all the options, replacing any prior values.
976        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
977            self.0.options = v.into();
978            self
979        }
980
981        /// Sends the request.
982        ///
983        /// # Long running operations
984        ///
985        /// This starts, but does not poll, a longrunning operation. More information
986        /// on [delete_address_group][crate::client::AddressGroupService::delete_address_group].
987        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
988            (*self.0.stub)
989                .delete_address_group(self.0.request, self.0.options)
990                .await
991                .map(crate::Response::into_body)
992        }
993
994        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_address_group`.
995        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
996            type Operation =
997                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
998            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
999            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1000
1001            let stub = self.0.stub.clone();
1002            let mut options = self.0.options.clone();
1003            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1004            let query = move |name| {
1005                let stub = stub.clone();
1006                let options = options.clone();
1007                async {
1008                    let op = GetOperation::new(stub)
1009                        .set_name(name)
1010                        .with_options(options)
1011                        .send()
1012                        .await?;
1013                    Ok(Operation::new(op))
1014                }
1015            };
1016
1017            let start = move || async {
1018                let op = self.send().await?;
1019                Ok(Operation::new(op))
1020            };
1021
1022            google_cloud_lro::internal::new_unit_response_poller(
1023                polling_error_policy,
1024                polling_backoff_policy,
1025                start,
1026                query,
1027            )
1028        }
1029
1030        /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
1031        ///
1032        /// This is a **required** field for requests.
1033        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1034            self.0.request.name = v.into();
1035            self
1036        }
1037
1038        /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
1039        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1040            self.0.request.request_id = v.into();
1041            self
1042        }
1043    }
1044
1045    #[doc(hidden)]
1046    impl crate::RequestBuilder for DeleteAddressGroup {
1047        fn request_options(&mut self) -> &mut crate::RequestOptions {
1048            &mut self.0.options
1049        }
1050    }
1051
1052    /// The request builder for [AddressGroupService::list_address_group_references][crate::client::AddressGroupService::list_address_group_references] calls.
1053    ///
1054    /// # Example
1055    /// ```
1056    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListAddressGroupReferences;
1057    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1058    /// use google_cloud_gax::paginator::ItemPaginator;
1059    ///
1060    /// let builder = prepare_request_builder();
1061    /// let mut items = builder.by_item();
1062    /// while let Some(result) = items.next().await {
1063    ///   let item = result?;
1064    /// }
1065    /// # Ok(()) }
1066    ///
1067    /// fn prepare_request_builder() -> ListAddressGroupReferences {
1068    ///   # panic!();
1069    ///   // ... details omitted ...
1070    /// }
1071    /// ```
1072    #[derive(Clone, Debug)]
1073    pub struct ListAddressGroupReferences(
1074        RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
1075    );
1076
1077    impl ListAddressGroupReferences {
1078        pub(crate) fn new(
1079            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1080        ) -> Self {
1081            Self(RequestBuilder::new(stub))
1082        }
1083
1084        /// Sets the full request, replacing any prior values.
1085        pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
1086            mut self,
1087            v: V,
1088        ) -> Self {
1089            self.0.request = v.into();
1090            self
1091        }
1092
1093        /// Sets all the options, replacing any prior values.
1094        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1095            self.0.options = v.into();
1096            self
1097        }
1098
1099        /// Sends the request.
1100        pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
1101            (*self.0.stub)
1102                .list_address_group_references(self.0.request, self.0.options)
1103                .await
1104                .map(crate::Response::into_body)
1105        }
1106
1107        /// Streams each page in the collection.
1108        pub fn by_page(
1109            self,
1110        ) -> impl google_cloud_gax::paginator::Paginator<
1111            crate::model::ListAddressGroupReferencesResponse,
1112            crate::Error,
1113        > {
1114            use std::clone::Clone;
1115            let token = self.0.request.page_token.clone();
1116            let execute = move |token: String| {
1117                let mut builder = self.clone();
1118                builder.0.request = builder.0.request.set_page_token(token);
1119                builder.send()
1120            };
1121            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1122        }
1123
1124        /// Streams each item in the collection.
1125        pub fn by_item(
1126            self,
1127        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1128            crate::model::ListAddressGroupReferencesResponse,
1129            crate::Error,
1130        > {
1131            use google_cloud_gax::paginator::Paginator;
1132            self.by_page().items()
1133        }
1134
1135        /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
1136        ///
1137        /// This is a **required** field for requests.
1138        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
1139            self.0.request.address_group = v.into();
1140            self
1141        }
1142
1143        /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
1144        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1145            self.0.request.page_size = v.into();
1146            self
1147        }
1148
1149        /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
1150        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1151            self.0.request.page_token = v.into();
1152            self
1153        }
1154    }
1155
1156    #[doc(hidden)]
1157    impl crate::RequestBuilder for ListAddressGroupReferences {
1158        fn request_options(&mut self) -> &mut crate::RequestOptions {
1159            &mut self.0.options
1160        }
1161    }
1162
1163    /// The request builder for [AddressGroupService::list_locations][crate::client::AddressGroupService::list_locations] calls.
1164    ///
1165    /// # Example
1166    /// ```
1167    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListLocations;
1168    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1169    /// use google_cloud_gax::paginator::ItemPaginator;
1170    ///
1171    /// let builder = prepare_request_builder();
1172    /// let mut items = builder.by_item();
1173    /// while let Some(result) = items.next().await {
1174    ///   let item = result?;
1175    /// }
1176    /// # Ok(()) }
1177    ///
1178    /// fn prepare_request_builder() -> ListLocations {
1179    ///   # panic!();
1180    ///   // ... details omitted ...
1181    /// }
1182    /// ```
1183    #[derive(Clone, Debug)]
1184    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1185
1186    impl ListLocations {
1187        pub(crate) fn new(
1188            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1189        ) -> Self {
1190            Self(RequestBuilder::new(stub))
1191        }
1192
1193        /// Sets the full request, replacing any prior values.
1194        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1195            mut self,
1196            v: V,
1197        ) -> Self {
1198            self.0.request = v.into();
1199            self
1200        }
1201
1202        /// Sets all the options, replacing any prior values.
1203        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1204            self.0.options = v.into();
1205            self
1206        }
1207
1208        /// Sends the request.
1209        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1210            (*self.0.stub)
1211                .list_locations(self.0.request, self.0.options)
1212                .await
1213                .map(crate::Response::into_body)
1214        }
1215
1216        /// Streams each page in the collection.
1217        pub fn by_page(
1218            self,
1219        ) -> impl google_cloud_gax::paginator::Paginator<
1220            google_cloud_location::model::ListLocationsResponse,
1221            crate::Error,
1222        > {
1223            use std::clone::Clone;
1224            let token = self.0.request.page_token.clone();
1225            let execute = move |token: String| {
1226                let mut builder = self.clone();
1227                builder.0.request = builder.0.request.set_page_token(token);
1228                builder.send()
1229            };
1230            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1231        }
1232
1233        /// Streams each item in the collection.
1234        pub fn by_item(
1235            self,
1236        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1237            google_cloud_location::model::ListLocationsResponse,
1238            crate::Error,
1239        > {
1240            use google_cloud_gax::paginator::Paginator;
1241            self.by_page().items()
1242        }
1243
1244        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1245        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1246            self.0.request.name = v.into();
1247            self
1248        }
1249
1250        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1251        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1252            self.0.request.filter = v.into();
1253            self
1254        }
1255
1256        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1257        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1258            self.0.request.page_size = v.into();
1259            self
1260        }
1261
1262        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1263        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1264            self.0.request.page_token = v.into();
1265            self
1266        }
1267    }
1268
1269    #[doc(hidden)]
1270    impl crate::RequestBuilder for ListLocations {
1271        fn request_options(&mut self) -> &mut crate::RequestOptions {
1272            &mut self.0.options
1273        }
1274    }
1275
1276    /// The request builder for [AddressGroupService::get_location][crate::client::AddressGroupService::get_location] calls.
1277    ///
1278    /// # Example
1279    /// ```
1280    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetLocation;
1281    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1282    ///
1283    /// let builder = prepare_request_builder();
1284    /// let response = builder.send().await?;
1285    /// # Ok(()) }
1286    ///
1287    /// fn prepare_request_builder() -> GetLocation {
1288    ///   # panic!();
1289    ///   // ... details omitted ...
1290    /// }
1291    /// ```
1292    #[derive(Clone, Debug)]
1293    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1294
1295    impl GetLocation {
1296        pub(crate) fn new(
1297            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1298        ) -> Self {
1299            Self(RequestBuilder::new(stub))
1300        }
1301
1302        /// Sets the full request, replacing any prior values.
1303        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1304            mut self,
1305            v: V,
1306        ) -> Self {
1307            self.0.request = v.into();
1308            self
1309        }
1310
1311        /// Sets all the options, replacing any prior values.
1312        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1313            self.0.options = v.into();
1314            self
1315        }
1316
1317        /// Sends the request.
1318        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1319            (*self.0.stub)
1320                .get_location(self.0.request, self.0.options)
1321                .await
1322                .map(crate::Response::into_body)
1323        }
1324
1325        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1326        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1327            self.0.request.name = v.into();
1328            self
1329        }
1330    }
1331
1332    #[doc(hidden)]
1333    impl crate::RequestBuilder for GetLocation {
1334        fn request_options(&mut self) -> &mut crate::RequestOptions {
1335            &mut self.0.options
1336        }
1337    }
1338
1339    /// The request builder for [AddressGroupService::set_iam_policy][crate::client::AddressGroupService::set_iam_policy] calls.
1340    ///
1341    /// # Example
1342    /// ```
1343    /// # use google_cloud_networksecurity_v1::builder::address_group_service::SetIamPolicy;
1344    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1345    ///
1346    /// let builder = prepare_request_builder();
1347    /// let response = builder.send().await?;
1348    /// # Ok(()) }
1349    ///
1350    /// fn prepare_request_builder() -> SetIamPolicy {
1351    ///   # panic!();
1352    ///   // ... details omitted ...
1353    /// }
1354    /// ```
1355    #[derive(Clone, Debug)]
1356    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1357
1358    impl SetIamPolicy {
1359        pub(crate) fn new(
1360            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1361        ) -> Self {
1362            Self(RequestBuilder::new(stub))
1363        }
1364
1365        /// Sets the full request, replacing any prior values.
1366        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1367            mut self,
1368            v: V,
1369        ) -> Self {
1370            self.0.request = v.into();
1371            self
1372        }
1373
1374        /// Sets all the options, replacing any prior values.
1375        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1376            self.0.options = v.into();
1377            self
1378        }
1379
1380        /// Sends the request.
1381        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1382            (*self.0.stub)
1383                .set_iam_policy(self.0.request, self.0.options)
1384                .await
1385                .map(crate::Response::into_body)
1386        }
1387
1388        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
1389        ///
1390        /// This is a **required** field for requests.
1391        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1392            self.0.request.resource = v.into();
1393            self
1394        }
1395
1396        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1397        ///
1398        /// This is a **required** field for requests.
1399        pub fn set_policy<T>(mut self, v: T) -> Self
1400        where
1401            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1402        {
1403            self.0.request.policy = std::option::Option::Some(v.into());
1404            self
1405        }
1406
1407        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1408        ///
1409        /// This is a **required** field for requests.
1410        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1411        where
1412            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1413        {
1414            self.0.request.policy = v.map(|x| x.into());
1415            self
1416        }
1417
1418        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1419        pub fn set_update_mask<T>(mut self, v: T) -> Self
1420        where
1421            T: std::convert::Into<wkt::FieldMask>,
1422        {
1423            self.0.request.update_mask = std::option::Option::Some(v.into());
1424            self
1425        }
1426
1427        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1428        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1429        where
1430            T: std::convert::Into<wkt::FieldMask>,
1431        {
1432            self.0.request.update_mask = v.map(|x| x.into());
1433            self
1434        }
1435    }
1436
1437    #[doc(hidden)]
1438    impl crate::RequestBuilder for SetIamPolicy {
1439        fn request_options(&mut self) -> &mut crate::RequestOptions {
1440            &mut self.0.options
1441        }
1442    }
1443
1444    /// The request builder for [AddressGroupService::get_iam_policy][crate::client::AddressGroupService::get_iam_policy] calls.
1445    ///
1446    /// # Example
1447    /// ```
1448    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetIamPolicy;
1449    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1450    ///
1451    /// let builder = prepare_request_builder();
1452    /// let response = builder.send().await?;
1453    /// # Ok(()) }
1454    ///
1455    /// fn prepare_request_builder() -> GetIamPolicy {
1456    ///   # panic!();
1457    ///   // ... details omitted ...
1458    /// }
1459    /// ```
1460    #[derive(Clone, Debug)]
1461    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1462
1463    impl GetIamPolicy {
1464        pub(crate) fn new(
1465            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1466        ) -> Self {
1467            Self(RequestBuilder::new(stub))
1468        }
1469
1470        /// Sets the full request, replacing any prior values.
1471        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1472            mut self,
1473            v: V,
1474        ) -> Self {
1475            self.0.request = v.into();
1476            self
1477        }
1478
1479        /// Sets all the options, replacing any prior values.
1480        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1481            self.0.options = v.into();
1482            self
1483        }
1484
1485        /// Sends the request.
1486        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1487            (*self.0.stub)
1488                .get_iam_policy(self.0.request, self.0.options)
1489                .await
1490                .map(crate::Response::into_body)
1491        }
1492
1493        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
1494        ///
1495        /// This is a **required** field for requests.
1496        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1497            self.0.request.resource = v.into();
1498            self
1499        }
1500
1501        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1502        pub fn set_options<T>(mut self, v: T) -> Self
1503        where
1504            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1505        {
1506            self.0.request.options = std::option::Option::Some(v.into());
1507            self
1508        }
1509
1510        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1511        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1512        where
1513            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1514        {
1515            self.0.request.options = v.map(|x| x.into());
1516            self
1517        }
1518    }
1519
1520    #[doc(hidden)]
1521    impl crate::RequestBuilder for GetIamPolicy {
1522        fn request_options(&mut self) -> &mut crate::RequestOptions {
1523            &mut self.0.options
1524        }
1525    }
1526
1527    /// The request builder for [AddressGroupService::test_iam_permissions][crate::client::AddressGroupService::test_iam_permissions] calls.
1528    ///
1529    /// # Example
1530    /// ```
1531    /// # use google_cloud_networksecurity_v1::builder::address_group_service::TestIamPermissions;
1532    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1533    ///
1534    /// let builder = prepare_request_builder();
1535    /// let response = builder.send().await?;
1536    /// # Ok(()) }
1537    ///
1538    /// fn prepare_request_builder() -> TestIamPermissions {
1539    ///   # panic!();
1540    ///   // ... details omitted ...
1541    /// }
1542    /// ```
1543    #[derive(Clone, Debug)]
1544    pub struct TestIamPermissions(
1545        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1546    );
1547
1548    impl TestIamPermissions {
1549        pub(crate) fn new(
1550            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1551        ) -> Self {
1552            Self(RequestBuilder::new(stub))
1553        }
1554
1555        /// Sets the full request, replacing any prior values.
1556        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1557            mut self,
1558            v: V,
1559        ) -> Self {
1560            self.0.request = v.into();
1561            self
1562        }
1563
1564        /// Sets all the options, replacing any prior values.
1565        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1566            self.0.options = v.into();
1567            self
1568        }
1569
1570        /// Sends the request.
1571        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1572            (*self.0.stub)
1573                .test_iam_permissions(self.0.request, self.0.options)
1574                .await
1575                .map(crate::Response::into_body)
1576        }
1577
1578        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
1579        ///
1580        /// This is a **required** field for requests.
1581        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1582            self.0.request.resource = v.into();
1583            self
1584        }
1585
1586        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
1587        ///
1588        /// This is a **required** field for requests.
1589        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1590        where
1591            T: std::iter::IntoIterator<Item = V>,
1592            V: std::convert::Into<std::string::String>,
1593        {
1594            use std::iter::Iterator;
1595            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1596            self
1597        }
1598    }
1599
1600    #[doc(hidden)]
1601    impl crate::RequestBuilder for TestIamPermissions {
1602        fn request_options(&mut self) -> &mut crate::RequestOptions {
1603            &mut self.0.options
1604        }
1605    }
1606
1607    /// The request builder for [AddressGroupService::list_operations][crate::client::AddressGroupService::list_operations] calls.
1608    ///
1609    /// # Example
1610    /// ```
1611    /// # use google_cloud_networksecurity_v1::builder::address_group_service::ListOperations;
1612    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1613    /// use google_cloud_gax::paginator::ItemPaginator;
1614    ///
1615    /// let builder = prepare_request_builder();
1616    /// let mut items = builder.by_item();
1617    /// while let Some(result) = items.next().await {
1618    ///   let item = result?;
1619    /// }
1620    /// # Ok(()) }
1621    ///
1622    /// fn prepare_request_builder() -> ListOperations {
1623    ///   # panic!();
1624    ///   // ... details omitted ...
1625    /// }
1626    /// ```
1627    #[derive(Clone, Debug)]
1628    pub struct ListOperations(
1629        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1630    );
1631
1632    impl ListOperations {
1633        pub(crate) fn new(
1634            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1635        ) -> Self {
1636            Self(RequestBuilder::new(stub))
1637        }
1638
1639        /// Sets the full request, replacing any prior values.
1640        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1641            mut self,
1642            v: V,
1643        ) -> Self {
1644            self.0.request = v.into();
1645            self
1646        }
1647
1648        /// Sets all the options, replacing any prior values.
1649        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1650            self.0.options = v.into();
1651            self
1652        }
1653
1654        /// Sends the request.
1655        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1656            (*self.0.stub)
1657                .list_operations(self.0.request, self.0.options)
1658                .await
1659                .map(crate::Response::into_body)
1660        }
1661
1662        /// Streams each page in the collection.
1663        pub fn by_page(
1664            self,
1665        ) -> impl google_cloud_gax::paginator::Paginator<
1666            google_cloud_longrunning::model::ListOperationsResponse,
1667            crate::Error,
1668        > {
1669            use std::clone::Clone;
1670            let token = self.0.request.page_token.clone();
1671            let execute = move |token: String| {
1672                let mut builder = self.clone();
1673                builder.0.request = builder.0.request.set_page_token(token);
1674                builder.send()
1675            };
1676            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1677        }
1678
1679        /// Streams each item in the collection.
1680        pub fn by_item(
1681            self,
1682        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1683            google_cloud_longrunning::model::ListOperationsResponse,
1684            crate::Error,
1685        > {
1686            use google_cloud_gax::paginator::Paginator;
1687            self.by_page().items()
1688        }
1689
1690        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1691        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1692            self.0.request.name = v.into();
1693            self
1694        }
1695
1696        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1697        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1698            self.0.request.filter = v.into();
1699            self
1700        }
1701
1702        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1703        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1704            self.0.request.page_size = v.into();
1705            self
1706        }
1707
1708        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1709        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1710            self.0.request.page_token = v.into();
1711            self
1712        }
1713
1714        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1715        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1716            self.0.request.return_partial_success = v.into();
1717            self
1718        }
1719    }
1720
1721    #[doc(hidden)]
1722    impl crate::RequestBuilder for ListOperations {
1723        fn request_options(&mut self) -> &mut crate::RequestOptions {
1724            &mut self.0.options
1725        }
1726    }
1727
1728    /// The request builder for [AddressGroupService::get_operation][crate::client::AddressGroupService::get_operation] calls.
1729    ///
1730    /// # Example
1731    /// ```
1732    /// # use google_cloud_networksecurity_v1::builder::address_group_service::GetOperation;
1733    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1734    ///
1735    /// let builder = prepare_request_builder();
1736    /// let response = builder.send().await?;
1737    /// # Ok(()) }
1738    ///
1739    /// fn prepare_request_builder() -> GetOperation {
1740    ///   # panic!();
1741    ///   // ... details omitted ...
1742    /// }
1743    /// ```
1744    #[derive(Clone, Debug)]
1745    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1746
1747    impl GetOperation {
1748        pub(crate) fn new(
1749            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1750        ) -> Self {
1751            Self(RequestBuilder::new(stub))
1752        }
1753
1754        /// Sets the full request, replacing any prior values.
1755        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1756            mut self,
1757            v: V,
1758        ) -> Self {
1759            self.0.request = v.into();
1760            self
1761        }
1762
1763        /// Sets all the options, replacing any prior values.
1764        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1765            self.0.options = v.into();
1766            self
1767        }
1768
1769        /// Sends the request.
1770        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1771            (*self.0.stub)
1772                .get_operation(self.0.request, self.0.options)
1773                .await
1774                .map(crate::Response::into_body)
1775        }
1776
1777        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1778        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1779            self.0.request.name = v.into();
1780            self
1781        }
1782    }
1783
1784    #[doc(hidden)]
1785    impl crate::RequestBuilder for GetOperation {
1786        fn request_options(&mut self) -> &mut crate::RequestOptions {
1787            &mut self.0.options
1788        }
1789    }
1790
1791    /// The request builder for [AddressGroupService::delete_operation][crate::client::AddressGroupService::delete_operation] calls.
1792    ///
1793    /// # Example
1794    /// ```
1795    /// # use google_cloud_networksecurity_v1::builder::address_group_service::DeleteOperation;
1796    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1797    ///
1798    /// let builder = prepare_request_builder();
1799    /// let response = builder.send().await?;
1800    /// # Ok(()) }
1801    ///
1802    /// fn prepare_request_builder() -> DeleteOperation {
1803    ///   # panic!();
1804    ///   // ... details omitted ...
1805    /// }
1806    /// ```
1807    #[derive(Clone, Debug)]
1808    pub struct DeleteOperation(
1809        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1810    );
1811
1812    impl DeleteOperation {
1813        pub(crate) fn new(
1814            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1815        ) -> Self {
1816            Self(RequestBuilder::new(stub))
1817        }
1818
1819        /// Sets the full request, replacing any prior values.
1820        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1821            mut self,
1822            v: V,
1823        ) -> Self {
1824            self.0.request = v.into();
1825            self
1826        }
1827
1828        /// Sets all the options, replacing any prior values.
1829        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1830            self.0.options = v.into();
1831            self
1832        }
1833
1834        /// Sends the request.
1835        pub async fn send(self) -> Result<()> {
1836            (*self.0.stub)
1837                .delete_operation(self.0.request, self.0.options)
1838                .await
1839                .map(crate::Response::into_body)
1840        }
1841
1842        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
1843        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1844            self.0.request.name = v.into();
1845            self
1846        }
1847    }
1848
1849    #[doc(hidden)]
1850    impl crate::RequestBuilder for DeleteOperation {
1851        fn request_options(&mut self) -> &mut crate::RequestOptions {
1852            &mut self.0.options
1853        }
1854    }
1855
1856    /// The request builder for [AddressGroupService::cancel_operation][crate::client::AddressGroupService::cancel_operation] calls.
1857    ///
1858    /// # Example
1859    /// ```
1860    /// # use google_cloud_networksecurity_v1::builder::address_group_service::CancelOperation;
1861    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1862    ///
1863    /// let builder = prepare_request_builder();
1864    /// let response = builder.send().await?;
1865    /// # Ok(()) }
1866    ///
1867    /// fn prepare_request_builder() -> CancelOperation {
1868    ///   # panic!();
1869    ///   // ... details omitted ...
1870    /// }
1871    /// ```
1872    #[derive(Clone, Debug)]
1873    pub struct CancelOperation(
1874        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1875    );
1876
1877    impl CancelOperation {
1878        pub(crate) fn new(
1879            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1880        ) -> Self {
1881            Self(RequestBuilder::new(stub))
1882        }
1883
1884        /// Sets the full request, replacing any prior values.
1885        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1886            mut self,
1887            v: V,
1888        ) -> Self {
1889            self.0.request = v.into();
1890            self
1891        }
1892
1893        /// Sets all the options, replacing any prior values.
1894        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1895            self.0.options = v.into();
1896            self
1897        }
1898
1899        /// Sends the request.
1900        pub async fn send(self) -> Result<()> {
1901            (*self.0.stub)
1902                .cancel_operation(self.0.request, self.0.options)
1903                .await
1904                .map(crate::Response::into_body)
1905        }
1906
1907        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1908        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1909            self.0.request.name = v.into();
1910            self
1911        }
1912    }
1913
1914    #[doc(hidden)]
1915    impl crate::RequestBuilder for CancelOperation {
1916        fn request_options(&mut self) -> &mut crate::RequestOptions {
1917            &mut self.0.options
1918        }
1919    }
1920}
1921
1922/// Request and client builders for [OrganizationAddressGroupService][crate::client::OrganizationAddressGroupService].
1923pub mod organization_address_group_service {
1924    use crate::Result;
1925
1926    /// A builder for [OrganizationAddressGroupService][crate::client::OrganizationAddressGroupService].
1927    ///
1928    /// ```
1929    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1930    /// # use google_cloud_networksecurity_v1::*;
1931    /// # use builder::organization_address_group_service::ClientBuilder;
1932    /// # use client::OrganizationAddressGroupService;
1933    /// let builder : ClientBuilder = OrganizationAddressGroupService::builder();
1934    /// let client = builder
1935    ///     .with_endpoint("https://networksecurity.googleapis.com")
1936    ///     .build().await?;
1937    /// # Ok(()) }
1938    /// ```
1939    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1940
1941    pub(crate) mod client {
1942        use super::super::super::client::OrganizationAddressGroupService;
1943        pub struct Factory;
1944        impl crate::ClientFactory for Factory {
1945            type Client = OrganizationAddressGroupService;
1946            type Credentials = gaxi::options::Credentials;
1947            async fn build(
1948                self,
1949                config: gaxi::options::ClientConfig,
1950            ) -> crate::ClientBuilderResult<Self::Client> {
1951                Self::Client::new(config).await
1952            }
1953        }
1954    }
1955
1956    /// Common implementation for [crate::client::OrganizationAddressGroupService] request builders.
1957    #[derive(Clone, Debug)]
1958    pub(crate) struct RequestBuilder<R: std::default::Default> {
1959        stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1960        request: R,
1961        options: crate::RequestOptions,
1962    }
1963
1964    impl<R> RequestBuilder<R>
1965    where
1966        R: std::default::Default,
1967    {
1968        pub(crate) fn new(
1969            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1970        ) -> Self {
1971            Self {
1972                stub,
1973                request: R::default(),
1974                options: crate::RequestOptions::default(),
1975            }
1976        }
1977    }
1978
1979    /// The request builder for [OrganizationAddressGroupService::list_address_groups][crate::client::OrganizationAddressGroupService::list_address_groups] calls.
1980    ///
1981    /// # Example
1982    /// ```
1983    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListAddressGroups;
1984    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
1985    /// use google_cloud_gax::paginator::ItemPaginator;
1986    ///
1987    /// let builder = prepare_request_builder();
1988    /// let mut items = builder.by_item();
1989    /// while let Some(result) = items.next().await {
1990    ///   let item = result?;
1991    /// }
1992    /// # Ok(()) }
1993    ///
1994    /// fn prepare_request_builder() -> ListAddressGroups {
1995    ///   # panic!();
1996    ///   // ... details omitted ...
1997    /// }
1998    /// ```
1999    #[derive(Clone, Debug)]
2000    pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
2001
2002    impl ListAddressGroups {
2003        pub(crate) fn new(
2004            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2005        ) -> Self {
2006            Self(RequestBuilder::new(stub))
2007        }
2008
2009        /// Sets the full request, replacing any prior values.
2010        pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
2011            mut self,
2012            v: V,
2013        ) -> Self {
2014            self.0.request = v.into();
2015            self
2016        }
2017
2018        /// Sets all the options, replacing any prior values.
2019        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2020            self.0.options = v.into();
2021            self
2022        }
2023
2024        /// Sends the request.
2025        pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
2026            (*self.0.stub)
2027                .list_address_groups(self.0.request, self.0.options)
2028                .await
2029                .map(crate::Response::into_body)
2030        }
2031
2032        /// Streams each page in the collection.
2033        pub fn by_page(
2034            self,
2035        ) -> impl google_cloud_gax::paginator::Paginator<
2036            crate::model::ListAddressGroupsResponse,
2037            crate::Error,
2038        > {
2039            use std::clone::Clone;
2040            let token = self.0.request.page_token.clone();
2041            let execute = move |token: String| {
2042                let mut builder = self.clone();
2043                builder.0.request = builder.0.request.set_page_token(token);
2044                builder.send()
2045            };
2046            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2047        }
2048
2049        /// Streams each item in the collection.
2050        pub fn by_item(
2051            self,
2052        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2053            crate::model::ListAddressGroupsResponse,
2054            crate::Error,
2055        > {
2056            use google_cloud_gax::paginator::Paginator;
2057            self.by_page().items()
2058        }
2059
2060        /// Sets the value of [parent][crate::model::ListAddressGroupsRequest::parent].
2061        ///
2062        /// This is a **required** field for requests.
2063        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2064            self.0.request.parent = v.into();
2065            self
2066        }
2067
2068        /// Sets the value of [page_size][crate::model::ListAddressGroupsRequest::page_size].
2069        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2070            self.0.request.page_size = v.into();
2071            self
2072        }
2073
2074        /// Sets the value of [page_token][crate::model::ListAddressGroupsRequest::page_token].
2075        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2076            self.0.request.page_token = v.into();
2077            self
2078        }
2079
2080        /// Sets the value of [return_partial_success][crate::model::ListAddressGroupsRequest::return_partial_success].
2081        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2082            self.0.request.return_partial_success = v.into();
2083            self
2084        }
2085    }
2086
2087    #[doc(hidden)]
2088    impl crate::RequestBuilder for ListAddressGroups {
2089        fn request_options(&mut self) -> &mut crate::RequestOptions {
2090            &mut self.0.options
2091        }
2092    }
2093
2094    /// The request builder for [OrganizationAddressGroupService::get_address_group][crate::client::OrganizationAddressGroupService::get_address_group] calls.
2095    ///
2096    /// # Example
2097    /// ```
2098    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetAddressGroup;
2099    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2100    ///
2101    /// let builder = prepare_request_builder();
2102    /// let response = builder.send().await?;
2103    /// # Ok(()) }
2104    ///
2105    /// fn prepare_request_builder() -> GetAddressGroup {
2106    ///   # panic!();
2107    ///   // ... details omitted ...
2108    /// }
2109    /// ```
2110    #[derive(Clone, Debug)]
2111    pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
2112
2113    impl GetAddressGroup {
2114        pub(crate) fn new(
2115            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2116        ) -> Self {
2117            Self(RequestBuilder::new(stub))
2118        }
2119
2120        /// Sets the full request, replacing any prior values.
2121        pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
2122            self.0.request = v.into();
2123            self
2124        }
2125
2126        /// Sets all the options, replacing any prior values.
2127        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2128            self.0.options = v.into();
2129            self
2130        }
2131
2132        /// Sends the request.
2133        pub async fn send(self) -> Result<crate::model::AddressGroup> {
2134            (*self.0.stub)
2135                .get_address_group(self.0.request, self.0.options)
2136                .await
2137                .map(crate::Response::into_body)
2138        }
2139
2140        /// Sets the value of [name][crate::model::GetAddressGroupRequest::name].
2141        ///
2142        /// This is a **required** field for requests.
2143        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2144            self.0.request.name = v.into();
2145            self
2146        }
2147    }
2148
2149    #[doc(hidden)]
2150    impl crate::RequestBuilder for GetAddressGroup {
2151        fn request_options(&mut self) -> &mut crate::RequestOptions {
2152            &mut self.0.options
2153        }
2154    }
2155
2156    /// The request builder for [OrganizationAddressGroupService::create_address_group][crate::client::OrganizationAddressGroupService::create_address_group] calls.
2157    ///
2158    /// # Example
2159    /// ```
2160    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::CreateAddressGroup;
2161    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2162    /// use google_cloud_lro::Poller;
2163    ///
2164    /// let builder = prepare_request_builder();
2165    /// let response = builder.poller().until_done().await?;
2166    /// # Ok(()) }
2167    ///
2168    /// fn prepare_request_builder() -> CreateAddressGroup {
2169    ///   # panic!();
2170    ///   // ... details omitted ...
2171    /// }
2172    /// ```
2173    #[derive(Clone, Debug)]
2174    pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
2175
2176    impl CreateAddressGroup {
2177        pub(crate) fn new(
2178            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2179        ) -> Self {
2180            Self(RequestBuilder::new(stub))
2181        }
2182
2183        /// Sets the full request, replacing any prior values.
2184        pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
2185            mut self,
2186            v: V,
2187        ) -> Self {
2188            self.0.request = v.into();
2189            self
2190        }
2191
2192        /// Sets all the options, replacing any prior values.
2193        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2194            self.0.options = v.into();
2195            self
2196        }
2197
2198        /// Sends the request.
2199        ///
2200        /// # Long running operations
2201        ///
2202        /// This starts, but does not poll, a longrunning operation. More information
2203        /// on [create_address_group][crate::client::OrganizationAddressGroupService::create_address_group].
2204        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2205            (*self.0.stub)
2206                .create_address_group(self.0.request, self.0.options)
2207                .await
2208                .map(crate::Response::into_body)
2209        }
2210
2211        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_address_group`.
2212        pub fn poller(
2213            self,
2214        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2215        {
2216            type Operation = google_cloud_lro::internal::Operation<
2217                crate::model::AddressGroup,
2218                crate::model::OperationMetadata,
2219            >;
2220            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2221            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2222
2223            let stub = self.0.stub.clone();
2224            let mut options = self.0.options.clone();
2225            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2226            let query = move |name| {
2227                let stub = stub.clone();
2228                let options = options.clone();
2229                async {
2230                    let op = GetOperation::new(stub)
2231                        .set_name(name)
2232                        .with_options(options)
2233                        .send()
2234                        .await?;
2235                    Ok(Operation::new(op))
2236                }
2237            };
2238
2239            let start = move || async {
2240                let op = self.send().await?;
2241                Ok(Operation::new(op))
2242            };
2243
2244            google_cloud_lro::internal::new_poller(
2245                polling_error_policy,
2246                polling_backoff_policy,
2247                start,
2248                query,
2249            )
2250        }
2251
2252        /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
2253        ///
2254        /// This is a **required** field for requests.
2255        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2256            self.0.request.parent = v.into();
2257            self
2258        }
2259
2260        /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
2261        ///
2262        /// This is a **required** field for requests.
2263        pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2264            self.0.request.address_group_id = v.into();
2265            self
2266        }
2267
2268        /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
2269        ///
2270        /// This is a **required** field for requests.
2271        pub fn set_address_group<T>(mut self, v: T) -> Self
2272        where
2273            T: std::convert::Into<crate::model::AddressGroup>,
2274        {
2275            self.0.request.address_group = std::option::Option::Some(v.into());
2276            self
2277        }
2278
2279        /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
2280        ///
2281        /// This is a **required** field for requests.
2282        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2283        where
2284            T: std::convert::Into<crate::model::AddressGroup>,
2285        {
2286            self.0.request.address_group = v.map(|x| x.into());
2287            self
2288        }
2289
2290        /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
2291        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2292            self.0.request.request_id = v.into();
2293            self
2294        }
2295    }
2296
2297    #[doc(hidden)]
2298    impl crate::RequestBuilder for CreateAddressGroup {
2299        fn request_options(&mut self) -> &mut crate::RequestOptions {
2300            &mut self.0.options
2301        }
2302    }
2303
2304    /// The request builder for [OrganizationAddressGroupService::update_address_group][crate::client::OrganizationAddressGroupService::update_address_group] calls.
2305    ///
2306    /// # Example
2307    /// ```
2308    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::UpdateAddressGroup;
2309    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2310    /// use google_cloud_lro::Poller;
2311    ///
2312    /// let builder = prepare_request_builder();
2313    /// let response = builder.poller().until_done().await?;
2314    /// # Ok(()) }
2315    ///
2316    /// fn prepare_request_builder() -> UpdateAddressGroup {
2317    ///   # panic!();
2318    ///   // ... details omitted ...
2319    /// }
2320    /// ```
2321    #[derive(Clone, Debug)]
2322    pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
2323
2324    impl UpdateAddressGroup {
2325        pub(crate) fn new(
2326            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2327        ) -> Self {
2328            Self(RequestBuilder::new(stub))
2329        }
2330
2331        /// Sets the full request, replacing any prior values.
2332        pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
2333            mut self,
2334            v: V,
2335        ) -> Self {
2336            self.0.request = v.into();
2337            self
2338        }
2339
2340        /// Sets all the options, replacing any prior values.
2341        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2342            self.0.options = v.into();
2343            self
2344        }
2345
2346        /// Sends the request.
2347        ///
2348        /// # Long running operations
2349        ///
2350        /// This starts, but does not poll, a longrunning operation. More information
2351        /// on [update_address_group][crate::client::OrganizationAddressGroupService::update_address_group].
2352        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2353            (*self.0.stub)
2354                .update_address_group(self.0.request, self.0.options)
2355                .await
2356                .map(crate::Response::into_body)
2357        }
2358
2359        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_address_group`.
2360        pub fn poller(
2361            self,
2362        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2363        {
2364            type Operation = google_cloud_lro::internal::Operation<
2365                crate::model::AddressGroup,
2366                crate::model::OperationMetadata,
2367            >;
2368            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2369            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2370
2371            let stub = self.0.stub.clone();
2372            let mut options = self.0.options.clone();
2373            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2374            let query = move |name| {
2375                let stub = stub.clone();
2376                let options = options.clone();
2377                async {
2378                    let op = GetOperation::new(stub)
2379                        .set_name(name)
2380                        .with_options(options)
2381                        .send()
2382                        .await?;
2383                    Ok(Operation::new(op))
2384                }
2385            };
2386
2387            let start = move || async {
2388                let op = self.send().await?;
2389                Ok(Operation::new(op))
2390            };
2391
2392            google_cloud_lro::internal::new_poller(
2393                polling_error_policy,
2394                polling_backoff_policy,
2395                start,
2396                query,
2397            )
2398        }
2399
2400        /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
2401        pub fn set_update_mask<T>(mut self, v: T) -> Self
2402        where
2403            T: std::convert::Into<wkt::FieldMask>,
2404        {
2405            self.0.request.update_mask = std::option::Option::Some(v.into());
2406            self
2407        }
2408
2409        /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
2410        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2411        where
2412            T: std::convert::Into<wkt::FieldMask>,
2413        {
2414            self.0.request.update_mask = v.map(|x| x.into());
2415            self
2416        }
2417
2418        /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
2419        ///
2420        /// This is a **required** field for requests.
2421        pub fn set_address_group<T>(mut self, v: T) -> Self
2422        where
2423            T: std::convert::Into<crate::model::AddressGroup>,
2424        {
2425            self.0.request.address_group = std::option::Option::Some(v.into());
2426            self
2427        }
2428
2429        /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
2430        ///
2431        /// This is a **required** field for requests.
2432        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2433        where
2434            T: std::convert::Into<crate::model::AddressGroup>,
2435        {
2436            self.0.request.address_group = v.map(|x| x.into());
2437            self
2438        }
2439
2440        /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
2441        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2442            self.0.request.request_id = v.into();
2443            self
2444        }
2445    }
2446
2447    #[doc(hidden)]
2448    impl crate::RequestBuilder for UpdateAddressGroup {
2449        fn request_options(&mut self) -> &mut crate::RequestOptions {
2450            &mut self.0.options
2451        }
2452    }
2453
2454    /// The request builder for [OrganizationAddressGroupService::add_address_group_items][crate::client::OrganizationAddressGroupService::add_address_group_items] calls.
2455    ///
2456    /// # Example
2457    /// ```
2458    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::AddAddressGroupItems;
2459    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2460    /// use google_cloud_lro::Poller;
2461    ///
2462    /// let builder = prepare_request_builder();
2463    /// let response = builder.poller().until_done().await?;
2464    /// # Ok(()) }
2465    ///
2466    /// fn prepare_request_builder() -> AddAddressGroupItems {
2467    ///   # panic!();
2468    ///   // ... details omitted ...
2469    /// }
2470    /// ```
2471    #[derive(Clone, Debug)]
2472    pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
2473
2474    impl AddAddressGroupItems {
2475        pub(crate) fn new(
2476            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2477        ) -> Self {
2478            Self(RequestBuilder::new(stub))
2479        }
2480
2481        /// Sets the full request, replacing any prior values.
2482        pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
2483            mut self,
2484            v: V,
2485        ) -> Self {
2486            self.0.request = v.into();
2487            self
2488        }
2489
2490        /// Sets all the options, replacing any prior values.
2491        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2492            self.0.options = v.into();
2493            self
2494        }
2495
2496        /// Sends the request.
2497        ///
2498        /// # Long running operations
2499        ///
2500        /// This starts, but does not poll, a longrunning operation. More information
2501        /// on [add_address_group_items][crate::client::OrganizationAddressGroupService::add_address_group_items].
2502        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2503            (*self.0.stub)
2504                .add_address_group_items(self.0.request, self.0.options)
2505                .await
2506                .map(crate::Response::into_body)
2507        }
2508
2509        /// Creates a [Poller][google_cloud_lro::Poller] to work with `add_address_group_items`.
2510        pub fn poller(
2511            self,
2512        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2513        {
2514            type Operation = google_cloud_lro::internal::Operation<
2515                crate::model::AddressGroup,
2516                crate::model::OperationMetadata,
2517            >;
2518            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2519            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2520
2521            let stub = self.0.stub.clone();
2522            let mut options = self.0.options.clone();
2523            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2524            let query = move |name| {
2525                let stub = stub.clone();
2526                let options = options.clone();
2527                async {
2528                    let op = GetOperation::new(stub)
2529                        .set_name(name)
2530                        .with_options(options)
2531                        .send()
2532                        .await?;
2533                    Ok(Operation::new(op))
2534                }
2535            };
2536
2537            let start = move || async {
2538                let op = self.send().await?;
2539                Ok(Operation::new(op))
2540            };
2541
2542            google_cloud_lro::internal::new_poller(
2543                polling_error_policy,
2544                polling_backoff_policy,
2545                start,
2546                query,
2547            )
2548        }
2549
2550        /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
2551        ///
2552        /// This is a **required** field for requests.
2553        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2554            self.0.request.address_group = v.into();
2555            self
2556        }
2557
2558        /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
2559        ///
2560        /// This is a **required** field for requests.
2561        pub fn set_items<T, V>(mut self, v: T) -> Self
2562        where
2563            T: std::iter::IntoIterator<Item = V>,
2564            V: std::convert::Into<std::string::String>,
2565        {
2566            use std::iter::Iterator;
2567            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2568            self
2569        }
2570
2571        /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
2572        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2573            self.0.request.request_id = v.into();
2574            self
2575        }
2576    }
2577
2578    #[doc(hidden)]
2579    impl crate::RequestBuilder for AddAddressGroupItems {
2580        fn request_options(&mut self) -> &mut crate::RequestOptions {
2581            &mut self.0.options
2582        }
2583    }
2584
2585    /// The request builder for [OrganizationAddressGroupService::remove_address_group_items][crate::client::OrganizationAddressGroupService::remove_address_group_items] calls.
2586    ///
2587    /// # Example
2588    /// ```
2589    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::RemoveAddressGroupItems;
2590    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2591    /// use google_cloud_lro::Poller;
2592    ///
2593    /// let builder = prepare_request_builder();
2594    /// let response = builder.poller().until_done().await?;
2595    /// # Ok(()) }
2596    ///
2597    /// fn prepare_request_builder() -> RemoveAddressGroupItems {
2598    ///   # panic!();
2599    ///   // ... details omitted ...
2600    /// }
2601    /// ```
2602    #[derive(Clone, Debug)]
2603    pub struct RemoveAddressGroupItems(
2604        RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
2605    );
2606
2607    impl RemoveAddressGroupItems {
2608        pub(crate) fn new(
2609            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2610        ) -> Self {
2611            Self(RequestBuilder::new(stub))
2612        }
2613
2614        /// Sets the full request, replacing any prior values.
2615        pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
2616            mut self,
2617            v: V,
2618        ) -> Self {
2619            self.0.request = v.into();
2620            self
2621        }
2622
2623        /// Sets all the options, replacing any prior values.
2624        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2625            self.0.options = v.into();
2626            self
2627        }
2628
2629        /// Sends the request.
2630        ///
2631        /// # Long running operations
2632        ///
2633        /// This starts, but does not poll, a longrunning operation. More information
2634        /// on [remove_address_group_items][crate::client::OrganizationAddressGroupService::remove_address_group_items].
2635        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2636            (*self.0.stub)
2637                .remove_address_group_items(self.0.request, self.0.options)
2638                .await
2639                .map(crate::Response::into_body)
2640        }
2641
2642        /// Creates a [Poller][google_cloud_lro::Poller] to work with `remove_address_group_items`.
2643        pub fn poller(
2644            self,
2645        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2646        {
2647            type Operation = google_cloud_lro::internal::Operation<
2648                crate::model::AddressGroup,
2649                crate::model::OperationMetadata,
2650            >;
2651            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2652            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2653
2654            let stub = self.0.stub.clone();
2655            let mut options = self.0.options.clone();
2656            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2657            let query = move |name| {
2658                let stub = stub.clone();
2659                let options = options.clone();
2660                async {
2661                    let op = GetOperation::new(stub)
2662                        .set_name(name)
2663                        .with_options(options)
2664                        .send()
2665                        .await?;
2666                    Ok(Operation::new(op))
2667                }
2668            };
2669
2670            let start = move || async {
2671                let op = self.send().await?;
2672                Ok(Operation::new(op))
2673            };
2674
2675            google_cloud_lro::internal::new_poller(
2676                polling_error_policy,
2677                polling_backoff_policy,
2678                start,
2679                query,
2680            )
2681        }
2682
2683        /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
2684        ///
2685        /// This is a **required** field for requests.
2686        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2687            self.0.request.address_group = v.into();
2688            self
2689        }
2690
2691        /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
2692        ///
2693        /// This is a **required** field for requests.
2694        pub fn set_items<T, V>(mut self, v: T) -> Self
2695        where
2696            T: std::iter::IntoIterator<Item = V>,
2697            V: std::convert::Into<std::string::String>,
2698        {
2699            use std::iter::Iterator;
2700            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2701            self
2702        }
2703
2704        /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
2705        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2706            self.0.request.request_id = v.into();
2707            self
2708        }
2709    }
2710
2711    #[doc(hidden)]
2712    impl crate::RequestBuilder for RemoveAddressGroupItems {
2713        fn request_options(&mut self) -> &mut crate::RequestOptions {
2714            &mut self.0.options
2715        }
2716    }
2717
2718    /// The request builder for [OrganizationAddressGroupService::clone_address_group_items][crate::client::OrganizationAddressGroupService::clone_address_group_items] calls.
2719    ///
2720    /// # Example
2721    /// ```
2722    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::CloneAddressGroupItems;
2723    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2724    /// use google_cloud_lro::Poller;
2725    ///
2726    /// let builder = prepare_request_builder();
2727    /// let response = builder.poller().until_done().await?;
2728    /// # Ok(()) }
2729    ///
2730    /// fn prepare_request_builder() -> CloneAddressGroupItems {
2731    ///   # panic!();
2732    ///   // ... details omitted ...
2733    /// }
2734    /// ```
2735    #[derive(Clone, Debug)]
2736    pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
2737
2738    impl CloneAddressGroupItems {
2739        pub(crate) fn new(
2740            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2741        ) -> Self {
2742            Self(RequestBuilder::new(stub))
2743        }
2744
2745        /// Sets the full request, replacing any prior values.
2746        pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
2747            mut self,
2748            v: V,
2749        ) -> Self {
2750            self.0.request = v.into();
2751            self
2752        }
2753
2754        /// Sets all the options, replacing any prior values.
2755        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2756            self.0.options = v.into();
2757            self
2758        }
2759
2760        /// Sends the request.
2761        ///
2762        /// # Long running operations
2763        ///
2764        /// This starts, but does not poll, a longrunning operation. More information
2765        /// on [clone_address_group_items][crate::client::OrganizationAddressGroupService::clone_address_group_items].
2766        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2767            (*self.0.stub)
2768                .clone_address_group_items(self.0.request, self.0.options)
2769                .await
2770                .map(crate::Response::into_body)
2771        }
2772
2773        /// Creates a [Poller][google_cloud_lro::Poller] to work with `clone_address_group_items`.
2774        pub fn poller(
2775            self,
2776        ) -> impl google_cloud_lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata>
2777        {
2778            type Operation = google_cloud_lro::internal::Operation<
2779                crate::model::AddressGroup,
2780                crate::model::OperationMetadata,
2781            >;
2782            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2783            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2784
2785            let stub = self.0.stub.clone();
2786            let mut options = self.0.options.clone();
2787            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2788            let query = move |name| {
2789                let stub = stub.clone();
2790                let options = options.clone();
2791                async {
2792                    let op = GetOperation::new(stub)
2793                        .set_name(name)
2794                        .with_options(options)
2795                        .send()
2796                        .await?;
2797                    Ok(Operation::new(op))
2798                }
2799            };
2800
2801            let start = move || async {
2802                let op = self.send().await?;
2803                Ok(Operation::new(op))
2804            };
2805
2806            google_cloud_lro::internal::new_poller(
2807                polling_error_policy,
2808                polling_backoff_policy,
2809                start,
2810                query,
2811            )
2812        }
2813
2814        /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
2815        ///
2816        /// This is a **required** field for requests.
2817        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2818            self.0.request.address_group = v.into();
2819            self
2820        }
2821
2822        /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
2823        ///
2824        /// This is a **required** field for requests.
2825        pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2826            self.0.request.source_address_group = v.into();
2827            self
2828        }
2829
2830        /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
2831        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2832            self.0.request.request_id = v.into();
2833            self
2834        }
2835    }
2836
2837    #[doc(hidden)]
2838    impl crate::RequestBuilder for CloneAddressGroupItems {
2839        fn request_options(&mut self) -> &mut crate::RequestOptions {
2840            &mut self.0.options
2841        }
2842    }
2843
2844    /// The request builder for [OrganizationAddressGroupService::delete_address_group][crate::client::OrganizationAddressGroupService::delete_address_group] calls.
2845    ///
2846    /// # Example
2847    /// ```
2848    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::DeleteAddressGroup;
2849    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2850    /// use google_cloud_lro::Poller;
2851    ///
2852    /// let builder = prepare_request_builder();
2853    /// let response = builder.poller().until_done().await?;
2854    /// # Ok(()) }
2855    ///
2856    /// fn prepare_request_builder() -> DeleteAddressGroup {
2857    ///   # panic!();
2858    ///   // ... details omitted ...
2859    /// }
2860    /// ```
2861    #[derive(Clone, Debug)]
2862    pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
2863
2864    impl DeleteAddressGroup {
2865        pub(crate) fn new(
2866            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2867        ) -> Self {
2868            Self(RequestBuilder::new(stub))
2869        }
2870
2871        /// Sets the full request, replacing any prior values.
2872        pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
2873            mut self,
2874            v: V,
2875        ) -> Self {
2876            self.0.request = v.into();
2877            self
2878        }
2879
2880        /// Sets all the options, replacing any prior values.
2881        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2882            self.0.options = v.into();
2883            self
2884        }
2885
2886        /// Sends the request.
2887        ///
2888        /// # Long running operations
2889        ///
2890        /// This starts, but does not poll, a longrunning operation. More information
2891        /// on [delete_address_group][crate::client::OrganizationAddressGroupService::delete_address_group].
2892        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2893            (*self.0.stub)
2894                .delete_address_group(self.0.request, self.0.options)
2895                .await
2896                .map(crate::Response::into_body)
2897        }
2898
2899        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_address_group`.
2900        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2901            type Operation =
2902                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2903            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2904            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2905
2906            let stub = self.0.stub.clone();
2907            let mut options = self.0.options.clone();
2908            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2909            let query = move |name| {
2910                let stub = stub.clone();
2911                let options = options.clone();
2912                async {
2913                    let op = GetOperation::new(stub)
2914                        .set_name(name)
2915                        .with_options(options)
2916                        .send()
2917                        .await?;
2918                    Ok(Operation::new(op))
2919                }
2920            };
2921
2922            let start = move || async {
2923                let op = self.send().await?;
2924                Ok(Operation::new(op))
2925            };
2926
2927            google_cloud_lro::internal::new_unit_response_poller(
2928                polling_error_policy,
2929                polling_backoff_policy,
2930                start,
2931                query,
2932            )
2933        }
2934
2935        /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
2936        ///
2937        /// This is a **required** field for requests.
2938        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2939            self.0.request.name = v.into();
2940            self
2941        }
2942
2943        /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
2944        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2945            self.0.request.request_id = v.into();
2946            self
2947        }
2948    }
2949
2950    #[doc(hidden)]
2951    impl crate::RequestBuilder for DeleteAddressGroup {
2952        fn request_options(&mut self) -> &mut crate::RequestOptions {
2953            &mut self.0.options
2954        }
2955    }
2956
2957    /// The request builder for [OrganizationAddressGroupService::list_address_group_references][crate::client::OrganizationAddressGroupService::list_address_group_references] calls.
2958    ///
2959    /// # Example
2960    /// ```
2961    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListAddressGroupReferences;
2962    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
2963    /// use google_cloud_gax::paginator::ItemPaginator;
2964    ///
2965    /// let builder = prepare_request_builder();
2966    /// let mut items = builder.by_item();
2967    /// while let Some(result) = items.next().await {
2968    ///   let item = result?;
2969    /// }
2970    /// # Ok(()) }
2971    ///
2972    /// fn prepare_request_builder() -> ListAddressGroupReferences {
2973    ///   # panic!();
2974    ///   // ... details omitted ...
2975    /// }
2976    /// ```
2977    #[derive(Clone, Debug)]
2978    pub struct ListAddressGroupReferences(
2979        RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
2980    );
2981
2982    impl ListAddressGroupReferences {
2983        pub(crate) fn new(
2984            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2985        ) -> Self {
2986            Self(RequestBuilder::new(stub))
2987        }
2988
2989        /// Sets the full request, replacing any prior values.
2990        pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
2991            mut self,
2992            v: V,
2993        ) -> Self {
2994            self.0.request = v.into();
2995            self
2996        }
2997
2998        /// Sets all the options, replacing any prior values.
2999        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3000            self.0.options = v.into();
3001            self
3002        }
3003
3004        /// Sends the request.
3005        pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
3006            (*self.0.stub)
3007                .list_address_group_references(self.0.request, self.0.options)
3008                .await
3009                .map(crate::Response::into_body)
3010        }
3011
3012        /// Streams each page in the collection.
3013        pub fn by_page(
3014            self,
3015        ) -> impl google_cloud_gax::paginator::Paginator<
3016            crate::model::ListAddressGroupReferencesResponse,
3017            crate::Error,
3018        > {
3019            use std::clone::Clone;
3020            let token = self.0.request.page_token.clone();
3021            let execute = move |token: String| {
3022                let mut builder = self.clone();
3023                builder.0.request = builder.0.request.set_page_token(token);
3024                builder.send()
3025            };
3026            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3027        }
3028
3029        /// Streams each item in the collection.
3030        pub fn by_item(
3031            self,
3032        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3033            crate::model::ListAddressGroupReferencesResponse,
3034            crate::Error,
3035        > {
3036            use google_cloud_gax::paginator::Paginator;
3037            self.by_page().items()
3038        }
3039
3040        /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
3041        ///
3042        /// This is a **required** field for requests.
3043        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
3044            self.0.request.address_group = v.into();
3045            self
3046        }
3047
3048        /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
3049        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3050            self.0.request.page_size = v.into();
3051            self
3052        }
3053
3054        /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
3055        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3056            self.0.request.page_token = v.into();
3057            self
3058        }
3059    }
3060
3061    #[doc(hidden)]
3062    impl crate::RequestBuilder for ListAddressGroupReferences {
3063        fn request_options(&mut self) -> &mut crate::RequestOptions {
3064            &mut self.0.options
3065        }
3066    }
3067
3068    /// The request builder for [OrganizationAddressGroupService::list_locations][crate::client::OrganizationAddressGroupService::list_locations] calls.
3069    ///
3070    /// # Example
3071    /// ```
3072    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListLocations;
3073    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3074    /// use google_cloud_gax::paginator::ItemPaginator;
3075    ///
3076    /// let builder = prepare_request_builder();
3077    /// let mut items = builder.by_item();
3078    /// while let Some(result) = items.next().await {
3079    ///   let item = result?;
3080    /// }
3081    /// # Ok(()) }
3082    ///
3083    /// fn prepare_request_builder() -> ListLocations {
3084    ///   # panic!();
3085    ///   // ... details omitted ...
3086    /// }
3087    /// ```
3088    #[derive(Clone, Debug)]
3089    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3090
3091    impl ListLocations {
3092        pub(crate) fn new(
3093            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3094        ) -> Self {
3095            Self(RequestBuilder::new(stub))
3096        }
3097
3098        /// Sets the full request, replacing any prior values.
3099        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3100            mut self,
3101            v: V,
3102        ) -> Self {
3103            self.0.request = v.into();
3104            self
3105        }
3106
3107        /// Sets all the options, replacing any prior values.
3108        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3109            self.0.options = v.into();
3110            self
3111        }
3112
3113        /// Sends the request.
3114        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3115            (*self.0.stub)
3116                .list_locations(self.0.request, self.0.options)
3117                .await
3118                .map(crate::Response::into_body)
3119        }
3120
3121        /// Streams each page in the collection.
3122        pub fn by_page(
3123            self,
3124        ) -> impl google_cloud_gax::paginator::Paginator<
3125            google_cloud_location::model::ListLocationsResponse,
3126            crate::Error,
3127        > {
3128            use std::clone::Clone;
3129            let token = self.0.request.page_token.clone();
3130            let execute = move |token: String| {
3131                let mut builder = self.clone();
3132                builder.0.request = builder.0.request.set_page_token(token);
3133                builder.send()
3134            };
3135            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3136        }
3137
3138        /// Streams each item in the collection.
3139        pub fn by_item(
3140            self,
3141        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3142            google_cloud_location::model::ListLocationsResponse,
3143            crate::Error,
3144        > {
3145            use google_cloud_gax::paginator::Paginator;
3146            self.by_page().items()
3147        }
3148
3149        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
3150        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3151            self.0.request.name = v.into();
3152            self
3153        }
3154
3155        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
3156        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3157            self.0.request.filter = v.into();
3158            self
3159        }
3160
3161        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
3162        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3163            self.0.request.page_size = v.into();
3164            self
3165        }
3166
3167        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
3168        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3169            self.0.request.page_token = v.into();
3170            self
3171        }
3172    }
3173
3174    #[doc(hidden)]
3175    impl crate::RequestBuilder for ListLocations {
3176        fn request_options(&mut self) -> &mut crate::RequestOptions {
3177            &mut self.0.options
3178        }
3179    }
3180
3181    /// The request builder for [OrganizationAddressGroupService::get_location][crate::client::OrganizationAddressGroupService::get_location] calls.
3182    ///
3183    /// # Example
3184    /// ```
3185    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetLocation;
3186    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3187    ///
3188    /// let builder = prepare_request_builder();
3189    /// let response = builder.send().await?;
3190    /// # Ok(()) }
3191    ///
3192    /// fn prepare_request_builder() -> GetLocation {
3193    ///   # panic!();
3194    ///   // ... details omitted ...
3195    /// }
3196    /// ```
3197    #[derive(Clone, Debug)]
3198    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3199
3200    impl GetLocation {
3201        pub(crate) fn new(
3202            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3203        ) -> Self {
3204            Self(RequestBuilder::new(stub))
3205        }
3206
3207        /// Sets the full request, replacing any prior values.
3208        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3209            mut self,
3210            v: V,
3211        ) -> Self {
3212            self.0.request = v.into();
3213            self
3214        }
3215
3216        /// Sets all the options, replacing any prior values.
3217        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3218            self.0.options = v.into();
3219            self
3220        }
3221
3222        /// Sends the request.
3223        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3224            (*self.0.stub)
3225                .get_location(self.0.request, self.0.options)
3226                .await
3227                .map(crate::Response::into_body)
3228        }
3229
3230        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
3231        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3232            self.0.request.name = v.into();
3233            self
3234        }
3235    }
3236
3237    #[doc(hidden)]
3238    impl crate::RequestBuilder for GetLocation {
3239        fn request_options(&mut self) -> &mut crate::RequestOptions {
3240            &mut self.0.options
3241        }
3242    }
3243
3244    /// The request builder for [OrganizationAddressGroupService::set_iam_policy][crate::client::OrganizationAddressGroupService::set_iam_policy] calls.
3245    ///
3246    /// # Example
3247    /// ```
3248    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::SetIamPolicy;
3249    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3250    ///
3251    /// let builder = prepare_request_builder();
3252    /// let response = builder.send().await?;
3253    /// # Ok(()) }
3254    ///
3255    /// fn prepare_request_builder() -> SetIamPolicy {
3256    ///   # panic!();
3257    ///   // ... details omitted ...
3258    /// }
3259    /// ```
3260    #[derive(Clone, Debug)]
3261    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3262
3263    impl SetIamPolicy {
3264        pub(crate) fn new(
3265            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3266        ) -> Self {
3267            Self(RequestBuilder::new(stub))
3268        }
3269
3270        /// Sets the full request, replacing any prior values.
3271        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3272            mut self,
3273            v: V,
3274        ) -> Self {
3275            self.0.request = v.into();
3276            self
3277        }
3278
3279        /// Sets all the options, replacing any prior values.
3280        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3281            self.0.options = v.into();
3282            self
3283        }
3284
3285        /// Sends the request.
3286        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3287            (*self.0.stub)
3288                .set_iam_policy(self.0.request, self.0.options)
3289                .await
3290                .map(crate::Response::into_body)
3291        }
3292
3293        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
3294        ///
3295        /// This is a **required** field for requests.
3296        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3297            self.0.request.resource = v.into();
3298            self
3299        }
3300
3301        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3302        ///
3303        /// This is a **required** field for requests.
3304        pub fn set_policy<T>(mut self, v: T) -> Self
3305        where
3306            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3307        {
3308            self.0.request.policy = std::option::Option::Some(v.into());
3309            self
3310        }
3311
3312        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3313        ///
3314        /// This is a **required** field for requests.
3315        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3316        where
3317            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3318        {
3319            self.0.request.policy = v.map(|x| x.into());
3320            self
3321        }
3322
3323        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3324        pub fn set_update_mask<T>(mut self, v: T) -> Self
3325        where
3326            T: std::convert::Into<wkt::FieldMask>,
3327        {
3328            self.0.request.update_mask = std::option::Option::Some(v.into());
3329            self
3330        }
3331
3332        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3333        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3334        where
3335            T: std::convert::Into<wkt::FieldMask>,
3336        {
3337            self.0.request.update_mask = v.map(|x| x.into());
3338            self
3339        }
3340    }
3341
3342    #[doc(hidden)]
3343    impl crate::RequestBuilder for SetIamPolicy {
3344        fn request_options(&mut self) -> &mut crate::RequestOptions {
3345            &mut self.0.options
3346        }
3347    }
3348
3349    /// The request builder for [OrganizationAddressGroupService::get_iam_policy][crate::client::OrganizationAddressGroupService::get_iam_policy] calls.
3350    ///
3351    /// # Example
3352    /// ```
3353    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetIamPolicy;
3354    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3355    ///
3356    /// let builder = prepare_request_builder();
3357    /// let response = builder.send().await?;
3358    /// # Ok(()) }
3359    ///
3360    /// fn prepare_request_builder() -> GetIamPolicy {
3361    ///   # panic!();
3362    ///   // ... details omitted ...
3363    /// }
3364    /// ```
3365    #[derive(Clone, Debug)]
3366    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3367
3368    impl GetIamPolicy {
3369        pub(crate) fn new(
3370            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3371        ) -> Self {
3372            Self(RequestBuilder::new(stub))
3373        }
3374
3375        /// Sets the full request, replacing any prior values.
3376        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3377            mut self,
3378            v: V,
3379        ) -> Self {
3380            self.0.request = v.into();
3381            self
3382        }
3383
3384        /// Sets all the options, replacing any prior values.
3385        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3386            self.0.options = v.into();
3387            self
3388        }
3389
3390        /// Sends the request.
3391        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3392            (*self.0.stub)
3393                .get_iam_policy(self.0.request, self.0.options)
3394                .await
3395                .map(crate::Response::into_body)
3396        }
3397
3398        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
3399        ///
3400        /// This is a **required** field for requests.
3401        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3402            self.0.request.resource = v.into();
3403            self
3404        }
3405
3406        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3407        pub fn set_options<T>(mut self, v: T) -> Self
3408        where
3409            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3410        {
3411            self.0.request.options = std::option::Option::Some(v.into());
3412            self
3413        }
3414
3415        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3416        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3417        where
3418            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3419        {
3420            self.0.request.options = v.map(|x| x.into());
3421            self
3422        }
3423    }
3424
3425    #[doc(hidden)]
3426    impl crate::RequestBuilder for GetIamPolicy {
3427        fn request_options(&mut self) -> &mut crate::RequestOptions {
3428            &mut self.0.options
3429        }
3430    }
3431
3432    /// The request builder for [OrganizationAddressGroupService::test_iam_permissions][crate::client::OrganizationAddressGroupService::test_iam_permissions] calls.
3433    ///
3434    /// # Example
3435    /// ```
3436    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::TestIamPermissions;
3437    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3438    ///
3439    /// let builder = prepare_request_builder();
3440    /// let response = builder.send().await?;
3441    /// # Ok(()) }
3442    ///
3443    /// fn prepare_request_builder() -> TestIamPermissions {
3444    ///   # panic!();
3445    ///   // ... details omitted ...
3446    /// }
3447    /// ```
3448    #[derive(Clone, Debug)]
3449    pub struct TestIamPermissions(
3450        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3451    );
3452
3453    impl TestIamPermissions {
3454        pub(crate) fn new(
3455            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3456        ) -> Self {
3457            Self(RequestBuilder::new(stub))
3458        }
3459
3460        /// Sets the full request, replacing any prior values.
3461        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3462            mut self,
3463            v: V,
3464        ) -> Self {
3465            self.0.request = v.into();
3466            self
3467        }
3468
3469        /// Sets all the options, replacing any prior values.
3470        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3471            self.0.options = v.into();
3472            self
3473        }
3474
3475        /// Sends the request.
3476        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3477            (*self.0.stub)
3478                .test_iam_permissions(self.0.request, self.0.options)
3479                .await
3480                .map(crate::Response::into_body)
3481        }
3482
3483        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
3484        ///
3485        /// This is a **required** field for requests.
3486        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3487            self.0.request.resource = v.into();
3488            self
3489        }
3490
3491        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
3492        ///
3493        /// This is a **required** field for requests.
3494        pub fn set_permissions<T, V>(mut self, v: T) -> Self
3495        where
3496            T: std::iter::IntoIterator<Item = V>,
3497            V: std::convert::Into<std::string::String>,
3498        {
3499            use std::iter::Iterator;
3500            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3501            self
3502        }
3503    }
3504
3505    #[doc(hidden)]
3506    impl crate::RequestBuilder for TestIamPermissions {
3507        fn request_options(&mut self) -> &mut crate::RequestOptions {
3508            &mut self.0.options
3509        }
3510    }
3511
3512    /// The request builder for [OrganizationAddressGroupService::list_operations][crate::client::OrganizationAddressGroupService::list_operations] calls.
3513    ///
3514    /// # Example
3515    /// ```
3516    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::ListOperations;
3517    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3518    /// use google_cloud_gax::paginator::ItemPaginator;
3519    ///
3520    /// let builder = prepare_request_builder();
3521    /// let mut items = builder.by_item();
3522    /// while let Some(result) = items.next().await {
3523    ///   let item = result?;
3524    /// }
3525    /// # Ok(()) }
3526    ///
3527    /// fn prepare_request_builder() -> ListOperations {
3528    ///   # panic!();
3529    ///   // ... details omitted ...
3530    /// }
3531    /// ```
3532    #[derive(Clone, Debug)]
3533    pub struct ListOperations(
3534        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3535    );
3536
3537    impl ListOperations {
3538        pub(crate) fn new(
3539            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3540        ) -> Self {
3541            Self(RequestBuilder::new(stub))
3542        }
3543
3544        /// Sets the full request, replacing any prior values.
3545        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3546            mut self,
3547            v: V,
3548        ) -> Self {
3549            self.0.request = v.into();
3550            self
3551        }
3552
3553        /// Sets all the options, replacing any prior values.
3554        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3555            self.0.options = v.into();
3556            self
3557        }
3558
3559        /// Sends the request.
3560        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3561            (*self.0.stub)
3562                .list_operations(self.0.request, self.0.options)
3563                .await
3564                .map(crate::Response::into_body)
3565        }
3566
3567        /// Streams each page in the collection.
3568        pub fn by_page(
3569            self,
3570        ) -> impl google_cloud_gax::paginator::Paginator<
3571            google_cloud_longrunning::model::ListOperationsResponse,
3572            crate::Error,
3573        > {
3574            use std::clone::Clone;
3575            let token = self.0.request.page_token.clone();
3576            let execute = move |token: String| {
3577                let mut builder = self.clone();
3578                builder.0.request = builder.0.request.set_page_token(token);
3579                builder.send()
3580            };
3581            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3582        }
3583
3584        /// Streams each item in the collection.
3585        pub fn by_item(
3586            self,
3587        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3588            google_cloud_longrunning::model::ListOperationsResponse,
3589            crate::Error,
3590        > {
3591            use google_cloud_gax::paginator::Paginator;
3592            self.by_page().items()
3593        }
3594
3595        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3596        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3597            self.0.request.name = v.into();
3598            self
3599        }
3600
3601        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3602        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3603            self.0.request.filter = v.into();
3604            self
3605        }
3606
3607        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3608        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3609            self.0.request.page_size = v.into();
3610            self
3611        }
3612
3613        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3614        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3615            self.0.request.page_token = v.into();
3616            self
3617        }
3618
3619        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3620        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3621            self.0.request.return_partial_success = v.into();
3622            self
3623        }
3624    }
3625
3626    #[doc(hidden)]
3627    impl crate::RequestBuilder for ListOperations {
3628        fn request_options(&mut self) -> &mut crate::RequestOptions {
3629            &mut self.0.options
3630        }
3631    }
3632
3633    /// The request builder for [OrganizationAddressGroupService::get_operation][crate::client::OrganizationAddressGroupService::get_operation] calls.
3634    ///
3635    /// # Example
3636    /// ```
3637    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::GetOperation;
3638    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3639    ///
3640    /// let builder = prepare_request_builder();
3641    /// let response = builder.send().await?;
3642    /// # Ok(()) }
3643    ///
3644    /// fn prepare_request_builder() -> GetOperation {
3645    ///   # panic!();
3646    ///   // ... details omitted ...
3647    /// }
3648    /// ```
3649    #[derive(Clone, Debug)]
3650    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3651
3652    impl GetOperation {
3653        pub(crate) fn new(
3654            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3655        ) -> Self {
3656            Self(RequestBuilder::new(stub))
3657        }
3658
3659        /// Sets the full request, replacing any prior values.
3660        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3661            mut self,
3662            v: V,
3663        ) -> Self {
3664            self.0.request = v.into();
3665            self
3666        }
3667
3668        /// Sets all the options, replacing any prior values.
3669        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3670            self.0.options = v.into();
3671            self
3672        }
3673
3674        /// Sends the request.
3675        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3676            (*self.0.stub)
3677                .get_operation(self.0.request, self.0.options)
3678                .await
3679                .map(crate::Response::into_body)
3680        }
3681
3682        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3683        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3684            self.0.request.name = v.into();
3685            self
3686        }
3687    }
3688
3689    #[doc(hidden)]
3690    impl crate::RequestBuilder for GetOperation {
3691        fn request_options(&mut self) -> &mut crate::RequestOptions {
3692            &mut self.0.options
3693        }
3694    }
3695
3696    /// The request builder for [OrganizationAddressGroupService::delete_operation][crate::client::OrganizationAddressGroupService::delete_operation] calls.
3697    ///
3698    /// # Example
3699    /// ```
3700    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::DeleteOperation;
3701    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3702    ///
3703    /// let builder = prepare_request_builder();
3704    /// let response = builder.send().await?;
3705    /// # Ok(()) }
3706    ///
3707    /// fn prepare_request_builder() -> DeleteOperation {
3708    ///   # panic!();
3709    ///   // ... details omitted ...
3710    /// }
3711    /// ```
3712    #[derive(Clone, Debug)]
3713    pub struct DeleteOperation(
3714        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3715    );
3716
3717    impl DeleteOperation {
3718        pub(crate) fn new(
3719            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3720        ) -> Self {
3721            Self(RequestBuilder::new(stub))
3722        }
3723
3724        /// Sets the full request, replacing any prior values.
3725        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3726            mut self,
3727            v: V,
3728        ) -> Self {
3729            self.0.request = v.into();
3730            self
3731        }
3732
3733        /// Sets all the options, replacing any prior values.
3734        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3735            self.0.options = v.into();
3736            self
3737        }
3738
3739        /// Sends the request.
3740        pub async fn send(self) -> Result<()> {
3741            (*self.0.stub)
3742                .delete_operation(self.0.request, self.0.options)
3743                .await
3744                .map(crate::Response::into_body)
3745        }
3746
3747        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3748        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3749            self.0.request.name = v.into();
3750            self
3751        }
3752    }
3753
3754    #[doc(hidden)]
3755    impl crate::RequestBuilder for DeleteOperation {
3756        fn request_options(&mut self) -> &mut crate::RequestOptions {
3757            &mut self.0.options
3758        }
3759    }
3760
3761    /// The request builder for [OrganizationAddressGroupService::cancel_operation][crate::client::OrganizationAddressGroupService::cancel_operation] calls.
3762    ///
3763    /// # Example
3764    /// ```
3765    /// # use google_cloud_networksecurity_v1::builder::organization_address_group_service::CancelOperation;
3766    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3767    ///
3768    /// let builder = prepare_request_builder();
3769    /// let response = builder.send().await?;
3770    /// # Ok(()) }
3771    ///
3772    /// fn prepare_request_builder() -> CancelOperation {
3773    ///   # panic!();
3774    ///   // ... details omitted ...
3775    /// }
3776    /// ```
3777    #[derive(Clone, Debug)]
3778    pub struct CancelOperation(
3779        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3780    );
3781
3782    impl CancelOperation {
3783        pub(crate) fn new(
3784            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3785        ) -> Self {
3786            Self(RequestBuilder::new(stub))
3787        }
3788
3789        /// Sets the full request, replacing any prior values.
3790        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3791            mut self,
3792            v: V,
3793        ) -> Self {
3794            self.0.request = v.into();
3795            self
3796        }
3797
3798        /// Sets all the options, replacing any prior values.
3799        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3800            self.0.options = v.into();
3801            self
3802        }
3803
3804        /// Sends the request.
3805        pub async fn send(self) -> Result<()> {
3806            (*self.0.stub)
3807                .cancel_operation(self.0.request, self.0.options)
3808                .await
3809                .map(crate::Response::into_body)
3810        }
3811
3812        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3813        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3814            self.0.request.name = v.into();
3815            self
3816        }
3817    }
3818
3819    #[doc(hidden)]
3820    impl crate::RequestBuilder for CancelOperation {
3821        fn request_options(&mut self) -> &mut crate::RequestOptions {
3822            &mut self.0.options
3823        }
3824    }
3825}
3826
3827/// Request and client builders for [DnsThreatDetectorService][crate::client::DnsThreatDetectorService].
3828pub mod dns_threat_detector_service {
3829    use crate::Result;
3830
3831    /// A builder for [DnsThreatDetectorService][crate::client::DnsThreatDetectorService].
3832    ///
3833    /// ```
3834    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3835    /// # use google_cloud_networksecurity_v1::*;
3836    /// # use builder::dns_threat_detector_service::ClientBuilder;
3837    /// # use client::DnsThreatDetectorService;
3838    /// let builder : ClientBuilder = DnsThreatDetectorService::builder();
3839    /// let client = builder
3840    ///     .with_endpoint("https://networksecurity.googleapis.com")
3841    ///     .build().await?;
3842    /// # Ok(()) }
3843    /// ```
3844    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3845
3846    pub(crate) mod client {
3847        use super::super::super::client::DnsThreatDetectorService;
3848        pub struct Factory;
3849        impl crate::ClientFactory for Factory {
3850            type Client = DnsThreatDetectorService;
3851            type Credentials = gaxi::options::Credentials;
3852            async fn build(
3853                self,
3854                config: gaxi::options::ClientConfig,
3855            ) -> crate::ClientBuilderResult<Self::Client> {
3856                Self::Client::new(config).await
3857            }
3858        }
3859    }
3860
3861    /// Common implementation for [crate::client::DnsThreatDetectorService] request builders.
3862    #[derive(Clone, Debug)]
3863    pub(crate) struct RequestBuilder<R: std::default::Default> {
3864        stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3865        request: R,
3866        options: crate::RequestOptions,
3867    }
3868
3869    impl<R> RequestBuilder<R>
3870    where
3871        R: std::default::Default,
3872    {
3873        pub(crate) fn new(
3874            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3875        ) -> Self {
3876            Self {
3877                stub,
3878                request: R::default(),
3879                options: crate::RequestOptions::default(),
3880            }
3881        }
3882    }
3883
3884    /// The request builder for [DnsThreatDetectorService::list_dns_threat_detectors][crate::client::DnsThreatDetectorService::list_dns_threat_detectors] calls.
3885    ///
3886    /// # Example
3887    /// ```
3888    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::ListDnsThreatDetectors;
3889    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3890    /// use google_cloud_gax::paginator::ItemPaginator;
3891    ///
3892    /// let builder = prepare_request_builder();
3893    /// let mut items = builder.by_item();
3894    /// while let Some(result) = items.next().await {
3895    ///   let item = result?;
3896    /// }
3897    /// # Ok(()) }
3898    ///
3899    /// fn prepare_request_builder() -> ListDnsThreatDetectors {
3900    ///   # panic!();
3901    ///   // ... details omitted ...
3902    /// }
3903    /// ```
3904    #[derive(Clone, Debug)]
3905    pub struct ListDnsThreatDetectors(RequestBuilder<crate::model::ListDnsThreatDetectorsRequest>);
3906
3907    impl ListDnsThreatDetectors {
3908        pub(crate) fn new(
3909            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
3910        ) -> Self {
3911            Self(RequestBuilder::new(stub))
3912        }
3913
3914        /// Sets the full request, replacing any prior values.
3915        pub fn with_request<V: Into<crate::model::ListDnsThreatDetectorsRequest>>(
3916            mut self,
3917            v: V,
3918        ) -> Self {
3919            self.0.request = v.into();
3920            self
3921        }
3922
3923        /// Sets all the options, replacing any prior values.
3924        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3925            self.0.options = v.into();
3926            self
3927        }
3928
3929        /// Sends the request.
3930        pub async fn send(self) -> Result<crate::model::ListDnsThreatDetectorsResponse> {
3931            (*self.0.stub)
3932                .list_dns_threat_detectors(self.0.request, self.0.options)
3933                .await
3934                .map(crate::Response::into_body)
3935        }
3936
3937        /// Streams each page in the collection.
3938        pub fn by_page(
3939            self,
3940        ) -> impl google_cloud_gax::paginator::Paginator<
3941            crate::model::ListDnsThreatDetectorsResponse,
3942            crate::Error,
3943        > {
3944            use std::clone::Clone;
3945            let token = self.0.request.page_token.clone();
3946            let execute = move |token: String| {
3947                let mut builder = self.clone();
3948                builder.0.request = builder.0.request.set_page_token(token);
3949                builder.send()
3950            };
3951            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3952        }
3953
3954        /// Streams each item in the collection.
3955        pub fn by_item(
3956            self,
3957        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3958            crate::model::ListDnsThreatDetectorsResponse,
3959            crate::Error,
3960        > {
3961            use google_cloud_gax::paginator::Paginator;
3962            self.by_page().items()
3963        }
3964
3965        /// Sets the value of [parent][crate::model::ListDnsThreatDetectorsRequest::parent].
3966        ///
3967        /// This is a **required** field for requests.
3968        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3969            self.0.request.parent = v.into();
3970            self
3971        }
3972
3973        /// Sets the value of [page_size][crate::model::ListDnsThreatDetectorsRequest::page_size].
3974        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3975            self.0.request.page_size = v.into();
3976            self
3977        }
3978
3979        /// Sets the value of [page_token][crate::model::ListDnsThreatDetectorsRequest::page_token].
3980        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3981            self.0.request.page_token = v.into();
3982            self
3983        }
3984    }
3985
3986    #[doc(hidden)]
3987    impl crate::RequestBuilder for ListDnsThreatDetectors {
3988        fn request_options(&mut self) -> &mut crate::RequestOptions {
3989            &mut self.0.options
3990        }
3991    }
3992
3993    /// The request builder for [DnsThreatDetectorService::get_dns_threat_detector][crate::client::DnsThreatDetectorService::get_dns_threat_detector] calls.
3994    ///
3995    /// # Example
3996    /// ```
3997    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetDnsThreatDetector;
3998    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
3999    ///
4000    /// let builder = prepare_request_builder();
4001    /// let response = builder.send().await?;
4002    /// # Ok(()) }
4003    ///
4004    /// fn prepare_request_builder() -> GetDnsThreatDetector {
4005    ///   # panic!();
4006    ///   // ... details omitted ...
4007    /// }
4008    /// ```
4009    #[derive(Clone, Debug)]
4010    pub struct GetDnsThreatDetector(RequestBuilder<crate::model::GetDnsThreatDetectorRequest>);
4011
4012    impl GetDnsThreatDetector {
4013        pub(crate) fn new(
4014            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4015        ) -> Self {
4016            Self(RequestBuilder::new(stub))
4017        }
4018
4019        /// Sets the full request, replacing any prior values.
4020        pub fn with_request<V: Into<crate::model::GetDnsThreatDetectorRequest>>(
4021            mut self,
4022            v: V,
4023        ) -> Self {
4024            self.0.request = v.into();
4025            self
4026        }
4027
4028        /// Sets all the options, replacing any prior values.
4029        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4030            self.0.options = v.into();
4031            self
4032        }
4033
4034        /// Sends the request.
4035        pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4036            (*self.0.stub)
4037                .get_dns_threat_detector(self.0.request, self.0.options)
4038                .await
4039                .map(crate::Response::into_body)
4040        }
4041
4042        /// Sets the value of [name][crate::model::GetDnsThreatDetectorRequest::name].
4043        ///
4044        /// This is a **required** field for requests.
4045        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4046            self.0.request.name = v.into();
4047            self
4048        }
4049    }
4050
4051    #[doc(hidden)]
4052    impl crate::RequestBuilder for GetDnsThreatDetector {
4053        fn request_options(&mut self) -> &mut crate::RequestOptions {
4054            &mut self.0.options
4055        }
4056    }
4057
4058    /// The request builder for [DnsThreatDetectorService::create_dns_threat_detector][crate::client::DnsThreatDetectorService::create_dns_threat_detector] calls.
4059    ///
4060    /// # Example
4061    /// ```
4062    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::CreateDnsThreatDetector;
4063    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4064    ///
4065    /// let builder = prepare_request_builder();
4066    /// let response = builder.send().await?;
4067    /// # Ok(()) }
4068    ///
4069    /// fn prepare_request_builder() -> CreateDnsThreatDetector {
4070    ///   # panic!();
4071    ///   // ... details omitted ...
4072    /// }
4073    /// ```
4074    #[derive(Clone, Debug)]
4075    pub struct CreateDnsThreatDetector(
4076        RequestBuilder<crate::model::CreateDnsThreatDetectorRequest>,
4077    );
4078
4079    impl CreateDnsThreatDetector {
4080        pub(crate) fn new(
4081            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4082        ) -> Self {
4083            Self(RequestBuilder::new(stub))
4084        }
4085
4086        /// Sets the full request, replacing any prior values.
4087        pub fn with_request<V: Into<crate::model::CreateDnsThreatDetectorRequest>>(
4088            mut self,
4089            v: V,
4090        ) -> Self {
4091            self.0.request = v.into();
4092            self
4093        }
4094
4095        /// Sets all the options, replacing any prior values.
4096        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4097            self.0.options = v.into();
4098            self
4099        }
4100
4101        /// Sends the request.
4102        pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4103            (*self.0.stub)
4104                .create_dns_threat_detector(self.0.request, self.0.options)
4105                .await
4106                .map(crate::Response::into_body)
4107        }
4108
4109        /// Sets the value of [parent][crate::model::CreateDnsThreatDetectorRequest::parent].
4110        ///
4111        /// This is a **required** field for requests.
4112        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4113            self.0.request.parent = v.into();
4114            self
4115        }
4116
4117        /// Sets the value of [dns_threat_detector_id][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector_id].
4118        pub fn set_dns_threat_detector_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4119            self.0.request.dns_threat_detector_id = v.into();
4120            self
4121        }
4122
4123        /// Sets the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
4124        ///
4125        /// This is a **required** field for requests.
4126        pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4127        where
4128            T: std::convert::Into<crate::model::DnsThreatDetector>,
4129        {
4130            self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4131            self
4132        }
4133
4134        /// Sets or clears the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
4135        ///
4136        /// This is a **required** field for requests.
4137        pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4138        where
4139            T: std::convert::Into<crate::model::DnsThreatDetector>,
4140        {
4141            self.0.request.dns_threat_detector = v.map(|x| x.into());
4142            self
4143        }
4144    }
4145
4146    #[doc(hidden)]
4147    impl crate::RequestBuilder for CreateDnsThreatDetector {
4148        fn request_options(&mut self) -> &mut crate::RequestOptions {
4149            &mut self.0.options
4150        }
4151    }
4152
4153    /// The request builder for [DnsThreatDetectorService::update_dns_threat_detector][crate::client::DnsThreatDetectorService::update_dns_threat_detector] calls.
4154    ///
4155    /// # Example
4156    /// ```
4157    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::UpdateDnsThreatDetector;
4158    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4159    ///
4160    /// let builder = prepare_request_builder();
4161    /// let response = builder.send().await?;
4162    /// # Ok(()) }
4163    ///
4164    /// fn prepare_request_builder() -> UpdateDnsThreatDetector {
4165    ///   # panic!();
4166    ///   // ... details omitted ...
4167    /// }
4168    /// ```
4169    #[derive(Clone, Debug)]
4170    pub struct UpdateDnsThreatDetector(
4171        RequestBuilder<crate::model::UpdateDnsThreatDetectorRequest>,
4172    );
4173
4174    impl UpdateDnsThreatDetector {
4175        pub(crate) fn new(
4176            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4177        ) -> Self {
4178            Self(RequestBuilder::new(stub))
4179        }
4180
4181        /// Sets the full request, replacing any prior values.
4182        pub fn with_request<V: Into<crate::model::UpdateDnsThreatDetectorRequest>>(
4183            mut self,
4184            v: V,
4185        ) -> Self {
4186            self.0.request = v.into();
4187            self
4188        }
4189
4190        /// Sets all the options, replacing any prior values.
4191        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4192            self.0.options = v.into();
4193            self
4194        }
4195
4196        /// Sends the request.
4197        pub async fn send(self) -> Result<crate::model::DnsThreatDetector> {
4198            (*self.0.stub)
4199                .update_dns_threat_detector(self.0.request, self.0.options)
4200                .await
4201                .map(crate::Response::into_body)
4202        }
4203
4204        /// Sets the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
4205        pub fn set_update_mask<T>(mut self, v: T) -> Self
4206        where
4207            T: std::convert::Into<wkt::FieldMask>,
4208        {
4209            self.0.request.update_mask = std::option::Option::Some(v.into());
4210            self
4211        }
4212
4213        /// Sets or clears the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
4214        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4215        where
4216            T: std::convert::Into<wkt::FieldMask>,
4217        {
4218            self.0.request.update_mask = v.map(|x| x.into());
4219            self
4220        }
4221
4222        /// Sets the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
4223        ///
4224        /// This is a **required** field for requests.
4225        pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
4226        where
4227            T: std::convert::Into<crate::model::DnsThreatDetector>,
4228        {
4229            self.0.request.dns_threat_detector = std::option::Option::Some(v.into());
4230            self
4231        }
4232
4233        /// Sets or clears the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
4234        ///
4235        /// This is a **required** field for requests.
4236        pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
4237        where
4238            T: std::convert::Into<crate::model::DnsThreatDetector>,
4239        {
4240            self.0.request.dns_threat_detector = v.map(|x| x.into());
4241            self
4242        }
4243    }
4244
4245    #[doc(hidden)]
4246    impl crate::RequestBuilder for UpdateDnsThreatDetector {
4247        fn request_options(&mut self) -> &mut crate::RequestOptions {
4248            &mut self.0.options
4249        }
4250    }
4251
4252    /// The request builder for [DnsThreatDetectorService::delete_dns_threat_detector][crate::client::DnsThreatDetectorService::delete_dns_threat_detector] calls.
4253    ///
4254    /// # Example
4255    /// ```
4256    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::DeleteDnsThreatDetector;
4257    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4258    ///
4259    /// let builder = prepare_request_builder();
4260    /// let response = builder.send().await?;
4261    /// # Ok(()) }
4262    ///
4263    /// fn prepare_request_builder() -> DeleteDnsThreatDetector {
4264    ///   # panic!();
4265    ///   // ... details omitted ...
4266    /// }
4267    /// ```
4268    #[derive(Clone, Debug)]
4269    pub struct DeleteDnsThreatDetector(
4270        RequestBuilder<crate::model::DeleteDnsThreatDetectorRequest>,
4271    );
4272
4273    impl DeleteDnsThreatDetector {
4274        pub(crate) fn new(
4275            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4276        ) -> Self {
4277            Self(RequestBuilder::new(stub))
4278        }
4279
4280        /// Sets the full request, replacing any prior values.
4281        pub fn with_request<V: Into<crate::model::DeleteDnsThreatDetectorRequest>>(
4282            mut self,
4283            v: V,
4284        ) -> Self {
4285            self.0.request = v.into();
4286            self
4287        }
4288
4289        /// Sets all the options, replacing any prior values.
4290        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4291            self.0.options = v.into();
4292            self
4293        }
4294
4295        /// Sends the request.
4296        pub async fn send(self) -> Result<()> {
4297            (*self.0.stub)
4298                .delete_dns_threat_detector(self.0.request, self.0.options)
4299                .await
4300                .map(crate::Response::into_body)
4301        }
4302
4303        /// Sets the value of [name][crate::model::DeleteDnsThreatDetectorRequest::name].
4304        ///
4305        /// This is a **required** field for requests.
4306        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4307            self.0.request.name = v.into();
4308            self
4309        }
4310    }
4311
4312    #[doc(hidden)]
4313    impl crate::RequestBuilder for DeleteDnsThreatDetector {
4314        fn request_options(&mut self) -> &mut crate::RequestOptions {
4315            &mut self.0.options
4316        }
4317    }
4318
4319    /// The request builder for [DnsThreatDetectorService::list_locations][crate::client::DnsThreatDetectorService::list_locations] calls.
4320    ///
4321    /// # Example
4322    /// ```
4323    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::ListLocations;
4324    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4325    /// use google_cloud_gax::paginator::ItemPaginator;
4326    ///
4327    /// let builder = prepare_request_builder();
4328    /// let mut items = builder.by_item();
4329    /// while let Some(result) = items.next().await {
4330    ///   let item = result?;
4331    /// }
4332    /// # Ok(()) }
4333    ///
4334    /// fn prepare_request_builder() -> ListLocations {
4335    ///   # panic!();
4336    ///   // ... details omitted ...
4337    /// }
4338    /// ```
4339    #[derive(Clone, Debug)]
4340    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4341
4342    impl ListLocations {
4343        pub(crate) fn new(
4344            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4345        ) -> Self {
4346            Self(RequestBuilder::new(stub))
4347        }
4348
4349        /// Sets the full request, replacing any prior values.
4350        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4351            mut self,
4352            v: V,
4353        ) -> Self {
4354            self.0.request = v.into();
4355            self
4356        }
4357
4358        /// Sets all the options, replacing any prior values.
4359        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4360            self.0.options = v.into();
4361            self
4362        }
4363
4364        /// Sends the request.
4365        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4366            (*self.0.stub)
4367                .list_locations(self.0.request, self.0.options)
4368                .await
4369                .map(crate::Response::into_body)
4370        }
4371
4372        /// Streams each page in the collection.
4373        pub fn by_page(
4374            self,
4375        ) -> impl google_cloud_gax::paginator::Paginator<
4376            google_cloud_location::model::ListLocationsResponse,
4377            crate::Error,
4378        > {
4379            use std::clone::Clone;
4380            let token = self.0.request.page_token.clone();
4381            let execute = move |token: String| {
4382                let mut builder = self.clone();
4383                builder.0.request = builder.0.request.set_page_token(token);
4384                builder.send()
4385            };
4386            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4387        }
4388
4389        /// Streams each item in the collection.
4390        pub fn by_item(
4391            self,
4392        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4393            google_cloud_location::model::ListLocationsResponse,
4394            crate::Error,
4395        > {
4396            use google_cloud_gax::paginator::Paginator;
4397            self.by_page().items()
4398        }
4399
4400        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
4401        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4402            self.0.request.name = v.into();
4403            self
4404        }
4405
4406        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
4407        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4408            self.0.request.filter = v.into();
4409            self
4410        }
4411
4412        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
4413        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4414            self.0.request.page_size = v.into();
4415            self
4416        }
4417
4418        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
4419        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4420            self.0.request.page_token = v.into();
4421            self
4422        }
4423    }
4424
4425    #[doc(hidden)]
4426    impl crate::RequestBuilder for ListLocations {
4427        fn request_options(&mut self) -> &mut crate::RequestOptions {
4428            &mut self.0.options
4429        }
4430    }
4431
4432    /// The request builder for [DnsThreatDetectorService::get_location][crate::client::DnsThreatDetectorService::get_location] calls.
4433    ///
4434    /// # Example
4435    /// ```
4436    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetLocation;
4437    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4438    ///
4439    /// let builder = prepare_request_builder();
4440    /// let response = builder.send().await?;
4441    /// # Ok(()) }
4442    ///
4443    /// fn prepare_request_builder() -> GetLocation {
4444    ///   # panic!();
4445    ///   // ... details omitted ...
4446    /// }
4447    /// ```
4448    #[derive(Clone, Debug)]
4449    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4450
4451    impl GetLocation {
4452        pub(crate) fn new(
4453            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4454        ) -> Self {
4455            Self(RequestBuilder::new(stub))
4456        }
4457
4458        /// Sets the full request, replacing any prior values.
4459        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4460            mut self,
4461            v: V,
4462        ) -> Self {
4463            self.0.request = v.into();
4464            self
4465        }
4466
4467        /// Sets all the options, replacing any prior values.
4468        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4469            self.0.options = v.into();
4470            self
4471        }
4472
4473        /// Sends the request.
4474        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4475            (*self.0.stub)
4476                .get_location(self.0.request, self.0.options)
4477                .await
4478                .map(crate::Response::into_body)
4479        }
4480
4481        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
4482        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4483            self.0.request.name = v.into();
4484            self
4485        }
4486    }
4487
4488    #[doc(hidden)]
4489    impl crate::RequestBuilder for GetLocation {
4490        fn request_options(&mut self) -> &mut crate::RequestOptions {
4491            &mut self.0.options
4492        }
4493    }
4494
4495    /// The request builder for [DnsThreatDetectorService::set_iam_policy][crate::client::DnsThreatDetectorService::set_iam_policy] calls.
4496    ///
4497    /// # Example
4498    /// ```
4499    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::SetIamPolicy;
4500    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4501    ///
4502    /// let builder = prepare_request_builder();
4503    /// let response = builder.send().await?;
4504    /// # Ok(()) }
4505    ///
4506    /// fn prepare_request_builder() -> SetIamPolicy {
4507    ///   # panic!();
4508    ///   // ... details omitted ...
4509    /// }
4510    /// ```
4511    #[derive(Clone, Debug)]
4512    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4513
4514    impl SetIamPolicy {
4515        pub(crate) fn new(
4516            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4517        ) -> Self {
4518            Self(RequestBuilder::new(stub))
4519        }
4520
4521        /// Sets the full request, replacing any prior values.
4522        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4523            mut self,
4524            v: V,
4525        ) -> Self {
4526            self.0.request = v.into();
4527            self
4528        }
4529
4530        /// Sets all the options, replacing any prior values.
4531        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4532            self.0.options = v.into();
4533            self
4534        }
4535
4536        /// Sends the request.
4537        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4538            (*self.0.stub)
4539                .set_iam_policy(self.0.request, self.0.options)
4540                .await
4541                .map(crate::Response::into_body)
4542        }
4543
4544        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
4545        ///
4546        /// This is a **required** field for requests.
4547        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4548            self.0.request.resource = v.into();
4549            self
4550        }
4551
4552        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4553        ///
4554        /// This is a **required** field for requests.
4555        pub fn set_policy<T>(mut self, v: T) -> Self
4556        where
4557            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4558        {
4559            self.0.request.policy = std::option::Option::Some(v.into());
4560            self
4561        }
4562
4563        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4564        ///
4565        /// This is a **required** field for requests.
4566        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4567        where
4568            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4569        {
4570            self.0.request.policy = v.map(|x| x.into());
4571            self
4572        }
4573
4574        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4575        pub fn set_update_mask<T>(mut self, v: T) -> Self
4576        where
4577            T: std::convert::Into<wkt::FieldMask>,
4578        {
4579            self.0.request.update_mask = std::option::Option::Some(v.into());
4580            self
4581        }
4582
4583        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4584        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4585        where
4586            T: std::convert::Into<wkt::FieldMask>,
4587        {
4588            self.0.request.update_mask = v.map(|x| x.into());
4589            self
4590        }
4591    }
4592
4593    #[doc(hidden)]
4594    impl crate::RequestBuilder for SetIamPolicy {
4595        fn request_options(&mut self) -> &mut crate::RequestOptions {
4596            &mut self.0.options
4597        }
4598    }
4599
4600    /// The request builder for [DnsThreatDetectorService::get_iam_policy][crate::client::DnsThreatDetectorService::get_iam_policy] calls.
4601    ///
4602    /// # Example
4603    /// ```
4604    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetIamPolicy;
4605    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4606    ///
4607    /// let builder = prepare_request_builder();
4608    /// let response = builder.send().await?;
4609    /// # Ok(()) }
4610    ///
4611    /// fn prepare_request_builder() -> GetIamPolicy {
4612    ///   # panic!();
4613    ///   // ... details omitted ...
4614    /// }
4615    /// ```
4616    #[derive(Clone, Debug)]
4617    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4618
4619    impl GetIamPolicy {
4620        pub(crate) fn new(
4621            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4622        ) -> Self {
4623            Self(RequestBuilder::new(stub))
4624        }
4625
4626        /// Sets the full request, replacing any prior values.
4627        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4628            mut self,
4629            v: V,
4630        ) -> Self {
4631            self.0.request = v.into();
4632            self
4633        }
4634
4635        /// Sets all the options, replacing any prior values.
4636        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4637            self.0.options = v.into();
4638            self
4639        }
4640
4641        /// Sends the request.
4642        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4643            (*self.0.stub)
4644                .get_iam_policy(self.0.request, self.0.options)
4645                .await
4646                .map(crate::Response::into_body)
4647        }
4648
4649        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
4650        ///
4651        /// This is a **required** field for requests.
4652        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4653            self.0.request.resource = v.into();
4654            self
4655        }
4656
4657        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4658        pub fn set_options<T>(mut self, v: T) -> Self
4659        where
4660            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4661        {
4662            self.0.request.options = std::option::Option::Some(v.into());
4663            self
4664        }
4665
4666        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4667        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4668        where
4669            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4670        {
4671            self.0.request.options = v.map(|x| x.into());
4672            self
4673        }
4674    }
4675
4676    #[doc(hidden)]
4677    impl crate::RequestBuilder for GetIamPolicy {
4678        fn request_options(&mut self) -> &mut crate::RequestOptions {
4679            &mut self.0.options
4680        }
4681    }
4682
4683    /// The request builder for [DnsThreatDetectorService::test_iam_permissions][crate::client::DnsThreatDetectorService::test_iam_permissions] calls.
4684    ///
4685    /// # Example
4686    /// ```
4687    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::TestIamPermissions;
4688    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4689    ///
4690    /// let builder = prepare_request_builder();
4691    /// let response = builder.send().await?;
4692    /// # Ok(()) }
4693    ///
4694    /// fn prepare_request_builder() -> TestIamPermissions {
4695    ///   # panic!();
4696    ///   // ... details omitted ...
4697    /// }
4698    /// ```
4699    #[derive(Clone, Debug)]
4700    pub struct TestIamPermissions(
4701        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4702    );
4703
4704    impl TestIamPermissions {
4705        pub(crate) fn new(
4706            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4707        ) -> Self {
4708            Self(RequestBuilder::new(stub))
4709        }
4710
4711        /// Sets the full request, replacing any prior values.
4712        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4713            mut self,
4714            v: V,
4715        ) -> Self {
4716            self.0.request = v.into();
4717            self
4718        }
4719
4720        /// Sets all the options, replacing any prior values.
4721        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4722            self.0.options = v.into();
4723            self
4724        }
4725
4726        /// Sends the request.
4727        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4728            (*self.0.stub)
4729                .test_iam_permissions(self.0.request, self.0.options)
4730                .await
4731                .map(crate::Response::into_body)
4732        }
4733
4734        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
4735        ///
4736        /// This is a **required** field for requests.
4737        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4738            self.0.request.resource = v.into();
4739            self
4740        }
4741
4742        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
4743        ///
4744        /// This is a **required** field for requests.
4745        pub fn set_permissions<T, V>(mut self, v: T) -> Self
4746        where
4747            T: std::iter::IntoIterator<Item = V>,
4748            V: std::convert::Into<std::string::String>,
4749        {
4750            use std::iter::Iterator;
4751            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4752            self
4753        }
4754    }
4755
4756    #[doc(hidden)]
4757    impl crate::RequestBuilder for TestIamPermissions {
4758        fn request_options(&mut self) -> &mut crate::RequestOptions {
4759            &mut self.0.options
4760        }
4761    }
4762
4763    /// The request builder for [DnsThreatDetectorService::list_operations][crate::client::DnsThreatDetectorService::list_operations] calls.
4764    ///
4765    /// # Example
4766    /// ```
4767    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::ListOperations;
4768    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4769    /// use google_cloud_gax::paginator::ItemPaginator;
4770    ///
4771    /// let builder = prepare_request_builder();
4772    /// let mut items = builder.by_item();
4773    /// while let Some(result) = items.next().await {
4774    ///   let item = result?;
4775    /// }
4776    /// # Ok(()) }
4777    ///
4778    /// fn prepare_request_builder() -> ListOperations {
4779    ///   # panic!();
4780    ///   // ... details omitted ...
4781    /// }
4782    /// ```
4783    #[derive(Clone, Debug)]
4784    pub struct ListOperations(
4785        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4786    );
4787
4788    impl ListOperations {
4789        pub(crate) fn new(
4790            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4791        ) -> Self {
4792            Self(RequestBuilder::new(stub))
4793        }
4794
4795        /// Sets the full request, replacing any prior values.
4796        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4797            mut self,
4798            v: V,
4799        ) -> Self {
4800            self.0.request = v.into();
4801            self
4802        }
4803
4804        /// Sets all the options, replacing any prior values.
4805        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4806            self.0.options = v.into();
4807            self
4808        }
4809
4810        /// Sends the request.
4811        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4812            (*self.0.stub)
4813                .list_operations(self.0.request, self.0.options)
4814                .await
4815                .map(crate::Response::into_body)
4816        }
4817
4818        /// Streams each page in the collection.
4819        pub fn by_page(
4820            self,
4821        ) -> impl google_cloud_gax::paginator::Paginator<
4822            google_cloud_longrunning::model::ListOperationsResponse,
4823            crate::Error,
4824        > {
4825            use std::clone::Clone;
4826            let token = self.0.request.page_token.clone();
4827            let execute = move |token: String| {
4828                let mut builder = self.clone();
4829                builder.0.request = builder.0.request.set_page_token(token);
4830                builder.send()
4831            };
4832            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4833        }
4834
4835        /// Streams each item in the collection.
4836        pub fn by_item(
4837            self,
4838        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4839            google_cloud_longrunning::model::ListOperationsResponse,
4840            crate::Error,
4841        > {
4842            use google_cloud_gax::paginator::Paginator;
4843            self.by_page().items()
4844        }
4845
4846        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
4847        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4848            self.0.request.name = v.into();
4849            self
4850        }
4851
4852        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
4853        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4854            self.0.request.filter = v.into();
4855            self
4856        }
4857
4858        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
4859        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4860            self.0.request.page_size = v.into();
4861            self
4862        }
4863
4864        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
4865        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4866            self.0.request.page_token = v.into();
4867            self
4868        }
4869
4870        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
4871        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4872            self.0.request.return_partial_success = v.into();
4873            self
4874        }
4875    }
4876
4877    #[doc(hidden)]
4878    impl crate::RequestBuilder for ListOperations {
4879        fn request_options(&mut self) -> &mut crate::RequestOptions {
4880            &mut self.0.options
4881        }
4882    }
4883
4884    /// The request builder for [DnsThreatDetectorService::get_operation][crate::client::DnsThreatDetectorService::get_operation] calls.
4885    ///
4886    /// # Example
4887    /// ```
4888    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::GetOperation;
4889    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4890    ///
4891    /// let builder = prepare_request_builder();
4892    /// let response = builder.send().await?;
4893    /// # Ok(()) }
4894    ///
4895    /// fn prepare_request_builder() -> GetOperation {
4896    ///   # panic!();
4897    ///   // ... details omitted ...
4898    /// }
4899    /// ```
4900    #[derive(Clone, Debug)]
4901    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4902
4903    impl GetOperation {
4904        pub(crate) fn new(
4905            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4906        ) -> Self {
4907            Self(RequestBuilder::new(stub))
4908        }
4909
4910        /// Sets the full request, replacing any prior values.
4911        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4912            mut self,
4913            v: V,
4914        ) -> Self {
4915            self.0.request = v.into();
4916            self
4917        }
4918
4919        /// Sets all the options, replacing any prior values.
4920        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4921            self.0.options = v.into();
4922            self
4923        }
4924
4925        /// Sends the request.
4926        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4927            (*self.0.stub)
4928                .get_operation(self.0.request, self.0.options)
4929                .await
4930                .map(crate::Response::into_body)
4931        }
4932
4933        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4934        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4935            self.0.request.name = v.into();
4936            self
4937        }
4938    }
4939
4940    #[doc(hidden)]
4941    impl crate::RequestBuilder for GetOperation {
4942        fn request_options(&mut self) -> &mut crate::RequestOptions {
4943            &mut self.0.options
4944        }
4945    }
4946
4947    /// The request builder for [DnsThreatDetectorService::delete_operation][crate::client::DnsThreatDetectorService::delete_operation] calls.
4948    ///
4949    /// # Example
4950    /// ```
4951    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::DeleteOperation;
4952    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
4953    ///
4954    /// let builder = prepare_request_builder();
4955    /// let response = builder.send().await?;
4956    /// # Ok(()) }
4957    ///
4958    /// fn prepare_request_builder() -> DeleteOperation {
4959    ///   # panic!();
4960    ///   // ... details omitted ...
4961    /// }
4962    /// ```
4963    #[derive(Clone, Debug)]
4964    pub struct DeleteOperation(
4965        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4966    );
4967
4968    impl DeleteOperation {
4969        pub(crate) fn new(
4970            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
4971        ) -> Self {
4972            Self(RequestBuilder::new(stub))
4973        }
4974
4975        /// Sets the full request, replacing any prior values.
4976        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4977            mut self,
4978            v: V,
4979        ) -> Self {
4980            self.0.request = v.into();
4981            self
4982        }
4983
4984        /// Sets all the options, replacing any prior values.
4985        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4986            self.0.options = v.into();
4987            self
4988        }
4989
4990        /// Sends the request.
4991        pub async fn send(self) -> Result<()> {
4992            (*self.0.stub)
4993                .delete_operation(self.0.request, self.0.options)
4994                .await
4995                .map(crate::Response::into_body)
4996        }
4997
4998        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
4999        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5000            self.0.request.name = v.into();
5001            self
5002        }
5003    }
5004
5005    #[doc(hidden)]
5006    impl crate::RequestBuilder for DeleteOperation {
5007        fn request_options(&mut self) -> &mut crate::RequestOptions {
5008            &mut self.0.options
5009        }
5010    }
5011
5012    /// The request builder for [DnsThreatDetectorService::cancel_operation][crate::client::DnsThreatDetectorService::cancel_operation] calls.
5013    ///
5014    /// # Example
5015    /// ```
5016    /// # use google_cloud_networksecurity_v1::builder::dns_threat_detector_service::CancelOperation;
5017    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5018    ///
5019    /// let builder = prepare_request_builder();
5020    /// let response = builder.send().await?;
5021    /// # Ok(()) }
5022    ///
5023    /// fn prepare_request_builder() -> CancelOperation {
5024    ///   # panic!();
5025    ///   // ... details omitted ...
5026    /// }
5027    /// ```
5028    #[derive(Clone, Debug)]
5029    pub struct CancelOperation(
5030        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5031    );
5032
5033    impl CancelOperation {
5034        pub(crate) fn new(
5035            stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsThreatDetectorService>,
5036        ) -> Self {
5037            Self(RequestBuilder::new(stub))
5038        }
5039
5040        /// Sets the full request, replacing any prior values.
5041        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5042            mut self,
5043            v: V,
5044        ) -> Self {
5045            self.0.request = v.into();
5046            self
5047        }
5048
5049        /// Sets all the options, replacing any prior values.
5050        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5051            self.0.options = v.into();
5052            self
5053        }
5054
5055        /// Sends the request.
5056        pub async fn send(self) -> Result<()> {
5057            (*self.0.stub)
5058                .cancel_operation(self.0.request, self.0.options)
5059                .await
5060                .map(crate::Response::into_body)
5061        }
5062
5063        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5064        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5065            self.0.request.name = v.into();
5066            self
5067        }
5068    }
5069
5070    #[doc(hidden)]
5071    impl crate::RequestBuilder for CancelOperation {
5072        fn request_options(&mut self) -> &mut crate::RequestOptions {
5073            &mut self.0.options
5074        }
5075    }
5076}
5077
5078/// Request and client builders for [FirewallActivation][crate::client::FirewallActivation].
5079pub mod firewall_activation {
5080    use crate::Result;
5081
5082    /// A builder for [FirewallActivation][crate::client::FirewallActivation].
5083    ///
5084    /// ```
5085    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5086    /// # use google_cloud_networksecurity_v1::*;
5087    /// # use builder::firewall_activation::ClientBuilder;
5088    /// # use client::FirewallActivation;
5089    /// let builder : ClientBuilder = FirewallActivation::builder();
5090    /// let client = builder
5091    ///     .with_endpoint("https://networksecurity.googleapis.com")
5092    ///     .build().await?;
5093    /// # Ok(()) }
5094    /// ```
5095    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5096
5097    pub(crate) mod client {
5098        use super::super::super::client::FirewallActivation;
5099        pub struct Factory;
5100        impl crate::ClientFactory for Factory {
5101            type Client = FirewallActivation;
5102            type Credentials = gaxi::options::Credentials;
5103            async fn build(
5104                self,
5105                config: gaxi::options::ClientConfig,
5106            ) -> crate::ClientBuilderResult<Self::Client> {
5107                Self::Client::new(config).await
5108            }
5109        }
5110    }
5111
5112    /// Common implementation for [crate::client::FirewallActivation] request builders.
5113    #[derive(Clone, Debug)]
5114    pub(crate) struct RequestBuilder<R: std::default::Default> {
5115        stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5116        request: R,
5117        options: crate::RequestOptions,
5118    }
5119
5120    impl<R> RequestBuilder<R>
5121    where
5122        R: std::default::Default,
5123    {
5124        pub(crate) fn new(
5125            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5126        ) -> Self {
5127            Self {
5128                stub,
5129                request: R::default(),
5130                options: crate::RequestOptions::default(),
5131            }
5132        }
5133    }
5134
5135    /// The request builder for [FirewallActivation::list_firewall_endpoints][crate::client::FirewallActivation::list_firewall_endpoints] calls.
5136    ///
5137    /// # Example
5138    /// ```
5139    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListFirewallEndpoints;
5140    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5141    /// use google_cloud_gax::paginator::ItemPaginator;
5142    ///
5143    /// let builder = prepare_request_builder();
5144    /// let mut items = builder.by_item();
5145    /// while let Some(result) = items.next().await {
5146    ///   let item = result?;
5147    /// }
5148    /// # Ok(()) }
5149    ///
5150    /// fn prepare_request_builder() -> ListFirewallEndpoints {
5151    ///   # panic!();
5152    ///   // ... details omitted ...
5153    /// }
5154    /// ```
5155    #[derive(Clone, Debug)]
5156    pub struct ListFirewallEndpoints(RequestBuilder<crate::model::ListFirewallEndpointsRequest>);
5157
5158    impl ListFirewallEndpoints {
5159        pub(crate) fn new(
5160            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5161        ) -> Self {
5162            Self(RequestBuilder::new(stub))
5163        }
5164
5165        /// Sets the full request, replacing any prior values.
5166        pub fn with_request<V: Into<crate::model::ListFirewallEndpointsRequest>>(
5167            mut self,
5168            v: V,
5169        ) -> Self {
5170            self.0.request = v.into();
5171            self
5172        }
5173
5174        /// Sets all the options, replacing any prior values.
5175        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5176            self.0.options = v.into();
5177            self
5178        }
5179
5180        /// Sends the request.
5181        pub async fn send(self) -> Result<crate::model::ListFirewallEndpointsResponse> {
5182            (*self.0.stub)
5183                .list_firewall_endpoints(self.0.request, self.0.options)
5184                .await
5185                .map(crate::Response::into_body)
5186        }
5187
5188        /// Streams each page in the collection.
5189        pub fn by_page(
5190            self,
5191        ) -> impl google_cloud_gax::paginator::Paginator<
5192            crate::model::ListFirewallEndpointsResponse,
5193            crate::Error,
5194        > {
5195            use std::clone::Clone;
5196            let token = self.0.request.page_token.clone();
5197            let execute = move |token: String| {
5198                let mut builder = self.clone();
5199                builder.0.request = builder.0.request.set_page_token(token);
5200                builder.send()
5201            };
5202            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5203        }
5204
5205        /// Streams each item in the collection.
5206        pub fn by_item(
5207            self,
5208        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5209            crate::model::ListFirewallEndpointsResponse,
5210            crate::Error,
5211        > {
5212            use google_cloud_gax::paginator::Paginator;
5213            self.by_page().items()
5214        }
5215
5216        /// Sets the value of [parent][crate::model::ListFirewallEndpointsRequest::parent].
5217        ///
5218        /// This is a **required** field for requests.
5219        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5220            self.0.request.parent = v.into();
5221            self
5222        }
5223
5224        /// Sets the value of [page_size][crate::model::ListFirewallEndpointsRequest::page_size].
5225        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5226            self.0.request.page_size = v.into();
5227            self
5228        }
5229
5230        /// Sets the value of [page_token][crate::model::ListFirewallEndpointsRequest::page_token].
5231        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5232            self.0.request.page_token = v.into();
5233            self
5234        }
5235
5236        /// Sets the value of [filter][crate::model::ListFirewallEndpointsRequest::filter].
5237        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5238            self.0.request.filter = v.into();
5239            self
5240        }
5241
5242        /// Sets the value of [order_by][crate::model::ListFirewallEndpointsRequest::order_by].
5243        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5244            self.0.request.order_by = v.into();
5245            self
5246        }
5247    }
5248
5249    #[doc(hidden)]
5250    impl crate::RequestBuilder for ListFirewallEndpoints {
5251        fn request_options(&mut self) -> &mut crate::RequestOptions {
5252            &mut self.0.options
5253        }
5254    }
5255
5256    /// The request builder for [FirewallActivation::list_project_firewall_endpoints][crate::client::FirewallActivation::list_project_firewall_endpoints] calls.
5257    ///
5258    /// # Example
5259    /// ```
5260    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListProjectFirewallEndpoints;
5261    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5262    /// use google_cloud_gax::paginator::ItemPaginator;
5263    ///
5264    /// let builder = prepare_request_builder();
5265    /// let mut items = builder.by_item();
5266    /// while let Some(result) = items.next().await {
5267    ///   let item = result?;
5268    /// }
5269    /// # Ok(()) }
5270    ///
5271    /// fn prepare_request_builder() -> ListProjectFirewallEndpoints {
5272    ///   # panic!();
5273    ///   // ... details omitted ...
5274    /// }
5275    /// ```
5276    #[derive(Clone, Debug)]
5277    pub struct ListProjectFirewallEndpoints(
5278        RequestBuilder<crate::model::ListFirewallEndpointsRequest>,
5279    );
5280
5281    impl ListProjectFirewallEndpoints {
5282        pub(crate) fn new(
5283            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5284        ) -> Self {
5285            Self(RequestBuilder::new(stub))
5286        }
5287
5288        /// Sets the full request, replacing any prior values.
5289        pub fn with_request<V: Into<crate::model::ListFirewallEndpointsRequest>>(
5290            mut self,
5291            v: V,
5292        ) -> Self {
5293            self.0.request = v.into();
5294            self
5295        }
5296
5297        /// Sets all the options, replacing any prior values.
5298        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5299            self.0.options = v.into();
5300            self
5301        }
5302
5303        /// Sends the request.
5304        pub async fn send(self) -> Result<crate::model::ListFirewallEndpointsResponse> {
5305            (*self.0.stub)
5306                .list_project_firewall_endpoints(self.0.request, self.0.options)
5307                .await
5308                .map(crate::Response::into_body)
5309        }
5310
5311        /// Streams each page in the collection.
5312        pub fn by_page(
5313            self,
5314        ) -> impl google_cloud_gax::paginator::Paginator<
5315            crate::model::ListFirewallEndpointsResponse,
5316            crate::Error,
5317        > {
5318            use std::clone::Clone;
5319            let token = self.0.request.page_token.clone();
5320            let execute = move |token: String| {
5321                let mut builder = self.clone();
5322                builder.0.request = builder.0.request.set_page_token(token);
5323                builder.send()
5324            };
5325            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5326        }
5327
5328        /// Streams each item in the collection.
5329        pub fn by_item(
5330            self,
5331        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5332            crate::model::ListFirewallEndpointsResponse,
5333            crate::Error,
5334        > {
5335            use google_cloud_gax::paginator::Paginator;
5336            self.by_page().items()
5337        }
5338
5339        /// Sets the value of [parent][crate::model::ListFirewallEndpointsRequest::parent].
5340        ///
5341        /// This is a **required** field for requests.
5342        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5343            self.0.request.parent = v.into();
5344            self
5345        }
5346
5347        /// Sets the value of [page_size][crate::model::ListFirewallEndpointsRequest::page_size].
5348        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5349            self.0.request.page_size = v.into();
5350            self
5351        }
5352
5353        /// Sets the value of [page_token][crate::model::ListFirewallEndpointsRequest::page_token].
5354        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5355            self.0.request.page_token = v.into();
5356            self
5357        }
5358
5359        /// Sets the value of [filter][crate::model::ListFirewallEndpointsRequest::filter].
5360        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5361            self.0.request.filter = v.into();
5362            self
5363        }
5364
5365        /// Sets the value of [order_by][crate::model::ListFirewallEndpointsRequest::order_by].
5366        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5367            self.0.request.order_by = v.into();
5368            self
5369        }
5370    }
5371
5372    #[doc(hidden)]
5373    impl crate::RequestBuilder for ListProjectFirewallEndpoints {
5374        fn request_options(&mut self) -> &mut crate::RequestOptions {
5375            &mut self.0.options
5376        }
5377    }
5378
5379    /// The request builder for [FirewallActivation::get_firewall_endpoint][crate::client::FirewallActivation::get_firewall_endpoint] calls.
5380    ///
5381    /// # Example
5382    /// ```
5383    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetFirewallEndpoint;
5384    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5385    ///
5386    /// let builder = prepare_request_builder();
5387    /// let response = builder.send().await?;
5388    /// # Ok(()) }
5389    ///
5390    /// fn prepare_request_builder() -> GetFirewallEndpoint {
5391    ///   # panic!();
5392    ///   // ... details omitted ...
5393    /// }
5394    /// ```
5395    #[derive(Clone, Debug)]
5396    pub struct GetFirewallEndpoint(RequestBuilder<crate::model::GetFirewallEndpointRequest>);
5397
5398    impl GetFirewallEndpoint {
5399        pub(crate) fn new(
5400            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5401        ) -> Self {
5402            Self(RequestBuilder::new(stub))
5403        }
5404
5405        /// Sets the full request, replacing any prior values.
5406        pub fn with_request<V: Into<crate::model::GetFirewallEndpointRequest>>(
5407            mut self,
5408            v: V,
5409        ) -> Self {
5410            self.0.request = v.into();
5411            self
5412        }
5413
5414        /// Sets all the options, replacing any prior values.
5415        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5416            self.0.options = v.into();
5417            self
5418        }
5419
5420        /// Sends the request.
5421        pub async fn send(self) -> Result<crate::model::FirewallEndpoint> {
5422            (*self.0.stub)
5423                .get_firewall_endpoint(self.0.request, self.0.options)
5424                .await
5425                .map(crate::Response::into_body)
5426        }
5427
5428        /// Sets the value of [name][crate::model::GetFirewallEndpointRequest::name].
5429        ///
5430        /// This is a **required** field for requests.
5431        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5432            self.0.request.name = v.into();
5433            self
5434        }
5435    }
5436
5437    #[doc(hidden)]
5438    impl crate::RequestBuilder for GetFirewallEndpoint {
5439        fn request_options(&mut self) -> &mut crate::RequestOptions {
5440            &mut self.0.options
5441        }
5442    }
5443
5444    /// The request builder for [FirewallActivation::get_project_firewall_endpoint][crate::client::FirewallActivation::get_project_firewall_endpoint] calls.
5445    ///
5446    /// # Example
5447    /// ```
5448    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetProjectFirewallEndpoint;
5449    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5450    ///
5451    /// let builder = prepare_request_builder();
5452    /// let response = builder.send().await?;
5453    /// # Ok(()) }
5454    ///
5455    /// fn prepare_request_builder() -> GetProjectFirewallEndpoint {
5456    ///   # panic!();
5457    ///   // ... details omitted ...
5458    /// }
5459    /// ```
5460    #[derive(Clone, Debug)]
5461    pub struct GetProjectFirewallEndpoint(RequestBuilder<crate::model::GetFirewallEndpointRequest>);
5462
5463    impl GetProjectFirewallEndpoint {
5464        pub(crate) fn new(
5465            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5466        ) -> Self {
5467            Self(RequestBuilder::new(stub))
5468        }
5469
5470        /// Sets the full request, replacing any prior values.
5471        pub fn with_request<V: Into<crate::model::GetFirewallEndpointRequest>>(
5472            mut self,
5473            v: V,
5474        ) -> Self {
5475            self.0.request = v.into();
5476            self
5477        }
5478
5479        /// Sets all the options, replacing any prior values.
5480        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5481            self.0.options = v.into();
5482            self
5483        }
5484
5485        /// Sends the request.
5486        pub async fn send(self) -> Result<crate::model::FirewallEndpoint> {
5487            (*self.0.stub)
5488                .get_project_firewall_endpoint(self.0.request, self.0.options)
5489                .await
5490                .map(crate::Response::into_body)
5491        }
5492
5493        /// Sets the value of [name][crate::model::GetFirewallEndpointRequest::name].
5494        ///
5495        /// This is a **required** field for requests.
5496        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5497            self.0.request.name = v.into();
5498            self
5499        }
5500    }
5501
5502    #[doc(hidden)]
5503    impl crate::RequestBuilder for GetProjectFirewallEndpoint {
5504        fn request_options(&mut self) -> &mut crate::RequestOptions {
5505            &mut self.0.options
5506        }
5507    }
5508
5509    /// The request builder for [FirewallActivation::create_firewall_endpoint][crate::client::FirewallActivation::create_firewall_endpoint] calls.
5510    ///
5511    /// # Example
5512    /// ```
5513    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::CreateFirewallEndpoint;
5514    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5515    /// use google_cloud_lro::Poller;
5516    ///
5517    /// let builder = prepare_request_builder();
5518    /// let response = builder.poller().until_done().await?;
5519    /// # Ok(()) }
5520    ///
5521    /// fn prepare_request_builder() -> CreateFirewallEndpoint {
5522    ///   # panic!();
5523    ///   // ... details omitted ...
5524    /// }
5525    /// ```
5526    #[derive(Clone, Debug)]
5527    pub struct CreateFirewallEndpoint(RequestBuilder<crate::model::CreateFirewallEndpointRequest>);
5528
5529    impl CreateFirewallEndpoint {
5530        pub(crate) fn new(
5531            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5532        ) -> Self {
5533            Self(RequestBuilder::new(stub))
5534        }
5535
5536        /// Sets the full request, replacing any prior values.
5537        pub fn with_request<V: Into<crate::model::CreateFirewallEndpointRequest>>(
5538            mut self,
5539            v: V,
5540        ) -> Self {
5541            self.0.request = v.into();
5542            self
5543        }
5544
5545        /// Sets all the options, replacing any prior values.
5546        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5547            self.0.options = v.into();
5548            self
5549        }
5550
5551        /// Sends the request.
5552        ///
5553        /// # Long running operations
5554        ///
5555        /// This starts, but does not poll, a longrunning operation. More information
5556        /// on [create_firewall_endpoint][crate::client::FirewallActivation::create_firewall_endpoint].
5557        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5558            (*self.0.stub)
5559                .create_firewall_endpoint(self.0.request, self.0.options)
5560                .await
5561                .map(crate::Response::into_body)
5562        }
5563
5564        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_firewall_endpoint`.
5565        pub fn poller(
5566            self,
5567        ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5568        {
5569            type Operation = google_cloud_lro::internal::Operation<
5570                crate::model::FirewallEndpoint,
5571                crate::model::OperationMetadata,
5572            >;
5573            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5574            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5575
5576            let stub = self.0.stub.clone();
5577            let mut options = self.0.options.clone();
5578            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5579            let query = move |name| {
5580                let stub = stub.clone();
5581                let options = options.clone();
5582                async {
5583                    let op = GetOperation::new(stub)
5584                        .set_name(name)
5585                        .with_options(options)
5586                        .send()
5587                        .await?;
5588                    Ok(Operation::new(op))
5589                }
5590            };
5591
5592            let start = move || async {
5593                let op = self.send().await?;
5594                Ok(Operation::new(op))
5595            };
5596
5597            google_cloud_lro::internal::new_poller(
5598                polling_error_policy,
5599                polling_backoff_policy,
5600                start,
5601                query,
5602            )
5603        }
5604
5605        /// Sets the value of [parent][crate::model::CreateFirewallEndpointRequest::parent].
5606        ///
5607        /// This is a **required** field for requests.
5608        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5609            self.0.request.parent = v.into();
5610            self
5611        }
5612
5613        /// Sets the value of [firewall_endpoint_id][crate::model::CreateFirewallEndpointRequest::firewall_endpoint_id].
5614        ///
5615        /// This is a **required** field for requests.
5616        pub fn set_firewall_endpoint_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5617            self.0.request.firewall_endpoint_id = v.into();
5618            self
5619        }
5620
5621        /// Sets the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
5622        ///
5623        /// This is a **required** field for requests.
5624        pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5625        where
5626            T: std::convert::Into<crate::model::FirewallEndpoint>,
5627        {
5628            self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5629            self
5630        }
5631
5632        /// Sets or clears the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
5633        ///
5634        /// This is a **required** field for requests.
5635        pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5636        where
5637            T: std::convert::Into<crate::model::FirewallEndpoint>,
5638        {
5639            self.0.request.firewall_endpoint = v.map(|x| x.into());
5640            self
5641        }
5642
5643        /// Sets the value of [request_id][crate::model::CreateFirewallEndpointRequest::request_id].
5644        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5645            self.0.request.request_id = v.into();
5646            self
5647        }
5648    }
5649
5650    #[doc(hidden)]
5651    impl crate::RequestBuilder for CreateFirewallEndpoint {
5652        fn request_options(&mut self) -> &mut crate::RequestOptions {
5653            &mut self.0.options
5654        }
5655    }
5656
5657    /// The request builder for [FirewallActivation::create_project_firewall_endpoint][crate::client::FirewallActivation::create_project_firewall_endpoint] calls.
5658    ///
5659    /// # Example
5660    /// ```
5661    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::CreateProjectFirewallEndpoint;
5662    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5663    /// use google_cloud_lro::Poller;
5664    ///
5665    /// let builder = prepare_request_builder();
5666    /// let response = builder.poller().until_done().await?;
5667    /// # Ok(()) }
5668    ///
5669    /// fn prepare_request_builder() -> CreateProjectFirewallEndpoint {
5670    ///   # panic!();
5671    ///   // ... details omitted ...
5672    /// }
5673    /// ```
5674    #[derive(Clone, Debug)]
5675    pub struct CreateProjectFirewallEndpoint(
5676        RequestBuilder<crate::model::CreateFirewallEndpointRequest>,
5677    );
5678
5679    impl CreateProjectFirewallEndpoint {
5680        pub(crate) fn new(
5681            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5682        ) -> Self {
5683            Self(RequestBuilder::new(stub))
5684        }
5685
5686        /// Sets the full request, replacing any prior values.
5687        pub fn with_request<V: Into<crate::model::CreateFirewallEndpointRequest>>(
5688            mut self,
5689            v: V,
5690        ) -> Self {
5691            self.0.request = v.into();
5692            self
5693        }
5694
5695        /// Sets all the options, replacing any prior values.
5696        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5697            self.0.options = v.into();
5698            self
5699        }
5700
5701        /// Sends the request.
5702        ///
5703        /// # Long running operations
5704        ///
5705        /// This starts, but does not poll, a longrunning operation. More information
5706        /// on [create_project_firewall_endpoint][crate::client::FirewallActivation::create_project_firewall_endpoint].
5707        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5708            (*self.0.stub)
5709                .create_project_firewall_endpoint(self.0.request, self.0.options)
5710                .await
5711                .map(crate::Response::into_body)
5712        }
5713
5714        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_project_firewall_endpoint`.
5715        pub fn poller(
5716            self,
5717        ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
5718        {
5719            type Operation = google_cloud_lro::internal::Operation<
5720                crate::model::FirewallEndpoint,
5721                crate::model::OperationMetadata,
5722            >;
5723            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5724            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5725
5726            let stub = self.0.stub.clone();
5727            let mut options = self.0.options.clone();
5728            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5729            let query = move |name| {
5730                let stub = stub.clone();
5731                let options = options.clone();
5732                async {
5733                    let op = GetOperation::new(stub)
5734                        .set_name(name)
5735                        .with_options(options)
5736                        .send()
5737                        .await?;
5738                    Ok(Operation::new(op))
5739                }
5740            };
5741
5742            let start = move || async {
5743                let op = self.send().await?;
5744                Ok(Operation::new(op))
5745            };
5746
5747            google_cloud_lro::internal::new_poller(
5748                polling_error_policy,
5749                polling_backoff_policy,
5750                start,
5751                query,
5752            )
5753        }
5754
5755        /// Sets the value of [parent][crate::model::CreateFirewallEndpointRequest::parent].
5756        ///
5757        /// This is a **required** field for requests.
5758        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5759            self.0.request.parent = v.into();
5760            self
5761        }
5762
5763        /// Sets the value of [firewall_endpoint_id][crate::model::CreateFirewallEndpointRequest::firewall_endpoint_id].
5764        ///
5765        /// This is a **required** field for requests.
5766        pub fn set_firewall_endpoint_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5767            self.0.request.firewall_endpoint_id = v.into();
5768            self
5769        }
5770
5771        /// Sets the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
5772        ///
5773        /// This is a **required** field for requests.
5774        pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
5775        where
5776            T: std::convert::Into<crate::model::FirewallEndpoint>,
5777        {
5778            self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
5779            self
5780        }
5781
5782        /// Sets or clears the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
5783        ///
5784        /// This is a **required** field for requests.
5785        pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
5786        where
5787            T: std::convert::Into<crate::model::FirewallEndpoint>,
5788        {
5789            self.0.request.firewall_endpoint = v.map(|x| x.into());
5790            self
5791        }
5792
5793        /// Sets the value of [request_id][crate::model::CreateFirewallEndpointRequest::request_id].
5794        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5795            self.0.request.request_id = v.into();
5796            self
5797        }
5798    }
5799
5800    #[doc(hidden)]
5801    impl crate::RequestBuilder for CreateProjectFirewallEndpoint {
5802        fn request_options(&mut self) -> &mut crate::RequestOptions {
5803            &mut self.0.options
5804        }
5805    }
5806
5807    /// The request builder for [FirewallActivation::delete_firewall_endpoint][crate::client::FirewallActivation::delete_firewall_endpoint] calls.
5808    ///
5809    /// # Example
5810    /// ```
5811    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::DeleteFirewallEndpoint;
5812    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5813    /// use google_cloud_lro::Poller;
5814    ///
5815    /// let builder = prepare_request_builder();
5816    /// let response = builder.poller().until_done().await?;
5817    /// # Ok(()) }
5818    ///
5819    /// fn prepare_request_builder() -> DeleteFirewallEndpoint {
5820    ///   # panic!();
5821    ///   // ... details omitted ...
5822    /// }
5823    /// ```
5824    #[derive(Clone, Debug)]
5825    pub struct DeleteFirewallEndpoint(RequestBuilder<crate::model::DeleteFirewallEndpointRequest>);
5826
5827    impl DeleteFirewallEndpoint {
5828        pub(crate) fn new(
5829            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5830        ) -> Self {
5831            Self(RequestBuilder::new(stub))
5832        }
5833
5834        /// Sets the full request, replacing any prior values.
5835        pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointRequest>>(
5836            mut self,
5837            v: V,
5838        ) -> Self {
5839            self.0.request = v.into();
5840            self
5841        }
5842
5843        /// Sets all the options, replacing any prior values.
5844        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5845            self.0.options = v.into();
5846            self
5847        }
5848
5849        /// Sends the request.
5850        ///
5851        /// # Long running operations
5852        ///
5853        /// This starts, but does not poll, a longrunning operation. More information
5854        /// on [delete_firewall_endpoint][crate::client::FirewallActivation::delete_firewall_endpoint].
5855        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5856            (*self.0.stub)
5857                .delete_firewall_endpoint(self.0.request, self.0.options)
5858                .await
5859                .map(crate::Response::into_body)
5860        }
5861
5862        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_firewall_endpoint`.
5863        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5864            type Operation =
5865                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5866            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5867            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5868
5869            let stub = self.0.stub.clone();
5870            let mut options = self.0.options.clone();
5871            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5872            let query = move |name| {
5873                let stub = stub.clone();
5874                let options = options.clone();
5875                async {
5876                    let op = GetOperation::new(stub)
5877                        .set_name(name)
5878                        .with_options(options)
5879                        .send()
5880                        .await?;
5881                    Ok(Operation::new(op))
5882                }
5883            };
5884
5885            let start = move || async {
5886                let op = self.send().await?;
5887                Ok(Operation::new(op))
5888            };
5889
5890            google_cloud_lro::internal::new_unit_response_poller(
5891                polling_error_policy,
5892                polling_backoff_policy,
5893                start,
5894                query,
5895            )
5896        }
5897
5898        /// Sets the value of [name][crate::model::DeleteFirewallEndpointRequest::name].
5899        ///
5900        /// This is a **required** field for requests.
5901        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5902            self.0.request.name = v.into();
5903            self
5904        }
5905
5906        /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointRequest::request_id].
5907        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5908            self.0.request.request_id = v.into();
5909            self
5910        }
5911    }
5912
5913    #[doc(hidden)]
5914    impl crate::RequestBuilder for DeleteFirewallEndpoint {
5915        fn request_options(&mut self) -> &mut crate::RequestOptions {
5916            &mut self.0.options
5917        }
5918    }
5919
5920    /// The request builder for [FirewallActivation::delete_project_firewall_endpoint][crate::client::FirewallActivation::delete_project_firewall_endpoint] calls.
5921    ///
5922    /// # Example
5923    /// ```
5924    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::DeleteProjectFirewallEndpoint;
5925    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
5926    /// use google_cloud_lro::Poller;
5927    ///
5928    /// let builder = prepare_request_builder();
5929    /// let response = builder.poller().until_done().await?;
5930    /// # Ok(()) }
5931    ///
5932    /// fn prepare_request_builder() -> DeleteProjectFirewallEndpoint {
5933    ///   # panic!();
5934    ///   // ... details omitted ...
5935    /// }
5936    /// ```
5937    #[derive(Clone, Debug)]
5938    pub struct DeleteProjectFirewallEndpoint(
5939        RequestBuilder<crate::model::DeleteFirewallEndpointRequest>,
5940    );
5941
5942    impl DeleteProjectFirewallEndpoint {
5943        pub(crate) fn new(
5944            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
5945        ) -> Self {
5946            Self(RequestBuilder::new(stub))
5947        }
5948
5949        /// Sets the full request, replacing any prior values.
5950        pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointRequest>>(
5951            mut self,
5952            v: V,
5953        ) -> Self {
5954            self.0.request = v.into();
5955            self
5956        }
5957
5958        /// Sets all the options, replacing any prior values.
5959        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5960            self.0.options = v.into();
5961            self
5962        }
5963
5964        /// Sends the request.
5965        ///
5966        /// # Long running operations
5967        ///
5968        /// This starts, but does not poll, a longrunning operation. More information
5969        /// on [delete_project_firewall_endpoint][crate::client::FirewallActivation::delete_project_firewall_endpoint].
5970        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5971            (*self.0.stub)
5972                .delete_project_firewall_endpoint(self.0.request, self.0.options)
5973                .await
5974                .map(crate::Response::into_body)
5975        }
5976
5977        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_project_firewall_endpoint`.
5978        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5979            type Operation =
5980                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5981            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5982            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5983
5984            let stub = self.0.stub.clone();
5985            let mut options = self.0.options.clone();
5986            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5987            let query = move |name| {
5988                let stub = stub.clone();
5989                let options = options.clone();
5990                async {
5991                    let op = GetOperation::new(stub)
5992                        .set_name(name)
5993                        .with_options(options)
5994                        .send()
5995                        .await?;
5996                    Ok(Operation::new(op))
5997                }
5998            };
5999
6000            let start = move || async {
6001                let op = self.send().await?;
6002                Ok(Operation::new(op))
6003            };
6004
6005            google_cloud_lro::internal::new_unit_response_poller(
6006                polling_error_policy,
6007                polling_backoff_policy,
6008                start,
6009                query,
6010            )
6011        }
6012
6013        /// Sets the value of [name][crate::model::DeleteFirewallEndpointRequest::name].
6014        ///
6015        /// This is a **required** field for requests.
6016        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6017            self.0.request.name = v.into();
6018            self
6019        }
6020
6021        /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointRequest::request_id].
6022        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6023            self.0.request.request_id = v.into();
6024            self
6025        }
6026    }
6027
6028    #[doc(hidden)]
6029    impl crate::RequestBuilder for DeleteProjectFirewallEndpoint {
6030        fn request_options(&mut self) -> &mut crate::RequestOptions {
6031            &mut self.0.options
6032        }
6033    }
6034
6035    /// The request builder for [FirewallActivation::update_firewall_endpoint][crate::client::FirewallActivation::update_firewall_endpoint] calls.
6036    ///
6037    /// # Example
6038    /// ```
6039    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::UpdateFirewallEndpoint;
6040    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6041    /// use google_cloud_lro::Poller;
6042    ///
6043    /// let builder = prepare_request_builder();
6044    /// let response = builder.poller().until_done().await?;
6045    /// # Ok(()) }
6046    ///
6047    /// fn prepare_request_builder() -> UpdateFirewallEndpoint {
6048    ///   # panic!();
6049    ///   // ... details omitted ...
6050    /// }
6051    /// ```
6052    #[derive(Clone, Debug)]
6053    pub struct UpdateFirewallEndpoint(RequestBuilder<crate::model::UpdateFirewallEndpointRequest>);
6054
6055    impl UpdateFirewallEndpoint {
6056        pub(crate) fn new(
6057            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6058        ) -> Self {
6059            Self(RequestBuilder::new(stub))
6060        }
6061
6062        /// Sets the full request, replacing any prior values.
6063        pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointRequest>>(
6064            mut self,
6065            v: V,
6066        ) -> Self {
6067            self.0.request = v.into();
6068            self
6069        }
6070
6071        /// Sets all the options, replacing any prior values.
6072        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6073            self.0.options = v.into();
6074            self
6075        }
6076
6077        /// Sends the request.
6078        ///
6079        /// # Long running operations
6080        ///
6081        /// This starts, but does not poll, a longrunning operation. More information
6082        /// on [update_firewall_endpoint][crate::client::FirewallActivation::update_firewall_endpoint].
6083        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6084            (*self.0.stub)
6085                .update_firewall_endpoint(self.0.request, self.0.options)
6086                .await
6087                .map(crate::Response::into_body)
6088        }
6089
6090        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_firewall_endpoint`.
6091        pub fn poller(
6092            self,
6093        ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
6094        {
6095            type Operation = google_cloud_lro::internal::Operation<
6096                crate::model::FirewallEndpoint,
6097                crate::model::OperationMetadata,
6098            >;
6099            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6100            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6101
6102            let stub = self.0.stub.clone();
6103            let mut options = self.0.options.clone();
6104            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6105            let query = move |name| {
6106                let stub = stub.clone();
6107                let options = options.clone();
6108                async {
6109                    let op = GetOperation::new(stub)
6110                        .set_name(name)
6111                        .with_options(options)
6112                        .send()
6113                        .await?;
6114                    Ok(Operation::new(op))
6115                }
6116            };
6117
6118            let start = move || async {
6119                let op = self.send().await?;
6120                Ok(Operation::new(op))
6121            };
6122
6123            google_cloud_lro::internal::new_poller(
6124                polling_error_policy,
6125                polling_backoff_policy,
6126                start,
6127                query,
6128            )
6129        }
6130
6131        /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
6132        ///
6133        /// This is a **required** field for requests.
6134        pub fn set_update_mask<T>(mut self, v: T) -> Self
6135        where
6136            T: std::convert::Into<wkt::FieldMask>,
6137        {
6138            self.0.request.update_mask = std::option::Option::Some(v.into());
6139            self
6140        }
6141
6142        /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
6143        ///
6144        /// This is a **required** field for requests.
6145        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6146        where
6147            T: std::convert::Into<wkt::FieldMask>,
6148        {
6149            self.0.request.update_mask = v.map(|x| x.into());
6150            self
6151        }
6152
6153        /// Sets the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
6154        ///
6155        /// This is a **required** field for requests.
6156        pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
6157        where
6158            T: std::convert::Into<crate::model::FirewallEndpoint>,
6159        {
6160            self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
6161            self
6162        }
6163
6164        /// Sets or clears the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
6165        ///
6166        /// This is a **required** field for requests.
6167        pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
6168        where
6169            T: std::convert::Into<crate::model::FirewallEndpoint>,
6170        {
6171            self.0.request.firewall_endpoint = v.map(|x| x.into());
6172            self
6173        }
6174
6175        /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointRequest::request_id].
6176        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6177            self.0.request.request_id = v.into();
6178            self
6179        }
6180    }
6181
6182    #[doc(hidden)]
6183    impl crate::RequestBuilder for UpdateFirewallEndpoint {
6184        fn request_options(&mut self) -> &mut crate::RequestOptions {
6185            &mut self.0.options
6186        }
6187    }
6188
6189    /// The request builder for [FirewallActivation::update_project_firewall_endpoint][crate::client::FirewallActivation::update_project_firewall_endpoint] calls.
6190    ///
6191    /// # Example
6192    /// ```
6193    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::UpdateProjectFirewallEndpoint;
6194    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6195    /// use google_cloud_lro::Poller;
6196    ///
6197    /// let builder = prepare_request_builder();
6198    /// let response = builder.poller().until_done().await?;
6199    /// # Ok(()) }
6200    ///
6201    /// fn prepare_request_builder() -> UpdateProjectFirewallEndpoint {
6202    ///   # panic!();
6203    ///   // ... details omitted ...
6204    /// }
6205    /// ```
6206    #[derive(Clone, Debug)]
6207    pub struct UpdateProjectFirewallEndpoint(
6208        RequestBuilder<crate::model::UpdateFirewallEndpointRequest>,
6209    );
6210
6211    impl UpdateProjectFirewallEndpoint {
6212        pub(crate) fn new(
6213            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6214        ) -> Self {
6215            Self(RequestBuilder::new(stub))
6216        }
6217
6218        /// Sets the full request, replacing any prior values.
6219        pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointRequest>>(
6220            mut self,
6221            v: V,
6222        ) -> Self {
6223            self.0.request = v.into();
6224            self
6225        }
6226
6227        /// Sets all the options, replacing any prior values.
6228        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6229            self.0.options = v.into();
6230            self
6231        }
6232
6233        /// Sends the request.
6234        ///
6235        /// # Long running operations
6236        ///
6237        /// This starts, but does not poll, a longrunning operation. More information
6238        /// on [update_project_firewall_endpoint][crate::client::FirewallActivation::update_project_firewall_endpoint].
6239        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6240            (*self.0.stub)
6241                .update_project_firewall_endpoint(self.0.request, self.0.options)
6242                .await
6243                .map(crate::Response::into_body)
6244        }
6245
6246        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_project_firewall_endpoint`.
6247        pub fn poller(
6248            self,
6249        ) -> impl google_cloud_lro::Poller<crate::model::FirewallEndpoint, crate::model::OperationMetadata>
6250        {
6251            type Operation = google_cloud_lro::internal::Operation<
6252                crate::model::FirewallEndpoint,
6253                crate::model::OperationMetadata,
6254            >;
6255            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6256            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6257
6258            let stub = self.0.stub.clone();
6259            let mut options = self.0.options.clone();
6260            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6261            let query = move |name| {
6262                let stub = stub.clone();
6263                let options = options.clone();
6264                async {
6265                    let op = GetOperation::new(stub)
6266                        .set_name(name)
6267                        .with_options(options)
6268                        .send()
6269                        .await?;
6270                    Ok(Operation::new(op))
6271                }
6272            };
6273
6274            let start = move || async {
6275                let op = self.send().await?;
6276                Ok(Operation::new(op))
6277            };
6278
6279            google_cloud_lro::internal::new_poller(
6280                polling_error_policy,
6281                polling_backoff_policy,
6282                start,
6283                query,
6284            )
6285        }
6286
6287        /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
6288        ///
6289        /// This is a **required** field for requests.
6290        pub fn set_update_mask<T>(mut self, v: T) -> Self
6291        where
6292            T: std::convert::Into<wkt::FieldMask>,
6293        {
6294            self.0.request.update_mask = std::option::Option::Some(v.into());
6295            self
6296        }
6297
6298        /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
6299        ///
6300        /// This is a **required** field for requests.
6301        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6302        where
6303            T: std::convert::Into<wkt::FieldMask>,
6304        {
6305            self.0.request.update_mask = v.map(|x| x.into());
6306            self
6307        }
6308
6309        /// Sets the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
6310        ///
6311        /// This is a **required** field for requests.
6312        pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
6313        where
6314            T: std::convert::Into<crate::model::FirewallEndpoint>,
6315        {
6316            self.0.request.firewall_endpoint = std::option::Option::Some(v.into());
6317            self
6318        }
6319
6320        /// Sets or clears the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
6321        ///
6322        /// This is a **required** field for requests.
6323        pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
6324        where
6325            T: std::convert::Into<crate::model::FirewallEndpoint>,
6326        {
6327            self.0.request.firewall_endpoint = v.map(|x| x.into());
6328            self
6329        }
6330
6331        /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointRequest::request_id].
6332        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6333            self.0.request.request_id = v.into();
6334            self
6335        }
6336    }
6337
6338    #[doc(hidden)]
6339    impl crate::RequestBuilder for UpdateProjectFirewallEndpoint {
6340        fn request_options(&mut self) -> &mut crate::RequestOptions {
6341            &mut self.0.options
6342        }
6343    }
6344
6345    /// The request builder for [FirewallActivation::list_firewall_endpoint_associations][crate::client::FirewallActivation::list_firewall_endpoint_associations] calls.
6346    ///
6347    /// # Example
6348    /// ```
6349    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListFirewallEndpointAssociations;
6350    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6351    /// use google_cloud_gax::paginator::ItemPaginator;
6352    ///
6353    /// let builder = prepare_request_builder();
6354    /// let mut items = builder.by_item();
6355    /// while let Some(result) = items.next().await {
6356    ///   let item = result?;
6357    /// }
6358    /// # Ok(()) }
6359    ///
6360    /// fn prepare_request_builder() -> ListFirewallEndpointAssociations {
6361    ///   # panic!();
6362    ///   // ... details omitted ...
6363    /// }
6364    /// ```
6365    #[derive(Clone, Debug)]
6366    pub struct ListFirewallEndpointAssociations(
6367        RequestBuilder<crate::model::ListFirewallEndpointAssociationsRequest>,
6368    );
6369
6370    impl ListFirewallEndpointAssociations {
6371        pub(crate) fn new(
6372            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6373        ) -> Self {
6374            Self(RequestBuilder::new(stub))
6375        }
6376
6377        /// Sets the full request, replacing any prior values.
6378        pub fn with_request<V: Into<crate::model::ListFirewallEndpointAssociationsRequest>>(
6379            mut self,
6380            v: V,
6381        ) -> Self {
6382            self.0.request = v.into();
6383            self
6384        }
6385
6386        /// Sets all the options, replacing any prior values.
6387        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6388            self.0.options = v.into();
6389            self
6390        }
6391
6392        /// Sends the request.
6393        pub async fn send(self) -> Result<crate::model::ListFirewallEndpointAssociationsResponse> {
6394            (*self.0.stub)
6395                .list_firewall_endpoint_associations(self.0.request, self.0.options)
6396                .await
6397                .map(crate::Response::into_body)
6398        }
6399
6400        /// Streams each page in the collection.
6401        pub fn by_page(
6402            self,
6403        ) -> impl google_cloud_gax::paginator::Paginator<
6404            crate::model::ListFirewallEndpointAssociationsResponse,
6405            crate::Error,
6406        > {
6407            use std::clone::Clone;
6408            let token = self.0.request.page_token.clone();
6409            let execute = move |token: String| {
6410                let mut builder = self.clone();
6411                builder.0.request = builder.0.request.set_page_token(token);
6412                builder.send()
6413            };
6414            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6415        }
6416
6417        /// Streams each item in the collection.
6418        pub fn by_item(
6419            self,
6420        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6421            crate::model::ListFirewallEndpointAssociationsResponse,
6422            crate::Error,
6423        > {
6424            use google_cloud_gax::paginator::Paginator;
6425            self.by_page().items()
6426        }
6427
6428        /// Sets the value of [parent][crate::model::ListFirewallEndpointAssociationsRequest::parent].
6429        ///
6430        /// This is a **required** field for requests.
6431        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6432            self.0.request.parent = v.into();
6433            self
6434        }
6435
6436        /// Sets the value of [page_size][crate::model::ListFirewallEndpointAssociationsRequest::page_size].
6437        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6438            self.0.request.page_size = v.into();
6439            self
6440        }
6441
6442        /// Sets the value of [page_token][crate::model::ListFirewallEndpointAssociationsRequest::page_token].
6443        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6444            self.0.request.page_token = v.into();
6445            self
6446        }
6447
6448        /// Sets the value of [filter][crate::model::ListFirewallEndpointAssociationsRequest::filter].
6449        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6450            self.0.request.filter = v.into();
6451            self
6452        }
6453
6454        /// Sets the value of [order_by][crate::model::ListFirewallEndpointAssociationsRequest::order_by].
6455        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6456            self.0.request.order_by = v.into();
6457            self
6458        }
6459    }
6460
6461    #[doc(hidden)]
6462    impl crate::RequestBuilder for ListFirewallEndpointAssociations {
6463        fn request_options(&mut self) -> &mut crate::RequestOptions {
6464            &mut self.0.options
6465        }
6466    }
6467
6468    /// The request builder for [FirewallActivation::get_firewall_endpoint_association][crate::client::FirewallActivation::get_firewall_endpoint_association] calls.
6469    ///
6470    /// # Example
6471    /// ```
6472    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetFirewallEndpointAssociation;
6473    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6474    ///
6475    /// let builder = prepare_request_builder();
6476    /// let response = builder.send().await?;
6477    /// # Ok(()) }
6478    ///
6479    /// fn prepare_request_builder() -> GetFirewallEndpointAssociation {
6480    ///   # panic!();
6481    ///   // ... details omitted ...
6482    /// }
6483    /// ```
6484    #[derive(Clone, Debug)]
6485    pub struct GetFirewallEndpointAssociation(
6486        RequestBuilder<crate::model::GetFirewallEndpointAssociationRequest>,
6487    );
6488
6489    impl GetFirewallEndpointAssociation {
6490        pub(crate) fn new(
6491            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6492        ) -> Self {
6493            Self(RequestBuilder::new(stub))
6494        }
6495
6496        /// Sets the full request, replacing any prior values.
6497        pub fn with_request<V: Into<crate::model::GetFirewallEndpointAssociationRequest>>(
6498            mut self,
6499            v: V,
6500        ) -> Self {
6501            self.0.request = v.into();
6502            self
6503        }
6504
6505        /// Sets all the options, replacing any prior values.
6506        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6507            self.0.options = v.into();
6508            self
6509        }
6510
6511        /// Sends the request.
6512        pub async fn send(self) -> Result<crate::model::FirewallEndpointAssociation> {
6513            (*self.0.stub)
6514                .get_firewall_endpoint_association(self.0.request, self.0.options)
6515                .await
6516                .map(crate::Response::into_body)
6517        }
6518
6519        /// Sets the value of [name][crate::model::GetFirewallEndpointAssociationRequest::name].
6520        ///
6521        /// This is a **required** field for requests.
6522        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6523            self.0.request.name = v.into();
6524            self
6525        }
6526    }
6527
6528    #[doc(hidden)]
6529    impl crate::RequestBuilder for GetFirewallEndpointAssociation {
6530        fn request_options(&mut self) -> &mut crate::RequestOptions {
6531            &mut self.0.options
6532        }
6533    }
6534
6535    /// The request builder for [FirewallActivation::create_firewall_endpoint_association][crate::client::FirewallActivation::create_firewall_endpoint_association] calls.
6536    ///
6537    /// # Example
6538    /// ```
6539    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::CreateFirewallEndpointAssociation;
6540    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6541    /// use google_cloud_lro::Poller;
6542    ///
6543    /// let builder = prepare_request_builder();
6544    /// let response = builder.poller().until_done().await?;
6545    /// # Ok(()) }
6546    ///
6547    /// fn prepare_request_builder() -> CreateFirewallEndpointAssociation {
6548    ///   # panic!();
6549    ///   // ... details omitted ...
6550    /// }
6551    /// ```
6552    #[derive(Clone, Debug)]
6553    pub struct CreateFirewallEndpointAssociation(
6554        RequestBuilder<crate::model::CreateFirewallEndpointAssociationRequest>,
6555    );
6556
6557    impl CreateFirewallEndpointAssociation {
6558        pub(crate) fn new(
6559            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6560        ) -> Self {
6561            Self(RequestBuilder::new(stub))
6562        }
6563
6564        /// Sets the full request, replacing any prior values.
6565        pub fn with_request<V: Into<crate::model::CreateFirewallEndpointAssociationRequest>>(
6566            mut self,
6567            v: V,
6568        ) -> Self {
6569            self.0.request = v.into();
6570            self
6571        }
6572
6573        /// Sets all the options, replacing any prior values.
6574        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6575            self.0.options = v.into();
6576            self
6577        }
6578
6579        /// Sends the request.
6580        ///
6581        /// # Long running operations
6582        ///
6583        /// This starts, but does not poll, a longrunning operation. More information
6584        /// on [create_firewall_endpoint_association][crate::client::FirewallActivation::create_firewall_endpoint_association].
6585        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6586            (*self.0.stub)
6587                .create_firewall_endpoint_association(self.0.request, self.0.options)
6588                .await
6589                .map(crate::Response::into_body)
6590        }
6591
6592        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_firewall_endpoint_association`.
6593        pub fn poller(
6594            self,
6595        ) -> impl google_cloud_lro::Poller<
6596            crate::model::FirewallEndpointAssociation,
6597            crate::model::OperationMetadata,
6598        > {
6599            type Operation = google_cloud_lro::internal::Operation<
6600                crate::model::FirewallEndpointAssociation,
6601                crate::model::OperationMetadata,
6602            >;
6603            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6604            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6605
6606            let stub = self.0.stub.clone();
6607            let mut options = self.0.options.clone();
6608            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6609            let query = move |name| {
6610                let stub = stub.clone();
6611                let options = options.clone();
6612                async {
6613                    let op = GetOperation::new(stub)
6614                        .set_name(name)
6615                        .with_options(options)
6616                        .send()
6617                        .await?;
6618                    Ok(Operation::new(op))
6619                }
6620            };
6621
6622            let start = move || async {
6623                let op = self.send().await?;
6624                Ok(Operation::new(op))
6625            };
6626
6627            google_cloud_lro::internal::new_poller(
6628                polling_error_policy,
6629                polling_backoff_policy,
6630                start,
6631                query,
6632            )
6633        }
6634
6635        /// Sets the value of [parent][crate::model::CreateFirewallEndpointAssociationRequest::parent].
6636        ///
6637        /// This is a **required** field for requests.
6638        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6639            self.0.request.parent = v.into();
6640            self
6641        }
6642
6643        /// Sets the value of [firewall_endpoint_association_id][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association_id].
6644        pub fn set_firewall_endpoint_association_id<T: Into<std::string::String>>(
6645            mut self,
6646            v: T,
6647        ) -> Self {
6648            self.0.request.firewall_endpoint_association_id = v.into();
6649            self
6650        }
6651
6652        /// Sets the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
6653        ///
6654        /// This is a **required** field for requests.
6655        pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
6656        where
6657            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6658        {
6659            self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
6660            self
6661        }
6662
6663        /// Sets or clears the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
6664        ///
6665        /// This is a **required** field for requests.
6666        pub fn set_or_clear_firewall_endpoint_association<T>(
6667            mut self,
6668            v: std::option::Option<T>,
6669        ) -> Self
6670        where
6671            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6672        {
6673            self.0.request.firewall_endpoint_association = v.map(|x| x.into());
6674            self
6675        }
6676
6677        /// Sets the value of [request_id][crate::model::CreateFirewallEndpointAssociationRequest::request_id].
6678        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6679            self.0.request.request_id = v.into();
6680            self
6681        }
6682    }
6683
6684    #[doc(hidden)]
6685    impl crate::RequestBuilder for CreateFirewallEndpointAssociation {
6686        fn request_options(&mut self) -> &mut crate::RequestOptions {
6687            &mut self.0.options
6688        }
6689    }
6690
6691    /// The request builder for [FirewallActivation::delete_firewall_endpoint_association][crate::client::FirewallActivation::delete_firewall_endpoint_association] calls.
6692    ///
6693    /// # Example
6694    /// ```
6695    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::DeleteFirewallEndpointAssociation;
6696    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6697    /// use google_cloud_lro::Poller;
6698    ///
6699    /// let builder = prepare_request_builder();
6700    /// let response = builder.poller().until_done().await?;
6701    /// # Ok(()) }
6702    ///
6703    /// fn prepare_request_builder() -> DeleteFirewallEndpointAssociation {
6704    ///   # panic!();
6705    ///   // ... details omitted ...
6706    /// }
6707    /// ```
6708    #[derive(Clone, Debug)]
6709    pub struct DeleteFirewallEndpointAssociation(
6710        RequestBuilder<crate::model::DeleteFirewallEndpointAssociationRequest>,
6711    );
6712
6713    impl DeleteFirewallEndpointAssociation {
6714        pub(crate) fn new(
6715            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6716        ) -> Self {
6717            Self(RequestBuilder::new(stub))
6718        }
6719
6720        /// Sets the full request, replacing any prior values.
6721        pub fn with_request<V: Into<crate::model::DeleteFirewallEndpointAssociationRequest>>(
6722            mut self,
6723            v: V,
6724        ) -> Self {
6725            self.0.request = v.into();
6726            self
6727        }
6728
6729        /// Sets all the options, replacing any prior values.
6730        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6731            self.0.options = v.into();
6732            self
6733        }
6734
6735        /// Sends the request.
6736        ///
6737        /// # Long running operations
6738        ///
6739        /// This starts, but does not poll, a longrunning operation. More information
6740        /// on [delete_firewall_endpoint_association][crate::client::FirewallActivation::delete_firewall_endpoint_association].
6741        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6742            (*self.0.stub)
6743                .delete_firewall_endpoint_association(self.0.request, self.0.options)
6744                .await
6745                .map(crate::Response::into_body)
6746        }
6747
6748        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_firewall_endpoint_association`.
6749        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6750            type Operation =
6751                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6752            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6753            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6754
6755            let stub = self.0.stub.clone();
6756            let mut options = self.0.options.clone();
6757            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6758            let query = move |name| {
6759                let stub = stub.clone();
6760                let options = options.clone();
6761                async {
6762                    let op = GetOperation::new(stub)
6763                        .set_name(name)
6764                        .with_options(options)
6765                        .send()
6766                        .await?;
6767                    Ok(Operation::new(op))
6768                }
6769            };
6770
6771            let start = move || async {
6772                let op = self.send().await?;
6773                Ok(Operation::new(op))
6774            };
6775
6776            google_cloud_lro::internal::new_unit_response_poller(
6777                polling_error_policy,
6778                polling_backoff_policy,
6779                start,
6780                query,
6781            )
6782        }
6783
6784        /// Sets the value of [name][crate::model::DeleteFirewallEndpointAssociationRequest::name].
6785        ///
6786        /// This is a **required** field for requests.
6787        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6788            self.0.request.name = v.into();
6789            self
6790        }
6791
6792        /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointAssociationRequest::request_id].
6793        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6794            self.0.request.request_id = v.into();
6795            self
6796        }
6797    }
6798
6799    #[doc(hidden)]
6800    impl crate::RequestBuilder for DeleteFirewallEndpointAssociation {
6801        fn request_options(&mut self) -> &mut crate::RequestOptions {
6802            &mut self.0.options
6803        }
6804    }
6805
6806    /// The request builder for [FirewallActivation::update_firewall_endpoint_association][crate::client::FirewallActivation::update_firewall_endpoint_association] calls.
6807    ///
6808    /// # Example
6809    /// ```
6810    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::UpdateFirewallEndpointAssociation;
6811    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6812    /// use google_cloud_lro::Poller;
6813    ///
6814    /// let builder = prepare_request_builder();
6815    /// let response = builder.poller().until_done().await?;
6816    /// # Ok(()) }
6817    ///
6818    /// fn prepare_request_builder() -> UpdateFirewallEndpointAssociation {
6819    ///   # panic!();
6820    ///   // ... details omitted ...
6821    /// }
6822    /// ```
6823    #[derive(Clone, Debug)]
6824    pub struct UpdateFirewallEndpointAssociation(
6825        RequestBuilder<crate::model::UpdateFirewallEndpointAssociationRequest>,
6826    );
6827
6828    impl UpdateFirewallEndpointAssociation {
6829        pub(crate) fn new(
6830            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6831        ) -> Self {
6832            Self(RequestBuilder::new(stub))
6833        }
6834
6835        /// Sets the full request, replacing any prior values.
6836        pub fn with_request<V: Into<crate::model::UpdateFirewallEndpointAssociationRequest>>(
6837            mut self,
6838            v: V,
6839        ) -> Self {
6840            self.0.request = v.into();
6841            self
6842        }
6843
6844        /// Sets all the options, replacing any prior values.
6845        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6846            self.0.options = v.into();
6847            self
6848        }
6849
6850        /// Sends the request.
6851        ///
6852        /// # Long running operations
6853        ///
6854        /// This starts, but does not poll, a longrunning operation. More information
6855        /// on [update_firewall_endpoint_association][crate::client::FirewallActivation::update_firewall_endpoint_association].
6856        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6857            (*self.0.stub)
6858                .update_firewall_endpoint_association(self.0.request, self.0.options)
6859                .await
6860                .map(crate::Response::into_body)
6861        }
6862
6863        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_firewall_endpoint_association`.
6864        pub fn poller(
6865            self,
6866        ) -> impl google_cloud_lro::Poller<
6867            crate::model::FirewallEndpointAssociation,
6868            crate::model::OperationMetadata,
6869        > {
6870            type Operation = google_cloud_lro::internal::Operation<
6871                crate::model::FirewallEndpointAssociation,
6872                crate::model::OperationMetadata,
6873            >;
6874            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6875            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6876
6877            let stub = self.0.stub.clone();
6878            let mut options = self.0.options.clone();
6879            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6880            let query = move |name| {
6881                let stub = stub.clone();
6882                let options = options.clone();
6883                async {
6884                    let op = GetOperation::new(stub)
6885                        .set_name(name)
6886                        .with_options(options)
6887                        .send()
6888                        .await?;
6889                    Ok(Operation::new(op))
6890                }
6891            };
6892
6893            let start = move || async {
6894                let op = self.send().await?;
6895                Ok(Operation::new(op))
6896            };
6897
6898            google_cloud_lro::internal::new_poller(
6899                polling_error_policy,
6900                polling_backoff_policy,
6901                start,
6902                query,
6903            )
6904        }
6905
6906        /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
6907        ///
6908        /// This is a **required** field for requests.
6909        pub fn set_update_mask<T>(mut self, v: T) -> Self
6910        where
6911            T: std::convert::Into<wkt::FieldMask>,
6912        {
6913            self.0.request.update_mask = std::option::Option::Some(v.into());
6914            self
6915        }
6916
6917        /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
6918        ///
6919        /// This is a **required** field for requests.
6920        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6921        where
6922            T: std::convert::Into<wkt::FieldMask>,
6923        {
6924            self.0.request.update_mask = v.map(|x| x.into());
6925            self
6926        }
6927
6928        /// Sets the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
6929        ///
6930        /// This is a **required** field for requests.
6931        pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
6932        where
6933            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6934        {
6935            self.0.request.firewall_endpoint_association = std::option::Option::Some(v.into());
6936            self
6937        }
6938
6939        /// Sets or clears the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
6940        ///
6941        /// This is a **required** field for requests.
6942        pub fn set_or_clear_firewall_endpoint_association<T>(
6943            mut self,
6944            v: std::option::Option<T>,
6945        ) -> Self
6946        where
6947            T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
6948        {
6949            self.0.request.firewall_endpoint_association = v.map(|x| x.into());
6950            self
6951        }
6952
6953        /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointAssociationRequest::request_id].
6954        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6955            self.0.request.request_id = v.into();
6956            self
6957        }
6958    }
6959
6960    #[doc(hidden)]
6961    impl crate::RequestBuilder for UpdateFirewallEndpointAssociation {
6962        fn request_options(&mut self) -> &mut crate::RequestOptions {
6963            &mut self.0.options
6964        }
6965    }
6966
6967    /// The request builder for [FirewallActivation::list_locations][crate::client::FirewallActivation::list_locations] calls.
6968    ///
6969    /// # Example
6970    /// ```
6971    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListLocations;
6972    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
6973    /// use google_cloud_gax::paginator::ItemPaginator;
6974    ///
6975    /// let builder = prepare_request_builder();
6976    /// let mut items = builder.by_item();
6977    /// while let Some(result) = items.next().await {
6978    ///   let item = result?;
6979    /// }
6980    /// # Ok(()) }
6981    ///
6982    /// fn prepare_request_builder() -> ListLocations {
6983    ///   # panic!();
6984    ///   // ... details omitted ...
6985    /// }
6986    /// ```
6987    #[derive(Clone, Debug)]
6988    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6989
6990    impl ListLocations {
6991        pub(crate) fn new(
6992            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
6993        ) -> Self {
6994            Self(RequestBuilder::new(stub))
6995        }
6996
6997        /// Sets the full request, replacing any prior values.
6998        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6999            mut self,
7000            v: V,
7001        ) -> Self {
7002            self.0.request = v.into();
7003            self
7004        }
7005
7006        /// Sets all the options, replacing any prior values.
7007        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7008            self.0.options = v.into();
7009            self
7010        }
7011
7012        /// Sends the request.
7013        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7014            (*self.0.stub)
7015                .list_locations(self.0.request, self.0.options)
7016                .await
7017                .map(crate::Response::into_body)
7018        }
7019
7020        /// Streams each page in the collection.
7021        pub fn by_page(
7022            self,
7023        ) -> impl google_cloud_gax::paginator::Paginator<
7024            google_cloud_location::model::ListLocationsResponse,
7025            crate::Error,
7026        > {
7027            use std::clone::Clone;
7028            let token = self.0.request.page_token.clone();
7029            let execute = move |token: String| {
7030                let mut builder = self.clone();
7031                builder.0.request = builder.0.request.set_page_token(token);
7032                builder.send()
7033            };
7034            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7035        }
7036
7037        /// Streams each item in the collection.
7038        pub fn by_item(
7039            self,
7040        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7041            google_cloud_location::model::ListLocationsResponse,
7042            crate::Error,
7043        > {
7044            use google_cloud_gax::paginator::Paginator;
7045            self.by_page().items()
7046        }
7047
7048        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
7049        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7050            self.0.request.name = v.into();
7051            self
7052        }
7053
7054        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
7055        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7056            self.0.request.filter = v.into();
7057            self
7058        }
7059
7060        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
7061        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7062            self.0.request.page_size = v.into();
7063            self
7064        }
7065
7066        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
7067        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7068            self.0.request.page_token = v.into();
7069            self
7070        }
7071    }
7072
7073    #[doc(hidden)]
7074    impl crate::RequestBuilder for ListLocations {
7075        fn request_options(&mut self) -> &mut crate::RequestOptions {
7076            &mut self.0.options
7077        }
7078    }
7079
7080    /// The request builder for [FirewallActivation::get_location][crate::client::FirewallActivation::get_location] calls.
7081    ///
7082    /// # Example
7083    /// ```
7084    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetLocation;
7085    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7086    ///
7087    /// let builder = prepare_request_builder();
7088    /// let response = builder.send().await?;
7089    /// # Ok(()) }
7090    ///
7091    /// fn prepare_request_builder() -> GetLocation {
7092    ///   # panic!();
7093    ///   // ... details omitted ...
7094    /// }
7095    /// ```
7096    #[derive(Clone, Debug)]
7097    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
7098
7099    impl GetLocation {
7100        pub(crate) fn new(
7101            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7102        ) -> Self {
7103            Self(RequestBuilder::new(stub))
7104        }
7105
7106        /// Sets the full request, replacing any prior values.
7107        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
7108            mut self,
7109            v: V,
7110        ) -> Self {
7111            self.0.request = v.into();
7112            self
7113        }
7114
7115        /// Sets all the options, replacing any prior values.
7116        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7117            self.0.options = v.into();
7118            self
7119        }
7120
7121        /// Sends the request.
7122        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
7123            (*self.0.stub)
7124                .get_location(self.0.request, self.0.options)
7125                .await
7126                .map(crate::Response::into_body)
7127        }
7128
7129        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
7130        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7131            self.0.request.name = v.into();
7132            self
7133        }
7134    }
7135
7136    #[doc(hidden)]
7137    impl crate::RequestBuilder for GetLocation {
7138        fn request_options(&mut self) -> &mut crate::RequestOptions {
7139            &mut self.0.options
7140        }
7141    }
7142
7143    /// The request builder for [FirewallActivation::set_iam_policy][crate::client::FirewallActivation::set_iam_policy] calls.
7144    ///
7145    /// # Example
7146    /// ```
7147    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::SetIamPolicy;
7148    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7149    ///
7150    /// let builder = prepare_request_builder();
7151    /// let response = builder.send().await?;
7152    /// # Ok(()) }
7153    ///
7154    /// fn prepare_request_builder() -> SetIamPolicy {
7155    ///   # panic!();
7156    ///   // ... details omitted ...
7157    /// }
7158    /// ```
7159    #[derive(Clone, Debug)]
7160    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
7161
7162    impl SetIamPolicy {
7163        pub(crate) fn new(
7164            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7165        ) -> Self {
7166            Self(RequestBuilder::new(stub))
7167        }
7168
7169        /// Sets the full request, replacing any prior values.
7170        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
7171            mut self,
7172            v: V,
7173        ) -> Self {
7174            self.0.request = v.into();
7175            self
7176        }
7177
7178        /// Sets all the options, replacing any prior values.
7179        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7180            self.0.options = v.into();
7181            self
7182        }
7183
7184        /// Sends the request.
7185        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
7186            (*self.0.stub)
7187                .set_iam_policy(self.0.request, self.0.options)
7188                .await
7189                .map(crate::Response::into_body)
7190        }
7191
7192        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
7193        ///
7194        /// This is a **required** field for requests.
7195        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7196            self.0.request.resource = v.into();
7197            self
7198        }
7199
7200        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
7201        ///
7202        /// This is a **required** field for requests.
7203        pub fn set_policy<T>(mut self, v: T) -> Self
7204        where
7205            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
7206        {
7207            self.0.request.policy = std::option::Option::Some(v.into());
7208            self
7209        }
7210
7211        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
7212        ///
7213        /// This is a **required** field for requests.
7214        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
7215        where
7216            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
7217        {
7218            self.0.request.policy = v.map(|x| x.into());
7219            self
7220        }
7221
7222        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
7223        pub fn set_update_mask<T>(mut self, v: T) -> Self
7224        where
7225            T: std::convert::Into<wkt::FieldMask>,
7226        {
7227            self.0.request.update_mask = std::option::Option::Some(v.into());
7228            self
7229        }
7230
7231        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
7232        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7233        where
7234            T: std::convert::Into<wkt::FieldMask>,
7235        {
7236            self.0.request.update_mask = v.map(|x| x.into());
7237            self
7238        }
7239    }
7240
7241    #[doc(hidden)]
7242    impl crate::RequestBuilder for SetIamPolicy {
7243        fn request_options(&mut self) -> &mut crate::RequestOptions {
7244            &mut self.0.options
7245        }
7246    }
7247
7248    /// The request builder for [FirewallActivation::get_iam_policy][crate::client::FirewallActivation::get_iam_policy] calls.
7249    ///
7250    /// # Example
7251    /// ```
7252    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetIamPolicy;
7253    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7254    ///
7255    /// let builder = prepare_request_builder();
7256    /// let response = builder.send().await?;
7257    /// # Ok(()) }
7258    ///
7259    /// fn prepare_request_builder() -> GetIamPolicy {
7260    ///   # panic!();
7261    ///   // ... details omitted ...
7262    /// }
7263    /// ```
7264    #[derive(Clone, Debug)]
7265    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
7266
7267    impl GetIamPolicy {
7268        pub(crate) fn new(
7269            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7270        ) -> Self {
7271            Self(RequestBuilder::new(stub))
7272        }
7273
7274        /// Sets the full request, replacing any prior values.
7275        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
7276            mut self,
7277            v: V,
7278        ) -> Self {
7279            self.0.request = v.into();
7280            self
7281        }
7282
7283        /// Sets all the options, replacing any prior values.
7284        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7285            self.0.options = v.into();
7286            self
7287        }
7288
7289        /// Sends the request.
7290        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
7291            (*self.0.stub)
7292                .get_iam_policy(self.0.request, self.0.options)
7293                .await
7294                .map(crate::Response::into_body)
7295        }
7296
7297        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
7298        ///
7299        /// This is a **required** field for requests.
7300        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7301            self.0.request.resource = v.into();
7302            self
7303        }
7304
7305        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
7306        pub fn set_options<T>(mut self, v: T) -> Self
7307        where
7308            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
7309        {
7310            self.0.request.options = std::option::Option::Some(v.into());
7311            self
7312        }
7313
7314        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
7315        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
7316        where
7317            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
7318        {
7319            self.0.request.options = v.map(|x| x.into());
7320            self
7321        }
7322    }
7323
7324    #[doc(hidden)]
7325    impl crate::RequestBuilder for GetIamPolicy {
7326        fn request_options(&mut self) -> &mut crate::RequestOptions {
7327            &mut self.0.options
7328        }
7329    }
7330
7331    /// The request builder for [FirewallActivation::test_iam_permissions][crate::client::FirewallActivation::test_iam_permissions] calls.
7332    ///
7333    /// # Example
7334    /// ```
7335    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::TestIamPermissions;
7336    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7337    ///
7338    /// let builder = prepare_request_builder();
7339    /// let response = builder.send().await?;
7340    /// # Ok(()) }
7341    ///
7342    /// fn prepare_request_builder() -> TestIamPermissions {
7343    ///   # panic!();
7344    ///   // ... details omitted ...
7345    /// }
7346    /// ```
7347    #[derive(Clone, Debug)]
7348    pub struct TestIamPermissions(
7349        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
7350    );
7351
7352    impl TestIamPermissions {
7353        pub(crate) fn new(
7354            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7355        ) -> Self {
7356            Self(RequestBuilder::new(stub))
7357        }
7358
7359        /// Sets the full request, replacing any prior values.
7360        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
7361            mut self,
7362            v: V,
7363        ) -> Self {
7364            self.0.request = v.into();
7365            self
7366        }
7367
7368        /// Sets all the options, replacing any prior values.
7369        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7370            self.0.options = v.into();
7371            self
7372        }
7373
7374        /// Sends the request.
7375        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
7376            (*self.0.stub)
7377                .test_iam_permissions(self.0.request, self.0.options)
7378                .await
7379                .map(crate::Response::into_body)
7380        }
7381
7382        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
7383        ///
7384        /// This is a **required** field for requests.
7385        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7386            self.0.request.resource = v.into();
7387            self
7388        }
7389
7390        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
7391        ///
7392        /// This is a **required** field for requests.
7393        pub fn set_permissions<T, V>(mut self, v: T) -> Self
7394        where
7395            T: std::iter::IntoIterator<Item = V>,
7396            V: std::convert::Into<std::string::String>,
7397        {
7398            use std::iter::Iterator;
7399            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
7400            self
7401        }
7402    }
7403
7404    #[doc(hidden)]
7405    impl crate::RequestBuilder for TestIamPermissions {
7406        fn request_options(&mut self) -> &mut crate::RequestOptions {
7407            &mut self.0.options
7408        }
7409    }
7410
7411    /// The request builder for [FirewallActivation::list_operations][crate::client::FirewallActivation::list_operations] calls.
7412    ///
7413    /// # Example
7414    /// ```
7415    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::ListOperations;
7416    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7417    /// use google_cloud_gax::paginator::ItemPaginator;
7418    ///
7419    /// let builder = prepare_request_builder();
7420    /// let mut items = builder.by_item();
7421    /// while let Some(result) = items.next().await {
7422    ///   let item = result?;
7423    /// }
7424    /// # Ok(()) }
7425    ///
7426    /// fn prepare_request_builder() -> ListOperations {
7427    ///   # panic!();
7428    ///   // ... details omitted ...
7429    /// }
7430    /// ```
7431    #[derive(Clone, Debug)]
7432    pub struct ListOperations(
7433        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
7434    );
7435
7436    impl ListOperations {
7437        pub(crate) fn new(
7438            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7439        ) -> Self {
7440            Self(RequestBuilder::new(stub))
7441        }
7442
7443        /// Sets the full request, replacing any prior values.
7444        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7445            mut self,
7446            v: V,
7447        ) -> Self {
7448            self.0.request = v.into();
7449            self
7450        }
7451
7452        /// Sets all the options, replacing any prior values.
7453        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7454            self.0.options = v.into();
7455            self
7456        }
7457
7458        /// Sends the request.
7459        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7460            (*self.0.stub)
7461                .list_operations(self.0.request, self.0.options)
7462                .await
7463                .map(crate::Response::into_body)
7464        }
7465
7466        /// Streams each page in the collection.
7467        pub fn by_page(
7468            self,
7469        ) -> impl google_cloud_gax::paginator::Paginator<
7470            google_cloud_longrunning::model::ListOperationsResponse,
7471            crate::Error,
7472        > {
7473            use std::clone::Clone;
7474            let token = self.0.request.page_token.clone();
7475            let execute = move |token: String| {
7476                let mut builder = self.clone();
7477                builder.0.request = builder.0.request.set_page_token(token);
7478                builder.send()
7479            };
7480            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7481        }
7482
7483        /// Streams each item in the collection.
7484        pub fn by_item(
7485            self,
7486        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7487            google_cloud_longrunning::model::ListOperationsResponse,
7488            crate::Error,
7489        > {
7490            use google_cloud_gax::paginator::Paginator;
7491            self.by_page().items()
7492        }
7493
7494        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
7495        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7496            self.0.request.name = v.into();
7497            self
7498        }
7499
7500        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
7501        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7502            self.0.request.filter = v.into();
7503            self
7504        }
7505
7506        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
7507        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7508            self.0.request.page_size = v.into();
7509            self
7510        }
7511
7512        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
7513        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7514            self.0.request.page_token = v.into();
7515            self
7516        }
7517
7518        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
7519        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7520            self.0.request.return_partial_success = v.into();
7521            self
7522        }
7523    }
7524
7525    #[doc(hidden)]
7526    impl crate::RequestBuilder for ListOperations {
7527        fn request_options(&mut self) -> &mut crate::RequestOptions {
7528            &mut self.0.options
7529        }
7530    }
7531
7532    /// The request builder for [FirewallActivation::get_operation][crate::client::FirewallActivation::get_operation] calls.
7533    ///
7534    /// # Example
7535    /// ```
7536    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::GetOperation;
7537    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7538    ///
7539    /// let builder = prepare_request_builder();
7540    /// let response = builder.send().await?;
7541    /// # Ok(()) }
7542    ///
7543    /// fn prepare_request_builder() -> GetOperation {
7544    ///   # panic!();
7545    ///   // ... details omitted ...
7546    /// }
7547    /// ```
7548    #[derive(Clone, Debug)]
7549    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7550
7551    impl GetOperation {
7552        pub(crate) fn new(
7553            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7554        ) -> Self {
7555            Self(RequestBuilder::new(stub))
7556        }
7557
7558        /// Sets the full request, replacing any prior values.
7559        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7560            mut self,
7561            v: V,
7562        ) -> Self {
7563            self.0.request = v.into();
7564            self
7565        }
7566
7567        /// Sets all the options, replacing any prior values.
7568        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7569            self.0.options = v.into();
7570            self
7571        }
7572
7573        /// Sends the request.
7574        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7575            (*self.0.stub)
7576                .get_operation(self.0.request, self.0.options)
7577                .await
7578                .map(crate::Response::into_body)
7579        }
7580
7581        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
7582        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7583            self.0.request.name = v.into();
7584            self
7585        }
7586    }
7587
7588    #[doc(hidden)]
7589    impl crate::RequestBuilder for GetOperation {
7590        fn request_options(&mut self) -> &mut crate::RequestOptions {
7591            &mut self.0.options
7592        }
7593    }
7594
7595    /// The request builder for [FirewallActivation::delete_operation][crate::client::FirewallActivation::delete_operation] calls.
7596    ///
7597    /// # Example
7598    /// ```
7599    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::DeleteOperation;
7600    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7601    ///
7602    /// let builder = prepare_request_builder();
7603    /// let response = builder.send().await?;
7604    /// # Ok(()) }
7605    ///
7606    /// fn prepare_request_builder() -> DeleteOperation {
7607    ///   # panic!();
7608    ///   // ... details omitted ...
7609    /// }
7610    /// ```
7611    #[derive(Clone, Debug)]
7612    pub struct DeleteOperation(
7613        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7614    );
7615
7616    impl DeleteOperation {
7617        pub(crate) fn new(
7618            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7619        ) -> Self {
7620            Self(RequestBuilder::new(stub))
7621        }
7622
7623        /// Sets the full request, replacing any prior values.
7624        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7625            mut self,
7626            v: V,
7627        ) -> Self {
7628            self.0.request = v.into();
7629            self
7630        }
7631
7632        /// Sets all the options, replacing any prior values.
7633        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7634            self.0.options = v.into();
7635            self
7636        }
7637
7638        /// Sends the request.
7639        pub async fn send(self) -> Result<()> {
7640            (*self.0.stub)
7641                .delete_operation(self.0.request, self.0.options)
7642                .await
7643                .map(crate::Response::into_body)
7644        }
7645
7646        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
7647        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7648            self.0.request.name = v.into();
7649            self
7650        }
7651    }
7652
7653    #[doc(hidden)]
7654    impl crate::RequestBuilder for DeleteOperation {
7655        fn request_options(&mut self) -> &mut crate::RequestOptions {
7656            &mut self.0.options
7657        }
7658    }
7659
7660    /// The request builder for [FirewallActivation::cancel_operation][crate::client::FirewallActivation::cancel_operation] calls.
7661    ///
7662    /// # Example
7663    /// ```
7664    /// # use google_cloud_networksecurity_v1::builder::firewall_activation::CancelOperation;
7665    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7666    ///
7667    /// let builder = prepare_request_builder();
7668    /// let response = builder.send().await?;
7669    /// # Ok(()) }
7670    ///
7671    /// fn prepare_request_builder() -> CancelOperation {
7672    ///   # panic!();
7673    ///   // ... details omitted ...
7674    /// }
7675    /// ```
7676    #[derive(Clone, Debug)]
7677    pub struct CancelOperation(
7678        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7679    );
7680
7681    impl CancelOperation {
7682        pub(crate) fn new(
7683            stub: std::sync::Arc<dyn super::super::stub::dynamic::FirewallActivation>,
7684        ) -> Self {
7685            Self(RequestBuilder::new(stub))
7686        }
7687
7688        /// Sets the full request, replacing any prior values.
7689        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7690            mut self,
7691            v: V,
7692        ) -> Self {
7693            self.0.request = v.into();
7694            self
7695        }
7696
7697        /// Sets all the options, replacing any prior values.
7698        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7699            self.0.options = v.into();
7700            self
7701        }
7702
7703        /// Sends the request.
7704        pub async fn send(self) -> Result<()> {
7705            (*self.0.stub)
7706                .cancel_operation(self.0.request, self.0.options)
7707                .await
7708                .map(crate::Response::into_body)
7709        }
7710
7711        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
7712        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7713            self.0.request.name = v.into();
7714            self
7715        }
7716    }
7717
7718    #[doc(hidden)]
7719    impl crate::RequestBuilder for CancelOperation {
7720        fn request_options(&mut self) -> &mut crate::RequestOptions {
7721            &mut self.0.options
7722        }
7723    }
7724}
7725
7726/// Request and client builders for [Intercept][crate::client::Intercept].
7727pub mod intercept {
7728    use crate::Result;
7729
7730    /// A builder for [Intercept][crate::client::Intercept].
7731    ///
7732    /// ```
7733    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7734    /// # use google_cloud_networksecurity_v1::*;
7735    /// # use builder::intercept::ClientBuilder;
7736    /// # use client::Intercept;
7737    /// let builder : ClientBuilder = Intercept::builder();
7738    /// let client = builder
7739    ///     .with_endpoint("https://networksecurity.googleapis.com")
7740    ///     .build().await?;
7741    /// # Ok(()) }
7742    /// ```
7743    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7744
7745    pub(crate) mod client {
7746        use super::super::super::client::Intercept;
7747        pub struct Factory;
7748        impl crate::ClientFactory for Factory {
7749            type Client = Intercept;
7750            type Credentials = gaxi::options::Credentials;
7751            async fn build(
7752                self,
7753                config: gaxi::options::ClientConfig,
7754            ) -> crate::ClientBuilderResult<Self::Client> {
7755                Self::Client::new(config).await
7756            }
7757        }
7758    }
7759
7760    /// Common implementation for [crate::client::Intercept] request builders.
7761    #[derive(Clone, Debug)]
7762    pub(crate) struct RequestBuilder<R: std::default::Default> {
7763        stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7764        request: R,
7765        options: crate::RequestOptions,
7766    }
7767
7768    impl<R> RequestBuilder<R>
7769    where
7770        R: std::default::Default,
7771    {
7772        pub(crate) fn new(
7773            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7774        ) -> Self {
7775            Self {
7776                stub,
7777                request: R::default(),
7778                options: crate::RequestOptions::default(),
7779            }
7780        }
7781    }
7782
7783    /// The request builder for [Intercept::list_intercept_endpoint_groups][crate::client::Intercept::list_intercept_endpoint_groups] calls.
7784    ///
7785    /// # Example
7786    /// ```
7787    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptEndpointGroups;
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() -> ListInterceptEndpointGroups {
7799    ///   # panic!();
7800    ///   // ... details omitted ...
7801    /// }
7802    /// ```
7803    #[derive(Clone, Debug)]
7804    pub struct ListInterceptEndpointGroups(
7805        RequestBuilder<crate::model::ListInterceptEndpointGroupsRequest>,
7806    );
7807
7808    impl ListInterceptEndpointGroups {
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<V: Into<crate::model::ListInterceptEndpointGroupsRequest>>(
7817            mut self,
7818            v: V,
7819        ) -> Self {
7820            self.0.request = v.into();
7821            self
7822        }
7823
7824        /// Sets all the options, replacing any prior values.
7825        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7826            self.0.options = v.into();
7827            self
7828        }
7829
7830        /// Sends the request.
7831        pub async fn send(self) -> Result<crate::model::ListInterceptEndpointGroupsResponse> {
7832            (*self.0.stub)
7833                .list_intercept_endpoint_groups(self.0.request, self.0.options)
7834                .await
7835                .map(crate::Response::into_body)
7836        }
7837
7838        /// Streams each page in the collection.
7839        pub fn by_page(
7840            self,
7841        ) -> impl google_cloud_gax::paginator::Paginator<
7842            crate::model::ListInterceptEndpointGroupsResponse,
7843            crate::Error,
7844        > {
7845            use std::clone::Clone;
7846            let token = self.0.request.page_token.clone();
7847            let execute = move |token: String| {
7848                let mut builder = self.clone();
7849                builder.0.request = builder.0.request.set_page_token(token);
7850                builder.send()
7851            };
7852            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7853        }
7854
7855        /// Streams each item in the collection.
7856        pub fn by_item(
7857            self,
7858        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7859            crate::model::ListInterceptEndpointGroupsResponse,
7860            crate::Error,
7861        > {
7862            use google_cloud_gax::paginator::Paginator;
7863            self.by_page().items()
7864        }
7865
7866        /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupsRequest::parent].
7867        ///
7868        /// This is a **required** field for requests.
7869        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7870            self.0.request.parent = v.into();
7871            self
7872        }
7873
7874        /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupsRequest::page_size].
7875        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7876            self.0.request.page_size = v.into();
7877            self
7878        }
7879
7880        /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupsRequest::page_token].
7881        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7882            self.0.request.page_token = v.into();
7883            self
7884        }
7885
7886        /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupsRequest::filter].
7887        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7888            self.0.request.filter = v.into();
7889            self
7890        }
7891
7892        /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupsRequest::order_by].
7893        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7894            self.0.request.order_by = v.into();
7895            self
7896        }
7897    }
7898
7899    #[doc(hidden)]
7900    impl crate::RequestBuilder for ListInterceptEndpointGroups {
7901        fn request_options(&mut self) -> &mut crate::RequestOptions {
7902            &mut self.0.options
7903        }
7904    }
7905
7906    /// The request builder for [Intercept::get_intercept_endpoint_group][crate::client::Intercept::get_intercept_endpoint_group] calls.
7907    ///
7908    /// # Example
7909    /// ```
7910    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptEndpointGroup;
7911    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7912    ///
7913    /// let builder = prepare_request_builder();
7914    /// let response = builder.send().await?;
7915    /// # Ok(()) }
7916    ///
7917    /// fn prepare_request_builder() -> GetInterceptEndpointGroup {
7918    ///   # panic!();
7919    ///   // ... details omitted ...
7920    /// }
7921    /// ```
7922    #[derive(Clone, Debug)]
7923    pub struct GetInterceptEndpointGroup(
7924        RequestBuilder<crate::model::GetInterceptEndpointGroupRequest>,
7925    );
7926
7927    impl GetInterceptEndpointGroup {
7928        pub(crate) fn new(
7929            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7930        ) -> Self {
7931            Self(RequestBuilder::new(stub))
7932        }
7933
7934        /// Sets the full request, replacing any prior values.
7935        pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupRequest>>(
7936            mut self,
7937            v: V,
7938        ) -> Self {
7939            self.0.request = v.into();
7940            self
7941        }
7942
7943        /// Sets all the options, replacing any prior values.
7944        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7945            self.0.options = v.into();
7946            self
7947        }
7948
7949        /// Sends the request.
7950        pub async fn send(self) -> Result<crate::model::InterceptEndpointGroup> {
7951            (*self.0.stub)
7952                .get_intercept_endpoint_group(self.0.request, self.0.options)
7953                .await
7954                .map(crate::Response::into_body)
7955        }
7956
7957        /// Sets the value of [name][crate::model::GetInterceptEndpointGroupRequest::name].
7958        ///
7959        /// This is a **required** field for requests.
7960        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7961            self.0.request.name = v.into();
7962            self
7963        }
7964    }
7965
7966    #[doc(hidden)]
7967    impl crate::RequestBuilder for GetInterceptEndpointGroup {
7968        fn request_options(&mut self) -> &mut crate::RequestOptions {
7969            &mut self.0.options
7970        }
7971    }
7972
7973    /// The request builder for [Intercept::create_intercept_endpoint_group][crate::client::Intercept::create_intercept_endpoint_group] calls.
7974    ///
7975    /// # Example
7976    /// ```
7977    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptEndpointGroup;
7978    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
7979    /// use google_cloud_lro::Poller;
7980    ///
7981    /// let builder = prepare_request_builder();
7982    /// let response = builder.poller().until_done().await?;
7983    /// # Ok(()) }
7984    ///
7985    /// fn prepare_request_builder() -> CreateInterceptEndpointGroup {
7986    ///   # panic!();
7987    ///   // ... details omitted ...
7988    /// }
7989    /// ```
7990    #[derive(Clone, Debug)]
7991    pub struct CreateInterceptEndpointGroup(
7992        RequestBuilder<crate::model::CreateInterceptEndpointGroupRequest>,
7993    );
7994
7995    impl CreateInterceptEndpointGroup {
7996        pub(crate) fn new(
7997            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
7998        ) -> Self {
7999            Self(RequestBuilder::new(stub))
8000        }
8001
8002        /// Sets the full request, replacing any prior values.
8003        pub fn with_request<V: Into<crate::model::CreateInterceptEndpointGroupRequest>>(
8004            mut self,
8005            v: V,
8006        ) -> Self {
8007            self.0.request = v.into();
8008            self
8009        }
8010
8011        /// Sets all the options, replacing any prior values.
8012        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8013            self.0.options = v.into();
8014            self
8015        }
8016
8017        /// Sends the request.
8018        ///
8019        /// # Long running operations
8020        ///
8021        /// This starts, but does not poll, a longrunning operation. More information
8022        /// on [create_intercept_endpoint_group][crate::client::Intercept::create_intercept_endpoint_group].
8023        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8024            (*self.0.stub)
8025                .create_intercept_endpoint_group(self.0.request, self.0.options)
8026                .await
8027                .map(crate::Response::into_body)
8028        }
8029
8030        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_endpoint_group`.
8031        pub fn poller(
8032            self,
8033        ) -> impl google_cloud_lro::Poller<
8034            crate::model::InterceptEndpointGroup,
8035            crate::model::OperationMetadata,
8036        > {
8037            type Operation = google_cloud_lro::internal::Operation<
8038                crate::model::InterceptEndpointGroup,
8039                crate::model::OperationMetadata,
8040            >;
8041            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8042            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8043
8044            let stub = self.0.stub.clone();
8045            let mut options = self.0.options.clone();
8046            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8047            let query = move |name| {
8048                let stub = stub.clone();
8049                let options = options.clone();
8050                async {
8051                    let op = GetOperation::new(stub)
8052                        .set_name(name)
8053                        .with_options(options)
8054                        .send()
8055                        .await?;
8056                    Ok(Operation::new(op))
8057                }
8058            };
8059
8060            let start = move || async {
8061                let op = self.send().await?;
8062                Ok(Operation::new(op))
8063            };
8064
8065            google_cloud_lro::internal::new_poller(
8066                polling_error_policy,
8067                polling_backoff_policy,
8068                start,
8069                query,
8070            )
8071        }
8072
8073        /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupRequest::parent].
8074        ///
8075        /// This is a **required** field for requests.
8076        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8077            self.0.request.parent = v.into();
8078            self
8079        }
8080
8081        /// Sets the value of [intercept_endpoint_group_id][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group_id].
8082        ///
8083        /// This is a **required** field for requests.
8084        pub fn set_intercept_endpoint_group_id<T: Into<std::string::String>>(
8085            mut self,
8086            v: T,
8087        ) -> Self {
8088            self.0.request.intercept_endpoint_group_id = v.into();
8089            self
8090        }
8091
8092        /// Sets the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
8093        ///
8094        /// This is a **required** field for requests.
8095        pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
8096        where
8097            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8098        {
8099            self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
8100            self
8101        }
8102
8103        /// Sets or clears the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
8104        ///
8105        /// This is a **required** field for requests.
8106        pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
8107        where
8108            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8109        {
8110            self.0.request.intercept_endpoint_group = v.map(|x| x.into());
8111            self
8112        }
8113
8114        /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupRequest::request_id].
8115        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8116            self.0.request.request_id = v.into();
8117            self
8118        }
8119    }
8120
8121    #[doc(hidden)]
8122    impl crate::RequestBuilder for CreateInterceptEndpointGroup {
8123        fn request_options(&mut self) -> &mut crate::RequestOptions {
8124            &mut self.0.options
8125        }
8126    }
8127
8128    /// The request builder for [Intercept::update_intercept_endpoint_group][crate::client::Intercept::update_intercept_endpoint_group] calls.
8129    ///
8130    /// # Example
8131    /// ```
8132    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptEndpointGroup;
8133    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8134    /// use google_cloud_lro::Poller;
8135    ///
8136    /// let builder = prepare_request_builder();
8137    /// let response = builder.poller().until_done().await?;
8138    /// # Ok(()) }
8139    ///
8140    /// fn prepare_request_builder() -> UpdateInterceptEndpointGroup {
8141    ///   # panic!();
8142    ///   // ... details omitted ...
8143    /// }
8144    /// ```
8145    #[derive(Clone, Debug)]
8146    pub struct UpdateInterceptEndpointGroup(
8147        RequestBuilder<crate::model::UpdateInterceptEndpointGroupRequest>,
8148    );
8149
8150    impl UpdateInterceptEndpointGroup {
8151        pub(crate) fn new(
8152            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8153        ) -> Self {
8154            Self(RequestBuilder::new(stub))
8155        }
8156
8157        /// Sets the full request, replacing any prior values.
8158        pub fn with_request<V: Into<crate::model::UpdateInterceptEndpointGroupRequest>>(
8159            mut self,
8160            v: V,
8161        ) -> Self {
8162            self.0.request = v.into();
8163            self
8164        }
8165
8166        /// Sets all the options, replacing any prior values.
8167        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8168            self.0.options = v.into();
8169            self
8170        }
8171
8172        /// Sends the request.
8173        ///
8174        /// # Long running operations
8175        ///
8176        /// This starts, but does not poll, a longrunning operation. More information
8177        /// on [update_intercept_endpoint_group][crate::client::Intercept::update_intercept_endpoint_group].
8178        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8179            (*self.0.stub)
8180                .update_intercept_endpoint_group(self.0.request, self.0.options)
8181                .await
8182                .map(crate::Response::into_body)
8183        }
8184
8185        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_endpoint_group`.
8186        pub fn poller(
8187            self,
8188        ) -> impl google_cloud_lro::Poller<
8189            crate::model::InterceptEndpointGroup,
8190            crate::model::OperationMetadata,
8191        > {
8192            type Operation = google_cloud_lro::internal::Operation<
8193                crate::model::InterceptEndpointGroup,
8194                crate::model::OperationMetadata,
8195            >;
8196            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8197            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8198
8199            let stub = self.0.stub.clone();
8200            let mut options = self.0.options.clone();
8201            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8202            let query = move |name| {
8203                let stub = stub.clone();
8204                let options = options.clone();
8205                async {
8206                    let op = GetOperation::new(stub)
8207                        .set_name(name)
8208                        .with_options(options)
8209                        .send()
8210                        .await?;
8211                    Ok(Operation::new(op))
8212                }
8213            };
8214
8215            let start = move || async {
8216                let op = self.send().await?;
8217                Ok(Operation::new(op))
8218            };
8219
8220            google_cloud_lro::internal::new_poller(
8221                polling_error_policy,
8222                polling_backoff_policy,
8223                start,
8224                query,
8225            )
8226        }
8227
8228        /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
8229        pub fn set_update_mask<T>(mut self, v: T) -> Self
8230        where
8231            T: std::convert::Into<wkt::FieldMask>,
8232        {
8233            self.0.request.update_mask = std::option::Option::Some(v.into());
8234            self
8235        }
8236
8237        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
8238        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8239        where
8240            T: std::convert::Into<wkt::FieldMask>,
8241        {
8242            self.0.request.update_mask = v.map(|x| x.into());
8243            self
8244        }
8245
8246        /// Sets the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
8247        ///
8248        /// This is a **required** field for requests.
8249        pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
8250        where
8251            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8252        {
8253            self.0.request.intercept_endpoint_group = std::option::Option::Some(v.into());
8254            self
8255        }
8256
8257        /// Sets or clears the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
8258        ///
8259        /// This is a **required** field for requests.
8260        pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
8261        where
8262            T: std::convert::Into<crate::model::InterceptEndpointGroup>,
8263        {
8264            self.0.request.intercept_endpoint_group = v.map(|x| x.into());
8265            self
8266        }
8267
8268        /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupRequest::request_id].
8269        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8270            self.0.request.request_id = v.into();
8271            self
8272        }
8273    }
8274
8275    #[doc(hidden)]
8276    impl crate::RequestBuilder for UpdateInterceptEndpointGroup {
8277        fn request_options(&mut self) -> &mut crate::RequestOptions {
8278            &mut self.0.options
8279        }
8280    }
8281
8282    /// The request builder for [Intercept::delete_intercept_endpoint_group][crate::client::Intercept::delete_intercept_endpoint_group] calls.
8283    ///
8284    /// # Example
8285    /// ```
8286    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptEndpointGroup;
8287    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8288    /// use google_cloud_lro::Poller;
8289    ///
8290    /// let builder = prepare_request_builder();
8291    /// let response = builder.poller().until_done().await?;
8292    /// # Ok(()) }
8293    ///
8294    /// fn prepare_request_builder() -> DeleteInterceptEndpointGroup {
8295    ///   # panic!();
8296    ///   // ... details omitted ...
8297    /// }
8298    /// ```
8299    #[derive(Clone, Debug)]
8300    pub struct DeleteInterceptEndpointGroup(
8301        RequestBuilder<crate::model::DeleteInterceptEndpointGroupRequest>,
8302    );
8303
8304    impl DeleteInterceptEndpointGroup {
8305        pub(crate) fn new(
8306            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8307        ) -> Self {
8308            Self(RequestBuilder::new(stub))
8309        }
8310
8311        /// Sets the full request, replacing any prior values.
8312        pub fn with_request<V: Into<crate::model::DeleteInterceptEndpointGroupRequest>>(
8313            mut self,
8314            v: V,
8315        ) -> Self {
8316            self.0.request = v.into();
8317            self
8318        }
8319
8320        /// Sets all the options, replacing any prior values.
8321        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8322            self.0.options = v.into();
8323            self
8324        }
8325
8326        /// Sends the request.
8327        ///
8328        /// # Long running operations
8329        ///
8330        /// This starts, but does not poll, a longrunning operation. More information
8331        /// on [delete_intercept_endpoint_group][crate::client::Intercept::delete_intercept_endpoint_group].
8332        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8333            (*self.0.stub)
8334                .delete_intercept_endpoint_group(self.0.request, self.0.options)
8335                .await
8336                .map(crate::Response::into_body)
8337        }
8338
8339        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_endpoint_group`.
8340        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
8341            type Operation =
8342                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8343            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8344            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8345
8346            let stub = self.0.stub.clone();
8347            let mut options = self.0.options.clone();
8348            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8349            let query = move |name| {
8350                let stub = stub.clone();
8351                let options = options.clone();
8352                async {
8353                    let op = GetOperation::new(stub)
8354                        .set_name(name)
8355                        .with_options(options)
8356                        .send()
8357                        .await?;
8358                    Ok(Operation::new(op))
8359                }
8360            };
8361
8362            let start = move || async {
8363                let op = self.send().await?;
8364                Ok(Operation::new(op))
8365            };
8366
8367            google_cloud_lro::internal::new_unit_response_poller(
8368                polling_error_policy,
8369                polling_backoff_policy,
8370                start,
8371                query,
8372            )
8373        }
8374
8375        /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupRequest::name].
8376        ///
8377        /// This is a **required** field for requests.
8378        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8379            self.0.request.name = v.into();
8380            self
8381        }
8382
8383        /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupRequest::request_id].
8384        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8385            self.0.request.request_id = v.into();
8386            self
8387        }
8388    }
8389
8390    #[doc(hidden)]
8391    impl crate::RequestBuilder for DeleteInterceptEndpointGroup {
8392        fn request_options(&mut self) -> &mut crate::RequestOptions {
8393            &mut self.0.options
8394        }
8395    }
8396
8397    /// The request builder for [Intercept::list_intercept_endpoint_group_associations][crate::client::Intercept::list_intercept_endpoint_group_associations] calls.
8398    ///
8399    /// # Example
8400    /// ```
8401    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptEndpointGroupAssociations;
8402    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8403    /// use google_cloud_gax::paginator::ItemPaginator;
8404    ///
8405    /// let builder = prepare_request_builder();
8406    /// let mut items = builder.by_item();
8407    /// while let Some(result) = items.next().await {
8408    ///   let item = result?;
8409    /// }
8410    /// # Ok(()) }
8411    ///
8412    /// fn prepare_request_builder() -> ListInterceptEndpointGroupAssociations {
8413    ///   # panic!();
8414    ///   // ... details omitted ...
8415    /// }
8416    /// ```
8417    #[derive(Clone, Debug)]
8418    pub struct ListInterceptEndpointGroupAssociations(
8419        RequestBuilder<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
8420    );
8421
8422    impl ListInterceptEndpointGroupAssociations {
8423        pub(crate) fn new(
8424            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8425        ) -> Self {
8426            Self(RequestBuilder::new(stub))
8427        }
8428
8429        /// Sets the full request, replacing any prior values.
8430        pub fn with_request<
8431            V: Into<crate::model::ListInterceptEndpointGroupAssociationsRequest>,
8432        >(
8433            mut self,
8434            v: V,
8435        ) -> Self {
8436            self.0.request = v.into();
8437            self
8438        }
8439
8440        /// Sets all the options, replacing any prior values.
8441        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8442            self.0.options = v.into();
8443            self
8444        }
8445
8446        /// Sends the request.
8447        pub async fn send(
8448            self,
8449        ) -> Result<crate::model::ListInterceptEndpointGroupAssociationsResponse> {
8450            (*self.0.stub)
8451                .list_intercept_endpoint_group_associations(self.0.request, self.0.options)
8452                .await
8453                .map(crate::Response::into_body)
8454        }
8455
8456        /// Streams each page in the collection.
8457        pub fn by_page(
8458            self,
8459        ) -> impl google_cloud_gax::paginator::Paginator<
8460            crate::model::ListInterceptEndpointGroupAssociationsResponse,
8461            crate::Error,
8462        > {
8463            use std::clone::Clone;
8464            let token = self.0.request.page_token.clone();
8465            let execute = move |token: String| {
8466                let mut builder = self.clone();
8467                builder.0.request = builder.0.request.set_page_token(token);
8468                builder.send()
8469            };
8470            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8471        }
8472
8473        /// Streams each item in the collection.
8474        pub fn by_item(
8475            self,
8476        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8477            crate::model::ListInterceptEndpointGroupAssociationsResponse,
8478            crate::Error,
8479        > {
8480            use google_cloud_gax::paginator::Paginator;
8481            self.by_page().items()
8482        }
8483
8484        /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupAssociationsRequest::parent].
8485        ///
8486        /// This is a **required** field for requests.
8487        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8488            self.0.request.parent = v.into();
8489            self
8490        }
8491
8492        /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_size].
8493        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8494            self.0.request.page_size = v.into();
8495            self
8496        }
8497
8498        /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_token].
8499        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8500            self.0.request.page_token = v.into();
8501            self
8502        }
8503
8504        /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupAssociationsRequest::filter].
8505        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8506            self.0.request.filter = v.into();
8507            self
8508        }
8509
8510        /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupAssociationsRequest::order_by].
8511        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8512            self.0.request.order_by = v.into();
8513            self
8514        }
8515    }
8516
8517    #[doc(hidden)]
8518    impl crate::RequestBuilder for ListInterceptEndpointGroupAssociations {
8519        fn request_options(&mut self) -> &mut crate::RequestOptions {
8520            &mut self.0.options
8521        }
8522    }
8523
8524    /// The request builder for [Intercept::get_intercept_endpoint_group_association][crate::client::Intercept::get_intercept_endpoint_group_association] calls.
8525    ///
8526    /// # Example
8527    /// ```
8528    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptEndpointGroupAssociation;
8529    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8530    ///
8531    /// let builder = prepare_request_builder();
8532    /// let response = builder.send().await?;
8533    /// # Ok(()) }
8534    ///
8535    /// fn prepare_request_builder() -> GetInterceptEndpointGroupAssociation {
8536    ///   # panic!();
8537    ///   // ... details omitted ...
8538    /// }
8539    /// ```
8540    #[derive(Clone, Debug)]
8541    pub struct GetInterceptEndpointGroupAssociation(
8542        RequestBuilder<crate::model::GetInterceptEndpointGroupAssociationRequest>,
8543    );
8544
8545    impl GetInterceptEndpointGroupAssociation {
8546        pub(crate) fn new(
8547            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8548        ) -> Self {
8549            Self(RequestBuilder::new(stub))
8550        }
8551
8552        /// Sets the full request, replacing any prior values.
8553        pub fn with_request<V: Into<crate::model::GetInterceptEndpointGroupAssociationRequest>>(
8554            mut self,
8555            v: V,
8556        ) -> Self {
8557            self.0.request = v.into();
8558            self
8559        }
8560
8561        /// Sets all the options, replacing any prior values.
8562        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8563            self.0.options = v.into();
8564            self
8565        }
8566
8567        /// Sends the request.
8568        pub async fn send(self) -> Result<crate::model::InterceptEndpointGroupAssociation> {
8569            (*self.0.stub)
8570                .get_intercept_endpoint_group_association(self.0.request, self.0.options)
8571                .await
8572                .map(crate::Response::into_body)
8573        }
8574
8575        /// Sets the value of [name][crate::model::GetInterceptEndpointGroupAssociationRequest::name].
8576        ///
8577        /// This is a **required** field for requests.
8578        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8579            self.0.request.name = v.into();
8580            self
8581        }
8582    }
8583
8584    #[doc(hidden)]
8585    impl crate::RequestBuilder for GetInterceptEndpointGroupAssociation {
8586        fn request_options(&mut self) -> &mut crate::RequestOptions {
8587            &mut self.0.options
8588        }
8589    }
8590
8591    /// The request builder for [Intercept::create_intercept_endpoint_group_association][crate::client::Intercept::create_intercept_endpoint_group_association] calls.
8592    ///
8593    /// # Example
8594    /// ```
8595    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptEndpointGroupAssociation;
8596    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8597    /// use google_cloud_lro::Poller;
8598    ///
8599    /// let builder = prepare_request_builder();
8600    /// let response = builder.poller().until_done().await?;
8601    /// # Ok(()) }
8602    ///
8603    /// fn prepare_request_builder() -> CreateInterceptEndpointGroupAssociation {
8604    ///   # panic!();
8605    ///   // ... details omitted ...
8606    /// }
8607    /// ```
8608    #[derive(Clone, Debug)]
8609    pub struct CreateInterceptEndpointGroupAssociation(
8610        RequestBuilder<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
8611    );
8612
8613    impl CreateInterceptEndpointGroupAssociation {
8614        pub(crate) fn new(
8615            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8616        ) -> Self {
8617            Self(RequestBuilder::new(stub))
8618        }
8619
8620        /// Sets the full request, replacing any prior values.
8621        pub fn with_request<
8622            V: Into<crate::model::CreateInterceptEndpointGroupAssociationRequest>,
8623        >(
8624            mut self,
8625            v: V,
8626        ) -> Self {
8627            self.0.request = v.into();
8628            self
8629        }
8630
8631        /// Sets all the options, replacing any prior values.
8632        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8633            self.0.options = v.into();
8634            self
8635        }
8636
8637        /// Sends the request.
8638        ///
8639        /// # Long running operations
8640        ///
8641        /// This starts, but does not poll, a longrunning operation. More information
8642        /// on [create_intercept_endpoint_group_association][crate::client::Intercept::create_intercept_endpoint_group_association].
8643        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8644            (*self.0.stub)
8645                .create_intercept_endpoint_group_association(self.0.request, self.0.options)
8646                .await
8647                .map(crate::Response::into_body)
8648        }
8649
8650        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_endpoint_group_association`.
8651        pub fn poller(
8652            self,
8653        ) -> impl google_cloud_lro::Poller<
8654            crate::model::InterceptEndpointGroupAssociation,
8655            crate::model::OperationMetadata,
8656        > {
8657            type Operation = google_cloud_lro::internal::Operation<
8658                crate::model::InterceptEndpointGroupAssociation,
8659                crate::model::OperationMetadata,
8660            >;
8661            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8662            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8663
8664            let stub = self.0.stub.clone();
8665            let mut options = self.0.options.clone();
8666            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8667            let query = move |name| {
8668                let stub = stub.clone();
8669                let options = options.clone();
8670                async {
8671                    let op = GetOperation::new(stub)
8672                        .set_name(name)
8673                        .with_options(options)
8674                        .send()
8675                        .await?;
8676                    Ok(Operation::new(op))
8677                }
8678            };
8679
8680            let start = move || async {
8681                let op = self.send().await?;
8682                Ok(Operation::new(op))
8683            };
8684
8685            google_cloud_lro::internal::new_poller(
8686                polling_error_policy,
8687                polling_backoff_policy,
8688                start,
8689                query,
8690            )
8691        }
8692
8693        /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupAssociationRequest::parent].
8694        ///
8695        /// This is a **required** field for requests.
8696        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8697            self.0.request.parent = v.into();
8698            self
8699        }
8700
8701        /// Sets the value of [intercept_endpoint_group_association_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association_id].
8702        pub fn set_intercept_endpoint_group_association_id<T: Into<std::string::String>>(
8703            mut self,
8704            v: T,
8705        ) -> Self {
8706            self.0.request.intercept_endpoint_group_association_id = v.into();
8707            self
8708        }
8709
8710        /// Sets the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
8711        ///
8712        /// This is a **required** field for requests.
8713        pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
8714        where
8715            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8716        {
8717            self.0.request.intercept_endpoint_group_association =
8718                std::option::Option::Some(v.into());
8719            self
8720        }
8721
8722        /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
8723        ///
8724        /// This is a **required** field for requests.
8725        pub fn set_or_clear_intercept_endpoint_group_association<T>(
8726            mut self,
8727            v: std::option::Option<T>,
8728        ) -> Self
8729        where
8730            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8731        {
8732            self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
8733            self
8734        }
8735
8736        /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::request_id].
8737        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8738            self.0.request.request_id = v.into();
8739            self
8740        }
8741    }
8742
8743    #[doc(hidden)]
8744    impl crate::RequestBuilder for CreateInterceptEndpointGroupAssociation {
8745        fn request_options(&mut self) -> &mut crate::RequestOptions {
8746            &mut self.0.options
8747        }
8748    }
8749
8750    /// The request builder for [Intercept::update_intercept_endpoint_group_association][crate::client::Intercept::update_intercept_endpoint_group_association] calls.
8751    ///
8752    /// # Example
8753    /// ```
8754    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptEndpointGroupAssociation;
8755    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8756    /// use google_cloud_lro::Poller;
8757    ///
8758    /// let builder = prepare_request_builder();
8759    /// let response = builder.poller().until_done().await?;
8760    /// # Ok(()) }
8761    ///
8762    /// fn prepare_request_builder() -> UpdateInterceptEndpointGroupAssociation {
8763    ///   # panic!();
8764    ///   // ... details omitted ...
8765    /// }
8766    /// ```
8767    #[derive(Clone, Debug)]
8768    pub struct UpdateInterceptEndpointGroupAssociation(
8769        RequestBuilder<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8770    );
8771
8772    impl UpdateInterceptEndpointGroupAssociation {
8773        pub(crate) fn new(
8774            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8775        ) -> Self {
8776            Self(RequestBuilder::new(stub))
8777        }
8778
8779        /// Sets the full request, replacing any prior values.
8780        pub fn with_request<
8781            V: Into<crate::model::UpdateInterceptEndpointGroupAssociationRequest>,
8782        >(
8783            mut self,
8784            v: V,
8785        ) -> Self {
8786            self.0.request = v.into();
8787            self
8788        }
8789
8790        /// Sets all the options, replacing any prior values.
8791        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8792            self.0.options = v.into();
8793            self
8794        }
8795
8796        /// Sends the request.
8797        ///
8798        /// # Long running operations
8799        ///
8800        /// This starts, but does not poll, a longrunning operation. More information
8801        /// on [update_intercept_endpoint_group_association][crate::client::Intercept::update_intercept_endpoint_group_association].
8802        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8803            (*self.0.stub)
8804                .update_intercept_endpoint_group_association(self.0.request, self.0.options)
8805                .await
8806                .map(crate::Response::into_body)
8807        }
8808
8809        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_endpoint_group_association`.
8810        pub fn poller(
8811            self,
8812        ) -> impl google_cloud_lro::Poller<
8813            crate::model::InterceptEndpointGroupAssociation,
8814            crate::model::OperationMetadata,
8815        > {
8816            type Operation = google_cloud_lro::internal::Operation<
8817                crate::model::InterceptEndpointGroupAssociation,
8818                crate::model::OperationMetadata,
8819            >;
8820            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8821            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8822
8823            let stub = self.0.stub.clone();
8824            let mut options = self.0.options.clone();
8825            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8826            let query = move |name| {
8827                let stub = stub.clone();
8828                let options = options.clone();
8829                async {
8830                    let op = GetOperation::new(stub)
8831                        .set_name(name)
8832                        .with_options(options)
8833                        .send()
8834                        .await?;
8835                    Ok(Operation::new(op))
8836                }
8837            };
8838
8839            let start = move || async {
8840                let op = self.send().await?;
8841                Ok(Operation::new(op))
8842            };
8843
8844            google_cloud_lro::internal::new_poller(
8845                polling_error_policy,
8846                polling_backoff_policy,
8847                start,
8848                query,
8849            )
8850        }
8851
8852        /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
8853        pub fn set_update_mask<T>(mut self, v: T) -> Self
8854        where
8855            T: std::convert::Into<wkt::FieldMask>,
8856        {
8857            self.0.request.update_mask = std::option::Option::Some(v.into());
8858            self
8859        }
8860
8861        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
8862        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8863        where
8864            T: std::convert::Into<wkt::FieldMask>,
8865        {
8866            self.0.request.update_mask = v.map(|x| x.into());
8867            self
8868        }
8869
8870        /// Sets the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
8871        ///
8872        /// This is a **required** field for requests.
8873        pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
8874        where
8875            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8876        {
8877            self.0.request.intercept_endpoint_group_association =
8878                std::option::Option::Some(v.into());
8879            self
8880        }
8881
8882        /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
8883        ///
8884        /// This is a **required** field for requests.
8885        pub fn set_or_clear_intercept_endpoint_group_association<T>(
8886            mut self,
8887            v: std::option::Option<T>,
8888        ) -> Self
8889        where
8890            T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
8891        {
8892            self.0.request.intercept_endpoint_group_association = v.map(|x| x.into());
8893            self
8894        }
8895
8896        /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupAssociationRequest::request_id].
8897        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8898            self.0.request.request_id = v.into();
8899            self
8900        }
8901    }
8902
8903    #[doc(hidden)]
8904    impl crate::RequestBuilder for UpdateInterceptEndpointGroupAssociation {
8905        fn request_options(&mut self) -> &mut crate::RequestOptions {
8906            &mut self.0.options
8907        }
8908    }
8909
8910    /// The request builder for [Intercept::delete_intercept_endpoint_group_association][crate::client::Intercept::delete_intercept_endpoint_group_association] calls.
8911    ///
8912    /// # Example
8913    /// ```
8914    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptEndpointGroupAssociation;
8915    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
8916    /// use google_cloud_lro::Poller;
8917    ///
8918    /// let builder = prepare_request_builder();
8919    /// let response = builder.poller().until_done().await?;
8920    /// # Ok(()) }
8921    ///
8922    /// fn prepare_request_builder() -> DeleteInterceptEndpointGroupAssociation {
8923    ///   # panic!();
8924    ///   // ... details omitted ...
8925    /// }
8926    /// ```
8927    #[derive(Clone, Debug)]
8928    pub struct DeleteInterceptEndpointGroupAssociation(
8929        RequestBuilder<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
8930    );
8931
8932    impl DeleteInterceptEndpointGroupAssociation {
8933        pub(crate) fn new(
8934            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
8935        ) -> Self {
8936            Self(RequestBuilder::new(stub))
8937        }
8938
8939        /// Sets the full request, replacing any prior values.
8940        pub fn with_request<
8941            V: Into<crate::model::DeleteInterceptEndpointGroupAssociationRequest>,
8942        >(
8943            mut self,
8944            v: V,
8945        ) -> Self {
8946            self.0.request = v.into();
8947            self
8948        }
8949
8950        /// Sets all the options, replacing any prior values.
8951        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8952            self.0.options = v.into();
8953            self
8954        }
8955
8956        /// Sends the request.
8957        ///
8958        /// # Long running operations
8959        ///
8960        /// This starts, but does not poll, a longrunning operation. More information
8961        /// on [delete_intercept_endpoint_group_association][crate::client::Intercept::delete_intercept_endpoint_group_association].
8962        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8963            (*self.0.stub)
8964                .delete_intercept_endpoint_group_association(self.0.request, self.0.options)
8965                .await
8966                .map(crate::Response::into_body)
8967        }
8968
8969        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_endpoint_group_association`.
8970        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
8971            type Operation =
8972                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8973            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8974            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8975
8976            let stub = self.0.stub.clone();
8977            let mut options = self.0.options.clone();
8978            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8979            let query = move |name| {
8980                let stub = stub.clone();
8981                let options = options.clone();
8982                async {
8983                    let op = GetOperation::new(stub)
8984                        .set_name(name)
8985                        .with_options(options)
8986                        .send()
8987                        .await?;
8988                    Ok(Operation::new(op))
8989                }
8990            };
8991
8992            let start = move || async {
8993                let op = self.send().await?;
8994                Ok(Operation::new(op))
8995            };
8996
8997            google_cloud_lro::internal::new_unit_response_poller(
8998                polling_error_policy,
8999                polling_backoff_policy,
9000                start,
9001                query,
9002            )
9003        }
9004
9005        /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupAssociationRequest::name].
9006        ///
9007        /// This is a **required** field for requests.
9008        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9009            self.0.request.name = v.into();
9010            self
9011        }
9012
9013        /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupAssociationRequest::request_id].
9014        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9015            self.0.request.request_id = v.into();
9016            self
9017        }
9018    }
9019
9020    #[doc(hidden)]
9021    impl crate::RequestBuilder for DeleteInterceptEndpointGroupAssociation {
9022        fn request_options(&mut self) -> &mut crate::RequestOptions {
9023            &mut self.0.options
9024        }
9025    }
9026
9027    /// The request builder for [Intercept::list_intercept_deployment_groups][crate::client::Intercept::list_intercept_deployment_groups] calls.
9028    ///
9029    /// # Example
9030    /// ```
9031    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptDeploymentGroups;
9032    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9033    /// use google_cloud_gax::paginator::ItemPaginator;
9034    ///
9035    /// let builder = prepare_request_builder();
9036    /// let mut items = builder.by_item();
9037    /// while let Some(result) = items.next().await {
9038    ///   let item = result?;
9039    /// }
9040    /// # Ok(()) }
9041    ///
9042    /// fn prepare_request_builder() -> ListInterceptDeploymentGroups {
9043    ///   # panic!();
9044    ///   // ... details omitted ...
9045    /// }
9046    /// ```
9047    #[derive(Clone, Debug)]
9048    pub struct ListInterceptDeploymentGroups(
9049        RequestBuilder<crate::model::ListInterceptDeploymentGroupsRequest>,
9050    );
9051
9052    impl ListInterceptDeploymentGroups {
9053        pub(crate) fn new(
9054            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9055        ) -> Self {
9056            Self(RequestBuilder::new(stub))
9057        }
9058
9059        /// Sets the full request, replacing any prior values.
9060        pub fn with_request<V: Into<crate::model::ListInterceptDeploymentGroupsRequest>>(
9061            mut self,
9062            v: V,
9063        ) -> Self {
9064            self.0.request = v.into();
9065            self
9066        }
9067
9068        /// Sets all the options, replacing any prior values.
9069        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9070            self.0.options = v.into();
9071            self
9072        }
9073
9074        /// Sends the request.
9075        pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentGroupsResponse> {
9076            (*self.0.stub)
9077                .list_intercept_deployment_groups(self.0.request, self.0.options)
9078                .await
9079                .map(crate::Response::into_body)
9080        }
9081
9082        /// Streams each page in the collection.
9083        pub fn by_page(
9084            self,
9085        ) -> impl google_cloud_gax::paginator::Paginator<
9086            crate::model::ListInterceptDeploymentGroupsResponse,
9087            crate::Error,
9088        > {
9089            use std::clone::Clone;
9090            let token = self.0.request.page_token.clone();
9091            let execute = move |token: String| {
9092                let mut builder = self.clone();
9093                builder.0.request = builder.0.request.set_page_token(token);
9094                builder.send()
9095            };
9096            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9097        }
9098
9099        /// Streams each item in the collection.
9100        pub fn by_item(
9101            self,
9102        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9103            crate::model::ListInterceptDeploymentGroupsResponse,
9104            crate::Error,
9105        > {
9106            use google_cloud_gax::paginator::Paginator;
9107            self.by_page().items()
9108        }
9109
9110        /// Sets the value of [parent][crate::model::ListInterceptDeploymentGroupsRequest::parent].
9111        ///
9112        /// This is a **required** field for requests.
9113        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9114            self.0.request.parent = v.into();
9115            self
9116        }
9117
9118        /// Sets the value of [page_size][crate::model::ListInterceptDeploymentGroupsRequest::page_size].
9119        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9120            self.0.request.page_size = v.into();
9121            self
9122        }
9123
9124        /// Sets the value of [page_token][crate::model::ListInterceptDeploymentGroupsRequest::page_token].
9125        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9126            self.0.request.page_token = v.into();
9127            self
9128        }
9129
9130        /// Sets the value of [filter][crate::model::ListInterceptDeploymentGroupsRequest::filter].
9131        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9132            self.0.request.filter = v.into();
9133            self
9134        }
9135
9136        /// Sets the value of [order_by][crate::model::ListInterceptDeploymentGroupsRequest::order_by].
9137        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9138            self.0.request.order_by = v.into();
9139            self
9140        }
9141    }
9142
9143    #[doc(hidden)]
9144    impl crate::RequestBuilder for ListInterceptDeploymentGroups {
9145        fn request_options(&mut self) -> &mut crate::RequestOptions {
9146            &mut self.0.options
9147        }
9148    }
9149
9150    /// The request builder for [Intercept::get_intercept_deployment_group][crate::client::Intercept::get_intercept_deployment_group] calls.
9151    ///
9152    /// # Example
9153    /// ```
9154    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptDeploymentGroup;
9155    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9156    ///
9157    /// let builder = prepare_request_builder();
9158    /// let response = builder.send().await?;
9159    /// # Ok(()) }
9160    ///
9161    /// fn prepare_request_builder() -> GetInterceptDeploymentGroup {
9162    ///   # panic!();
9163    ///   // ... details omitted ...
9164    /// }
9165    /// ```
9166    #[derive(Clone, Debug)]
9167    pub struct GetInterceptDeploymentGroup(
9168        RequestBuilder<crate::model::GetInterceptDeploymentGroupRequest>,
9169    );
9170
9171    impl GetInterceptDeploymentGroup {
9172        pub(crate) fn new(
9173            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9174        ) -> Self {
9175            Self(RequestBuilder::new(stub))
9176        }
9177
9178        /// Sets the full request, replacing any prior values.
9179        pub fn with_request<V: Into<crate::model::GetInterceptDeploymentGroupRequest>>(
9180            mut self,
9181            v: V,
9182        ) -> Self {
9183            self.0.request = v.into();
9184            self
9185        }
9186
9187        /// Sets all the options, replacing any prior values.
9188        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9189            self.0.options = v.into();
9190            self
9191        }
9192
9193        /// Sends the request.
9194        pub async fn send(self) -> Result<crate::model::InterceptDeploymentGroup> {
9195            (*self.0.stub)
9196                .get_intercept_deployment_group(self.0.request, self.0.options)
9197                .await
9198                .map(crate::Response::into_body)
9199        }
9200
9201        /// Sets the value of [name][crate::model::GetInterceptDeploymentGroupRequest::name].
9202        ///
9203        /// This is a **required** field for requests.
9204        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9205            self.0.request.name = v.into();
9206            self
9207        }
9208    }
9209
9210    #[doc(hidden)]
9211    impl crate::RequestBuilder for GetInterceptDeploymentGroup {
9212        fn request_options(&mut self) -> &mut crate::RequestOptions {
9213            &mut self.0.options
9214        }
9215    }
9216
9217    /// The request builder for [Intercept::create_intercept_deployment_group][crate::client::Intercept::create_intercept_deployment_group] calls.
9218    ///
9219    /// # Example
9220    /// ```
9221    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptDeploymentGroup;
9222    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9223    /// use google_cloud_lro::Poller;
9224    ///
9225    /// let builder = prepare_request_builder();
9226    /// let response = builder.poller().until_done().await?;
9227    /// # Ok(()) }
9228    ///
9229    /// fn prepare_request_builder() -> CreateInterceptDeploymentGroup {
9230    ///   # panic!();
9231    ///   // ... details omitted ...
9232    /// }
9233    /// ```
9234    #[derive(Clone, Debug)]
9235    pub struct CreateInterceptDeploymentGroup(
9236        RequestBuilder<crate::model::CreateInterceptDeploymentGroupRequest>,
9237    );
9238
9239    impl CreateInterceptDeploymentGroup {
9240        pub(crate) fn new(
9241            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9242        ) -> Self {
9243            Self(RequestBuilder::new(stub))
9244        }
9245
9246        /// Sets the full request, replacing any prior values.
9247        pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentGroupRequest>>(
9248            mut self,
9249            v: V,
9250        ) -> Self {
9251            self.0.request = v.into();
9252            self
9253        }
9254
9255        /// Sets all the options, replacing any prior values.
9256        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9257            self.0.options = v.into();
9258            self
9259        }
9260
9261        /// Sends the request.
9262        ///
9263        /// # Long running operations
9264        ///
9265        /// This starts, but does not poll, a longrunning operation. More information
9266        /// on [create_intercept_deployment_group][crate::client::Intercept::create_intercept_deployment_group].
9267        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9268            (*self.0.stub)
9269                .create_intercept_deployment_group(self.0.request, self.0.options)
9270                .await
9271                .map(crate::Response::into_body)
9272        }
9273
9274        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_deployment_group`.
9275        pub fn poller(
9276            self,
9277        ) -> impl google_cloud_lro::Poller<
9278            crate::model::InterceptDeploymentGroup,
9279            crate::model::OperationMetadata,
9280        > {
9281            type Operation = google_cloud_lro::internal::Operation<
9282                crate::model::InterceptDeploymentGroup,
9283                crate::model::OperationMetadata,
9284            >;
9285            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9286            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9287
9288            let stub = self.0.stub.clone();
9289            let mut options = self.0.options.clone();
9290            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9291            let query = move |name| {
9292                let stub = stub.clone();
9293                let options = options.clone();
9294                async {
9295                    let op = GetOperation::new(stub)
9296                        .set_name(name)
9297                        .with_options(options)
9298                        .send()
9299                        .await?;
9300                    Ok(Operation::new(op))
9301                }
9302            };
9303
9304            let start = move || async {
9305                let op = self.send().await?;
9306                Ok(Operation::new(op))
9307            };
9308
9309            google_cloud_lro::internal::new_poller(
9310                polling_error_policy,
9311                polling_backoff_policy,
9312                start,
9313                query,
9314            )
9315        }
9316
9317        /// Sets the value of [parent][crate::model::CreateInterceptDeploymentGroupRequest::parent].
9318        ///
9319        /// This is a **required** field for requests.
9320        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9321            self.0.request.parent = v.into();
9322            self
9323        }
9324
9325        /// Sets the value of [intercept_deployment_group_id][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group_id].
9326        ///
9327        /// This is a **required** field for requests.
9328        pub fn set_intercept_deployment_group_id<T: Into<std::string::String>>(
9329            mut self,
9330            v: T,
9331        ) -> Self {
9332            self.0.request.intercept_deployment_group_id = v.into();
9333            self
9334        }
9335
9336        /// Sets the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
9337        ///
9338        /// This is a **required** field for requests.
9339        pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
9340        where
9341            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9342        {
9343            self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
9344            self
9345        }
9346
9347        /// Sets or clears the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
9348        ///
9349        /// This is a **required** field for requests.
9350        pub fn set_or_clear_intercept_deployment_group<T>(
9351            mut self,
9352            v: std::option::Option<T>,
9353        ) -> Self
9354        where
9355            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9356        {
9357            self.0.request.intercept_deployment_group = v.map(|x| x.into());
9358            self
9359        }
9360
9361        /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentGroupRequest::request_id].
9362        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9363            self.0.request.request_id = v.into();
9364            self
9365        }
9366    }
9367
9368    #[doc(hidden)]
9369    impl crate::RequestBuilder for CreateInterceptDeploymentGroup {
9370        fn request_options(&mut self) -> &mut crate::RequestOptions {
9371            &mut self.0.options
9372        }
9373    }
9374
9375    /// The request builder for [Intercept::update_intercept_deployment_group][crate::client::Intercept::update_intercept_deployment_group] calls.
9376    ///
9377    /// # Example
9378    /// ```
9379    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptDeploymentGroup;
9380    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9381    /// use google_cloud_lro::Poller;
9382    ///
9383    /// let builder = prepare_request_builder();
9384    /// let response = builder.poller().until_done().await?;
9385    /// # Ok(()) }
9386    ///
9387    /// fn prepare_request_builder() -> UpdateInterceptDeploymentGroup {
9388    ///   # panic!();
9389    ///   // ... details omitted ...
9390    /// }
9391    /// ```
9392    #[derive(Clone, Debug)]
9393    pub struct UpdateInterceptDeploymentGroup(
9394        RequestBuilder<crate::model::UpdateInterceptDeploymentGroupRequest>,
9395    );
9396
9397    impl UpdateInterceptDeploymentGroup {
9398        pub(crate) fn new(
9399            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9400        ) -> Self {
9401            Self(RequestBuilder::new(stub))
9402        }
9403
9404        /// Sets the full request, replacing any prior values.
9405        pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentGroupRequest>>(
9406            mut self,
9407            v: V,
9408        ) -> Self {
9409            self.0.request = v.into();
9410            self
9411        }
9412
9413        /// Sets all the options, replacing any prior values.
9414        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9415            self.0.options = v.into();
9416            self
9417        }
9418
9419        /// Sends the request.
9420        ///
9421        /// # Long running operations
9422        ///
9423        /// This starts, but does not poll, a longrunning operation. More information
9424        /// on [update_intercept_deployment_group][crate::client::Intercept::update_intercept_deployment_group].
9425        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9426            (*self.0.stub)
9427                .update_intercept_deployment_group(self.0.request, self.0.options)
9428                .await
9429                .map(crate::Response::into_body)
9430        }
9431
9432        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_deployment_group`.
9433        pub fn poller(
9434            self,
9435        ) -> impl google_cloud_lro::Poller<
9436            crate::model::InterceptDeploymentGroup,
9437            crate::model::OperationMetadata,
9438        > {
9439            type Operation = google_cloud_lro::internal::Operation<
9440                crate::model::InterceptDeploymentGroup,
9441                crate::model::OperationMetadata,
9442            >;
9443            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9444            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9445
9446            let stub = self.0.stub.clone();
9447            let mut options = self.0.options.clone();
9448            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9449            let query = move |name| {
9450                let stub = stub.clone();
9451                let options = options.clone();
9452                async {
9453                    let op = GetOperation::new(stub)
9454                        .set_name(name)
9455                        .with_options(options)
9456                        .send()
9457                        .await?;
9458                    Ok(Operation::new(op))
9459                }
9460            };
9461
9462            let start = move || async {
9463                let op = self.send().await?;
9464                Ok(Operation::new(op))
9465            };
9466
9467            google_cloud_lro::internal::new_poller(
9468                polling_error_policy,
9469                polling_backoff_policy,
9470                start,
9471                query,
9472            )
9473        }
9474
9475        /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
9476        pub fn set_update_mask<T>(mut self, v: T) -> Self
9477        where
9478            T: std::convert::Into<wkt::FieldMask>,
9479        {
9480            self.0.request.update_mask = std::option::Option::Some(v.into());
9481            self
9482        }
9483
9484        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
9485        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9486        where
9487            T: std::convert::Into<wkt::FieldMask>,
9488        {
9489            self.0.request.update_mask = v.map(|x| x.into());
9490            self
9491        }
9492
9493        /// Sets the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
9494        ///
9495        /// This is a **required** field for requests.
9496        pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
9497        where
9498            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9499        {
9500            self.0.request.intercept_deployment_group = std::option::Option::Some(v.into());
9501            self
9502        }
9503
9504        /// Sets or clears the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
9505        ///
9506        /// This is a **required** field for requests.
9507        pub fn set_or_clear_intercept_deployment_group<T>(
9508            mut self,
9509            v: std::option::Option<T>,
9510        ) -> Self
9511        where
9512            T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
9513        {
9514            self.0.request.intercept_deployment_group = v.map(|x| x.into());
9515            self
9516        }
9517
9518        /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentGroupRequest::request_id].
9519        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9520            self.0.request.request_id = v.into();
9521            self
9522        }
9523    }
9524
9525    #[doc(hidden)]
9526    impl crate::RequestBuilder for UpdateInterceptDeploymentGroup {
9527        fn request_options(&mut self) -> &mut crate::RequestOptions {
9528            &mut self.0.options
9529        }
9530    }
9531
9532    /// The request builder for [Intercept::delete_intercept_deployment_group][crate::client::Intercept::delete_intercept_deployment_group] calls.
9533    ///
9534    /// # Example
9535    /// ```
9536    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptDeploymentGroup;
9537    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9538    /// use google_cloud_lro::Poller;
9539    ///
9540    /// let builder = prepare_request_builder();
9541    /// let response = builder.poller().until_done().await?;
9542    /// # Ok(()) }
9543    ///
9544    /// fn prepare_request_builder() -> DeleteInterceptDeploymentGroup {
9545    ///   # panic!();
9546    ///   // ... details omitted ...
9547    /// }
9548    /// ```
9549    #[derive(Clone, Debug)]
9550    pub struct DeleteInterceptDeploymentGroup(
9551        RequestBuilder<crate::model::DeleteInterceptDeploymentGroupRequest>,
9552    );
9553
9554    impl DeleteInterceptDeploymentGroup {
9555        pub(crate) fn new(
9556            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9557        ) -> Self {
9558            Self(RequestBuilder::new(stub))
9559        }
9560
9561        /// Sets the full request, replacing any prior values.
9562        pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentGroupRequest>>(
9563            mut self,
9564            v: V,
9565        ) -> Self {
9566            self.0.request = v.into();
9567            self
9568        }
9569
9570        /// Sets all the options, replacing any prior values.
9571        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9572            self.0.options = v.into();
9573            self
9574        }
9575
9576        /// Sends the request.
9577        ///
9578        /// # Long running operations
9579        ///
9580        /// This starts, but does not poll, a longrunning operation. More information
9581        /// on [delete_intercept_deployment_group][crate::client::Intercept::delete_intercept_deployment_group].
9582        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9583            (*self.0.stub)
9584                .delete_intercept_deployment_group(self.0.request, self.0.options)
9585                .await
9586                .map(crate::Response::into_body)
9587        }
9588
9589        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_deployment_group`.
9590        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9591            type Operation =
9592                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9593            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9594            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9595
9596            let stub = self.0.stub.clone();
9597            let mut options = self.0.options.clone();
9598            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9599            let query = move |name| {
9600                let stub = stub.clone();
9601                let options = options.clone();
9602                async {
9603                    let op = GetOperation::new(stub)
9604                        .set_name(name)
9605                        .with_options(options)
9606                        .send()
9607                        .await?;
9608                    Ok(Operation::new(op))
9609                }
9610            };
9611
9612            let start = move || async {
9613                let op = self.send().await?;
9614                Ok(Operation::new(op))
9615            };
9616
9617            google_cloud_lro::internal::new_unit_response_poller(
9618                polling_error_policy,
9619                polling_backoff_policy,
9620                start,
9621                query,
9622            )
9623        }
9624
9625        /// Sets the value of [name][crate::model::DeleteInterceptDeploymentGroupRequest::name].
9626        ///
9627        /// This is a **required** field for requests.
9628        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9629            self.0.request.name = v.into();
9630            self
9631        }
9632
9633        /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentGroupRequest::request_id].
9634        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9635            self.0.request.request_id = v.into();
9636            self
9637        }
9638    }
9639
9640    #[doc(hidden)]
9641    impl crate::RequestBuilder for DeleteInterceptDeploymentGroup {
9642        fn request_options(&mut self) -> &mut crate::RequestOptions {
9643            &mut self.0.options
9644        }
9645    }
9646
9647    /// The request builder for [Intercept::list_intercept_deployments][crate::client::Intercept::list_intercept_deployments] calls.
9648    ///
9649    /// # Example
9650    /// ```
9651    /// # use google_cloud_networksecurity_v1::builder::intercept::ListInterceptDeployments;
9652    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9653    /// use google_cloud_gax::paginator::ItemPaginator;
9654    ///
9655    /// let builder = prepare_request_builder();
9656    /// let mut items = builder.by_item();
9657    /// while let Some(result) = items.next().await {
9658    ///   let item = result?;
9659    /// }
9660    /// # Ok(()) }
9661    ///
9662    /// fn prepare_request_builder() -> ListInterceptDeployments {
9663    ///   # panic!();
9664    ///   // ... details omitted ...
9665    /// }
9666    /// ```
9667    #[derive(Clone, Debug)]
9668    pub struct ListInterceptDeployments(
9669        RequestBuilder<crate::model::ListInterceptDeploymentsRequest>,
9670    );
9671
9672    impl ListInterceptDeployments {
9673        pub(crate) fn new(
9674            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9675        ) -> Self {
9676            Self(RequestBuilder::new(stub))
9677        }
9678
9679        /// Sets the full request, replacing any prior values.
9680        pub fn with_request<V: Into<crate::model::ListInterceptDeploymentsRequest>>(
9681            mut self,
9682            v: V,
9683        ) -> Self {
9684            self.0.request = v.into();
9685            self
9686        }
9687
9688        /// Sets all the options, replacing any prior values.
9689        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9690            self.0.options = v.into();
9691            self
9692        }
9693
9694        /// Sends the request.
9695        pub async fn send(self) -> Result<crate::model::ListInterceptDeploymentsResponse> {
9696            (*self.0.stub)
9697                .list_intercept_deployments(self.0.request, self.0.options)
9698                .await
9699                .map(crate::Response::into_body)
9700        }
9701
9702        /// Streams each page in the collection.
9703        pub fn by_page(
9704            self,
9705        ) -> impl google_cloud_gax::paginator::Paginator<
9706            crate::model::ListInterceptDeploymentsResponse,
9707            crate::Error,
9708        > {
9709            use std::clone::Clone;
9710            let token = self.0.request.page_token.clone();
9711            let execute = move |token: String| {
9712                let mut builder = self.clone();
9713                builder.0.request = builder.0.request.set_page_token(token);
9714                builder.send()
9715            };
9716            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9717        }
9718
9719        /// Streams each item in the collection.
9720        pub fn by_item(
9721            self,
9722        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9723            crate::model::ListInterceptDeploymentsResponse,
9724            crate::Error,
9725        > {
9726            use google_cloud_gax::paginator::Paginator;
9727            self.by_page().items()
9728        }
9729
9730        /// Sets the value of [parent][crate::model::ListInterceptDeploymentsRequest::parent].
9731        ///
9732        /// This is a **required** field for requests.
9733        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9734            self.0.request.parent = v.into();
9735            self
9736        }
9737
9738        /// Sets the value of [page_size][crate::model::ListInterceptDeploymentsRequest::page_size].
9739        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9740            self.0.request.page_size = v.into();
9741            self
9742        }
9743
9744        /// Sets the value of [page_token][crate::model::ListInterceptDeploymentsRequest::page_token].
9745        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9746            self.0.request.page_token = v.into();
9747            self
9748        }
9749
9750        /// Sets the value of [filter][crate::model::ListInterceptDeploymentsRequest::filter].
9751        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9752            self.0.request.filter = v.into();
9753            self
9754        }
9755
9756        /// Sets the value of [order_by][crate::model::ListInterceptDeploymentsRequest::order_by].
9757        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9758            self.0.request.order_by = v.into();
9759            self
9760        }
9761    }
9762
9763    #[doc(hidden)]
9764    impl crate::RequestBuilder for ListInterceptDeployments {
9765        fn request_options(&mut self) -> &mut crate::RequestOptions {
9766            &mut self.0.options
9767        }
9768    }
9769
9770    /// The request builder for [Intercept::get_intercept_deployment][crate::client::Intercept::get_intercept_deployment] calls.
9771    ///
9772    /// # Example
9773    /// ```
9774    /// # use google_cloud_networksecurity_v1::builder::intercept::GetInterceptDeployment;
9775    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9776    ///
9777    /// let builder = prepare_request_builder();
9778    /// let response = builder.send().await?;
9779    /// # Ok(()) }
9780    ///
9781    /// fn prepare_request_builder() -> GetInterceptDeployment {
9782    ///   # panic!();
9783    ///   // ... details omitted ...
9784    /// }
9785    /// ```
9786    #[derive(Clone, Debug)]
9787    pub struct GetInterceptDeployment(RequestBuilder<crate::model::GetInterceptDeploymentRequest>);
9788
9789    impl GetInterceptDeployment {
9790        pub(crate) fn new(
9791            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9792        ) -> Self {
9793            Self(RequestBuilder::new(stub))
9794        }
9795
9796        /// Sets the full request, replacing any prior values.
9797        pub fn with_request<V: Into<crate::model::GetInterceptDeploymentRequest>>(
9798            mut self,
9799            v: V,
9800        ) -> Self {
9801            self.0.request = v.into();
9802            self
9803        }
9804
9805        /// Sets all the options, replacing any prior values.
9806        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9807            self.0.options = v.into();
9808            self
9809        }
9810
9811        /// Sends the request.
9812        pub async fn send(self) -> Result<crate::model::InterceptDeployment> {
9813            (*self.0.stub)
9814                .get_intercept_deployment(self.0.request, self.0.options)
9815                .await
9816                .map(crate::Response::into_body)
9817        }
9818
9819        /// Sets the value of [name][crate::model::GetInterceptDeploymentRequest::name].
9820        ///
9821        /// This is a **required** field for requests.
9822        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9823            self.0.request.name = v.into();
9824            self
9825        }
9826    }
9827
9828    #[doc(hidden)]
9829    impl crate::RequestBuilder for GetInterceptDeployment {
9830        fn request_options(&mut self) -> &mut crate::RequestOptions {
9831            &mut self.0.options
9832        }
9833    }
9834
9835    /// The request builder for [Intercept::create_intercept_deployment][crate::client::Intercept::create_intercept_deployment] calls.
9836    ///
9837    /// # Example
9838    /// ```
9839    /// # use google_cloud_networksecurity_v1::builder::intercept::CreateInterceptDeployment;
9840    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9841    /// use google_cloud_lro::Poller;
9842    ///
9843    /// let builder = prepare_request_builder();
9844    /// let response = builder.poller().until_done().await?;
9845    /// # Ok(()) }
9846    ///
9847    /// fn prepare_request_builder() -> CreateInterceptDeployment {
9848    ///   # panic!();
9849    ///   // ... details omitted ...
9850    /// }
9851    /// ```
9852    #[derive(Clone, Debug)]
9853    pub struct CreateInterceptDeployment(
9854        RequestBuilder<crate::model::CreateInterceptDeploymentRequest>,
9855    );
9856
9857    impl CreateInterceptDeployment {
9858        pub(crate) fn new(
9859            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
9860        ) -> Self {
9861            Self(RequestBuilder::new(stub))
9862        }
9863
9864        /// Sets the full request, replacing any prior values.
9865        pub fn with_request<V: Into<crate::model::CreateInterceptDeploymentRequest>>(
9866            mut self,
9867            v: V,
9868        ) -> Self {
9869            self.0.request = v.into();
9870            self
9871        }
9872
9873        /// Sets all the options, replacing any prior values.
9874        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9875            self.0.options = v.into();
9876            self
9877        }
9878
9879        /// Sends the request.
9880        ///
9881        /// # Long running operations
9882        ///
9883        /// This starts, but does not poll, a longrunning operation. More information
9884        /// on [create_intercept_deployment][crate::client::Intercept::create_intercept_deployment].
9885        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9886            (*self.0.stub)
9887                .create_intercept_deployment(self.0.request, self.0.options)
9888                .await
9889                .map(crate::Response::into_body)
9890        }
9891
9892        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_intercept_deployment`.
9893        pub fn poller(
9894            self,
9895        ) -> impl google_cloud_lro::Poller<
9896            crate::model::InterceptDeployment,
9897            crate::model::OperationMetadata,
9898        > {
9899            type Operation = google_cloud_lro::internal::Operation<
9900                crate::model::InterceptDeployment,
9901                crate::model::OperationMetadata,
9902            >;
9903            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9904            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9905
9906            let stub = self.0.stub.clone();
9907            let mut options = self.0.options.clone();
9908            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9909            let query = move |name| {
9910                let stub = stub.clone();
9911                let options = options.clone();
9912                async {
9913                    let op = GetOperation::new(stub)
9914                        .set_name(name)
9915                        .with_options(options)
9916                        .send()
9917                        .await?;
9918                    Ok(Operation::new(op))
9919                }
9920            };
9921
9922            let start = move || async {
9923                let op = self.send().await?;
9924                Ok(Operation::new(op))
9925            };
9926
9927            google_cloud_lro::internal::new_poller(
9928                polling_error_policy,
9929                polling_backoff_policy,
9930                start,
9931                query,
9932            )
9933        }
9934
9935        /// Sets the value of [parent][crate::model::CreateInterceptDeploymentRequest::parent].
9936        ///
9937        /// This is a **required** field for requests.
9938        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9939            self.0.request.parent = v.into();
9940            self
9941        }
9942
9943        /// Sets the value of [intercept_deployment_id][crate::model::CreateInterceptDeploymentRequest::intercept_deployment_id].
9944        ///
9945        /// This is a **required** field for requests.
9946        pub fn set_intercept_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9947            self.0.request.intercept_deployment_id = v.into();
9948            self
9949        }
9950
9951        /// Sets the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
9952        ///
9953        /// This is a **required** field for requests.
9954        pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
9955        where
9956            T: std::convert::Into<crate::model::InterceptDeployment>,
9957        {
9958            self.0.request.intercept_deployment = std::option::Option::Some(v.into());
9959            self
9960        }
9961
9962        /// Sets or clears the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
9963        ///
9964        /// This is a **required** field for requests.
9965        pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
9966        where
9967            T: std::convert::Into<crate::model::InterceptDeployment>,
9968        {
9969            self.0.request.intercept_deployment = v.map(|x| x.into());
9970            self
9971        }
9972
9973        /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentRequest::request_id].
9974        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9975            self.0.request.request_id = v.into();
9976            self
9977        }
9978    }
9979
9980    #[doc(hidden)]
9981    impl crate::RequestBuilder for CreateInterceptDeployment {
9982        fn request_options(&mut self) -> &mut crate::RequestOptions {
9983            &mut self.0.options
9984        }
9985    }
9986
9987    /// The request builder for [Intercept::update_intercept_deployment][crate::client::Intercept::update_intercept_deployment] calls.
9988    ///
9989    /// # Example
9990    /// ```
9991    /// # use google_cloud_networksecurity_v1::builder::intercept::UpdateInterceptDeployment;
9992    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
9993    /// use google_cloud_lro::Poller;
9994    ///
9995    /// let builder = prepare_request_builder();
9996    /// let response = builder.poller().until_done().await?;
9997    /// # Ok(()) }
9998    ///
9999    /// fn prepare_request_builder() -> UpdateInterceptDeployment {
10000    ///   # panic!();
10001    ///   // ... details omitted ...
10002    /// }
10003    /// ```
10004    #[derive(Clone, Debug)]
10005    pub struct UpdateInterceptDeployment(
10006        RequestBuilder<crate::model::UpdateInterceptDeploymentRequest>,
10007    );
10008
10009    impl UpdateInterceptDeployment {
10010        pub(crate) fn new(
10011            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10012        ) -> Self {
10013            Self(RequestBuilder::new(stub))
10014        }
10015
10016        /// Sets the full request, replacing any prior values.
10017        pub fn with_request<V: Into<crate::model::UpdateInterceptDeploymentRequest>>(
10018            mut self,
10019            v: V,
10020        ) -> Self {
10021            self.0.request = v.into();
10022            self
10023        }
10024
10025        /// Sets all the options, replacing any prior values.
10026        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10027            self.0.options = v.into();
10028            self
10029        }
10030
10031        /// Sends the request.
10032        ///
10033        /// # Long running operations
10034        ///
10035        /// This starts, but does not poll, a longrunning operation. More information
10036        /// on [update_intercept_deployment][crate::client::Intercept::update_intercept_deployment].
10037        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10038            (*self.0.stub)
10039                .update_intercept_deployment(self.0.request, self.0.options)
10040                .await
10041                .map(crate::Response::into_body)
10042        }
10043
10044        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_intercept_deployment`.
10045        pub fn poller(
10046            self,
10047        ) -> impl google_cloud_lro::Poller<
10048            crate::model::InterceptDeployment,
10049            crate::model::OperationMetadata,
10050        > {
10051            type Operation = google_cloud_lro::internal::Operation<
10052                crate::model::InterceptDeployment,
10053                crate::model::OperationMetadata,
10054            >;
10055            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10056            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10057
10058            let stub = self.0.stub.clone();
10059            let mut options = self.0.options.clone();
10060            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10061            let query = move |name| {
10062                let stub = stub.clone();
10063                let options = options.clone();
10064                async {
10065                    let op = GetOperation::new(stub)
10066                        .set_name(name)
10067                        .with_options(options)
10068                        .send()
10069                        .await?;
10070                    Ok(Operation::new(op))
10071                }
10072            };
10073
10074            let start = move || async {
10075                let op = self.send().await?;
10076                Ok(Operation::new(op))
10077            };
10078
10079            google_cloud_lro::internal::new_poller(
10080                polling_error_policy,
10081                polling_backoff_policy,
10082                start,
10083                query,
10084            )
10085        }
10086
10087        /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
10088        pub fn set_update_mask<T>(mut self, v: T) -> Self
10089        where
10090            T: std::convert::Into<wkt::FieldMask>,
10091        {
10092            self.0.request.update_mask = std::option::Option::Some(v.into());
10093            self
10094        }
10095
10096        /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
10097        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10098        where
10099            T: std::convert::Into<wkt::FieldMask>,
10100        {
10101            self.0.request.update_mask = v.map(|x| x.into());
10102            self
10103        }
10104
10105        /// Sets the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
10106        ///
10107        /// This is a **required** field for requests.
10108        pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
10109        where
10110            T: std::convert::Into<crate::model::InterceptDeployment>,
10111        {
10112            self.0.request.intercept_deployment = std::option::Option::Some(v.into());
10113            self
10114        }
10115
10116        /// Sets or clears the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
10117        ///
10118        /// This is a **required** field for requests.
10119        pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
10120        where
10121            T: std::convert::Into<crate::model::InterceptDeployment>,
10122        {
10123            self.0.request.intercept_deployment = v.map(|x| x.into());
10124            self
10125        }
10126
10127        /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentRequest::request_id].
10128        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10129            self.0.request.request_id = v.into();
10130            self
10131        }
10132    }
10133
10134    #[doc(hidden)]
10135    impl crate::RequestBuilder for UpdateInterceptDeployment {
10136        fn request_options(&mut self) -> &mut crate::RequestOptions {
10137            &mut self.0.options
10138        }
10139    }
10140
10141    /// The request builder for [Intercept::delete_intercept_deployment][crate::client::Intercept::delete_intercept_deployment] calls.
10142    ///
10143    /// # Example
10144    /// ```
10145    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteInterceptDeployment;
10146    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10147    /// use google_cloud_lro::Poller;
10148    ///
10149    /// let builder = prepare_request_builder();
10150    /// let response = builder.poller().until_done().await?;
10151    /// # Ok(()) }
10152    ///
10153    /// fn prepare_request_builder() -> DeleteInterceptDeployment {
10154    ///   # panic!();
10155    ///   // ... details omitted ...
10156    /// }
10157    /// ```
10158    #[derive(Clone, Debug)]
10159    pub struct DeleteInterceptDeployment(
10160        RequestBuilder<crate::model::DeleteInterceptDeploymentRequest>,
10161    );
10162
10163    impl DeleteInterceptDeployment {
10164        pub(crate) fn new(
10165            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10166        ) -> Self {
10167            Self(RequestBuilder::new(stub))
10168        }
10169
10170        /// Sets the full request, replacing any prior values.
10171        pub fn with_request<V: Into<crate::model::DeleteInterceptDeploymentRequest>>(
10172            mut self,
10173            v: V,
10174        ) -> Self {
10175            self.0.request = v.into();
10176            self
10177        }
10178
10179        /// Sets all the options, replacing any prior values.
10180        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10181            self.0.options = v.into();
10182            self
10183        }
10184
10185        /// Sends the request.
10186        ///
10187        /// # Long running operations
10188        ///
10189        /// This starts, but does not poll, a longrunning operation. More information
10190        /// on [delete_intercept_deployment][crate::client::Intercept::delete_intercept_deployment].
10191        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10192            (*self.0.stub)
10193                .delete_intercept_deployment(self.0.request, self.0.options)
10194                .await
10195                .map(crate::Response::into_body)
10196        }
10197
10198        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_intercept_deployment`.
10199        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
10200            type Operation =
10201                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10202            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10203            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10204
10205            let stub = self.0.stub.clone();
10206            let mut options = self.0.options.clone();
10207            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10208            let query = move |name| {
10209                let stub = stub.clone();
10210                let options = options.clone();
10211                async {
10212                    let op = GetOperation::new(stub)
10213                        .set_name(name)
10214                        .with_options(options)
10215                        .send()
10216                        .await?;
10217                    Ok(Operation::new(op))
10218                }
10219            };
10220
10221            let start = move || async {
10222                let op = self.send().await?;
10223                Ok(Operation::new(op))
10224            };
10225
10226            google_cloud_lro::internal::new_unit_response_poller(
10227                polling_error_policy,
10228                polling_backoff_policy,
10229                start,
10230                query,
10231            )
10232        }
10233
10234        /// Sets the value of [name][crate::model::DeleteInterceptDeploymentRequest::name].
10235        ///
10236        /// This is a **required** field for requests.
10237        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10238            self.0.request.name = v.into();
10239            self
10240        }
10241
10242        /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentRequest::request_id].
10243        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10244            self.0.request.request_id = v.into();
10245            self
10246        }
10247    }
10248
10249    #[doc(hidden)]
10250    impl crate::RequestBuilder for DeleteInterceptDeployment {
10251        fn request_options(&mut self) -> &mut crate::RequestOptions {
10252            &mut self.0.options
10253        }
10254    }
10255
10256    /// The request builder for [Intercept::list_locations][crate::client::Intercept::list_locations] calls.
10257    ///
10258    /// # Example
10259    /// ```
10260    /// # use google_cloud_networksecurity_v1::builder::intercept::ListLocations;
10261    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10262    /// use google_cloud_gax::paginator::ItemPaginator;
10263    ///
10264    /// let builder = prepare_request_builder();
10265    /// let mut items = builder.by_item();
10266    /// while let Some(result) = items.next().await {
10267    ///   let item = result?;
10268    /// }
10269    /// # Ok(()) }
10270    ///
10271    /// fn prepare_request_builder() -> ListLocations {
10272    ///   # panic!();
10273    ///   // ... details omitted ...
10274    /// }
10275    /// ```
10276    #[derive(Clone, Debug)]
10277    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10278
10279    impl ListLocations {
10280        pub(crate) fn new(
10281            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10282        ) -> Self {
10283            Self(RequestBuilder::new(stub))
10284        }
10285
10286        /// Sets the full request, replacing any prior values.
10287        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10288            mut self,
10289            v: V,
10290        ) -> Self {
10291            self.0.request = v.into();
10292            self
10293        }
10294
10295        /// Sets all the options, replacing any prior values.
10296        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10297            self.0.options = v.into();
10298            self
10299        }
10300
10301        /// Sends the request.
10302        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10303            (*self.0.stub)
10304                .list_locations(self.0.request, self.0.options)
10305                .await
10306                .map(crate::Response::into_body)
10307        }
10308
10309        /// Streams each page in the collection.
10310        pub fn by_page(
10311            self,
10312        ) -> impl google_cloud_gax::paginator::Paginator<
10313            google_cloud_location::model::ListLocationsResponse,
10314            crate::Error,
10315        > {
10316            use std::clone::Clone;
10317            let token = self.0.request.page_token.clone();
10318            let execute = move |token: String| {
10319                let mut builder = self.clone();
10320                builder.0.request = builder.0.request.set_page_token(token);
10321                builder.send()
10322            };
10323            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10324        }
10325
10326        /// Streams each item in the collection.
10327        pub fn by_item(
10328            self,
10329        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10330            google_cloud_location::model::ListLocationsResponse,
10331            crate::Error,
10332        > {
10333            use google_cloud_gax::paginator::Paginator;
10334            self.by_page().items()
10335        }
10336
10337        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
10338        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10339            self.0.request.name = v.into();
10340            self
10341        }
10342
10343        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
10344        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10345            self.0.request.filter = v.into();
10346            self
10347        }
10348
10349        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
10350        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10351            self.0.request.page_size = v.into();
10352            self
10353        }
10354
10355        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
10356        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10357            self.0.request.page_token = v.into();
10358            self
10359        }
10360    }
10361
10362    #[doc(hidden)]
10363    impl crate::RequestBuilder for ListLocations {
10364        fn request_options(&mut self) -> &mut crate::RequestOptions {
10365            &mut self.0.options
10366        }
10367    }
10368
10369    /// The request builder for [Intercept::get_location][crate::client::Intercept::get_location] calls.
10370    ///
10371    /// # Example
10372    /// ```
10373    /// # use google_cloud_networksecurity_v1::builder::intercept::GetLocation;
10374    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10375    ///
10376    /// let builder = prepare_request_builder();
10377    /// let response = builder.send().await?;
10378    /// # Ok(()) }
10379    ///
10380    /// fn prepare_request_builder() -> GetLocation {
10381    ///   # panic!();
10382    ///   // ... details omitted ...
10383    /// }
10384    /// ```
10385    #[derive(Clone, Debug)]
10386    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10387
10388    impl GetLocation {
10389        pub(crate) fn new(
10390            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10391        ) -> Self {
10392            Self(RequestBuilder::new(stub))
10393        }
10394
10395        /// Sets the full request, replacing any prior values.
10396        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10397            mut self,
10398            v: V,
10399        ) -> Self {
10400            self.0.request = v.into();
10401            self
10402        }
10403
10404        /// Sets all the options, replacing any prior values.
10405        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10406            self.0.options = v.into();
10407            self
10408        }
10409
10410        /// Sends the request.
10411        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10412            (*self.0.stub)
10413                .get_location(self.0.request, self.0.options)
10414                .await
10415                .map(crate::Response::into_body)
10416        }
10417
10418        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
10419        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10420            self.0.request.name = v.into();
10421            self
10422        }
10423    }
10424
10425    #[doc(hidden)]
10426    impl crate::RequestBuilder for GetLocation {
10427        fn request_options(&mut self) -> &mut crate::RequestOptions {
10428            &mut self.0.options
10429        }
10430    }
10431
10432    /// The request builder for [Intercept::set_iam_policy][crate::client::Intercept::set_iam_policy] calls.
10433    ///
10434    /// # Example
10435    /// ```
10436    /// # use google_cloud_networksecurity_v1::builder::intercept::SetIamPolicy;
10437    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10438    ///
10439    /// let builder = prepare_request_builder();
10440    /// let response = builder.send().await?;
10441    /// # Ok(()) }
10442    ///
10443    /// fn prepare_request_builder() -> SetIamPolicy {
10444    ///   # panic!();
10445    ///   // ... details omitted ...
10446    /// }
10447    /// ```
10448    #[derive(Clone, Debug)]
10449    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
10450
10451    impl SetIamPolicy {
10452        pub(crate) fn new(
10453            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10454        ) -> Self {
10455            Self(RequestBuilder::new(stub))
10456        }
10457
10458        /// Sets the full request, replacing any prior values.
10459        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
10460            mut self,
10461            v: V,
10462        ) -> Self {
10463            self.0.request = v.into();
10464            self
10465        }
10466
10467        /// Sets all the options, replacing any prior values.
10468        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10469            self.0.options = v.into();
10470            self
10471        }
10472
10473        /// Sends the request.
10474        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10475            (*self.0.stub)
10476                .set_iam_policy(self.0.request, self.0.options)
10477                .await
10478                .map(crate::Response::into_body)
10479        }
10480
10481        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
10482        ///
10483        /// This is a **required** field for requests.
10484        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10485            self.0.request.resource = v.into();
10486            self
10487        }
10488
10489        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
10490        ///
10491        /// This is a **required** field for requests.
10492        pub fn set_policy<T>(mut self, v: T) -> Self
10493        where
10494            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10495        {
10496            self.0.request.policy = std::option::Option::Some(v.into());
10497            self
10498        }
10499
10500        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
10501        ///
10502        /// This is a **required** field for requests.
10503        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10504        where
10505            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10506        {
10507            self.0.request.policy = v.map(|x| x.into());
10508            self
10509        }
10510
10511        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
10512        pub fn set_update_mask<T>(mut self, v: T) -> Self
10513        where
10514            T: std::convert::Into<wkt::FieldMask>,
10515        {
10516            self.0.request.update_mask = std::option::Option::Some(v.into());
10517            self
10518        }
10519
10520        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
10521        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10522        where
10523            T: std::convert::Into<wkt::FieldMask>,
10524        {
10525            self.0.request.update_mask = v.map(|x| x.into());
10526            self
10527        }
10528    }
10529
10530    #[doc(hidden)]
10531    impl crate::RequestBuilder for SetIamPolicy {
10532        fn request_options(&mut self) -> &mut crate::RequestOptions {
10533            &mut self.0.options
10534        }
10535    }
10536
10537    /// The request builder for [Intercept::get_iam_policy][crate::client::Intercept::get_iam_policy] calls.
10538    ///
10539    /// # Example
10540    /// ```
10541    /// # use google_cloud_networksecurity_v1::builder::intercept::GetIamPolicy;
10542    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10543    ///
10544    /// let builder = prepare_request_builder();
10545    /// let response = builder.send().await?;
10546    /// # Ok(()) }
10547    ///
10548    /// fn prepare_request_builder() -> GetIamPolicy {
10549    ///   # panic!();
10550    ///   // ... details omitted ...
10551    /// }
10552    /// ```
10553    #[derive(Clone, Debug)]
10554    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
10555
10556    impl GetIamPolicy {
10557        pub(crate) fn new(
10558            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10559        ) -> Self {
10560            Self(RequestBuilder::new(stub))
10561        }
10562
10563        /// Sets the full request, replacing any prior values.
10564        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
10565            mut self,
10566            v: V,
10567        ) -> Self {
10568            self.0.request = v.into();
10569            self
10570        }
10571
10572        /// Sets all the options, replacing any prior values.
10573        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10574            self.0.options = v.into();
10575            self
10576        }
10577
10578        /// Sends the request.
10579        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10580            (*self.0.stub)
10581                .get_iam_policy(self.0.request, self.0.options)
10582                .await
10583                .map(crate::Response::into_body)
10584        }
10585
10586        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
10587        ///
10588        /// This is a **required** field for requests.
10589        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10590            self.0.request.resource = v.into();
10591            self
10592        }
10593
10594        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
10595        pub fn set_options<T>(mut self, v: T) -> Self
10596        where
10597            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10598        {
10599            self.0.request.options = std::option::Option::Some(v.into());
10600            self
10601        }
10602
10603        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
10604        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10605        where
10606            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10607        {
10608            self.0.request.options = v.map(|x| x.into());
10609            self
10610        }
10611    }
10612
10613    #[doc(hidden)]
10614    impl crate::RequestBuilder for GetIamPolicy {
10615        fn request_options(&mut self) -> &mut crate::RequestOptions {
10616            &mut self.0.options
10617        }
10618    }
10619
10620    /// The request builder for [Intercept::test_iam_permissions][crate::client::Intercept::test_iam_permissions] calls.
10621    ///
10622    /// # Example
10623    /// ```
10624    /// # use google_cloud_networksecurity_v1::builder::intercept::TestIamPermissions;
10625    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10626    ///
10627    /// let builder = prepare_request_builder();
10628    /// let response = builder.send().await?;
10629    /// # Ok(()) }
10630    ///
10631    /// fn prepare_request_builder() -> TestIamPermissions {
10632    ///   # panic!();
10633    ///   // ... details omitted ...
10634    /// }
10635    /// ```
10636    #[derive(Clone, Debug)]
10637    pub struct TestIamPermissions(
10638        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
10639    );
10640
10641    impl TestIamPermissions {
10642        pub(crate) fn new(
10643            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10644        ) -> Self {
10645            Self(RequestBuilder::new(stub))
10646        }
10647
10648        /// Sets the full request, replacing any prior values.
10649        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
10650            mut self,
10651            v: V,
10652        ) -> Self {
10653            self.0.request = v.into();
10654            self
10655        }
10656
10657        /// Sets all the options, replacing any prior values.
10658        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10659            self.0.options = v.into();
10660            self
10661        }
10662
10663        /// Sends the request.
10664        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
10665            (*self.0.stub)
10666                .test_iam_permissions(self.0.request, self.0.options)
10667                .await
10668                .map(crate::Response::into_body)
10669        }
10670
10671        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
10672        ///
10673        /// This is a **required** field for requests.
10674        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10675            self.0.request.resource = v.into();
10676            self
10677        }
10678
10679        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
10680        ///
10681        /// This is a **required** field for requests.
10682        pub fn set_permissions<T, V>(mut self, v: T) -> Self
10683        where
10684            T: std::iter::IntoIterator<Item = V>,
10685            V: std::convert::Into<std::string::String>,
10686        {
10687            use std::iter::Iterator;
10688            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10689            self
10690        }
10691    }
10692
10693    #[doc(hidden)]
10694    impl crate::RequestBuilder for TestIamPermissions {
10695        fn request_options(&mut self) -> &mut crate::RequestOptions {
10696            &mut self.0.options
10697        }
10698    }
10699
10700    /// The request builder for [Intercept::list_operations][crate::client::Intercept::list_operations] calls.
10701    ///
10702    /// # Example
10703    /// ```
10704    /// # use google_cloud_networksecurity_v1::builder::intercept::ListOperations;
10705    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10706    /// use google_cloud_gax::paginator::ItemPaginator;
10707    ///
10708    /// let builder = prepare_request_builder();
10709    /// let mut items = builder.by_item();
10710    /// while let Some(result) = items.next().await {
10711    ///   let item = result?;
10712    /// }
10713    /// # Ok(()) }
10714    ///
10715    /// fn prepare_request_builder() -> ListOperations {
10716    ///   # panic!();
10717    ///   // ... details omitted ...
10718    /// }
10719    /// ```
10720    #[derive(Clone, Debug)]
10721    pub struct ListOperations(
10722        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10723    );
10724
10725    impl ListOperations {
10726        pub(crate) fn new(
10727            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10728        ) -> Self {
10729            Self(RequestBuilder::new(stub))
10730        }
10731
10732        /// Sets the full request, replacing any prior values.
10733        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10734            mut self,
10735            v: V,
10736        ) -> Self {
10737            self.0.request = v.into();
10738            self
10739        }
10740
10741        /// Sets all the options, replacing any prior values.
10742        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10743            self.0.options = v.into();
10744            self
10745        }
10746
10747        /// Sends the request.
10748        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
10749            (*self.0.stub)
10750                .list_operations(self.0.request, self.0.options)
10751                .await
10752                .map(crate::Response::into_body)
10753        }
10754
10755        /// Streams each page in the collection.
10756        pub fn by_page(
10757            self,
10758        ) -> impl google_cloud_gax::paginator::Paginator<
10759            google_cloud_longrunning::model::ListOperationsResponse,
10760            crate::Error,
10761        > {
10762            use std::clone::Clone;
10763            let token = self.0.request.page_token.clone();
10764            let execute = move |token: String| {
10765                let mut builder = self.clone();
10766                builder.0.request = builder.0.request.set_page_token(token);
10767                builder.send()
10768            };
10769            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10770        }
10771
10772        /// Streams each item in the collection.
10773        pub fn by_item(
10774            self,
10775        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10776            google_cloud_longrunning::model::ListOperationsResponse,
10777            crate::Error,
10778        > {
10779            use google_cloud_gax::paginator::Paginator;
10780            self.by_page().items()
10781        }
10782
10783        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
10784        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10785            self.0.request.name = v.into();
10786            self
10787        }
10788
10789        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
10790        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10791            self.0.request.filter = v.into();
10792            self
10793        }
10794
10795        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
10796        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10797            self.0.request.page_size = v.into();
10798            self
10799        }
10800
10801        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
10802        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10803            self.0.request.page_token = v.into();
10804            self
10805        }
10806
10807        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
10808        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10809            self.0.request.return_partial_success = v.into();
10810            self
10811        }
10812    }
10813
10814    #[doc(hidden)]
10815    impl crate::RequestBuilder for ListOperations {
10816        fn request_options(&mut self) -> &mut crate::RequestOptions {
10817            &mut self.0.options
10818        }
10819    }
10820
10821    /// The request builder for [Intercept::get_operation][crate::client::Intercept::get_operation] calls.
10822    ///
10823    /// # Example
10824    /// ```
10825    /// # use google_cloud_networksecurity_v1::builder::intercept::GetOperation;
10826    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10827    ///
10828    /// let builder = prepare_request_builder();
10829    /// let response = builder.send().await?;
10830    /// # Ok(()) }
10831    ///
10832    /// fn prepare_request_builder() -> GetOperation {
10833    ///   # panic!();
10834    ///   // ... details omitted ...
10835    /// }
10836    /// ```
10837    #[derive(Clone, Debug)]
10838    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
10839
10840    impl GetOperation {
10841        pub(crate) fn new(
10842            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10843        ) -> Self {
10844            Self(RequestBuilder::new(stub))
10845        }
10846
10847        /// Sets the full request, replacing any prior values.
10848        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
10849            mut self,
10850            v: V,
10851        ) -> Self {
10852            self.0.request = v.into();
10853            self
10854        }
10855
10856        /// Sets all the options, replacing any prior values.
10857        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10858            self.0.options = v.into();
10859            self
10860        }
10861
10862        /// Sends the request.
10863        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10864            (*self.0.stub)
10865                .get_operation(self.0.request, self.0.options)
10866                .await
10867                .map(crate::Response::into_body)
10868        }
10869
10870        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
10871        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10872            self.0.request.name = v.into();
10873            self
10874        }
10875    }
10876
10877    #[doc(hidden)]
10878    impl crate::RequestBuilder for GetOperation {
10879        fn request_options(&mut self) -> &mut crate::RequestOptions {
10880            &mut self.0.options
10881        }
10882    }
10883
10884    /// The request builder for [Intercept::delete_operation][crate::client::Intercept::delete_operation] calls.
10885    ///
10886    /// # Example
10887    /// ```
10888    /// # use google_cloud_networksecurity_v1::builder::intercept::DeleteOperation;
10889    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10890    ///
10891    /// let builder = prepare_request_builder();
10892    /// let response = builder.send().await?;
10893    /// # Ok(()) }
10894    ///
10895    /// fn prepare_request_builder() -> DeleteOperation {
10896    ///   # panic!();
10897    ///   // ... details omitted ...
10898    /// }
10899    /// ```
10900    #[derive(Clone, Debug)]
10901    pub struct DeleteOperation(
10902        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
10903    );
10904
10905    impl DeleteOperation {
10906        pub(crate) fn new(
10907            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10908        ) -> Self {
10909            Self(RequestBuilder::new(stub))
10910        }
10911
10912        /// Sets the full request, replacing any prior values.
10913        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
10914            mut self,
10915            v: V,
10916        ) -> Self {
10917            self.0.request = v.into();
10918            self
10919        }
10920
10921        /// Sets all the options, replacing any prior values.
10922        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10923            self.0.options = v.into();
10924            self
10925        }
10926
10927        /// Sends the request.
10928        pub async fn send(self) -> Result<()> {
10929            (*self.0.stub)
10930                .delete_operation(self.0.request, self.0.options)
10931                .await
10932                .map(crate::Response::into_body)
10933        }
10934
10935        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
10936        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10937            self.0.request.name = v.into();
10938            self
10939        }
10940    }
10941
10942    #[doc(hidden)]
10943    impl crate::RequestBuilder for DeleteOperation {
10944        fn request_options(&mut self) -> &mut crate::RequestOptions {
10945            &mut self.0.options
10946        }
10947    }
10948
10949    /// The request builder for [Intercept::cancel_operation][crate::client::Intercept::cancel_operation] calls.
10950    ///
10951    /// # Example
10952    /// ```
10953    /// # use google_cloud_networksecurity_v1::builder::intercept::CancelOperation;
10954    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
10955    ///
10956    /// let builder = prepare_request_builder();
10957    /// let response = builder.send().await?;
10958    /// # Ok(()) }
10959    ///
10960    /// fn prepare_request_builder() -> CancelOperation {
10961    ///   # panic!();
10962    ///   // ... details omitted ...
10963    /// }
10964    /// ```
10965    #[derive(Clone, Debug)]
10966    pub struct CancelOperation(
10967        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10968    );
10969
10970    impl CancelOperation {
10971        pub(crate) fn new(
10972            stub: std::sync::Arc<dyn super::super::stub::dynamic::Intercept>,
10973        ) -> Self {
10974            Self(RequestBuilder::new(stub))
10975        }
10976
10977        /// Sets the full request, replacing any prior values.
10978        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10979            mut self,
10980            v: V,
10981        ) -> Self {
10982            self.0.request = v.into();
10983            self
10984        }
10985
10986        /// Sets all the options, replacing any prior values.
10987        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10988            self.0.options = v.into();
10989            self
10990        }
10991
10992        /// Sends the request.
10993        pub async fn send(self) -> Result<()> {
10994            (*self.0.stub)
10995                .cancel_operation(self.0.request, self.0.options)
10996                .await
10997                .map(crate::Response::into_body)
10998        }
10999
11000        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
11001        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11002            self.0.request.name = v.into();
11003            self
11004        }
11005    }
11006
11007    #[doc(hidden)]
11008    impl crate::RequestBuilder for CancelOperation {
11009        fn request_options(&mut self) -> &mut crate::RequestOptions {
11010            &mut self.0.options
11011        }
11012    }
11013}
11014
11015/// Request and client builders for [Mirroring][crate::client::Mirroring].
11016pub mod mirroring {
11017    use crate::Result;
11018
11019    /// A builder for [Mirroring][crate::client::Mirroring].
11020    ///
11021    /// ```
11022    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11023    /// # use google_cloud_networksecurity_v1::*;
11024    /// # use builder::mirroring::ClientBuilder;
11025    /// # use client::Mirroring;
11026    /// let builder : ClientBuilder = Mirroring::builder();
11027    /// let client = builder
11028    ///     .with_endpoint("https://networksecurity.googleapis.com")
11029    ///     .build().await?;
11030    /// # Ok(()) }
11031    /// ```
11032    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11033
11034    pub(crate) mod client {
11035        use super::super::super::client::Mirroring;
11036        pub struct Factory;
11037        impl crate::ClientFactory for Factory {
11038            type Client = Mirroring;
11039            type Credentials = gaxi::options::Credentials;
11040            async fn build(
11041                self,
11042                config: gaxi::options::ClientConfig,
11043            ) -> crate::ClientBuilderResult<Self::Client> {
11044                Self::Client::new(config).await
11045            }
11046        }
11047    }
11048
11049    /// Common implementation for [crate::client::Mirroring] request builders.
11050    #[derive(Clone, Debug)]
11051    pub(crate) struct RequestBuilder<R: std::default::Default> {
11052        stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11053        request: R,
11054        options: crate::RequestOptions,
11055    }
11056
11057    impl<R> RequestBuilder<R>
11058    where
11059        R: std::default::Default,
11060    {
11061        pub(crate) fn new(
11062            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11063        ) -> Self {
11064            Self {
11065                stub,
11066                request: R::default(),
11067                options: crate::RequestOptions::default(),
11068            }
11069        }
11070    }
11071
11072    /// The request builder for [Mirroring::list_mirroring_endpoint_groups][crate::client::Mirroring::list_mirroring_endpoint_groups] calls.
11073    ///
11074    /// # Example
11075    /// ```
11076    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringEndpointGroups;
11077    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11078    /// use google_cloud_gax::paginator::ItemPaginator;
11079    ///
11080    /// let builder = prepare_request_builder();
11081    /// let mut items = builder.by_item();
11082    /// while let Some(result) = items.next().await {
11083    ///   let item = result?;
11084    /// }
11085    /// # Ok(()) }
11086    ///
11087    /// fn prepare_request_builder() -> ListMirroringEndpointGroups {
11088    ///   # panic!();
11089    ///   // ... details omitted ...
11090    /// }
11091    /// ```
11092    #[derive(Clone, Debug)]
11093    pub struct ListMirroringEndpointGroups(
11094        RequestBuilder<crate::model::ListMirroringEndpointGroupsRequest>,
11095    );
11096
11097    impl ListMirroringEndpointGroups {
11098        pub(crate) fn new(
11099            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11100        ) -> Self {
11101            Self(RequestBuilder::new(stub))
11102        }
11103
11104        /// Sets the full request, replacing any prior values.
11105        pub fn with_request<V: Into<crate::model::ListMirroringEndpointGroupsRequest>>(
11106            mut self,
11107            v: V,
11108        ) -> Self {
11109            self.0.request = v.into();
11110            self
11111        }
11112
11113        /// Sets all the options, replacing any prior values.
11114        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11115            self.0.options = v.into();
11116            self
11117        }
11118
11119        /// Sends the request.
11120        pub async fn send(self) -> Result<crate::model::ListMirroringEndpointGroupsResponse> {
11121            (*self.0.stub)
11122                .list_mirroring_endpoint_groups(self.0.request, self.0.options)
11123                .await
11124                .map(crate::Response::into_body)
11125        }
11126
11127        /// Streams each page in the collection.
11128        pub fn by_page(
11129            self,
11130        ) -> impl google_cloud_gax::paginator::Paginator<
11131            crate::model::ListMirroringEndpointGroupsResponse,
11132            crate::Error,
11133        > {
11134            use std::clone::Clone;
11135            let token = self.0.request.page_token.clone();
11136            let execute = move |token: String| {
11137                let mut builder = self.clone();
11138                builder.0.request = builder.0.request.set_page_token(token);
11139                builder.send()
11140            };
11141            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11142        }
11143
11144        /// Streams each item in the collection.
11145        pub fn by_item(
11146            self,
11147        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11148            crate::model::ListMirroringEndpointGroupsResponse,
11149            crate::Error,
11150        > {
11151            use google_cloud_gax::paginator::Paginator;
11152            self.by_page().items()
11153        }
11154
11155        /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupsRequest::parent].
11156        ///
11157        /// This is a **required** field for requests.
11158        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11159            self.0.request.parent = v.into();
11160            self
11161        }
11162
11163        /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupsRequest::page_size].
11164        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11165            self.0.request.page_size = v.into();
11166            self
11167        }
11168
11169        /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupsRequest::page_token].
11170        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11171            self.0.request.page_token = v.into();
11172            self
11173        }
11174
11175        /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupsRequest::filter].
11176        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11177            self.0.request.filter = v.into();
11178            self
11179        }
11180
11181        /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupsRequest::order_by].
11182        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11183            self.0.request.order_by = v.into();
11184            self
11185        }
11186    }
11187
11188    #[doc(hidden)]
11189    impl crate::RequestBuilder for ListMirroringEndpointGroups {
11190        fn request_options(&mut self) -> &mut crate::RequestOptions {
11191            &mut self.0.options
11192        }
11193    }
11194
11195    /// The request builder for [Mirroring::get_mirroring_endpoint_group][crate::client::Mirroring::get_mirroring_endpoint_group] calls.
11196    ///
11197    /// # Example
11198    /// ```
11199    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringEndpointGroup;
11200    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11201    ///
11202    /// let builder = prepare_request_builder();
11203    /// let response = builder.send().await?;
11204    /// # Ok(()) }
11205    ///
11206    /// fn prepare_request_builder() -> GetMirroringEndpointGroup {
11207    ///   # panic!();
11208    ///   // ... details omitted ...
11209    /// }
11210    /// ```
11211    #[derive(Clone, Debug)]
11212    pub struct GetMirroringEndpointGroup(
11213        RequestBuilder<crate::model::GetMirroringEndpointGroupRequest>,
11214    );
11215
11216    impl GetMirroringEndpointGroup {
11217        pub(crate) fn new(
11218            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11219        ) -> Self {
11220            Self(RequestBuilder::new(stub))
11221        }
11222
11223        /// Sets the full request, replacing any prior values.
11224        pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupRequest>>(
11225            mut self,
11226            v: V,
11227        ) -> Self {
11228            self.0.request = v.into();
11229            self
11230        }
11231
11232        /// Sets all the options, replacing any prior values.
11233        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11234            self.0.options = v.into();
11235            self
11236        }
11237
11238        /// Sends the request.
11239        pub async fn send(self) -> Result<crate::model::MirroringEndpointGroup> {
11240            (*self.0.stub)
11241                .get_mirroring_endpoint_group(self.0.request, self.0.options)
11242                .await
11243                .map(crate::Response::into_body)
11244        }
11245
11246        /// Sets the value of [name][crate::model::GetMirroringEndpointGroupRequest::name].
11247        ///
11248        /// This is a **required** field for requests.
11249        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11250            self.0.request.name = v.into();
11251            self
11252        }
11253    }
11254
11255    #[doc(hidden)]
11256    impl crate::RequestBuilder for GetMirroringEndpointGroup {
11257        fn request_options(&mut self) -> &mut crate::RequestOptions {
11258            &mut self.0.options
11259        }
11260    }
11261
11262    /// The request builder for [Mirroring::create_mirroring_endpoint_group][crate::client::Mirroring::create_mirroring_endpoint_group] calls.
11263    ///
11264    /// # Example
11265    /// ```
11266    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringEndpointGroup;
11267    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11268    /// use google_cloud_lro::Poller;
11269    ///
11270    /// let builder = prepare_request_builder();
11271    /// let response = builder.poller().until_done().await?;
11272    /// # Ok(()) }
11273    ///
11274    /// fn prepare_request_builder() -> CreateMirroringEndpointGroup {
11275    ///   # panic!();
11276    ///   // ... details omitted ...
11277    /// }
11278    /// ```
11279    #[derive(Clone, Debug)]
11280    pub struct CreateMirroringEndpointGroup(
11281        RequestBuilder<crate::model::CreateMirroringEndpointGroupRequest>,
11282    );
11283
11284    impl CreateMirroringEndpointGroup {
11285        pub(crate) fn new(
11286            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11287        ) -> Self {
11288            Self(RequestBuilder::new(stub))
11289        }
11290
11291        /// Sets the full request, replacing any prior values.
11292        pub fn with_request<V: Into<crate::model::CreateMirroringEndpointGroupRequest>>(
11293            mut self,
11294            v: V,
11295        ) -> Self {
11296            self.0.request = v.into();
11297            self
11298        }
11299
11300        /// Sets all the options, replacing any prior values.
11301        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11302            self.0.options = v.into();
11303            self
11304        }
11305
11306        /// Sends the request.
11307        ///
11308        /// # Long running operations
11309        ///
11310        /// This starts, but does not poll, a longrunning operation. More information
11311        /// on [create_mirroring_endpoint_group][crate::client::Mirroring::create_mirroring_endpoint_group].
11312        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11313            (*self.0.stub)
11314                .create_mirroring_endpoint_group(self.0.request, self.0.options)
11315                .await
11316                .map(crate::Response::into_body)
11317        }
11318
11319        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_endpoint_group`.
11320        pub fn poller(
11321            self,
11322        ) -> impl google_cloud_lro::Poller<
11323            crate::model::MirroringEndpointGroup,
11324            crate::model::OperationMetadata,
11325        > {
11326            type Operation = google_cloud_lro::internal::Operation<
11327                crate::model::MirroringEndpointGroup,
11328                crate::model::OperationMetadata,
11329            >;
11330            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11331            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11332
11333            let stub = self.0.stub.clone();
11334            let mut options = self.0.options.clone();
11335            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11336            let query = move |name| {
11337                let stub = stub.clone();
11338                let options = options.clone();
11339                async {
11340                    let op = GetOperation::new(stub)
11341                        .set_name(name)
11342                        .with_options(options)
11343                        .send()
11344                        .await?;
11345                    Ok(Operation::new(op))
11346                }
11347            };
11348
11349            let start = move || async {
11350                let op = self.send().await?;
11351                Ok(Operation::new(op))
11352            };
11353
11354            google_cloud_lro::internal::new_poller(
11355                polling_error_policy,
11356                polling_backoff_policy,
11357                start,
11358                query,
11359            )
11360        }
11361
11362        /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupRequest::parent].
11363        ///
11364        /// This is a **required** field for requests.
11365        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11366            self.0.request.parent = v.into();
11367            self
11368        }
11369
11370        /// Sets the value of [mirroring_endpoint_group_id][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group_id].
11371        ///
11372        /// This is a **required** field for requests.
11373        pub fn set_mirroring_endpoint_group_id<T: Into<std::string::String>>(
11374            mut self,
11375            v: T,
11376        ) -> Self {
11377            self.0.request.mirroring_endpoint_group_id = v.into();
11378            self
11379        }
11380
11381        /// Sets the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
11382        ///
11383        /// This is a **required** field for requests.
11384        pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
11385        where
11386            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11387        {
11388            self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
11389            self
11390        }
11391
11392        /// Sets or clears the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
11393        ///
11394        /// This is a **required** field for requests.
11395        pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
11396        where
11397            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11398        {
11399            self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
11400            self
11401        }
11402
11403        /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupRequest::request_id].
11404        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11405            self.0.request.request_id = v.into();
11406            self
11407        }
11408    }
11409
11410    #[doc(hidden)]
11411    impl crate::RequestBuilder for CreateMirroringEndpointGroup {
11412        fn request_options(&mut self) -> &mut crate::RequestOptions {
11413            &mut self.0.options
11414        }
11415    }
11416
11417    /// The request builder for [Mirroring::update_mirroring_endpoint_group][crate::client::Mirroring::update_mirroring_endpoint_group] calls.
11418    ///
11419    /// # Example
11420    /// ```
11421    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringEndpointGroup;
11422    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11423    /// use google_cloud_lro::Poller;
11424    ///
11425    /// let builder = prepare_request_builder();
11426    /// let response = builder.poller().until_done().await?;
11427    /// # Ok(()) }
11428    ///
11429    /// fn prepare_request_builder() -> UpdateMirroringEndpointGroup {
11430    ///   # panic!();
11431    ///   // ... details omitted ...
11432    /// }
11433    /// ```
11434    #[derive(Clone, Debug)]
11435    pub struct UpdateMirroringEndpointGroup(
11436        RequestBuilder<crate::model::UpdateMirroringEndpointGroupRequest>,
11437    );
11438
11439    impl UpdateMirroringEndpointGroup {
11440        pub(crate) fn new(
11441            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11442        ) -> Self {
11443            Self(RequestBuilder::new(stub))
11444        }
11445
11446        /// Sets the full request, replacing any prior values.
11447        pub fn with_request<V: Into<crate::model::UpdateMirroringEndpointGroupRequest>>(
11448            mut self,
11449            v: V,
11450        ) -> Self {
11451            self.0.request = v.into();
11452            self
11453        }
11454
11455        /// Sets all the options, replacing any prior values.
11456        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11457            self.0.options = v.into();
11458            self
11459        }
11460
11461        /// Sends the request.
11462        ///
11463        /// # Long running operations
11464        ///
11465        /// This starts, but does not poll, a longrunning operation. More information
11466        /// on [update_mirroring_endpoint_group][crate::client::Mirroring::update_mirroring_endpoint_group].
11467        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11468            (*self.0.stub)
11469                .update_mirroring_endpoint_group(self.0.request, self.0.options)
11470                .await
11471                .map(crate::Response::into_body)
11472        }
11473
11474        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_endpoint_group`.
11475        pub fn poller(
11476            self,
11477        ) -> impl google_cloud_lro::Poller<
11478            crate::model::MirroringEndpointGroup,
11479            crate::model::OperationMetadata,
11480        > {
11481            type Operation = google_cloud_lro::internal::Operation<
11482                crate::model::MirroringEndpointGroup,
11483                crate::model::OperationMetadata,
11484            >;
11485            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11486            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11487
11488            let stub = self.0.stub.clone();
11489            let mut options = self.0.options.clone();
11490            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11491            let query = move |name| {
11492                let stub = stub.clone();
11493                let options = options.clone();
11494                async {
11495                    let op = GetOperation::new(stub)
11496                        .set_name(name)
11497                        .with_options(options)
11498                        .send()
11499                        .await?;
11500                    Ok(Operation::new(op))
11501                }
11502            };
11503
11504            let start = move || async {
11505                let op = self.send().await?;
11506                Ok(Operation::new(op))
11507            };
11508
11509            google_cloud_lro::internal::new_poller(
11510                polling_error_policy,
11511                polling_backoff_policy,
11512                start,
11513                query,
11514            )
11515        }
11516
11517        /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
11518        pub fn set_update_mask<T>(mut self, v: T) -> Self
11519        where
11520            T: std::convert::Into<wkt::FieldMask>,
11521        {
11522            self.0.request.update_mask = std::option::Option::Some(v.into());
11523            self
11524        }
11525
11526        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
11527        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11528        where
11529            T: std::convert::Into<wkt::FieldMask>,
11530        {
11531            self.0.request.update_mask = v.map(|x| x.into());
11532            self
11533        }
11534
11535        /// Sets the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
11536        ///
11537        /// This is a **required** field for requests.
11538        pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
11539        where
11540            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11541        {
11542            self.0.request.mirroring_endpoint_group = std::option::Option::Some(v.into());
11543            self
11544        }
11545
11546        /// Sets or clears the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
11547        ///
11548        /// This is a **required** field for requests.
11549        pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
11550        where
11551            T: std::convert::Into<crate::model::MirroringEndpointGroup>,
11552        {
11553            self.0.request.mirroring_endpoint_group = v.map(|x| x.into());
11554            self
11555        }
11556
11557        /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupRequest::request_id].
11558        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11559            self.0.request.request_id = v.into();
11560            self
11561        }
11562    }
11563
11564    #[doc(hidden)]
11565    impl crate::RequestBuilder for UpdateMirroringEndpointGroup {
11566        fn request_options(&mut self) -> &mut crate::RequestOptions {
11567            &mut self.0.options
11568        }
11569    }
11570
11571    /// The request builder for [Mirroring::delete_mirroring_endpoint_group][crate::client::Mirroring::delete_mirroring_endpoint_group] calls.
11572    ///
11573    /// # Example
11574    /// ```
11575    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringEndpointGroup;
11576    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11577    /// use google_cloud_lro::Poller;
11578    ///
11579    /// let builder = prepare_request_builder();
11580    /// let response = builder.poller().until_done().await?;
11581    /// # Ok(()) }
11582    ///
11583    /// fn prepare_request_builder() -> DeleteMirroringEndpointGroup {
11584    ///   # panic!();
11585    ///   // ... details omitted ...
11586    /// }
11587    /// ```
11588    #[derive(Clone, Debug)]
11589    pub struct DeleteMirroringEndpointGroup(
11590        RequestBuilder<crate::model::DeleteMirroringEndpointGroupRequest>,
11591    );
11592
11593    impl DeleteMirroringEndpointGroup {
11594        pub(crate) fn new(
11595            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11596        ) -> Self {
11597            Self(RequestBuilder::new(stub))
11598        }
11599
11600        /// Sets the full request, replacing any prior values.
11601        pub fn with_request<V: Into<crate::model::DeleteMirroringEndpointGroupRequest>>(
11602            mut self,
11603            v: V,
11604        ) -> Self {
11605            self.0.request = v.into();
11606            self
11607        }
11608
11609        /// Sets all the options, replacing any prior values.
11610        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11611            self.0.options = v.into();
11612            self
11613        }
11614
11615        /// Sends the request.
11616        ///
11617        /// # Long running operations
11618        ///
11619        /// This starts, but does not poll, a longrunning operation. More information
11620        /// on [delete_mirroring_endpoint_group][crate::client::Mirroring::delete_mirroring_endpoint_group].
11621        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11622            (*self.0.stub)
11623                .delete_mirroring_endpoint_group(self.0.request, self.0.options)
11624                .await
11625                .map(crate::Response::into_body)
11626        }
11627
11628        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_endpoint_group`.
11629        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11630            type Operation =
11631                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11632            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11633            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11634
11635            let stub = self.0.stub.clone();
11636            let mut options = self.0.options.clone();
11637            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11638            let query = move |name| {
11639                let stub = stub.clone();
11640                let options = options.clone();
11641                async {
11642                    let op = GetOperation::new(stub)
11643                        .set_name(name)
11644                        .with_options(options)
11645                        .send()
11646                        .await?;
11647                    Ok(Operation::new(op))
11648                }
11649            };
11650
11651            let start = move || async {
11652                let op = self.send().await?;
11653                Ok(Operation::new(op))
11654            };
11655
11656            google_cloud_lro::internal::new_unit_response_poller(
11657                polling_error_policy,
11658                polling_backoff_policy,
11659                start,
11660                query,
11661            )
11662        }
11663
11664        /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupRequest::name].
11665        ///
11666        /// This is a **required** field for requests.
11667        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11668            self.0.request.name = v.into();
11669            self
11670        }
11671
11672        /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupRequest::request_id].
11673        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11674            self.0.request.request_id = v.into();
11675            self
11676        }
11677    }
11678
11679    #[doc(hidden)]
11680    impl crate::RequestBuilder for DeleteMirroringEndpointGroup {
11681        fn request_options(&mut self) -> &mut crate::RequestOptions {
11682            &mut self.0.options
11683        }
11684    }
11685
11686    /// The request builder for [Mirroring::list_mirroring_endpoint_group_associations][crate::client::Mirroring::list_mirroring_endpoint_group_associations] calls.
11687    ///
11688    /// # Example
11689    /// ```
11690    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringEndpointGroupAssociations;
11691    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11692    /// use google_cloud_gax::paginator::ItemPaginator;
11693    ///
11694    /// let builder = prepare_request_builder();
11695    /// let mut items = builder.by_item();
11696    /// while let Some(result) = items.next().await {
11697    ///   let item = result?;
11698    /// }
11699    /// # Ok(()) }
11700    ///
11701    /// fn prepare_request_builder() -> ListMirroringEndpointGroupAssociations {
11702    ///   # panic!();
11703    ///   // ... details omitted ...
11704    /// }
11705    /// ```
11706    #[derive(Clone, Debug)]
11707    pub struct ListMirroringEndpointGroupAssociations(
11708        RequestBuilder<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
11709    );
11710
11711    impl ListMirroringEndpointGroupAssociations {
11712        pub(crate) fn new(
11713            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11714        ) -> Self {
11715            Self(RequestBuilder::new(stub))
11716        }
11717
11718        /// Sets the full request, replacing any prior values.
11719        pub fn with_request<
11720            V: Into<crate::model::ListMirroringEndpointGroupAssociationsRequest>,
11721        >(
11722            mut self,
11723            v: V,
11724        ) -> Self {
11725            self.0.request = v.into();
11726            self
11727        }
11728
11729        /// Sets all the options, replacing any prior values.
11730        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11731            self.0.options = v.into();
11732            self
11733        }
11734
11735        /// Sends the request.
11736        pub async fn send(
11737            self,
11738        ) -> Result<crate::model::ListMirroringEndpointGroupAssociationsResponse> {
11739            (*self.0.stub)
11740                .list_mirroring_endpoint_group_associations(self.0.request, self.0.options)
11741                .await
11742                .map(crate::Response::into_body)
11743        }
11744
11745        /// Streams each page in the collection.
11746        pub fn by_page(
11747            self,
11748        ) -> impl google_cloud_gax::paginator::Paginator<
11749            crate::model::ListMirroringEndpointGroupAssociationsResponse,
11750            crate::Error,
11751        > {
11752            use std::clone::Clone;
11753            let token = self.0.request.page_token.clone();
11754            let execute = move |token: String| {
11755                let mut builder = self.clone();
11756                builder.0.request = builder.0.request.set_page_token(token);
11757                builder.send()
11758            };
11759            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11760        }
11761
11762        /// Streams each item in the collection.
11763        pub fn by_item(
11764            self,
11765        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11766            crate::model::ListMirroringEndpointGroupAssociationsResponse,
11767            crate::Error,
11768        > {
11769            use google_cloud_gax::paginator::Paginator;
11770            self.by_page().items()
11771        }
11772
11773        /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupAssociationsRequest::parent].
11774        ///
11775        /// This is a **required** field for requests.
11776        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11777            self.0.request.parent = v.into();
11778            self
11779        }
11780
11781        /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_size].
11782        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11783            self.0.request.page_size = v.into();
11784            self
11785        }
11786
11787        /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_token].
11788        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11789            self.0.request.page_token = v.into();
11790            self
11791        }
11792
11793        /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupAssociationsRequest::filter].
11794        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11795            self.0.request.filter = v.into();
11796            self
11797        }
11798
11799        /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupAssociationsRequest::order_by].
11800        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11801            self.0.request.order_by = v.into();
11802            self
11803        }
11804    }
11805
11806    #[doc(hidden)]
11807    impl crate::RequestBuilder for ListMirroringEndpointGroupAssociations {
11808        fn request_options(&mut self) -> &mut crate::RequestOptions {
11809            &mut self.0.options
11810        }
11811    }
11812
11813    /// The request builder for [Mirroring::get_mirroring_endpoint_group_association][crate::client::Mirroring::get_mirroring_endpoint_group_association] calls.
11814    ///
11815    /// # Example
11816    /// ```
11817    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringEndpointGroupAssociation;
11818    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11819    ///
11820    /// let builder = prepare_request_builder();
11821    /// let response = builder.send().await?;
11822    /// # Ok(()) }
11823    ///
11824    /// fn prepare_request_builder() -> GetMirroringEndpointGroupAssociation {
11825    ///   # panic!();
11826    ///   // ... details omitted ...
11827    /// }
11828    /// ```
11829    #[derive(Clone, Debug)]
11830    pub struct GetMirroringEndpointGroupAssociation(
11831        RequestBuilder<crate::model::GetMirroringEndpointGroupAssociationRequest>,
11832    );
11833
11834    impl GetMirroringEndpointGroupAssociation {
11835        pub(crate) fn new(
11836            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11837        ) -> Self {
11838            Self(RequestBuilder::new(stub))
11839        }
11840
11841        /// Sets the full request, replacing any prior values.
11842        pub fn with_request<V: Into<crate::model::GetMirroringEndpointGroupAssociationRequest>>(
11843            mut self,
11844            v: V,
11845        ) -> Self {
11846            self.0.request = v.into();
11847            self
11848        }
11849
11850        /// Sets all the options, replacing any prior values.
11851        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11852            self.0.options = v.into();
11853            self
11854        }
11855
11856        /// Sends the request.
11857        pub async fn send(self) -> Result<crate::model::MirroringEndpointGroupAssociation> {
11858            (*self.0.stub)
11859                .get_mirroring_endpoint_group_association(self.0.request, self.0.options)
11860                .await
11861                .map(crate::Response::into_body)
11862        }
11863
11864        /// Sets the value of [name][crate::model::GetMirroringEndpointGroupAssociationRequest::name].
11865        ///
11866        /// This is a **required** field for requests.
11867        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11868            self.0.request.name = v.into();
11869            self
11870        }
11871    }
11872
11873    #[doc(hidden)]
11874    impl crate::RequestBuilder for GetMirroringEndpointGroupAssociation {
11875        fn request_options(&mut self) -> &mut crate::RequestOptions {
11876            &mut self.0.options
11877        }
11878    }
11879
11880    /// The request builder for [Mirroring::create_mirroring_endpoint_group_association][crate::client::Mirroring::create_mirroring_endpoint_group_association] calls.
11881    ///
11882    /// # Example
11883    /// ```
11884    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringEndpointGroupAssociation;
11885    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
11886    /// use google_cloud_lro::Poller;
11887    ///
11888    /// let builder = prepare_request_builder();
11889    /// let response = builder.poller().until_done().await?;
11890    /// # Ok(()) }
11891    ///
11892    /// fn prepare_request_builder() -> CreateMirroringEndpointGroupAssociation {
11893    ///   # panic!();
11894    ///   // ... details omitted ...
11895    /// }
11896    /// ```
11897    #[derive(Clone, Debug)]
11898    pub struct CreateMirroringEndpointGroupAssociation(
11899        RequestBuilder<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
11900    );
11901
11902    impl CreateMirroringEndpointGroupAssociation {
11903        pub(crate) fn new(
11904            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
11905        ) -> Self {
11906            Self(RequestBuilder::new(stub))
11907        }
11908
11909        /// Sets the full request, replacing any prior values.
11910        pub fn with_request<
11911            V: Into<crate::model::CreateMirroringEndpointGroupAssociationRequest>,
11912        >(
11913            mut self,
11914            v: V,
11915        ) -> Self {
11916            self.0.request = v.into();
11917            self
11918        }
11919
11920        /// Sets all the options, replacing any prior values.
11921        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11922            self.0.options = v.into();
11923            self
11924        }
11925
11926        /// Sends the request.
11927        ///
11928        /// # Long running operations
11929        ///
11930        /// This starts, but does not poll, a longrunning operation. More information
11931        /// on [create_mirroring_endpoint_group_association][crate::client::Mirroring::create_mirroring_endpoint_group_association].
11932        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11933            (*self.0.stub)
11934                .create_mirroring_endpoint_group_association(self.0.request, self.0.options)
11935                .await
11936                .map(crate::Response::into_body)
11937        }
11938
11939        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_endpoint_group_association`.
11940        pub fn poller(
11941            self,
11942        ) -> impl google_cloud_lro::Poller<
11943            crate::model::MirroringEndpointGroupAssociation,
11944            crate::model::OperationMetadata,
11945        > {
11946            type Operation = google_cloud_lro::internal::Operation<
11947                crate::model::MirroringEndpointGroupAssociation,
11948                crate::model::OperationMetadata,
11949            >;
11950            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11951            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11952
11953            let stub = self.0.stub.clone();
11954            let mut options = self.0.options.clone();
11955            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11956            let query = move |name| {
11957                let stub = stub.clone();
11958                let options = options.clone();
11959                async {
11960                    let op = GetOperation::new(stub)
11961                        .set_name(name)
11962                        .with_options(options)
11963                        .send()
11964                        .await?;
11965                    Ok(Operation::new(op))
11966                }
11967            };
11968
11969            let start = move || async {
11970                let op = self.send().await?;
11971                Ok(Operation::new(op))
11972            };
11973
11974            google_cloud_lro::internal::new_poller(
11975                polling_error_policy,
11976                polling_backoff_policy,
11977                start,
11978                query,
11979            )
11980        }
11981
11982        /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupAssociationRequest::parent].
11983        ///
11984        /// This is a **required** field for requests.
11985        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11986            self.0.request.parent = v.into();
11987            self
11988        }
11989
11990        /// Sets the value of [mirroring_endpoint_group_association_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association_id].
11991        pub fn set_mirroring_endpoint_group_association_id<T: Into<std::string::String>>(
11992            mut self,
11993            v: T,
11994        ) -> Self {
11995            self.0.request.mirroring_endpoint_group_association_id = v.into();
11996            self
11997        }
11998
11999        /// Sets the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
12000        ///
12001        /// This is a **required** field for requests.
12002        pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
12003        where
12004            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12005        {
12006            self.0.request.mirroring_endpoint_group_association =
12007                std::option::Option::Some(v.into());
12008            self
12009        }
12010
12011        /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
12012        ///
12013        /// This is a **required** field for requests.
12014        pub fn set_or_clear_mirroring_endpoint_group_association<T>(
12015            mut self,
12016            v: std::option::Option<T>,
12017        ) -> Self
12018        where
12019            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12020        {
12021            self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
12022            self
12023        }
12024
12025        /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::request_id].
12026        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12027            self.0.request.request_id = v.into();
12028            self
12029        }
12030    }
12031
12032    #[doc(hidden)]
12033    impl crate::RequestBuilder for CreateMirroringEndpointGroupAssociation {
12034        fn request_options(&mut self) -> &mut crate::RequestOptions {
12035            &mut self.0.options
12036        }
12037    }
12038
12039    /// The request builder for [Mirroring::update_mirroring_endpoint_group_association][crate::client::Mirroring::update_mirroring_endpoint_group_association] calls.
12040    ///
12041    /// # Example
12042    /// ```
12043    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringEndpointGroupAssociation;
12044    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12045    /// use google_cloud_lro::Poller;
12046    ///
12047    /// let builder = prepare_request_builder();
12048    /// let response = builder.poller().until_done().await?;
12049    /// # Ok(()) }
12050    ///
12051    /// fn prepare_request_builder() -> UpdateMirroringEndpointGroupAssociation {
12052    ///   # panic!();
12053    ///   // ... details omitted ...
12054    /// }
12055    /// ```
12056    #[derive(Clone, Debug)]
12057    pub struct UpdateMirroringEndpointGroupAssociation(
12058        RequestBuilder<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
12059    );
12060
12061    impl UpdateMirroringEndpointGroupAssociation {
12062        pub(crate) fn new(
12063            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12064        ) -> Self {
12065            Self(RequestBuilder::new(stub))
12066        }
12067
12068        /// Sets the full request, replacing any prior values.
12069        pub fn with_request<
12070            V: Into<crate::model::UpdateMirroringEndpointGroupAssociationRequest>,
12071        >(
12072            mut self,
12073            v: V,
12074        ) -> Self {
12075            self.0.request = v.into();
12076            self
12077        }
12078
12079        /// Sets all the options, replacing any prior values.
12080        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12081            self.0.options = v.into();
12082            self
12083        }
12084
12085        /// Sends the request.
12086        ///
12087        /// # Long running operations
12088        ///
12089        /// This starts, but does not poll, a longrunning operation. More information
12090        /// on [update_mirroring_endpoint_group_association][crate::client::Mirroring::update_mirroring_endpoint_group_association].
12091        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12092            (*self.0.stub)
12093                .update_mirroring_endpoint_group_association(self.0.request, self.0.options)
12094                .await
12095                .map(crate::Response::into_body)
12096        }
12097
12098        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_endpoint_group_association`.
12099        pub fn poller(
12100            self,
12101        ) -> impl google_cloud_lro::Poller<
12102            crate::model::MirroringEndpointGroupAssociation,
12103            crate::model::OperationMetadata,
12104        > {
12105            type Operation = google_cloud_lro::internal::Operation<
12106                crate::model::MirroringEndpointGroupAssociation,
12107                crate::model::OperationMetadata,
12108            >;
12109            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12110            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12111
12112            let stub = self.0.stub.clone();
12113            let mut options = self.0.options.clone();
12114            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12115            let query = move |name| {
12116                let stub = stub.clone();
12117                let options = options.clone();
12118                async {
12119                    let op = GetOperation::new(stub)
12120                        .set_name(name)
12121                        .with_options(options)
12122                        .send()
12123                        .await?;
12124                    Ok(Operation::new(op))
12125                }
12126            };
12127
12128            let start = move || async {
12129                let op = self.send().await?;
12130                Ok(Operation::new(op))
12131            };
12132
12133            google_cloud_lro::internal::new_poller(
12134                polling_error_policy,
12135                polling_backoff_policy,
12136                start,
12137                query,
12138            )
12139        }
12140
12141        /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
12142        pub fn set_update_mask<T>(mut self, v: T) -> Self
12143        where
12144            T: std::convert::Into<wkt::FieldMask>,
12145        {
12146            self.0.request.update_mask = std::option::Option::Some(v.into());
12147            self
12148        }
12149
12150        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
12151        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12152        where
12153            T: std::convert::Into<wkt::FieldMask>,
12154        {
12155            self.0.request.update_mask = v.map(|x| x.into());
12156            self
12157        }
12158
12159        /// Sets the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
12160        ///
12161        /// This is a **required** field for requests.
12162        pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
12163        where
12164            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12165        {
12166            self.0.request.mirroring_endpoint_group_association =
12167                std::option::Option::Some(v.into());
12168            self
12169        }
12170
12171        /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
12172        ///
12173        /// This is a **required** field for requests.
12174        pub fn set_or_clear_mirroring_endpoint_group_association<T>(
12175            mut self,
12176            v: std::option::Option<T>,
12177        ) -> Self
12178        where
12179            T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
12180        {
12181            self.0.request.mirroring_endpoint_group_association = v.map(|x| x.into());
12182            self
12183        }
12184
12185        /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupAssociationRequest::request_id].
12186        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12187            self.0.request.request_id = v.into();
12188            self
12189        }
12190    }
12191
12192    #[doc(hidden)]
12193    impl crate::RequestBuilder for UpdateMirroringEndpointGroupAssociation {
12194        fn request_options(&mut self) -> &mut crate::RequestOptions {
12195            &mut self.0.options
12196        }
12197    }
12198
12199    /// The request builder for [Mirroring::delete_mirroring_endpoint_group_association][crate::client::Mirroring::delete_mirroring_endpoint_group_association] calls.
12200    ///
12201    /// # Example
12202    /// ```
12203    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringEndpointGroupAssociation;
12204    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12205    /// use google_cloud_lro::Poller;
12206    ///
12207    /// let builder = prepare_request_builder();
12208    /// let response = builder.poller().until_done().await?;
12209    /// # Ok(()) }
12210    ///
12211    /// fn prepare_request_builder() -> DeleteMirroringEndpointGroupAssociation {
12212    ///   # panic!();
12213    ///   // ... details omitted ...
12214    /// }
12215    /// ```
12216    #[derive(Clone, Debug)]
12217    pub struct DeleteMirroringEndpointGroupAssociation(
12218        RequestBuilder<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
12219    );
12220
12221    impl DeleteMirroringEndpointGroupAssociation {
12222        pub(crate) fn new(
12223            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12224        ) -> Self {
12225            Self(RequestBuilder::new(stub))
12226        }
12227
12228        /// Sets the full request, replacing any prior values.
12229        pub fn with_request<
12230            V: Into<crate::model::DeleteMirroringEndpointGroupAssociationRequest>,
12231        >(
12232            mut self,
12233            v: V,
12234        ) -> Self {
12235            self.0.request = v.into();
12236            self
12237        }
12238
12239        /// Sets all the options, replacing any prior values.
12240        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12241            self.0.options = v.into();
12242            self
12243        }
12244
12245        /// Sends the request.
12246        ///
12247        /// # Long running operations
12248        ///
12249        /// This starts, but does not poll, a longrunning operation. More information
12250        /// on [delete_mirroring_endpoint_group_association][crate::client::Mirroring::delete_mirroring_endpoint_group_association].
12251        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12252            (*self.0.stub)
12253                .delete_mirroring_endpoint_group_association(self.0.request, self.0.options)
12254                .await
12255                .map(crate::Response::into_body)
12256        }
12257
12258        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_endpoint_group_association`.
12259        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12260            type Operation =
12261                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12262            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12263            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12264
12265            let stub = self.0.stub.clone();
12266            let mut options = self.0.options.clone();
12267            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12268            let query = move |name| {
12269                let stub = stub.clone();
12270                let options = options.clone();
12271                async {
12272                    let op = GetOperation::new(stub)
12273                        .set_name(name)
12274                        .with_options(options)
12275                        .send()
12276                        .await?;
12277                    Ok(Operation::new(op))
12278                }
12279            };
12280
12281            let start = move || async {
12282                let op = self.send().await?;
12283                Ok(Operation::new(op))
12284            };
12285
12286            google_cloud_lro::internal::new_unit_response_poller(
12287                polling_error_policy,
12288                polling_backoff_policy,
12289                start,
12290                query,
12291            )
12292        }
12293
12294        /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupAssociationRequest::name].
12295        ///
12296        /// This is a **required** field for requests.
12297        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12298            self.0.request.name = v.into();
12299            self
12300        }
12301
12302        /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupAssociationRequest::request_id].
12303        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12304            self.0.request.request_id = v.into();
12305            self
12306        }
12307    }
12308
12309    #[doc(hidden)]
12310    impl crate::RequestBuilder for DeleteMirroringEndpointGroupAssociation {
12311        fn request_options(&mut self) -> &mut crate::RequestOptions {
12312            &mut self.0.options
12313        }
12314    }
12315
12316    /// The request builder for [Mirroring::list_mirroring_deployment_groups][crate::client::Mirroring::list_mirroring_deployment_groups] calls.
12317    ///
12318    /// # Example
12319    /// ```
12320    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringDeploymentGroups;
12321    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12322    /// use google_cloud_gax::paginator::ItemPaginator;
12323    ///
12324    /// let builder = prepare_request_builder();
12325    /// let mut items = builder.by_item();
12326    /// while let Some(result) = items.next().await {
12327    ///   let item = result?;
12328    /// }
12329    /// # Ok(()) }
12330    ///
12331    /// fn prepare_request_builder() -> ListMirroringDeploymentGroups {
12332    ///   # panic!();
12333    ///   // ... details omitted ...
12334    /// }
12335    /// ```
12336    #[derive(Clone, Debug)]
12337    pub struct ListMirroringDeploymentGroups(
12338        RequestBuilder<crate::model::ListMirroringDeploymentGroupsRequest>,
12339    );
12340
12341    impl ListMirroringDeploymentGroups {
12342        pub(crate) fn new(
12343            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12344        ) -> Self {
12345            Self(RequestBuilder::new(stub))
12346        }
12347
12348        /// Sets the full request, replacing any prior values.
12349        pub fn with_request<V: Into<crate::model::ListMirroringDeploymentGroupsRequest>>(
12350            mut self,
12351            v: V,
12352        ) -> Self {
12353            self.0.request = v.into();
12354            self
12355        }
12356
12357        /// Sets all the options, replacing any prior values.
12358        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12359            self.0.options = v.into();
12360            self
12361        }
12362
12363        /// Sends the request.
12364        pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentGroupsResponse> {
12365            (*self.0.stub)
12366                .list_mirroring_deployment_groups(self.0.request, self.0.options)
12367                .await
12368                .map(crate::Response::into_body)
12369        }
12370
12371        /// Streams each page in the collection.
12372        pub fn by_page(
12373            self,
12374        ) -> impl google_cloud_gax::paginator::Paginator<
12375            crate::model::ListMirroringDeploymentGroupsResponse,
12376            crate::Error,
12377        > {
12378            use std::clone::Clone;
12379            let token = self.0.request.page_token.clone();
12380            let execute = move |token: String| {
12381                let mut builder = self.clone();
12382                builder.0.request = builder.0.request.set_page_token(token);
12383                builder.send()
12384            };
12385            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12386        }
12387
12388        /// Streams each item in the collection.
12389        pub fn by_item(
12390            self,
12391        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12392            crate::model::ListMirroringDeploymentGroupsResponse,
12393            crate::Error,
12394        > {
12395            use google_cloud_gax::paginator::Paginator;
12396            self.by_page().items()
12397        }
12398
12399        /// Sets the value of [parent][crate::model::ListMirroringDeploymentGroupsRequest::parent].
12400        ///
12401        /// This is a **required** field for requests.
12402        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12403            self.0.request.parent = v.into();
12404            self
12405        }
12406
12407        /// Sets the value of [page_size][crate::model::ListMirroringDeploymentGroupsRequest::page_size].
12408        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12409            self.0.request.page_size = v.into();
12410            self
12411        }
12412
12413        /// Sets the value of [page_token][crate::model::ListMirroringDeploymentGroupsRequest::page_token].
12414        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12415            self.0.request.page_token = v.into();
12416            self
12417        }
12418
12419        /// Sets the value of [filter][crate::model::ListMirroringDeploymentGroupsRequest::filter].
12420        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12421            self.0.request.filter = v.into();
12422            self
12423        }
12424
12425        /// Sets the value of [order_by][crate::model::ListMirroringDeploymentGroupsRequest::order_by].
12426        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12427            self.0.request.order_by = v.into();
12428            self
12429        }
12430    }
12431
12432    #[doc(hidden)]
12433    impl crate::RequestBuilder for ListMirroringDeploymentGroups {
12434        fn request_options(&mut self) -> &mut crate::RequestOptions {
12435            &mut self.0.options
12436        }
12437    }
12438
12439    /// The request builder for [Mirroring::get_mirroring_deployment_group][crate::client::Mirroring::get_mirroring_deployment_group] calls.
12440    ///
12441    /// # Example
12442    /// ```
12443    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringDeploymentGroup;
12444    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12445    ///
12446    /// let builder = prepare_request_builder();
12447    /// let response = builder.send().await?;
12448    /// # Ok(()) }
12449    ///
12450    /// fn prepare_request_builder() -> GetMirroringDeploymentGroup {
12451    ///   # panic!();
12452    ///   // ... details omitted ...
12453    /// }
12454    /// ```
12455    #[derive(Clone, Debug)]
12456    pub struct GetMirroringDeploymentGroup(
12457        RequestBuilder<crate::model::GetMirroringDeploymentGroupRequest>,
12458    );
12459
12460    impl GetMirroringDeploymentGroup {
12461        pub(crate) fn new(
12462            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12463        ) -> Self {
12464            Self(RequestBuilder::new(stub))
12465        }
12466
12467        /// Sets the full request, replacing any prior values.
12468        pub fn with_request<V: Into<crate::model::GetMirroringDeploymentGroupRequest>>(
12469            mut self,
12470            v: V,
12471        ) -> Self {
12472            self.0.request = v.into();
12473            self
12474        }
12475
12476        /// Sets all the options, replacing any prior values.
12477        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12478            self.0.options = v.into();
12479            self
12480        }
12481
12482        /// Sends the request.
12483        pub async fn send(self) -> Result<crate::model::MirroringDeploymentGroup> {
12484            (*self.0.stub)
12485                .get_mirroring_deployment_group(self.0.request, self.0.options)
12486                .await
12487                .map(crate::Response::into_body)
12488        }
12489
12490        /// Sets the value of [name][crate::model::GetMirroringDeploymentGroupRequest::name].
12491        ///
12492        /// This is a **required** field for requests.
12493        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12494            self.0.request.name = v.into();
12495            self
12496        }
12497    }
12498
12499    #[doc(hidden)]
12500    impl crate::RequestBuilder for GetMirroringDeploymentGroup {
12501        fn request_options(&mut self) -> &mut crate::RequestOptions {
12502            &mut self.0.options
12503        }
12504    }
12505
12506    /// The request builder for [Mirroring::create_mirroring_deployment_group][crate::client::Mirroring::create_mirroring_deployment_group] calls.
12507    ///
12508    /// # Example
12509    /// ```
12510    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringDeploymentGroup;
12511    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12512    /// use google_cloud_lro::Poller;
12513    ///
12514    /// let builder = prepare_request_builder();
12515    /// let response = builder.poller().until_done().await?;
12516    /// # Ok(()) }
12517    ///
12518    /// fn prepare_request_builder() -> CreateMirroringDeploymentGroup {
12519    ///   # panic!();
12520    ///   // ... details omitted ...
12521    /// }
12522    /// ```
12523    #[derive(Clone, Debug)]
12524    pub struct CreateMirroringDeploymentGroup(
12525        RequestBuilder<crate::model::CreateMirroringDeploymentGroupRequest>,
12526    );
12527
12528    impl CreateMirroringDeploymentGroup {
12529        pub(crate) fn new(
12530            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12531        ) -> Self {
12532            Self(RequestBuilder::new(stub))
12533        }
12534
12535        /// Sets the full request, replacing any prior values.
12536        pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentGroupRequest>>(
12537            mut self,
12538            v: V,
12539        ) -> Self {
12540            self.0.request = v.into();
12541            self
12542        }
12543
12544        /// Sets all the options, replacing any prior values.
12545        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12546            self.0.options = v.into();
12547            self
12548        }
12549
12550        /// Sends the request.
12551        ///
12552        /// # Long running operations
12553        ///
12554        /// This starts, but does not poll, a longrunning operation. More information
12555        /// on [create_mirroring_deployment_group][crate::client::Mirroring::create_mirroring_deployment_group].
12556        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12557            (*self.0.stub)
12558                .create_mirroring_deployment_group(self.0.request, self.0.options)
12559                .await
12560                .map(crate::Response::into_body)
12561        }
12562
12563        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_deployment_group`.
12564        pub fn poller(
12565            self,
12566        ) -> impl google_cloud_lro::Poller<
12567            crate::model::MirroringDeploymentGroup,
12568            crate::model::OperationMetadata,
12569        > {
12570            type Operation = google_cloud_lro::internal::Operation<
12571                crate::model::MirroringDeploymentGroup,
12572                crate::model::OperationMetadata,
12573            >;
12574            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12575            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12576
12577            let stub = self.0.stub.clone();
12578            let mut options = self.0.options.clone();
12579            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12580            let query = move |name| {
12581                let stub = stub.clone();
12582                let options = options.clone();
12583                async {
12584                    let op = GetOperation::new(stub)
12585                        .set_name(name)
12586                        .with_options(options)
12587                        .send()
12588                        .await?;
12589                    Ok(Operation::new(op))
12590                }
12591            };
12592
12593            let start = move || async {
12594                let op = self.send().await?;
12595                Ok(Operation::new(op))
12596            };
12597
12598            google_cloud_lro::internal::new_poller(
12599                polling_error_policy,
12600                polling_backoff_policy,
12601                start,
12602                query,
12603            )
12604        }
12605
12606        /// Sets the value of [parent][crate::model::CreateMirroringDeploymentGroupRequest::parent].
12607        ///
12608        /// This is a **required** field for requests.
12609        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12610            self.0.request.parent = v.into();
12611            self
12612        }
12613
12614        /// Sets the value of [mirroring_deployment_group_id][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group_id].
12615        ///
12616        /// This is a **required** field for requests.
12617        pub fn set_mirroring_deployment_group_id<T: Into<std::string::String>>(
12618            mut self,
12619            v: T,
12620        ) -> Self {
12621            self.0.request.mirroring_deployment_group_id = v.into();
12622            self
12623        }
12624
12625        /// Sets the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
12626        ///
12627        /// This is a **required** field for requests.
12628        pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
12629        where
12630            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12631        {
12632            self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
12633            self
12634        }
12635
12636        /// Sets or clears the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
12637        ///
12638        /// This is a **required** field for requests.
12639        pub fn set_or_clear_mirroring_deployment_group<T>(
12640            mut self,
12641            v: std::option::Option<T>,
12642        ) -> Self
12643        where
12644            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12645        {
12646            self.0.request.mirroring_deployment_group = v.map(|x| x.into());
12647            self
12648        }
12649
12650        /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentGroupRequest::request_id].
12651        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12652            self.0.request.request_id = v.into();
12653            self
12654        }
12655    }
12656
12657    #[doc(hidden)]
12658    impl crate::RequestBuilder for CreateMirroringDeploymentGroup {
12659        fn request_options(&mut self) -> &mut crate::RequestOptions {
12660            &mut self.0.options
12661        }
12662    }
12663
12664    /// The request builder for [Mirroring::update_mirroring_deployment_group][crate::client::Mirroring::update_mirroring_deployment_group] calls.
12665    ///
12666    /// # Example
12667    /// ```
12668    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringDeploymentGroup;
12669    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12670    /// use google_cloud_lro::Poller;
12671    ///
12672    /// let builder = prepare_request_builder();
12673    /// let response = builder.poller().until_done().await?;
12674    /// # Ok(()) }
12675    ///
12676    /// fn prepare_request_builder() -> UpdateMirroringDeploymentGroup {
12677    ///   # panic!();
12678    ///   // ... details omitted ...
12679    /// }
12680    /// ```
12681    #[derive(Clone, Debug)]
12682    pub struct UpdateMirroringDeploymentGroup(
12683        RequestBuilder<crate::model::UpdateMirroringDeploymentGroupRequest>,
12684    );
12685
12686    impl UpdateMirroringDeploymentGroup {
12687        pub(crate) fn new(
12688            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12689        ) -> Self {
12690            Self(RequestBuilder::new(stub))
12691        }
12692
12693        /// Sets the full request, replacing any prior values.
12694        pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentGroupRequest>>(
12695            mut self,
12696            v: V,
12697        ) -> Self {
12698            self.0.request = v.into();
12699            self
12700        }
12701
12702        /// Sets all the options, replacing any prior values.
12703        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12704            self.0.options = v.into();
12705            self
12706        }
12707
12708        /// Sends the request.
12709        ///
12710        /// # Long running operations
12711        ///
12712        /// This starts, but does not poll, a longrunning operation. More information
12713        /// on [update_mirroring_deployment_group][crate::client::Mirroring::update_mirroring_deployment_group].
12714        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12715            (*self.0.stub)
12716                .update_mirroring_deployment_group(self.0.request, self.0.options)
12717                .await
12718                .map(crate::Response::into_body)
12719        }
12720
12721        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_deployment_group`.
12722        pub fn poller(
12723            self,
12724        ) -> impl google_cloud_lro::Poller<
12725            crate::model::MirroringDeploymentGroup,
12726            crate::model::OperationMetadata,
12727        > {
12728            type Operation = google_cloud_lro::internal::Operation<
12729                crate::model::MirroringDeploymentGroup,
12730                crate::model::OperationMetadata,
12731            >;
12732            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12733            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12734
12735            let stub = self.0.stub.clone();
12736            let mut options = self.0.options.clone();
12737            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12738            let query = move |name| {
12739                let stub = stub.clone();
12740                let options = options.clone();
12741                async {
12742                    let op = GetOperation::new(stub)
12743                        .set_name(name)
12744                        .with_options(options)
12745                        .send()
12746                        .await?;
12747                    Ok(Operation::new(op))
12748                }
12749            };
12750
12751            let start = move || async {
12752                let op = self.send().await?;
12753                Ok(Operation::new(op))
12754            };
12755
12756            google_cloud_lro::internal::new_poller(
12757                polling_error_policy,
12758                polling_backoff_policy,
12759                start,
12760                query,
12761            )
12762        }
12763
12764        /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
12765        pub fn set_update_mask<T>(mut self, v: T) -> Self
12766        where
12767            T: std::convert::Into<wkt::FieldMask>,
12768        {
12769            self.0.request.update_mask = std::option::Option::Some(v.into());
12770            self
12771        }
12772
12773        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
12774        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12775        where
12776            T: std::convert::Into<wkt::FieldMask>,
12777        {
12778            self.0.request.update_mask = v.map(|x| x.into());
12779            self
12780        }
12781
12782        /// Sets the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
12783        ///
12784        /// This is a **required** field for requests.
12785        pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
12786        where
12787            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12788        {
12789            self.0.request.mirroring_deployment_group = std::option::Option::Some(v.into());
12790            self
12791        }
12792
12793        /// Sets or clears the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
12794        ///
12795        /// This is a **required** field for requests.
12796        pub fn set_or_clear_mirroring_deployment_group<T>(
12797            mut self,
12798            v: std::option::Option<T>,
12799        ) -> Self
12800        where
12801            T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
12802        {
12803            self.0.request.mirroring_deployment_group = v.map(|x| x.into());
12804            self
12805        }
12806
12807        /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentGroupRequest::request_id].
12808        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12809            self.0.request.request_id = v.into();
12810            self
12811        }
12812    }
12813
12814    #[doc(hidden)]
12815    impl crate::RequestBuilder for UpdateMirroringDeploymentGroup {
12816        fn request_options(&mut self) -> &mut crate::RequestOptions {
12817            &mut self.0.options
12818        }
12819    }
12820
12821    /// The request builder for [Mirroring::delete_mirroring_deployment_group][crate::client::Mirroring::delete_mirroring_deployment_group] calls.
12822    ///
12823    /// # Example
12824    /// ```
12825    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringDeploymentGroup;
12826    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12827    /// use google_cloud_lro::Poller;
12828    ///
12829    /// let builder = prepare_request_builder();
12830    /// let response = builder.poller().until_done().await?;
12831    /// # Ok(()) }
12832    ///
12833    /// fn prepare_request_builder() -> DeleteMirroringDeploymentGroup {
12834    ///   # panic!();
12835    ///   // ... details omitted ...
12836    /// }
12837    /// ```
12838    #[derive(Clone, Debug)]
12839    pub struct DeleteMirroringDeploymentGroup(
12840        RequestBuilder<crate::model::DeleteMirroringDeploymentGroupRequest>,
12841    );
12842
12843    impl DeleteMirroringDeploymentGroup {
12844        pub(crate) fn new(
12845            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12846        ) -> Self {
12847            Self(RequestBuilder::new(stub))
12848        }
12849
12850        /// Sets the full request, replacing any prior values.
12851        pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentGroupRequest>>(
12852            mut self,
12853            v: V,
12854        ) -> Self {
12855            self.0.request = v.into();
12856            self
12857        }
12858
12859        /// Sets all the options, replacing any prior values.
12860        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12861            self.0.options = v.into();
12862            self
12863        }
12864
12865        /// Sends the request.
12866        ///
12867        /// # Long running operations
12868        ///
12869        /// This starts, but does not poll, a longrunning operation. More information
12870        /// on [delete_mirroring_deployment_group][crate::client::Mirroring::delete_mirroring_deployment_group].
12871        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12872            (*self.0.stub)
12873                .delete_mirroring_deployment_group(self.0.request, self.0.options)
12874                .await
12875                .map(crate::Response::into_body)
12876        }
12877
12878        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_deployment_group`.
12879        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12880            type Operation =
12881                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12882            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12883            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12884
12885            let stub = self.0.stub.clone();
12886            let mut options = self.0.options.clone();
12887            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12888            let query = move |name| {
12889                let stub = stub.clone();
12890                let options = options.clone();
12891                async {
12892                    let op = GetOperation::new(stub)
12893                        .set_name(name)
12894                        .with_options(options)
12895                        .send()
12896                        .await?;
12897                    Ok(Operation::new(op))
12898                }
12899            };
12900
12901            let start = move || async {
12902                let op = self.send().await?;
12903                Ok(Operation::new(op))
12904            };
12905
12906            google_cloud_lro::internal::new_unit_response_poller(
12907                polling_error_policy,
12908                polling_backoff_policy,
12909                start,
12910                query,
12911            )
12912        }
12913
12914        /// Sets the value of [name][crate::model::DeleteMirroringDeploymentGroupRequest::name].
12915        ///
12916        /// This is a **required** field for requests.
12917        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12918            self.0.request.name = v.into();
12919            self
12920        }
12921
12922        /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentGroupRequest::request_id].
12923        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12924            self.0.request.request_id = v.into();
12925            self
12926        }
12927    }
12928
12929    #[doc(hidden)]
12930    impl crate::RequestBuilder for DeleteMirroringDeploymentGroup {
12931        fn request_options(&mut self) -> &mut crate::RequestOptions {
12932            &mut self.0.options
12933        }
12934    }
12935
12936    /// The request builder for [Mirroring::list_mirroring_deployments][crate::client::Mirroring::list_mirroring_deployments] calls.
12937    ///
12938    /// # Example
12939    /// ```
12940    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListMirroringDeployments;
12941    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
12942    /// use google_cloud_gax::paginator::ItemPaginator;
12943    ///
12944    /// let builder = prepare_request_builder();
12945    /// let mut items = builder.by_item();
12946    /// while let Some(result) = items.next().await {
12947    ///   let item = result?;
12948    /// }
12949    /// # Ok(()) }
12950    ///
12951    /// fn prepare_request_builder() -> ListMirroringDeployments {
12952    ///   # panic!();
12953    ///   // ... details omitted ...
12954    /// }
12955    /// ```
12956    #[derive(Clone, Debug)]
12957    pub struct ListMirroringDeployments(
12958        RequestBuilder<crate::model::ListMirroringDeploymentsRequest>,
12959    );
12960
12961    impl ListMirroringDeployments {
12962        pub(crate) fn new(
12963            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
12964        ) -> Self {
12965            Self(RequestBuilder::new(stub))
12966        }
12967
12968        /// Sets the full request, replacing any prior values.
12969        pub fn with_request<V: Into<crate::model::ListMirroringDeploymentsRequest>>(
12970            mut self,
12971            v: V,
12972        ) -> Self {
12973            self.0.request = v.into();
12974            self
12975        }
12976
12977        /// Sets all the options, replacing any prior values.
12978        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12979            self.0.options = v.into();
12980            self
12981        }
12982
12983        /// Sends the request.
12984        pub async fn send(self) -> Result<crate::model::ListMirroringDeploymentsResponse> {
12985            (*self.0.stub)
12986                .list_mirroring_deployments(self.0.request, self.0.options)
12987                .await
12988                .map(crate::Response::into_body)
12989        }
12990
12991        /// Streams each page in the collection.
12992        pub fn by_page(
12993            self,
12994        ) -> impl google_cloud_gax::paginator::Paginator<
12995            crate::model::ListMirroringDeploymentsResponse,
12996            crate::Error,
12997        > {
12998            use std::clone::Clone;
12999            let token = self.0.request.page_token.clone();
13000            let execute = move |token: String| {
13001                let mut builder = self.clone();
13002                builder.0.request = builder.0.request.set_page_token(token);
13003                builder.send()
13004            };
13005            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13006        }
13007
13008        /// Streams each item in the collection.
13009        pub fn by_item(
13010            self,
13011        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13012            crate::model::ListMirroringDeploymentsResponse,
13013            crate::Error,
13014        > {
13015            use google_cloud_gax::paginator::Paginator;
13016            self.by_page().items()
13017        }
13018
13019        /// Sets the value of [parent][crate::model::ListMirroringDeploymentsRequest::parent].
13020        ///
13021        /// This is a **required** field for requests.
13022        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13023            self.0.request.parent = v.into();
13024            self
13025        }
13026
13027        /// Sets the value of [page_size][crate::model::ListMirroringDeploymentsRequest::page_size].
13028        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13029            self.0.request.page_size = v.into();
13030            self
13031        }
13032
13033        /// Sets the value of [page_token][crate::model::ListMirroringDeploymentsRequest::page_token].
13034        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13035            self.0.request.page_token = v.into();
13036            self
13037        }
13038
13039        /// Sets the value of [filter][crate::model::ListMirroringDeploymentsRequest::filter].
13040        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13041            self.0.request.filter = v.into();
13042            self
13043        }
13044
13045        /// Sets the value of [order_by][crate::model::ListMirroringDeploymentsRequest::order_by].
13046        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
13047            self.0.request.order_by = v.into();
13048            self
13049        }
13050    }
13051
13052    #[doc(hidden)]
13053    impl crate::RequestBuilder for ListMirroringDeployments {
13054        fn request_options(&mut self) -> &mut crate::RequestOptions {
13055            &mut self.0.options
13056        }
13057    }
13058
13059    /// The request builder for [Mirroring::get_mirroring_deployment][crate::client::Mirroring::get_mirroring_deployment] calls.
13060    ///
13061    /// # Example
13062    /// ```
13063    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetMirroringDeployment;
13064    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13065    ///
13066    /// let builder = prepare_request_builder();
13067    /// let response = builder.send().await?;
13068    /// # Ok(()) }
13069    ///
13070    /// fn prepare_request_builder() -> GetMirroringDeployment {
13071    ///   # panic!();
13072    ///   // ... details omitted ...
13073    /// }
13074    /// ```
13075    #[derive(Clone, Debug)]
13076    pub struct GetMirroringDeployment(RequestBuilder<crate::model::GetMirroringDeploymentRequest>);
13077
13078    impl GetMirroringDeployment {
13079        pub(crate) fn new(
13080            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13081        ) -> Self {
13082            Self(RequestBuilder::new(stub))
13083        }
13084
13085        /// Sets the full request, replacing any prior values.
13086        pub fn with_request<V: Into<crate::model::GetMirroringDeploymentRequest>>(
13087            mut self,
13088            v: V,
13089        ) -> Self {
13090            self.0.request = v.into();
13091            self
13092        }
13093
13094        /// Sets all the options, replacing any prior values.
13095        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13096            self.0.options = v.into();
13097            self
13098        }
13099
13100        /// Sends the request.
13101        pub async fn send(self) -> Result<crate::model::MirroringDeployment> {
13102            (*self.0.stub)
13103                .get_mirroring_deployment(self.0.request, self.0.options)
13104                .await
13105                .map(crate::Response::into_body)
13106        }
13107
13108        /// Sets the value of [name][crate::model::GetMirroringDeploymentRequest::name].
13109        ///
13110        /// This is a **required** field for requests.
13111        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13112            self.0.request.name = v.into();
13113            self
13114        }
13115    }
13116
13117    #[doc(hidden)]
13118    impl crate::RequestBuilder for GetMirroringDeployment {
13119        fn request_options(&mut self) -> &mut crate::RequestOptions {
13120            &mut self.0.options
13121        }
13122    }
13123
13124    /// The request builder for [Mirroring::create_mirroring_deployment][crate::client::Mirroring::create_mirroring_deployment] calls.
13125    ///
13126    /// # Example
13127    /// ```
13128    /// # use google_cloud_networksecurity_v1::builder::mirroring::CreateMirroringDeployment;
13129    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13130    /// use google_cloud_lro::Poller;
13131    ///
13132    /// let builder = prepare_request_builder();
13133    /// let response = builder.poller().until_done().await?;
13134    /// # Ok(()) }
13135    ///
13136    /// fn prepare_request_builder() -> CreateMirroringDeployment {
13137    ///   # panic!();
13138    ///   // ... details omitted ...
13139    /// }
13140    /// ```
13141    #[derive(Clone, Debug)]
13142    pub struct CreateMirroringDeployment(
13143        RequestBuilder<crate::model::CreateMirroringDeploymentRequest>,
13144    );
13145
13146    impl CreateMirroringDeployment {
13147        pub(crate) fn new(
13148            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13149        ) -> Self {
13150            Self(RequestBuilder::new(stub))
13151        }
13152
13153        /// Sets the full request, replacing any prior values.
13154        pub fn with_request<V: Into<crate::model::CreateMirroringDeploymentRequest>>(
13155            mut self,
13156            v: V,
13157        ) -> Self {
13158            self.0.request = v.into();
13159            self
13160        }
13161
13162        /// Sets all the options, replacing any prior values.
13163        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13164            self.0.options = v.into();
13165            self
13166        }
13167
13168        /// Sends the request.
13169        ///
13170        /// # Long running operations
13171        ///
13172        /// This starts, but does not poll, a longrunning operation. More information
13173        /// on [create_mirroring_deployment][crate::client::Mirroring::create_mirroring_deployment].
13174        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13175            (*self.0.stub)
13176                .create_mirroring_deployment(self.0.request, self.0.options)
13177                .await
13178                .map(crate::Response::into_body)
13179        }
13180
13181        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_mirroring_deployment`.
13182        pub fn poller(
13183            self,
13184        ) -> impl google_cloud_lro::Poller<
13185            crate::model::MirroringDeployment,
13186            crate::model::OperationMetadata,
13187        > {
13188            type Operation = google_cloud_lro::internal::Operation<
13189                crate::model::MirroringDeployment,
13190                crate::model::OperationMetadata,
13191            >;
13192            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13193            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13194
13195            let stub = self.0.stub.clone();
13196            let mut options = self.0.options.clone();
13197            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13198            let query = move |name| {
13199                let stub = stub.clone();
13200                let options = options.clone();
13201                async {
13202                    let op = GetOperation::new(stub)
13203                        .set_name(name)
13204                        .with_options(options)
13205                        .send()
13206                        .await?;
13207                    Ok(Operation::new(op))
13208                }
13209            };
13210
13211            let start = move || async {
13212                let op = self.send().await?;
13213                Ok(Operation::new(op))
13214            };
13215
13216            google_cloud_lro::internal::new_poller(
13217                polling_error_policy,
13218                polling_backoff_policy,
13219                start,
13220                query,
13221            )
13222        }
13223
13224        /// Sets the value of [parent][crate::model::CreateMirroringDeploymentRequest::parent].
13225        ///
13226        /// This is a **required** field for requests.
13227        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13228            self.0.request.parent = v.into();
13229            self
13230        }
13231
13232        /// Sets the value of [mirroring_deployment_id][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment_id].
13233        ///
13234        /// This is a **required** field for requests.
13235        pub fn set_mirroring_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13236            self.0.request.mirroring_deployment_id = v.into();
13237            self
13238        }
13239
13240        /// Sets the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
13241        ///
13242        /// This is a **required** field for requests.
13243        pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
13244        where
13245            T: std::convert::Into<crate::model::MirroringDeployment>,
13246        {
13247            self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
13248            self
13249        }
13250
13251        /// Sets or clears the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
13252        ///
13253        /// This is a **required** field for requests.
13254        pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
13255        where
13256            T: std::convert::Into<crate::model::MirroringDeployment>,
13257        {
13258            self.0.request.mirroring_deployment = v.map(|x| x.into());
13259            self
13260        }
13261
13262        /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentRequest::request_id].
13263        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13264            self.0.request.request_id = v.into();
13265            self
13266        }
13267    }
13268
13269    #[doc(hidden)]
13270    impl crate::RequestBuilder for CreateMirroringDeployment {
13271        fn request_options(&mut self) -> &mut crate::RequestOptions {
13272            &mut self.0.options
13273        }
13274    }
13275
13276    /// The request builder for [Mirroring::update_mirroring_deployment][crate::client::Mirroring::update_mirroring_deployment] calls.
13277    ///
13278    /// # Example
13279    /// ```
13280    /// # use google_cloud_networksecurity_v1::builder::mirroring::UpdateMirroringDeployment;
13281    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13282    /// use google_cloud_lro::Poller;
13283    ///
13284    /// let builder = prepare_request_builder();
13285    /// let response = builder.poller().until_done().await?;
13286    /// # Ok(()) }
13287    ///
13288    /// fn prepare_request_builder() -> UpdateMirroringDeployment {
13289    ///   # panic!();
13290    ///   // ... details omitted ...
13291    /// }
13292    /// ```
13293    #[derive(Clone, Debug)]
13294    pub struct UpdateMirroringDeployment(
13295        RequestBuilder<crate::model::UpdateMirroringDeploymentRequest>,
13296    );
13297
13298    impl UpdateMirroringDeployment {
13299        pub(crate) fn new(
13300            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13301        ) -> Self {
13302            Self(RequestBuilder::new(stub))
13303        }
13304
13305        /// Sets the full request, replacing any prior values.
13306        pub fn with_request<V: Into<crate::model::UpdateMirroringDeploymentRequest>>(
13307            mut self,
13308            v: V,
13309        ) -> Self {
13310            self.0.request = v.into();
13311            self
13312        }
13313
13314        /// Sets all the options, replacing any prior values.
13315        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13316            self.0.options = v.into();
13317            self
13318        }
13319
13320        /// Sends the request.
13321        ///
13322        /// # Long running operations
13323        ///
13324        /// This starts, but does not poll, a longrunning operation. More information
13325        /// on [update_mirroring_deployment][crate::client::Mirroring::update_mirroring_deployment].
13326        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13327            (*self.0.stub)
13328                .update_mirroring_deployment(self.0.request, self.0.options)
13329                .await
13330                .map(crate::Response::into_body)
13331        }
13332
13333        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_mirroring_deployment`.
13334        pub fn poller(
13335            self,
13336        ) -> impl google_cloud_lro::Poller<
13337            crate::model::MirroringDeployment,
13338            crate::model::OperationMetadata,
13339        > {
13340            type Operation = google_cloud_lro::internal::Operation<
13341                crate::model::MirroringDeployment,
13342                crate::model::OperationMetadata,
13343            >;
13344            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13345            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13346
13347            let stub = self.0.stub.clone();
13348            let mut options = self.0.options.clone();
13349            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13350            let query = move |name| {
13351                let stub = stub.clone();
13352                let options = options.clone();
13353                async {
13354                    let op = GetOperation::new(stub)
13355                        .set_name(name)
13356                        .with_options(options)
13357                        .send()
13358                        .await?;
13359                    Ok(Operation::new(op))
13360                }
13361            };
13362
13363            let start = move || async {
13364                let op = self.send().await?;
13365                Ok(Operation::new(op))
13366            };
13367
13368            google_cloud_lro::internal::new_poller(
13369                polling_error_policy,
13370                polling_backoff_policy,
13371                start,
13372                query,
13373            )
13374        }
13375
13376        /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
13377        pub fn set_update_mask<T>(mut self, v: T) -> Self
13378        where
13379            T: std::convert::Into<wkt::FieldMask>,
13380        {
13381            self.0.request.update_mask = std::option::Option::Some(v.into());
13382            self
13383        }
13384
13385        /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
13386        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13387        where
13388            T: std::convert::Into<wkt::FieldMask>,
13389        {
13390            self.0.request.update_mask = v.map(|x| x.into());
13391            self
13392        }
13393
13394        /// Sets the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
13395        ///
13396        /// This is a **required** field for requests.
13397        pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
13398        where
13399            T: std::convert::Into<crate::model::MirroringDeployment>,
13400        {
13401            self.0.request.mirroring_deployment = std::option::Option::Some(v.into());
13402            self
13403        }
13404
13405        /// Sets or clears the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
13406        ///
13407        /// This is a **required** field for requests.
13408        pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
13409        where
13410            T: std::convert::Into<crate::model::MirroringDeployment>,
13411        {
13412            self.0.request.mirroring_deployment = v.map(|x| x.into());
13413            self
13414        }
13415
13416        /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentRequest::request_id].
13417        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13418            self.0.request.request_id = v.into();
13419            self
13420        }
13421    }
13422
13423    #[doc(hidden)]
13424    impl crate::RequestBuilder for UpdateMirroringDeployment {
13425        fn request_options(&mut self) -> &mut crate::RequestOptions {
13426            &mut self.0.options
13427        }
13428    }
13429
13430    /// The request builder for [Mirroring::delete_mirroring_deployment][crate::client::Mirroring::delete_mirroring_deployment] calls.
13431    ///
13432    /// # Example
13433    /// ```
13434    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteMirroringDeployment;
13435    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13436    /// use google_cloud_lro::Poller;
13437    ///
13438    /// let builder = prepare_request_builder();
13439    /// let response = builder.poller().until_done().await?;
13440    /// # Ok(()) }
13441    ///
13442    /// fn prepare_request_builder() -> DeleteMirroringDeployment {
13443    ///   # panic!();
13444    ///   // ... details omitted ...
13445    /// }
13446    /// ```
13447    #[derive(Clone, Debug)]
13448    pub struct DeleteMirroringDeployment(
13449        RequestBuilder<crate::model::DeleteMirroringDeploymentRequest>,
13450    );
13451
13452    impl DeleteMirroringDeployment {
13453        pub(crate) fn new(
13454            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13455        ) -> Self {
13456            Self(RequestBuilder::new(stub))
13457        }
13458
13459        /// Sets the full request, replacing any prior values.
13460        pub fn with_request<V: Into<crate::model::DeleteMirroringDeploymentRequest>>(
13461            mut self,
13462            v: V,
13463        ) -> Self {
13464            self.0.request = v.into();
13465            self
13466        }
13467
13468        /// Sets all the options, replacing any prior values.
13469        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13470            self.0.options = v.into();
13471            self
13472        }
13473
13474        /// Sends the request.
13475        ///
13476        /// # Long running operations
13477        ///
13478        /// This starts, but does not poll, a longrunning operation. More information
13479        /// on [delete_mirroring_deployment][crate::client::Mirroring::delete_mirroring_deployment].
13480        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13481            (*self.0.stub)
13482                .delete_mirroring_deployment(self.0.request, self.0.options)
13483                .await
13484                .map(crate::Response::into_body)
13485        }
13486
13487        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_mirroring_deployment`.
13488        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
13489            type Operation =
13490                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
13491            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13492            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13493
13494            let stub = self.0.stub.clone();
13495            let mut options = self.0.options.clone();
13496            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13497            let query = move |name| {
13498                let stub = stub.clone();
13499                let options = options.clone();
13500                async {
13501                    let op = GetOperation::new(stub)
13502                        .set_name(name)
13503                        .with_options(options)
13504                        .send()
13505                        .await?;
13506                    Ok(Operation::new(op))
13507                }
13508            };
13509
13510            let start = move || async {
13511                let op = self.send().await?;
13512                Ok(Operation::new(op))
13513            };
13514
13515            google_cloud_lro::internal::new_unit_response_poller(
13516                polling_error_policy,
13517                polling_backoff_policy,
13518                start,
13519                query,
13520            )
13521        }
13522
13523        /// Sets the value of [name][crate::model::DeleteMirroringDeploymentRequest::name].
13524        ///
13525        /// This is a **required** field for requests.
13526        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13527            self.0.request.name = v.into();
13528            self
13529        }
13530
13531        /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentRequest::request_id].
13532        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13533            self.0.request.request_id = v.into();
13534            self
13535        }
13536    }
13537
13538    #[doc(hidden)]
13539    impl crate::RequestBuilder for DeleteMirroringDeployment {
13540        fn request_options(&mut self) -> &mut crate::RequestOptions {
13541            &mut self.0.options
13542        }
13543    }
13544
13545    /// The request builder for [Mirroring::list_locations][crate::client::Mirroring::list_locations] calls.
13546    ///
13547    /// # Example
13548    /// ```
13549    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListLocations;
13550    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13551    /// use google_cloud_gax::paginator::ItemPaginator;
13552    ///
13553    /// let builder = prepare_request_builder();
13554    /// let mut items = builder.by_item();
13555    /// while let Some(result) = items.next().await {
13556    ///   let item = result?;
13557    /// }
13558    /// # Ok(()) }
13559    ///
13560    /// fn prepare_request_builder() -> ListLocations {
13561    ///   # panic!();
13562    ///   // ... details omitted ...
13563    /// }
13564    /// ```
13565    #[derive(Clone, Debug)]
13566    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13567
13568    impl ListLocations {
13569        pub(crate) fn new(
13570            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13571        ) -> Self {
13572            Self(RequestBuilder::new(stub))
13573        }
13574
13575        /// Sets the full request, replacing any prior values.
13576        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13577            mut self,
13578            v: V,
13579        ) -> Self {
13580            self.0.request = v.into();
13581            self
13582        }
13583
13584        /// Sets all the options, replacing any prior values.
13585        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13586            self.0.options = v.into();
13587            self
13588        }
13589
13590        /// Sends the request.
13591        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
13592            (*self.0.stub)
13593                .list_locations(self.0.request, self.0.options)
13594                .await
13595                .map(crate::Response::into_body)
13596        }
13597
13598        /// Streams each page in the collection.
13599        pub fn by_page(
13600            self,
13601        ) -> impl google_cloud_gax::paginator::Paginator<
13602            google_cloud_location::model::ListLocationsResponse,
13603            crate::Error,
13604        > {
13605            use std::clone::Clone;
13606            let token = self.0.request.page_token.clone();
13607            let execute = move |token: String| {
13608                let mut builder = self.clone();
13609                builder.0.request = builder.0.request.set_page_token(token);
13610                builder.send()
13611            };
13612            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13613        }
13614
13615        /// Streams each item in the collection.
13616        pub fn by_item(
13617            self,
13618        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13619            google_cloud_location::model::ListLocationsResponse,
13620            crate::Error,
13621        > {
13622            use google_cloud_gax::paginator::Paginator;
13623            self.by_page().items()
13624        }
13625
13626        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
13627        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13628            self.0.request.name = v.into();
13629            self
13630        }
13631
13632        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
13633        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13634            self.0.request.filter = v.into();
13635            self
13636        }
13637
13638        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
13639        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13640            self.0.request.page_size = v.into();
13641            self
13642        }
13643
13644        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
13645        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13646            self.0.request.page_token = v.into();
13647            self
13648        }
13649    }
13650
13651    #[doc(hidden)]
13652    impl crate::RequestBuilder for ListLocations {
13653        fn request_options(&mut self) -> &mut crate::RequestOptions {
13654            &mut self.0.options
13655        }
13656    }
13657
13658    /// The request builder for [Mirroring::get_location][crate::client::Mirroring::get_location] calls.
13659    ///
13660    /// # Example
13661    /// ```
13662    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetLocation;
13663    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13664    ///
13665    /// let builder = prepare_request_builder();
13666    /// let response = builder.send().await?;
13667    /// # Ok(()) }
13668    ///
13669    /// fn prepare_request_builder() -> GetLocation {
13670    ///   # panic!();
13671    ///   // ... details omitted ...
13672    /// }
13673    /// ```
13674    #[derive(Clone, Debug)]
13675    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13676
13677    impl GetLocation {
13678        pub(crate) fn new(
13679            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13680        ) -> Self {
13681            Self(RequestBuilder::new(stub))
13682        }
13683
13684        /// Sets the full request, replacing any prior values.
13685        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13686            mut self,
13687            v: V,
13688        ) -> Self {
13689            self.0.request = v.into();
13690            self
13691        }
13692
13693        /// Sets all the options, replacing any prior values.
13694        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13695            self.0.options = v.into();
13696            self
13697        }
13698
13699        /// Sends the request.
13700        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13701            (*self.0.stub)
13702                .get_location(self.0.request, self.0.options)
13703                .await
13704                .map(crate::Response::into_body)
13705        }
13706
13707        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
13708        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13709            self.0.request.name = v.into();
13710            self
13711        }
13712    }
13713
13714    #[doc(hidden)]
13715    impl crate::RequestBuilder for GetLocation {
13716        fn request_options(&mut self) -> &mut crate::RequestOptions {
13717            &mut self.0.options
13718        }
13719    }
13720
13721    /// The request builder for [Mirroring::set_iam_policy][crate::client::Mirroring::set_iam_policy] calls.
13722    ///
13723    /// # Example
13724    /// ```
13725    /// # use google_cloud_networksecurity_v1::builder::mirroring::SetIamPolicy;
13726    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13727    ///
13728    /// let builder = prepare_request_builder();
13729    /// let response = builder.send().await?;
13730    /// # Ok(()) }
13731    ///
13732    /// fn prepare_request_builder() -> SetIamPolicy {
13733    ///   # panic!();
13734    ///   // ... details omitted ...
13735    /// }
13736    /// ```
13737    #[derive(Clone, Debug)]
13738    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
13739
13740    impl SetIamPolicy {
13741        pub(crate) fn new(
13742            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13743        ) -> Self {
13744            Self(RequestBuilder::new(stub))
13745        }
13746
13747        /// Sets the full request, replacing any prior values.
13748        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
13749            mut self,
13750            v: V,
13751        ) -> Self {
13752            self.0.request = v.into();
13753            self
13754        }
13755
13756        /// Sets all the options, replacing any prior values.
13757        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13758            self.0.options = v.into();
13759            self
13760        }
13761
13762        /// Sends the request.
13763        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13764            (*self.0.stub)
13765                .set_iam_policy(self.0.request, self.0.options)
13766                .await
13767                .map(crate::Response::into_body)
13768        }
13769
13770        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
13771        ///
13772        /// This is a **required** field for requests.
13773        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13774            self.0.request.resource = v.into();
13775            self
13776        }
13777
13778        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
13779        ///
13780        /// This is a **required** field for requests.
13781        pub fn set_policy<T>(mut self, v: T) -> Self
13782        where
13783            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13784        {
13785            self.0.request.policy = std::option::Option::Some(v.into());
13786            self
13787        }
13788
13789        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
13790        ///
13791        /// This is a **required** field for requests.
13792        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
13793        where
13794            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13795        {
13796            self.0.request.policy = v.map(|x| x.into());
13797            self
13798        }
13799
13800        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
13801        pub fn set_update_mask<T>(mut self, v: T) -> Self
13802        where
13803            T: std::convert::Into<wkt::FieldMask>,
13804        {
13805            self.0.request.update_mask = std::option::Option::Some(v.into());
13806            self
13807        }
13808
13809        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
13810        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13811        where
13812            T: std::convert::Into<wkt::FieldMask>,
13813        {
13814            self.0.request.update_mask = v.map(|x| x.into());
13815            self
13816        }
13817    }
13818
13819    #[doc(hidden)]
13820    impl crate::RequestBuilder for SetIamPolicy {
13821        fn request_options(&mut self) -> &mut crate::RequestOptions {
13822            &mut self.0.options
13823        }
13824    }
13825
13826    /// The request builder for [Mirroring::get_iam_policy][crate::client::Mirroring::get_iam_policy] calls.
13827    ///
13828    /// # Example
13829    /// ```
13830    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetIamPolicy;
13831    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13832    ///
13833    /// let builder = prepare_request_builder();
13834    /// let response = builder.send().await?;
13835    /// # Ok(()) }
13836    ///
13837    /// fn prepare_request_builder() -> GetIamPolicy {
13838    ///   # panic!();
13839    ///   // ... details omitted ...
13840    /// }
13841    /// ```
13842    #[derive(Clone, Debug)]
13843    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
13844
13845    impl GetIamPolicy {
13846        pub(crate) fn new(
13847            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13848        ) -> Self {
13849            Self(RequestBuilder::new(stub))
13850        }
13851
13852        /// Sets the full request, replacing any prior values.
13853        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
13854            mut self,
13855            v: V,
13856        ) -> Self {
13857            self.0.request = v.into();
13858            self
13859        }
13860
13861        /// Sets all the options, replacing any prior values.
13862        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13863            self.0.options = v.into();
13864            self
13865        }
13866
13867        /// Sends the request.
13868        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13869            (*self.0.stub)
13870                .get_iam_policy(self.0.request, self.0.options)
13871                .await
13872                .map(crate::Response::into_body)
13873        }
13874
13875        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
13876        ///
13877        /// This is a **required** field for requests.
13878        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13879            self.0.request.resource = v.into();
13880            self
13881        }
13882
13883        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
13884        pub fn set_options<T>(mut self, v: T) -> Self
13885        where
13886            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13887        {
13888            self.0.request.options = std::option::Option::Some(v.into());
13889            self
13890        }
13891
13892        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
13893        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
13894        where
13895            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13896        {
13897            self.0.request.options = v.map(|x| x.into());
13898            self
13899        }
13900    }
13901
13902    #[doc(hidden)]
13903    impl crate::RequestBuilder for GetIamPolicy {
13904        fn request_options(&mut self) -> &mut crate::RequestOptions {
13905            &mut self.0.options
13906        }
13907    }
13908
13909    /// The request builder for [Mirroring::test_iam_permissions][crate::client::Mirroring::test_iam_permissions] calls.
13910    ///
13911    /// # Example
13912    /// ```
13913    /// # use google_cloud_networksecurity_v1::builder::mirroring::TestIamPermissions;
13914    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13915    ///
13916    /// let builder = prepare_request_builder();
13917    /// let response = builder.send().await?;
13918    /// # Ok(()) }
13919    ///
13920    /// fn prepare_request_builder() -> TestIamPermissions {
13921    ///   # panic!();
13922    ///   // ... details omitted ...
13923    /// }
13924    /// ```
13925    #[derive(Clone, Debug)]
13926    pub struct TestIamPermissions(
13927        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
13928    );
13929
13930    impl TestIamPermissions {
13931        pub(crate) fn new(
13932            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
13933        ) -> Self {
13934            Self(RequestBuilder::new(stub))
13935        }
13936
13937        /// Sets the full request, replacing any prior values.
13938        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
13939            mut self,
13940            v: V,
13941        ) -> Self {
13942            self.0.request = v.into();
13943            self
13944        }
13945
13946        /// Sets all the options, replacing any prior values.
13947        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13948            self.0.options = v.into();
13949            self
13950        }
13951
13952        /// Sends the request.
13953        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
13954            (*self.0.stub)
13955                .test_iam_permissions(self.0.request, self.0.options)
13956                .await
13957                .map(crate::Response::into_body)
13958        }
13959
13960        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
13961        ///
13962        /// This is a **required** field for requests.
13963        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13964            self.0.request.resource = v.into();
13965            self
13966        }
13967
13968        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
13969        ///
13970        /// This is a **required** field for requests.
13971        pub fn set_permissions<T, V>(mut self, v: T) -> Self
13972        where
13973            T: std::iter::IntoIterator<Item = V>,
13974            V: std::convert::Into<std::string::String>,
13975        {
13976            use std::iter::Iterator;
13977            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
13978            self
13979        }
13980    }
13981
13982    #[doc(hidden)]
13983    impl crate::RequestBuilder for TestIamPermissions {
13984        fn request_options(&mut self) -> &mut crate::RequestOptions {
13985            &mut self.0.options
13986        }
13987    }
13988
13989    /// The request builder for [Mirroring::list_operations][crate::client::Mirroring::list_operations] calls.
13990    ///
13991    /// # Example
13992    /// ```
13993    /// # use google_cloud_networksecurity_v1::builder::mirroring::ListOperations;
13994    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
13995    /// use google_cloud_gax::paginator::ItemPaginator;
13996    ///
13997    /// let builder = prepare_request_builder();
13998    /// let mut items = builder.by_item();
13999    /// while let Some(result) = items.next().await {
14000    ///   let item = result?;
14001    /// }
14002    /// # Ok(()) }
14003    ///
14004    /// fn prepare_request_builder() -> ListOperations {
14005    ///   # panic!();
14006    ///   // ... details omitted ...
14007    /// }
14008    /// ```
14009    #[derive(Clone, Debug)]
14010    pub struct ListOperations(
14011        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
14012    );
14013
14014    impl ListOperations {
14015        pub(crate) fn new(
14016            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14017        ) -> Self {
14018            Self(RequestBuilder::new(stub))
14019        }
14020
14021        /// Sets the full request, replacing any prior values.
14022        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
14023            mut self,
14024            v: V,
14025        ) -> Self {
14026            self.0.request = v.into();
14027            self
14028        }
14029
14030        /// Sets all the options, replacing any prior values.
14031        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14032            self.0.options = v.into();
14033            self
14034        }
14035
14036        /// Sends the request.
14037        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
14038            (*self.0.stub)
14039                .list_operations(self.0.request, self.0.options)
14040                .await
14041                .map(crate::Response::into_body)
14042        }
14043
14044        /// Streams each page in the collection.
14045        pub fn by_page(
14046            self,
14047        ) -> impl google_cloud_gax::paginator::Paginator<
14048            google_cloud_longrunning::model::ListOperationsResponse,
14049            crate::Error,
14050        > {
14051            use std::clone::Clone;
14052            let token = self.0.request.page_token.clone();
14053            let execute = move |token: String| {
14054                let mut builder = self.clone();
14055                builder.0.request = builder.0.request.set_page_token(token);
14056                builder.send()
14057            };
14058            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14059        }
14060
14061        /// Streams each item in the collection.
14062        pub fn by_item(
14063            self,
14064        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14065            google_cloud_longrunning::model::ListOperationsResponse,
14066            crate::Error,
14067        > {
14068            use google_cloud_gax::paginator::Paginator;
14069            self.by_page().items()
14070        }
14071
14072        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
14073        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14074            self.0.request.name = v.into();
14075            self
14076        }
14077
14078        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
14079        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14080            self.0.request.filter = v.into();
14081            self
14082        }
14083
14084        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
14085        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14086            self.0.request.page_size = v.into();
14087            self
14088        }
14089
14090        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
14091        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14092            self.0.request.page_token = v.into();
14093            self
14094        }
14095
14096        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
14097        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14098            self.0.request.return_partial_success = v.into();
14099            self
14100        }
14101    }
14102
14103    #[doc(hidden)]
14104    impl crate::RequestBuilder for ListOperations {
14105        fn request_options(&mut self) -> &mut crate::RequestOptions {
14106            &mut self.0.options
14107        }
14108    }
14109
14110    /// The request builder for [Mirroring::get_operation][crate::client::Mirroring::get_operation] calls.
14111    ///
14112    /// # Example
14113    /// ```
14114    /// # use google_cloud_networksecurity_v1::builder::mirroring::GetOperation;
14115    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14116    ///
14117    /// let builder = prepare_request_builder();
14118    /// let response = builder.send().await?;
14119    /// # Ok(()) }
14120    ///
14121    /// fn prepare_request_builder() -> GetOperation {
14122    ///   # panic!();
14123    ///   // ... details omitted ...
14124    /// }
14125    /// ```
14126    #[derive(Clone, Debug)]
14127    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
14128
14129    impl GetOperation {
14130        pub(crate) fn new(
14131            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14132        ) -> Self {
14133            Self(RequestBuilder::new(stub))
14134        }
14135
14136        /// Sets the full request, replacing any prior values.
14137        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
14138            mut self,
14139            v: V,
14140        ) -> Self {
14141            self.0.request = v.into();
14142            self
14143        }
14144
14145        /// Sets all the options, replacing any prior values.
14146        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14147            self.0.options = v.into();
14148            self
14149        }
14150
14151        /// Sends the request.
14152        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14153            (*self.0.stub)
14154                .get_operation(self.0.request, self.0.options)
14155                .await
14156                .map(crate::Response::into_body)
14157        }
14158
14159        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
14160        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14161            self.0.request.name = v.into();
14162            self
14163        }
14164    }
14165
14166    #[doc(hidden)]
14167    impl crate::RequestBuilder for GetOperation {
14168        fn request_options(&mut self) -> &mut crate::RequestOptions {
14169            &mut self.0.options
14170        }
14171    }
14172
14173    /// The request builder for [Mirroring::delete_operation][crate::client::Mirroring::delete_operation] calls.
14174    ///
14175    /// # Example
14176    /// ```
14177    /// # use google_cloud_networksecurity_v1::builder::mirroring::DeleteOperation;
14178    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14179    ///
14180    /// let builder = prepare_request_builder();
14181    /// let response = builder.send().await?;
14182    /// # Ok(()) }
14183    ///
14184    /// fn prepare_request_builder() -> DeleteOperation {
14185    ///   # panic!();
14186    ///   // ... details omitted ...
14187    /// }
14188    /// ```
14189    #[derive(Clone, Debug)]
14190    pub struct DeleteOperation(
14191        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
14192    );
14193
14194    impl DeleteOperation {
14195        pub(crate) fn new(
14196            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14197        ) -> Self {
14198            Self(RequestBuilder::new(stub))
14199        }
14200
14201        /// Sets the full request, replacing any prior values.
14202        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
14203            mut self,
14204            v: V,
14205        ) -> Self {
14206            self.0.request = v.into();
14207            self
14208        }
14209
14210        /// Sets all the options, replacing any prior values.
14211        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14212            self.0.options = v.into();
14213            self
14214        }
14215
14216        /// Sends the request.
14217        pub async fn send(self) -> Result<()> {
14218            (*self.0.stub)
14219                .delete_operation(self.0.request, self.0.options)
14220                .await
14221                .map(crate::Response::into_body)
14222        }
14223
14224        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
14225        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14226            self.0.request.name = v.into();
14227            self
14228        }
14229    }
14230
14231    #[doc(hidden)]
14232    impl crate::RequestBuilder for DeleteOperation {
14233        fn request_options(&mut self) -> &mut crate::RequestOptions {
14234            &mut self.0.options
14235        }
14236    }
14237
14238    /// The request builder for [Mirroring::cancel_operation][crate::client::Mirroring::cancel_operation] calls.
14239    ///
14240    /// # Example
14241    /// ```
14242    /// # use google_cloud_networksecurity_v1::builder::mirroring::CancelOperation;
14243    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14244    ///
14245    /// let builder = prepare_request_builder();
14246    /// let response = builder.send().await?;
14247    /// # Ok(()) }
14248    ///
14249    /// fn prepare_request_builder() -> CancelOperation {
14250    ///   # panic!();
14251    ///   // ... details omitted ...
14252    /// }
14253    /// ```
14254    #[derive(Clone, Debug)]
14255    pub struct CancelOperation(
14256        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
14257    );
14258
14259    impl CancelOperation {
14260        pub(crate) fn new(
14261            stub: std::sync::Arc<dyn super::super::stub::dynamic::Mirroring>,
14262        ) -> Self {
14263            Self(RequestBuilder::new(stub))
14264        }
14265
14266        /// Sets the full request, replacing any prior values.
14267        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
14268            mut self,
14269            v: V,
14270        ) -> Self {
14271            self.0.request = v.into();
14272            self
14273        }
14274
14275        /// Sets all the options, replacing any prior values.
14276        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14277            self.0.options = v.into();
14278            self
14279        }
14280
14281        /// Sends the request.
14282        pub async fn send(self) -> Result<()> {
14283            (*self.0.stub)
14284                .cancel_operation(self.0.request, self.0.options)
14285                .await
14286                .map(crate::Response::into_body)
14287        }
14288
14289        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
14290        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14291            self.0.request.name = v.into();
14292            self
14293        }
14294    }
14295
14296    #[doc(hidden)]
14297    impl crate::RequestBuilder for CancelOperation {
14298        fn request_options(&mut self) -> &mut crate::RequestOptions {
14299            &mut self.0.options
14300        }
14301    }
14302}
14303
14304/// Request and client builders for [NetworkSecurity][crate::client::NetworkSecurity].
14305pub mod network_security {
14306    use crate::Result;
14307
14308    /// A builder for [NetworkSecurity][crate::client::NetworkSecurity].
14309    ///
14310    /// ```
14311    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14312    /// # use google_cloud_networksecurity_v1::*;
14313    /// # use builder::network_security::ClientBuilder;
14314    /// # use client::NetworkSecurity;
14315    /// let builder : ClientBuilder = NetworkSecurity::builder();
14316    /// let client = builder
14317    ///     .with_endpoint("https://networksecurity.googleapis.com")
14318    ///     .build().await?;
14319    /// # Ok(()) }
14320    /// ```
14321    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14322
14323    pub(crate) mod client {
14324        use super::super::super::client::NetworkSecurity;
14325        pub struct Factory;
14326        impl crate::ClientFactory for Factory {
14327            type Client = NetworkSecurity;
14328            type Credentials = gaxi::options::Credentials;
14329            async fn build(
14330                self,
14331                config: gaxi::options::ClientConfig,
14332            ) -> crate::ClientBuilderResult<Self::Client> {
14333                Self::Client::new(config).await
14334            }
14335        }
14336    }
14337
14338    /// Common implementation for [crate::client::NetworkSecurity] request builders.
14339    #[derive(Clone, Debug)]
14340    pub(crate) struct RequestBuilder<R: std::default::Default> {
14341        stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14342        request: R,
14343        options: crate::RequestOptions,
14344    }
14345
14346    impl<R> RequestBuilder<R>
14347    where
14348        R: std::default::Default,
14349    {
14350        pub(crate) fn new(
14351            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14352        ) -> Self {
14353            Self {
14354                stub,
14355                request: R::default(),
14356                options: crate::RequestOptions::default(),
14357            }
14358        }
14359    }
14360
14361    /// The request builder for [NetworkSecurity::list_authorization_policies][crate::client::NetworkSecurity::list_authorization_policies] calls.
14362    ///
14363    /// # Example
14364    /// ```
14365    /// # use google_cloud_networksecurity_v1::builder::network_security::ListAuthorizationPolicies;
14366    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14367    /// use google_cloud_gax::paginator::ItemPaginator;
14368    ///
14369    /// let builder = prepare_request_builder();
14370    /// let mut items = builder.by_item();
14371    /// while let Some(result) = items.next().await {
14372    ///   let item = result?;
14373    /// }
14374    /// # Ok(()) }
14375    ///
14376    /// fn prepare_request_builder() -> ListAuthorizationPolicies {
14377    ///   # panic!();
14378    ///   // ... details omitted ...
14379    /// }
14380    /// ```
14381    #[derive(Clone, Debug)]
14382    pub struct ListAuthorizationPolicies(
14383        RequestBuilder<crate::model::ListAuthorizationPoliciesRequest>,
14384    );
14385
14386    impl ListAuthorizationPolicies {
14387        pub(crate) fn new(
14388            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14389        ) -> Self {
14390            Self(RequestBuilder::new(stub))
14391        }
14392
14393        /// Sets the full request, replacing any prior values.
14394        pub fn with_request<V: Into<crate::model::ListAuthorizationPoliciesRequest>>(
14395            mut self,
14396            v: V,
14397        ) -> Self {
14398            self.0.request = v.into();
14399            self
14400        }
14401
14402        /// Sets all the options, replacing any prior values.
14403        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14404            self.0.options = v.into();
14405            self
14406        }
14407
14408        /// Sends the request.
14409        pub async fn send(self) -> Result<crate::model::ListAuthorizationPoliciesResponse> {
14410            (*self.0.stub)
14411                .list_authorization_policies(self.0.request, self.0.options)
14412                .await
14413                .map(crate::Response::into_body)
14414        }
14415
14416        /// Streams each page in the collection.
14417        pub fn by_page(
14418            self,
14419        ) -> impl google_cloud_gax::paginator::Paginator<
14420            crate::model::ListAuthorizationPoliciesResponse,
14421            crate::Error,
14422        > {
14423            use std::clone::Clone;
14424            let token = self.0.request.page_token.clone();
14425            let execute = move |token: String| {
14426                let mut builder = self.clone();
14427                builder.0.request = builder.0.request.set_page_token(token);
14428                builder.send()
14429            };
14430            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14431        }
14432
14433        /// Streams each item in the collection.
14434        pub fn by_item(
14435            self,
14436        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14437            crate::model::ListAuthorizationPoliciesResponse,
14438            crate::Error,
14439        > {
14440            use google_cloud_gax::paginator::Paginator;
14441            self.by_page().items()
14442        }
14443
14444        /// Sets the value of [parent][crate::model::ListAuthorizationPoliciesRequest::parent].
14445        ///
14446        /// This is a **required** field for requests.
14447        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14448            self.0.request.parent = v.into();
14449            self
14450        }
14451
14452        /// Sets the value of [page_size][crate::model::ListAuthorizationPoliciesRequest::page_size].
14453        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14454            self.0.request.page_size = v.into();
14455            self
14456        }
14457
14458        /// Sets the value of [page_token][crate::model::ListAuthorizationPoliciesRequest::page_token].
14459        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14460            self.0.request.page_token = v.into();
14461            self
14462        }
14463    }
14464
14465    #[doc(hidden)]
14466    impl crate::RequestBuilder for ListAuthorizationPolicies {
14467        fn request_options(&mut self) -> &mut crate::RequestOptions {
14468            &mut self.0.options
14469        }
14470    }
14471
14472    /// The request builder for [NetworkSecurity::get_authorization_policy][crate::client::NetworkSecurity::get_authorization_policy] calls.
14473    ///
14474    /// # Example
14475    /// ```
14476    /// # use google_cloud_networksecurity_v1::builder::network_security::GetAuthorizationPolicy;
14477    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14478    ///
14479    /// let builder = prepare_request_builder();
14480    /// let response = builder.send().await?;
14481    /// # Ok(()) }
14482    ///
14483    /// fn prepare_request_builder() -> GetAuthorizationPolicy {
14484    ///   # panic!();
14485    ///   // ... details omitted ...
14486    /// }
14487    /// ```
14488    #[derive(Clone, Debug)]
14489    pub struct GetAuthorizationPolicy(RequestBuilder<crate::model::GetAuthorizationPolicyRequest>);
14490
14491    impl GetAuthorizationPolicy {
14492        pub(crate) fn new(
14493            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14494        ) -> Self {
14495            Self(RequestBuilder::new(stub))
14496        }
14497
14498        /// Sets the full request, replacing any prior values.
14499        pub fn with_request<V: Into<crate::model::GetAuthorizationPolicyRequest>>(
14500            mut self,
14501            v: V,
14502        ) -> Self {
14503            self.0.request = v.into();
14504            self
14505        }
14506
14507        /// Sets all the options, replacing any prior values.
14508        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14509            self.0.options = v.into();
14510            self
14511        }
14512
14513        /// Sends the request.
14514        pub async fn send(self) -> Result<crate::model::AuthorizationPolicy> {
14515            (*self.0.stub)
14516                .get_authorization_policy(self.0.request, self.0.options)
14517                .await
14518                .map(crate::Response::into_body)
14519        }
14520
14521        /// Sets the value of [name][crate::model::GetAuthorizationPolicyRequest::name].
14522        ///
14523        /// This is a **required** field for requests.
14524        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14525            self.0.request.name = v.into();
14526            self
14527        }
14528    }
14529
14530    #[doc(hidden)]
14531    impl crate::RequestBuilder for GetAuthorizationPolicy {
14532        fn request_options(&mut self) -> &mut crate::RequestOptions {
14533            &mut self.0.options
14534        }
14535    }
14536
14537    /// The request builder for [NetworkSecurity::create_authorization_policy][crate::client::NetworkSecurity::create_authorization_policy] calls.
14538    ///
14539    /// # Example
14540    /// ```
14541    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateAuthorizationPolicy;
14542    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14543    /// use google_cloud_lro::Poller;
14544    ///
14545    /// let builder = prepare_request_builder();
14546    /// let response = builder.poller().until_done().await?;
14547    /// # Ok(()) }
14548    ///
14549    /// fn prepare_request_builder() -> CreateAuthorizationPolicy {
14550    ///   # panic!();
14551    ///   // ... details omitted ...
14552    /// }
14553    /// ```
14554    #[derive(Clone, Debug)]
14555    pub struct CreateAuthorizationPolicy(
14556        RequestBuilder<crate::model::CreateAuthorizationPolicyRequest>,
14557    );
14558
14559    impl CreateAuthorizationPolicy {
14560        pub(crate) fn new(
14561            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14562        ) -> Self {
14563            Self(RequestBuilder::new(stub))
14564        }
14565
14566        /// Sets the full request, replacing any prior values.
14567        pub fn with_request<V: Into<crate::model::CreateAuthorizationPolicyRequest>>(
14568            mut self,
14569            v: V,
14570        ) -> Self {
14571            self.0.request = v.into();
14572            self
14573        }
14574
14575        /// Sets all the options, replacing any prior values.
14576        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14577            self.0.options = v.into();
14578            self
14579        }
14580
14581        /// Sends the request.
14582        ///
14583        /// # Long running operations
14584        ///
14585        /// This starts, but does not poll, a longrunning operation. More information
14586        /// on [create_authorization_policy][crate::client::NetworkSecurity::create_authorization_policy].
14587        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14588            (*self.0.stub)
14589                .create_authorization_policy(self.0.request, self.0.options)
14590                .await
14591                .map(crate::Response::into_body)
14592        }
14593
14594        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_authorization_policy`.
14595        pub fn poller(
14596            self,
14597        ) -> impl google_cloud_lro::Poller<
14598            crate::model::AuthorizationPolicy,
14599            crate::model::OperationMetadata,
14600        > {
14601            type Operation = google_cloud_lro::internal::Operation<
14602                crate::model::AuthorizationPolicy,
14603                crate::model::OperationMetadata,
14604            >;
14605            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14606            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14607
14608            let stub = self.0.stub.clone();
14609            let mut options = self.0.options.clone();
14610            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14611            let query = move |name| {
14612                let stub = stub.clone();
14613                let options = options.clone();
14614                async {
14615                    let op = GetOperation::new(stub)
14616                        .set_name(name)
14617                        .with_options(options)
14618                        .send()
14619                        .await?;
14620                    Ok(Operation::new(op))
14621                }
14622            };
14623
14624            let start = move || async {
14625                let op = self.send().await?;
14626                Ok(Operation::new(op))
14627            };
14628
14629            google_cloud_lro::internal::new_poller(
14630                polling_error_policy,
14631                polling_backoff_policy,
14632                start,
14633                query,
14634            )
14635        }
14636
14637        /// Sets the value of [parent][crate::model::CreateAuthorizationPolicyRequest::parent].
14638        ///
14639        /// This is a **required** field for requests.
14640        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14641            self.0.request.parent = v.into();
14642            self
14643        }
14644
14645        /// Sets the value of [authorization_policy_id][crate::model::CreateAuthorizationPolicyRequest::authorization_policy_id].
14646        ///
14647        /// This is a **required** field for requests.
14648        pub fn set_authorization_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14649            self.0.request.authorization_policy_id = v.into();
14650            self
14651        }
14652
14653        /// Sets the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
14654        ///
14655        /// This is a **required** field for requests.
14656        pub fn set_authorization_policy<T>(mut self, v: T) -> Self
14657        where
14658            T: std::convert::Into<crate::model::AuthorizationPolicy>,
14659        {
14660            self.0.request.authorization_policy = std::option::Option::Some(v.into());
14661            self
14662        }
14663
14664        /// Sets or clears the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
14665        ///
14666        /// This is a **required** field for requests.
14667        pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
14668        where
14669            T: std::convert::Into<crate::model::AuthorizationPolicy>,
14670        {
14671            self.0.request.authorization_policy = v.map(|x| x.into());
14672            self
14673        }
14674    }
14675
14676    #[doc(hidden)]
14677    impl crate::RequestBuilder for CreateAuthorizationPolicy {
14678        fn request_options(&mut self) -> &mut crate::RequestOptions {
14679            &mut self.0.options
14680        }
14681    }
14682
14683    /// The request builder for [NetworkSecurity::update_authorization_policy][crate::client::NetworkSecurity::update_authorization_policy] calls.
14684    ///
14685    /// # Example
14686    /// ```
14687    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateAuthorizationPolicy;
14688    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14689    /// use google_cloud_lro::Poller;
14690    ///
14691    /// let builder = prepare_request_builder();
14692    /// let response = builder.poller().until_done().await?;
14693    /// # Ok(()) }
14694    ///
14695    /// fn prepare_request_builder() -> UpdateAuthorizationPolicy {
14696    ///   # panic!();
14697    ///   // ... details omitted ...
14698    /// }
14699    /// ```
14700    #[derive(Clone, Debug)]
14701    pub struct UpdateAuthorizationPolicy(
14702        RequestBuilder<crate::model::UpdateAuthorizationPolicyRequest>,
14703    );
14704
14705    impl UpdateAuthorizationPolicy {
14706        pub(crate) fn new(
14707            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14708        ) -> Self {
14709            Self(RequestBuilder::new(stub))
14710        }
14711
14712        /// Sets the full request, replacing any prior values.
14713        pub fn with_request<V: Into<crate::model::UpdateAuthorizationPolicyRequest>>(
14714            mut self,
14715            v: V,
14716        ) -> Self {
14717            self.0.request = v.into();
14718            self
14719        }
14720
14721        /// Sets all the options, replacing any prior values.
14722        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14723            self.0.options = v.into();
14724            self
14725        }
14726
14727        /// Sends the request.
14728        ///
14729        /// # Long running operations
14730        ///
14731        /// This starts, but does not poll, a longrunning operation. More information
14732        /// on [update_authorization_policy][crate::client::NetworkSecurity::update_authorization_policy].
14733        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14734            (*self.0.stub)
14735                .update_authorization_policy(self.0.request, self.0.options)
14736                .await
14737                .map(crate::Response::into_body)
14738        }
14739
14740        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_authorization_policy`.
14741        pub fn poller(
14742            self,
14743        ) -> impl google_cloud_lro::Poller<
14744            crate::model::AuthorizationPolicy,
14745            crate::model::OperationMetadata,
14746        > {
14747            type Operation = google_cloud_lro::internal::Operation<
14748                crate::model::AuthorizationPolicy,
14749                crate::model::OperationMetadata,
14750            >;
14751            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14752            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14753
14754            let stub = self.0.stub.clone();
14755            let mut options = self.0.options.clone();
14756            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14757            let query = move |name| {
14758                let stub = stub.clone();
14759                let options = options.clone();
14760                async {
14761                    let op = GetOperation::new(stub)
14762                        .set_name(name)
14763                        .with_options(options)
14764                        .send()
14765                        .await?;
14766                    Ok(Operation::new(op))
14767                }
14768            };
14769
14770            let start = move || async {
14771                let op = self.send().await?;
14772                Ok(Operation::new(op))
14773            };
14774
14775            google_cloud_lro::internal::new_poller(
14776                polling_error_policy,
14777                polling_backoff_policy,
14778                start,
14779                query,
14780            )
14781        }
14782
14783        /// Sets the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
14784        pub fn set_update_mask<T>(mut self, v: T) -> Self
14785        where
14786            T: std::convert::Into<wkt::FieldMask>,
14787        {
14788            self.0.request.update_mask = std::option::Option::Some(v.into());
14789            self
14790        }
14791
14792        /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
14793        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14794        where
14795            T: std::convert::Into<wkt::FieldMask>,
14796        {
14797            self.0.request.update_mask = v.map(|x| x.into());
14798            self
14799        }
14800
14801        /// Sets the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
14802        ///
14803        /// This is a **required** field for requests.
14804        pub fn set_authorization_policy<T>(mut self, v: T) -> Self
14805        where
14806            T: std::convert::Into<crate::model::AuthorizationPolicy>,
14807        {
14808            self.0.request.authorization_policy = std::option::Option::Some(v.into());
14809            self
14810        }
14811
14812        /// Sets or clears the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
14813        ///
14814        /// This is a **required** field for requests.
14815        pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
14816        where
14817            T: std::convert::Into<crate::model::AuthorizationPolicy>,
14818        {
14819            self.0.request.authorization_policy = v.map(|x| x.into());
14820            self
14821        }
14822    }
14823
14824    #[doc(hidden)]
14825    impl crate::RequestBuilder for UpdateAuthorizationPolicy {
14826        fn request_options(&mut self) -> &mut crate::RequestOptions {
14827            &mut self.0.options
14828        }
14829    }
14830
14831    /// The request builder for [NetworkSecurity::delete_authorization_policy][crate::client::NetworkSecurity::delete_authorization_policy] calls.
14832    ///
14833    /// # Example
14834    /// ```
14835    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteAuthorizationPolicy;
14836    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14837    /// use google_cloud_lro::Poller;
14838    ///
14839    /// let builder = prepare_request_builder();
14840    /// let response = builder.poller().until_done().await?;
14841    /// # Ok(()) }
14842    ///
14843    /// fn prepare_request_builder() -> DeleteAuthorizationPolicy {
14844    ///   # panic!();
14845    ///   // ... details omitted ...
14846    /// }
14847    /// ```
14848    #[derive(Clone, Debug)]
14849    pub struct DeleteAuthorizationPolicy(
14850        RequestBuilder<crate::model::DeleteAuthorizationPolicyRequest>,
14851    );
14852
14853    impl DeleteAuthorizationPolicy {
14854        pub(crate) fn new(
14855            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14856        ) -> Self {
14857            Self(RequestBuilder::new(stub))
14858        }
14859
14860        /// Sets the full request, replacing any prior values.
14861        pub fn with_request<V: Into<crate::model::DeleteAuthorizationPolicyRequest>>(
14862            mut self,
14863            v: V,
14864        ) -> Self {
14865            self.0.request = v.into();
14866            self
14867        }
14868
14869        /// Sets all the options, replacing any prior values.
14870        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14871            self.0.options = v.into();
14872            self
14873        }
14874
14875        /// Sends the request.
14876        ///
14877        /// # Long running operations
14878        ///
14879        /// This starts, but does not poll, a longrunning operation. More information
14880        /// on [delete_authorization_policy][crate::client::NetworkSecurity::delete_authorization_policy].
14881        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14882            (*self.0.stub)
14883                .delete_authorization_policy(self.0.request, self.0.options)
14884                .await
14885                .map(crate::Response::into_body)
14886        }
14887
14888        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_authorization_policy`.
14889        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
14890            type Operation =
14891                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14892            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14893            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14894
14895            let stub = self.0.stub.clone();
14896            let mut options = self.0.options.clone();
14897            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14898            let query = move |name| {
14899                let stub = stub.clone();
14900                let options = options.clone();
14901                async {
14902                    let op = GetOperation::new(stub)
14903                        .set_name(name)
14904                        .with_options(options)
14905                        .send()
14906                        .await?;
14907                    Ok(Operation::new(op))
14908                }
14909            };
14910
14911            let start = move || async {
14912                let op = self.send().await?;
14913                Ok(Operation::new(op))
14914            };
14915
14916            google_cloud_lro::internal::new_unit_response_poller(
14917                polling_error_policy,
14918                polling_backoff_policy,
14919                start,
14920                query,
14921            )
14922        }
14923
14924        /// Sets the value of [name][crate::model::DeleteAuthorizationPolicyRequest::name].
14925        ///
14926        /// This is a **required** field for requests.
14927        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14928            self.0.request.name = v.into();
14929            self
14930        }
14931    }
14932
14933    #[doc(hidden)]
14934    impl crate::RequestBuilder for DeleteAuthorizationPolicy {
14935        fn request_options(&mut self) -> &mut crate::RequestOptions {
14936            &mut self.0.options
14937        }
14938    }
14939
14940    /// The request builder for [NetworkSecurity::list_backend_authentication_configs][crate::client::NetworkSecurity::list_backend_authentication_configs] calls.
14941    ///
14942    /// # Example
14943    /// ```
14944    /// # use google_cloud_networksecurity_v1::builder::network_security::ListBackendAuthenticationConfigs;
14945    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
14946    /// use google_cloud_gax::paginator::ItemPaginator;
14947    ///
14948    /// let builder = prepare_request_builder();
14949    /// let mut items = builder.by_item();
14950    /// while let Some(result) = items.next().await {
14951    ///   let item = result?;
14952    /// }
14953    /// # Ok(()) }
14954    ///
14955    /// fn prepare_request_builder() -> ListBackendAuthenticationConfigs {
14956    ///   # panic!();
14957    ///   // ... details omitted ...
14958    /// }
14959    /// ```
14960    #[derive(Clone, Debug)]
14961    pub struct ListBackendAuthenticationConfigs(
14962        RequestBuilder<crate::model::ListBackendAuthenticationConfigsRequest>,
14963    );
14964
14965    impl ListBackendAuthenticationConfigs {
14966        pub(crate) fn new(
14967            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
14968        ) -> Self {
14969            Self(RequestBuilder::new(stub))
14970        }
14971
14972        /// Sets the full request, replacing any prior values.
14973        pub fn with_request<V: Into<crate::model::ListBackendAuthenticationConfigsRequest>>(
14974            mut self,
14975            v: V,
14976        ) -> Self {
14977            self.0.request = v.into();
14978            self
14979        }
14980
14981        /// Sets all the options, replacing any prior values.
14982        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14983            self.0.options = v.into();
14984            self
14985        }
14986
14987        /// Sends the request.
14988        pub async fn send(self) -> Result<crate::model::ListBackendAuthenticationConfigsResponse> {
14989            (*self.0.stub)
14990                .list_backend_authentication_configs(self.0.request, self.0.options)
14991                .await
14992                .map(crate::Response::into_body)
14993        }
14994
14995        /// Streams each page in the collection.
14996        pub fn by_page(
14997            self,
14998        ) -> impl google_cloud_gax::paginator::Paginator<
14999            crate::model::ListBackendAuthenticationConfigsResponse,
15000            crate::Error,
15001        > {
15002            use std::clone::Clone;
15003            let token = self.0.request.page_token.clone();
15004            let execute = move |token: String| {
15005                let mut builder = self.clone();
15006                builder.0.request = builder.0.request.set_page_token(token);
15007                builder.send()
15008            };
15009            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15010        }
15011
15012        /// Streams each item in the collection.
15013        pub fn by_item(
15014            self,
15015        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15016            crate::model::ListBackendAuthenticationConfigsResponse,
15017            crate::Error,
15018        > {
15019            use google_cloud_gax::paginator::Paginator;
15020            self.by_page().items()
15021        }
15022
15023        /// Sets the value of [parent][crate::model::ListBackendAuthenticationConfigsRequest::parent].
15024        ///
15025        /// This is a **required** field for requests.
15026        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15027            self.0.request.parent = v.into();
15028            self
15029        }
15030
15031        /// Sets the value of [page_size][crate::model::ListBackendAuthenticationConfigsRequest::page_size].
15032        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15033            self.0.request.page_size = v.into();
15034            self
15035        }
15036
15037        /// Sets the value of [page_token][crate::model::ListBackendAuthenticationConfigsRequest::page_token].
15038        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15039            self.0.request.page_token = v.into();
15040            self
15041        }
15042    }
15043
15044    #[doc(hidden)]
15045    impl crate::RequestBuilder for ListBackendAuthenticationConfigs {
15046        fn request_options(&mut self) -> &mut crate::RequestOptions {
15047            &mut self.0.options
15048        }
15049    }
15050
15051    /// The request builder for [NetworkSecurity::get_backend_authentication_config][crate::client::NetworkSecurity::get_backend_authentication_config] calls.
15052    ///
15053    /// # Example
15054    /// ```
15055    /// # use google_cloud_networksecurity_v1::builder::network_security::GetBackendAuthenticationConfig;
15056    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15057    ///
15058    /// let builder = prepare_request_builder();
15059    /// let response = builder.send().await?;
15060    /// # Ok(()) }
15061    ///
15062    /// fn prepare_request_builder() -> GetBackendAuthenticationConfig {
15063    ///   # panic!();
15064    ///   // ... details omitted ...
15065    /// }
15066    /// ```
15067    #[derive(Clone, Debug)]
15068    pub struct GetBackendAuthenticationConfig(
15069        RequestBuilder<crate::model::GetBackendAuthenticationConfigRequest>,
15070    );
15071
15072    impl GetBackendAuthenticationConfig {
15073        pub(crate) fn new(
15074            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15075        ) -> Self {
15076            Self(RequestBuilder::new(stub))
15077        }
15078
15079        /// Sets the full request, replacing any prior values.
15080        pub fn with_request<V: Into<crate::model::GetBackendAuthenticationConfigRequest>>(
15081            mut self,
15082            v: V,
15083        ) -> Self {
15084            self.0.request = v.into();
15085            self
15086        }
15087
15088        /// Sets all the options, replacing any prior values.
15089        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15090            self.0.options = v.into();
15091            self
15092        }
15093
15094        /// Sends the request.
15095        pub async fn send(self) -> Result<crate::model::BackendAuthenticationConfig> {
15096            (*self.0.stub)
15097                .get_backend_authentication_config(self.0.request, self.0.options)
15098                .await
15099                .map(crate::Response::into_body)
15100        }
15101
15102        /// Sets the value of [name][crate::model::GetBackendAuthenticationConfigRequest::name].
15103        ///
15104        /// This is a **required** field for requests.
15105        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15106            self.0.request.name = v.into();
15107            self
15108        }
15109    }
15110
15111    #[doc(hidden)]
15112    impl crate::RequestBuilder for GetBackendAuthenticationConfig {
15113        fn request_options(&mut self) -> &mut crate::RequestOptions {
15114            &mut self.0.options
15115        }
15116    }
15117
15118    /// The request builder for [NetworkSecurity::create_backend_authentication_config][crate::client::NetworkSecurity::create_backend_authentication_config] calls.
15119    ///
15120    /// # Example
15121    /// ```
15122    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateBackendAuthenticationConfig;
15123    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15124    /// use google_cloud_lro::Poller;
15125    ///
15126    /// let builder = prepare_request_builder();
15127    /// let response = builder.poller().until_done().await?;
15128    /// # Ok(()) }
15129    ///
15130    /// fn prepare_request_builder() -> CreateBackendAuthenticationConfig {
15131    ///   # panic!();
15132    ///   // ... details omitted ...
15133    /// }
15134    /// ```
15135    #[derive(Clone, Debug)]
15136    pub struct CreateBackendAuthenticationConfig(
15137        RequestBuilder<crate::model::CreateBackendAuthenticationConfigRequest>,
15138    );
15139
15140    impl CreateBackendAuthenticationConfig {
15141        pub(crate) fn new(
15142            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15143        ) -> Self {
15144            Self(RequestBuilder::new(stub))
15145        }
15146
15147        /// Sets the full request, replacing any prior values.
15148        pub fn with_request<V: Into<crate::model::CreateBackendAuthenticationConfigRequest>>(
15149            mut self,
15150            v: V,
15151        ) -> Self {
15152            self.0.request = v.into();
15153            self
15154        }
15155
15156        /// Sets all the options, replacing any prior values.
15157        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15158            self.0.options = v.into();
15159            self
15160        }
15161
15162        /// Sends the request.
15163        ///
15164        /// # Long running operations
15165        ///
15166        /// This starts, but does not poll, a longrunning operation. More information
15167        /// on [create_backend_authentication_config][crate::client::NetworkSecurity::create_backend_authentication_config].
15168        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15169            (*self.0.stub)
15170                .create_backend_authentication_config(self.0.request, self.0.options)
15171                .await
15172                .map(crate::Response::into_body)
15173        }
15174
15175        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_backend_authentication_config`.
15176        pub fn poller(
15177            self,
15178        ) -> impl google_cloud_lro::Poller<
15179            crate::model::BackendAuthenticationConfig,
15180            crate::model::OperationMetadata,
15181        > {
15182            type Operation = google_cloud_lro::internal::Operation<
15183                crate::model::BackendAuthenticationConfig,
15184                crate::model::OperationMetadata,
15185            >;
15186            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15187            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15188
15189            let stub = self.0.stub.clone();
15190            let mut options = self.0.options.clone();
15191            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15192            let query = move |name| {
15193                let stub = stub.clone();
15194                let options = options.clone();
15195                async {
15196                    let op = GetOperation::new(stub)
15197                        .set_name(name)
15198                        .with_options(options)
15199                        .send()
15200                        .await?;
15201                    Ok(Operation::new(op))
15202                }
15203            };
15204
15205            let start = move || async {
15206                let op = self.send().await?;
15207                Ok(Operation::new(op))
15208            };
15209
15210            google_cloud_lro::internal::new_poller(
15211                polling_error_policy,
15212                polling_backoff_policy,
15213                start,
15214                query,
15215            )
15216        }
15217
15218        /// Sets the value of [parent][crate::model::CreateBackendAuthenticationConfigRequest::parent].
15219        ///
15220        /// This is a **required** field for requests.
15221        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15222            self.0.request.parent = v.into();
15223            self
15224        }
15225
15226        /// Sets the value of [backend_authentication_config_id][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config_id].
15227        ///
15228        /// This is a **required** field for requests.
15229        pub fn set_backend_authentication_config_id<T: Into<std::string::String>>(
15230            mut self,
15231            v: T,
15232        ) -> Self {
15233            self.0.request.backend_authentication_config_id = v.into();
15234            self
15235        }
15236
15237        /// Sets the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
15238        ///
15239        /// This is a **required** field for requests.
15240        pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
15241        where
15242            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15243        {
15244            self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
15245            self
15246        }
15247
15248        /// Sets or clears the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
15249        ///
15250        /// This is a **required** field for requests.
15251        pub fn set_or_clear_backend_authentication_config<T>(
15252            mut self,
15253            v: std::option::Option<T>,
15254        ) -> Self
15255        where
15256            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15257        {
15258            self.0.request.backend_authentication_config = v.map(|x| x.into());
15259            self
15260        }
15261    }
15262
15263    #[doc(hidden)]
15264    impl crate::RequestBuilder for CreateBackendAuthenticationConfig {
15265        fn request_options(&mut self) -> &mut crate::RequestOptions {
15266            &mut self.0.options
15267        }
15268    }
15269
15270    /// The request builder for [NetworkSecurity::update_backend_authentication_config][crate::client::NetworkSecurity::update_backend_authentication_config] calls.
15271    ///
15272    /// # Example
15273    /// ```
15274    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateBackendAuthenticationConfig;
15275    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15276    /// use google_cloud_lro::Poller;
15277    ///
15278    /// let builder = prepare_request_builder();
15279    /// let response = builder.poller().until_done().await?;
15280    /// # Ok(()) }
15281    ///
15282    /// fn prepare_request_builder() -> UpdateBackendAuthenticationConfig {
15283    ///   # panic!();
15284    ///   // ... details omitted ...
15285    /// }
15286    /// ```
15287    #[derive(Clone, Debug)]
15288    pub struct UpdateBackendAuthenticationConfig(
15289        RequestBuilder<crate::model::UpdateBackendAuthenticationConfigRequest>,
15290    );
15291
15292    impl UpdateBackendAuthenticationConfig {
15293        pub(crate) fn new(
15294            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15295        ) -> Self {
15296            Self(RequestBuilder::new(stub))
15297        }
15298
15299        /// Sets the full request, replacing any prior values.
15300        pub fn with_request<V: Into<crate::model::UpdateBackendAuthenticationConfigRequest>>(
15301            mut self,
15302            v: V,
15303        ) -> Self {
15304            self.0.request = v.into();
15305            self
15306        }
15307
15308        /// Sets all the options, replacing any prior values.
15309        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15310            self.0.options = v.into();
15311            self
15312        }
15313
15314        /// Sends the request.
15315        ///
15316        /// # Long running operations
15317        ///
15318        /// This starts, but does not poll, a longrunning operation. More information
15319        /// on [update_backend_authentication_config][crate::client::NetworkSecurity::update_backend_authentication_config].
15320        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15321            (*self.0.stub)
15322                .update_backend_authentication_config(self.0.request, self.0.options)
15323                .await
15324                .map(crate::Response::into_body)
15325        }
15326
15327        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_backend_authentication_config`.
15328        pub fn poller(
15329            self,
15330        ) -> impl google_cloud_lro::Poller<
15331            crate::model::BackendAuthenticationConfig,
15332            crate::model::OperationMetadata,
15333        > {
15334            type Operation = google_cloud_lro::internal::Operation<
15335                crate::model::BackendAuthenticationConfig,
15336                crate::model::OperationMetadata,
15337            >;
15338            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15339            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15340
15341            let stub = self.0.stub.clone();
15342            let mut options = self.0.options.clone();
15343            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15344            let query = move |name| {
15345                let stub = stub.clone();
15346                let options = options.clone();
15347                async {
15348                    let op = GetOperation::new(stub)
15349                        .set_name(name)
15350                        .with_options(options)
15351                        .send()
15352                        .await?;
15353                    Ok(Operation::new(op))
15354                }
15355            };
15356
15357            let start = move || async {
15358                let op = self.send().await?;
15359                Ok(Operation::new(op))
15360            };
15361
15362            google_cloud_lro::internal::new_poller(
15363                polling_error_policy,
15364                polling_backoff_policy,
15365                start,
15366                query,
15367            )
15368        }
15369
15370        /// Sets the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
15371        pub fn set_update_mask<T>(mut self, v: T) -> Self
15372        where
15373            T: std::convert::Into<wkt::FieldMask>,
15374        {
15375            self.0.request.update_mask = std::option::Option::Some(v.into());
15376            self
15377        }
15378
15379        /// Sets or clears the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
15380        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15381        where
15382            T: std::convert::Into<wkt::FieldMask>,
15383        {
15384            self.0.request.update_mask = v.map(|x| x.into());
15385            self
15386        }
15387
15388        /// Sets the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
15389        ///
15390        /// This is a **required** field for requests.
15391        pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
15392        where
15393            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15394        {
15395            self.0.request.backend_authentication_config = std::option::Option::Some(v.into());
15396            self
15397        }
15398
15399        /// Sets or clears the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
15400        ///
15401        /// This is a **required** field for requests.
15402        pub fn set_or_clear_backend_authentication_config<T>(
15403            mut self,
15404            v: std::option::Option<T>,
15405        ) -> Self
15406        where
15407            T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
15408        {
15409            self.0.request.backend_authentication_config = v.map(|x| x.into());
15410            self
15411        }
15412    }
15413
15414    #[doc(hidden)]
15415    impl crate::RequestBuilder for UpdateBackendAuthenticationConfig {
15416        fn request_options(&mut self) -> &mut crate::RequestOptions {
15417            &mut self.0.options
15418        }
15419    }
15420
15421    /// The request builder for [NetworkSecurity::delete_backend_authentication_config][crate::client::NetworkSecurity::delete_backend_authentication_config] calls.
15422    ///
15423    /// # Example
15424    /// ```
15425    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteBackendAuthenticationConfig;
15426    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15427    /// use google_cloud_lro::Poller;
15428    ///
15429    /// let builder = prepare_request_builder();
15430    /// let response = builder.poller().until_done().await?;
15431    /// # Ok(()) }
15432    ///
15433    /// fn prepare_request_builder() -> DeleteBackendAuthenticationConfig {
15434    ///   # panic!();
15435    ///   // ... details omitted ...
15436    /// }
15437    /// ```
15438    #[derive(Clone, Debug)]
15439    pub struct DeleteBackendAuthenticationConfig(
15440        RequestBuilder<crate::model::DeleteBackendAuthenticationConfigRequest>,
15441    );
15442
15443    impl DeleteBackendAuthenticationConfig {
15444        pub(crate) fn new(
15445            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15446        ) -> Self {
15447            Self(RequestBuilder::new(stub))
15448        }
15449
15450        /// Sets the full request, replacing any prior values.
15451        pub fn with_request<V: Into<crate::model::DeleteBackendAuthenticationConfigRequest>>(
15452            mut self,
15453            v: V,
15454        ) -> Self {
15455            self.0.request = v.into();
15456            self
15457        }
15458
15459        /// Sets all the options, replacing any prior values.
15460        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15461            self.0.options = v.into();
15462            self
15463        }
15464
15465        /// Sends the request.
15466        ///
15467        /// # Long running operations
15468        ///
15469        /// This starts, but does not poll, a longrunning operation. More information
15470        /// on [delete_backend_authentication_config][crate::client::NetworkSecurity::delete_backend_authentication_config].
15471        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15472            (*self.0.stub)
15473                .delete_backend_authentication_config(self.0.request, self.0.options)
15474                .await
15475                .map(crate::Response::into_body)
15476        }
15477
15478        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_backend_authentication_config`.
15479        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
15480            type Operation =
15481                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15482            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15483            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15484
15485            let stub = self.0.stub.clone();
15486            let mut options = self.0.options.clone();
15487            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15488            let query = move |name| {
15489                let stub = stub.clone();
15490                let options = options.clone();
15491                async {
15492                    let op = GetOperation::new(stub)
15493                        .set_name(name)
15494                        .with_options(options)
15495                        .send()
15496                        .await?;
15497                    Ok(Operation::new(op))
15498                }
15499            };
15500
15501            let start = move || async {
15502                let op = self.send().await?;
15503                Ok(Operation::new(op))
15504            };
15505
15506            google_cloud_lro::internal::new_unit_response_poller(
15507                polling_error_policy,
15508                polling_backoff_policy,
15509                start,
15510                query,
15511            )
15512        }
15513
15514        /// Sets the value of [name][crate::model::DeleteBackendAuthenticationConfigRequest::name].
15515        ///
15516        /// This is a **required** field for requests.
15517        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15518            self.0.request.name = v.into();
15519            self
15520        }
15521
15522        /// Sets the value of [etag][crate::model::DeleteBackendAuthenticationConfigRequest::etag].
15523        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
15524            self.0.request.etag = v.into();
15525            self
15526        }
15527    }
15528
15529    #[doc(hidden)]
15530    impl crate::RequestBuilder for DeleteBackendAuthenticationConfig {
15531        fn request_options(&mut self) -> &mut crate::RequestOptions {
15532            &mut self.0.options
15533        }
15534    }
15535
15536    /// The request builder for [NetworkSecurity::list_server_tls_policies][crate::client::NetworkSecurity::list_server_tls_policies] calls.
15537    ///
15538    /// # Example
15539    /// ```
15540    /// # use google_cloud_networksecurity_v1::builder::network_security::ListServerTlsPolicies;
15541    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15542    /// use google_cloud_gax::paginator::ItemPaginator;
15543    ///
15544    /// let builder = prepare_request_builder();
15545    /// let mut items = builder.by_item();
15546    /// while let Some(result) = items.next().await {
15547    ///   let item = result?;
15548    /// }
15549    /// # Ok(()) }
15550    ///
15551    /// fn prepare_request_builder() -> ListServerTlsPolicies {
15552    ///   # panic!();
15553    ///   // ... details omitted ...
15554    /// }
15555    /// ```
15556    #[derive(Clone, Debug)]
15557    pub struct ListServerTlsPolicies(RequestBuilder<crate::model::ListServerTlsPoliciesRequest>);
15558
15559    impl ListServerTlsPolicies {
15560        pub(crate) fn new(
15561            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15562        ) -> Self {
15563            Self(RequestBuilder::new(stub))
15564        }
15565
15566        /// Sets the full request, replacing any prior values.
15567        pub fn with_request<V: Into<crate::model::ListServerTlsPoliciesRequest>>(
15568            mut self,
15569            v: V,
15570        ) -> Self {
15571            self.0.request = v.into();
15572            self
15573        }
15574
15575        /// Sets all the options, replacing any prior values.
15576        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15577            self.0.options = v.into();
15578            self
15579        }
15580
15581        /// Sends the request.
15582        pub async fn send(self) -> Result<crate::model::ListServerTlsPoliciesResponse> {
15583            (*self.0.stub)
15584                .list_server_tls_policies(self.0.request, self.0.options)
15585                .await
15586                .map(crate::Response::into_body)
15587        }
15588
15589        /// Streams each page in the collection.
15590        pub fn by_page(
15591            self,
15592        ) -> impl google_cloud_gax::paginator::Paginator<
15593            crate::model::ListServerTlsPoliciesResponse,
15594            crate::Error,
15595        > {
15596            use std::clone::Clone;
15597            let token = self.0.request.page_token.clone();
15598            let execute = move |token: String| {
15599                let mut builder = self.clone();
15600                builder.0.request = builder.0.request.set_page_token(token);
15601                builder.send()
15602            };
15603            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15604        }
15605
15606        /// Streams each item in the collection.
15607        pub fn by_item(
15608            self,
15609        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15610            crate::model::ListServerTlsPoliciesResponse,
15611            crate::Error,
15612        > {
15613            use google_cloud_gax::paginator::Paginator;
15614            self.by_page().items()
15615        }
15616
15617        /// Sets the value of [parent][crate::model::ListServerTlsPoliciesRequest::parent].
15618        ///
15619        /// This is a **required** field for requests.
15620        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15621            self.0.request.parent = v.into();
15622            self
15623        }
15624
15625        /// Sets the value of [page_size][crate::model::ListServerTlsPoliciesRequest::page_size].
15626        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15627            self.0.request.page_size = v.into();
15628            self
15629        }
15630
15631        /// Sets the value of [page_token][crate::model::ListServerTlsPoliciesRequest::page_token].
15632        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15633            self.0.request.page_token = v.into();
15634            self
15635        }
15636
15637        /// Sets the value of [return_partial_success][crate::model::ListServerTlsPoliciesRequest::return_partial_success].
15638        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15639            self.0.request.return_partial_success = v.into();
15640            self
15641        }
15642    }
15643
15644    #[doc(hidden)]
15645    impl crate::RequestBuilder for ListServerTlsPolicies {
15646        fn request_options(&mut self) -> &mut crate::RequestOptions {
15647            &mut self.0.options
15648        }
15649    }
15650
15651    /// The request builder for [NetworkSecurity::get_server_tls_policy][crate::client::NetworkSecurity::get_server_tls_policy] calls.
15652    ///
15653    /// # Example
15654    /// ```
15655    /// # use google_cloud_networksecurity_v1::builder::network_security::GetServerTlsPolicy;
15656    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15657    ///
15658    /// let builder = prepare_request_builder();
15659    /// let response = builder.send().await?;
15660    /// # Ok(()) }
15661    ///
15662    /// fn prepare_request_builder() -> GetServerTlsPolicy {
15663    ///   # panic!();
15664    ///   // ... details omitted ...
15665    /// }
15666    /// ```
15667    #[derive(Clone, Debug)]
15668    pub struct GetServerTlsPolicy(RequestBuilder<crate::model::GetServerTlsPolicyRequest>);
15669
15670    impl GetServerTlsPolicy {
15671        pub(crate) fn new(
15672            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15673        ) -> Self {
15674            Self(RequestBuilder::new(stub))
15675        }
15676
15677        /// Sets the full request, replacing any prior values.
15678        pub fn with_request<V: Into<crate::model::GetServerTlsPolicyRequest>>(
15679            mut self,
15680            v: V,
15681        ) -> Self {
15682            self.0.request = v.into();
15683            self
15684        }
15685
15686        /// Sets all the options, replacing any prior values.
15687        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15688            self.0.options = v.into();
15689            self
15690        }
15691
15692        /// Sends the request.
15693        pub async fn send(self) -> Result<crate::model::ServerTlsPolicy> {
15694            (*self.0.stub)
15695                .get_server_tls_policy(self.0.request, self.0.options)
15696                .await
15697                .map(crate::Response::into_body)
15698        }
15699
15700        /// Sets the value of [name][crate::model::GetServerTlsPolicyRequest::name].
15701        ///
15702        /// This is a **required** field for requests.
15703        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15704            self.0.request.name = v.into();
15705            self
15706        }
15707    }
15708
15709    #[doc(hidden)]
15710    impl crate::RequestBuilder for GetServerTlsPolicy {
15711        fn request_options(&mut self) -> &mut crate::RequestOptions {
15712            &mut self.0.options
15713        }
15714    }
15715
15716    /// The request builder for [NetworkSecurity::create_server_tls_policy][crate::client::NetworkSecurity::create_server_tls_policy] calls.
15717    ///
15718    /// # Example
15719    /// ```
15720    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateServerTlsPolicy;
15721    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15722    /// use google_cloud_lro::Poller;
15723    ///
15724    /// let builder = prepare_request_builder();
15725    /// let response = builder.poller().until_done().await?;
15726    /// # Ok(()) }
15727    ///
15728    /// fn prepare_request_builder() -> CreateServerTlsPolicy {
15729    ///   # panic!();
15730    ///   // ... details omitted ...
15731    /// }
15732    /// ```
15733    #[derive(Clone, Debug)]
15734    pub struct CreateServerTlsPolicy(RequestBuilder<crate::model::CreateServerTlsPolicyRequest>);
15735
15736    impl CreateServerTlsPolicy {
15737        pub(crate) fn new(
15738            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15739        ) -> Self {
15740            Self(RequestBuilder::new(stub))
15741        }
15742
15743        /// Sets the full request, replacing any prior values.
15744        pub fn with_request<V: Into<crate::model::CreateServerTlsPolicyRequest>>(
15745            mut self,
15746            v: V,
15747        ) -> Self {
15748            self.0.request = v.into();
15749            self
15750        }
15751
15752        /// Sets all the options, replacing any prior values.
15753        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15754            self.0.options = v.into();
15755            self
15756        }
15757
15758        /// Sends the request.
15759        ///
15760        /// # Long running operations
15761        ///
15762        /// This starts, but does not poll, a longrunning operation. More information
15763        /// on [create_server_tls_policy][crate::client::NetworkSecurity::create_server_tls_policy].
15764        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15765            (*self.0.stub)
15766                .create_server_tls_policy(self.0.request, self.0.options)
15767                .await
15768                .map(crate::Response::into_body)
15769        }
15770
15771        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_server_tls_policy`.
15772        pub fn poller(
15773            self,
15774        ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
15775        {
15776            type Operation = google_cloud_lro::internal::Operation<
15777                crate::model::ServerTlsPolicy,
15778                crate::model::OperationMetadata,
15779            >;
15780            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15781            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15782
15783            let stub = self.0.stub.clone();
15784            let mut options = self.0.options.clone();
15785            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15786            let query = move |name| {
15787                let stub = stub.clone();
15788                let options = options.clone();
15789                async {
15790                    let op = GetOperation::new(stub)
15791                        .set_name(name)
15792                        .with_options(options)
15793                        .send()
15794                        .await?;
15795                    Ok(Operation::new(op))
15796                }
15797            };
15798
15799            let start = move || async {
15800                let op = self.send().await?;
15801                Ok(Operation::new(op))
15802            };
15803
15804            google_cloud_lro::internal::new_poller(
15805                polling_error_policy,
15806                polling_backoff_policy,
15807                start,
15808                query,
15809            )
15810        }
15811
15812        /// Sets the value of [parent][crate::model::CreateServerTlsPolicyRequest::parent].
15813        ///
15814        /// This is a **required** field for requests.
15815        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15816            self.0.request.parent = v.into();
15817            self
15818        }
15819
15820        /// Sets the value of [server_tls_policy_id][crate::model::CreateServerTlsPolicyRequest::server_tls_policy_id].
15821        ///
15822        /// This is a **required** field for requests.
15823        pub fn set_server_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15824            self.0.request.server_tls_policy_id = v.into();
15825            self
15826        }
15827
15828        /// Sets the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
15829        ///
15830        /// This is a **required** field for requests.
15831        pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
15832        where
15833            T: std::convert::Into<crate::model::ServerTlsPolicy>,
15834        {
15835            self.0.request.server_tls_policy = std::option::Option::Some(v.into());
15836            self
15837        }
15838
15839        /// Sets or clears the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
15840        ///
15841        /// This is a **required** field for requests.
15842        pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15843        where
15844            T: std::convert::Into<crate::model::ServerTlsPolicy>,
15845        {
15846            self.0.request.server_tls_policy = v.map(|x| x.into());
15847            self
15848        }
15849    }
15850
15851    #[doc(hidden)]
15852    impl crate::RequestBuilder for CreateServerTlsPolicy {
15853        fn request_options(&mut self) -> &mut crate::RequestOptions {
15854            &mut self.0.options
15855        }
15856    }
15857
15858    /// The request builder for [NetworkSecurity::update_server_tls_policy][crate::client::NetworkSecurity::update_server_tls_policy] calls.
15859    ///
15860    /// # Example
15861    /// ```
15862    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateServerTlsPolicy;
15863    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
15864    /// use google_cloud_lro::Poller;
15865    ///
15866    /// let builder = prepare_request_builder();
15867    /// let response = builder.poller().until_done().await?;
15868    /// # Ok(()) }
15869    ///
15870    /// fn prepare_request_builder() -> UpdateServerTlsPolicy {
15871    ///   # panic!();
15872    ///   // ... details omitted ...
15873    /// }
15874    /// ```
15875    #[derive(Clone, Debug)]
15876    pub struct UpdateServerTlsPolicy(RequestBuilder<crate::model::UpdateServerTlsPolicyRequest>);
15877
15878    impl UpdateServerTlsPolicy {
15879        pub(crate) fn new(
15880            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
15881        ) -> Self {
15882            Self(RequestBuilder::new(stub))
15883        }
15884
15885        /// Sets the full request, replacing any prior values.
15886        pub fn with_request<V: Into<crate::model::UpdateServerTlsPolicyRequest>>(
15887            mut self,
15888            v: V,
15889        ) -> Self {
15890            self.0.request = v.into();
15891            self
15892        }
15893
15894        /// Sets all the options, replacing any prior values.
15895        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15896            self.0.options = v.into();
15897            self
15898        }
15899
15900        /// Sends the request.
15901        ///
15902        /// # Long running operations
15903        ///
15904        /// This starts, but does not poll, a longrunning operation. More information
15905        /// on [update_server_tls_policy][crate::client::NetworkSecurity::update_server_tls_policy].
15906        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15907            (*self.0.stub)
15908                .update_server_tls_policy(self.0.request, self.0.options)
15909                .await
15910                .map(crate::Response::into_body)
15911        }
15912
15913        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_server_tls_policy`.
15914        pub fn poller(
15915            self,
15916        ) -> impl google_cloud_lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
15917        {
15918            type Operation = google_cloud_lro::internal::Operation<
15919                crate::model::ServerTlsPolicy,
15920                crate::model::OperationMetadata,
15921            >;
15922            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15923            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15924
15925            let stub = self.0.stub.clone();
15926            let mut options = self.0.options.clone();
15927            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15928            let query = move |name| {
15929                let stub = stub.clone();
15930                let options = options.clone();
15931                async {
15932                    let op = GetOperation::new(stub)
15933                        .set_name(name)
15934                        .with_options(options)
15935                        .send()
15936                        .await?;
15937                    Ok(Operation::new(op))
15938                }
15939            };
15940
15941            let start = move || async {
15942                let op = self.send().await?;
15943                Ok(Operation::new(op))
15944            };
15945
15946            google_cloud_lro::internal::new_poller(
15947                polling_error_policy,
15948                polling_backoff_policy,
15949                start,
15950                query,
15951            )
15952        }
15953
15954        /// Sets the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
15955        pub fn set_update_mask<T>(mut self, v: T) -> Self
15956        where
15957            T: std::convert::Into<wkt::FieldMask>,
15958        {
15959            self.0.request.update_mask = std::option::Option::Some(v.into());
15960            self
15961        }
15962
15963        /// Sets or clears the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
15964        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15965        where
15966            T: std::convert::Into<wkt::FieldMask>,
15967        {
15968            self.0.request.update_mask = v.map(|x| x.into());
15969            self
15970        }
15971
15972        /// Sets the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
15973        ///
15974        /// This is a **required** field for requests.
15975        pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
15976        where
15977            T: std::convert::Into<crate::model::ServerTlsPolicy>,
15978        {
15979            self.0.request.server_tls_policy = std::option::Option::Some(v.into());
15980            self
15981        }
15982
15983        /// Sets or clears the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
15984        ///
15985        /// This is a **required** field for requests.
15986        pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
15987        where
15988            T: std::convert::Into<crate::model::ServerTlsPolicy>,
15989        {
15990            self.0.request.server_tls_policy = v.map(|x| x.into());
15991            self
15992        }
15993    }
15994
15995    #[doc(hidden)]
15996    impl crate::RequestBuilder for UpdateServerTlsPolicy {
15997        fn request_options(&mut self) -> &mut crate::RequestOptions {
15998            &mut self.0.options
15999        }
16000    }
16001
16002    /// The request builder for [NetworkSecurity::delete_server_tls_policy][crate::client::NetworkSecurity::delete_server_tls_policy] calls.
16003    ///
16004    /// # Example
16005    /// ```
16006    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteServerTlsPolicy;
16007    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16008    /// use google_cloud_lro::Poller;
16009    ///
16010    /// let builder = prepare_request_builder();
16011    /// let response = builder.poller().until_done().await?;
16012    /// # Ok(()) }
16013    ///
16014    /// fn prepare_request_builder() -> DeleteServerTlsPolicy {
16015    ///   # panic!();
16016    ///   // ... details omitted ...
16017    /// }
16018    /// ```
16019    #[derive(Clone, Debug)]
16020    pub struct DeleteServerTlsPolicy(RequestBuilder<crate::model::DeleteServerTlsPolicyRequest>);
16021
16022    impl DeleteServerTlsPolicy {
16023        pub(crate) fn new(
16024            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16025        ) -> Self {
16026            Self(RequestBuilder::new(stub))
16027        }
16028
16029        /// Sets the full request, replacing any prior values.
16030        pub fn with_request<V: Into<crate::model::DeleteServerTlsPolicyRequest>>(
16031            mut self,
16032            v: V,
16033        ) -> Self {
16034            self.0.request = v.into();
16035            self
16036        }
16037
16038        /// Sets all the options, replacing any prior values.
16039        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16040            self.0.options = v.into();
16041            self
16042        }
16043
16044        /// Sends the request.
16045        ///
16046        /// # Long running operations
16047        ///
16048        /// This starts, but does not poll, a longrunning operation. More information
16049        /// on [delete_server_tls_policy][crate::client::NetworkSecurity::delete_server_tls_policy].
16050        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16051            (*self.0.stub)
16052                .delete_server_tls_policy(self.0.request, self.0.options)
16053                .await
16054                .map(crate::Response::into_body)
16055        }
16056
16057        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_server_tls_policy`.
16058        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16059            type Operation =
16060                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16061            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16062            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16063
16064            let stub = self.0.stub.clone();
16065            let mut options = self.0.options.clone();
16066            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16067            let query = move |name| {
16068                let stub = stub.clone();
16069                let options = options.clone();
16070                async {
16071                    let op = GetOperation::new(stub)
16072                        .set_name(name)
16073                        .with_options(options)
16074                        .send()
16075                        .await?;
16076                    Ok(Operation::new(op))
16077                }
16078            };
16079
16080            let start = move || async {
16081                let op = self.send().await?;
16082                Ok(Operation::new(op))
16083            };
16084
16085            google_cloud_lro::internal::new_unit_response_poller(
16086                polling_error_policy,
16087                polling_backoff_policy,
16088                start,
16089                query,
16090            )
16091        }
16092
16093        /// Sets the value of [name][crate::model::DeleteServerTlsPolicyRequest::name].
16094        ///
16095        /// This is a **required** field for requests.
16096        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16097            self.0.request.name = v.into();
16098            self
16099        }
16100    }
16101
16102    #[doc(hidden)]
16103    impl crate::RequestBuilder for DeleteServerTlsPolicy {
16104        fn request_options(&mut self) -> &mut crate::RequestOptions {
16105            &mut self.0.options
16106        }
16107    }
16108
16109    /// The request builder for [NetworkSecurity::list_client_tls_policies][crate::client::NetworkSecurity::list_client_tls_policies] calls.
16110    ///
16111    /// # Example
16112    /// ```
16113    /// # use google_cloud_networksecurity_v1::builder::network_security::ListClientTlsPolicies;
16114    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16115    /// use google_cloud_gax::paginator::ItemPaginator;
16116    ///
16117    /// let builder = prepare_request_builder();
16118    /// let mut items = builder.by_item();
16119    /// while let Some(result) = items.next().await {
16120    ///   let item = result?;
16121    /// }
16122    /// # Ok(()) }
16123    ///
16124    /// fn prepare_request_builder() -> ListClientTlsPolicies {
16125    ///   # panic!();
16126    ///   // ... details omitted ...
16127    /// }
16128    /// ```
16129    #[derive(Clone, Debug)]
16130    pub struct ListClientTlsPolicies(RequestBuilder<crate::model::ListClientTlsPoliciesRequest>);
16131
16132    impl ListClientTlsPolicies {
16133        pub(crate) fn new(
16134            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16135        ) -> Self {
16136            Self(RequestBuilder::new(stub))
16137        }
16138
16139        /// Sets the full request, replacing any prior values.
16140        pub fn with_request<V: Into<crate::model::ListClientTlsPoliciesRequest>>(
16141            mut self,
16142            v: V,
16143        ) -> Self {
16144            self.0.request = v.into();
16145            self
16146        }
16147
16148        /// Sets all the options, replacing any prior values.
16149        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16150            self.0.options = v.into();
16151            self
16152        }
16153
16154        /// Sends the request.
16155        pub async fn send(self) -> Result<crate::model::ListClientTlsPoliciesResponse> {
16156            (*self.0.stub)
16157                .list_client_tls_policies(self.0.request, self.0.options)
16158                .await
16159                .map(crate::Response::into_body)
16160        }
16161
16162        /// Streams each page in the collection.
16163        pub fn by_page(
16164            self,
16165        ) -> impl google_cloud_gax::paginator::Paginator<
16166            crate::model::ListClientTlsPoliciesResponse,
16167            crate::Error,
16168        > {
16169            use std::clone::Clone;
16170            let token = self.0.request.page_token.clone();
16171            let execute = move |token: String| {
16172                let mut builder = self.clone();
16173                builder.0.request = builder.0.request.set_page_token(token);
16174                builder.send()
16175            };
16176            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16177        }
16178
16179        /// Streams each item in the collection.
16180        pub fn by_item(
16181            self,
16182        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16183            crate::model::ListClientTlsPoliciesResponse,
16184            crate::Error,
16185        > {
16186            use google_cloud_gax::paginator::Paginator;
16187            self.by_page().items()
16188        }
16189
16190        /// Sets the value of [parent][crate::model::ListClientTlsPoliciesRequest::parent].
16191        ///
16192        /// This is a **required** field for requests.
16193        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16194            self.0.request.parent = v.into();
16195            self
16196        }
16197
16198        /// Sets the value of [page_size][crate::model::ListClientTlsPoliciesRequest::page_size].
16199        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16200            self.0.request.page_size = v.into();
16201            self
16202        }
16203
16204        /// Sets the value of [page_token][crate::model::ListClientTlsPoliciesRequest::page_token].
16205        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16206            self.0.request.page_token = v.into();
16207            self
16208        }
16209    }
16210
16211    #[doc(hidden)]
16212    impl crate::RequestBuilder for ListClientTlsPolicies {
16213        fn request_options(&mut self) -> &mut crate::RequestOptions {
16214            &mut self.0.options
16215        }
16216    }
16217
16218    /// The request builder for [NetworkSecurity::get_client_tls_policy][crate::client::NetworkSecurity::get_client_tls_policy] calls.
16219    ///
16220    /// # Example
16221    /// ```
16222    /// # use google_cloud_networksecurity_v1::builder::network_security::GetClientTlsPolicy;
16223    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16224    ///
16225    /// let builder = prepare_request_builder();
16226    /// let response = builder.send().await?;
16227    /// # Ok(()) }
16228    ///
16229    /// fn prepare_request_builder() -> GetClientTlsPolicy {
16230    ///   # panic!();
16231    ///   // ... details omitted ...
16232    /// }
16233    /// ```
16234    #[derive(Clone, Debug)]
16235    pub struct GetClientTlsPolicy(RequestBuilder<crate::model::GetClientTlsPolicyRequest>);
16236
16237    impl GetClientTlsPolicy {
16238        pub(crate) fn new(
16239            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16240        ) -> Self {
16241            Self(RequestBuilder::new(stub))
16242        }
16243
16244        /// Sets the full request, replacing any prior values.
16245        pub fn with_request<V: Into<crate::model::GetClientTlsPolicyRequest>>(
16246            mut self,
16247            v: V,
16248        ) -> Self {
16249            self.0.request = v.into();
16250            self
16251        }
16252
16253        /// Sets all the options, replacing any prior values.
16254        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16255            self.0.options = v.into();
16256            self
16257        }
16258
16259        /// Sends the request.
16260        pub async fn send(self) -> Result<crate::model::ClientTlsPolicy> {
16261            (*self.0.stub)
16262                .get_client_tls_policy(self.0.request, self.0.options)
16263                .await
16264                .map(crate::Response::into_body)
16265        }
16266
16267        /// Sets the value of [name][crate::model::GetClientTlsPolicyRequest::name].
16268        ///
16269        /// This is a **required** field for requests.
16270        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16271            self.0.request.name = v.into();
16272            self
16273        }
16274    }
16275
16276    #[doc(hidden)]
16277    impl crate::RequestBuilder for GetClientTlsPolicy {
16278        fn request_options(&mut self) -> &mut crate::RequestOptions {
16279            &mut self.0.options
16280        }
16281    }
16282
16283    /// The request builder for [NetworkSecurity::create_client_tls_policy][crate::client::NetworkSecurity::create_client_tls_policy] calls.
16284    ///
16285    /// # Example
16286    /// ```
16287    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateClientTlsPolicy;
16288    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16289    /// use google_cloud_lro::Poller;
16290    ///
16291    /// let builder = prepare_request_builder();
16292    /// let response = builder.poller().until_done().await?;
16293    /// # Ok(()) }
16294    ///
16295    /// fn prepare_request_builder() -> CreateClientTlsPolicy {
16296    ///   # panic!();
16297    ///   // ... details omitted ...
16298    /// }
16299    /// ```
16300    #[derive(Clone, Debug)]
16301    pub struct CreateClientTlsPolicy(RequestBuilder<crate::model::CreateClientTlsPolicyRequest>);
16302
16303    impl CreateClientTlsPolicy {
16304        pub(crate) fn new(
16305            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16306        ) -> Self {
16307            Self(RequestBuilder::new(stub))
16308        }
16309
16310        /// Sets the full request, replacing any prior values.
16311        pub fn with_request<V: Into<crate::model::CreateClientTlsPolicyRequest>>(
16312            mut self,
16313            v: V,
16314        ) -> Self {
16315            self.0.request = v.into();
16316            self
16317        }
16318
16319        /// Sets all the options, replacing any prior values.
16320        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16321            self.0.options = v.into();
16322            self
16323        }
16324
16325        /// Sends the request.
16326        ///
16327        /// # Long running operations
16328        ///
16329        /// This starts, but does not poll, a longrunning operation. More information
16330        /// on [create_client_tls_policy][crate::client::NetworkSecurity::create_client_tls_policy].
16331        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16332            (*self.0.stub)
16333                .create_client_tls_policy(self.0.request, self.0.options)
16334                .await
16335                .map(crate::Response::into_body)
16336        }
16337
16338        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_client_tls_policy`.
16339        pub fn poller(
16340            self,
16341        ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
16342        {
16343            type Operation = google_cloud_lro::internal::Operation<
16344                crate::model::ClientTlsPolicy,
16345                crate::model::OperationMetadata,
16346            >;
16347            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16348            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16349
16350            let stub = self.0.stub.clone();
16351            let mut options = self.0.options.clone();
16352            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16353            let query = move |name| {
16354                let stub = stub.clone();
16355                let options = options.clone();
16356                async {
16357                    let op = GetOperation::new(stub)
16358                        .set_name(name)
16359                        .with_options(options)
16360                        .send()
16361                        .await?;
16362                    Ok(Operation::new(op))
16363                }
16364            };
16365
16366            let start = move || async {
16367                let op = self.send().await?;
16368                Ok(Operation::new(op))
16369            };
16370
16371            google_cloud_lro::internal::new_poller(
16372                polling_error_policy,
16373                polling_backoff_policy,
16374                start,
16375                query,
16376            )
16377        }
16378
16379        /// Sets the value of [parent][crate::model::CreateClientTlsPolicyRequest::parent].
16380        ///
16381        /// This is a **required** field for requests.
16382        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16383            self.0.request.parent = v.into();
16384            self
16385        }
16386
16387        /// Sets the value of [client_tls_policy_id][crate::model::CreateClientTlsPolicyRequest::client_tls_policy_id].
16388        ///
16389        /// This is a **required** field for requests.
16390        pub fn set_client_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
16391            self.0.request.client_tls_policy_id = v.into();
16392            self
16393        }
16394
16395        /// Sets the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
16396        ///
16397        /// This is a **required** field for requests.
16398        pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
16399        where
16400            T: std::convert::Into<crate::model::ClientTlsPolicy>,
16401        {
16402            self.0.request.client_tls_policy = std::option::Option::Some(v.into());
16403            self
16404        }
16405
16406        /// Sets or clears the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
16407        ///
16408        /// This is a **required** field for requests.
16409        pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
16410        where
16411            T: std::convert::Into<crate::model::ClientTlsPolicy>,
16412        {
16413            self.0.request.client_tls_policy = v.map(|x| x.into());
16414            self
16415        }
16416    }
16417
16418    #[doc(hidden)]
16419    impl crate::RequestBuilder for CreateClientTlsPolicy {
16420        fn request_options(&mut self) -> &mut crate::RequestOptions {
16421            &mut self.0.options
16422        }
16423    }
16424
16425    /// The request builder for [NetworkSecurity::update_client_tls_policy][crate::client::NetworkSecurity::update_client_tls_policy] calls.
16426    ///
16427    /// # Example
16428    /// ```
16429    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateClientTlsPolicy;
16430    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16431    /// use google_cloud_lro::Poller;
16432    ///
16433    /// let builder = prepare_request_builder();
16434    /// let response = builder.poller().until_done().await?;
16435    /// # Ok(()) }
16436    ///
16437    /// fn prepare_request_builder() -> UpdateClientTlsPolicy {
16438    ///   # panic!();
16439    ///   // ... details omitted ...
16440    /// }
16441    /// ```
16442    #[derive(Clone, Debug)]
16443    pub struct UpdateClientTlsPolicy(RequestBuilder<crate::model::UpdateClientTlsPolicyRequest>);
16444
16445    impl UpdateClientTlsPolicy {
16446        pub(crate) fn new(
16447            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16448        ) -> Self {
16449            Self(RequestBuilder::new(stub))
16450        }
16451
16452        /// Sets the full request, replacing any prior values.
16453        pub fn with_request<V: Into<crate::model::UpdateClientTlsPolicyRequest>>(
16454            mut self,
16455            v: V,
16456        ) -> Self {
16457            self.0.request = v.into();
16458            self
16459        }
16460
16461        /// Sets all the options, replacing any prior values.
16462        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16463            self.0.options = v.into();
16464            self
16465        }
16466
16467        /// Sends the request.
16468        ///
16469        /// # Long running operations
16470        ///
16471        /// This starts, but does not poll, a longrunning operation. More information
16472        /// on [update_client_tls_policy][crate::client::NetworkSecurity::update_client_tls_policy].
16473        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16474            (*self.0.stub)
16475                .update_client_tls_policy(self.0.request, self.0.options)
16476                .await
16477                .map(crate::Response::into_body)
16478        }
16479
16480        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_client_tls_policy`.
16481        pub fn poller(
16482            self,
16483        ) -> impl google_cloud_lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
16484        {
16485            type Operation = google_cloud_lro::internal::Operation<
16486                crate::model::ClientTlsPolicy,
16487                crate::model::OperationMetadata,
16488            >;
16489            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16490            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16491
16492            let stub = self.0.stub.clone();
16493            let mut options = self.0.options.clone();
16494            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16495            let query = move |name| {
16496                let stub = stub.clone();
16497                let options = options.clone();
16498                async {
16499                    let op = GetOperation::new(stub)
16500                        .set_name(name)
16501                        .with_options(options)
16502                        .send()
16503                        .await?;
16504                    Ok(Operation::new(op))
16505                }
16506            };
16507
16508            let start = move || async {
16509                let op = self.send().await?;
16510                Ok(Operation::new(op))
16511            };
16512
16513            google_cloud_lro::internal::new_poller(
16514                polling_error_policy,
16515                polling_backoff_policy,
16516                start,
16517                query,
16518            )
16519        }
16520
16521        /// Sets the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
16522        pub fn set_update_mask<T>(mut self, v: T) -> Self
16523        where
16524            T: std::convert::Into<wkt::FieldMask>,
16525        {
16526            self.0.request.update_mask = std::option::Option::Some(v.into());
16527            self
16528        }
16529
16530        /// Sets or clears the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
16531        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16532        where
16533            T: std::convert::Into<wkt::FieldMask>,
16534        {
16535            self.0.request.update_mask = v.map(|x| x.into());
16536            self
16537        }
16538
16539        /// Sets the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
16540        ///
16541        /// This is a **required** field for requests.
16542        pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
16543        where
16544            T: std::convert::Into<crate::model::ClientTlsPolicy>,
16545        {
16546            self.0.request.client_tls_policy = std::option::Option::Some(v.into());
16547            self
16548        }
16549
16550        /// Sets or clears the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
16551        ///
16552        /// This is a **required** field for requests.
16553        pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
16554        where
16555            T: std::convert::Into<crate::model::ClientTlsPolicy>,
16556        {
16557            self.0.request.client_tls_policy = v.map(|x| x.into());
16558            self
16559        }
16560    }
16561
16562    #[doc(hidden)]
16563    impl crate::RequestBuilder for UpdateClientTlsPolicy {
16564        fn request_options(&mut self) -> &mut crate::RequestOptions {
16565            &mut self.0.options
16566        }
16567    }
16568
16569    /// The request builder for [NetworkSecurity::delete_client_tls_policy][crate::client::NetworkSecurity::delete_client_tls_policy] calls.
16570    ///
16571    /// # Example
16572    /// ```
16573    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteClientTlsPolicy;
16574    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16575    /// use google_cloud_lro::Poller;
16576    ///
16577    /// let builder = prepare_request_builder();
16578    /// let response = builder.poller().until_done().await?;
16579    /// # Ok(()) }
16580    ///
16581    /// fn prepare_request_builder() -> DeleteClientTlsPolicy {
16582    ///   # panic!();
16583    ///   // ... details omitted ...
16584    /// }
16585    /// ```
16586    #[derive(Clone, Debug)]
16587    pub struct DeleteClientTlsPolicy(RequestBuilder<crate::model::DeleteClientTlsPolicyRequest>);
16588
16589    impl DeleteClientTlsPolicy {
16590        pub(crate) fn new(
16591            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16592        ) -> Self {
16593            Self(RequestBuilder::new(stub))
16594        }
16595
16596        /// Sets the full request, replacing any prior values.
16597        pub fn with_request<V: Into<crate::model::DeleteClientTlsPolicyRequest>>(
16598            mut self,
16599            v: V,
16600        ) -> Self {
16601            self.0.request = v.into();
16602            self
16603        }
16604
16605        /// Sets all the options, replacing any prior values.
16606        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16607            self.0.options = v.into();
16608            self
16609        }
16610
16611        /// Sends the request.
16612        ///
16613        /// # Long running operations
16614        ///
16615        /// This starts, but does not poll, a longrunning operation. More information
16616        /// on [delete_client_tls_policy][crate::client::NetworkSecurity::delete_client_tls_policy].
16617        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16618            (*self.0.stub)
16619                .delete_client_tls_policy(self.0.request, self.0.options)
16620                .await
16621                .map(crate::Response::into_body)
16622        }
16623
16624        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_client_tls_policy`.
16625        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16626            type Operation =
16627                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16628            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16629            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16630
16631            let stub = self.0.stub.clone();
16632            let mut options = self.0.options.clone();
16633            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16634            let query = move |name| {
16635                let stub = stub.clone();
16636                let options = options.clone();
16637                async {
16638                    let op = GetOperation::new(stub)
16639                        .set_name(name)
16640                        .with_options(options)
16641                        .send()
16642                        .await?;
16643                    Ok(Operation::new(op))
16644                }
16645            };
16646
16647            let start = move || async {
16648                let op = self.send().await?;
16649                Ok(Operation::new(op))
16650            };
16651
16652            google_cloud_lro::internal::new_unit_response_poller(
16653                polling_error_policy,
16654                polling_backoff_policy,
16655                start,
16656                query,
16657            )
16658        }
16659
16660        /// Sets the value of [name][crate::model::DeleteClientTlsPolicyRequest::name].
16661        ///
16662        /// This is a **required** field for requests.
16663        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16664            self.0.request.name = v.into();
16665            self
16666        }
16667    }
16668
16669    #[doc(hidden)]
16670    impl crate::RequestBuilder for DeleteClientTlsPolicy {
16671        fn request_options(&mut self) -> &mut crate::RequestOptions {
16672            &mut self.0.options
16673        }
16674    }
16675
16676    /// The request builder for [NetworkSecurity::list_gateway_security_policies][crate::client::NetworkSecurity::list_gateway_security_policies] calls.
16677    ///
16678    /// # Example
16679    /// ```
16680    /// # use google_cloud_networksecurity_v1::builder::network_security::ListGatewaySecurityPolicies;
16681    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16682    /// use google_cloud_gax::paginator::ItemPaginator;
16683    ///
16684    /// let builder = prepare_request_builder();
16685    /// let mut items = builder.by_item();
16686    /// while let Some(result) = items.next().await {
16687    ///   let item = result?;
16688    /// }
16689    /// # Ok(()) }
16690    ///
16691    /// fn prepare_request_builder() -> ListGatewaySecurityPolicies {
16692    ///   # panic!();
16693    ///   // ... details omitted ...
16694    /// }
16695    /// ```
16696    #[derive(Clone, Debug)]
16697    pub struct ListGatewaySecurityPolicies(
16698        RequestBuilder<crate::model::ListGatewaySecurityPoliciesRequest>,
16699    );
16700
16701    impl ListGatewaySecurityPolicies {
16702        pub(crate) fn new(
16703            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16704        ) -> Self {
16705            Self(RequestBuilder::new(stub))
16706        }
16707
16708        /// Sets the full request, replacing any prior values.
16709        pub fn with_request<V: Into<crate::model::ListGatewaySecurityPoliciesRequest>>(
16710            mut self,
16711            v: V,
16712        ) -> Self {
16713            self.0.request = v.into();
16714            self
16715        }
16716
16717        /// Sets all the options, replacing any prior values.
16718        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16719            self.0.options = v.into();
16720            self
16721        }
16722
16723        /// Sends the request.
16724        pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPoliciesResponse> {
16725            (*self.0.stub)
16726                .list_gateway_security_policies(self.0.request, self.0.options)
16727                .await
16728                .map(crate::Response::into_body)
16729        }
16730
16731        /// Streams each page in the collection.
16732        pub fn by_page(
16733            self,
16734        ) -> impl google_cloud_gax::paginator::Paginator<
16735            crate::model::ListGatewaySecurityPoliciesResponse,
16736            crate::Error,
16737        > {
16738            use std::clone::Clone;
16739            let token = self.0.request.page_token.clone();
16740            let execute = move |token: String| {
16741                let mut builder = self.clone();
16742                builder.0.request = builder.0.request.set_page_token(token);
16743                builder.send()
16744            };
16745            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16746        }
16747
16748        /// Streams each item in the collection.
16749        pub fn by_item(
16750            self,
16751        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16752            crate::model::ListGatewaySecurityPoliciesResponse,
16753            crate::Error,
16754        > {
16755            use google_cloud_gax::paginator::Paginator;
16756            self.by_page().items()
16757        }
16758
16759        /// Sets the value of [parent][crate::model::ListGatewaySecurityPoliciesRequest::parent].
16760        ///
16761        /// This is a **required** field for requests.
16762        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16763            self.0.request.parent = v.into();
16764            self
16765        }
16766
16767        /// Sets the value of [page_size][crate::model::ListGatewaySecurityPoliciesRequest::page_size].
16768        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16769            self.0.request.page_size = v.into();
16770            self
16771        }
16772
16773        /// Sets the value of [page_token][crate::model::ListGatewaySecurityPoliciesRequest::page_token].
16774        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16775            self.0.request.page_token = v.into();
16776            self
16777        }
16778    }
16779
16780    #[doc(hidden)]
16781    impl crate::RequestBuilder for ListGatewaySecurityPolicies {
16782        fn request_options(&mut self) -> &mut crate::RequestOptions {
16783            &mut self.0.options
16784        }
16785    }
16786
16787    /// The request builder for [NetworkSecurity::get_gateway_security_policy][crate::client::NetworkSecurity::get_gateway_security_policy] calls.
16788    ///
16789    /// # Example
16790    /// ```
16791    /// # use google_cloud_networksecurity_v1::builder::network_security::GetGatewaySecurityPolicy;
16792    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16793    ///
16794    /// let builder = prepare_request_builder();
16795    /// let response = builder.send().await?;
16796    /// # Ok(()) }
16797    ///
16798    /// fn prepare_request_builder() -> GetGatewaySecurityPolicy {
16799    ///   # panic!();
16800    ///   // ... details omitted ...
16801    /// }
16802    /// ```
16803    #[derive(Clone, Debug)]
16804    pub struct GetGatewaySecurityPolicy(
16805        RequestBuilder<crate::model::GetGatewaySecurityPolicyRequest>,
16806    );
16807
16808    impl GetGatewaySecurityPolicy {
16809        pub(crate) fn new(
16810            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16811        ) -> Self {
16812            Self(RequestBuilder::new(stub))
16813        }
16814
16815        /// Sets the full request, replacing any prior values.
16816        pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRequest>>(
16817            mut self,
16818            v: V,
16819        ) -> Self {
16820            self.0.request = v.into();
16821            self
16822        }
16823
16824        /// Sets all the options, replacing any prior values.
16825        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16826            self.0.options = v.into();
16827            self
16828        }
16829
16830        /// Sends the request.
16831        pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicy> {
16832            (*self.0.stub)
16833                .get_gateway_security_policy(self.0.request, self.0.options)
16834                .await
16835                .map(crate::Response::into_body)
16836        }
16837
16838        /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRequest::name].
16839        ///
16840        /// This is a **required** field for requests.
16841        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16842            self.0.request.name = v.into();
16843            self
16844        }
16845    }
16846
16847    #[doc(hidden)]
16848    impl crate::RequestBuilder for GetGatewaySecurityPolicy {
16849        fn request_options(&mut self) -> &mut crate::RequestOptions {
16850            &mut self.0.options
16851        }
16852    }
16853
16854    /// The request builder for [NetworkSecurity::create_gateway_security_policy][crate::client::NetworkSecurity::create_gateway_security_policy] calls.
16855    ///
16856    /// # Example
16857    /// ```
16858    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateGatewaySecurityPolicy;
16859    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
16860    /// use google_cloud_lro::Poller;
16861    ///
16862    /// let builder = prepare_request_builder();
16863    /// let response = builder.poller().until_done().await?;
16864    /// # Ok(()) }
16865    ///
16866    /// fn prepare_request_builder() -> CreateGatewaySecurityPolicy {
16867    ///   # panic!();
16868    ///   // ... details omitted ...
16869    /// }
16870    /// ```
16871    #[derive(Clone, Debug)]
16872    pub struct CreateGatewaySecurityPolicy(
16873        RequestBuilder<crate::model::CreateGatewaySecurityPolicyRequest>,
16874    );
16875
16876    impl CreateGatewaySecurityPolicy {
16877        pub(crate) fn new(
16878            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
16879        ) -> Self {
16880            Self(RequestBuilder::new(stub))
16881        }
16882
16883        /// Sets the full request, replacing any prior values.
16884        pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRequest>>(
16885            mut self,
16886            v: V,
16887        ) -> Self {
16888            self.0.request = v.into();
16889            self
16890        }
16891
16892        /// Sets all the options, replacing any prior values.
16893        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16894            self.0.options = v.into();
16895            self
16896        }
16897
16898        /// Sends the request.
16899        ///
16900        /// # Long running operations
16901        ///
16902        /// This starts, but does not poll, a longrunning operation. More information
16903        /// on [create_gateway_security_policy][crate::client::NetworkSecurity::create_gateway_security_policy].
16904        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16905            (*self.0.stub)
16906                .create_gateway_security_policy(self.0.request, self.0.options)
16907                .await
16908                .map(crate::Response::into_body)
16909        }
16910
16911        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_gateway_security_policy`.
16912        pub fn poller(
16913            self,
16914        ) -> impl google_cloud_lro::Poller<
16915            crate::model::GatewaySecurityPolicy,
16916            crate::model::OperationMetadata,
16917        > {
16918            type Operation = google_cloud_lro::internal::Operation<
16919                crate::model::GatewaySecurityPolicy,
16920                crate::model::OperationMetadata,
16921            >;
16922            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16923            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16924
16925            let stub = self.0.stub.clone();
16926            let mut options = self.0.options.clone();
16927            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16928            let query = move |name| {
16929                let stub = stub.clone();
16930                let options = options.clone();
16931                async {
16932                    let op = GetOperation::new(stub)
16933                        .set_name(name)
16934                        .with_options(options)
16935                        .send()
16936                        .await?;
16937                    Ok(Operation::new(op))
16938                }
16939            };
16940
16941            let start = move || async {
16942                let op = self.send().await?;
16943                Ok(Operation::new(op))
16944            };
16945
16946            google_cloud_lro::internal::new_poller(
16947                polling_error_policy,
16948                polling_backoff_policy,
16949                start,
16950                query,
16951            )
16952        }
16953
16954        /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRequest::parent].
16955        ///
16956        /// This is a **required** field for requests.
16957        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16958            self.0.request.parent = v.into();
16959            self
16960        }
16961
16962        /// Sets the value of [gateway_security_policy_id][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy_id].
16963        ///
16964        /// This is a **required** field for requests.
16965        pub fn set_gateway_security_policy_id<T: Into<std::string::String>>(
16966            mut self,
16967            v: T,
16968        ) -> Self {
16969            self.0.request.gateway_security_policy_id = v.into();
16970            self
16971        }
16972
16973        /// Sets the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
16974        ///
16975        /// This is a **required** field for requests.
16976        pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
16977        where
16978            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16979        {
16980            self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
16981            self
16982        }
16983
16984        /// Sets or clears the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
16985        ///
16986        /// This is a **required** field for requests.
16987        pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
16988        where
16989            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
16990        {
16991            self.0.request.gateway_security_policy = v.map(|x| x.into());
16992            self
16993        }
16994    }
16995
16996    #[doc(hidden)]
16997    impl crate::RequestBuilder for CreateGatewaySecurityPolicy {
16998        fn request_options(&mut self) -> &mut crate::RequestOptions {
16999            &mut self.0.options
17000        }
17001    }
17002
17003    /// The request builder for [NetworkSecurity::update_gateway_security_policy][crate::client::NetworkSecurity::update_gateway_security_policy] calls.
17004    ///
17005    /// # Example
17006    /// ```
17007    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateGatewaySecurityPolicy;
17008    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17009    /// use google_cloud_lro::Poller;
17010    ///
17011    /// let builder = prepare_request_builder();
17012    /// let response = builder.poller().until_done().await?;
17013    /// # Ok(()) }
17014    ///
17015    /// fn prepare_request_builder() -> UpdateGatewaySecurityPolicy {
17016    ///   # panic!();
17017    ///   // ... details omitted ...
17018    /// }
17019    /// ```
17020    #[derive(Clone, Debug)]
17021    pub struct UpdateGatewaySecurityPolicy(
17022        RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRequest>,
17023    );
17024
17025    impl UpdateGatewaySecurityPolicy {
17026        pub(crate) fn new(
17027            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17028        ) -> Self {
17029            Self(RequestBuilder::new(stub))
17030        }
17031
17032        /// Sets the full request, replacing any prior values.
17033        pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRequest>>(
17034            mut self,
17035            v: V,
17036        ) -> Self {
17037            self.0.request = v.into();
17038            self
17039        }
17040
17041        /// Sets all the options, replacing any prior values.
17042        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17043            self.0.options = v.into();
17044            self
17045        }
17046
17047        /// Sends the request.
17048        ///
17049        /// # Long running operations
17050        ///
17051        /// This starts, but does not poll, a longrunning operation. More information
17052        /// on [update_gateway_security_policy][crate::client::NetworkSecurity::update_gateway_security_policy].
17053        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17054            (*self.0.stub)
17055                .update_gateway_security_policy(self.0.request, self.0.options)
17056                .await
17057                .map(crate::Response::into_body)
17058        }
17059
17060        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_gateway_security_policy`.
17061        pub fn poller(
17062            self,
17063        ) -> impl google_cloud_lro::Poller<
17064            crate::model::GatewaySecurityPolicy,
17065            crate::model::OperationMetadata,
17066        > {
17067            type Operation = google_cloud_lro::internal::Operation<
17068                crate::model::GatewaySecurityPolicy,
17069                crate::model::OperationMetadata,
17070            >;
17071            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17072            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17073
17074            let stub = self.0.stub.clone();
17075            let mut options = self.0.options.clone();
17076            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17077            let query = move |name| {
17078                let stub = stub.clone();
17079                let options = options.clone();
17080                async {
17081                    let op = GetOperation::new(stub)
17082                        .set_name(name)
17083                        .with_options(options)
17084                        .send()
17085                        .await?;
17086                    Ok(Operation::new(op))
17087                }
17088            };
17089
17090            let start = move || async {
17091                let op = self.send().await?;
17092                Ok(Operation::new(op))
17093            };
17094
17095            google_cloud_lro::internal::new_poller(
17096                polling_error_policy,
17097                polling_backoff_policy,
17098                start,
17099                query,
17100            )
17101        }
17102
17103        /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
17104        pub fn set_update_mask<T>(mut self, v: T) -> Self
17105        where
17106            T: std::convert::Into<wkt::FieldMask>,
17107        {
17108            self.0.request.update_mask = std::option::Option::Some(v.into());
17109            self
17110        }
17111
17112        /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
17113        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17114        where
17115            T: std::convert::Into<wkt::FieldMask>,
17116        {
17117            self.0.request.update_mask = v.map(|x| x.into());
17118            self
17119        }
17120
17121        /// Sets the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
17122        ///
17123        /// This is a **required** field for requests.
17124        pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
17125        where
17126            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
17127        {
17128            self.0.request.gateway_security_policy = std::option::Option::Some(v.into());
17129            self
17130        }
17131
17132        /// Sets or clears the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
17133        ///
17134        /// This is a **required** field for requests.
17135        pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
17136        where
17137            T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
17138        {
17139            self.0.request.gateway_security_policy = v.map(|x| x.into());
17140            self
17141        }
17142    }
17143
17144    #[doc(hidden)]
17145    impl crate::RequestBuilder for UpdateGatewaySecurityPolicy {
17146        fn request_options(&mut self) -> &mut crate::RequestOptions {
17147            &mut self.0.options
17148        }
17149    }
17150
17151    /// The request builder for [NetworkSecurity::delete_gateway_security_policy][crate::client::NetworkSecurity::delete_gateway_security_policy] calls.
17152    ///
17153    /// # Example
17154    /// ```
17155    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteGatewaySecurityPolicy;
17156    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17157    /// use google_cloud_lro::Poller;
17158    ///
17159    /// let builder = prepare_request_builder();
17160    /// let response = builder.poller().until_done().await?;
17161    /// # Ok(()) }
17162    ///
17163    /// fn prepare_request_builder() -> DeleteGatewaySecurityPolicy {
17164    ///   # panic!();
17165    ///   // ... details omitted ...
17166    /// }
17167    /// ```
17168    #[derive(Clone, Debug)]
17169    pub struct DeleteGatewaySecurityPolicy(
17170        RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRequest>,
17171    );
17172
17173    impl DeleteGatewaySecurityPolicy {
17174        pub(crate) fn new(
17175            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17176        ) -> Self {
17177            Self(RequestBuilder::new(stub))
17178        }
17179
17180        /// Sets the full request, replacing any prior values.
17181        pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRequest>>(
17182            mut self,
17183            v: V,
17184        ) -> Self {
17185            self.0.request = v.into();
17186            self
17187        }
17188
17189        /// Sets all the options, replacing any prior values.
17190        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17191            self.0.options = v.into();
17192            self
17193        }
17194
17195        /// Sends the request.
17196        ///
17197        /// # Long running operations
17198        ///
17199        /// This starts, but does not poll, a longrunning operation. More information
17200        /// on [delete_gateway_security_policy][crate::client::NetworkSecurity::delete_gateway_security_policy].
17201        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17202            (*self.0.stub)
17203                .delete_gateway_security_policy(self.0.request, self.0.options)
17204                .await
17205                .map(crate::Response::into_body)
17206        }
17207
17208        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_gateway_security_policy`.
17209        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17210            type Operation =
17211                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17212            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17213            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17214
17215            let stub = self.0.stub.clone();
17216            let mut options = self.0.options.clone();
17217            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17218            let query = move |name| {
17219                let stub = stub.clone();
17220                let options = options.clone();
17221                async {
17222                    let op = GetOperation::new(stub)
17223                        .set_name(name)
17224                        .with_options(options)
17225                        .send()
17226                        .await?;
17227                    Ok(Operation::new(op))
17228                }
17229            };
17230
17231            let start = move || async {
17232                let op = self.send().await?;
17233                Ok(Operation::new(op))
17234            };
17235
17236            google_cloud_lro::internal::new_unit_response_poller(
17237                polling_error_policy,
17238                polling_backoff_policy,
17239                start,
17240                query,
17241            )
17242        }
17243
17244        /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRequest::name].
17245        ///
17246        /// This is a **required** field for requests.
17247        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17248            self.0.request.name = v.into();
17249            self
17250        }
17251    }
17252
17253    #[doc(hidden)]
17254    impl crate::RequestBuilder for DeleteGatewaySecurityPolicy {
17255        fn request_options(&mut self) -> &mut crate::RequestOptions {
17256            &mut self.0.options
17257        }
17258    }
17259
17260    /// The request builder for [NetworkSecurity::list_gateway_security_policy_rules][crate::client::NetworkSecurity::list_gateway_security_policy_rules] calls.
17261    ///
17262    /// # Example
17263    /// ```
17264    /// # use google_cloud_networksecurity_v1::builder::network_security::ListGatewaySecurityPolicyRules;
17265    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17266    /// use google_cloud_gax::paginator::ItemPaginator;
17267    ///
17268    /// let builder = prepare_request_builder();
17269    /// let mut items = builder.by_item();
17270    /// while let Some(result) = items.next().await {
17271    ///   let item = result?;
17272    /// }
17273    /// # Ok(()) }
17274    ///
17275    /// fn prepare_request_builder() -> ListGatewaySecurityPolicyRules {
17276    ///   # panic!();
17277    ///   // ... details omitted ...
17278    /// }
17279    /// ```
17280    #[derive(Clone, Debug)]
17281    pub struct ListGatewaySecurityPolicyRules(
17282        RequestBuilder<crate::model::ListGatewaySecurityPolicyRulesRequest>,
17283    );
17284
17285    impl ListGatewaySecurityPolicyRules {
17286        pub(crate) fn new(
17287            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17288        ) -> Self {
17289            Self(RequestBuilder::new(stub))
17290        }
17291
17292        /// Sets the full request, replacing any prior values.
17293        pub fn with_request<V: Into<crate::model::ListGatewaySecurityPolicyRulesRequest>>(
17294            mut self,
17295            v: V,
17296        ) -> Self {
17297            self.0.request = v.into();
17298            self
17299        }
17300
17301        /// Sets all the options, replacing any prior values.
17302        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17303            self.0.options = v.into();
17304            self
17305        }
17306
17307        /// Sends the request.
17308        pub async fn send(self) -> Result<crate::model::ListGatewaySecurityPolicyRulesResponse> {
17309            (*self.0.stub)
17310                .list_gateway_security_policy_rules(self.0.request, self.0.options)
17311                .await
17312                .map(crate::Response::into_body)
17313        }
17314
17315        /// Streams each page in the collection.
17316        pub fn by_page(
17317            self,
17318        ) -> impl google_cloud_gax::paginator::Paginator<
17319            crate::model::ListGatewaySecurityPolicyRulesResponse,
17320            crate::Error,
17321        > {
17322            use std::clone::Clone;
17323            let token = self.0.request.page_token.clone();
17324            let execute = move |token: String| {
17325                let mut builder = self.clone();
17326                builder.0.request = builder.0.request.set_page_token(token);
17327                builder.send()
17328            };
17329            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17330        }
17331
17332        /// Streams each item in the collection.
17333        pub fn by_item(
17334            self,
17335        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17336            crate::model::ListGatewaySecurityPolicyRulesResponse,
17337            crate::Error,
17338        > {
17339            use google_cloud_gax::paginator::Paginator;
17340            self.by_page().items()
17341        }
17342
17343        /// Sets the value of [parent][crate::model::ListGatewaySecurityPolicyRulesRequest::parent].
17344        ///
17345        /// This is a **required** field for requests.
17346        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17347            self.0.request.parent = v.into();
17348            self
17349        }
17350
17351        /// Sets the value of [page_size][crate::model::ListGatewaySecurityPolicyRulesRequest::page_size].
17352        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17353            self.0.request.page_size = v.into();
17354            self
17355        }
17356
17357        /// Sets the value of [page_token][crate::model::ListGatewaySecurityPolicyRulesRequest::page_token].
17358        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17359            self.0.request.page_token = v.into();
17360            self
17361        }
17362    }
17363
17364    #[doc(hidden)]
17365    impl crate::RequestBuilder for ListGatewaySecurityPolicyRules {
17366        fn request_options(&mut self) -> &mut crate::RequestOptions {
17367            &mut self.0.options
17368        }
17369    }
17370
17371    /// The request builder for [NetworkSecurity::get_gateway_security_policy_rule][crate::client::NetworkSecurity::get_gateway_security_policy_rule] calls.
17372    ///
17373    /// # Example
17374    /// ```
17375    /// # use google_cloud_networksecurity_v1::builder::network_security::GetGatewaySecurityPolicyRule;
17376    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17377    ///
17378    /// let builder = prepare_request_builder();
17379    /// let response = builder.send().await?;
17380    /// # Ok(()) }
17381    ///
17382    /// fn prepare_request_builder() -> GetGatewaySecurityPolicyRule {
17383    ///   # panic!();
17384    ///   // ... details omitted ...
17385    /// }
17386    /// ```
17387    #[derive(Clone, Debug)]
17388    pub struct GetGatewaySecurityPolicyRule(
17389        RequestBuilder<crate::model::GetGatewaySecurityPolicyRuleRequest>,
17390    );
17391
17392    impl GetGatewaySecurityPolicyRule {
17393        pub(crate) fn new(
17394            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17395        ) -> Self {
17396            Self(RequestBuilder::new(stub))
17397        }
17398
17399        /// Sets the full request, replacing any prior values.
17400        pub fn with_request<V: Into<crate::model::GetGatewaySecurityPolicyRuleRequest>>(
17401            mut self,
17402            v: V,
17403        ) -> Self {
17404            self.0.request = v.into();
17405            self
17406        }
17407
17408        /// Sets all the options, replacing any prior values.
17409        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17410            self.0.options = v.into();
17411            self
17412        }
17413
17414        /// Sends the request.
17415        pub async fn send(self) -> Result<crate::model::GatewaySecurityPolicyRule> {
17416            (*self.0.stub)
17417                .get_gateway_security_policy_rule(self.0.request, self.0.options)
17418                .await
17419                .map(crate::Response::into_body)
17420        }
17421
17422        /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRuleRequest::name].
17423        ///
17424        /// This is a **required** field for requests.
17425        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17426            self.0.request.name = v.into();
17427            self
17428        }
17429    }
17430
17431    #[doc(hidden)]
17432    impl crate::RequestBuilder for GetGatewaySecurityPolicyRule {
17433        fn request_options(&mut self) -> &mut crate::RequestOptions {
17434            &mut self.0.options
17435        }
17436    }
17437
17438    /// The request builder for [NetworkSecurity::create_gateway_security_policy_rule][crate::client::NetworkSecurity::create_gateway_security_policy_rule] calls.
17439    ///
17440    /// # Example
17441    /// ```
17442    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateGatewaySecurityPolicyRule;
17443    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17444    /// use google_cloud_lro::Poller;
17445    ///
17446    /// let builder = prepare_request_builder();
17447    /// let response = builder.poller().until_done().await?;
17448    /// # Ok(()) }
17449    ///
17450    /// fn prepare_request_builder() -> CreateGatewaySecurityPolicyRule {
17451    ///   # panic!();
17452    ///   // ... details omitted ...
17453    /// }
17454    /// ```
17455    #[derive(Clone, Debug)]
17456    pub struct CreateGatewaySecurityPolicyRule(
17457        RequestBuilder<crate::model::CreateGatewaySecurityPolicyRuleRequest>,
17458    );
17459
17460    impl CreateGatewaySecurityPolicyRule {
17461        pub(crate) fn new(
17462            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17463        ) -> Self {
17464            Self(RequestBuilder::new(stub))
17465        }
17466
17467        /// Sets the full request, replacing any prior values.
17468        pub fn with_request<V: Into<crate::model::CreateGatewaySecurityPolicyRuleRequest>>(
17469            mut self,
17470            v: V,
17471        ) -> Self {
17472            self.0.request = v.into();
17473            self
17474        }
17475
17476        /// Sets all the options, replacing any prior values.
17477        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17478            self.0.options = v.into();
17479            self
17480        }
17481
17482        /// Sends the request.
17483        ///
17484        /// # Long running operations
17485        ///
17486        /// This starts, but does not poll, a longrunning operation. More information
17487        /// on [create_gateway_security_policy_rule][crate::client::NetworkSecurity::create_gateway_security_policy_rule].
17488        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17489            (*self.0.stub)
17490                .create_gateway_security_policy_rule(self.0.request, self.0.options)
17491                .await
17492                .map(crate::Response::into_body)
17493        }
17494
17495        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_gateway_security_policy_rule`.
17496        pub fn poller(
17497            self,
17498        ) -> impl google_cloud_lro::Poller<
17499            crate::model::GatewaySecurityPolicyRule,
17500            crate::model::OperationMetadata,
17501        > {
17502            type Operation = google_cloud_lro::internal::Operation<
17503                crate::model::GatewaySecurityPolicyRule,
17504                crate::model::OperationMetadata,
17505            >;
17506            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17507            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17508
17509            let stub = self.0.stub.clone();
17510            let mut options = self.0.options.clone();
17511            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17512            let query = move |name| {
17513                let stub = stub.clone();
17514                let options = options.clone();
17515                async {
17516                    let op = GetOperation::new(stub)
17517                        .set_name(name)
17518                        .with_options(options)
17519                        .send()
17520                        .await?;
17521                    Ok(Operation::new(op))
17522                }
17523            };
17524
17525            let start = move || async {
17526                let op = self.send().await?;
17527                Ok(Operation::new(op))
17528            };
17529
17530            google_cloud_lro::internal::new_poller(
17531                polling_error_policy,
17532                polling_backoff_policy,
17533                start,
17534                query,
17535            )
17536        }
17537
17538        /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRuleRequest::parent].
17539        ///
17540        /// This is a **required** field for requests.
17541        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17542            self.0.request.parent = v.into();
17543            self
17544        }
17545
17546        /// Sets the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
17547        ///
17548        /// This is a **required** field for requests.
17549        pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
17550        where
17551            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17552        {
17553            self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
17554            self
17555        }
17556
17557        /// Sets or clears the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
17558        ///
17559        /// This is a **required** field for requests.
17560        pub fn set_or_clear_gateway_security_policy_rule<T>(
17561            mut self,
17562            v: std::option::Option<T>,
17563        ) -> Self
17564        where
17565            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17566        {
17567            self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
17568            self
17569        }
17570
17571        /// Sets the value of [gateway_security_policy_rule_id][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule_id].
17572        pub fn set_gateway_security_policy_rule_id<T: Into<std::string::String>>(
17573            mut self,
17574            v: T,
17575        ) -> Self {
17576            self.0.request.gateway_security_policy_rule_id = v.into();
17577            self
17578        }
17579    }
17580
17581    #[doc(hidden)]
17582    impl crate::RequestBuilder for CreateGatewaySecurityPolicyRule {
17583        fn request_options(&mut self) -> &mut crate::RequestOptions {
17584            &mut self.0.options
17585        }
17586    }
17587
17588    /// The request builder for [NetworkSecurity::update_gateway_security_policy_rule][crate::client::NetworkSecurity::update_gateway_security_policy_rule] calls.
17589    ///
17590    /// # Example
17591    /// ```
17592    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateGatewaySecurityPolicyRule;
17593    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17594    /// use google_cloud_lro::Poller;
17595    ///
17596    /// let builder = prepare_request_builder();
17597    /// let response = builder.poller().until_done().await?;
17598    /// # Ok(()) }
17599    ///
17600    /// fn prepare_request_builder() -> UpdateGatewaySecurityPolicyRule {
17601    ///   # panic!();
17602    ///   // ... details omitted ...
17603    /// }
17604    /// ```
17605    #[derive(Clone, Debug)]
17606    pub struct UpdateGatewaySecurityPolicyRule(
17607        RequestBuilder<crate::model::UpdateGatewaySecurityPolicyRuleRequest>,
17608    );
17609
17610    impl UpdateGatewaySecurityPolicyRule {
17611        pub(crate) fn new(
17612            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17613        ) -> Self {
17614            Self(RequestBuilder::new(stub))
17615        }
17616
17617        /// Sets the full request, replacing any prior values.
17618        pub fn with_request<V: Into<crate::model::UpdateGatewaySecurityPolicyRuleRequest>>(
17619            mut self,
17620            v: V,
17621        ) -> Self {
17622            self.0.request = v.into();
17623            self
17624        }
17625
17626        /// Sets all the options, replacing any prior values.
17627        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17628            self.0.options = v.into();
17629            self
17630        }
17631
17632        /// Sends the request.
17633        ///
17634        /// # Long running operations
17635        ///
17636        /// This starts, but does not poll, a longrunning operation. More information
17637        /// on [update_gateway_security_policy_rule][crate::client::NetworkSecurity::update_gateway_security_policy_rule].
17638        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17639            (*self.0.stub)
17640                .update_gateway_security_policy_rule(self.0.request, self.0.options)
17641                .await
17642                .map(crate::Response::into_body)
17643        }
17644
17645        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_gateway_security_policy_rule`.
17646        pub fn poller(
17647            self,
17648        ) -> impl google_cloud_lro::Poller<
17649            crate::model::GatewaySecurityPolicyRule,
17650            crate::model::OperationMetadata,
17651        > {
17652            type Operation = google_cloud_lro::internal::Operation<
17653                crate::model::GatewaySecurityPolicyRule,
17654                crate::model::OperationMetadata,
17655            >;
17656            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17657            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17658
17659            let stub = self.0.stub.clone();
17660            let mut options = self.0.options.clone();
17661            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17662            let query = move |name| {
17663                let stub = stub.clone();
17664                let options = options.clone();
17665                async {
17666                    let op = GetOperation::new(stub)
17667                        .set_name(name)
17668                        .with_options(options)
17669                        .send()
17670                        .await?;
17671                    Ok(Operation::new(op))
17672                }
17673            };
17674
17675            let start = move || async {
17676                let op = self.send().await?;
17677                Ok(Operation::new(op))
17678            };
17679
17680            google_cloud_lro::internal::new_poller(
17681                polling_error_policy,
17682                polling_backoff_policy,
17683                start,
17684                query,
17685            )
17686        }
17687
17688        /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
17689        pub fn set_update_mask<T>(mut self, v: T) -> Self
17690        where
17691            T: std::convert::Into<wkt::FieldMask>,
17692        {
17693            self.0.request.update_mask = std::option::Option::Some(v.into());
17694            self
17695        }
17696
17697        /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
17698        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17699        where
17700            T: std::convert::Into<wkt::FieldMask>,
17701        {
17702            self.0.request.update_mask = v.map(|x| x.into());
17703            self
17704        }
17705
17706        /// Sets the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
17707        ///
17708        /// This is a **required** field for requests.
17709        pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
17710        where
17711            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17712        {
17713            self.0.request.gateway_security_policy_rule = std::option::Option::Some(v.into());
17714            self
17715        }
17716
17717        /// Sets or clears the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
17718        ///
17719        /// This is a **required** field for requests.
17720        pub fn set_or_clear_gateway_security_policy_rule<T>(
17721            mut self,
17722            v: std::option::Option<T>,
17723        ) -> Self
17724        where
17725            T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
17726        {
17727            self.0.request.gateway_security_policy_rule = v.map(|x| x.into());
17728            self
17729        }
17730    }
17731
17732    #[doc(hidden)]
17733    impl crate::RequestBuilder for UpdateGatewaySecurityPolicyRule {
17734        fn request_options(&mut self) -> &mut crate::RequestOptions {
17735            &mut self.0.options
17736        }
17737    }
17738
17739    /// The request builder for [NetworkSecurity::delete_gateway_security_policy_rule][crate::client::NetworkSecurity::delete_gateway_security_policy_rule] calls.
17740    ///
17741    /// # Example
17742    /// ```
17743    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteGatewaySecurityPolicyRule;
17744    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17745    /// use google_cloud_lro::Poller;
17746    ///
17747    /// let builder = prepare_request_builder();
17748    /// let response = builder.poller().until_done().await?;
17749    /// # Ok(()) }
17750    ///
17751    /// fn prepare_request_builder() -> DeleteGatewaySecurityPolicyRule {
17752    ///   # panic!();
17753    ///   // ... details omitted ...
17754    /// }
17755    /// ```
17756    #[derive(Clone, Debug)]
17757    pub struct DeleteGatewaySecurityPolicyRule(
17758        RequestBuilder<crate::model::DeleteGatewaySecurityPolicyRuleRequest>,
17759    );
17760
17761    impl DeleteGatewaySecurityPolicyRule {
17762        pub(crate) fn new(
17763            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17764        ) -> Self {
17765            Self(RequestBuilder::new(stub))
17766        }
17767
17768        /// Sets the full request, replacing any prior values.
17769        pub fn with_request<V: Into<crate::model::DeleteGatewaySecurityPolicyRuleRequest>>(
17770            mut self,
17771            v: V,
17772        ) -> Self {
17773            self.0.request = v.into();
17774            self
17775        }
17776
17777        /// Sets all the options, replacing any prior values.
17778        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17779            self.0.options = v.into();
17780            self
17781        }
17782
17783        /// Sends the request.
17784        ///
17785        /// # Long running operations
17786        ///
17787        /// This starts, but does not poll, a longrunning operation. More information
17788        /// on [delete_gateway_security_policy_rule][crate::client::NetworkSecurity::delete_gateway_security_policy_rule].
17789        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17790            (*self.0.stub)
17791                .delete_gateway_security_policy_rule(self.0.request, self.0.options)
17792                .await
17793                .map(crate::Response::into_body)
17794        }
17795
17796        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_gateway_security_policy_rule`.
17797        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17798            type Operation =
17799                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17800            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17801            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17802
17803            let stub = self.0.stub.clone();
17804            let mut options = self.0.options.clone();
17805            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17806            let query = move |name| {
17807                let stub = stub.clone();
17808                let options = options.clone();
17809                async {
17810                    let op = GetOperation::new(stub)
17811                        .set_name(name)
17812                        .with_options(options)
17813                        .send()
17814                        .await?;
17815                    Ok(Operation::new(op))
17816                }
17817            };
17818
17819            let start = move || async {
17820                let op = self.send().await?;
17821                Ok(Operation::new(op))
17822            };
17823
17824            google_cloud_lro::internal::new_unit_response_poller(
17825                polling_error_policy,
17826                polling_backoff_policy,
17827                start,
17828                query,
17829            )
17830        }
17831
17832        /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRuleRequest::name].
17833        ///
17834        /// This is a **required** field for requests.
17835        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17836            self.0.request.name = v.into();
17837            self
17838        }
17839    }
17840
17841    #[doc(hidden)]
17842    impl crate::RequestBuilder for DeleteGatewaySecurityPolicyRule {
17843        fn request_options(&mut self) -> &mut crate::RequestOptions {
17844            &mut self.0.options
17845        }
17846    }
17847
17848    /// The request builder for [NetworkSecurity::list_url_lists][crate::client::NetworkSecurity::list_url_lists] calls.
17849    ///
17850    /// # Example
17851    /// ```
17852    /// # use google_cloud_networksecurity_v1::builder::network_security::ListUrlLists;
17853    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17854    /// use google_cloud_gax::paginator::ItemPaginator;
17855    ///
17856    /// let builder = prepare_request_builder();
17857    /// let mut items = builder.by_item();
17858    /// while let Some(result) = items.next().await {
17859    ///   let item = result?;
17860    /// }
17861    /// # Ok(()) }
17862    ///
17863    /// fn prepare_request_builder() -> ListUrlLists {
17864    ///   # panic!();
17865    ///   // ... details omitted ...
17866    /// }
17867    /// ```
17868    #[derive(Clone, Debug)]
17869    pub struct ListUrlLists(RequestBuilder<crate::model::ListUrlListsRequest>);
17870
17871    impl ListUrlLists {
17872        pub(crate) fn new(
17873            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17874        ) -> Self {
17875            Self(RequestBuilder::new(stub))
17876        }
17877
17878        /// Sets the full request, replacing any prior values.
17879        pub fn with_request<V: Into<crate::model::ListUrlListsRequest>>(mut self, v: V) -> Self {
17880            self.0.request = v.into();
17881            self
17882        }
17883
17884        /// Sets all the options, replacing any prior values.
17885        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17886            self.0.options = v.into();
17887            self
17888        }
17889
17890        /// Sends the request.
17891        pub async fn send(self) -> Result<crate::model::ListUrlListsResponse> {
17892            (*self.0.stub)
17893                .list_url_lists(self.0.request, self.0.options)
17894                .await
17895                .map(crate::Response::into_body)
17896        }
17897
17898        /// Streams each page in the collection.
17899        pub fn by_page(
17900            self,
17901        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListUrlListsResponse, crate::Error>
17902        {
17903            use std::clone::Clone;
17904            let token = self.0.request.page_token.clone();
17905            let execute = move |token: String| {
17906                let mut builder = self.clone();
17907                builder.0.request = builder.0.request.set_page_token(token);
17908                builder.send()
17909            };
17910            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17911        }
17912
17913        /// Streams each item in the collection.
17914        pub fn by_item(
17915            self,
17916        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17917            crate::model::ListUrlListsResponse,
17918            crate::Error,
17919        > {
17920            use google_cloud_gax::paginator::Paginator;
17921            self.by_page().items()
17922        }
17923
17924        /// Sets the value of [parent][crate::model::ListUrlListsRequest::parent].
17925        ///
17926        /// This is a **required** field for requests.
17927        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17928            self.0.request.parent = v.into();
17929            self
17930        }
17931
17932        /// Sets the value of [page_size][crate::model::ListUrlListsRequest::page_size].
17933        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17934            self.0.request.page_size = v.into();
17935            self
17936        }
17937
17938        /// Sets the value of [page_token][crate::model::ListUrlListsRequest::page_token].
17939        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17940            self.0.request.page_token = v.into();
17941            self
17942        }
17943    }
17944
17945    #[doc(hidden)]
17946    impl crate::RequestBuilder for ListUrlLists {
17947        fn request_options(&mut self) -> &mut crate::RequestOptions {
17948            &mut self.0.options
17949        }
17950    }
17951
17952    /// The request builder for [NetworkSecurity::get_url_list][crate::client::NetworkSecurity::get_url_list] calls.
17953    ///
17954    /// # Example
17955    /// ```
17956    /// # use google_cloud_networksecurity_v1::builder::network_security::GetUrlList;
17957    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
17958    ///
17959    /// let builder = prepare_request_builder();
17960    /// let response = builder.send().await?;
17961    /// # Ok(()) }
17962    ///
17963    /// fn prepare_request_builder() -> GetUrlList {
17964    ///   # panic!();
17965    ///   // ... details omitted ...
17966    /// }
17967    /// ```
17968    #[derive(Clone, Debug)]
17969    pub struct GetUrlList(RequestBuilder<crate::model::GetUrlListRequest>);
17970
17971    impl GetUrlList {
17972        pub(crate) fn new(
17973            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
17974        ) -> Self {
17975            Self(RequestBuilder::new(stub))
17976        }
17977
17978        /// Sets the full request, replacing any prior values.
17979        pub fn with_request<V: Into<crate::model::GetUrlListRequest>>(mut self, v: V) -> Self {
17980            self.0.request = v.into();
17981            self
17982        }
17983
17984        /// Sets all the options, replacing any prior values.
17985        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17986            self.0.options = v.into();
17987            self
17988        }
17989
17990        /// Sends the request.
17991        pub async fn send(self) -> Result<crate::model::UrlList> {
17992            (*self.0.stub)
17993                .get_url_list(self.0.request, self.0.options)
17994                .await
17995                .map(crate::Response::into_body)
17996        }
17997
17998        /// Sets the value of [name][crate::model::GetUrlListRequest::name].
17999        ///
18000        /// This is a **required** field for requests.
18001        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18002            self.0.request.name = v.into();
18003            self
18004        }
18005    }
18006
18007    #[doc(hidden)]
18008    impl crate::RequestBuilder for GetUrlList {
18009        fn request_options(&mut self) -> &mut crate::RequestOptions {
18010            &mut self.0.options
18011        }
18012    }
18013
18014    /// The request builder for [NetworkSecurity::create_url_list][crate::client::NetworkSecurity::create_url_list] calls.
18015    ///
18016    /// # Example
18017    /// ```
18018    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateUrlList;
18019    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18020    /// use google_cloud_lro::Poller;
18021    ///
18022    /// let builder = prepare_request_builder();
18023    /// let response = builder.poller().until_done().await?;
18024    /// # Ok(()) }
18025    ///
18026    /// fn prepare_request_builder() -> CreateUrlList {
18027    ///   # panic!();
18028    ///   // ... details omitted ...
18029    /// }
18030    /// ```
18031    #[derive(Clone, Debug)]
18032    pub struct CreateUrlList(RequestBuilder<crate::model::CreateUrlListRequest>);
18033
18034    impl CreateUrlList {
18035        pub(crate) fn new(
18036            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18037        ) -> Self {
18038            Self(RequestBuilder::new(stub))
18039        }
18040
18041        /// Sets the full request, replacing any prior values.
18042        pub fn with_request<V: Into<crate::model::CreateUrlListRequest>>(mut self, v: V) -> Self {
18043            self.0.request = v.into();
18044            self
18045        }
18046
18047        /// Sets all the options, replacing any prior values.
18048        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18049            self.0.options = v.into();
18050            self
18051        }
18052
18053        /// Sends the request.
18054        ///
18055        /// # Long running operations
18056        ///
18057        /// This starts, but does not poll, a longrunning operation. More information
18058        /// on [create_url_list][crate::client::NetworkSecurity::create_url_list].
18059        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18060            (*self.0.stub)
18061                .create_url_list(self.0.request, self.0.options)
18062                .await
18063                .map(crate::Response::into_body)
18064        }
18065
18066        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_url_list`.
18067        pub fn poller(
18068            self,
18069        ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
18070        {
18071            type Operation = google_cloud_lro::internal::Operation<
18072                crate::model::UrlList,
18073                crate::model::OperationMetadata,
18074            >;
18075            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18076            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18077
18078            let stub = self.0.stub.clone();
18079            let mut options = self.0.options.clone();
18080            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18081            let query = move |name| {
18082                let stub = stub.clone();
18083                let options = options.clone();
18084                async {
18085                    let op = GetOperation::new(stub)
18086                        .set_name(name)
18087                        .with_options(options)
18088                        .send()
18089                        .await?;
18090                    Ok(Operation::new(op))
18091                }
18092            };
18093
18094            let start = move || async {
18095                let op = self.send().await?;
18096                Ok(Operation::new(op))
18097            };
18098
18099            google_cloud_lro::internal::new_poller(
18100                polling_error_policy,
18101                polling_backoff_policy,
18102                start,
18103                query,
18104            )
18105        }
18106
18107        /// Sets the value of [parent][crate::model::CreateUrlListRequest::parent].
18108        ///
18109        /// This is a **required** field for requests.
18110        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18111            self.0.request.parent = v.into();
18112            self
18113        }
18114
18115        /// Sets the value of [url_list_id][crate::model::CreateUrlListRequest::url_list_id].
18116        ///
18117        /// This is a **required** field for requests.
18118        pub fn set_url_list_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18119            self.0.request.url_list_id = v.into();
18120            self
18121        }
18122
18123        /// Sets the value of [url_list][crate::model::CreateUrlListRequest::url_list].
18124        ///
18125        /// This is a **required** field for requests.
18126        pub fn set_url_list<T>(mut self, v: T) -> Self
18127        where
18128            T: std::convert::Into<crate::model::UrlList>,
18129        {
18130            self.0.request.url_list = std::option::Option::Some(v.into());
18131            self
18132        }
18133
18134        /// Sets or clears the value of [url_list][crate::model::CreateUrlListRequest::url_list].
18135        ///
18136        /// This is a **required** field for requests.
18137        pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
18138        where
18139            T: std::convert::Into<crate::model::UrlList>,
18140        {
18141            self.0.request.url_list = v.map(|x| x.into());
18142            self
18143        }
18144    }
18145
18146    #[doc(hidden)]
18147    impl crate::RequestBuilder for CreateUrlList {
18148        fn request_options(&mut self) -> &mut crate::RequestOptions {
18149            &mut self.0.options
18150        }
18151    }
18152
18153    /// The request builder for [NetworkSecurity::update_url_list][crate::client::NetworkSecurity::update_url_list] calls.
18154    ///
18155    /// # Example
18156    /// ```
18157    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateUrlList;
18158    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18159    /// use google_cloud_lro::Poller;
18160    ///
18161    /// let builder = prepare_request_builder();
18162    /// let response = builder.poller().until_done().await?;
18163    /// # Ok(()) }
18164    ///
18165    /// fn prepare_request_builder() -> UpdateUrlList {
18166    ///   # panic!();
18167    ///   // ... details omitted ...
18168    /// }
18169    /// ```
18170    #[derive(Clone, Debug)]
18171    pub struct UpdateUrlList(RequestBuilder<crate::model::UpdateUrlListRequest>);
18172
18173    impl UpdateUrlList {
18174        pub(crate) fn new(
18175            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18176        ) -> Self {
18177            Self(RequestBuilder::new(stub))
18178        }
18179
18180        /// Sets the full request, replacing any prior values.
18181        pub fn with_request<V: Into<crate::model::UpdateUrlListRequest>>(mut self, v: V) -> Self {
18182            self.0.request = v.into();
18183            self
18184        }
18185
18186        /// Sets all the options, replacing any prior values.
18187        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18188            self.0.options = v.into();
18189            self
18190        }
18191
18192        /// Sends the request.
18193        ///
18194        /// # Long running operations
18195        ///
18196        /// This starts, but does not poll, a longrunning operation. More information
18197        /// on [update_url_list][crate::client::NetworkSecurity::update_url_list].
18198        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18199            (*self.0.stub)
18200                .update_url_list(self.0.request, self.0.options)
18201                .await
18202                .map(crate::Response::into_body)
18203        }
18204
18205        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_url_list`.
18206        pub fn poller(
18207            self,
18208        ) -> impl google_cloud_lro::Poller<crate::model::UrlList, crate::model::OperationMetadata>
18209        {
18210            type Operation = google_cloud_lro::internal::Operation<
18211                crate::model::UrlList,
18212                crate::model::OperationMetadata,
18213            >;
18214            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18215            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18216
18217            let stub = self.0.stub.clone();
18218            let mut options = self.0.options.clone();
18219            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18220            let query = move |name| {
18221                let stub = stub.clone();
18222                let options = options.clone();
18223                async {
18224                    let op = GetOperation::new(stub)
18225                        .set_name(name)
18226                        .with_options(options)
18227                        .send()
18228                        .await?;
18229                    Ok(Operation::new(op))
18230                }
18231            };
18232
18233            let start = move || async {
18234                let op = self.send().await?;
18235                Ok(Operation::new(op))
18236            };
18237
18238            google_cloud_lro::internal::new_poller(
18239                polling_error_policy,
18240                polling_backoff_policy,
18241                start,
18242                query,
18243            )
18244        }
18245
18246        /// Sets the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
18247        pub fn set_update_mask<T>(mut self, v: T) -> Self
18248        where
18249            T: std::convert::Into<wkt::FieldMask>,
18250        {
18251            self.0.request.update_mask = std::option::Option::Some(v.into());
18252            self
18253        }
18254
18255        /// Sets or clears the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
18256        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18257        where
18258            T: std::convert::Into<wkt::FieldMask>,
18259        {
18260            self.0.request.update_mask = v.map(|x| x.into());
18261            self
18262        }
18263
18264        /// Sets the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
18265        ///
18266        /// This is a **required** field for requests.
18267        pub fn set_url_list<T>(mut self, v: T) -> Self
18268        where
18269            T: std::convert::Into<crate::model::UrlList>,
18270        {
18271            self.0.request.url_list = std::option::Option::Some(v.into());
18272            self
18273        }
18274
18275        /// Sets or clears the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
18276        ///
18277        /// This is a **required** field for requests.
18278        pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
18279        where
18280            T: std::convert::Into<crate::model::UrlList>,
18281        {
18282            self.0.request.url_list = v.map(|x| x.into());
18283            self
18284        }
18285    }
18286
18287    #[doc(hidden)]
18288    impl crate::RequestBuilder for UpdateUrlList {
18289        fn request_options(&mut self) -> &mut crate::RequestOptions {
18290            &mut self.0.options
18291        }
18292    }
18293
18294    /// The request builder for [NetworkSecurity::delete_url_list][crate::client::NetworkSecurity::delete_url_list] calls.
18295    ///
18296    /// # Example
18297    /// ```
18298    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteUrlList;
18299    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18300    /// use google_cloud_lro::Poller;
18301    ///
18302    /// let builder = prepare_request_builder();
18303    /// let response = builder.poller().until_done().await?;
18304    /// # Ok(()) }
18305    ///
18306    /// fn prepare_request_builder() -> DeleteUrlList {
18307    ///   # panic!();
18308    ///   // ... details omitted ...
18309    /// }
18310    /// ```
18311    #[derive(Clone, Debug)]
18312    pub struct DeleteUrlList(RequestBuilder<crate::model::DeleteUrlListRequest>);
18313
18314    impl DeleteUrlList {
18315        pub(crate) fn new(
18316            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18317        ) -> Self {
18318            Self(RequestBuilder::new(stub))
18319        }
18320
18321        /// Sets the full request, replacing any prior values.
18322        pub fn with_request<V: Into<crate::model::DeleteUrlListRequest>>(mut self, v: V) -> Self {
18323            self.0.request = v.into();
18324            self
18325        }
18326
18327        /// Sets all the options, replacing any prior values.
18328        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18329            self.0.options = v.into();
18330            self
18331        }
18332
18333        /// Sends the request.
18334        ///
18335        /// # Long running operations
18336        ///
18337        /// This starts, but does not poll, a longrunning operation. More information
18338        /// on [delete_url_list][crate::client::NetworkSecurity::delete_url_list].
18339        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18340            (*self.0.stub)
18341                .delete_url_list(self.0.request, self.0.options)
18342                .await
18343                .map(crate::Response::into_body)
18344        }
18345
18346        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_url_list`.
18347        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18348            type Operation =
18349                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18350            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18351            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18352
18353            let stub = self.0.stub.clone();
18354            let mut options = self.0.options.clone();
18355            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18356            let query = move |name| {
18357                let stub = stub.clone();
18358                let options = options.clone();
18359                async {
18360                    let op = GetOperation::new(stub)
18361                        .set_name(name)
18362                        .with_options(options)
18363                        .send()
18364                        .await?;
18365                    Ok(Operation::new(op))
18366                }
18367            };
18368
18369            let start = move || async {
18370                let op = self.send().await?;
18371                Ok(Operation::new(op))
18372            };
18373
18374            google_cloud_lro::internal::new_unit_response_poller(
18375                polling_error_policy,
18376                polling_backoff_policy,
18377                start,
18378                query,
18379            )
18380        }
18381
18382        /// Sets the value of [name][crate::model::DeleteUrlListRequest::name].
18383        ///
18384        /// This is a **required** field for requests.
18385        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18386            self.0.request.name = v.into();
18387            self
18388        }
18389    }
18390
18391    #[doc(hidden)]
18392    impl crate::RequestBuilder for DeleteUrlList {
18393        fn request_options(&mut self) -> &mut crate::RequestOptions {
18394            &mut self.0.options
18395        }
18396    }
18397
18398    /// The request builder for [NetworkSecurity::list_tls_inspection_policies][crate::client::NetworkSecurity::list_tls_inspection_policies] calls.
18399    ///
18400    /// # Example
18401    /// ```
18402    /// # use google_cloud_networksecurity_v1::builder::network_security::ListTlsInspectionPolicies;
18403    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18404    /// use google_cloud_gax::paginator::ItemPaginator;
18405    ///
18406    /// let builder = prepare_request_builder();
18407    /// let mut items = builder.by_item();
18408    /// while let Some(result) = items.next().await {
18409    ///   let item = result?;
18410    /// }
18411    /// # Ok(()) }
18412    ///
18413    /// fn prepare_request_builder() -> ListTlsInspectionPolicies {
18414    ///   # panic!();
18415    ///   // ... details omitted ...
18416    /// }
18417    /// ```
18418    #[derive(Clone, Debug)]
18419    pub struct ListTlsInspectionPolicies(
18420        RequestBuilder<crate::model::ListTlsInspectionPoliciesRequest>,
18421    );
18422
18423    impl ListTlsInspectionPolicies {
18424        pub(crate) fn new(
18425            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18426        ) -> Self {
18427            Self(RequestBuilder::new(stub))
18428        }
18429
18430        /// Sets the full request, replacing any prior values.
18431        pub fn with_request<V: Into<crate::model::ListTlsInspectionPoliciesRequest>>(
18432            mut self,
18433            v: V,
18434        ) -> Self {
18435            self.0.request = v.into();
18436            self
18437        }
18438
18439        /// Sets all the options, replacing any prior values.
18440        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18441            self.0.options = v.into();
18442            self
18443        }
18444
18445        /// Sends the request.
18446        pub async fn send(self) -> Result<crate::model::ListTlsInspectionPoliciesResponse> {
18447            (*self.0.stub)
18448                .list_tls_inspection_policies(self.0.request, self.0.options)
18449                .await
18450                .map(crate::Response::into_body)
18451        }
18452
18453        /// Streams each page in the collection.
18454        pub fn by_page(
18455            self,
18456        ) -> impl google_cloud_gax::paginator::Paginator<
18457            crate::model::ListTlsInspectionPoliciesResponse,
18458            crate::Error,
18459        > {
18460            use std::clone::Clone;
18461            let token = self.0.request.page_token.clone();
18462            let execute = move |token: String| {
18463                let mut builder = self.clone();
18464                builder.0.request = builder.0.request.set_page_token(token);
18465                builder.send()
18466            };
18467            google_cloud_gax::paginator::internal::new_paginator(token, execute)
18468        }
18469
18470        /// Streams each item in the collection.
18471        pub fn by_item(
18472            self,
18473        ) -> impl google_cloud_gax::paginator::ItemPaginator<
18474            crate::model::ListTlsInspectionPoliciesResponse,
18475            crate::Error,
18476        > {
18477            use google_cloud_gax::paginator::Paginator;
18478            self.by_page().items()
18479        }
18480
18481        /// Sets the value of [parent][crate::model::ListTlsInspectionPoliciesRequest::parent].
18482        ///
18483        /// This is a **required** field for requests.
18484        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18485            self.0.request.parent = v.into();
18486            self
18487        }
18488
18489        /// Sets the value of [page_size][crate::model::ListTlsInspectionPoliciesRequest::page_size].
18490        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18491            self.0.request.page_size = v.into();
18492            self
18493        }
18494
18495        /// Sets the value of [page_token][crate::model::ListTlsInspectionPoliciesRequest::page_token].
18496        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18497            self.0.request.page_token = v.into();
18498            self
18499        }
18500    }
18501
18502    #[doc(hidden)]
18503    impl crate::RequestBuilder for ListTlsInspectionPolicies {
18504        fn request_options(&mut self) -> &mut crate::RequestOptions {
18505            &mut self.0.options
18506        }
18507    }
18508
18509    /// The request builder for [NetworkSecurity::get_tls_inspection_policy][crate::client::NetworkSecurity::get_tls_inspection_policy] calls.
18510    ///
18511    /// # Example
18512    /// ```
18513    /// # use google_cloud_networksecurity_v1::builder::network_security::GetTlsInspectionPolicy;
18514    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18515    ///
18516    /// let builder = prepare_request_builder();
18517    /// let response = builder.send().await?;
18518    /// # Ok(()) }
18519    ///
18520    /// fn prepare_request_builder() -> GetTlsInspectionPolicy {
18521    ///   # panic!();
18522    ///   // ... details omitted ...
18523    /// }
18524    /// ```
18525    #[derive(Clone, Debug)]
18526    pub struct GetTlsInspectionPolicy(RequestBuilder<crate::model::GetTlsInspectionPolicyRequest>);
18527
18528    impl GetTlsInspectionPolicy {
18529        pub(crate) fn new(
18530            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18531        ) -> Self {
18532            Self(RequestBuilder::new(stub))
18533        }
18534
18535        /// Sets the full request, replacing any prior values.
18536        pub fn with_request<V: Into<crate::model::GetTlsInspectionPolicyRequest>>(
18537            mut self,
18538            v: V,
18539        ) -> Self {
18540            self.0.request = v.into();
18541            self
18542        }
18543
18544        /// Sets all the options, replacing any prior values.
18545        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18546            self.0.options = v.into();
18547            self
18548        }
18549
18550        /// Sends the request.
18551        pub async fn send(self) -> Result<crate::model::TlsInspectionPolicy> {
18552            (*self.0.stub)
18553                .get_tls_inspection_policy(self.0.request, self.0.options)
18554                .await
18555                .map(crate::Response::into_body)
18556        }
18557
18558        /// Sets the value of [name][crate::model::GetTlsInspectionPolicyRequest::name].
18559        ///
18560        /// This is a **required** field for requests.
18561        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18562            self.0.request.name = v.into();
18563            self
18564        }
18565    }
18566
18567    #[doc(hidden)]
18568    impl crate::RequestBuilder for GetTlsInspectionPolicy {
18569        fn request_options(&mut self) -> &mut crate::RequestOptions {
18570            &mut self.0.options
18571        }
18572    }
18573
18574    /// The request builder for [NetworkSecurity::create_tls_inspection_policy][crate::client::NetworkSecurity::create_tls_inspection_policy] calls.
18575    ///
18576    /// # Example
18577    /// ```
18578    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateTlsInspectionPolicy;
18579    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18580    /// use google_cloud_lro::Poller;
18581    ///
18582    /// let builder = prepare_request_builder();
18583    /// let response = builder.poller().until_done().await?;
18584    /// # Ok(()) }
18585    ///
18586    /// fn prepare_request_builder() -> CreateTlsInspectionPolicy {
18587    ///   # panic!();
18588    ///   // ... details omitted ...
18589    /// }
18590    /// ```
18591    #[derive(Clone, Debug)]
18592    pub struct CreateTlsInspectionPolicy(
18593        RequestBuilder<crate::model::CreateTlsInspectionPolicyRequest>,
18594    );
18595
18596    impl CreateTlsInspectionPolicy {
18597        pub(crate) fn new(
18598            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18599        ) -> Self {
18600            Self(RequestBuilder::new(stub))
18601        }
18602
18603        /// Sets the full request, replacing any prior values.
18604        pub fn with_request<V: Into<crate::model::CreateTlsInspectionPolicyRequest>>(
18605            mut self,
18606            v: V,
18607        ) -> Self {
18608            self.0.request = v.into();
18609            self
18610        }
18611
18612        /// Sets all the options, replacing any prior values.
18613        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18614            self.0.options = v.into();
18615            self
18616        }
18617
18618        /// Sends the request.
18619        ///
18620        /// # Long running operations
18621        ///
18622        /// This starts, but does not poll, a longrunning operation. More information
18623        /// on [create_tls_inspection_policy][crate::client::NetworkSecurity::create_tls_inspection_policy].
18624        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18625            (*self.0.stub)
18626                .create_tls_inspection_policy(self.0.request, self.0.options)
18627                .await
18628                .map(crate::Response::into_body)
18629        }
18630
18631        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_tls_inspection_policy`.
18632        pub fn poller(
18633            self,
18634        ) -> impl google_cloud_lro::Poller<
18635            crate::model::TlsInspectionPolicy,
18636            crate::model::OperationMetadata,
18637        > {
18638            type Operation = google_cloud_lro::internal::Operation<
18639                crate::model::TlsInspectionPolicy,
18640                crate::model::OperationMetadata,
18641            >;
18642            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18643            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18644
18645            let stub = self.0.stub.clone();
18646            let mut options = self.0.options.clone();
18647            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18648            let query = move |name| {
18649                let stub = stub.clone();
18650                let options = options.clone();
18651                async {
18652                    let op = GetOperation::new(stub)
18653                        .set_name(name)
18654                        .with_options(options)
18655                        .send()
18656                        .await?;
18657                    Ok(Operation::new(op))
18658                }
18659            };
18660
18661            let start = move || async {
18662                let op = self.send().await?;
18663                Ok(Operation::new(op))
18664            };
18665
18666            google_cloud_lro::internal::new_poller(
18667                polling_error_policy,
18668                polling_backoff_policy,
18669                start,
18670                query,
18671            )
18672        }
18673
18674        /// Sets the value of [parent][crate::model::CreateTlsInspectionPolicyRequest::parent].
18675        ///
18676        /// This is a **required** field for requests.
18677        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18678            self.0.request.parent = v.into();
18679            self
18680        }
18681
18682        /// Sets the value of [tls_inspection_policy_id][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy_id].
18683        ///
18684        /// This is a **required** field for requests.
18685        pub fn set_tls_inspection_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18686            self.0.request.tls_inspection_policy_id = v.into();
18687            self
18688        }
18689
18690        /// Sets the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
18691        ///
18692        /// This is a **required** field for requests.
18693        pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
18694        where
18695            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18696        {
18697            self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
18698            self
18699        }
18700
18701        /// Sets or clears the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
18702        ///
18703        /// This is a **required** field for requests.
18704        pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
18705        where
18706            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18707        {
18708            self.0.request.tls_inspection_policy = v.map(|x| x.into());
18709            self
18710        }
18711    }
18712
18713    #[doc(hidden)]
18714    impl crate::RequestBuilder for CreateTlsInspectionPolicy {
18715        fn request_options(&mut self) -> &mut crate::RequestOptions {
18716            &mut self.0.options
18717        }
18718    }
18719
18720    /// The request builder for [NetworkSecurity::update_tls_inspection_policy][crate::client::NetworkSecurity::update_tls_inspection_policy] calls.
18721    ///
18722    /// # Example
18723    /// ```
18724    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateTlsInspectionPolicy;
18725    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18726    /// use google_cloud_lro::Poller;
18727    ///
18728    /// let builder = prepare_request_builder();
18729    /// let response = builder.poller().until_done().await?;
18730    /// # Ok(()) }
18731    ///
18732    /// fn prepare_request_builder() -> UpdateTlsInspectionPolicy {
18733    ///   # panic!();
18734    ///   // ... details omitted ...
18735    /// }
18736    /// ```
18737    #[derive(Clone, Debug)]
18738    pub struct UpdateTlsInspectionPolicy(
18739        RequestBuilder<crate::model::UpdateTlsInspectionPolicyRequest>,
18740    );
18741
18742    impl UpdateTlsInspectionPolicy {
18743        pub(crate) fn new(
18744            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18745        ) -> Self {
18746            Self(RequestBuilder::new(stub))
18747        }
18748
18749        /// Sets the full request, replacing any prior values.
18750        pub fn with_request<V: Into<crate::model::UpdateTlsInspectionPolicyRequest>>(
18751            mut self,
18752            v: V,
18753        ) -> Self {
18754            self.0.request = v.into();
18755            self
18756        }
18757
18758        /// Sets all the options, replacing any prior values.
18759        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18760            self.0.options = v.into();
18761            self
18762        }
18763
18764        /// Sends the request.
18765        ///
18766        /// # Long running operations
18767        ///
18768        /// This starts, but does not poll, a longrunning operation. More information
18769        /// on [update_tls_inspection_policy][crate::client::NetworkSecurity::update_tls_inspection_policy].
18770        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18771            (*self.0.stub)
18772                .update_tls_inspection_policy(self.0.request, self.0.options)
18773                .await
18774                .map(crate::Response::into_body)
18775        }
18776
18777        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_tls_inspection_policy`.
18778        pub fn poller(
18779            self,
18780        ) -> impl google_cloud_lro::Poller<
18781            crate::model::TlsInspectionPolicy,
18782            crate::model::OperationMetadata,
18783        > {
18784            type Operation = google_cloud_lro::internal::Operation<
18785                crate::model::TlsInspectionPolicy,
18786                crate::model::OperationMetadata,
18787            >;
18788            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18789            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18790
18791            let stub = self.0.stub.clone();
18792            let mut options = self.0.options.clone();
18793            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18794            let query = move |name| {
18795                let stub = stub.clone();
18796                let options = options.clone();
18797                async {
18798                    let op = GetOperation::new(stub)
18799                        .set_name(name)
18800                        .with_options(options)
18801                        .send()
18802                        .await?;
18803                    Ok(Operation::new(op))
18804                }
18805            };
18806
18807            let start = move || async {
18808                let op = self.send().await?;
18809                Ok(Operation::new(op))
18810            };
18811
18812            google_cloud_lro::internal::new_poller(
18813                polling_error_policy,
18814                polling_backoff_policy,
18815                start,
18816                query,
18817            )
18818        }
18819
18820        /// Sets the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
18821        pub fn set_update_mask<T>(mut self, v: T) -> Self
18822        where
18823            T: std::convert::Into<wkt::FieldMask>,
18824        {
18825            self.0.request.update_mask = std::option::Option::Some(v.into());
18826            self
18827        }
18828
18829        /// Sets or clears the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
18830        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18831        where
18832            T: std::convert::Into<wkt::FieldMask>,
18833        {
18834            self.0.request.update_mask = v.map(|x| x.into());
18835            self
18836        }
18837
18838        /// Sets the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
18839        ///
18840        /// This is a **required** field for requests.
18841        pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
18842        where
18843            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18844        {
18845            self.0.request.tls_inspection_policy = std::option::Option::Some(v.into());
18846            self
18847        }
18848
18849        /// Sets or clears the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
18850        ///
18851        /// This is a **required** field for requests.
18852        pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
18853        where
18854            T: std::convert::Into<crate::model::TlsInspectionPolicy>,
18855        {
18856            self.0.request.tls_inspection_policy = v.map(|x| x.into());
18857            self
18858        }
18859    }
18860
18861    #[doc(hidden)]
18862    impl crate::RequestBuilder for UpdateTlsInspectionPolicy {
18863        fn request_options(&mut self) -> &mut crate::RequestOptions {
18864            &mut self.0.options
18865        }
18866    }
18867
18868    /// The request builder for [NetworkSecurity::delete_tls_inspection_policy][crate::client::NetworkSecurity::delete_tls_inspection_policy] calls.
18869    ///
18870    /// # Example
18871    /// ```
18872    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteTlsInspectionPolicy;
18873    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18874    /// use google_cloud_lro::Poller;
18875    ///
18876    /// let builder = prepare_request_builder();
18877    /// let response = builder.poller().until_done().await?;
18878    /// # Ok(()) }
18879    ///
18880    /// fn prepare_request_builder() -> DeleteTlsInspectionPolicy {
18881    ///   # panic!();
18882    ///   // ... details omitted ...
18883    /// }
18884    /// ```
18885    #[derive(Clone, Debug)]
18886    pub struct DeleteTlsInspectionPolicy(
18887        RequestBuilder<crate::model::DeleteTlsInspectionPolicyRequest>,
18888    );
18889
18890    impl DeleteTlsInspectionPolicy {
18891        pub(crate) fn new(
18892            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
18893        ) -> Self {
18894            Self(RequestBuilder::new(stub))
18895        }
18896
18897        /// Sets the full request, replacing any prior values.
18898        pub fn with_request<V: Into<crate::model::DeleteTlsInspectionPolicyRequest>>(
18899            mut self,
18900            v: V,
18901        ) -> Self {
18902            self.0.request = v.into();
18903            self
18904        }
18905
18906        /// Sets all the options, replacing any prior values.
18907        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18908            self.0.options = v.into();
18909            self
18910        }
18911
18912        /// Sends the request.
18913        ///
18914        /// # Long running operations
18915        ///
18916        /// This starts, but does not poll, a longrunning operation. More information
18917        /// on [delete_tls_inspection_policy][crate::client::NetworkSecurity::delete_tls_inspection_policy].
18918        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18919            (*self.0.stub)
18920                .delete_tls_inspection_policy(self.0.request, self.0.options)
18921                .await
18922                .map(crate::Response::into_body)
18923        }
18924
18925        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_tls_inspection_policy`.
18926        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18927            type Operation =
18928                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18929            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18930            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18931
18932            let stub = self.0.stub.clone();
18933            let mut options = self.0.options.clone();
18934            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18935            let query = move |name| {
18936                let stub = stub.clone();
18937                let options = options.clone();
18938                async {
18939                    let op = GetOperation::new(stub)
18940                        .set_name(name)
18941                        .with_options(options)
18942                        .send()
18943                        .await?;
18944                    Ok(Operation::new(op))
18945                }
18946            };
18947
18948            let start = move || async {
18949                let op = self.send().await?;
18950                Ok(Operation::new(op))
18951            };
18952
18953            google_cloud_lro::internal::new_unit_response_poller(
18954                polling_error_policy,
18955                polling_backoff_policy,
18956                start,
18957                query,
18958            )
18959        }
18960
18961        /// Sets the value of [name][crate::model::DeleteTlsInspectionPolicyRequest::name].
18962        ///
18963        /// This is a **required** field for requests.
18964        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18965            self.0.request.name = v.into();
18966            self
18967        }
18968
18969        /// Sets the value of [force][crate::model::DeleteTlsInspectionPolicyRequest::force].
18970        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
18971            self.0.request.force = v.into();
18972            self
18973        }
18974    }
18975
18976    #[doc(hidden)]
18977    impl crate::RequestBuilder for DeleteTlsInspectionPolicy {
18978        fn request_options(&mut self) -> &mut crate::RequestOptions {
18979            &mut self.0.options
18980        }
18981    }
18982
18983    /// The request builder for [NetworkSecurity::list_authz_policies][crate::client::NetworkSecurity::list_authz_policies] calls.
18984    ///
18985    /// # Example
18986    /// ```
18987    /// # use google_cloud_networksecurity_v1::builder::network_security::ListAuthzPolicies;
18988    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
18989    /// use google_cloud_gax::paginator::ItemPaginator;
18990    ///
18991    /// let builder = prepare_request_builder();
18992    /// let mut items = builder.by_item();
18993    /// while let Some(result) = items.next().await {
18994    ///   let item = result?;
18995    /// }
18996    /// # Ok(()) }
18997    ///
18998    /// fn prepare_request_builder() -> ListAuthzPolicies {
18999    ///   # panic!();
19000    ///   // ... details omitted ...
19001    /// }
19002    /// ```
19003    #[derive(Clone, Debug)]
19004    pub struct ListAuthzPolicies(RequestBuilder<crate::model::ListAuthzPoliciesRequest>);
19005
19006    impl ListAuthzPolicies {
19007        pub(crate) fn new(
19008            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19009        ) -> Self {
19010            Self(RequestBuilder::new(stub))
19011        }
19012
19013        /// Sets the full request, replacing any prior values.
19014        pub fn with_request<V: Into<crate::model::ListAuthzPoliciesRequest>>(
19015            mut self,
19016            v: V,
19017        ) -> Self {
19018            self.0.request = v.into();
19019            self
19020        }
19021
19022        /// Sets all the options, replacing any prior values.
19023        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19024            self.0.options = v.into();
19025            self
19026        }
19027
19028        /// Sends the request.
19029        pub async fn send(self) -> Result<crate::model::ListAuthzPoliciesResponse> {
19030            (*self.0.stub)
19031                .list_authz_policies(self.0.request, self.0.options)
19032                .await
19033                .map(crate::Response::into_body)
19034        }
19035
19036        /// Streams each page in the collection.
19037        pub fn by_page(
19038            self,
19039        ) -> impl google_cloud_gax::paginator::Paginator<
19040            crate::model::ListAuthzPoliciesResponse,
19041            crate::Error,
19042        > {
19043            use std::clone::Clone;
19044            let token = self.0.request.page_token.clone();
19045            let execute = move |token: String| {
19046                let mut builder = self.clone();
19047                builder.0.request = builder.0.request.set_page_token(token);
19048                builder.send()
19049            };
19050            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19051        }
19052
19053        /// Streams each item in the collection.
19054        pub fn by_item(
19055            self,
19056        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19057            crate::model::ListAuthzPoliciesResponse,
19058            crate::Error,
19059        > {
19060            use google_cloud_gax::paginator::Paginator;
19061            self.by_page().items()
19062        }
19063
19064        /// Sets the value of [parent][crate::model::ListAuthzPoliciesRequest::parent].
19065        ///
19066        /// This is a **required** field for requests.
19067        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19068            self.0.request.parent = v.into();
19069            self
19070        }
19071
19072        /// Sets the value of [page_size][crate::model::ListAuthzPoliciesRequest::page_size].
19073        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19074            self.0.request.page_size = v.into();
19075            self
19076        }
19077
19078        /// Sets the value of [page_token][crate::model::ListAuthzPoliciesRequest::page_token].
19079        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19080            self.0.request.page_token = v.into();
19081            self
19082        }
19083
19084        /// Sets the value of [filter][crate::model::ListAuthzPoliciesRequest::filter].
19085        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19086            self.0.request.filter = v.into();
19087            self
19088        }
19089
19090        /// Sets the value of [order_by][crate::model::ListAuthzPoliciesRequest::order_by].
19091        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
19092            self.0.request.order_by = v.into();
19093            self
19094        }
19095    }
19096
19097    #[doc(hidden)]
19098    impl crate::RequestBuilder for ListAuthzPolicies {
19099        fn request_options(&mut self) -> &mut crate::RequestOptions {
19100            &mut self.0.options
19101        }
19102    }
19103
19104    /// The request builder for [NetworkSecurity::get_authz_policy][crate::client::NetworkSecurity::get_authz_policy] calls.
19105    ///
19106    /// # Example
19107    /// ```
19108    /// # use google_cloud_networksecurity_v1::builder::network_security::GetAuthzPolicy;
19109    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19110    ///
19111    /// let builder = prepare_request_builder();
19112    /// let response = builder.send().await?;
19113    /// # Ok(()) }
19114    ///
19115    /// fn prepare_request_builder() -> GetAuthzPolicy {
19116    ///   # panic!();
19117    ///   // ... details omitted ...
19118    /// }
19119    /// ```
19120    #[derive(Clone, Debug)]
19121    pub struct GetAuthzPolicy(RequestBuilder<crate::model::GetAuthzPolicyRequest>);
19122
19123    impl GetAuthzPolicy {
19124        pub(crate) fn new(
19125            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19126        ) -> Self {
19127            Self(RequestBuilder::new(stub))
19128        }
19129
19130        /// Sets the full request, replacing any prior values.
19131        pub fn with_request<V: Into<crate::model::GetAuthzPolicyRequest>>(mut self, v: V) -> Self {
19132            self.0.request = v.into();
19133            self
19134        }
19135
19136        /// Sets all the options, replacing any prior values.
19137        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19138            self.0.options = v.into();
19139            self
19140        }
19141
19142        /// Sends the request.
19143        pub async fn send(self) -> Result<crate::model::AuthzPolicy> {
19144            (*self.0.stub)
19145                .get_authz_policy(self.0.request, self.0.options)
19146                .await
19147                .map(crate::Response::into_body)
19148        }
19149
19150        /// Sets the value of [name][crate::model::GetAuthzPolicyRequest::name].
19151        ///
19152        /// This is a **required** field for requests.
19153        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19154            self.0.request.name = v.into();
19155            self
19156        }
19157    }
19158
19159    #[doc(hidden)]
19160    impl crate::RequestBuilder for GetAuthzPolicy {
19161        fn request_options(&mut self) -> &mut crate::RequestOptions {
19162            &mut self.0.options
19163        }
19164    }
19165
19166    /// The request builder for [NetworkSecurity::create_authz_policy][crate::client::NetworkSecurity::create_authz_policy] calls.
19167    ///
19168    /// # Example
19169    /// ```
19170    /// # use google_cloud_networksecurity_v1::builder::network_security::CreateAuthzPolicy;
19171    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19172    /// use google_cloud_lro::Poller;
19173    ///
19174    /// let builder = prepare_request_builder();
19175    /// let response = builder.poller().until_done().await?;
19176    /// # Ok(()) }
19177    ///
19178    /// fn prepare_request_builder() -> CreateAuthzPolicy {
19179    ///   # panic!();
19180    ///   // ... details omitted ...
19181    /// }
19182    /// ```
19183    #[derive(Clone, Debug)]
19184    pub struct CreateAuthzPolicy(RequestBuilder<crate::model::CreateAuthzPolicyRequest>);
19185
19186    impl CreateAuthzPolicy {
19187        pub(crate) fn new(
19188            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19189        ) -> Self {
19190            Self(RequestBuilder::new(stub))
19191        }
19192
19193        /// Sets the full request, replacing any prior values.
19194        pub fn with_request<V: Into<crate::model::CreateAuthzPolicyRequest>>(
19195            mut self,
19196            v: V,
19197        ) -> Self {
19198            self.0.request = v.into();
19199            self
19200        }
19201
19202        /// Sets all the options, replacing any prior values.
19203        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19204            self.0.options = v.into();
19205            self
19206        }
19207
19208        /// Sends the request.
19209        ///
19210        /// # Long running operations
19211        ///
19212        /// This starts, but does not poll, a longrunning operation. More information
19213        /// on [create_authz_policy][crate::client::NetworkSecurity::create_authz_policy].
19214        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19215            (*self.0.stub)
19216                .create_authz_policy(self.0.request, self.0.options)
19217                .await
19218                .map(crate::Response::into_body)
19219        }
19220
19221        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_authz_policy`.
19222        pub fn poller(
19223            self,
19224        ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
19225        {
19226            type Operation = google_cloud_lro::internal::Operation<
19227                crate::model::AuthzPolicy,
19228                crate::model::OperationMetadata,
19229            >;
19230            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19231            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19232
19233            let stub = self.0.stub.clone();
19234            let mut options = self.0.options.clone();
19235            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19236            let query = move |name| {
19237                let stub = stub.clone();
19238                let options = options.clone();
19239                async {
19240                    let op = GetOperation::new(stub)
19241                        .set_name(name)
19242                        .with_options(options)
19243                        .send()
19244                        .await?;
19245                    Ok(Operation::new(op))
19246                }
19247            };
19248
19249            let start = move || async {
19250                let op = self.send().await?;
19251                Ok(Operation::new(op))
19252            };
19253
19254            google_cloud_lro::internal::new_poller(
19255                polling_error_policy,
19256                polling_backoff_policy,
19257                start,
19258                query,
19259            )
19260        }
19261
19262        /// Sets the value of [parent][crate::model::CreateAuthzPolicyRequest::parent].
19263        ///
19264        /// This is a **required** field for requests.
19265        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19266            self.0.request.parent = v.into();
19267            self
19268        }
19269
19270        /// Sets the value of [authz_policy_id][crate::model::CreateAuthzPolicyRequest::authz_policy_id].
19271        ///
19272        /// This is a **required** field for requests.
19273        pub fn set_authz_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19274            self.0.request.authz_policy_id = v.into();
19275            self
19276        }
19277
19278        /// Sets the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
19279        ///
19280        /// This is a **required** field for requests.
19281        pub fn set_authz_policy<T>(mut self, v: T) -> Self
19282        where
19283            T: std::convert::Into<crate::model::AuthzPolicy>,
19284        {
19285            self.0.request.authz_policy = std::option::Option::Some(v.into());
19286            self
19287        }
19288
19289        /// Sets or clears the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
19290        ///
19291        /// This is a **required** field for requests.
19292        pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
19293        where
19294            T: std::convert::Into<crate::model::AuthzPolicy>,
19295        {
19296            self.0.request.authz_policy = v.map(|x| x.into());
19297            self
19298        }
19299
19300        /// Sets the value of [request_id][crate::model::CreateAuthzPolicyRequest::request_id].
19301        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19302            self.0.request.request_id = v.into();
19303            self
19304        }
19305    }
19306
19307    #[doc(hidden)]
19308    impl crate::RequestBuilder for CreateAuthzPolicy {
19309        fn request_options(&mut self) -> &mut crate::RequestOptions {
19310            &mut self.0.options
19311        }
19312    }
19313
19314    /// The request builder for [NetworkSecurity::update_authz_policy][crate::client::NetworkSecurity::update_authz_policy] calls.
19315    ///
19316    /// # Example
19317    /// ```
19318    /// # use google_cloud_networksecurity_v1::builder::network_security::UpdateAuthzPolicy;
19319    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19320    /// use google_cloud_lro::Poller;
19321    ///
19322    /// let builder = prepare_request_builder();
19323    /// let response = builder.poller().until_done().await?;
19324    /// # Ok(()) }
19325    ///
19326    /// fn prepare_request_builder() -> UpdateAuthzPolicy {
19327    ///   # panic!();
19328    ///   // ... details omitted ...
19329    /// }
19330    /// ```
19331    #[derive(Clone, Debug)]
19332    pub struct UpdateAuthzPolicy(RequestBuilder<crate::model::UpdateAuthzPolicyRequest>);
19333
19334    impl UpdateAuthzPolicy {
19335        pub(crate) fn new(
19336            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19337        ) -> Self {
19338            Self(RequestBuilder::new(stub))
19339        }
19340
19341        /// Sets the full request, replacing any prior values.
19342        pub fn with_request<V: Into<crate::model::UpdateAuthzPolicyRequest>>(
19343            mut self,
19344            v: V,
19345        ) -> Self {
19346            self.0.request = v.into();
19347            self
19348        }
19349
19350        /// Sets all the options, replacing any prior values.
19351        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19352            self.0.options = v.into();
19353            self
19354        }
19355
19356        /// Sends the request.
19357        ///
19358        /// # Long running operations
19359        ///
19360        /// This starts, but does not poll, a longrunning operation. More information
19361        /// on [update_authz_policy][crate::client::NetworkSecurity::update_authz_policy].
19362        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19363            (*self.0.stub)
19364                .update_authz_policy(self.0.request, self.0.options)
19365                .await
19366                .map(crate::Response::into_body)
19367        }
19368
19369        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_authz_policy`.
19370        pub fn poller(
19371            self,
19372        ) -> impl google_cloud_lro::Poller<crate::model::AuthzPolicy, crate::model::OperationMetadata>
19373        {
19374            type Operation = google_cloud_lro::internal::Operation<
19375                crate::model::AuthzPolicy,
19376                crate::model::OperationMetadata,
19377            >;
19378            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19379            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19380
19381            let stub = self.0.stub.clone();
19382            let mut options = self.0.options.clone();
19383            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19384            let query = move |name| {
19385                let stub = stub.clone();
19386                let options = options.clone();
19387                async {
19388                    let op = GetOperation::new(stub)
19389                        .set_name(name)
19390                        .with_options(options)
19391                        .send()
19392                        .await?;
19393                    Ok(Operation::new(op))
19394                }
19395            };
19396
19397            let start = move || async {
19398                let op = self.send().await?;
19399                Ok(Operation::new(op))
19400            };
19401
19402            google_cloud_lro::internal::new_poller(
19403                polling_error_policy,
19404                polling_backoff_policy,
19405                start,
19406                query,
19407            )
19408        }
19409
19410        /// Sets the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
19411        ///
19412        /// This is a **required** field for requests.
19413        pub fn set_update_mask<T>(mut self, v: T) -> Self
19414        where
19415            T: std::convert::Into<wkt::FieldMask>,
19416        {
19417            self.0.request.update_mask = std::option::Option::Some(v.into());
19418            self
19419        }
19420
19421        /// Sets or clears the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
19422        ///
19423        /// This is a **required** field for requests.
19424        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19425        where
19426            T: std::convert::Into<wkt::FieldMask>,
19427        {
19428            self.0.request.update_mask = v.map(|x| x.into());
19429            self
19430        }
19431
19432        /// Sets the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
19433        ///
19434        /// This is a **required** field for requests.
19435        pub fn set_authz_policy<T>(mut self, v: T) -> Self
19436        where
19437            T: std::convert::Into<crate::model::AuthzPolicy>,
19438        {
19439            self.0.request.authz_policy = std::option::Option::Some(v.into());
19440            self
19441        }
19442
19443        /// Sets or clears the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
19444        ///
19445        /// This is a **required** field for requests.
19446        pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
19447        where
19448            T: std::convert::Into<crate::model::AuthzPolicy>,
19449        {
19450            self.0.request.authz_policy = v.map(|x| x.into());
19451            self
19452        }
19453
19454        /// Sets the value of [request_id][crate::model::UpdateAuthzPolicyRequest::request_id].
19455        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19456            self.0.request.request_id = v.into();
19457            self
19458        }
19459    }
19460
19461    #[doc(hidden)]
19462    impl crate::RequestBuilder for UpdateAuthzPolicy {
19463        fn request_options(&mut self) -> &mut crate::RequestOptions {
19464            &mut self.0.options
19465        }
19466    }
19467
19468    /// The request builder for [NetworkSecurity::delete_authz_policy][crate::client::NetworkSecurity::delete_authz_policy] calls.
19469    ///
19470    /// # Example
19471    /// ```
19472    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteAuthzPolicy;
19473    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19474    /// use google_cloud_lro::Poller;
19475    ///
19476    /// let builder = prepare_request_builder();
19477    /// let response = builder.poller().until_done().await?;
19478    /// # Ok(()) }
19479    ///
19480    /// fn prepare_request_builder() -> DeleteAuthzPolicy {
19481    ///   # panic!();
19482    ///   // ... details omitted ...
19483    /// }
19484    /// ```
19485    #[derive(Clone, Debug)]
19486    pub struct DeleteAuthzPolicy(RequestBuilder<crate::model::DeleteAuthzPolicyRequest>);
19487
19488    impl DeleteAuthzPolicy {
19489        pub(crate) fn new(
19490            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19491        ) -> Self {
19492            Self(RequestBuilder::new(stub))
19493        }
19494
19495        /// Sets the full request, replacing any prior values.
19496        pub fn with_request<V: Into<crate::model::DeleteAuthzPolicyRequest>>(
19497            mut self,
19498            v: V,
19499        ) -> Self {
19500            self.0.request = v.into();
19501            self
19502        }
19503
19504        /// Sets all the options, replacing any prior values.
19505        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19506            self.0.options = v.into();
19507            self
19508        }
19509
19510        /// Sends the request.
19511        ///
19512        /// # Long running operations
19513        ///
19514        /// This starts, but does not poll, a longrunning operation. More information
19515        /// on [delete_authz_policy][crate::client::NetworkSecurity::delete_authz_policy].
19516        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19517            (*self.0.stub)
19518                .delete_authz_policy(self.0.request, self.0.options)
19519                .await
19520                .map(crate::Response::into_body)
19521        }
19522
19523        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_authz_policy`.
19524        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
19525            type Operation =
19526                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
19527            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19528            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19529
19530            let stub = self.0.stub.clone();
19531            let mut options = self.0.options.clone();
19532            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19533            let query = move |name| {
19534                let stub = stub.clone();
19535                let options = options.clone();
19536                async {
19537                    let op = GetOperation::new(stub)
19538                        .set_name(name)
19539                        .with_options(options)
19540                        .send()
19541                        .await?;
19542                    Ok(Operation::new(op))
19543                }
19544            };
19545
19546            let start = move || async {
19547                let op = self.send().await?;
19548                Ok(Operation::new(op))
19549            };
19550
19551            google_cloud_lro::internal::new_unit_response_poller(
19552                polling_error_policy,
19553                polling_backoff_policy,
19554                start,
19555                query,
19556            )
19557        }
19558
19559        /// Sets the value of [name][crate::model::DeleteAuthzPolicyRequest::name].
19560        ///
19561        /// This is a **required** field for requests.
19562        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19563            self.0.request.name = v.into();
19564            self
19565        }
19566
19567        /// Sets the value of [request_id][crate::model::DeleteAuthzPolicyRequest::request_id].
19568        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19569            self.0.request.request_id = v.into();
19570            self
19571        }
19572    }
19573
19574    #[doc(hidden)]
19575    impl crate::RequestBuilder for DeleteAuthzPolicy {
19576        fn request_options(&mut self) -> &mut crate::RequestOptions {
19577            &mut self.0.options
19578        }
19579    }
19580
19581    /// The request builder for [NetworkSecurity::list_locations][crate::client::NetworkSecurity::list_locations] calls.
19582    ///
19583    /// # Example
19584    /// ```
19585    /// # use google_cloud_networksecurity_v1::builder::network_security::ListLocations;
19586    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19587    /// use google_cloud_gax::paginator::ItemPaginator;
19588    ///
19589    /// let builder = prepare_request_builder();
19590    /// let mut items = builder.by_item();
19591    /// while let Some(result) = items.next().await {
19592    ///   let item = result?;
19593    /// }
19594    /// # Ok(()) }
19595    ///
19596    /// fn prepare_request_builder() -> ListLocations {
19597    ///   # panic!();
19598    ///   // ... details omitted ...
19599    /// }
19600    /// ```
19601    #[derive(Clone, Debug)]
19602    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
19603
19604    impl ListLocations {
19605        pub(crate) fn new(
19606            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19607        ) -> Self {
19608            Self(RequestBuilder::new(stub))
19609        }
19610
19611        /// Sets the full request, replacing any prior values.
19612        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
19613            mut self,
19614            v: V,
19615        ) -> Self {
19616            self.0.request = v.into();
19617            self
19618        }
19619
19620        /// Sets all the options, replacing any prior values.
19621        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19622            self.0.options = v.into();
19623            self
19624        }
19625
19626        /// Sends the request.
19627        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
19628            (*self.0.stub)
19629                .list_locations(self.0.request, self.0.options)
19630                .await
19631                .map(crate::Response::into_body)
19632        }
19633
19634        /// Streams each page in the collection.
19635        pub fn by_page(
19636            self,
19637        ) -> impl google_cloud_gax::paginator::Paginator<
19638            google_cloud_location::model::ListLocationsResponse,
19639            crate::Error,
19640        > {
19641            use std::clone::Clone;
19642            let token = self.0.request.page_token.clone();
19643            let execute = move |token: String| {
19644                let mut builder = self.clone();
19645                builder.0.request = builder.0.request.set_page_token(token);
19646                builder.send()
19647            };
19648            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19649        }
19650
19651        /// Streams each item in the collection.
19652        pub fn by_item(
19653            self,
19654        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19655            google_cloud_location::model::ListLocationsResponse,
19656            crate::Error,
19657        > {
19658            use google_cloud_gax::paginator::Paginator;
19659            self.by_page().items()
19660        }
19661
19662        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
19663        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19664            self.0.request.name = v.into();
19665            self
19666        }
19667
19668        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
19669        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19670            self.0.request.filter = v.into();
19671            self
19672        }
19673
19674        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
19675        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19676            self.0.request.page_size = v.into();
19677            self
19678        }
19679
19680        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
19681        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19682            self.0.request.page_token = v.into();
19683            self
19684        }
19685    }
19686
19687    #[doc(hidden)]
19688    impl crate::RequestBuilder for ListLocations {
19689        fn request_options(&mut self) -> &mut crate::RequestOptions {
19690            &mut self.0.options
19691        }
19692    }
19693
19694    /// The request builder for [NetworkSecurity::get_location][crate::client::NetworkSecurity::get_location] calls.
19695    ///
19696    /// # Example
19697    /// ```
19698    /// # use google_cloud_networksecurity_v1::builder::network_security::GetLocation;
19699    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19700    ///
19701    /// let builder = prepare_request_builder();
19702    /// let response = builder.send().await?;
19703    /// # Ok(()) }
19704    ///
19705    /// fn prepare_request_builder() -> GetLocation {
19706    ///   # panic!();
19707    ///   // ... details omitted ...
19708    /// }
19709    /// ```
19710    #[derive(Clone, Debug)]
19711    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
19712
19713    impl GetLocation {
19714        pub(crate) fn new(
19715            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19716        ) -> Self {
19717            Self(RequestBuilder::new(stub))
19718        }
19719
19720        /// Sets the full request, replacing any prior values.
19721        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
19722            mut self,
19723            v: V,
19724        ) -> Self {
19725            self.0.request = v.into();
19726            self
19727        }
19728
19729        /// Sets all the options, replacing any prior values.
19730        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19731            self.0.options = v.into();
19732            self
19733        }
19734
19735        /// Sends the request.
19736        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
19737            (*self.0.stub)
19738                .get_location(self.0.request, self.0.options)
19739                .await
19740                .map(crate::Response::into_body)
19741        }
19742
19743        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
19744        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19745            self.0.request.name = v.into();
19746            self
19747        }
19748    }
19749
19750    #[doc(hidden)]
19751    impl crate::RequestBuilder for GetLocation {
19752        fn request_options(&mut self) -> &mut crate::RequestOptions {
19753            &mut self.0.options
19754        }
19755    }
19756
19757    /// The request builder for [NetworkSecurity::set_iam_policy][crate::client::NetworkSecurity::set_iam_policy] calls.
19758    ///
19759    /// # Example
19760    /// ```
19761    /// # use google_cloud_networksecurity_v1::builder::network_security::SetIamPolicy;
19762    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19763    ///
19764    /// let builder = prepare_request_builder();
19765    /// let response = builder.send().await?;
19766    /// # Ok(()) }
19767    ///
19768    /// fn prepare_request_builder() -> SetIamPolicy {
19769    ///   # panic!();
19770    ///   // ... details omitted ...
19771    /// }
19772    /// ```
19773    #[derive(Clone, Debug)]
19774    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
19775
19776    impl SetIamPolicy {
19777        pub(crate) fn new(
19778            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19779        ) -> Self {
19780            Self(RequestBuilder::new(stub))
19781        }
19782
19783        /// Sets the full request, replacing any prior values.
19784        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
19785            mut self,
19786            v: V,
19787        ) -> Self {
19788            self.0.request = v.into();
19789            self
19790        }
19791
19792        /// Sets all the options, replacing any prior values.
19793        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19794            self.0.options = v.into();
19795            self
19796        }
19797
19798        /// Sends the request.
19799        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
19800            (*self.0.stub)
19801                .set_iam_policy(self.0.request, self.0.options)
19802                .await
19803                .map(crate::Response::into_body)
19804        }
19805
19806        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
19807        ///
19808        /// This is a **required** field for requests.
19809        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19810            self.0.request.resource = v.into();
19811            self
19812        }
19813
19814        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
19815        ///
19816        /// This is a **required** field for requests.
19817        pub fn set_policy<T>(mut self, v: T) -> Self
19818        where
19819            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
19820        {
19821            self.0.request.policy = std::option::Option::Some(v.into());
19822            self
19823        }
19824
19825        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
19826        ///
19827        /// This is a **required** field for requests.
19828        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
19829        where
19830            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
19831        {
19832            self.0.request.policy = v.map(|x| x.into());
19833            self
19834        }
19835
19836        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
19837        pub fn set_update_mask<T>(mut self, v: T) -> Self
19838        where
19839            T: std::convert::Into<wkt::FieldMask>,
19840        {
19841            self.0.request.update_mask = std::option::Option::Some(v.into());
19842            self
19843        }
19844
19845        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
19846        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19847        where
19848            T: std::convert::Into<wkt::FieldMask>,
19849        {
19850            self.0.request.update_mask = v.map(|x| x.into());
19851            self
19852        }
19853    }
19854
19855    #[doc(hidden)]
19856    impl crate::RequestBuilder for SetIamPolicy {
19857        fn request_options(&mut self) -> &mut crate::RequestOptions {
19858            &mut self.0.options
19859        }
19860    }
19861
19862    /// The request builder for [NetworkSecurity::get_iam_policy][crate::client::NetworkSecurity::get_iam_policy] calls.
19863    ///
19864    /// # Example
19865    /// ```
19866    /// # use google_cloud_networksecurity_v1::builder::network_security::GetIamPolicy;
19867    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19868    ///
19869    /// let builder = prepare_request_builder();
19870    /// let response = builder.send().await?;
19871    /// # Ok(()) }
19872    ///
19873    /// fn prepare_request_builder() -> GetIamPolicy {
19874    ///   # panic!();
19875    ///   // ... details omitted ...
19876    /// }
19877    /// ```
19878    #[derive(Clone, Debug)]
19879    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
19880
19881    impl GetIamPolicy {
19882        pub(crate) fn new(
19883            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19884        ) -> Self {
19885            Self(RequestBuilder::new(stub))
19886        }
19887
19888        /// Sets the full request, replacing any prior values.
19889        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
19890            mut self,
19891            v: V,
19892        ) -> Self {
19893            self.0.request = v.into();
19894            self
19895        }
19896
19897        /// Sets all the options, replacing any prior values.
19898        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19899            self.0.options = v.into();
19900            self
19901        }
19902
19903        /// Sends the request.
19904        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
19905            (*self.0.stub)
19906                .get_iam_policy(self.0.request, self.0.options)
19907                .await
19908                .map(crate::Response::into_body)
19909        }
19910
19911        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
19912        ///
19913        /// This is a **required** field for requests.
19914        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
19915            self.0.request.resource = v.into();
19916            self
19917        }
19918
19919        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
19920        pub fn set_options<T>(mut self, v: T) -> Self
19921        where
19922            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
19923        {
19924            self.0.request.options = std::option::Option::Some(v.into());
19925            self
19926        }
19927
19928        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
19929        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
19930        where
19931            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
19932        {
19933            self.0.request.options = v.map(|x| x.into());
19934            self
19935        }
19936    }
19937
19938    #[doc(hidden)]
19939    impl crate::RequestBuilder for GetIamPolicy {
19940        fn request_options(&mut self) -> &mut crate::RequestOptions {
19941            &mut self.0.options
19942        }
19943    }
19944
19945    /// The request builder for [NetworkSecurity::test_iam_permissions][crate::client::NetworkSecurity::test_iam_permissions] calls.
19946    ///
19947    /// # Example
19948    /// ```
19949    /// # use google_cloud_networksecurity_v1::builder::network_security::TestIamPermissions;
19950    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
19951    ///
19952    /// let builder = prepare_request_builder();
19953    /// let response = builder.send().await?;
19954    /// # Ok(()) }
19955    ///
19956    /// fn prepare_request_builder() -> TestIamPermissions {
19957    ///   # panic!();
19958    ///   // ... details omitted ...
19959    /// }
19960    /// ```
19961    #[derive(Clone, Debug)]
19962    pub struct TestIamPermissions(
19963        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
19964    );
19965
19966    impl TestIamPermissions {
19967        pub(crate) fn new(
19968            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
19969        ) -> Self {
19970            Self(RequestBuilder::new(stub))
19971        }
19972
19973        /// Sets the full request, replacing any prior values.
19974        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
19975            mut self,
19976            v: V,
19977        ) -> Self {
19978            self.0.request = v.into();
19979            self
19980        }
19981
19982        /// Sets all the options, replacing any prior values.
19983        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19984            self.0.options = v.into();
19985            self
19986        }
19987
19988        /// Sends the request.
19989        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
19990            (*self.0.stub)
19991                .test_iam_permissions(self.0.request, self.0.options)
19992                .await
19993                .map(crate::Response::into_body)
19994        }
19995
19996        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
19997        ///
19998        /// This is a **required** field for requests.
19999        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20000            self.0.request.resource = v.into();
20001            self
20002        }
20003
20004        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
20005        ///
20006        /// This is a **required** field for requests.
20007        pub fn set_permissions<T, V>(mut self, v: T) -> Self
20008        where
20009            T: std::iter::IntoIterator<Item = V>,
20010            V: std::convert::Into<std::string::String>,
20011        {
20012            use std::iter::Iterator;
20013            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
20014            self
20015        }
20016    }
20017
20018    #[doc(hidden)]
20019    impl crate::RequestBuilder for TestIamPermissions {
20020        fn request_options(&mut self) -> &mut crate::RequestOptions {
20021            &mut self.0.options
20022        }
20023    }
20024
20025    /// The request builder for [NetworkSecurity::list_operations][crate::client::NetworkSecurity::list_operations] calls.
20026    ///
20027    /// # Example
20028    /// ```
20029    /// # use google_cloud_networksecurity_v1::builder::network_security::ListOperations;
20030    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20031    /// use google_cloud_gax::paginator::ItemPaginator;
20032    ///
20033    /// let builder = prepare_request_builder();
20034    /// let mut items = builder.by_item();
20035    /// while let Some(result) = items.next().await {
20036    ///   let item = result?;
20037    /// }
20038    /// # Ok(()) }
20039    ///
20040    /// fn prepare_request_builder() -> ListOperations {
20041    ///   # panic!();
20042    ///   // ... details omitted ...
20043    /// }
20044    /// ```
20045    #[derive(Clone, Debug)]
20046    pub struct ListOperations(
20047        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
20048    );
20049
20050    impl ListOperations {
20051        pub(crate) fn new(
20052            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20053        ) -> Self {
20054            Self(RequestBuilder::new(stub))
20055        }
20056
20057        /// Sets the full request, replacing any prior values.
20058        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
20059            mut self,
20060            v: V,
20061        ) -> Self {
20062            self.0.request = v.into();
20063            self
20064        }
20065
20066        /// Sets all the options, replacing any prior values.
20067        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20068            self.0.options = v.into();
20069            self
20070        }
20071
20072        /// Sends the request.
20073        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
20074            (*self.0.stub)
20075                .list_operations(self.0.request, self.0.options)
20076                .await
20077                .map(crate::Response::into_body)
20078        }
20079
20080        /// Streams each page in the collection.
20081        pub fn by_page(
20082            self,
20083        ) -> impl google_cloud_gax::paginator::Paginator<
20084            google_cloud_longrunning::model::ListOperationsResponse,
20085            crate::Error,
20086        > {
20087            use std::clone::Clone;
20088            let token = self.0.request.page_token.clone();
20089            let execute = move |token: String| {
20090                let mut builder = self.clone();
20091                builder.0.request = builder.0.request.set_page_token(token);
20092                builder.send()
20093            };
20094            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20095        }
20096
20097        /// Streams each item in the collection.
20098        pub fn by_item(
20099            self,
20100        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20101            google_cloud_longrunning::model::ListOperationsResponse,
20102            crate::Error,
20103        > {
20104            use google_cloud_gax::paginator::Paginator;
20105            self.by_page().items()
20106        }
20107
20108        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
20109        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20110            self.0.request.name = v.into();
20111            self
20112        }
20113
20114        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
20115        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20116            self.0.request.filter = v.into();
20117            self
20118        }
20119
20120        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
20121        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20122            self.0.request.page_size = v.into();
20123            self
20124        }
20125
20126        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
20127        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20128            self.0.request.page_token = v.into();
20129            self
20130        }
20131
20132        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
20133        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
20134            self.0.request.return_partial_success = v.into();
20135            self
20136        }
20137    }
20138
20139    #[doc(hidden)]
20140    impl crate::RequestBuilder for ListOperations {
20141        fn request_options(&mut self) -> &mut crate::RequestOptions {
20142            &mut self.0.options
20143        }
20144    }
20145
20146    /// The request builder for [NetworkSecurity::get_operation][crate::client::NetworkSecurity::get_operation] calls.
20147    ///
20148    /// # Example
20149    /// ```
20150    /// # use google_cloud_networksecurity_v1::builder::network_security::GetOperation;
20151    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20152    ///
20153    /// let builder = prepare_request_builder();
20154    /// let response = builder.send().await?;
20155    /// # Ok(()) }
20156    ///
20157    /// fn prepare_request_builder() -> GetOperation {
20158    ///   # panic!();
20159    ///   // ... details omitted ...
20160    /// }
20161    /// ```
20162    #[derive(Clone, Debug)]
20163    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
20164
20165    impl GetOperation {
20166        pub(crate) fn new(
20167            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20168        ) -> Self {
20169            Self(RequestBuilder::new(stub))
20170        }
20171
20172        /// Sets the full request, replacing any prior values.
20173        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
20174            mut self,
20175            v: V,
20176        ) -> Self {
20177            self.0.request = v.into();
20178            self
20179        }
20180
20181        /// Sets all the options, replacing any prior values.
20182        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20183            self.0.options = v.into();
20184            self
20185        }
20186
20187        /// Sends the request.
20188        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20189            (*self.0.stub)
20190                .get_operation(self.0.request, self.0.options)
20191                .await
20192                .map(crate::Response::into_body)
20193        }
20194
20195        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
20196        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20197            self.0.request.name = v.into();
20198            self
20199        }
20200    }
20201
20202    #[doc(hidden)]
20203    impl crate::RequestBuilder for GetOperation {
20204        fn request_options(&mut self) -> &mut crate::RequestOptions {
20205            &mut self.0.options
20206        }
20207    }
20208
20209    /// The request builder for [NetworkSecurity::delete_operation][crate::client::NetworkSecurity::delete_operation] calls.
20210    ///
20211    /// # Example
20212    /// ```
20213    /// # use google_cloud_networksecurity_v1::builder::network_security::DeleteOperation;
20214    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20215    ///
20216    /// let builder = prepare_request_builder();
20217    /// let response = builder.send().await?;
20218    /// # Ok(()) }
20219    ///
20220    /// fn prepare_request_builder() -> DeleteOperation {
20221    ///   # panic!();
20222    ///   // ... details omitted ...
20223    /// }
20224    /// ```
20225    #[derive(Clone, Debug)]
20226    pub struct DeleteOperation(
20227        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
20228    );
20229
20230    impl DeleteOperation {
20231        pub(crate) fn new(
20232            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20233        ) -> Self {
20234            Self(RequestBuilder::new(stub))
20235        }
20236
20237        /// Sets the full request, replacing any prior values.
20238        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
20239            mut self,
20240            v: V,
20241        ) -> Self {
20242            self.0.request = v.into();
20243            self
20244        }
20245
20246        /// Sets all the options, replacing any prior values.
20247        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20248            self.0.options = v.into();
20249            self
20250        }
20251
20252        /// Sends the request.
20253        pub async fn send(self) -> Result<()> {
20254            (*self.0.stub)
20255                .delete_operation(self.0.request, self.0.options)
20256                .await
20257                .map(crate::Response::into_body)
20258        }
20259
20260        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
20261        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20262            self.0.request.name = v.into();
20263            self
20264        }
20265    }
20266
20267    #[doc(hidden)]
20268    impl crate::RequestBuilder for DeleteOperation {
20269        fn request_options(&mut self) -> &mut crate::RequestOptions {
20270            &mut self.0.options
20271        }
20272    }
20273
20274    /// The request builder for [NetworkSecurity::cancel_operation][crate::client::NetworkSecurity::cancel_operation] calls.
20275    ///
20276    /// # Example
20277    /// ```
20278    /// # use google_cloud_networksecurity_v1::builder::network_security::CancelOperation;
20279    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20280    ///
20281    /// let builder = prepare_request_builder();
20282    /// let response = builder.send().await?;
20283    /// # Ok(()) }
20284    ///
20285    /// fn prepare_request_builder() -> CancelOperation {
20286    ///   # panic!();
20287    ///   // ... details omitted ...
20288    /// }
20289    /// ```
20290    #[derive(Clone, Debug)]
20291    pub struct CancelOperation(
20292        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
20293    );
20294
20295    impl CancelOperation {
20296        pub(crate) fn new(
20297            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
20298        ) -> Self {
20299            Self(RequestBuilder::new(stub))
20300        }
20301
20302        /// Sets the full request, replacing any prior values.
20303        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
20304            mut self,
20305            v: V,
20306        ) -> Self {
20307            self.0.request = v.into();
20308            self
20309        }
20310
20311        /// Sets all the options, replacing any prior values.
20312        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20313            self.0.options = v.into();
20314            self
20315        }
20316
20317        /// Sends the request.
20318        pub async fn send(self) -> Result<()> {
20319            (*self.0.stub)
20320                .cancel_operation(self.0.request, self.0.options)
20321                .await
20322                .map(crate::Response::into_body)
20323        }
20324
20325        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
20326        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20327            self.0.request.name = v.into();
20328            self
20329        }
20330    }
20331
20332    #[doc(hidden)]
20333    impl crate::RequestBuilder for CancelOperation {
20334        fn request_options(&mut self) -> &mut crate::RequestOptions {
20335            &mut self.0.options
20336        }
20337    }
20338}
20339
20340/// Request and client builders for [SecurityProfileGroupService][crate::client::SecurityProfileGroupService].
20341pub mod security_profile_group_service {
20342    use crate::Result;
20343
20344    /// A builder for [SecurityProfileGroupService][crate::client::SecurityProfileGroupService].
20345    ///
20346    /// ```
20347    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20348    /// # use google_cloud_networksecurity_v1::*;
20349    /// # use builder::security_profile_group_service::ClientBuilder;
20350    /// # use client::SecurityProfileGroupService;
20351    /// let builder : ClientBuilder = SecurityProfileGroupService::builder();
20352    /// let client = builder
20353    ///     .with_endpoint("https://networksecurity.googleapis.com")
20354    ///     .build().await?;
20355    /// # Ok(()) }
20356    /// ```
20357    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
20358
20359    pub(crate) mod client {
20360        use super::super::super::client::SecurityProfileGroupService;
20361        pub struct Factory;
20362        impl crate::ClientFactory for Factory {
20363            type Client = SecurityProfileGroupService;
20364            type Credentials = gaxi::options::Credentials;
20365            async fn build(
20366                self,
20367                config: gaxi::options::ClientConfig,
20368            ) -> crate::ClientBuilderResult<Self::Client> {
20369                Self::Client::new(config).await
20370            }
20371        }
20372    }
20373
20374    /// Common implementation for [crate::client::SecurityProfileGroupService] request builders.
20375    #[derive(Clone, Debug)]
20376    pub(crate) struct RequestBuilder<R: std::default::Default> {
20377        stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20378        request: R,
20379        options: crate::RequestOptions,
20380    }
20381
20382    impl<R> RequestBuilder<R>
20383    where
20384        R: std::default::Default,
20385    {
20386        pub(crate) fn new(
20387            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20388        ) -> Self {
20389            Self {
20390                stub,
20391                request: R::default(),
20392                options: crate::RequestOptions::default(),
20393            }
20394        }
20395    }
20396
20397    /// The request builder for [SecurityProfileGroupService::list_security_profile_groups][crate::client::SecurityProfileGroupService::list_security_profile_groups] calls.
20398    ///
20399    /// # Example
20400    /// ```
20401    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::ListSecurityProfileGroups;
20402    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20403    /// use google_cloud_gax::paginator::ItemPaginator;
20404    ///
20405    /// let builder = prepare_request_builder();
20406    /// let mut items = builder.by_item();
20407    /// while let Some(result) = items.next().await {
20408    ///   let item = result?;
20409    /// }
20410    /// # Ok(()) }
20411    ///
20412    /// fn prepare_request_builder() -> ListSecurityProfileGroups {
20413    ///   # panic!();
20414    ///   // ... details omitted ...
20415    /// }
20416    /// ```
20417    #[derive(Clone, Debug)]
20418    pub struct ListSecurityProfileGroups(
20419        RequestBuilder<crate::model::ListSecurityProfileGroupsRequest>,
20420    );
20421
20422    impl ListSecurityProfileGroups {
20423        pub(crate) fn new(
20424            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20425        ) -> Self {
20426            Self(RequestBuilder::new(stub))
20427        }
20428
20429        /// Sets the full request, replacing any prior values.
20430        pub fn with_request<V: Into<crate::model::ListSecurityProfileGroupsRequest>>(
20431            mut self,
20432            v: V,
20433        ) -> Self {
20434            self.0.request = v.into();
20435            self
20436        }
20437
20438        /// Sets all the options, replacing any prior values.
20439        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20440            self.0.options = v.into();
20441            self
20442        }
20443
20444        /// Sends the request.
20445        pub async fn send(self) -> Result<crate::model::ListSecurityProfileGroupsResponse> {
20446            (*self.0.stub)
20447                .list_security_profile_groups(self.0.request, self.0.options)
20448                .await
20449                .map(crate::Response::into_body)
20450        }
20451
20452        /// Streams each page in the collection.
20453        pub fn by_page(
20454            self,
20455        ) -> impl google_cloud_gax::paginator::Paginator<
20456            crate::model::ListSecurityProfileGroupsResponse,
20457            crate::Error,
20458        > {
20459            use std::clone::Clone;
20460            let token = self.0.request.page_token.clone();
20461            let execute = move |token: String| {
20462                let mut builder = self.clone();
20463                builder.0.request = builder.0.request.set_page_token(token);
20464                builder.send()
20465            };
20466            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20467        }
20468
20469        /// Streams each item in the collection.
20470        pub fn by_item(
20471            self,
20472        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20473            crate::model::ListSecurityProfileGroupsResponse,
20474            crate::Error,
20475        > {
20476            use google_cloud_gax::paginator::Paginator;
20477            self.by_page().items()
20478        }
20479
20480        /// Sets the value of [parent][crate::model::ListSecurityProfileGroupsRequest::parent].
20481        ///
20482        /// This is a **required** field for requests.
20483        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20484            self.0.request.parent = v.into();
20485            self
20486        }
20487
20488        /// Sets the value of [page_size][crate::model::ListSecurityProfileGroupsRequest::page_size].
20489        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20490            self.0.request.page_size = v.into();
20491            self
20492        }
20493
20494        /// Sets the value of [page_token][crate::model::ListSecurityProfileGroupsRequest::page_token].
20495        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20496            self.0.request.page_token = v.into();
20497            self
20498        }
20499    }
20500
20501    #[doc(hidden)]
20502    impl crate::RequestBuilder for ListSecurityProfileGroups {
20503        fn request_options(&mut self) -> &mut crate::RequestOptions {
20504            &mut self.0.options
20505        }
20506    }
20507
20508    /// The request builder for [SecurityProfileGroupService::get_security_profile_group][crate::client::SecurityProfileGroupService::get_security_profile_group] calls.
20509    ///
20510    /// # Example
20511    /// ```
20512    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::GetSecurityProfileGroup;
20513    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20514    ///
20515    /// let builder = prepare_request_builder();
20516    /// let response = builder.send().await?;
20517    /// # Ok(()) }
20518    ///
20519    /// fn prepare_request_builder() -> GetSecurityProfileGroup {
20520    ///   # panic!();
20521    ///   // ... details omitted ...
20522    /// }
20523    /// ```
20524    #[derive(Clone, Debug)]
20525    pub struct GetSecurityProfileGroup(
20526        RequestBuilder<crate::model::GetSecurityProfileGroupRequest>,
20527    );
20528
20529    impl GetSecurityProfileGroup {
20530        pub(crate) fn new(
20531            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20532        ) -> Self {
20533            Self(RequestBuilder::new(stub))
20534        }
20535
20536        /// Sets the full request, replacing any prior values.
20537        pub fn with_request<V: Into<crate::model::GetSecurityProfileGroupRequest>>(
20538            mut self,
20539            v: V,
20540        ) -> Self {
20541            self.0.request = v.into();
20542            self
20543        }
20544
20545        /// Sets all the options, replacing any prior values.
20546        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20547            self.0.options = v.into();
20548            self
20549        }
20550
20551        /// Sends the request.
20552        pub async fn send(self) -> Result<crate::model::SecurityProfileGroup> {
20553            (*self.0.stub)
20554                .get_security_profile_group(self.0.request, self.0.options)
20555                .await
20556                .map(crate::Response::into_body)
20557        }
20558
20559        /// Sets the value of [name][crate::model::GetSecurityProfileGroupRequest::name].
20560        ///
20561        /// This is a **required** field for requests.
20562        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20563            self.0.request.name = v.into();
20564            self
20565        }
20566    }
20567
20568    #[doc(hidden)]
20569    impl crate::RequestBuilder for GetSecurityProfileGroup {
20570        fn request_options(&mut self) -> &mut crate::RequestOptions {
20571            &mut self.0.options
20572        }
20573    }
20574
20575    /// The request builder for [SecurityProfileGroupService::create_security_profile_group][crate::client::SecurityProfileGroupService::create_security_profile_group] calls.
20576    ///
20577    /// # Example
20578    /// ```
20579    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::CreateSecurityProfileGroup;
20580    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20581    /// use google_cloud_lro::Poller;
20582    ///
20583    /// let builder = prepare_request_builder();
20584    /// let response = builder.poller().until_done().await?;
20585    /// # Ok(()) }
20586    ///
20587    /// fn prepare_request_builder() -> CreateSecurityProfileGroup {
20588    ///   # panic!();
20589    ///   // ... details omitted ...
20590    /// }
20591    /// ```
20592    #[derive(Clone, Debug)]
20593    pub struct CreateSecurityProfileGroup(
20594        RequestBuilder<crate::model::CreateSecurityProfileGroupRequest>,
20595    );
20596
20597    impl CreateSecurityProfileGroup {
20598        pub(crate) fn new(
20599            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20600        ) -> Self {
20601            Self(RequestBuilder::new(stub))
20602        }
20603
20604        /// Sets the full request, replacing any prior values.
20605        pub fn with_request<V: Into<crate::model::CreateSecurityProfileGroupRequest>>(
20606            mut self,
20607            v: V,
20608        ) -> Self {
20609            self.0.request = v.into();
20610            self
20611        }
20612
20613        /// Sets all the options, replacing any prior values.
20614        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20615            self.0.options = v.into();
20616            self
20617        }
20618
20619        /// Sends the request.
20620        ///
20621        /// # Long running operations
20622        ///
20623        /// This starts, but does not poll, a longrunning operation. More information
20624        /// on [create_security_profile_group][crate::client::SecurityProfileGroupService::create_security_profile_group].
20625        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20626            (*self.0.stub)
20627                .create_security_profile_group(self.0.request, self.0.options)
20628                .await
20629                .map(crate::Response::into_body)
20630        }
20631
20632        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_security_profile_group`.
20633        pub fn poller(
20634            self,
20635        ) -> impl google_cloud_lro::Poller<
20636            crate::model::SecurityProfileGroup,
20637            crate::model::OperationMetadata,
20638        > {
20639            type Operation = google_cloud_lro::internal::Operation<
20640                crate::model::SecurityProfileGroup,
20641                crate::model::OperationMetadata,
20642            >;
20643            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20644            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20645
20646            let stub = self.0.stub.clone();
20647            let mut options = self.0.options.clone();
20648            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20649            let query = move |name| {
20650                let stub = stub.clone();
20651                let options = options.clone();
20652                async {
20653                    let op = GetOperation::new(stub)
20654                        .set_name(name)
20655                        .with_options(options)
20656                        .send()
20657                        .await?;
20658                    Ok(Operation::new(op))
20659                }
20660            };
20661
20662            let start = move || async {
20663                let op = self.send().await?;
20664                Ok(Operation::new(op))
20665            };
20666
20667            google_cloud_lro::internal::new_poller(
20668                polling_error_policy,
20669                polling_backoff_policy,
20670                start,
20671                query,
20672            )
20673        }
20674
20675        /// Sets the value of [parent][crate::model::CreateSecurityProfileGroupRequest::parent].
20676        ///
20677        /// This is a **required** field for requests.
20678        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20679            self.0.request.parent = v.into();
20680            self
20681        }
20682
20683        /// Sets the value of [security_profile_group_id][crate::model::CreateSecurityProfileGroupRequest::security_profile_group_id].
20684        ///
20685        /// This is a **required** field for requests.
20686        pub fn set_security_profile_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
20687            self.0.request.security_profile_group_id = v.into();
20688            self
20689        }
20690
20691        /// Sets the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
20692        ///
20693        /// This is a **required** field for requests.
20694        pub fn set_security_profile_group<T>(mut self, v: T) -> Self
20695        where
20696            T: std::convert::Into<crate::model::SecurityProfileGroup>,
20697        {
20698            self.0.request.security_profile_group = std::option::Option::Some(v.into());
20699            self
20700        }
20701
20702        /// Sets or clears the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
20703        ///
20704        /// This is a **required** field for requests.
20705        pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
20706        where
20707            T: std::convert::Into<crate::model::SecurityProfileGroup>,
20708        {
20709            self.0.request.security_profile_group = v.map(|x| x.into());
20710            self
20711        }
20712    }
20713
20714    #[doc(hidden)]
20715    impl crate::RequestBuilder for CreateSecurityProfileGroup {
20716        fn request_options(&mut self) -> &mut crate::RequestOptions {
20717            &mut self.0.options
20718        }
20719    }
20720
20721    /// The request builder for [SecurityProfileGroupService::update_security_profile_group][crate::client::SecurityProfileGroupService::update_security_profile_group] calls.
20722    ///
20723    /// # Example
20724    /// ```
20725    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::UpdateSecurityProfileGroup;
20726    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20727    /// use google_cloud_lro::Poller;
20728    ///
20729    /// let builder = prepare_request_builder();
20730    /// let response = builder.poller().until_done().await?;
20731    /// # Ok(()) }
20732    ///
20733    /// fn prepare_request_builder() -> UpdateSecurityProfileGroup {
20734    ///   # panic!();
20735    ///   // ... details omitted ...
20736    /// }
20737    /// ```
20738    #[derive(Clone, Debug)]
20739    pub struct UpdateSecurityProfileGroup(
20740        RequestBuilder<crate::model::UpdateSecurityProfileGroupRequest>,
20741    );
20742
20743    impl UpdateSecurityProfileGroup {
20744        pub(crate) fn new(
20745            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20746        ) -> Self {
20747            Self(RequestBuilder::new(stub))
20748        }
20749
20750        /// Sets the full request, replacing any prior values.
20751        pub fn with_request<V: Into<crate::model::UpdateSecurityProfileGroupRequest>>(
20752            mut self,
20753            v: V,
20754        ) -> Self {
20755            self.0.request = v.into();
20756            self
20757        }
20758
20759        /// Sets all the options, replacing any prior values.
20760        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20761            self.0.options = v.into();
20762            self
20763        }
20764
20765        /// Sends the request.
20766        ///
20767        /// # Long running operations
20768        ///
20769        /// This starts, but does not poll, a longrunning operation. More information
20770        /// on [update_security_profile_group][crate::client::SecurityProfileGroupService::update_security_profile_group].
20771        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20772            (*self.0.stub)
20773                .update_security_profile_group(self.0.request, self.0.options)
20774                .await
20775                .map(crate::Response::into_body)
20776        }
20777
20778        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_security_profile_group`.
20779        pub fn poller(
20780            self,
20781        ) -> impl google_cloud_lro::Poller<
20782            crate::model::SecurityProfileGroup,
20783            crate::model::OperationMetadata,
20784        > {
20785            type Operation = google_cloud_lro::internal::Operation<
20786                crate::model::SecurityProfileGroup,
20787                crate::model::OperationMetadata,
20788            >;
20789            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20790            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20791
20792            let stub = self.0.stub.clone();
20793            let mut options = self.0.options.clone();
20794            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20795            let query = move |name| {
20796                let stub = stub.clone();
20797                let options = options.clone();
20798                async {
20799                    let op = GetOperation::new(stub)
20800                        .set_name(name)
20801                        .with_options(options)
20802                        .send()
20803                        .await?;
20804                    Ok(Operation::new(op))
20805                }
20806            };
20807
20808            let start = move || async {
20809                let op = self.send().await?;
20810                Ok(Operation::new(op))
20811            };
20812
20813            google_cloud_lro::internal::new_poller(
20814                polling_error_policy,
20815                polling_backoff_policy,
20816                start,
20817                query,
20818            )
20819        }
20820
20821        /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
20822        ///
20823        /// This is a **required** field for requests.
20824        pub fn set_update_mask<T>(mut self, v: T) -> Self
20825        where
20826            T: std::convert::Into<wkt::FieldMask>,
20827        {
20828            self.0.request.update_mask = std::option::Option::Some(v.into());
20829            self
20830        }
20831
20832        /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
20833        ///
20834        /// This is a **required** field for requests.
20835        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20836        where
20837            T: std::convert::Into<wkt::FieldMask>,
20838        {
20839            self.0.request.update_mask = v.map(|x| x.into());
20840            self
20841        }
20842
20843        /// Sets the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
20844        ///
20845        /// This is a **required** field for requests.
20846        pub fn set_security_profile_group<T>(mut self, v: T) -> Self
20847        where
20848            T: std::convert::Into<crate::model::SecurityProfileGroup>,
20849        {
20850            self.0.request.security_profile_group = std::option::Option::Some(v.into());
20851            self
20852        }
20853
20854        /// Sets or clears the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
20855        ///
20856        /// This is a **required** field for requests.
20857        pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
20858        where
20859            T: std::convert::Into<crate::model::SecurityProfileGroup>,
20860        {
20861            self.0.request.security_profile_group = v.map(|x| x.into());
20862            self
20863        }
20864    }
20865
20866    #[doc(hidden)]
20867    impl crate::RequestBuilder for UpdateSecurityProfileGroup {
20868        fn request_options(&mut self) -> &mut crate::RequestOptions {
20869            &mut self.0.options
20870        }
20871    }
20872
20873    /// The request builder for [SecurityProfileGroupService::delete_security_profile_group][crate::client::SecurityProfileGroupService::delete_security_profile_group] calls.
20874    ///
20875    /// # Example
20876    /// ```
20877    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::DeleteSecurityProfileGroup;
20878    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20879    /// use google_cloud_lro::Poller;
20880    ///
20881    /// let builder = prepare_request_builder();
20882    /// let response = builder.poller().until_done().await?;
20883    /// # Ok(()) }
20884    ///
20885    /// fn prepare_request_builder() -> DeleteSecurityProfileGroup {
20886    ///   # panic!();
20887    ///   // ... details omitted ...
20888    /// }
20889    /// ```
20890    #[derive(Clone, Debug)]
20891    pub struct DeleteSecurityProfileGroup(
20892        RequestBuilder<crate::model::DeleteSecurityProfileGroupRequest>,
20893    );
20894
20895    impl DeleteSecurityProfileGroup {
20896        pub(crate) fn new(
20897            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
20898        ) -> Self {
20899            Self(RequestBuilder::new(stub))
20900        }
20901
20902        /// Sets the full request, replacing any prior values.
20903        pub fn with_request<V: Into<crate::model::DeleteSecurityProfileGroupRequest>>(
20904            mut self,
20905            v: V,
20906        ) -> Self {
20907            self.0.request = v.into();
20908            self
20909        }
20910
20911        /// Sets all the options, replacing any prior values.
20912        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20913            self.0.options = v.into();
20914            self
20915        }
20916
20917        /// Sends the request.
20918        ///
20919        /// # Long running operations
20920        ///
20921        /// This starts, but does not poll, a longrunning operation. More information
20922        /// on [delete_security_profile_group][crate::client::SecurityProfileGroupService::delete_security_profile_group].
20923        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20924            (*self.0.stub)
20925                .delete_security_profile_group(self.0.request, self.0.options)
20926                .await
20927                .map(crate::Response::into_body)
20928        }
20929
20930        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_security_profile_group`.
20931        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
20932            type Operation =
20933                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
20934            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20935            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20936
20937            let stub = self.0.stub.clone();
20938            let mut options = self.0.options.clone();
20939            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20940            let query = move |name| {
20941                let stub = stub.clone();
20942                let options = options.clone();
20943                async {
20944                    let op = GetOperation::new(stub)
20945                        .set_name(name)
20946                        .with_options(options)
20947                        .send()
20948                        .await?;
20949                    Ok(Operation::new(op))
20950                }
20951            };
20952
20953            let start = move || async {
20954                let op = self.send().await?;
20955                Ok(Operation::new(op))
20956            };
20957
20958            google_cloud_lro::internal::new_unit_response_poller(
20959                polling_error_policy,
20960                polling_backoff_policy,
20961                start,
20962                query,
20963            )
20964        }
20965
20966        /// Sets the value of [name][crate::model::DeleteSecurityProfileGroupRequest::name].
20967        ///
20968        /// This is a **required** field for requests.
20969        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20970            self.0.request.name = v.into();
20971            self
20972        }
20973
20974        /// Sets the value of [etag][crate::model::DeleteSecurityProfileGroupRequest::etag].
20975        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
20976            self.0.request.etag = v.into();
20977            self
20978        }
20979    }
20980
20981    #[doc(hidden)]
20982    impl crate::RequestBuilder for DeleteSecurityProfileGroup {
20983        fn request_options(&mut self) -> &mut crate::RequestOptions {
20984            &mut self.0.options
20985        }
20986    }
20987
20988    /// The request builder for [SecurityProfileGroupService::list_security_profiles][crate::client::SecurityProfileGroupService::list_security_profiles] calls.
20989    ///
20990    /// # Example
20991    /// ```
20992    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::ListSecurityProfiles;
20993    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
20994    /// use google_cloud_gax::paginator::ItemPaginator;
20995    ///
20996    /// let builder = prepare_request_builder();
20997    /// let mut items = builder.by_item();
20998    /// while let Some(result) = items.next().await {
20999    ///   let item = result?;
21000    /// }
21001    /// # Ok(()) }
21002    ///
21003    /// fn prepare_request_builder() -> ListSecurityProfiles {
21004    ///   # panic!();
21005    ///   // ... details omitted ...
21006    /// }
21007    /// ```
21008    #[derive(Clone, Debug)]
21009    pub struct ListSecurityProfiles(RequestBuilder<crate::model::ListSecurityProfilesRequest>);
21010
21011    impl ListSecurityProfiles {
21012        pub(crate) fn new(
21013            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21014        ) -> Self {
21015            Self(RequestBuilder::new(stub))
21016        }
21017
21018        /// Sets the full request, replacing any prior values.
21019        pub fn with_request<V: Into<crate::model::ListSecurityProfilesRequest>>(
21020            mut self,
21021            v: V,
21022        ) -> Self {
21023            self.0.request = v.into();
21024            self
21025        }
21026
21027        /// Sets all the options, replacing any prior values.
21028        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21029            self.0.options = v.into();
21030            self
21031        }
21032
21033        /// Sends the request.
21034        pub async fn send(self) -> Result<crate::model::ListSecurityProfilesResponse> {
21035            (*self.0.stub)
21036                .list_security_profiles(self.0.request, self.0.options)
21037                .await
21038                .map(crate::Response::into_body)
21039        }
21040
21041        /// Streams each page in the collection.
21042        pub fn by_page(
21043            self,
21044        ) -> impl google_cloud_gax::paginator::Paginator<
21045            crate::model::ListSecurityProfilesResponse,
21046            crate::Error,
21047        > {
21048            use std::clone::Clone;
21049            let token = self.0.request.page_token.clone();
21050            let execute = move |token: String| {
21051                let mut builder = self.clone();
21052                builder.0.request = builder.0.request.set_page_token(token);
21053                builder.send()
21054            };
21055            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21056        }
21057
21058        /// Streams each item in the collection.
21059        pub fn by_item(
21060            self,
21061        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21062            crate::model::ListSecurityProfilesResponse,
21063            crate::Error,
21064        > {
21065            use google_cloud_gax::paginator::Paginator;
21066            self.by_page().items()
21067        }
21068
21069        /// Sets the value of [parent][crate::model::ListSecurityProfilesRequest::parent].
21070        ///
21071        /// This is a **required** field for requests.
21072        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21073            self.0.request.parent = v.into();
21074            self
21075        }
21076
21077        /// Sets the value of [page_size][crate::model::ListSecurityProfilesRequest::page_size].
21078        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21079            self.0.request.page_size = v.into();
21080            self
21081        }
21082
21083        /// Sets the value of [page_token][crate::model::ListSecurityProfilesRequest::page_token].
21084        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21085            self.0.request.page_token = v.into();
21086            self
21087        }
21088    }
21089
21090    #[doc(hidden)]
21091    impl crate::RequestBuilder for ListSecurityProfiles {
21092        fn request_options(&mut self) -> &mut crate::RequestOptions {
21093            &mut self.0.options
21094        }
21095    }
21096
21097    /// The request builder for [SecurityProfileGroupService::get_security_profile][crate::client::SecurityProfileGroupService::get_security_profile] calls.
21098    ///
21099    /// # Example
21100    /// ```
21101    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::GetSecurityProfile;
21102    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21103    ///
21104    /// let builder = prepare_request_builder();
21105    /// let response = builder.send().await?;
21106    /// # Ok(()) }
21107    ///
21108    /// fn prepare_request_builder() -> GetSecurityProfile {
21109    ///   # panic!();
21110    ///   // ... details omitted ...
21111    /// }
21112    /// ```
21113    #[derive(Clone, Debug)]
21114    pub struct GetSecurityProfile(RequestBuilder<crate::model::GetSecurityProfileRequest>);
21115
21116    impl GetSecurityProfile {
21117        pub(crate) fn new(
21118            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21119        ) -> Self {
21120            Self(RequestBuilder::new(stub))
21121        }
21122
21123        /// Sets the full request, replacing any prior values.
21124        pub fn with_request<V: Into<crate::model::GetSecurityProfileRequest>>(
21125            mut self,
21126            v: V,
21127        ) -> Self {
21128            self.0.request = v.into();
21129            self
21130        }
21131
21132        /// Sets all the options, replacing any prior values.
21133        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21134            self.0.options = v.into();
21135            self
21136        }
21137
21138        /// Sends the request.
21139        pub async fn send(self) -> Result<crate::model::SecurityProfile> {
21140            (*self.0.stub)
21141                .get_security_profile(self.0.request, self.0.options)
21142                .await
21143                .map(crate::Response::into_body)
21144        }
21145
21146        /// Sets the value of [name][crate::model::GetSecurityProfileRequest::name].
21147        ///
21148        /// This is a **required** field for requests.
21149        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21150            self.0.request.name = v.into();
21151            self
21152        }
21153    }
21154
21155    #[doc(hidden)]
21156    impl crate::RequestBuilder for GetSecurityProfile {
21157        fn request_options(&mut self) -> &mut crate::RequestOptions {
21158            &mut self.0.options
21159        }
21160    }
21161
21162    /// The request builder for [SecurityProfileGroupService::create_security_profile][crate::client::SecurityProfileGroupService::create_security_profile] calls.
21163    ///
21164    /// # Example
21165    /// ```
21166    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::CreateSecurityProfile;
21167    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21168    /// use google_cloud_lro::Poller;
21169    ///
21170    /// let builder = prepare_request_builder();
21171    /// let response = builder.poller().until_done().await?;
21172    /// # Ok(()) }
21173    ///
21174    /// fn prepare_request_builder() -> CreateSecurityProfile {
21175    ///   # panic!();
21176    ///   // ... details omitted ...
21177    /// }
21178    /// ```
21179    #[derive(Clone, Debug)]
21180    pub struct CreateSecurityProfile(RequestBuilder<crate::model::CreateSecurityProfileRequest>);
21181
21182    impl CreateSecurityProfile {
21183        pub(crate) fn new(
21184            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21185        ) -> Self {
21186            Self(RequestBuilder::new(stub))
21187        }
21188
21189        /// Sets the full request, replacing any prior values.
21190        pub fn with_request<V: Into<crate::model::CreateSecurityProfileRequest>>(
21191            mut self,
21192            v: V,
21193        ) -> Self {
21194            self.0.request = v.into();
21195            self
21196        }
21197
21198        /// Sets all the options, replacing any prior values.
21199        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21200            self.0.options = v.into();
21201            self
21202        }
21203
21204        /// Sends the request.
21205        ///
21206        /// # Long running operations
21207        ///
21208        /// This starts, but does not poll, a longrunning operation. More information
21209        /// on [create_security_profile][crate::client::SecurityProfileGroupService::create_security_profile].
21210        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21211            (*self.0.stub)
21212                .create_security_profile(self.0.request, self.0.options)
21213                .await
21214                .map(crate::Response::into_body)
21215        }
21216
21217        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_security_profile`.
21218        pub fn poller(
21219            self,
21220        ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
21221        {
21222            type Operation = google_cloud_lro::internal::Operation<
21223                crate::model::SecurityProfile,
21224                crate::model::OperationMetadata,
21225            >;
21226            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21227            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21228
21229            let stub = self.0.stub.clone();
21230            let mut options = self.0.options.clone();
21231            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21232            let query = move |name| {
21233                let stub = stub.clone();
21234                let options = options.clone();
21235                async {
21236                    let op = GetOperation::new(stub)
21237                        .set_name(name)
21238                        .with_options(options)
21239                        .send()
21240                        .await?;
21241                    Ok(Operation::new(op))
21242                }
21243            };
21244
21245            let start = move || async {
21246                let op = self.send().await?;
21247                Ok(Operation::new(op))
21248            };
21249
21250            google_cloud_lro::internal::new_poller(
21251                polling_error_policy,
21252                polling_backoff_policy,
21253                start,
21254                query,
21255            )
21256        }
21257
21258        /// Sets the value of [parent][crate::model::CreateSecurityProfileRequest::parent].
21259        ///
21260        /// This is a **required** field for requests.
21261        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21262            self.0.request.parent = v.into();
21263            self
21264        }
21265
21266        /// Sets the value of [security_profile_id][crate::model::CreateSecurityProfileRequest::security_profile_id].
21267        ///
21268        /// This is a **required** field for requests.
21269        pub fn set_security_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
21270            self.0.request.security_profile_id = v.into();
21271            self
21272        }
21273
21274        /// Sets the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
21275        ///
21276        /// This is a **required** field for requests.
21277        pub fn set_security_profile<T>(mut self, v: T) -> Self
21278        where
21279            T: std::convert::Into<crate::model::SecurityProfile>,
21280        {
21281            self.0.request.security_profile = std::option::Option::Some(v.into());
21282            self
21283        }
21284
21285        /// Sets or clears the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
21286        ///
21287        /// This is a **required** field for requests.
21288        pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
21289        where
21290            T: std::convert::Into<crate::model::SecurityProfile>,
21291        {
21292            self.0.request.security_profile = v.map(|x| x.into());
21293            self
21294        }
21295    }
21296
21297    #[doc(hidden)]
21298    impl crate::RequestBuilder for CreateSecurityProfile {
21299        fn request_options(&mut self) -> &mut crate::RequestOptions {
21300            &mut self.0.options
21301        }
21302    }
21303
21304    /// The request builder for [SecurityProfileGroupService::update_security_profile][crate::client::SecurityProfileGroupService::update_security_profile] calls.
21305    ///
21306    /// # Example
21307    /// ```
21308    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::UpdateSecurityProfile;
21309    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21310    /// use google_cloud_lro::Poller;
21311    ///
21312    /// let builder = prepare_request_builder();
21313    /// let response = builder.poller().until_done().await?;
21314    /// # Ok(()) }
21315    ///
21316    /// fn prepare_request_builder() -> UpdateSecurityProfile {
21317    ///   # panic!();
21318    ///   // ... details omitted ...
21319    /// }
21320    /// ```
21321    #[derive(Clone, Debug)]
21322    pub struct UpdateSecurityProfile(RequestBuilder<crate::model::UpdateSecurityProfileRequest>);
21323
21324    impl UpdateSecurityProfile {
21325        pub(crate) fn new(
21326            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21327        ) -> Self {
21328            Self(RequestBuilder::new(stub))
21329        }
21330
21331        /// Sets the full request, replacing any prior values.
21332        pub fn with_request<V: Into<crate::model::UpdateSecurityProfileRequest>>(
21333            mut self,
21334            v: V,
21335        ) -> Self {
21336            self.0.request = v.into();
21337            self
21338        }
21339
21340        /// Sets all the options, replacing any prior values.
21341        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21342            self.0.options = v.into();
21343            self
21344        }
21345
21346        /// Sends the request.
21347        ///
21348        /// # Long running operations
21349        ///
21350        /// This starts, but does not poll, a longrunning operation. More information
21351        /// on [update_security_profile][crate::client::SecurityProfileGroupService::update_security_profile].
21352        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21353            (*self.0.stub)
21354                .update_security_profile(self.0.request, self.0.options)
21355                .await
21356                .map(crate::Response::into_body)
21357        }
21358
21359        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_security_profile`.
21360        pub fn poller(
21361            self,
21362        ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
21363        {
21364            type Operation = google_cloud_lro::internal::Operation<
21365                crate::model::SecurityProfile,
21366                crate::model::OperationMetadata,
21367            >;
21368            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21369            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21370
21371            let stub = self.0.stub.clone();
21372            let mut options = self.0.options.clone();
21373            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21374            let query = move |name| {
21375                let stub = stub.clone();
21376                let options = options.clone();
21377                async {
21378                    let op = GetOperation::new(stub)
21379                        .set_name(name)
21380                        .with_options(options)
21381                        .send()
21382                        .await?;
21383                    Ok(Operation::new(op))
21384                }
21385            };
21386
21387            let start = move || async {
21388                let op = self.send().await?;
21389                Ok(Operation::new(op))
21390            };
21391
21392            google_cloud_lro::internal::new_poller(
21393                polling_error_policy,
21394                polling_backoff_policy,
21395                start,
21396                query,
21397            )
21398        }
21399
21400        /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
21401        ///
21402        /// This is a **required** field for requests.
21403        pub fn set_update_mask<T>(mut self, v: T) -> Self
21404        where
21405            T: std::convert::Into<wkt::FieldMask>,
21406        {
21407            self.0.request.update_mask = std::option::Option::Some(v.into());
21408            self
21409        }
21410
21411        /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
21412        ///
21413        /// This is a **required** field for requests.
21414        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21415        where
21416            T: std::convert::Into<wkt::FieldMask>,
21417        {
21418            self.0.request.update_mask = v.map(|x| x.into());
21419            self
21420        }
21421
21422        /// Sets the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
21423        ///
21424        /// This is a **required** field for requests.
21425        pub fn set_security_profile<T>(mut self, v: T) -> Self
21426        where
21427            T: std::convert::Into<crate::model::SecurityProfile>,
21428        {
21429            self.0.request.security_profile = std::option::Option::Some(v.into());
21430            self
21431        }
21432
21433        /// Sets or clears the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
21434        ///
21435        /// This is a **required** field for requests.
21436        pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
21437        where
21438            T: std::convert::Into<crate::model::SecurityProfile>,
21439        {
21440            self.0.request.security_profile = v.map(|x| x.into());
21441            self
21442        }
21443    }
21444
21445    #[doc(hidden)]
21446    impl crate::RequestBuilder for UpdateSecurityProfile {
21447        fn request_options(&mut self) -> &mut crate::RequestOptions {
21448            &mut self.0.options
21449        }
21450    }
21451
21452    /// The request builder for [SecurityProfileGroupService::delete_security_profile][crate::client::SecurityProfileGroupService::delete_security_profile] calls.
21453    ///
21454    /// # Example
21455    /// ```
21456    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::DeleteSecurityProfile;
21457    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21458    /// use google_cloud_lro::Poller;
21459    ///
21460    /// let builder = prepare_request_builder();
21461    /// let response = builder.poller().until_done().await?;
21462    /// # Ok(()) }
21463    ///
21464    /// fn prepare_request_builder() -> DeleteSecurityProfile {
21465    ///   # panic!();
21466    ///   // ... details omitted ...
21467    /// }
21468    /// ```
21469    #[derive(Clone, Debug)]
21470    pub struct DeleteSecurityProfile(RequestBuilder<crate::model::DeleteSecurityProfileRequest>);
21471
21472    impl DeleteSecurityProfile {
21473        pub(crate) fn new(
21474            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21475        ) -> Self {
21476            Self(RequestBuilder::new(stub))
21477        }
21478
21479        /// Sets the full request, replacing any prior values.
21480        pub fn with_request<V: Into<crate::model::DeleteSecurityProfileRequest>>(
21481            mut self,
21482            v: V,
21483        ) -> Self {
21484            self.0.request = v.into();
21485            self
21486        }
21487
21488        /// Sets all the options, replacing any prior values.
21489        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21490            self.0.options = v.into();
21491            self
21492        }
21493
21494        /// Sends the request.
21495        ///
21496        /// # Long running operations
21497        ///
21498        /// This starts, but does not poll, a longrunning operation. More information
21499        /// on [delete_security_profile][crate::client::SecurityProfileGroupService::delete_security_profile].
21500        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21501            (*self.0.stub)
21502                .delete_security_profile(self.0.request, self.0.options)
21503                .await
21504                .map(crate::Response::into_body)
21505        }
21506
21507        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_security_profile`.
21508        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
21509            type Operation =
21510                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
21511            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
21512            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
21513
21514            let stub = self.0.stub.clone();
21515            let mut options = self.0.options.clone();
21516            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
21517            let query = move |name| {
21518                let stub = stub.clone();
21519                let options = options.clone();
21520                async {
21521                    let op = GetOperation::new(stub)
21522                        .set_name(name)
21523                        .with_options(options)
21524                        .send()
21525                        .await?;
21526                    Ok(Operation::new(op))
21527                }
21528            };
21529
21530            let start = move || async {
21531                let op = self.send().await?;
21532                Ok(Operation::new(op))
21533            };
21534
21535            google_cloud_lro::internal::new_unit_response_poller(
21536                polling_error_policy,
21537                polling_backoff_policy,
21538                start,
21539                query,
21540            )
21541        }
21542
21543        /// Sets the value of [name][crate::model::DeleteSecurityProfileRequest::name].
21544        ///
21545        /// This is a **required** field for requests.
21546        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21547            self.0.request.name = v.into();
21548            self
21549        }
21550
21551        /// Sets the value of [etag][crate::model::DeleteSecurityProfileRequest::etag].
21552        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
21553            self.0.request.etag = v.into();
21554            self
21555        }
21556    }
21557
21558    #[doc(hidden)]
21559    impl crate::RequestBuilder for DeleteSecurityProfile {
21560        fn request_options(&mut self) -> &mut crate::RequestOptions {
21561            &mut self.0.options
21562        }
21563    }
21564
21565    /// The request builder for [SecurityProfileGroupService::list_locations][crate::client::SecurityProfileGroupService::list_locations] calls.
21566    ///
21567    /// # Example
21568    /// ```
21569    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::ListLocations;
21570    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21571    /// use google_cloud_gax::paginator::ItemPaginator;
21572    ///
21573    /// let builder = prepare_request_builder();
21574    /// let mut items = builder.by_item();
21575    /// while let Some(result) = items.next().await {
21576    ///   let item = result?;
21577    /// }
21578    /// # Ok(()) }
21579    ///
21580    /// fn prepare_request_builder() -> ListLocations {
21581    ///   # panic!();
21582    ///   // ... details omitted ...
21583    /// }
21584    /// ```
21585    #[derive(Clone, Debug)]
21586    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
21587
21588    impl ListLocations {
21589        pub(crate) fn new(
21590            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21591        ) -> Self {
21592            Self(RequestBuilder::new(stub))
21593        }
21594
21595        /// Sets the full request, replacing any prior values.
21596        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
21597            mut self,
21598            v: V,
21599        ) -> Self {
21600            self.0.request = v.into();
21601            self
21602        }
21603
21604        /// Sets all the options, replacing any prior values.
21605        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21606            self.0.options = v.into();
21607            self
21608        }
21609
21610        /// Sends the request.
21611        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
21612            (*self.0.stub)
21613                .list_locations(self.0.request, self.0.options)
21614                .await
21615                .map(crate::Response::into_body)
21616        }
21617
21618        /// Streams each page in the collection.
21619        pub fn by_page(
21620            self,
21621        ) -> impl google_cloud_gax::paginator::Paginator<
21622            google_cloud_location::model::ListLocationsResponse,
21623            crate::Error,
21624        > {
21625            use std::clone::Clone;
21626            let token = self.0.request.page_token.clone();
21627            let execute = move |token: String| {
21628                let mut builder = self.clone();
21629                builder.0.request = builder.0.request.set_page_token(token);
21630                builder.send()
21631            };
21632            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21633        }
21634
21635        /// Streams each item in the collection.
21636        pub fn by_item(
21637            self,
21638        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21639            google_cloud_location::model::ListLocationsResponse,
21640            crate::Error,
21641        > {
21642            use google_cloud_gax::paginator::Paginator;
21643            self.by_page().items()
21644        }
21645
21646        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
21647        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21648            self.0.request.name = v.into();
21649            self
21650        }
21651
21652        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
21653        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21654            self.0.request.filter = v.into();
21655            self
21656        }
21657
21658        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
21659        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21660            self.0.request.page_size = v.into();
21661            self
21662        }
21663
21664        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
21665        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21666            self.0.request.page_token = v.into();
21667            self
21668        }
21669    }
21670
21671    #[doc(hidden)]
21672    impl crate::RequestBuilder for ListLocations {
21673        fn request_options(&mut self) -> &mut crate::RequestOptions {
21674            &mut self.0.options
21675        }
21676    }
21677
21678    /// The request builder for [SecurityProfileGroupService::get_location][crate::client::SecurityProfileGroupService::get_location] calls.
21679    ///
21680    /// # Example
21681    /// ```
21682    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::GetLocation;
21683    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21684    ///
21685    /// let builder = prepare_request_builder();
21686    /// let response = builder.send().await?;
21687    /// # Ok(()) }
21688    ///
21689    /// fn prepare_request_builder() -> GetLocation {
21690    ///   # panic!();
21691    ///   // ... details omitted ...
21692    /// }
21693    /// ```
21694    #[derive(Clone, Debug)]
21695    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
21696
21697    impl GetLocation {
21698        pub(crate) fn new(
21699            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21700        ) -> Self {
21701            Self(RequestBuilder::new(stub))
21702        }
21703
21704        /// Sets the full request, replacing any prior values.
21705        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
21706            mut self,
21707            v: V,
21708        ) -> Self {
21709            self.0.request = v.into();
21710            self
21711        }
21712
21713        /// Sets all the options, replacing any prior values.
21714        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21715            self.0.options = v.into();
21716            self
21717        }
21718
21719        /// Sends the request.
21720        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
21721            (*self.0.stub)
21722                .get_location(self.0.request, self.0.options)
21723                .await
21724                .map(crate::Response::into_body)
21725        }
21726
21727        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
21728        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21729            self.0.request.name = v.into();
21730            self
21731        }
21732    }
21733
21734    #[doc(hidden)]
21735    impl crate::RequestBuilder for GetLocation {
21736        fn request_options(&mut self) -> &mut crate::RequestOptions {
21737            &mut self.0.options
21738        }
21739    }
21740
21741    /// The request builder for [SecurityProfileGroupService::set_iam_policy][crate::client::SecurityProfileGroupService::set_iam_policy] calls.
21742    ///
21743    /// # Example
21744    /// ```
21745    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::SetIamPolicy;
21746    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21747    ///
21748    /// let builder = prepare_request_builder();
21749    /// let response = builder.send().await?;
21750    /// # Ok(()) }
21751    ///
21752    /// fn prepare_request_builder() -> SetIamPolicy {
21753    ///   # panic!();
21754    ///   // ... details omitted ...
21755    /// }
21756    /// ```
21757    #[derive(Clone, Debug)]
21758    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
21759
21760    impl SetIamPolicy {
21761        pub(crate) fn new(
21762            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21763        ) -> Self {
21764            Self(RequestBuilder::new(stub))
21765        }
21766
21767        /// Sets the full request, replacing any prior values.
21768        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
21769            mut self,
21770            v: V,
21771        ) -> Self {
21772            self.0.request = v.into();
21773            self
21774        }
21775
21776        /// Sets all the options, replacing any prior values.
21777        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21778            self.0.options = v.into();
21779            self
21780        }
21781
21782        /// Sends the request.
21783        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
21784            (*self.0.stub)
21785                .set_iam_policy(self.0.request, self.0.options)
21786                .await
21787                .map(crate::Response::into_body)
21788        }
21789
21790        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
21791        ///
21792        /// This is a **required** field for requests.
21793        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21794            self.0.request.resource = v.into();
21795            self
21796        }
21797
21798        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
21799        ///
21800        /// This is a **required** field for requests.
21801        pub fn set_policy<T>(mut self, v: T) -> Self
21802        where
21803            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
21804        {
21805            self.0.request.policy = std::option::Option::Some(v.into());
21806            self
21807        }
21808
21809        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
21810        ///
21811        /// This is a **required** field for requests.
21812        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
21813        where
21814            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
21815        {
21816            self.0.request.policy = v.map(|x| x.into());
21817            self
21818        }
21819
21820        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
21821        pub fn set_update_mask<T>(mut self, v: T) -> Self
21822        where
21823            T: std::convert::Into<wkt::FieldMask>,
21824        {
21825            self.0.request.update_mask = std::option::Option::Some(v.into());
21826            self
21827        }
21828
21829        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
21830        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21831        where
21832            T: std::convert::Into<wkt::FieldMask>,
21833        {
21834            self.0.request.update_mask = v.map(|x| x.into());
21835            self
21836        }
21837    }
21838
21839    #[doc(hidden)]
21840    impl crate::RequestBuilder for SetIamPolicy {
21841        fn request_options(&mut self) -> &mut crate::RequestOptions {
21842            &mut self.0.options
21843        }
21844    }
21845
21846    /// The request builder for [SecurityProfileGroupService::get_iam_policy][crate::client::SecurityProfileGroupService::get_iam_policy] calls.
21847    ///
21848    /// # Example
21849    /// ```
21850    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::GetIamPolicy;
21851    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21852    ///
21853    /// let builder = prepare_request_builder();
21854    /// let response = builder.send().await?;
21855    /// # Ok(()) }
21856    ///
21857    /// fn prepare_request_builder() -> GetIamPolicy {
21858    ///   # panic!();
21859    ///   // ... details omitted ...
21860    /// }
21861    /// ```
21862    #[derive(Clone, Debug)]
21863    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
21864
21865    impl GetIamPolicy {
21866        pub(crate) fn new(
21867            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21868        ) -> Self {
21869            Self(RequestBuilder::new(stub))
21870        }
21871
21872        /// Sets the full request, replacing any prior values.
21873        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
21874            mut self,
21875            v: V,
21876        ) -> Self {
21877            self.0.request = v.into();
21878            self
21879        }
21880
21881        /// Sets all the options, replacing any prior values.
21882        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21883            self.0.options = v.into();
21884            self
21885        }
21886
21887        /// Sends the request.
21888        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
21889            (*self.0.stub)
21890                .get_iam_policy(self.0.request, self.0.options)
21891                .await
21892                .map(crate::Response::into_body)
21893        }
21894
21895        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
21896        ///
21897        /// This is a **required** field for requests.
21898        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21899            self.0.request.resource = v.into();
21900            self
21901        }
21902
21903        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
21904        pub fn set_options<T>(mut self, v: T) -> Self
21905        where
21906            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
21907        {
21908            self.0.request.options = std::option::Option::Some(v.into());
21909            self
21910        }
21911
21912        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
21913        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
21914        where
21915            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
21916        {
21917            self.0.request.options = v.map(|x| x.into());
21918            self
21919        }
21920    }
21921
21922    #[doc(hidden)]
21923    impl crate::RequestBuilder for GetIamPolicy {
21924        fn request_options(&mut self) -> &mut crate::RequestOptions {
21925            &mut self.0.options
21926        }
21927    }
21928
21929    /// The request builder for [SecurityProfileGroupService::test_iam_permissions][crate::client::SecurityProfileGroupService::test_iam_permissions] calls.
21930    ///
21931    /// # Example
21932    /// ```
21933    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::TestIamPermissions;
21934    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
21935    ///
21936    /// let builder = prepare_request_builder();
21937    /// let response = builder.send().await?;
21938    /// # Ok(()) }
21939    ///
21940    /// fn prepare_request_builder() -> TestIamPermissions {
21941    ///   # panic!();
21942    ///   // ... details omitted ...
21943    /// }
21944    /// ```
21945    #[derive(Clone, Debug)]
21946    pub struct TestIamPermissions(
21947        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
21948    );
21949
21950    impl TestIamPermissions {
21951        pub(crate) fn new(
21952            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
21953        ) -> Self {
21954            Self(RequestBuilder::new(stub))
21955        }
21956
21957        /// Sets the full request, replacing any prior values.
21958        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
21959            mut self,
21960            v: V,
21961        ) -> Self {
21962            self.0.request = v.into();
21963            self
21964        }
21965
21966        /// Sets all the options, replacing any prior values.
21967        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21968            self.0.options = v.into();
21969            self
21970        }
21971
21972        /// Sends the request.
21973        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
21974            (*self.0.stub)
21975                .test_iam_permissions(self.0.request, self.0.options)
21976                .await
21977                .map(crate::Response::into_body)
21978        }
21979
21980        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
21981        ///
21982        /// This is a **required** field for requests.
21983        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
21984            self.0.request.resource = v.into();
21985            self
21986        }
21987
21988        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
21989        ///
21990        /// This is a **required** field for requests.
21991        pub fn set_permissions<T, V>(mut self, v: T) -> Self
21992        where
21993            T: std::iter::IntoIterator<Item = V>,
21994            V: std::convert::Into<std::string::String>,
21995        {
21996            use std::iter::Iterator;
21997            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
21998            self
21999        }
22000    }
22001
22002    #[doc(hidden)]
22003    impl crate::RequestBuilder for TestIamPermissions {
22004        fn request_options(&mut self) -> &mut crate::RequestOptions {
22005            &mut self.0.options
22006        }
22007    }
22008
22009    /// The request builder for [SecurityProfileGroupService::list_operations][crate::client::SecurityProfileGroupService::list_operations] calls.
22010    ///
22011    /// # Example
22012    /// ```
22013    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::ListOperations;
22014    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22015    /// use google_cloud_gax::paginator::ItemPaginator;
22016    ///
22017    /// let builder = prepare_request_builder();
22018    /// let mut items = builder.by_item();
22019    /// while let Some(result) = items.next().await {
22020    ///   let item = result?;
22021    /// }
22022    /// # Ok(()) }
22023    ///
22024    /// fn prepare_request_builder() -> ListOperations {
22025    ///   # panic!();
22026    ///   // ... details omitted ...
22027    /// }
22028    /// ```
22029    #[derive(Clone, Debug)]
22030    pub struct ListOperations(
22031        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
22032    );
22033
22034    impl ListOperations {
22035        pub(crate) fn new(
22036            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22037        ) -> Self {
22038            Self(RequestBuilder::new(stub))
22039        }
22040
22041        /// Sets the full request, replacing any prior values.
22042        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
22043            mut self,
22044            v: V,
22045        ) -> Self {
22046            self.0.request = v.into();
22047            self
22048        }
22049
22050        /// Sets all the options, replacing any prior values.
22051        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22052            self.0.options = v.into();
22053            self
22054        }
22055
22056        /// Sends the request.
22057        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
22058            (*self.0.stub)
22059                .list_operations(self.0.request, self.0.options)
22060                .await
22061                .map(crate::Response::into_body)
22062        }
22063
22064        /// Streams each page in the collection.
22065        pub fn by_page(
22066            self,
22067        ) -> impl google_cloud_gax::paginator::Paginator<
22068            google_cloud_longrunning::model::ListOperationsResponse,
22069            crate::Error,
22070        > {
22071            use std::clone::Clone;
22072            let token = self.0.request.page_token.clone();
22073            let execute = move |token: String| {
22074                let mut builder = self.clone();
22075                builder.0.request = builder.0.request.set_page_token(token);
22076                builder.send()
22077            };
22078            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22079        }
22080
22081        /// Streams each item in the collection.
22082        pub fn by_item(
22083            self,
22084        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22085            google_cloud_longrunning::model::ListOperationsResponse,
22086            crate::Error,
22087        > {
22088            use google_cloud_gax::paginator::Paginator;
22089            self.by_page().items()
22090        }
22091
22092        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
22093        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22094            self.0.request.name = v.into();
22095            self
22096        }
22097
22098        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
22099        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22100            self.0.request.filter = v.into();
22101            self
22102        }
22103
22104        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
22105        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22106            self.0.request.page_size = v.into();
22107            self
22108        }
22109
22110        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
22111        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22112            self.0.request.page_token = v.into();
22113            self
22114        }
22115
22116        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
22117        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
22118            self.0.request.return_partial_success = v.into();
22119            self
22120        }
22121    }
22122
22123    #[doc(hidden)]
22124    impl crate::RequestBuilder for ListOperations {
22125        fn request_options(&mut self) -> &mut crate::RequestOptions {
22126            &mut self.0.options
22127        }
22128    }
22129
22130    /// The request builder for [SecurityProfileGroupService::get_operation][crate::client::SecurityProfileGroupService::get_operation] calls.
22131    ///
22132    /// # Example
22133    /// ```
22134    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::GetOperation;
22135    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22136    ///
22137    /// let builder = prepare_request_builder();
22138    /// let response = builder.send().await?;
22139    /// # Ok(()) }
22140    ///
22141    /// fn prepare_request_builder() -> GetOperation {
22142    ///   # panic!();
22143    ///   // ... details omitted ...
22144    /// }
22145    /// ```
22146    #[derive(Clone, Debug)]
22147    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
22148
22149    impl GetOperation {
22150        pub(crate) fn new(
22151            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22152        ) -> Self {
22153            Self(RequestBuilder::new(stub))
22154        }
22155
22156        /// Sets the full request, replacing any prior values.
22157        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
22158            mut self,
22159            v: V,
22160        ) -> Self {
22161            self.0.request = v.into();
22162            self
22163        }
22164
22165        /// Sets all the options, replacing any prior values.
22166        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22167            self.0.options = v.into();
22168            self
22169        }
22170
22171        /// Sends the request.
22172        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22173            (*self.0.stub)
22174                .get_operation(self.0.request, self.0.options)
22175                .await
22176                .map(crate::Response::into_body)
22177        }
22178
22179        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
22180        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22181            self.0.request.name = v.into();
22182            self
22183        }
22184    }
22185
22186    #[doc(hidden)]
22187    impl crate::RequestBuilder for GetOperation {
22188        fn request_options(&mut self) -> &mut crate::RequestOptions {
22189            &mut self.0.options
22190        }
22191    }
22192
22193    /// The request builder for [SecurityProfileGroupService::delete_operation][crate::client::SecurityProfileGroupService::delete_operation] calls.
22194    ///
22195    /// # Example
22196    /// ```
22197    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::DeleteOperation;
22198    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22199    ///
22200    /// let builder = prepare_request_builder();
22201    /// let response = builder.send().await?;
22202    /// # Ok(()) }
22203    ///
22204    /// fn prepare_request_builder() -> DeleteOperation {
22205    ///   # panic!();
22206    ///   // ... details omitted ...
22207    /// }
22208    /// ```
22209    #[derive(Clone, Debug)]
22210    pub struct DeleteOperation(
22211        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
22212    );
22213
22214    impl DeleteOperation {
22215        pub(crate) fn new(
22216            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22217        ) -> Self {
22218            Self(RequestBuilder::new(stub))
22219        }
22220
22221        /// Sets the full request, replacing any prior values.
22222        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
22223            mut self,
22224            v: V,
22225        ) -> Self {
22226            self.0.request = v.into();
22227            self
22228        }
22229
22230        /// Sets all the options, replacing any prior values.
22231        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22232            self.0.options = v.into();
22233            self
22234        }
22235
22236        /// Sends the request.
22237        pub async fn send(self) -> Result<()> {
22238            (*self.0.stub)
22239                .delete_operation(self.0.request, self.0.options)
22240                .await
22241                .map(crate::Response::into_body)
22242        }
22243
22244        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
22245        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22246            self.0.request.name = v.into();
22247            self
22248        }
22249    }
22250
22251    #[doc(hidden)]
22252    impl crate::RequestBuilder for DeleteOperation {
22253        fn request_options(&mut self) -> &mut crate::RequestOptions {
22254            &mut self.0.options
22255        }
22256    }
22257
22258    /// The request builder for [SecurityProfileGroupService::cancel_operation][crate::client::SecurityProfileGroupService::cancel_operation] calls.
22259    ///
22260    /// # Example
22261    /// ```
22262    /// # use google_cloud_networksecurity_v1::builder::security_profile_group_service::CancelOperation;
22263    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22264    ///
22265    /// let builder = prepare_request_builder();
22266    /// let response = builder.send().await?;
22267    /// # Ok(()) }
22268    ///
22269    /// fn prepare_request_builder() -> CancelOperation {
22270    ///   # panic!();
22271    ///   // ... details omitted ...
22272    /// }
22273    /// ```
22274    #[derive(Clone, Debug)]
22275    pub struct CancelOperation(
22276        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
22277    );
22278
22279    impl CancelOperation {
22280        pub(crate) fn new(
22281            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityProfileGroupService>,
22282        ) -> Self {
22283            Self(RequestBuilder::new(stub))
22284        }
22285
22286        /// Sets the full request, replacing any prior values.
22287        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
22288            mut self,
22289            v: V,
22290        ) -> Self {
22291            self.0.request = v.into();
22292            self
22293        }
22294
22295        /// Sets all the options, replacing any prior values.
22296        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22297            self.0.options = v.into();
22298            self
22299        }
22300
22301        /// Sends the request.
22302        pub async fn send(self) -> Result<()> {
22303            (*self.0.stub)
22304                .cancel_operation(self.0.request, self.0.options)
22305                .await
22306                .map(crate::Response::into_body)
22307        }
22308
22309        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
22310        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22311            self.0.request.name = v.into();
22312            self
22313        }
22314    }
22315
22316    #[doc(hidden)]
22317    impl crate::RequestBuilder for CancelOperation {
22318        fn request_options(&mut self) -> &mut crate::RequestOptions {
22319            &mut self.0.options
22320        }
22321    }
22322}
22323
22324/// Request and client builders for [OrganizationSecurityProfileGroupService][crate::client::OrganizationSecurityProfileGroupService].
22325pub mod organization_security_profile_group_service {
22326    use crate::Result;
22327
22328    /// A builder for [OrganizationSecurityProfileGroupService][crate::client::OrganizationSecurityProfileGroupService].
22329    ///
22330    /// ```
22331    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
22332    /// # use google_cloud_networksecurity_v1::*;
22333    /// # use builder::organization_security_profile_group_service::ClientBuilder;
22334    /// # use client::OrganizationSecurityProfileGroupService;
22335    /// let builder : ClientBuilder = OrganizationSecurityProfileGroupService::builder();
22336    /// let client = builder
22337    ///     .with_endpoint("https://networksecurity.googleapis.com")
22338    ///     .build().await?;
22339    /// # Ok(()) }
22340    /// ```
22341    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
22342
22343    pub(crate) mod client {
22344        use super::super::super::client::OrganizationSecurityProfileGroupService;
22345        pub struct Factory;
22346        impl crate::ClientFactory for Factory {
22347            type Client = OrganizationSecurityProfileGroupService;
22348            type Credentials = gaxi::options::Credentials;
22349            async fn build(
22350                self,
22351                config: gaxi::options::ClientConfig,
22352            ) -> crate::ClientBuilderResult<Self::Client> {
22353                Self::Client::new(config).await
22354            }
22355        }
22356    }
22357
22358    /// Common implementation for [crate::client::OrganizationSecurityProfileGroupService] request builders.
22359    #[derive(Clone, Debug)]
22360    pub(crate) struct RequestBuilder<R: std::default::Default> {
22361        stub: std::sync::Arc<
22362            dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22363        >,
22364        request: R,
22365        options: crate::RequestOptions,
22366    }
22367
22368    impl<R> RequestBuilder<R>
22369    where
22370        R: std::default::Default,
22371    {
22372        pub(crate) fn new(
22373            stub: std::sync::Arc<
22374                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22375            >,
22376        ) -> Self {
22377            Self {
22378                stub,
22379                request: R::default(),
22380                options: crate::RequestOptions::default(),
22381            }
22382        }
22383    }
22384
22385    /// The request builder for [OrganizationSecurityProfileGroupService::list_security_profile_groups][crate::client::OrganizationSecurityProfileGroupService::list_security_profile_groups] calls.
22386    ///
22387    /// # Example
22388    /// ```
22389    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListSecurityProfileGroups;
22390    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22391    /// use google_cloud_gax::paginator::ItemPaginator;
22392    ///
22393    /// let builder = prepare_request_builder();
22394    /// let mut items = builder.by_item();
22395    /// while let Some(result) = items.next().await {
22396    ///   let item = result?;
22397    /// }
22398    /// # Ok(()) }
22399    ///
22400    /// fn prepare_request_builder() -> ListSecurityProfileGroups {
22401    ///   # panic!();
22402    ///   // ... details omitted ...
22403    /// }
22404    /// ```
22405    #[derive(Clone, Debug)]
22406    pub struct ListSecurityProfileGroups(
22407        RequestBuilder<crate::model::ListSecurityProfileGroupsRequest>,
22408    );
22409
22410    impl ListSecurityProfileGroups {
22411        pub(crate) fn new(
22412            stub: std::sync::Arc<
22413                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22414            >,
22415        ) -> Self {
22416            Self(RequestBuilder::new(stub))
22417        }
22418
22419        /// Sets the full request, replacing any prior values.
22420        pub fn with_request<V: Into<crate::model::ListSecurityProfileGroupsRequest>>(
22421            mut self,
22422            v: V,
22423        ) -> Self {
22424            self.0.request = v.into();
22425            self
22426        }
22427
22428        /// Sets all the options, replacing any prior values.
22429        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22430            self.0.options = v.into();
22431            self
22432        }
22433
22434        /// Sends the request.
22435        pub async fn send(self) -> Result<crate::model::ListSecurityProfileGroupsResponse> {
22436            (*self.0.stub)
22437                .list_security_profile_groups(self.0.request, self.0.options)
22438                .await
22439                .map(crate::Response::into_body)
22440        }
22441
22442        /// Streams each page in the collection.
22443        pub fn by_page(
22444            self,
22445        ) -> impl google_cloud_gax::paginator::Paginator<
22446            crate::model::ListSecurityProfileGroupsResponse,
22447            crate::Error,
22448        > {
22449            use std::clone::Clone;
22450            let token = self.0.request.page_token.clone();
22451            let execute = move |token: String| {
22452                let mut builder = self.clone();
22453                builder.0.request = builder.0.request.set_page_token(token);
22454                builder.send()
22455            };
22456            google_cloud_gax::paginator::internal::new_paginator(token, execute)
22457        }
22458
22459        /// Streams each item in the collection.
22460        pub fn by_item(
22461            self,
22462        ) -> impl google_cloud_gax::paginator::ItemPaginator<
22463            crate::model::ListSecurityProfileGroupsResponse,
22464            crate::Error,
22465        > {
22466            use google_cloud_gax::paginator::Paginator;
22467            self.by_page().items()
22468        }
22469
22470        /// Sets the value of [parent][crate::model::ListSecurityProfileGroupsRequest::parent].
22471        ///
22472        /// This is a **required** field for requests.
22473        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22474            self.0.request.parent = v.into();
22475            self
22476        }
22477
22478        /// Sets the value of [page_size][crate::model::ListSecurityProfileGroupsRequest::page_size].
22479        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22480            self.0.request.page_size = v.into();
22481            self
22482        }
22483
22484        /// Sets the value of [page_token][crate::model::ListSecurityProfileGroupsRequest::page_token].
22485        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22486            self.0.request.page_token = v.into();
22487            self
22488        }
22489    }
22490
22491    #[doc(hidden)]
22492    impl crate::RequestBuilder for ListSecurityProfileGroups {
22493        fn request_options(&mut self) -> &mut crate::RequestOptions {
22494            &mut self.0.options
22495        }
22496    }
22497
22498    /// The request builder for [OrganizationSecurityProfileGroupService::get_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::get_security_profile_group] calls.
22499    ///
22500    /// # Example
22501    /// ```
22502    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetSecurityProfileGroup;
22503    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22504    ///
22505    /// let builder = prepare_request_builder();
22506    /// let response = builder.send().await?;
22507    /// # Ok(()) }
22508    ///
22509    /// fn prepare_request_builder() -> GetSecurityProfileGroup {
22510    ///   # panic!();
22511    ///   // ... details omitted ...
22512    /// }
22513    /// ```
22514    #[derive(Clone, Debug)]
22515    pub struct GetSecurityProfileGroup(
22516        RequestBuilder<crate::model::GetSecurityProfileGroupRequest>,
22517    );
22518
22519    impl GetSecurityProfileGroup {
22520        pub(crate) fn new(
22521            stub: std::sync::Arc<
22522                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22523            >,
22524        ) -> Self {
22525            Self(RequestBuilder::new(stub))
22526        }
22527
22528        /// Sets the full request, replacing any prior values.
22529        pub fn with_request<V: Into<crate::model::GetSecurityProfileGroupRequest>>(
22530            mut self,
22531            v: V,
22532        ) -> Self {
22533            self.0.request = v.into();
22534            self
22535        }
22536
22537        /// Sets all the options, replacing any prior values.
22538        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22539            self.0.options = v.into();
22540            self
22541        }
22542
22543        /// Sends the request.
22544        pub async fn send(self) -> Result<crate::model::SecurityProfileGroup> {
22545            (*self.0.stub)
22546                .get_security_profile_group(self.0.request, self.0.options)
22547                .await
22548                .map(crate::Response::into_body)
22549        }
22550
22551        /// Sets the value of [name][crate::model::GetSecurityProfileGroupRequest::name].
22552        ///
22553        /// This is a **required** field for requests.
22554        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22555            self.0.request.name = v.into();
22556            self
22557        }
22558    }
22559
22560    #[doc(hidden)]
22561    impl crate::RequestBuilder for GetSecurityProfileGroup {
22562        fn request_options(&mut self) -> &mut crate::RequestOptions {
22563            &mut self.0.options
22564        }
22565    }
22566
22567    /// The request builder for [OrganizationSecurityProfileGroupService::create_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::create_security_profile_group] calls.
22568    ///
22569    /// # Example
22570    /// ```
22571    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::CreateSecurityProfileGroup;
22572    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22573    /// use google_cloud_lro::Poller;
22574    ///
22575    /// let builder = prepare_request_builder();
22576    /// let response = builder.poller().until_done().await?;
22577    /// # Ok(()) }
22578    ///
22579    /// fn prepare_request_builder() -> CreateSecurityProfileGroup {
22580    ///   # panic!();
22581    ///   // ... details omitted ...
22582    /// }
22583    /// ```
22584    #[derive(Clone, Debug)]
22585    pub struct CreateSecurityProfileGroup(
22586        RequestBuilder<crate::model::CreateSecurityProfileGroupRequest>,
22587    );
22588
22589    impl CreateSecurityProfileGroup {
22590        pub(crate) fn new(
22591            stub: std::sync::Arc<
22592                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22593            >,
22594        ) -> Self {
22595            Self(RequestBuilder::new(stub))
22596        }
22597
22598        /// Sets the full request, replacing any prior values.
22599        pub fn with_request<V: Into<crate::model::CreateSecurityProfileGroupRequest>>(
22600            mut self,
22601            v: V,
22602        ) -> Self {
22603            self.0.request = v.into();
22604            self
22605        }
22606
22607        /// Sets all the options, replacing any prior values.
22608        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22609            self.0.options = v.into();
22610            self
22611        }
22612
22613        /// Sends the request.
22614        ///
22615        /// # Long running operations
22616        ///
22617        /// This starts, but does not poll, a longrunning operation. More information
22618        /// on [create_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::create_security_profile_group].
22619        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22620            (*self.0.stub)
22621                .create_security_profile_group(self.0.request, self.0.options)
22622                .await
22623                .map(crate::Response::into_body)
22624        }
22625
22626        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_security_profile_group`.
22627        pub fn poller(
22628            self,
22629        ) -> impl google_cloud_lro::Poller<
22630            crate::model::SecurityProfileGroup,
22631            crate::model::OperationMetadata,
22632        > {
22633            type Operation = google_cloud_lro::internal::Operation<
22634                crate::model::SecurityProfileGroup,
22635                crate::model::OperationMetadata,
22636            >;
22637            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
22638            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
22639
22640            let stub = self.0.stub.clone();
22641            let mut options = self.0.options.clone();
22642            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
22643            let query = move |name| {
22644                let stub = stub.clone();
22645                let options = options.clone();
22646                async {
22647                    let op = GetOperation::new(stub)
22648                        .set_name(name)
22649                        .with_options(options)
22650                        .send()
22651                        .await?;
22652                    Ok(Operation::new(op))
22653                }
22654            };
22655
22656            let start = move || async {
22657                let op = self.send().await?;
22658                Ok(Operation::new(op))
22659            };
22660
22661            google_cloud_lro::internal::new_poller(
22662                polling_error_policy,
22663                polling_backoff_policy,
22664                start,
22665                query,
22666            )
22667        }
22668
22669        /// Sets the value of [parent][crate::model::CreateSecurityProfileGroupRequest::parent].
22670        ///
22671        /// This is a **required** field for requests.
22672        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22673            self.0.request.parent = v.into();
22674            self
22675        }
22676
22677        /// Sets the value of [security_profile_group_id][crate::model::CreateSecurityProfileGroupRequest::security_profile_group_id].
22678        ///
22679        /// This is a **required** field for requests.
22680        pub fn set_security_profile_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
22681            self.0.request.security_profile_group_id = v.into();
22682            self
22683        }
22684
22685        /// Sets the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
22686        ///
22687        /// This is a **required** field for requests.
22688        pub fn set_security_profile_group<T>(mut self, v: T) -> Self
22689        where
22690            T: std::convert::Into<crate::model::SecurityProfileGroup>,
22691        {
22692            self.0.request.security_profile_group = std::option::Option::Some(v.into());
22693            self
22694        }
22695
22696        /// Sets or clears the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
22697        ///
22698        /// This is a **required** field for requests.
22699        pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
22700        where
22701            T: std::convert::Into<crate::model::SecurityProfileGroup>,
22702        {
22703            self.0.request.security_profile_group = v.map(|x| x.into());
22704            self
22705        }
22706    }
22707
22708    #[doc(hidden)]
22709    impl crate::RequestBuilder for CreateSecurityProfileGroup {
22710        fn request_options(&mut self) -> &mut crate::RequestOptions {
22711            &mut self.0.options
22712        }
22713    }
22714
22715    /// The request builder for [OrganizationSecurityProfileGroupService::update_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::update_security_profile_group] calls.
22716    ///
22717    /// # Example
22718    /// ```
22719    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::UpdateSecurityProfileGroup;
22720    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22721    /// use google_cloud_lro::Poller;
22722    ///
22723    /// let builder = prepare_request_builder();
22724    /// let response = builder.poller().until_done().await?;
22725    /// # Ok(()) }
22726    ///
22727    /// fn prepare_request_builder() -> UpdateSecurityProfileGroup {
22728    ///   # panic!();
22729    ///   // ... details omitted ...
22730    /// }
22731    /// ```
22732    #[derive(Clone, Debug)]
22733    pub struct UpdateSecurityProfileGroup(
22734        RequestBuilder<crate::model::UpdateSecurityProfileGroupRequest>,
22735    );
22736
22737    impl UpdateSecurityProfileGroup {
22738        pub(crate) fn new(
22739            stub: std::sync::Arc<
22740                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22741            >,
22742        ) -> Self {
22743            Self(RequestBuilder::new(stub))
22744        }
22745
22746        /// Sets the full request, replacing any prior values.
22747        pub fn with_request<V: Into<crate::model::UpdateSecurityProfileGroupRequest>>(
22748            mut self,
22749            v: V,
22750        ) -> Self {
22751            self.0.request = v.into();
22752            self
22753        }
22754
22755        /// Sets all the options, replacing any prior values.
22756        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22757            self.0.options = v.into();
22758            self
22759        }
22760
22761        /// Sends the request.
22762        ///
22763        /// # Long running operations
22764        ///
22765        /// This starts, but does not poll, a longrunning operation. More information
22766        /// on [update_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::update_security_profile_group].
22767        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22768            (*self.0.stub)
22769                .update_security_profile_group(self.0.request, self.0.options)
22770                .await
22771                .map(crate::Response::into_body)
22772        }
22773
22774        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_security_profile_group`.
22775        pub fn poller(
22776            self,
22777        ) -> impl google_cloud_lro::Poller<
22778            crate::model::SecurityProfileGroup,
22779            crate::model::OperationMetadata,
22780        > {
22781            type Operation = google_cloud_lro::internal::Operation<
22782                crate::model::SecurityProfileGroup,
22783                crate::model::OperationMetadata,
22784            >;
22785            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
22786            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
22787
22788            let stub = self.0.stub.clone();
22789            let mut options = self.0.options.clone();
22790            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
22791            let query = move |name| {
22792                let stub = stub.clone();
22793                let options = options.clone();
22794                async {
22795                    let op = GetOperation::new(stub)
22796                        .set_name(name)
22797                        .with_options(options)
22798                        .send()
22799                        .await?;
22800                    Ok(Operation::new(op))
22801                }
22802            };
22803
22804            let start = move || async {
22805                let op = self.send().await?;
22806                Ok(Operation::new(op))
22807            };
22808
22809            google_cloud_lro::internal::new_poller(
22810                polling_error_policy,
22811                polling_backoff_policy,
22812                start,
22813                query,
22814            )
22815        }
22816
22817        /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
22818        ///
22819        /// This is a **required** field for requests.
22820        pub fn set_update_mask<T>(mut self, v: T) -> Self
22821        where
22822            T: std::convert::Into<wkt::FieldMask>,
22823        {
22824            self.0.request.update_mask = std::option::Option::Some(v.into());
22825            self
22826        }
22827
22828        /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
22829        ///
22830        /// This is a **required** field for requests.
22831        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22832        where
22833            T: std::convert::Into<wkt::FieldMask>,
22834        {
22835            self.0.request.update_mask = v.map(|x| x.into());
22836            self
22837        }
22838
22839        /// Sets the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
22840        ///
22841        /// This is a **required** field for requests.
22842        pub fn set_security_profile_group<T>(mut self, v: T) -> Self
22843        where
22844            T: std::convert::Into<crate::model::SecurityProfileGroup>,
22845        {
22846            self.0.request.security_profile_group = std::option::Option::Some(v.into());
22847            self
22848        }
22849
22850        /// Sets or clears the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
22851        ///
22852        /// This is a **required** field for requests.
22853        pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
22854        where
22855            T: std::convert::Into<crate::model::SecurityProfileGroup>,
22856        {
22857            self.0.request.security_profile_group = v.map(|x| x.into());
22858            self
22859        }
22860    }
22861
22862    #[doc(hidden)]
22863    impl crate::RequestBuilder for UpdateSecurityProfileGroup {
22864        fn request_options(&mut self) -> &mut crate::RequestOptions {
22865            &mut self.0.options
22866        }
22867    }
22868
22869    /// The request builder for [OrganizationSecurityProfileGroupService::delete_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile_group] calls.
22870    ///
22871    /// # Example
22872    /// ```
22873    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::DeleteSecurityProfileGroup;
22874    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22875    /// use google_cloud_lro::Poller;
22876    ///
22877    /// let builder = prepare_request_builder();
22878    /// let response = builder.poller().until_done().await?;
22879    /// # Ok(()) }
22880    ///
22881    /// fn prepare_request_builder() -> DeleteSecurityProfileGroup {
22882    ///   # panic!();
22883    ///   // ... details omitted ...
22884    /// }
22885    /// ```
22886    #[derive(Clone, Debug)]
22887    pub struct DeleteSecurityProfileGroup(
22888        RequestBuilder<crate::model::DeleteSecurityProfileGroupRequest>,
22889    );
22890
22891    impl DeleteSecurityProfileGroup {
22892        pub(crate) fn new(
22893            stub: std::sync::Arc<
22894                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
22895            >,
22896        ) -> Self {
22897            Self(RequestBuilder::new(stub))
22898        }
22899
22900        /// Sets the full request, replacing any prior values.
22901        pub fn with_request<V: Into<crate::model::DeleteSecurityProfileGroupRequest>>(
22902            mut self,
22903            v: V,
22904        ) -> Self {
22905            self.0.request = v.into();
22906            self
22907        }
22908
22909        /// Sets all the options, replacing any prior values.
22910        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22911            self.0.options = v.into();
22912            self
22913        }
22914
22915        /// Sends the request.
22916        ///
22917        /// # Long running operations
22918        ///
22919        /// This starts, but does not poll, a longrunning operation. More information
22920        /// on [delete_security_profile_group][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile_group].
22921        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22922            (*self.0.stub)
22923                .delete_security_profile_group(self.0.request, self.0.options)
22924                .await
22925                .map(crate::Response::into_body)
22926        }
22927
22928        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_security_profile_group`.
22929        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
22930            type Operation =
22931                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
22932            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
22933            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
22934
22935            let stub = self.0.stub.clone();
22936            let mut options = self.0.options.clone();
22937            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
22938            let query = move |name| {
22939                let stub = stub.clone();
22940                let options = options.clone();
22941                async {
22942                    let op = GetOperation::new(stub)
22943                        .set_name(name)
22944                        .with_options(options)
22945                        .send()
22946                        .await?;
22947                    Ok(Operation::new(op))
22948                }
22949            };
22950
22951            let start = move || async {
22952                let op = self.send().await?;
22953                Ok(Operation::new(op))
22954            };
22955
22956            google_cloud_lro::internal::new_unit_response_poller(
22957                polling_error_policy,
22958                polling_backoff_policy,
22959                start,
22960                query,
22961            )
22962        }
22963
22964        /// Sets the value of [name][crate::model::DeleteSecurityProfileGroupRequest::name].
22965        ///
22966        /// This is a **required** field for requests.
22967        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22968            self.0.request.name = v.into();
22969            self
22970        }
22971
22972        /// Sets the value of [etag][crate::model::DeleteSecurityProfileGroupRequest::etag].
22973        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
22974            self.0.request.etag = v.into();
22975            self
22976        }
22977    }
22978
22979    #[doc(hidden)]
22980    impl crate::RequestBuilder for DeleteSecurityProfileGroup {
22981        fn request_options(&mut self) -> &mut crate::RequestOptions {
22982            &mut self.0.options
22983        }
22984    }
22985
22986    /// The request builder for [OrganizationSecurityProfileGroupService::list_security_profiles][crate::client::OrganizationSecurityProfileGroupService::list_security_profiles] calls.
22987    ///
22988    /// # Example
22989    /// ```
22990    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListSecurityProfiles;
22991    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
22992    /// use google_cloud_gax::paginator::ItemPaginator;
22993    ///
22994    /// let builder = prepare_request_builder();
22995    /// let mut items = builder.by_item();
22996    /// while let Some(result) = items.next().await {
22997    ///   let item = result?;
22998    /// }
22999    /// # Ok(()) }
23000    ///
23001    /// fn prepare_request_builder() -> ListSecurityProfiles {
23002    ///   # panic!();
23003    ///   // ... details omitted ...
23004    /// }
23005    /// ```
23006    #[derive(Clone, Debug)]
23007    pub struct ListSecurityProfiles(RequestBuilder<crate::model::ListSecurityProfilesRequest>);
23008
23009    impl ListSecurityProfiles {
23010        pub(crate) fn new(
23011            stub: std::sync::Arc<
23012                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23013            >,
23014        ) -> Self {
23015            Self(RequestBuilder::new(stub))
23016        }
23017
23018        /// Sets the full request, replacing any prior values.
23019        pub fn with_request<V: Into<crate::model::ListSecurityProfilesRequest>>(
23020            mut self,
23021            v: V,
23022        ) -> Self {
23023            self.0.request = v.into();
23024            self
23025        }
23026
23027        /// Sets all the options, replacing any prior values.
23028        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23029            self.0.options = v.into();
23030            self
23031        }
23032
23033        /// Sends the request.
23034        pub async fn send(self) -> Result<crate::model::ListSecurityProfilesResponse> {
23035            (*self.0.stub)
23036                .list_security_profiles(self.0.request, self.0.options)
23037                .await
23038                .map(crate::Response::into_body)
23039        }
23040
23041        /// Streams each page in the collection.
23042        pub fn by_page(
23043            self,
23044        ) -> impl google_cloud_gax::paginator::Paginator<
23045            crate::model::ListSecurityProfilesResponse,
23046            crate::Error,
23047        > {
23048            use std::clone::Clone;
23049            let token = self.0.request.page_token.clone();
23050            let execute = move |token: String| {
23051                let mut builder = self.clone();
23052                builder.0.request = builder.0.request.set_page_token(token);
23053                builder.send()
23054            };
23055            google_cloud_gax::paginator::internal::new_paginator(token, execute)
23056        }
23057
23058        /// Streams each item in the collection.
23059        pub fn by_item(
23060            self,
23061        ) -> impl google_cloud_gax::paginator::ItemPaginator<
23062            crate::model::ListSecurityProfilesResponse,
23063            crate::Error,
23064        > {
23065            use google_cloud_gax::paginator::Paginator;
23066            self.by_page().items()
23067        }
23068
23069        /// Sets the value of [parent][crate::model::ListSecurityProfilesRequest::parent].
23070        ///
23071        /// This is a **required** field for requests.
23072        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
23073            self.0.request.parent = v.into();
23074            self
23075        }
23076
23077        /// Sets the value of [page_size][crate::model::ListSecurityProfilesRequest::page_size].
23078        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
23079            self.0.request.page_size = v.into();
23080            self
23081        }
23082
23083        /// Sets the value of [page_token][crate::model::ListSecurityProfilesRequest::page_token].
23084        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
23085            self.0.request.page_token = v.into();
23086            self
23087        }
23088    }
23089
23090    #[doc(hidden)]
23091    impl crate::RequestBuilder for ListSecurityProfiles {
23092        fn request_options(&mut self) -> &mut crate::RequestOptions {
23093            &mut self.0.options
23094        }
23095    }
23096
23097    /// The request builder for [OrganizationSecurityProfileGroupService::get_security_profile][crate::client::OrganizationSecurityProfileGroupService::get_security_profile] calls.
23098    ///
23099    /// # Example
23100    /// ```
23101    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetSecurityProfile;
23102    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23103    ///
23104    /// let builder = prepare_request_builder();
23105    /// let response = builder.send().await?;
23106    /// # Ok(()) }
23107    ///
23108    /// fn prepare_request_builder() -> GetSecurityProfile {
23109    ///   # panic!();
23110    ///   // ... details omitted ...
23111    /// }
23112    /// ```
23113    #[derive(Clone, Debug)]
23114    pub struct GetSecurityProfile(RequestBuilder<crate::model::GetSecurityProfileRequest>);
23115
23116    impl GetSecurityProfile {
23117        pub(crate) fn new(
23118            stub: std::sync::Arc<
23119                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23120            >,
23121        ) -> Self {
23122            Self(RequestBuilder::new(stub))
23123        }
23124
23125        /// Sets the full request, replacing any prior values.
23126        pub fn with_request<V: Into<crate::model::GetSecurityProfileRequest>>(
23127            mut self,
23128            v: V,
23129        ) -> Self {
23130            self.0.request = v.into();
23131            self
23132        }
23133
23134        /// Sets all the options, replacing any prior values.
23135        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23136            self.0.options = v.into();
23137            self
23138        }
23139
23140        /// Sends the request.
23141        pub async fn send(self) -> Result<crate::model::SecurityProfile> {
23142            (*self.0.stub)
23143                .get_security_profile(self.0.request, self.0.options)
23144                .await
23145                .map(crate::Response::into_body)
23146        }
23147
23148        /// Sets the value of [name][crate::model::GetSecurityProfileRequest::name].
23149        ///
23150        /// This is a **required** field for requests.
23151        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23152            self.0.request.name = v.into();
23153            self
23154        }
23155    }
23156
23157    #[doc(hidden)]
23158    impl crate::RequestBuilder for GetSecurityProfile {
23159        fn request_options(&mut self) -> &mut crate::RequestOptions {
23160            &mut self.0.options
23161        }
23162    }
23163
23164    /// The request builder for [OrganizationSecurityProfileGroupService::create_security_profile][crate::client::OrganizationSecurityProfileGroupService::create_security_profile] calls.
23165    ///
23166    /// # Example
23167    /// ```
23168    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::CreateSecurityProfile;
23169    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23170    /// use google_cloud_lro::Poller;
23171    ///
23172    /// let builder = prepare_request_builder();
23173    /// let response = builder.poller().until_done().await?;
23174    /// # Ok(()) }
23175    ///
23176    /// fn prepare_request_builder() -> CreateSecurityProfile {
23177    ///   # panic!();
23178    ///   // ... details omitted ...
23179    /// }
23180    /// ```
23181    #[derive(Clone, Debug)]
23182    pub struct CreateSecurityProfile(RequestBuilder<crate::model::CreateSecurityProfileRequest>);
23183
23184    impl CreateSecurityProfile {
23185        pub(crate) fn new(
23186            stub: std::sync::Arc<
23187                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23188            >,
23189        ) -> Self {
23190            Self(RequestBuilder::new(stub))
23191        }
23192
23193        /// Sets the full request, replacing any prior values.
23194        pub fn with_request<V: Into<crate::model::CreateSecurityProfileRequest>>(
23195            mut self,
23196            v: V,
23197        ) -> Self {
23198            self.0.request = v.into();
23199            self
23200        }
23201
23202        /// Sets all the options, replacing any prior values.
23203        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23204            self.0.options = v.into();
23205            self
23206        }
23207
23208        /// Sends the request.
23209        ///
23210        /// # Long running operations
23211        ///
23212        /// This starts, but does not poll, a longrunning operation. More information
23213        /// on [create_security_profile][crate::client::OrganizationSecurityProfileGroupService::create_security_profile].
23214        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23215            (*self.0.stub)
23216                .create_security_profile(self.0.request, self.0.options)
23217                .await
23218                .map(crate::Response::into_body)
23219        }
23220
23221        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_security_profile`.
23222        pub fn poller(
23223            self,
23224        ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
23225        {
23226            type Operation = google_cloud_lro::internal::Operation<
23227                crate::model::SecurityProfile,
23228                crate::model::OperationMetadata,
23229            >;
23230            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
23231            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
23232
23233            let stub = self.0.stub.clone();
23234            let mut options = self.0.options.clone();
23235            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
23236            let query = move |name| {
23237                let stub = stub.clone();
23238                let options = options.clone();
23239                async {
23240                    let op = GetOperation::new(stub)
23241                        .set_name(name)
23242                        .with_options(options)
23243                        .send()
23244                        .await?;
23245                    Ok(Operation::new(op))
23246                }
23247            };
23248
23249            let start = move || async {
23250                let op = self.send().await?;
23251                Ok(Operation::new(op))
23252            };
23253
23254            google_cloud_lro::internal::new_poller(
23255                polling_error_policy,
23256                polling_backoff_policy,
23257                start,
23258                query,
23259            )
23260        }
23261
23262        /// Sets the value of [parent][crate::model::CreateSecurityProfileRequest::parent].
23263        ///
23264        /// This is a **required** field for requests.
23265        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
23266            self.0.request.parent = v.into();
23267            self
23268        }
23269
23270        /// Sets the value of [security_profile_id][crate::model::CreateSecurityProfileRequest::security_profile_id].
23271        ///
23272        /// This is a **required** field for requests.
23273        pub fn set_security_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
23274            self.0.request.security_profile_id = v.into();
23275            self
23276        }
23277
23278        /// Sets the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
23279        ///
23280        /// This is a **required** field for requests.
23281        pub fn set_security_profile<T>(mut self, v: T) -> Self
23282        where
23283            T: std::convert::Into<crate::model::SecurityProfile>,
23284        {
23285            self.0.request.security_profile = std::option::Option::Some(v.into());
23286            self
23287        }
23288
23289        /// Sets or clears the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
23290        ///
23291        /// This is a **required** field for requests.
23292        pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
23293        where
23294            T: std::convert::Into<crate::model::SecurityProfile>,
23295        {
23296            self.0.request.security_profile = v.map(|x| x.into());
23297            self
23298        }
23299    }
23300
23301    #[doc(hidden)]
23302    impl crate::RequestBuilder for CreateSecurityProfile {
23303        fn request_options(&mut self) -> &mut crate::RequestOptions {
23304            &mut self.0.options
23305        }
23306    }
23307
23308    /// The request builder for [OrganizationSecurityProfileGroupService::update_security_profile][crate::client::OrganizationSecurityProfileGroupService::update_security_profile] calls.
23309    ///
23310    /// # Example
23311    /// ```
23312    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::UpdateSecurityProfile;
23313    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23314    /// use google_cloud_lro::Poller;
23315    ///
23316    /// let builder = prepare_request_builder();
23317    /// let response = builder.poller().until_done().await?;
23318    /// # Ok(()) }
23319    ///
23320    /// fn prepare_request_builder() -> UpdateSecurityProfile {
23321    ///   # panic!();
23322    ///   // ... details omitted ...
23323    /// }
23324    /// ```
23325    #[derive(Clone, Debug)]
23326    pub struct UpdateSecurityProfile(RequestBuilder<crate::model::UpdateSecurityProfileRequest>);
23327
23328    impl UpdateSecurityProfile {
23329        pub(crate) fn new(
23330            stub: std::sync::Arc<
23331                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23332            >,
23333        ) -> Self {
23334            Self(RequestBuilder::new(stub))
23335        }
23336
23337        /// Sets the full request, replacing any prior values.
23338        pub fn with_request<V: Into<crate::model::UpdateSecurityProfileRequest>>(
23339            mut self,
23340            v: V,
23341        ) -> Self {
23342            self.0.request = v.into();
23343            self
23344        }
23345
23346        /// Sets all the options, replacing any prior values.
23347        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23348            self.0.options = v.into();
23349            self
23350        }
23351
23352        /// Sends the request.
23353        ///
23354        /// # Long running operations
23355        ///
23356        /// This starts, but does not poll, a longrunning operation. More information
23357        /// on [update_security_profile][crate::client::OrganizationSecurityProfileGroupService::update_security_profile].
23358        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23359            (*self.0.stub)
23360                .update_security_profile(self.0.request, self.0.options)
23361                .await
23362                .map(crate::Response::into_body)
23363        }
23364
23365        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_security_profile`.
23366        pub fn poller(
23367            self,
23368        ) -> impl google_cloud_lro::Poller<crate::model::SecurityProfile, crate::model::OperationMetadata>
23369        {
23370            type Operation = google_cloud_lro::internal::Operation<
23371                crate::model::SecurityProfile,
23372                crate::model::OperationMetadata,
23373            >;
23374            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
23375            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
23376
23377            let stub = self.0.stub.clone();
23378            let mut options = self.0.options.clone();
23379            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
23380            let query = move |name| {
23381                let stub = stub.clone();
23382                let options = options.clone();
23383                async {
23384                    let op = GetOperation::new(stub)
23385                        .set_name(name)
23386                        .with_options(options)
23387                        .send()
23388                        .await?;
23389                    Ok(Operation::new(op))
23390                }
23391            };
23392
23393            let start = move || async {
23394                let op = self.send().await?;
23395                Ok(Operation::new(op))
23396            };
23397
23398            google_cloud_lro::internal::new_poller(
23399                polling_error_policy,
23400                polling_backoff_policy,
23401                start,
23402                query,
23403            )
23404        }
23405
23406        /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
23407        ///
23408        /// This is a **required** field for requests.
23409        pub fn set_update_mask<T>(mut self, v: T) -> Self
23410        where
23411            T: std::convert::Into<wkt::FieldMask>,
23412        {
23413            self.0.request.update_mask = std::option::Option::Some(v.into());
23414            self
23415        }
23416
23417        /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
23418        ///
23419        /// This is a **required** field for requests.
23420        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
23421        where
23422            T: std::convert::Into<wkt::FieldMask>,
23423        {
23424            self.0.request.update_mask = v.map(|x| x.into());
23425            self
23426        }
23427
23428        /// Sets the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
23429        ///
23430        /// This is a **required** field for requests.
23431        pub fn set_security_profile<T>(mut self, v: T) -> Self
23432        where
23433            T: std::convert::Into<crate::model::SecurityProfile>,
23434        {
23435            self.0.request.security_profile = std::option::Option::Some(v.into());
23436            self
23437        }
23438
23439        /// Sets or clears the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
23440        ///
23441        /// This is a **required** field for requests.
23442        pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
23443        where
23444            T: std::convert::Into<crate::model::SecurityProfile>,
23445        {
23446            self.0.request.security_profile = v.map(|x| x.into());
23447            self
23448        }
23449    }
23450
23451    #[doc(hidden)]
23452    impl crate::RequestBuilder for UpdateSecurityProfile {
23453        fn request_options(&mut self) -> &mut crate::RequestOptions {
23454            &mut self.0.options
23455        }
23456    }
23457
23458    /// The request builder for [OrganizationSecurityProfileGroupService::delete_security_profile][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile] calls.
23459    ///
23460    /// # Example
23461    /// ```
23462    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::DeleteSecurityProfile;
23463    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23464    /// use google_cloud_lro::Poller;
23465    ///
23466    /// let builder = prepare_request_builder();
23467    /// let response = builder.poller().until_done().await?;
23468    /// # Ok(()) }
23469    ///
23470    /// fn prepare_request_builder() -> DeleteSecurityProfile {
23471    ///   # panic!();
23472    ///   // ... details omitted ...
23473    /// }
23474    /// ```
23475    #[derive(Clone, Debug)]
23476    pub struct DeleteSecurityProfile(RequestBuilder<crate::model::DeleteSecurityProfileRequest>);
23477
23478    impl DeleteSecurityProfile {
23479        pub(crate) fn new(
23480            stub: std::sync::Arc<
23481                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23482            >,
23483        ) -> Self {
23484            Self(RequestBuilder::new(stub))
23485        }
23486
23487        /// Sets the full request, replacing any prior values.
23488        pub fn with_request<V: Into<crate::model::DeleteSecurityProfileRequest>>(
23489            mut self,
23490            v: V,
23491        ) -> Self {
23492            self.0.request = v.into();
23493            self
23494        }
23495
23496        /// Sets all the options, replacing any prior values.
23497        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23498            self.0.options = v.into();
23499            self
23500        }
23501
23502        /// Sends the request.
23503        ///
23504        /// # Long running operations
23505        ///
23506        /// This starts, but does not poll, a longrunning operation. More information
23507        /// on [delete_security_profile][crate::client::OrganizationSecurityProfileGroupService::delete_security_profile].
23508        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23509            (*self.0.stub)
23510                .delete_security_profile(self.0.request, self.0.options)
23511                .await
23512                .map(crate::Response::into_body)
23513        }
23514
23515        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_security_profile`.
23516        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
23517            type Operation =
23518                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
23519            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
23520            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
23521
23522            let stub = self.0.stub.clone();
23523            let mut options = self.0.options.clone();
23524            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
23525            let query = move |name| {
23526                let stub = stub.clone();
23527                let options = options.clone();
23528                async {
23529                    let op = GetOperation::new(stub)
23530                        .set_name(name)
23531                        .with_options(options)
23532                        .send()
23533                        .await?;
23534                    Ok(Operation::new(op))
23535                }
23536            };
23537
23538            let start = move || async {
23539                let op = self.send().await?;
23540                Ok(Operation::new(op))
23541            };
23542
23543            google_cloud_lro::internal::new_unit_response_poller(
23544                polling_error_policy,
23545                polling_backoff_policy,
23546                start,
23547                query,
23548            )
23549        }
23550
23551        /// Sets the value of [name][crate::model::DeleteSecurityProfileRequest::name].
23552        ///
23553        /// This is a **required** field for requests.
23554        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23555            self.0.request.name = v.into();
23556            self
23557        }
23558
23559        /// Sets the value of [etag][crate::model::DeleteSecurityProfileRequest::etag].
23560        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
23561            self.0.request.etag = v.into();
23562            self
23563        }
23564    }
23565
23566    #[doc(hidden)]
23567    impl crate::RequestBuilder for DeleteSecurityProfile {
23568        fn request_options(&mut self) -> &mut crate::RequestOptions {
23569            &mut self.0.options
23570        }
23571    }
23572
23573    /// The request builder for [OrganizationSecurityProfileGroupService::list_locations][crate::client::OrganizationSecurityProfileGroupService::list_locations] calls.
23574    ///
23575    /// # Example
23576    /// ```
23577    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListLocations;
23578    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23579    /// use google_cloud_gax::paginator::ItemPaginator;
23580    ///
23581    /// let builder = prepare_request_builder();
23582    /// let mut items = builder.by_item();
23583    /// while let Some(result) = items.next().await {
23584    ///   let item = result?;
23585    /// }
23586    /// # Ok(()) }
23587    ///
23588    /// fn prepare_request_builder() -> ListLocations {
23589    ///   # panic!();
23590    ///   // ... details omitted ...
23591    /// }
23592    /// ```
23593    #[derive(Clone, Debug)]
23594    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
23595
23596    impl ListLocations {
23597        pub(crate) fn new(
23598            stub: std::sync::Arc<
23599                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23600            >,
23601        ) -> Self {
23602            Self(RequestBuilder::new(stub))
23603        }
23604
23605        /// Sets the full request, replacing any prior values.
23606        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
23607            mut self,
23608            v: V,
23609        ) -> Self {
23610            self.0.request = v.into();
23611            self
23612        }
23613
23614        /// Sets all the options, replacing any prior values.
23615        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23616            self.0.options = v.into();
23617            self
23618        }
23619
23620        /// Sends the request.
23621        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
23622            (*self.0.stub)
23623                .list_locations(self.0.request, self.0.options)
23624                .await
23625                .map(crate::Response::into_body)
23626        }
23627
23628        /// Streams each page in the collection.
23629        pub fn by_page(
23630            self,
23631        ) -> impl google_cloud_gax::paginator::Paginator<
23632            google_cloud_location::model::ListLocationsResponse,
23633            crate::Error,
23634        > {
23635            use std::clone::Clone;
23636            let token = self.0.request.page_token.clone();
23637            let execute = move |token: String| {
23638                let mut builder = self.clone();
23639                builder.0.request = builder.0.request.set_page_token(token);
23640                builder.send()
23641            };
23642            google_cloud_gax::paginator::internal::new_paginator(token, execute)
23643        }
23644
23645        /// Streams each item in the collection.
23646        pub fn by_item(
23647            self,
23648        ) -> impl google_cloud_gax::paginator::ItemPaginator<
23649            google_cloud_location::model::ListLocationsResponse,
23650            crate::Error,
23651        > {
23652            use google_cloud_gax::paginator::Paginator;
23653            self.by_page().items()
23654        }
23655
23656        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
23657        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23658            self.0.request.name = v.into();
23659            self
23660        }
23661
23662        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
23663        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
23664            self.0.request.filter = v.into();
23665            self
23666        }
23667
23668        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
23669        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
23670            self.0.request.page_size = v.into();
23671            self
23672        }
23673
23674        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
23675        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
23676            self.0.request.page_token = v.into();
23677            self
23678        }
23679    }
23680
23681    #[doc(hidden)]
23682    impl crate::RequestBuilder for ListLocations {
23683        fn request_options(&mut self) -> &mut crate::RequestOptions {
23684            &mut self.0.options
23685        }
23686    }
23687
23688    /// The request builder for [OrganizationSecurityProfileGroupService::get_location][crate::client::OrganizationSecurityProfileGroupService::get_location] calls.
23689    ///
23690    /// # Example
23691    /// ```
23692    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetLocation;
23693    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23694    ///
23695    /// let builder = prepare_request_builder();
23696    /// let response = builder.send().await?;
23697    /// # Ok(()) }
23698    ///
23699    /// fn prepare_request_builder() -> GetLocation {
23700    ///   # panic!();
23701    ///   // ... details omitted ...
23702    /// }
23703    /// ```
23704    #[derive(Clone, Debug)]
23705    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
23706
23707    impl GetLocation {
23708        pub(crate) fn new(
23709            stub: std::sync::Arc<
23710                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23711            >,
23712        ) -> Self {
23713            Self(RequestBuilder::new(stub))
23714        }
23715
23716        /// Sets the full request, replacing any prior values.
23717        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
23718            mut self,
23719            v: V,
23720        ) -> Self {
23721            self.0.request = v.into();
23722            self
23723        }
23724
23725        /// Sets all the options, replacing any prior values.
23726        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23727            self.0.options = v.into();
23728            self
23729        }
23730
23731        /// Sends the request.
23732        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
23733            (*self.0.stub)
23734                .get_location(self.0.request, self.0.options)
23735                .await
23736                .map(crate::Response::into_body)
23737        }
23738
23739        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
23740        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23741            self.0.request.name = v.into();
23742            self
23743        }
23744    }
23745
23746    #[doc(hidden)]
23747    impl crate::RequestBuilder for GetLocation {
23748        fn request_options(&mut self) -> &mut crate::RequestOptions {
23749            &mut self.0.options
23750        }
23751    }
23752
23753    /// The request builder for [OrganizationSecurityProfileGroupService::set_iam_policy][crate::client::OrganizationSecurityProfileGroupService::set_iam_policy] calls.
23754    ///
23755    /// # Example
23756    /// ```
23757    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::SetIamPolicy;
23758    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23759    ///
23760    /// let builder = prepare_request_builder();
23761    /// let response = builder.send().await?;
23762    /// # Ok(()) }
23763    ///
23764    /// fn prepare_request_builder() -> SetIamPolicy {
23765    ///   # panic!();
23766    ///   // ... details omitted ...
23767    /// }
23768    /// ```
23769    #[derive(Clone, Debug)]
23770    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
23771
23772    impl SetIamPolicy {
23773        pub(crate) fn new(
23774            stub: std::sync::Arc<
23775                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23776            >,
23777        ) -> Self {
23778            Self(RequestBuilder::new(stub))
23779        }
23780
23781        /// Sets the full request, replacing any prior values.
23782        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
23783            mut self,
23784            v: V,
23785        ) -> Self {
23786            self.0.request = v.into();
23787            self
23788        }
23789
23790        /// Sets all the options, replacing any prior values.
23791        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23792            self.0.options = v.into();
23793            self
23794        }
23795
23796        /// Sends the request.
23797        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
23798            (*self.0.stub)
23799                .set_iam_policy(self.0.request, self.0.options)
23800                .await
23801                .map(crate::Response::into_body)
23802        }
23803
23804        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
23805        ///
23806        /// This is a **required** field for requests.
23807        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
23808            self.0.request.resource = v.into();
23809            self
23810        }
23811
23812        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
23813        ///
23814        /// This is a **required** field for requests.
23815        pub fn set_policy<T>(mut self, v: T) -> Self
23816        where
23817            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
23818        {
23819            self.0.request.policy = std::option::Option::Some(v.into());
23820            self
23821        }
23822
23823        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
23824        ///
23825        /// This is a **required** field for requests.
23826        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
23827        where
23828            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
23829        {
23830            self.0.request.policy = v.map(|x| x.into());
23831            self
23832        }
23833
23834        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
23835        pub fn set_update_mask<T>(mut self, v: T) -> Self
23836        where
23837            T: std::convert::Into<wkt::FieldMask>,
23838        {
23839            self.0.request.update_mask = std::option::Option::Some(v.into());
23840            self
23841        }
23842
23843        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
23844        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
23845        where
23846            T: std::convert::Into<wkt::FieldMask>,
23847        {
23848            self.0.request.update_mask = v.map(|x| x.into());
23849            self
23850        }
23851    }
23852
23853    #[doc(hidden)]
23854    impl crate::RequestBuilder for SetIamPolicy {
23855        fn request_options(&mut self) -> &mut crate::RequestOptions {
23856            &mut self.0.options
23857        }
23858    }
23859
23860    /// The request builder for [OrganizationSecurityProfileGroupService::get_iam_policy][crate::client::OrganizationSecurityProfileGroupService::get_iam_policy] calls.
23861    ///
23862    /// # Example
23863    /// ```
23864    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetIamPolicy;
23865    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23866    ///
23867    /// let builder = prepare_request_builder();
23868    /// let response = builder.send().await?;
23869    /// # Ok(()) }
23870    ///
23871    /// fn prepare_request_builder() -> GetIamPolicy {
23872    ///   # panic!();
23873    ///   // ... details omitted ...
23874    /// }
23875    /// ```
23876    #[derive(Clone, Debug)]
23877    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
23878
23879    impl GetIamPolicy {
23880        pub(crate) fn new(
23881            stub: std::sync::Arc<
23882                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23883            >,
23884        ) -> Self {
23885            Self(RequestBuilder::new(stub))
23886        }
23887
23888        /// Sets the full request, replacing any prior values.
23889        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
23890            mut self,
23891            v: V,
23892        ) -> Self {
23893            self.0.request = v.into();
23894            self
23895        }
23896
23897        /// Sets all the options, replacing any prior values.
23898        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23899            self.0.options = v.into();
23900            self
23901        }
23902
23903        /// Sends the request.
23904        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
23905            (*self.0.stub)
23906                .get_iam_policy(self.0.request, self.0.options)
23907                .await
23908                .map(crate::Response::into_body)
23909        }
23910
23911        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
23912        ///
23913        /// This is a **required** field for requests.
23914        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
23915            self.0.request.resource = v.into();
23916            self
23917        }
23918
23919        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
23920        pub fn set_options<T>(mut self, v: T) -> Self
23921        where
23922            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
23923        {
23924            self.0.request.options = std::option::Option::Some(v.into());
23925            self
23926        }
23927
23928        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
23929        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
23930        where
23931            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
23932        {
23933            self.0.request.options = v.map(|x| x.into());
23934            self
23935        }
23936    }
23937
23938    #[doc(hidden)]
23939    impl crate::RequestBuilder for GetIamPolicy {
23940        fn request_options(&mut self) -> &mut crate::RequestOptions {
23941            &mut self.0.options
23942        }
23943    }
23944
23945    /// The request builder for [OrganizationSecurityProfileGroupService::test_iam_permissions][crate::client::OrganizationSecurityProfileGroupService::test_iam_permissions] calls.
23946    ///
23947    /// # Example
23948    /// ```
23949    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::TestIamPermissions;
23950    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
23951    ///
23952    /// let builder = prepare_request_builder();
23953    /// let response = builder.send().await?;
23954    /// # Ok(()) }
23955    ///
23956    /// fn prepare_request_builder() -> TestIamPermissions {
23957    ///   # panic!();
23958    ///   // ... details omitted ...
23959    /// }
23960    /// ```
23961    #[derive(Clone, Debug)]
23962    pub struct TestIamPermissions(
23963        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
23964    );
23965
23966    impl TestIamPermissions {
23967        pub(crate) fn new(
23968            stub: std::sync::Arc<
23969                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
23970            >,
23971        ) -> Self {
23972            Self(RequestBuilder::new(stub))
23973        }
23974
23975        /// Sets the full request, replacing any prior values.
23976        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
23977            mut self,
23978            v: V,
23979        ) -> Self {
23980            self.0.request = v.into();
23981            self
23982        }
23983
23984        /// Sets all the options, replacing any prior values.
23985        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23986            self.0.options = v.into();
23987            self
23988        }
23989
23990        /// Sends the request.
23991        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
23992            (*self.0.stub)
23993                .test_iam_permissions(self.0.request, self.0.options)
23994                .await
23995                .map(crate::Response::into_body)
23996        }
23997
23998        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
23999        ///
24000        /// This is a **required** field for requests.
24001        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
24002            self.0.request.resource = v.into();
24003            self
24004        }
24005
24006        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
24007        ///
24008        /// This is a **required** field for requests.
24009        pub fn set_permissions<T, V>(mut self, v: T) -> Self
24010        where
24011            T: std::iter::IntoIterator<Item = V>,
24012            V: std::convert::Into<std::string::String>,
24013        {
24014            use std::iter::Iterator;
24015            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
24016            self
24017        }
24018    }
24019
24020    #[doc(hidden)]
24021    impl crate::RequestBuilder for TestIamPermissions {
24022        fn request_options(&mut self) -> &mut crate::RequestOptions {
24023            &mut self.0.options
24024        }
24025    }
24026
24027    /// The request builder for [OrganizationSecurityProfileGroupService::list_operations][crate::client::OrganizationSecurityProfileGroupService::list_operations] calls.
24028    ///
24029    /// # Example
24030    /// ```
24031    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::ListOperations;
24032    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24033    /// use google_cloud_gax::paginator::ItemPaginator;
24034    ///
24035    /// let builder = prepare_request_builder();
24036    /// let mut items = builder.by_item();
24037    /// while let Some(result) = items.next().await {
24038    ///   let item = result?;
24039    /// }
24040    /// # Ok(()) }
24041    ///
24042    /// fn prepare_request_builder() -> ListOperations {
24043    ///   # panic!();
24044    ///   // ... details omitted ...
24045    /// }
24046    /// ```
24047    #[derive(Clone, Debug)]
24048    pub struct ListOperations(
24049        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
24050    );
24051
24052    impl ListOperations {
24053        pub(crate) fn new(
24054            stub: std::sync::Arc<
24055                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24056            >,
24057        ) -> Self {
24058            Self(RequestBuilder::new(stub))
24059        }
24060
24061        /// Sets the full request, replacing any prior values.
24062        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
24063            mut self,
24064            v: V,
24065        ) -> Self {
24066            self.0.request = v.into();
24067            self
24068        }
24069
24070        /// Sets all the options, replacing any prior values.
24071        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24072            self.0.options = v.into();
24073            self
24074        }
24075
24076        /// Sends the request.
24077        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
24078            (*self.0.stub)
24079                .list_operations(self.0.request, self.0.options)
24080                .await
24081                .map(crate::Response::into_body)
24082        }
24083
24084        /// Streams each page in the collection.
24085        pub fn by_page(
24086            self,
24087        ) -> impl google_cloud_gax::paginator::Paginator<
24088            google_cloud_longrunning::model::ListOperationsResponse,
24089            crate::Error,
24090        > {
24091            use std::clone::Clone;
24092            let token = self.0.request.page_token.clone();
24093            let execute = move |token: String| {
24094                let mut builder = self.clone();
24095                builder.0.request = builder.0.request.set_page_token(token);
24096                builder.send()
24097            };
24098            google_cloud_gax::paginator::internal::new_paginator(token, execute)
24099        }
24100
24101        /// Streams each item in the collection.
24102        pub fn by_item(
24103            self,
24104        ) -> impl google_cloud_gax::paginator::ItemPaginator<
24105            google_cloud_longrunning::model::ListOperationsResponse,
24106            crate::Error,
24107        > {
24108            use google_cloud_gax::paginator::Paginator;
24109            self.by_page().items()
24110        }
24111
24112        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
24113        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24114            self.0.request.name = v.into();
24115            self
24116        }
24117
24118        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
24119        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
24120            self.0.request.filter = v.into();
24121            self
24122        }
24123
24124        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
24125        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
24126            self.0.request.page_size = v.into();
24127            self
24128        }
24129
24130        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
24131        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
24132            self.0.request.page_token = v.into();
24133            self
24134        }
24135
24136        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
24137        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
24138            self.0.request.return_partial_success = v.into();
24139            self
24140        }
24141    }
24142
24143    #[doc(hidden)]
24144    impl crate::RequestBuilder for ListOperations {
24145        fn request_options(&mut self) -> &mut crate::RequestOptions {
24146            &mut self.0.options
24147        }
24148    }
24149
24150    /// The request builder for [OrganizationSecurityProfileGroupService::get_operation][crate::client::OrganizationSecurityProfileGroupService::get_operation] calls.
24151    ///
24152    /// # Example
24153    /// ```
24154    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::GetOperation;
24155    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24156    ///
24157    /// let builder = prepare_request_builder();
24158    /// let response = builder.send().await?;
24159    /// # Ok(()) }
24160    ///
24161    /// fn prepare_request_builder() -> GetOperation {
24162    ///   # panic!();
24163    ///   // ... details omitted ...
24164    /// }
24165    /// ```
24166    #[derive(Clone, Debug)]
24167    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
24168
24169    impl GetOperation {
24170        pub(crate) fn new(
24171            stub: std::sync::Arc<
24172                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24173            >,
24174        ) -> Self {
24175            Self(RequestBuilder::new(stub))
24176        }
24177
24178        /// Sets the full request, replacing any prior values.
24179        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
24180            mut self,
24181            v: V,
24182        ) -> Self {
24183            self.0.request = v.into();
24184            self
24185        }
24186
24187        /// Sets all the options, replacing any prior values.
24188        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24189            self.0.options = v.into();
24190            self
24191        }
24192
24193        /// Sends the request.
24194        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
24195            (*self.0.stub)
24196                .get_operation(self.0.request, self.0.options)
24197                .await
24198                .map(crate::Response::into_body)
24199        }
24200
24201        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
24202        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24203            self.0.request.name = v.into();
24204            self
24205        }
24206    }
24207
24208    #[doc(hidden)]
24209    impl crate::RequestBuilder for GetOperation {
24210        fn request_options(&mut self) -> &mut crate::RequestOptions {
24211            &mut self.0.options
24212        }
24213    }
24214
24215    /// The request builder for [OrganizationSecurityProfileGroupService::delete_operation][crate::client::OrganizationSecurityProfileGroupService::delete_operation] calls.
24216    ///
24217    /// # Example
24218    /// ```
24219    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::DeleteOperation;
24220    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24221    ///
24222    /// let builder = prepare_request_builder();
24223    /// let response = builder.send().await?;
24224    /// # Ok(()) }
24225    ///
24226    /// fn prepare_request_builder() -> DeleteOperation {
24227    ///   # panic!();
24228    ///   // ... details omitted ...
24229    /// }
24230    /// ```
24231    #[derive(Clone, Debug)]
24232    pub struct DeleteOperation(
24233        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
24234    );
24235
24236    impl DeleteOperation {
24237        pub(crate) fn new(
24238            stub: std::sync::Arc<
24239                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24240            >,
24241        ) -> Self {
24242            Self(RequestBuilder::new(stub))
24243        }
24244
24245        /// Sets the full request, replacing any prior values.
24246        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
24247            mut self,
24248            v: V,
24249        ) -> Self {
24250            self.0.request = v.into();
24251            self
24252        }
24253
24254        /// Sets all the options, replacing any prior values.
24255        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24256            self.0.options = v.into();
24257            self
24258        }
24259
24260        /// Sends the request.
24261        pub async fn send(self) -> Result<()> {
24262            (*self.0.stub)
24263                .delete_operation(self.0.request, self.0.options)
24264                .await
24265                .map(crate::Response::into_body)
24266        }
24267
24268        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
24269        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24270            self.0.request.name = v.into();
24271            self
24272        }
24273    }
24274
24275    #[doc(hidden)]
24276    impl crate::RequestBuilder for DeleteOperation {
24277        fn request_options(&mut self) -> &mut crate::RequestOptions {
24278            &mut self.0.options
24279        }
24280    }
24281
24282    /// The request builder for [OrganizationSecurityProfileGroupService::cancel_operation][crate::client::OrganizationSecurityProfileGroupService::cancel_operation] calls.
24283    ///
24284    /// # Example
24285    /// ```
24286    /// # use google_cloud_networksecurity_v1::builder::organization_security_profile_group_service::CancelOperation;
24287    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24288    ///
24289    /// let builder = prepare_request_builder();
24290    /// let response = builder.send().await?;
24291    /// # Ok(()) }
24292    ///
24293    /// fn prepare_request_builder() -> CancelOperation {
24294    ///   # panic!();
24295    ///   // ... details omitted ...
24296    /// }
24297    /// ```
24298    #[derive(Clone, Debug)]
24299    pub struct CancelOperation(
24300        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
24301    );
24302
24303    impl CancelOperation {
24304        pub(crate) fn new(
24305            stub: std::sync::Arc<
24306                dyn super::super::stub::dynamic::OrganizationSecurityProfileGroupService,
24307            >,
24308        ) -> Self {
24309            Self(RequestBuilder::new(stub))
24310        }
24311
24312        /// Sets the full request, replacing any prior values.
24313        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
24314            mut self,
24315            v: V,
24316        ) -> Self {
24317            self.0.request = v.into();
24318            self
24319        }
24320
24321        /// Sets all the options, replacing any prior values.
24322        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24323            self.0.options = v.into();
24324            self
24325        }
24326
24327        /// Sends the request.
24328        pub async fn send(self) -> Result<()> {
24329            (*self.0.stub)
24330                .cancel_operation(self.0.request, self.0.options)
24331                .await
24332                .map(crate::Response::into_body)
24333        }
24334
24335        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
24336        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24337            self.0.request.name = v.into();
24338            self
24339        }
24340    }
24341
24342    #[doc(hidden)]
24343    impl crate::RequestBuilder for CancelOperation {
24344        fn request_options(&mut self) -> &mut crate::RequestOptions {
24345            &mut self.0.options
24346        }
24347    }
24348}
24349
24350/// Request and client builders for [SSERealmService][crate::client::SSERealmService].
24351pub mod sse_realm_service {
24352    use crate::Result;
24353
24354    /// A builder for [SSERealmService][crate::client::SSERealmService].
24355    ///
24356    /// ```
24357    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
24358    /// # use google_cloud_networksecurity_v1::*;
24359    /// # use builder::sse_realm_service::ClientBuilder;
24360    /// # use client::SSERealmService;
24361    /// let builder : ClientBuilder = SSERealmService::builder();
24362    /// let client = builder
24363    ///     .with_endpoint("https://networksecurity.googleapis.com")
24364    ///     .build().await?;
24365    /// # Ok(()) }
24366    /// ```
24367    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
24368
24369    pub(crate) mod client {
24370        use super::super::super::client::SSERealmService;
24371        pub struct Factory;
24372        impl crate::ClientFactory for Factory {
24373            type Client = SSERealmService;
24374            type Credentials = gaxi::options::Credentials;
24375            async fn build(
24376                self,
24377                config: gaxi::options::ClientConfig,
24378            ) -> crate::ClientBuilderResult<Self::Client> {
24379                Self::Client::new(config).await
24380            }
24381        }
24382    }
24383
24384    /// Common implementation for [crate::client::SSERealmService] request builders.
24385    #[derive(Clone, Debug)]
24386    pub(crate) struct RequestBuilder<R: std::default::Default> {
24387        stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24388        request: R,
24389        options: crate::RequestOptions,
24390    }
24391
24392    impl<R> RequestBuilder<R>
24393    where
24394        R: std::default::Default,
24395    {
24396        pub(crate) fn new(
24397            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24398        ) -> Self {
24399            Self {
24400                stub,
24401                request: R::default(),
24402                options: crate::RequestOptions::default(),
24403            }
24404        }
24405    }
24406
24407    /// The request builder for [SSERealmService::list_sac_realms][crate::client::SSERealmService::list_sac_realms] calls.
24408    ///
24409    /// # Example
24410    /// ```
24411    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::ListSACRealms;
24412    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24413    /// use google_cloud_gax::paginator::ItemPaginator;
24414    ///
24415    /// let builder = prepare_request_builder();
24416    /// let mut items = builder.by_item();
24417    /// while let Some(result) = items.next().await {
24418    ///   let item = result?;
24419    /// }
24420    /// # Ok(()) }
24421    ///
24422    /// fn prepare_request_builder() -> ListSACRealms {
24423    ///   # panic!();
24424    ///   // ... details omitted ...
24425    /// }
24426    /// ```
24427    #[derive(Clone, Debug)]
24428    pub struct ListSACRealms(RequestBuilder<crate::model::ListSACRealmsRequest>);
24429
24430    impl ListSACRealms {
24431        pub(crate) fn new(
24432            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24433        ) -> Self {
24434            Self(RequestBuilder::new(stub))
24435        }
24436
24437        /// Sets the full request, replacing any prior values.
24438        pub fn with_request<V: Into<crate::model::ListSACRealmsRequest>>(mut self, v: V) -> Self {
24439            self.0.request = v.into();
24440            self
24441        }
24442
24443        /// Sets all the options, replacing any prior values.
24444        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24445            self.0.options = v.into();
24446            self
24447        }
24448
24449        /// Sends the request.
24450        pub async fn send(self) -> Result<crate::model::ListSACRealmsResponse> {
24451            (*self.0.stub)
24452                .list_sac_realms(self.0.request, self.0.options)
24453                .await
24454                .map(crate::Response::into_body)
24455        }
24456
24457        /// Streams each page in the collection.
24458        pub fn by_page(
24459            self,
24460        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSACRealmsResponse, crate::Error>
24461        {
24462            use std::clone::Clone;
24463            let token = self.0.request.page_token.clone();
24464            let execute = move |token: String| {
24465                let mut builder = self.clone();
24466                builder.0.request = builder.0.request.set_page_token(token);
24467                builder.send()
24468            };
24469            google_cloud_gax::paginator::internal::new_paginator(token, execute)
24470        }
24471
24472        /// Streams each item in the collection.
24473        pub fn by_item(
24474            self,
24475        ) -> impl google_cloud_gax::paginator::ItemPaginator<
24476            crate::model::ListSACRealmsResponse,
24477            crate::Error,
24478        > {
24479            use google_cloud_gax::paginator::Paginator;
24480            self.by_page().items()
24481        }
24482
24483        /// Sets the value of [parent][crate::model::ListSACRealmsRequest::parent].
24484        ///
24485        /// This is a **required** field for requests.
24486        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
24487            self.0.request.parent = v.into();
24488            self
24489        }
24490
24491        /// Sets the value of [page_size][crate::model::ListSACRealmsRequest::page_size].
24492        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
24493            self.0.request.page_size = v.into();
24494            self
24495        }
24496
24497        /// Sets the value of [page_token][crate::model::ListSACRealmsRequest::page_token].
24498        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
24499            self.0.request.page_token = v.into();
24500            self
24501        }
24502
24503        /// Sets the value of [filter][crate::model::ListSACRealmsRequest::filter].
24504        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
24505            self.0.request.filter = v.into();
24506            self
24507        }
24508
24509        /// Sets the value of [order_by][crate::model::ListSACRealmsRequest::order_by].
24510        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
24511            self.0.request.order_by = v.into();
24512            self
24513        }
24514    }
24515
24516    #[doc(hidden)]
24517    impl crate::RequestBuilder for ListSACRealms {
24518        fn request_options(&mut self) -> &mut crate::RequestOptions {
24519            &mut self.0.options
24520        }
24521    }
24522
24523    /// The request builder for [SSERealmService::get_sac_realm][crate::client::SSERealmService::get_sac_realm] calls.
24524    ///
24525    /// # Example
24526    /// ```
24527    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::GetSACRealm;
24528    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24529    ///
24530    /// let builder = prepare_request_builder();
24531    /// let response = builder.send().await?;
24532    /// # Ok(()) }
24533    ///
24534    /// fn prepare_request_builder() -> GetSACRealm {
24535    ///   # panic!();
24536    ///   // ... details omitted ...
24537    /// }
24538    /// ```
24539    #[derive(Clone, Debug)]
24540    pub struct GetSACRealm(RequestBuilder<crate::model::GetSACRealmRequest>);
24541
24542    impl GetSACRealm {
24543        pub(crate) fn new(
24544            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24545        ) -> Self {
24546            Self(RequestBuilder::new(stub))
24547        }
24548
24549        /// Sets the full request, replacing any prior values.
24550        pub fn with_request<V: Into<crate::model::GetSACRealmRequest>>(mut self, v: V) -> Self {
24551            self.0.request = v.into();
24552            self
24553        }
24554
24555        /// Sets all the options, replacing any prior values.
24556        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24557            self.0.options = v.into();
24558            self
24559        }
24560
24561        /// Sends the request.
24562        pub async fn send(self) -> Result<crate::model::SACRealm> {
24563            (*self.0.stub)
24564                .get_sac_realm(self.0.request, self.0.options)
24565                .await
24566                .map(crate::Response::into_body)
24567        }
24568
24569        /// Sets the value of [name][crate::model::GetSACRealmRequest::name].
24570        ///
24571        /// This is a **required** field for requests.
24572        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24573            self.0.request.name = v.into();
24574            self
24575        }
24576    }
24577
24578    #[doc(hidden)]
24579    impl crate::RequestBuilder for GetSACRealm {
24580        fn request_options(&mut self) -> &mut crate::RequestOptions {
24581            &mut self.0.options
24582        }
24583    }
24584
24585    /// The request builder for [SSERealmService::create_sac_realm][crate::client::SSERealmService::create_sac_realm] calls.
24586    ///
24587    /// # Example
24588    /// ```
24589    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::CreateSACRealm;
24590    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24591    /// use google_cloud_lro::Poller;
24592    ///
24593    /// let builder = prepare_request_builder();
24594    /// let response = builder.poller().until_done().await?;
24595    /// # Ok(()) }
24596    ///
24597    /// fn prepare_request_builder() -> CreateSACRealm {
24598    ///   # panic!();
24599    ///   // ... details omitted ...
24600    /// }
24601    /// ```
24602    #[derive(Clone, Debug)]
24603    pub struct CreateSACRealm(RequestBuilder<crate::model::CreateSACRealmRequest>);
24604
24605    impl CreateSACRealm {
24606        pub(crate) fn new(
24607            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24608        ) -> Self {
24609            Self(RequestBuilder::new(stub))
24610        }
24611
24612        /// Sets the full request, replacing any prior values.
24613        pub fn with_request<V: Into<crate::model::CreateSACRealmRequest>>(mut self, v: V) -> Self {
24614            self.0.request = v.into();
24615            self
24616        }
24617
24618        /// Sets all the options, replacing any prior values.
24619        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24620            self.0.options = v.into();
24621            self
24622        }
24623
24624        /// Sends the request.
24625        ///
24626        /// # Long running operations
24627        ///
24628        /// This starts, but does not poll, a longrunning operation. More information
24629        /// on [create_sac_realm][crate::client::SSERealmService::create_sac_realm].
24630        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
24631            (*self.0.stub)
24632                .create_sac_realm(self.0.request, self.0.options)
24633                .await
24634                .map(crate::Response::into_body)
24635        }
24636
24637        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_sac_realm`.
24638        pub fn poller(
24639            self,
24640        ) -> impl google_cloud_lro::Poller<crate::model::SACRealm, crate::model::OperationMetadata>
24641        {
24642            type Operation = google_cloud_lro::internal::Operation<
24643                crate::model::SACRealm,
24644                crate::model::OperationMetadata,
24645            >;
24646            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
24647            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
24648
24649            let stub = self.0.stub.clone();
24650            let mut options = self.0.options.clone();
24651            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
24652            let query = move |name| {
24653                let stub = stub.clone();
24654                let options = options.clone();
24655                async {
24656                    let op = GetOperation::new(stub)
24657                        .set_name(name)
24658                        .with_options(options)
24659                        .send()
24660                        .await?;
24661                    Ok(Operation::new(op))
24662                }
24663            };
24664
24665            let start = move || async {
24666                let op = self.send().await?;
24667                Ok(Operation::new(op))
24668            };
24669
24670            google_cloud_lro::internal::new_poller(
24671                polling_error_policy,
24672                polling_backoff_policy,
24673                start,
24674                query,
24675            )
24676        }
24677
24678        /// Sets the value of [parent][crate::model::CreateSACRealmRequest::parent].
24679        ///
24680        /// This is a **required** field for requests.
24681        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
24682            self.0.request.parent = v.into();
24683            self
24684        }
24685
24686        /// Sets the value of [sac_realm_id][crate::model::CreateSACRealmRequest::sac_realm_id].
24687        ///
24688        /// This is a **required** field for requests.
24689        pub fn set_sac_realm_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
24690            self.0.request.sac_realm_id = v.into();
24691            self
24692        }
24693
24694        /// Sets the value of [sac_realm][crate::model::CreateSACRealmRequest::sac_realm].
24695        ///
24696        /// This is a **required** field for requests.
24697        pub fn set_sac_realm<T>(mut self, v: T) -> Self
24698        where
24699            T: std::convert::Into<crate::model::SACRealm>,
24700        {
24701            self.0.request.sac_realm = std::option::Option::Some(v.into());
24702            self
24703        }
24704
24705        /// Sets or clears the value of [sac_realm][crate::model::CreateSACRealmRequest::sac_realm].
24706        ///
24707        /// This is a **required** field for requests.
24708        pub fn set_or_clear_sac_realm<T>(mut self, v: std::option::Option<T>) -> Self
24709        where
24710            T: std::convert::Into<crate::model::SACRealm>,
24711        {
24712            self.0.request.sac_realm = v.map(|x| x.into());
24713            self
24714        }
24715
24716        /// Sets the value of [request_id][crate::model::CreateSACRealmRequest::request_id].
24717        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
24718            self.0.request.request_id = v.into();
24719            self
24720        }
24721    }
24722
24723    #[doc(hidden)]
24724    impl crate::RequestBuilder for CreateSACRealm {
24725        fn request_options(&mut self) -> &mut crate::RequestOptions {
24726            &mut self.0.options
24727        }
24728    }
24729
24730    /// The request builder for [SSERealmService::delete_sac_realm][crate::client::SSERealmService::delete_sac_realm] calls.
24731    ///
24732    /// # Example
24733    /// ```
24734    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::DeleteSACRealm;
24735    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24736    /// use google_cloud_lro::Poller;
24737    ///
24738    /// let builder = prepare_request_builder();
24739    /// let response = builder.poller().until_done().await?;
24740    /// # Ok(()) }
24741    ///
24742    /// fn prepare_request_builder() -> DeleteSACRealm {
24743    ///   # panic!();
24744    ///   // ... details omitted ...
24745    /// }
24746    /// ```
24747    #[derive(Clone, Debug)]
24748    pub struct DeleteSACRealm(RequestBuilder<crate::model::DeleteSACRealmRequest>);
24749
24750    impl DeleteSACRealm {
24751        pub(crate) fn new(
24752            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24753        ) -> Self {
24754            Self(RequestBuilder::new(stub))
24755        }
24756
24757        /// Sets the full request, replacing any prior values.
24758        pub fn with_request<V: Into<crate::model::DeleteSACRealmRequest>>(mut self, v: V) -> Self {
24759            self.0.request = v.into();
24760            self
24761        }
24762
24763        /// Sets all the options, replacing any prior values.
24764        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24765            self.0.options = v.into();
24766            self
24767        }
24768
24769        /// Sends the request.
24770        ///
24771        /// # Long running operations
24772        ///
24773        /// This starts, but does not poll, a longrunning operation. More information
24774        /// on [delete_sac_realm][crate::client::SSERealmService::delete_sac_realm].
24775        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
24776            (*self.0.stub)
24777                .delete_sac_realm(self.0.request, self.0.options)
24778                .await
24779                .map(crate::Response::into_body)
24780        }
24781
24782        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_sac_realm`.
24783        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
24784            type Operation =
24785                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
24786            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
24787            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
24788
24789            let stub = self.0.stub.clone();
24790            let mut options = self.0.options.clone();
24791            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
24792            let query = move |name| {
24793                let stub = stub.clone();
24794                let options = options.clone();
24795                async {
24796                    let op = GetOperation::new(stub)
24797                        .set_name(name)
24798                        .with_options(options)
24799                        .send()
24800                        .await?;
24801                    Ok(Operation::new(op))
24802                }
24803            };
24804
24805            let start = move || async {
24806                let op = self.send().await?;
24807                Ok(Operation::new(op))
24808            };
24809
24810            google_cloud_lro::internal::new_unit_response_poller(
24811                polling_error_policy,
24812                polling_backoff_policy,
24813                start,
24814                query,
24815            )
24816        }
24817
24818        /// Sets the value of [name][crate::model::DeleteSACRealmRequest::name].
24819        ///
24820        /// This is a **required** field for requests.
24821        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
24822            self.0.request.name = v.into();
24823            self
24824        }
24825
24826        /// Sets the value of [request_id][crate::model::DeleteSACRealmRequest::request_id].
24827        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
24828            self.0.request.request_id = v.into();
24829            self
24830        }
24831    }
24832
24833    #[doc(hidden)]
24834    impl crate::RequestBuilder for DeleteSACRealm {
24835        fn request_options(&mut self) -> &mut crate::RequestOptions {
24836            &mut self.0.options
24837        }
24838    }
24839
24840    /// The request builder for [SSERealmService::list_sac_attachments][crate::client::SSERealmService::list_sac_attachments] calls.
24841    ///
24842    /// # Example
24843    /// ```
24844    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::ListSACAttachments;
24845    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24846    /// use google_cloud_gax::paginator::ItemPaginator;
24847    ///
24848    /// let builder = prepare_request_builder();
24849    /// let mut items = builder.by_item();
24850    /// while let Some(result) = items.next().await {
24851    ///   let item = result?;
24852    /// }
24853    /// # Ok(()) }
24854    ///
24855    /// fn prepare_request_builder() -> ListSACAttachments {
24856    ///   # panic!();
24857    ///   // ... details omitted ...
24858    /// }
24859    /// ```
24860    #[derive(Clone, Debug)]
24861    pub struct ListSACAttachments(RequestBuilder<crate::model::ListSACAttachmentsRequest>);
24862
24863    impl ListSACAttachments {
24864        pub(crate) fn new(
24865            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24866        ) -> Self {
24867            Self(RequestBuilder::new(stub))
24868        }
24869
24870        /// Sets the full request, replacing any prior values.
24871        pub fn with_request<V: Into<crate::model::ListSACAttachmentsRequest>>(
24872            mut self,
24873            v: V,
24874        ) -> Self {
24875            self.0.request = v.into();
24876            self
24877        }
24878
24879        /// Sets all the options, replacing any prior values.
24880        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24881            self.0.options = v.into();
24882            self
24883        }
24884
24885        /// Sends the request.
24886        pub async fn send(self) -> Result<crate::model::ListSACAttachmentsResponse> {
24887            (*self.0.stub)
24888                .list_sac_attachments(self.0.request, self.0.options)
24889                .await
24890                .map(crate::Response::into_body)
24891        }
24892
24893        /// Streams each page in the collection.
24894        pub fn by_page(
24895            self,
24896        ) -> impl google_cloud_gax::paginator::Paginator<
24897            crate::model::ListSACAttachmentsResponse,
24898            crate::Error,
24899        > {
24900            use std::clone::Clone;
24901            let token = self.0.request.page_token.clone();
24902            let execute = move |token: String| {
24903                let mut builder = self.clone();
24904                builder.0.request = builder.0.request.set_page_token(token);
24905                builder.send()
24906            };
24907            google_cloud_gax::paginator::internal::new_paginator(token, execute)
24908        }
24909
24910        /// Streams each item in the collection.
24911        pub fn by_item(
24912            self,
24913        ) -> impl google_cloud_gax::paginator::ItemPaginator<
24914            crate::model::ListSACAttachmentsResponse,
24915            crate::Error,
24916        > {
24917            use google_cloud_gax::paginator::Paginator;
24918            self.by_page().items()
24919        }
24920
24921        /// Sets the value of [parent][crate::model::ListSACAttachmentsRequest::parent].
24922        ///
24923        /// This is a **required** field for requests.
24924        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
24925            self.0.request.parent = v.into();
24926            self
24927        }
24928
24929        /// Sets the value of [page_size][crate::model::ListSACAttachmentsRequest::page_size].
24930        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
24931            self.0.request.page_size = v.into();
24932            self
24933        }
24934
24935        /// Sets the value of [page_token][crate::model::ListSACAttachmentsRequest::page_token].
24936        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
24937            self.0.request.page_token = v.into();
24938            self
24939        }
24940
24941        /// Sets the value of [filter][crate::model::ListSACAttachmentsRequest::filter].
24942        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
24943            self.0.request.filter = v.into();
24944            self
24945        }
24946
24947        /// Sets the value of [order_by][crate::model::ListSACAttachmentsRequest::order_by].
24948        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
24949            self.0.request.order_by = v.into();
24950            self
24951        }
24952    }
24953
24954    #[doc(hidden)]
24955    impl crate::RequestBuilder for ListSACAttachments {
24956        fn request_options(&mut self) -> &mut crate::RequestOptions {
24957            &mut self.0.options
24958        }
24959    }
24960
24961    /// The request builder for [SSERealmService::get_sac_attachment][crate::client::SSERealmService::get_sac_attachment] calls.
24962    ///
24963    /// # Example
24964    /// ```
24965    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::GetSACAttachment;
24966    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
24967    ///
24968    /// let builder = prepare_request_builder();
24969    /// let response = builder.send().await?;
24970    /// # Ok(()) }
24971    ///
24972    /// fn prepare_request_builder() -> GetSACAttachment {
24973    ///   # panic!();
24974    ///   // ... details omitted ...
24975    /// }
24976    /// ```
24977    #[derive(Clone, Debug)]
24978    pub struct GetSACAttachment(RequestBuilder<crate::model::GetSACAttachmentRequest>);
24979
24980    impl GetSACAttachment {
24981        pub(crate) fn new(
24982            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
24983        ) -> Self {
24984            Self(RequestBuilder::new(stub))
24985        }
24986
24987        /// Sets the full request, replacing any prior values.
24988        pub fn with_request<V: Into<crate::model::GetSACAttachmentRequest>>(
24989            mut self,
24990            v: V,
24991        ) -> Self {
24992            self.0.request = v.into();
24993            self
24994        }
24995
24996        /// Sets all the options, replacing any prior values.
24997        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
24998            self.0.options = v.into();
24999            self
25000        }
25001
25002        /// Sends the request.
25003        pub async fn send(self) -> Result<crate::model::SACAttachment> {
25004            (*self.0.stub)
25005                .get_sac_attachment(self.0.request, self.0.options)
25006                .await
25007                .map(crate::Response::into_body)
25008        }
25009
25010        /// Sets the value of [name][crate::model::GetSACAttachmentRequest::name].
25011        ///
25012        /// This is a **required** field for requests.
25013        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25014            self.0.request.name = v.into();
25015            self
25016        }
25017    }
25018
25019    #[doc(hidden)]
25020    impl crate::RequestBuilder for GetSACAttachment {
25021        fn request_options(&mut self) -> &mut crate::RequestOptions {
25022            &mut self.0.options
25023        }
25024    }
25025
25026    /// The request builder for [SSERealmService::create_sac_attachment][crate::client::SSERealmService::create_sac_attachment] calls.
25027    ///
25028    /// # Example
25029    /// ```
25030    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::CreateSACAttachment;
25031    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25032    /// use google_cloud_lro::Poller;
25033    ///
25034    /// let builder = prepare_request_builder();
25035    /// let response = builder.poller().until_done().await?;
25036    /// # Ok(()) }
25037    ///
25038    /// fn prepare_request_builder() -> CreateSACAttachment {
25039    ///   # panic!();
25040    ///   // ... details omitted ...
25041    /// }
25042    /// ```
25043    #[derive(Clone, Debug)]
25044    pub struct CreateSACAttachment(RequestBuilder<crate::model::CreateSACAttachmentRequest>);
25045
25046    impl CreateSACAttachment {
25047        pub(crate) fn new(
25048            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25049        ) -> Self {
25050            Self(RequestBuilder::new(stub))
25051        }
25052
25053        /// Sets the full request, replacing any prior values.
25054        pub fn with_request<V: Into<crate::model::CreateSACAttachmentRequest>>(
25055            mut self,
25056            v: V,
25057        ) -> Self {
25058            self.0.request = v.into();
25059            self
25060        }
25061
25062        /// Sets all the options, replacing any prior values.
25063        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25064            self.0.options = v.into();
25065            self
25066        }
25067
25068        /// Sends the request.
25069        ///
25070        /// # Long running operations
25071        ///
25072        /// This starts, but does not poll, a longrunning operation. More information
25073        /// on [create_sac_attachment][crate::client::SSERealmService::create_sac_attachment].
25074        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
25075            (*self.0.stub)
25076                .create_sac_attachment(self.0.request, self.0.options)
25077                .await
25078                .map(crate::Response::into_body)
25079        }
25080
25081        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_sac_attachment`.
25082        pub fn poller(
25083            self,
25084        ) -> impl google_cloud_lro::Poller<crate::model::SACAttachment, crate::model::OperationMetadata>
25085        {
25086            type Operation = google_cloud_lro::internal::Operation<
25087                crate::model::SACAttachment,
25088                crate::model::OperationMetadata,
25089            >;
25090            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
25091            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
25092
25093            let stub = self.0.stub.clone();
25094            let mut options = self.0.options.clone();
25095            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
25096            let query = move |name| {
25097                let stub = stub.clone();
25098                let options = options.clone();
25099                async {
25100                    let op = GetOperation::new(stub)
25101                        .set_name(name)
25102                        .with_options(options)
25103                        .send()
25104                        .await?;
25105                    Ok(Operation::new(op))
25106                }
25107            };
25108
25109            let start = move || async {
25110                let op = self.send().await?;
25111                Ok(Operation::new(op))
25112            };
25113
25114            google_cloud_lro::internal::new_poller(
25115                polling_error_policy,
25116                polling_backoff_policy,
25117                start,
25118                query,
25119            )
25120        }
25121
25122        /// Sets the value of [parent][crate::model::CreateSACAttachmentRequest::parent].
25123        ///
25124        /// This is a **required** field for requests.
25125        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
25126            self.0.request.parent = v.into();
25127            self
25128        }
25129
25130        /// Sets the value of [sac_attachment_id][crate::model::CreateSACAttachmentRequest::sac_attachment_id].
25131        ///
25132        /// This is a **required** field for requests.
25133        pub fn set_sac_attachment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25134            self.0.request.sac_attachment_id = v.into();
25135            self
25136        }
25137
25138        /// Sets the value of [sac_attachment][crate::model::CreateSACAttachmentRequest::sac_attachment].
25139        ///
25140        /// This is a **required** field for requests.
25141        pub fn set_sac_attachment<T>(mut self, v: T) -> Self
25142        where
25143            T: std::convert::Into<crate::model::SACAttachment>,
25144        {
25145            self.0.request.sac_attachment = std::option::Option::Some(v.into());
25146            self
25147        }
25148
25149        /// Sets or clears the value of [sac_attachment][crate::model::CreateSACAttachmentRequest::sac_attachment].
25150        ///
25151        /// This is a **required** field for requests.
25152        pub fn set_or_clear_sac_attachment<T>(mut self, v: std::option::Option<T>) -> Self
25153        where
25154            T: std::convert::Into<crate::model::SACAttachment>,
25155        {
25156            self.0.request.sac_attachment = v.map(|x| x.into());
25157            self
25158        }
25159
25160        /// Sets the value of [request_id][crate::model::CreateSACAttachmentRequest::request_id].
25161        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25162            self.0.request.request_id = v.into();
25163            self
25164        }
25165    }
25166
25167    #[doc(hidden)]
25168    impl crate::RequestBuilder for CreateSACAttachment {
25169        fn request_options(&mut self) -> &mut crate::RequestOptions {
25170            &mut self.0.options
25171        }
25172    }
25173
25174    /// The request builder for [SSERealmService::delete_sac_attachment][crate::client::SSERealmService::delete_sac_attachment] calls.
25175    ///
25176    /// # Example
25177    /// ```
25178    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::DeleteSACAttachment;
25179    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25180    /// use google_cloud_lro::Poller;
25181    ///
25182    /// let builder = prepare_request_builder();
25183    /// let response = builder.poller().until_done().await?;
25184    /// # Ok(()) }
25185    ///
25186    /// fn prepare_request_builder() -> DeleteSACAttachment {
25187    ///   # panic!();
25188    ///   // ... details omitted ...
25189    /// }
25190    /// ```
25191    #[derive(Clone, Debug)]
25192    pub struct DeleteSACAttachment(RequestBuilder<crate::model::DeleteSACAttachmentRequest>);
25193
25194    impl DeleteSACAttachment {
25195        pub(crate) fn new(
25196            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25197        ) -> Self {
25198            Self(RequestBuilder::new(stub))
25199        }
25200
25201        /// Sets the full request, replacing any prior values.
25202        pub fn with_request<V: Into<crate::model::DeleteSACAttachmentRequest>>(
25203            mut self,
25204            v: V,
25205        ) -> Self {
25206            self.0.request = v.into();
25207            self
25208        }
25209
25210        /// Sets all the options, replacing any prior values.
25211        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25212            self.0.options = v.into();
25213            self
25214        }
25215
25216        /// Sends the request.
25217        ///
25218        /// # Long running operations
25219        ///
25220        /// This starts, but does not poll, a longrunning operation. More information
25221        /// on [delete_sac_attachment][crate::client::SSERealmService::delete_sac_attachment].
25222        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
25223            (*self.0.stub)
25224                .delete_sac_attachment(self.0.request, self.0.options)
25225                .await
25226                .map(crate::Response::into_body)
25227        }
25228
25229        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_sac_attachment`.
25230        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
25231            type Operation =
25232                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
25233            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
25234            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
25235
25236            let stub = self.0.stub.clone();
25237            let mut options = self.0.options.clone();
25238            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
25239            let query = move |name| {
25240                let stub = stub.clone();
25241                let options = options.clone();
25242                async {
25243                    let op = GetOperation::new(stub)
25244                        .set_name(name)
25245                        .with_options(options)
25246                        .send()
25247                        .await?;
25248                    Ok(Operation::new(op))
25249                }
25250            };
25251
25252            let start = move || async {
25253                let op = self.send().await?;
25254                Ok(Operation::new(op))
25255            };
25256
25257            google_cloud_lro::internal::new_unit_response_poller(
25258                polling_error_policy,
25259                polling_backoff_policy,
25260                start,
25261                query,
25262            )
25263        }
25264
25265        /// Sets the value of [name][crate::model::DeleteSACAttachmentRequest::name].
25266        ///
25267        /// This is a **required** field for requests.
25268        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25269            self.0.request.name = v.into();
25270            self
25271        }
25272
25273        /// Sets the value of [request_id][crate::model::DeleteSACAttachmentRequest::request_id].
25274        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
25275            self.0.request.request_id = v.into();
25276            self
25277        }
25278    }
25279
25280    #[doc(hidden)]
25281    impl crate::RequestBuilder for DeleteSACAttachment {
25282        fn request_options(&mut self) -> &mut crate::RequestOptions {
25283            &mut self.0.options
25284        }
25285    }
25286
25287    /// The request builder for [SSERealmService::list_locations][crate::client::SSERealmService::list_locations] calls.
25288    ///
25289    /// # Example
25290    /// ```
25291    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::ListLocations;
25292    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25293    /// use google_cloud_gax::paginator::ItemPaginator;
25294    ///
25295    /// let builder = prepare_request_builder();
25296    /// let mut items = builder.by_item();
25297    /// while let Some(result) = items.next().await {
25298    ///   let item = result?;
25299    /// }
25300    /// # Ok(()) }
25301    ///
25302    /// fn prepare_request_builder() -> ListLocations {
25303    ///   # panic!();
25304    ///   // ... details omitted ...
25305    /// }
25306    /// ```
25307    #[derive(Clone, Debug)]
25308    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
25309
25310    impl ListLocations {
25311        pub(crate) fn new(
25312            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25313        ) -> Self {
25314            Self(RequestBuilder::new(stub))
25315        }
25316
25317        /// Sets the full request, replacing any prior values.
25318        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
25319            mut self,
25320            v: V,
25321        ) -> Self {
25322            self.0.request = v.into();
25323            self
25324        }
25325
25326        /// Sets all the options, replacing any prior values.
25327        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25328            self.0.options = v.into();
25329            self
25330        }
25331
25332        /// Sends the request.
25333        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
25334            (*self.0.stub)
25335                .list_locations(self.0.request, self.0.options)
25336                .await
25337                .map(crate::Response::into_body)
25338        }
25339
25340        /// Streams each page in the collection.
25341        pub fn by_page(
25342            self,
25343        ) -> impl google_cloud_gax::paginator::Paginator<
25344            google_cloud_location::model::ListLocationsResponse,
25345            crate::Error,
25346        > {
25347            use std::clone::Clone;
25348            let token = self.0.request.page_token.clone();
25349            let execute = move |token: String| {
25350                let mut builder = self.clone();
25351                builder.0.request = builder.0.request.set_page_token(token);
25352                builder.send()
25353            };
25354            google_cloud_gax::paginator::internal::new_paginator(token, execute)
25355        }
25356
25357        /// Streams each item in the collection.
25358        pub fn by_item(
25359            self,
25360        ) -> impl google_cloud_gax::paginator::ItemPaginator<
25361            google_cloud_location::model::ListLocationsResponse,
25362            crate::Error,
25363        > {
25364            use google_cloud_gax::paginator::Paginator;
25365            self.by_page().items()
25366        }
25367
25368        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
25369        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25370            self.0.request.name = v.into();
25371            self
25372        }
25373
25374        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
25375        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
25376            self.0.request.filter = v.into();
25377            self
25378        }
25379
25380        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
25381        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
25382            self.0.request.page_size = v.into();
25383            self
25384        }
25385
25386        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
25387        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
25388            self.0.request.page_token = v.into();
25389            self
25390        }
25391    }
25392
25393    #[doc(hidden)]
25394    impl crate::RequestBuilder for ListLocations {
25395        fn request_options(&mut self) -> &mut crate::RequestOptions {
25396            &mut self.0.options
25397        }
25398    }
25399
25400    /// The request builder for [SSERealmService::get_location][crate::client::SSERealmService::get_location] calls.
25401    ///
25402    /// # Example
25403    /// ```
25404    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::GetLocation;
25405    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25406    ///
25407    /// let builder = prepare_request_builder();
25408    /// let response = builder.send().await?;
25409    /// # Ok(()) }
25410    ///
25411    /// fn prepare_request_builder() -> GetLocation {
25412    ///   # panic!();
25413    ///   // ... details omitted ...
25414    /// }
25415    /// ```
25416    #[derive(Clone, Debug)]
25417    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
25418
25419    impl GetLocation {
25420        pub(crate) fn new(
25421            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25422        ) -> Self {
25423            Self(RequestBuilder::new(stub))
25424        }
25425
25426        /// Sets the full request, replacing any prior values.
25427        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
25428            mut self,
25429            v: V,
25430        ) -> Self {
25431            self.0.request = v.into();
25432            self
25433        }
25434
25435        /// Sets all the options, replacing any prior values.
25436        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25437            self.0.options = v.into();
25438            self
25439        }
25440
25441        /// Sends the request.
25442        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
25443            (*self.0.stub)
25444                .get_location(self.0.request, self.0.options)
25445                .await
25446                .map(crate::Response::into_body)
25447        }
25448
25449        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
25450        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25451            self.0.request.name = v.into();
25452            self
25453        }
25454    }
25455
25456    #[doc(hidden)]
25457    impl crate::RequestBuilder for GetLocation {
25458        fn request_options(&mut self) -> &mut crate::RequestOptions {
25459            &mut self.0.options
25460        }
25461    }
25462
25463    /// The request builder for [SSERealmService::set_iam_policy][crate::client::SSERealmService::set_iam_policy] calls.
25464    ///
25465    /// # Example
25466    /// ```
25467    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::SetIamPolicy;
25468    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25469    ///
25470    /// let builder = prepare_request_builder();
25471    /// let response = builder.send().await?;
25472    /// # Ok(()) }
25473    ///
25474    /// fn prepare_request_builder() -> SetIamPolicy {
25475    ///   # panic!();
25476    ///   // ... details omitted ...
25477    /// }
25478    /// ```
25479    #[derive(Clone, Debug)]
25480    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
25481
25482    impl SetIamPolicy {
25483        pub(crate) fn new(
25484            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25485        ) -> Self {
25486            Self(RequestBuilder::new(stub))
25487        }
25488
25489        /// Sets the full request, replacing any prior values.
25490        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
25491            mut self,
25492            v: V,
25493        ) -> Self {
25494            self.0.request = v.into();
25495            self
25496        }
25497
25498        /// Sets all the options, replacing any prior values.
25499        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25500            self.0.options = v.into();
25501            self
25502        }
25503
25504        /// Sends the request.
25505        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
25506            (*self.0.stub)
25507                .set_iam_policy(self.0.request, self.0.options)
25508                .await
25509                .map(crate::Response::into_body)
25510        }
25511
25512        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
25513        ///
25514        /// This is a **required** field for requests.
25515        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
25516            self.0.request.resource = v.into();
25517            self
25518        }
25519
25520        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
25521        ///
25522        /// This is a **required** field for requests.
25523        pub fn set_policy<T>(mut self, v: T) -> Self
25524        where
25525            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
25526        {
25527            self.0.request.policy = std::option::Option::Some(v.into());
25528            self
25529        }
25530
25531        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
25532        ///
25533        /// This is a **required** field for requests.
25534        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
25535        where
25536            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
25537        {
25538            self.0.request.policy = v.map(|x| x.into());
25539            self
25540        }
25541
25542        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
25543        pub fn set_update_mask<T>(mut self, v: T) -> Self
25544        where
25545            T: std::convert::Into<wkt::FieldMask>,
25546        {
25547            self.0.request.update_mask = std::option::Option::Some(v.into());
25548            self
25549        }
25550
25551        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
25552        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
25553        where
25554            T: std::convert::Into<wkt::FieldMask>,
25555        {
25556            self.0.request.update_mask = v.map(|x| x.into());
25557            self
25558        }
25559    }
25560
25561    #[doc(hidden)]
25562    impl crate::RequestBuilder for SetIamPolicy {
25563        fn request_options(&mut self) -> &mut crate::RequestOptions {
25564            &mut self.0.options
25565        }
25566    }
25567
25568    /// The request builder for [SSERealmService::get_iam_policy][crate::client::SSERealmService::get_iam_policy] calls.
25569    ///
25570    /// # Example
25571    /// ```
25572    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::GetIamPolicy;
25573    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25574    ///
25575    /// let builder = prepare_request_builder();
25576    /// let response = builder.send().await?;
25577    /// # Ok(()) }
25578    ///
25579    /// fn prepare_request_builder() -> GetIamPolicy {
25580    ///   # panic!();
25581    ///   // ... details omitted ...
25582    /// }
25583    /// ```
25584    #[derive(Clone, Debug)]
25585    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
25586
25587    impl GetIamPolicy {
25588        pub(crate) fn new(
25589            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25590        ) -> Self {
25591            Self(RequestBuilder::new(stub))
25592        }
25593
25594        /// Sets the full request, replacing any prior values.
25595        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
25596            mut self,
25597            v: V,
25598        ) -> Self {
25599            self.0.request = v.into();
25600            self
25601        }
25602
25603        /// Sets all the options, replacing any prior values.
25604        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25605            self.0.options = v.into();
25606            self
25607        }
25608
25609        /// Sends the request.
25610        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
25611            (*self.0.stub)
25612                .get_iam_policy(self.0.request, self.0.options)
25613                .await
25614                .map(crate::Response::into_body)
25615        }
25616
25617        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
25618        ///
25619        /// This is a **required** field for requests.
25620        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
25621            self.0.request.resource = v.into();
25622            self
25623        }
25624
25625        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
25626        pub fn set_options<T>(mut self, v: T) -> Self
25627        where
25628            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
25629        {
25630            self.0.request.options = std::option::Option::Some(v.into());
25631            self
25632        }
25633
25634        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
25635        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
25636        where
25637            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
25638        {
25639            self.0.request.options = v.map(|x| x.into());
25640            self
25641        }
25642    }
25643
25644    #[doc(hidden)]
25645    impl crate::RequestBuilder for GetIamPolicy {
25646        fn request_options(&mut self) -> &mut crate::RequestOptions {
25647            &mut self.0.options
25648        }
25649    }
25650
25651    /// The request builder for [SSERealmService::test_iam_permissions][crate::client::SSERealmService::test_iam_permissions] calls.
25652    ///
25653    /// # Example
25654    /// ```
25655    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::TestIamPermissions;
25656    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25657    ///
25658    /// let builder = prepare_request_builder();
25659    /// let response = builder.send().await?;
25660    /// # Ok(()) }
25661    ///
25662    /// fn prepare_request_builder() -> TestIamPermissions {
25663    ///   # panic!();
25664    ///   // ... details omitted ...
25665    /// }
25666    /// ```
25667    #[derive(Clone, Debug)]
25668    pub struct TestIamPermissions(
25669        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
25670    );
25671
25672    impl TestIamPermissions {
25673        pub(crate) fn new(
25674            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25675        ) -> Self {
25676            Self(RequestBuilder::new(stub))
25677        }
25678
25679        /// Sets the full request, replacing any prior values.
25680        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
25681            mut self,
25682            v: V,
25683        ) -> Self {
25684            self.0.request = v.into();
25685            self
25686        }
25687
25688        /// Sets all the options, replacing any prior values.
25689        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25690            self.0.options = v.into();
25691            self
25692        }
25693
25694        /// Sends the request.
25695        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
25696            (*self.0.stub)
25697                .test_iam_permissions(self.0.request, self.0.options)
25698                .await
25699                .map(crate::Response::into_body)
25700        }
25701
25702        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
25703        ///
25704        /// This is a **required** field for requests.
25705        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
25706            self.0.request.resource = v.into();
25707            self
25708        }
25709
25710        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
25711        ///
25712        /// This is a **required** field for requests.
25713        pub fn set_permissions<T, V>(mut self, v: T) -> Self
25714        where
25715            T: std::iter::IntoIterator<Item = V>,
25716            V: std::convert::Into<std::string::String>,
25717        {
25718            use std::iter::Iterator;
25719            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
25720            self
25721        }
25722    }
25723
25724    #[doc(hidden)]
25725    impl crate::RequestBuilder for TestIamPermissions {
25726        fn request_options(&mut self) -> &mut crate::RequestOptions {
25727            &mut self.0.options
25728        }
25729    }
25730
25731    /// The request builder for [SSERealmService::list_operations][crate::client::SSERealmService::list_operations] calls.
25732    ///
25733    /// # Example
25734    /// ```
25735    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::ListOperations;
25736    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25737    /// use google_cloud_gax::paginator::ItemPaginator;
25738    ///
25739    /// let builder = prepare_request_builder();
25740    /// let mut items = builder.by_item();
25741    /// while let Some(result) = items.next().await {
25742    ///   let item = result?;
25743    /// }
25744    /// # Ok(()) }
25745    ///
25746    /// fn prepare_request_builder() -> ListOperations {
25747    ///   # panic!();
25748    ///   // ... details omitted ...
25749    /// }
25750    /// ```
25751    #[derive(Clone, Debug)]
25752    pub struct ListOperations(
25753        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
25754    );
25755
25756    impl ListOperations {
25757        pub(crate) fn new(
25758            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25759        ) -> Self {
25760            Self(RequestBuilder::new(stub))
25761        }
25762
25763        /// Sets the full request, replacing any prior values.
25764        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
25765            mut self,
25766            v: V,
25767        ) -> Self {
25768            self.0.request = v.into();
25769            self
25770        }
25771
25772        /// Sets all the options, replacing any prior values.
25773        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25774            self.0.options = v.into();
25775            self
25776        }
25777
25778        /// Sends the request.
25779        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
25780            (*self.0.stub)
25781                .list_operations(self.0.request, self.0.options)
25782                .await
25783                .map(crate::Response::into_body)
25784        }
25785
25786        /// Streams each page in the collection.
25787        pub fn by_page(
25788            self,
25789        ) -> impl google_cloud_gax::paginator::Paginator<
25790            google_cloud_longrunning::model::ListOperationsResponse,
25791            crate::Error,
25792        > {
25793            use std::clone::Clone;
25794            let token = self.0.request.page_token.clone();
25795            let execute = move |token: String| {
25796                let mut builder = self.clone();
25797                builder.0.request = builder.0.request.set_page_token(token);
25798                builder.send()
25799            };
25800            google_cloud_gax::paginator::internal::new_paginator(token, execute)
25801        }
25802
25803        /// Streams each item in the collection.
25804        pub fn by_item(
25805            self,
25806        ) -> impl google_cloud_gax::paginator::ItemPaginator<
25807            google_cloud_longrunning::model::ListOperationsResponse,
25808            crate::Error,
25809        > {
25810            use google_cloud_gax::paginator::Paginator;
25811            self.by_page().items()
25812        }
25813
25814        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
25815        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25816            self.0.request.name = v.into();
25817            self
25818        }
25819
25820        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
25821        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
25822            self.0.request.filter = v.into();
25823            self
25824        }
25825
25826        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
25827        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
25828            self.0.request.page_size = v.into();
25829            self
25830        }
25831
25832        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
25833        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
25834            self.0.request.page_token = v.into();
25835            self
25836        }
25837
25838        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
25839        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
25840            self.0.request.return_partial_success = v.into();
25841            self
25842        }
25843    }
25844
25845    #[doc(hidden)]
25846    impl crate::RequestBuilder for ListOperations {
25847        fn request_options(&mut self) -> &mut crate::RequestOptions {
25848            &mut self.0.options
25849        }
25850    }
25851
25852    /// The request builder for [SSERealmService::get_operation][crate::client::SSERealmService::get_operation] calls.
25853    ///
25854    /// # Example
25855    /// ```
25856    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::GetOperation;
25857    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25858    ///
25859    /// let builder = prepare_request_builder();
25860    /// let response = builder.send().await?;
25861    /// # Ok(()) }
25862    ///
25863    /// fn prepare_request_builder() -> GetOperation {
25864    ///   # panic!();
25865    ///   // ... details omitted ...
25866    /// }
25867    /// ```
25868    #[derive(Clone, Debug)]
25869    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
25870
25871    impl GetOperation {
25872        pub(crate) fn new(
25873            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25874        ) -> Self {
25875            Self(RequestBuilder::new(stub))
25876        }
25877
25878        /// Sets the full request, replacing any prior values.
25879        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
25880            mut self,
25881            v: V,
25882        ) -> Self {
25883            self.0.request = v.into();
25884            self
25885        }
25886
25887        /// Sets all the options, replacing any prior values.
25888        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25889            self.0.options = v.into();
25890            self
25891        }
25892
25893        /// Sends the request.
25894        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
25895            (*self.0.stub)
25896                .get_operation(self.0.request, self.0.options)
25897                .await
25898                .map(crate::Response::into_body)
25899        }
25900
25901        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
25902        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25903            self.0.request.name = v.into();
25904            self
25905        }
25906    }
25907
25908    #[doc(hidden)]
25909    impl crate::RequestBuilder for GetOperation {
25910        fn request_options(&mut self) -> &mut crate::RequestOptions {
25911            &mut self.0.options
25912        }
25913    }
25914
25915    /// The request builder for [SSERealmService::delete_operation][crate::client::SSERealmService::delete_operation] calls.
25916    ///
25917    /// # Example
25918    /// ```
25919    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::DeleteOperation;
25920    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25921    ///
25922    /// let builder = prepare_request_builder();
25923    /// let response = builder.send().await?;
25924    /// # Ok(()) }
25925    ///
25926    /// fn prepare_request_builder() -> DeleteOperation {
25927    ///   # panic!();
25928    ///   // ... details omitted ...
25929    /// }
25930    /// ```
25931    #[derive(Clone, Debug)]
25932    pub struct DeleteOperation(
25933        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
25934    );
25935
25936    impl DeleteOperation {
25937        pub(crate) fn new(
25938            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
25939        ) -> Self {
25940            Self(RequestBuilder::new(stub))
25941        }
25942
25943        /// Sets the full request, replacing any prior values.
25944        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
25945            mut self,
25946            v: V,
25947        ) -> Self {
25948            self.0.request = v.into();
25949            self
25950        }
25951
25952        /// Sets all the options, replacing any prior values.
25953        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
25954            self.0.options = v.into();
25955            self
25956        }
25957
25958        /// Sends the request.
25959        pub async fn send(self) -> Result<()> {
25960            (*self.0.stub)
25961                .delete_operation(self.0.request, self.0.options)
25962                .await
25963                .map(crate::Response::into_body)
25964        }
25965
25966        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
25967        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
25968            self.0.request.name = v.into();
25969            self
25970        }
25971    }
25972
25973    #[doc(hidden)]
25974    impl crate::RequestBuilder for DeleteOperation {
25975        fn request_options(&mut self) -> &mut crate::RequestOptions {
25976            &mut self.0.options
25977        }
25978    }
25979
25980    /// The request builder for [SSERealmService::cancel_operation][crate::client::SSERealmService::cancel_operation] calls.
25981    ///
25982    /// # Example
25983    /// ```
25984    /// # use google_cloud_networksecurity_v1::builder::sse_realm_service::CancelOperation;
25985    /// # async fn sample() -> google_cloud_networksecurity_v1::Result<()> {
25986    ///
25987    /// let builder = prepare_request_builder();
25988    /// let response = builder.send().await?;
25989    /// # Ok(()) }
25990    ///
25991    /// fn prepare_request_builder() -> CancelOperation {
25992    ///   # panic!();
25993    ///   // ... details omitted ...
25994    /// }
25995    /// ```
25996    #[derive(Clone, Debug)]
25997    pub struct CancelOperation(
25998        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
25999    );
26000
26001    impl CancelOperation {
26002        pub(crate) fn new(
26003            stub: std::sync::Arc<dyn super::super::stub::dynamic::SSERealmService>,
26004        ) -> Self {
26005            Self(RequestBuilder::new(stub))
26006        }
26007
26008        /// Sets the full request, replacing any prior values.
26009        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
26010            mut self,
26011            v: V,
26012        ) -> Self {
26013            self.0.request = v.into();
26014            self
26015        }
26016
26017        /// Sets all the options, replacing any prior values.
26018        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
26019            self.0.options = v.into();
26020            self
26021        }
26022
26023        /// Sends the request.
26024        pub async fn send(self) -> Result<()> {
26025            (*self.0.stub)
26026                .cancel_operation(self.0.request, self.0.options)
26027                .await
26028                .map(crate::Response::into_body)
26029        }
26030
26031        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
26032        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
26033            self.0.request.name = v.into();
26034            self
26035        }
26036    }
26037
26038    #[doc(hidden)]
26039    impl crate::RequestBuilder for CancelOperation {
26040        fn request_options(&mut self) -> &mut crate::RequestOptions {
26041            &mut self.0.options
26042        }
26043    }
26044}