google_cloud_networksecurity_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17pub mod address_group_service {
18    use crate::Result;
19
20    /// A builder for [AddressGroupService][crate::client::AddressGroupService].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_networksecurity_v1::*;
25    /// # use builder::address_group_service::ClientBuilder;
26    /// # use client::AddressGroupService;
27    /// let builder : ClientBuilder = AddressGroupService::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://networksecurity.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::AddressGroupService;
38        pub struct Factory;
39        impl gax::client_builder::internal::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            ) -> gax::client_builder::Result<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: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [AddressGroupService::list_address_groups][crate::client::AddressGroupService::list_address_groups] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_networksecurity_v1::builder;
79    /// use builder::address_group_service::ListAddressGroups;
80    /// # tokio_test::block_on(async {
81    /// use gax::paginator::ItemPaginator;
82    ///
83    /// let builder = prepare_request_builder();
84    /// let mut items = builder.by_item();
85    /// while let Some(result) = items.next().await {
86    ///   let item = result?;
87    /// }
88    /// # gax::Result::<()>::Ok(()) });
89    ///
90    /// fn prepare_request_builder() -> ListAddressGroups {
91    ///   # panic!();
92    ///   // ... details omitted ...
93    /// }
94    /// ```
95    #[derive(Clone, Debug)]
96    pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
97
98    impl ListAddressGroups {
99        pub(crate) fn new(
100            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
101        ) -> Self {
102            Self(RequestBuilder::new(stub))
103        }
104
105        /// Sets the full request, replacing any prior values.
106        pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
107            mut self,
108            v: V,
109        ) -> Self {
110            self.0.request = v.into();
111            self
112        }
113
114        /// Sets all the options, replacing any prior values.
115        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
116            self.0.options = v.into();
117            self
118        }
119
120        /// Sends the request.
121        pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
122            (*self.0.stub)
123                .list_address_groups(self.0.request, self.0.options)
124                .await
125                .map(gax::response::Response::into_body)
126        }
127
128        /// Streams each page in the collection.
129        pub fn by_page(
130            self,
131        ) -> impl gax::paginator::Paginator<crate::model::ListAddressGroupsResponse, gax::error::Error>
132        {
133            use std::clone::Clone;
134            let token = self.0.request.page_token.clone();
135            let execute = move |token: String| {
136                let mut builder = self.clone();
137                builder.0.request = builder.0.request.set_page_token(token);
138                builder.send()
139            };
140            gax::paginator::internal::new_paginator(token, execute)
141        }
142
143        /// Streams each item in the collection.
144        pub fn by_item(
145            self,
146        ) -> impl gax::paginator::ItemPaginator<crate::model::ListAddressGroupsResponse, gax::error::Error>
147        {
148            use gax::paginator::Paginator;
149            self.by_page().items()
150        }
151
152        /// Sets the value of [parent][crate::model::ListAddressGroupsRequest::parent].
153        ///
154        /// This is a **required** field for requests.
155        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
156            self.0.request.parent = v.into();
157            self
158        }
159
160        /// Sets the value of [page_size][crate::model::ListAddressGroupsRequest::page_size].
161        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
162            self.0.request.page_size = v.into();
163            self
164        }
165
166        /// Sets the value of [page_token][crate::model::ListAddressGroupsRequest::page_token].
167        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
168            self.0.request.page_token = v.into();
169            self
170        }
171
172        /// Sets the value of [return_partial_success][crate::model::ListAddressGroupsRequest::return_partial_success].
173        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
174            self.0.request.return_partial_success = v.into();
175            self
176        }
177    }
178
179    #[doc(hidden)]
180    impl gax::options::internal::RequestBuilder for ListAddressGroups {
181        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
182            &mut self.0.options
183        }
184    }
185
186    /// The request builder for [AddressGroupService::get_address_group][crate::client::AddressGroupService::get_address_group] calls.
187    ///
188    /// # Example
189    /// ```no_run
190    /// # use google_cloud_networksecurity_v1::builder;
191    /// use builder::address_group_service::GetAddressGroup;
192    /// # tokio_test::block_on(async {
193    ///
194    /// let builder = prepare_request_builder();
195    /// let response = builder.send().await?;
196    /// # gax::Result::<()>::Ok(()) });
197    ///
198    /// fn prepare_request_builder() -> GetAddressGroup {
199    ///   # panic!();
200    ///   // ... details omitted ...
201    /// }
202    /// ```
203    #[derive(Clone, Debug)]
204    pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
205
206    impl GetAddressGroup {
207        pub(crate) fn new(
208            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
209        ) -> Self {
210            Self(RequestBuilder::new(stub))
211        }
212
213        /// Sets the full request, replacing any prior values.
214        pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
215            self.0.request = v.into();
216            self
217        }
218
219        /// Sets all the options, replacing any prior values.
220        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
221            self.0.options = v.into();
222            self
223        }
224
225        /// Sends the request.
226        pub async fn send(self) -> Result<crate::model::AddressGroup> {
227            (*self.0.stub)
228                .get_address_group(self.0.request, self.0.options)
229                .await
230                .map(gax::response::Response::into_body)
231        }
232
233        /// Sets the value of [name][crate::model::GetAddressGroupRequest::name].
234        ///
235        /// This is a **required** field for requests.
236        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
237            self.0.request.name = v.into();
238            self
239        }
240    }
241
242    #[doc(hidden)]
243    impl gax::options::internal::RequestBuilder for GetAddressGroup {
244        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
245            &mut self.0.options
246        }
247    }
248
249    /// The request builder for [AddressGroupService::create_address_group][crate::client::AddressGroupService::create_address_group] calls.
250    ///
251    /// # Example
252    /// ```no_run
253    /// # use google_cloud_networksecurity_v1::builder;
254    /// use builder::address_group_service::CreateAddressGroup;
255    /// # tokio_test::block_on(async {
256    /// use lro::Poller;
257    ///
258    /// let builder = prepare_request_builder();
259    /// let response = builder.poller().until_done().await?;
260    /// # gax::Result::<()>::Ok(()) });
261    ///
262    /// fn prepare_request_builder() -> CreateAddressGroup {
263    ///   # panic!();
264    ///   // ... details omitted ...
265    /// }
266    /// ```
267    #[derive(Clone, Debug)]
268    pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
269
270    impl CreateAddressGroup {
271        pub(crate) fn new(
272            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
273        ) -> Self {
274            Self(RequestBuilder::new(stub))
275        }
276
277        /// Sets the full request, replacing any prior values.
278        pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
279            mut self,
280            v: V,
281        ) -> Self {
282            self.0.request = v.into();
283            self
284        }
285
286        /// Sets all the options, replacing any prior values.
287        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
288            self.0.options = v.into();
289            self
290        }
291
292        /// Sends the request.
293        ///
294        /// # Long running operations
295        ///
296        /// This starts, but does not poll, a longrunning operation. More information
297        /// on [create_address_group][crate::client::AddressGroupService::create_address_group].
298        pub async fn send(self) -> Result<longrunning::model::Operation> {
299            (*self.0.stub)
300                .create_address_group(self.0.request, self.0.options)
301                .await
302                .map(gax::response::Response::into_body)
303        }
304
305        /// Creates a [Poller][lro::Poller] to work with `create_address_group`.
306        pub fn poller(
307            self,
308        ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
309            type Operation = lro::internal::Operation<
310                crate::model::AddressGroup,
311                crate::model::OperationMetadata,
312            >;
313            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
314            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
315
316            let stub = self.0.stub.clone();
317            let mut options = self.0.options.clone();
318            options.set_retry_policy(gax::retry_policy::NeverRetry);
319            let query = move |name| {
320                let stub = stub.clone();
321                let options = options.clone();
322                async {
323                    let op = GetOperation::new(stub)
324                        .set_name(name)
325                        .with_options(options)
326                        .send()
327                        .await?;
328                    Ok(Operation::new(op))
329                }
330            };
331
332            let start = move || async {
333                let op = self.send().await?;
334                Ok(Operation::new(op))
335            };
336
337            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
338        }
339
340        /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
341        ///
342        /// This is a **required** field for requests.
343        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
344            self.0.request.parent = v.into();
345            self
346        }
347
348        /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
349        ///
350        /// This is a **required** field for requests.
351        pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
352            self.0.request.address_group_id = v.into();
353            self
354        }
355
356        /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
357        ///
358        /// This is a **required** field for requests.
359        pub fn set_address_group<T>(mut self, v: T) -> Self
360        where
361            T: std::convert::Into<crate::model::AddressGroup>,
362        {
363            self.0.request.address_group = std::option::Option::Some(v.into());
364            self
365        }
366
367        /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
368        ///
369        /// This is a **required** field for requests.
370        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
371        where
372            T: std::convert::Into<crate::model::AddressGroup>,
373        {
374            self.0.request.address_group = v.map(|x| x.into());
375            self
376        }
377
378        /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
379        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
380            self.0.request.request_id = v.into();
381            self
382        }
383    }
384
385    #[doc(hidden)]
386    impl gax::options::internal::RequestBuilder for CreateAddressGroup {
387        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
388            &mut self.0.options
389        }
390    }
391
392    /// The request builder for [AddressGroupService::update_address_group][crate::client::AddressGroupService::update_address_group] calls.
393    ///
394    /// # Example
395    /// ```no_run
396    /// # use google_cloud_networksecurity_v1::builder;
397    /// use builder::address_group_service::UpdateAddressGroup;
398    /// # tokio_test::block_on(async {
399    /// use lro::Poller;
400    ///
401    /// let builder = prepare_request_builder();
402    /// let response = builder.poller().until_done().await?;
403    /// # gax::Result::<()>::Ok(()) });
404    ///
405    /// fn prepare_request_builder() -> UpdateAddressGroup {
406    ///   # panic!();
407    ///   // ... details omitted ...
408    /// }
409    /// ```
410    #[derive(Clone, Debug)]
411    pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
412
413    impl UpdateAddressGroup {
414        pub(crate) fn new(
415            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
416        ) -> Self {
417            Self(RequestBuilder::new(stub))
418        }
419
420        /// Sets the full request, replacing any prior values.
421        pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
422            mut self,
423            v: V,
424        ) -> Self {
425            self.0.request = v.into();
426            self
427        }
428
429        /// Sets all the options, replacing any prior values.
430        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
431            self.0.options = v.into();
432            self
433        }
434
435        /// Sends the request.
436        ///
437        /// # Long running operations
438        ///
439        /// This starts, but does not poll, a longrunning operation. More information
440        /// on [update_address_group][crate::client::AddressGroupService::update_address_group].
441        pub async fn send(self) -> Result<longrunning::model::Operation> {
442            (*self.0.stub)
443                .update_address_group(self.0.request, self.0.options)
444                .await
445                .map(gax::response::Response::into_body)
446        }
447
448        /// Creates a [Poller][lro::Poller] to work with `update_address_group`.
449        pub fn poller(
450            self,
451        ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
452            type Operation = lro::internal::Operation<
453                crate::model::AddressGroup,
454                crate::model::OperationMetadata,
455            >;
456            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
457            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
458
459            let stub = self.0.stub.clone();
460            let mut options = self.0.options.clone();
461            options.set_retry_policy(gax::retry_policy::NeverRetry);
462            let query = move |name| {
463                let stub = stub.clone();
464                let options = options.clone();
465                async {
466                    let op = GetOperation::new(stub)
467                        .set_name(name)
468                        .with_options(options)
469                        .send()
470                        .await?;
471                    Ok(Operation::new(op))
472                }
473            };
474
475            let start = move || async {
476                let op = self.send().await?;
477                Ok(Operation::new(op))
478            };
479
480            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
481        }
482
483        /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
484        pub fn set_update_mask<T>(mut self, v: T) -> Self
485        where
486            T: std::convert::Into<wkt::FieldMask>,
487        {
488            self.0.request.update_mask = std::option::Option::Some(v.into());
489            self
490        }
491
492        /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
493        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
494        where
495            T: std::convert::Into<wkt::FieldMask>,
496        {
497            self.0.request.update_mask = v.map(|x| x.into());
498            self
499        }
500
501        /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
502        ///
503        /// This is a **required** field for requests.
504        pub fn set_address_group<T>(mut self, v: T) -> Self
505        where
506            T: std::convert::Into<crate::model::AddressGroup>,
507        {
508            self.0.request.address_group = std::option::Option::Some(v.into());
509            self
510        }
511
512        /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
513        ///
514        /// This is a **required** field for requests.
515        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
516        where
517            T: std::convert::Into<crate::model::AddressGroup>,
518        {
519            self.0.request.address_group = v.map(|x| x.into());
520            self
521        }
522
523        /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
524        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
525            self.0.request.request_id = v.into();
526            self
527        }
528    }
529
530    #[doc(hidden)]
531    impl gax::options::internal::RequestBuilder for UpdateAddressGroup {
532        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
533            &mut self.0.options
534        }
535    }
536
537    /// The request builder for [AddressGroupService::add_address_group_items][crate::client::AddressGroupService::add_address_group_items] calls.
538    ///
539    /// # Example
540    /// ```no_run
541    /// # use google_cloud_networksecurity_v1::builder;
542    /// use builder::address_group_service::AddAddressGroupItems;
543    /// # tokio_test::block_on(async {
544    /// use lro::Poller;
545    ///
546    /// let builder = prepare_request_builder();
547    /// let response = builder.poller().until_done().await?;
548    /// # gax::Result::<()>::Ok(()) });
549    ///
550    /// fn prepare_request_builder() -> AddAddressGroupItems {
551    ///   # panic!();
552    ///   // ... details omitted ...
553    /// }
554    /// ```
555    #[derive(Clone, Debug)]
556    pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
557
558    impl AddAddressGroupItems {
559        pub(crate) fn new(
560            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
561        ) -> Self {
562            Self(RequestBuilder::new(stub))
563        }
564
565        /// Sets the full request, replacing any prior values.
566        pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
567            mut self,
568            v: V,
569        ) -> Self {
570            self.0.request = v.into();
571            self
572        }
573
574        /// Sets all the options, replacing any prior values.
575        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
576            self.0.options = v.into();
577            self
578        }
579
580        /// Sends the request.
581        ///
582        /// # Long running operations
583        ///
584        /// This starts, but does not poll, a longrunning operation. More information
585        /// on [add_address_group_items][crate::client::AddressGroupService::add_address_group_items].
586        pub async fn send(self) -> Result<longrunning::model::Operation> {
587            (*self.0.stub)
588                .add_address_group_items(self.0.request, self.0.options)
589                .await
590                .map(gax::response::Response::into_body)
591        }
592
593        /// Creates a [Poller][lro::Poller] to work with `add_address_group_items`.
594        pub fn poller(
595            self,
596        ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
597            type Operation = lro::internal::Operation<
598                crate::model::AddressGroup,
599                crate::model::OperationMetadata,
600            >;
601            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
602            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
603
604            let stub = self.0.stub.clone();
605            let mut options = self.0.options.clone();
606            options.set_retry_policy(gax::retry_policy::NeverRetry);
607            let query = move |name| {
608                let stub = stub.clone();
609                let options = options.clone();
610                async {
611                    let op = GetOperation::new(stub)
612                        .set_name(name)
613                        .with_options(options)
614                        .send()
615                        .await?;
616                    Ok(Operation::new(op))
617                }
618            };
619
620            let start = move || async {
621                let op = self.send().await?;
622                Ok(Operation::new(op))
623            };
624
625            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
626        }
627
628        /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
629        ///
630        /// This is a **required** field for requests.
631        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
632            self.0.request.address_group = v.into();
633            self
634        }
635
636        /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
637        ///
638        /// This is a **required** field for requests.
639        pub fn set_items<T, V>(mut self, v: T) -> Self
640        where
641            T: std::iter::IntoIterator<Item = V>,
642            V: std::convert::Into<std::string::String>,
643        {
644            use std::iter::Iterator;
645            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
646            self
647        }
648
649        /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
650        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
651            self.0.request.request_id = v.into();
652            self
653        }
654    }
655
656    #[doc(hidden)]
657    impl gax::options::internal::RequestBuilder for AddAddressGroupItems {
658        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
659            &mut self.0.options
660        }
661    }
662
663    /// The request builder for [AddressGroupService::remove_address_group_items][crate::client::AddressGroupService::remove_address_group_items] calls.
664    ///
665    /// # Example
666    /// ```no_run
667    /// # use google_cloud_networksecurity_v1::builder;
668    /// use builder::address_group_service::RemoveAddressGroupItems;
669    /// # tokio_test::block_on(async {
670    /// use lro::Poller;
671    ///
672    /// let builder = prepare_request_builder();
673    /// let response = builder.poller().until_done().await?;
674    /// # gax::Result::<()>::Ok(()) });
675    ///
676    /// fn prepare_request_builder() -> RemoveAddressGroupItems {
677    ///   # panic!();
678    ///   // ... details omitted ...
679    /// }
680    /// ```
681    #[derive(Clone, Debug)]
682    pub struct RemoveAddressGroupItems(
683        RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
684    );
685
686    impl RemoveAddressGroupItems {
687        pub(crate) fn new(
688            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
689        ) -> Self {
690            Self(RequestBuilder::new(stub))
691        }
692
693        /// Sets the full request, replacing any prior values.
694        pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
695            mut self,
696            v: V,
697        ) -> Self {
698            self.0.request = v.into();
699            self
700        }
701
702        /// Sets all the options, replacing any prior values.
703        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
704            self.0.options = v.into();
705            self
706        }
707
708        /// Sends the request.
709        ///
710        /// # Long running operations
711        ///
712        /// This starts, but does not poll, a longrunning operation. More information
713        /// on [remove_address_group_items][crate::client::AddressGroupService::remove_address_group_items].
714        pub async fn send(self) -> Result<longrunning::model::Operation> {
715            (*self.0.stub)
716                .remove_address_group_items(self.0.request, self.0.options)
717                .await
718                .map(gax::response::Response::into_body)
719        }
720
721        /// Creates a [Poller][lro::Poller] to work with `remove_address_group_items`.
722        pub fn poller(
723            self,
724        ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
725            type Operation = lro::internal::Operation<
726                crate::model::AddressGroup,
727                crate::model::OperationMetadata,
728            >;
729            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
730            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
731
732            let stub = self.0.stub.clone();
733            let mut options = self.0.options.clone();
734            options.set_retry_policy(gax::retry_policy::NeverRetry);
735            let query = move |name| {
736                let stub = stub.clone();
737                let options = options.clone();
738                async {
739                    let op = GetOperation::new(stub)
740                        .set_name(name)
741                        .with_options(options)
742                        .send()
743                        .await?;
744                    Ok(Operation::new(op))
745                }
746            };
747
748            let start = move || async {
749                let op = self.send().await?;
750                Ok(Operation::new(op))
751            };
752
753            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
754        }
755
756        /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
757        ///
758        /// This is a **required** field for requests.
759        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
760            self.0.request.address_group = v.into();
761            self
762        }
763
764        /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
765        ///
766        /// This is a **required** field for requests.
767        pub fn set_items<T, V>(mut self, v: T) -> Self
768        where
769            T: std::iter::IntoIterator<Item = V>,
770            V: std::convert::Into<std::string::String>,
771        {
772            use std::iter::Iterator;
773            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
774            self
775        }
776
777        /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
778        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
779            self.0.request.request_id = v.into();
780            self
781        }
782    }
783
784    #[doc(hidden)]
785    impl gax::options::internal::RequestBuilder for RemoveAddressGroupItems {
786        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
787            &mut self.0.options
788        }
789    }
790
791    /// The request builder for [AddressGroupService::clone_address_group_items][crate::client::AddressGroupService::clone_address_group_items] calls.
792    ///
793    /// # Example
794    /// ```no_run
795    /// # use google_cloud_networksecurity_v1::builder;
796    /// use builder::address_group_service::CloneAddressGroupItems;
797    /// # tokio_test::block_on(async {
798    /// use lro::Poller;
799    ///
800    /// let builder = prepare_request_builder();
801    /// let response = builder.poller().until_done().await?;
802    /// # gax::Result::<()>::Ok(()) });
803    ///
804    /// fn prepare_request_builder() -> CloneAddressGroupItems {
805    ///   # panic!();
806    ///   // ... details omitted ...
807    /// }
808    /// ```
809    #[derive(Clone, Debug)]
810    pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
811
812    impl CloneAddressGroupItems {
813        pub(crate) fn new(
814            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
815        ) -> Self {
816            Self(RequestBuilder::new(stub))
817        }
818
819        /// Sets the full request, replacing any prior values.
820        pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
821            mut self,
822            v: V,
823        ) -> Self {
824            self.0.request = v.into();
825            self
826        }
827
828        /// Sets all the options, replacing any prior values.
829        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
830            self.0.options = v.into();
831            self
832        }
833
834        /// Sends the request.
835        ///
836        /// # Long running operations
837        ///
838        /// This starts, but does not poll, a longrunning operation. More information
839        /// on [clone_address_group_items][crate::client::AddressGroupService::clone_address_group_items].
840        pub async fn send(self) -> Result<longrunning::model::Operation> {
841            (*self.0.stub)
842                .clone_address_group_items(self.0.request, self.0.options)
843                .await
844                .map(gax::response::Response::into_body)
845        }
846
847        /// Creates a [Poller][lro::Poller] to work with `clone_address_group_items`.
848        pub fn poller(
849            self,
850        ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
851            type Operation = lro::internal::Operation<
852                crate::model::AddressGroup,
853                crate::model::OperationMetadata,
854            >;
855            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
856            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
857
858            let stub = self.0.stub.clone();
859            let mut options = self.0.options.clone();
860            options.set_retry_policy(gax::retry_policy::NeverRetry);
861            let query = move |name| {
862                let stub = stub.clone();
863                let options = options.clone();
864                async {
865                    let op = GetOperation::new(stub)
866                        .set_name(name)
867                        .with_options(options)
868                        .send()
869                        .await?;
870                    Ok(Operation::new(op))
871                }
872            };
873
874            let start = move || async {
875                let op = self.send().await?;
876                Ok(Operation::new(op))
877            };
878
879            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
880        }
881
882        /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
883        ///
884        /// This is a **required** field for requests.
885        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
886            self.0.request.address_group = v.into();
887            self
888        }
889
890        /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
891        ///
892        /// This is a **required** field for requests.
893        pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
894            self.0.request.source_address_group = v.into();
895            self
896        }
897
898        /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
899        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
900            self.0.request.request_id = v.into();
901            self
902        }
903    }
904
905    #[doc(hidden)]
906    impl gax::options::internal::RequestBuilder for CloneAddressGroupItems {
907        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
908            &mut self.0.options
909        }
910    }
911
912    /// The request builder for [AddressGroupService::delete_address_group][crate::client::AddressGroupService::delete_address_group] calls.
913    ///
914    /// # Example
915    /// ```no_run
916    /// # use google_cloud_networksecurity_v1::builder;
917    /// use builder::address_group_service::DeleteAddressGroup;
918    /// # tokio_test::block_on(async {
919    /// use lro::Poller;
920    ///
921    /// let builder = prepare_request_builder();
922    /// let response = builder.poller().until_done().await?;
923    /// # gax::Result::<()>::Ok(()) });
924    ///
925    /// fn prepare_request_builder() -> DeleteAddressGroup {
926    ///   # panic!();
927    ///   // ... details omitted ...
928    /// }
929    /// ```
930    #[derive(Clone, Debug)]
931    pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
932
933    impl DeleteAddressGroup {
934        pub(crate) fn new(
935            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
936        ) -> Self {
937            Self(RequestBuilder::new(stub))
938        }
939
940        /// Sets the full request, replacing any prior values.
941        pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
942            mut self,
943            v: V,
944        ) -> Self {
945            self.0.request = v.into();
946            self
947        }
948
949        /// Sets all the options, replacing any prior values.
950        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
951            self.0.options = v.into();
952            self
953        }
954
955        /// Sends the request.
956        ///
957        /// # Long running operations
958        ///
959        /// This starts, but does not poll, a longrunning operation. More information
960        /// on [delete_address_group][crate::client::AddressGroupService::delete_address_group].
961        pub async fn send(self) -> Result<longrunning::model::Operation> {
962            (*self.0.stub)
963                .delete_address_group(self.0.request, self.0.options)
964                .await
965                .map(gax::response::Response::into_body)
966        }
967
968        /// Creates a [Poller][lro::Poller] to work with `delete_address_group`.
969        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
970            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
971            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
972            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
973
974            let stub = self.0.stub.clone();
975            let mut options = self.0.options.clone();
976            options.set_retry_policy(gax::retry_policy::NeverRetry);
977            let query = move |name| {
978                let stub = stub.clone();
979                let options = options.clone();
980                async {
981                    let op = GetOperation::new(stub)
982                        .set_name(name)
983                        .with_options(options)
984                        .send()
985                        .await?;
986                    Ok(Operation::new(op))
987                }
988            };
989
990            let start = move || async {
991                let op = self.send().await?;
992                Ok(Operation::new(op))
993            };
994
995            lro::internal::new_unit_response_poller(
996                polling_error_policy,
997                polling_backoff_policy,
998                start,
999                query,
1000            )
1001        }
1002
1003        /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
1004        ///
1005        /// This is a **required** field for requests.
1006        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1007            self.0.request.name = v.into();
1008            self
1009        }
1010
1011        /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
1012        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1013            self.0.request.request_id = v.into();
1014            self
1015        }
1016    }
1017
1018    #[doc(hidden)]
1019    impl gax::options::internal::RequestBuilder for DeleteAddressGroup {
1020        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1021            &mut self.0.options
1022        }
1023    }
1024
1025    /// The request builder for [AddressGroupService::list_address_group_references][crate::client::AddressGroupService::list_address_group_references] calls.
1026    ///
1027    /// # Example
1028    /// ```no_run
1029    /// # use google_cloud_networksecurity_v1::builder;
1030    /// use builder::address_group_service::ListAddressGroupReferences;
1031    /// # tokio_test::block_on(async {
1032    /// use gax::paginator::ItemPaginator;
1033    ///
1034    /// let builder = prepare_request_builder();
1035    /// let mut items = builder.by_item();
1036    /// while let Some(result) = items.next().await {
1037    ///   let item = result?;
1038    /// }
1039    /// # gax::Result::<()>::Ok(()) });
1040    ///
1041    /// fn prepare_request_builder() -> ListAddressGroupReferences {
1042    ///   # panic!();
1043    ///   // ... details omitted ...
1044    /// }
1045    /// ```
1046    #[derive(Clone, Debug)]
1047    pub struct ListAddressGroupReferences(
1048        RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
1049    );
1050
1051    impl ListAddressGroupReferences {
1052        pub(crate) fn new(
1053            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1054        ) -> Self {
1055            Self(RequestBuilder::new(stub))
1056        }
1057
1058        /// Sets the full request, replacing any prior values.
1059        pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
1060            mut self,
1061            v: V,
1062        ) -> Self {
1063            self.0.request = v.into();
1064            self
1065        }
1066
1067        /// Sets all the options, replacing any prior values.
1068        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1069            self.0.options = v.into();
1070            self
1071        }
1072
1073        /// Sends the request.
1074        pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
1075            (*self.0.stub)
1076                .list_address_group_references(self.0.request, self.0.options)
1077                .await
1078                .map(gax::response::Response::into_body)
1079        }
1080
1081        /// Streams each page in the collection.
1082        pub fn by_page(
1083            self,
1084        ) -> impl gax::paginator::Paginator<
1085            crate::model::ListAddressGroupReferencesResponse,
1086            gax::error::Error,
1087        > {
1088            use std::clone::Clone;
1089            let token = self.0.request.page_token.clone();
1090            let execute = move |token: String| {
1091                let mut builder = self.clone();
1092                builder.0.request = builder.0.request.set_page_token(token);
1093                builder.send()
1094            };
1095            gax::paginator::internal::new_paginator(token, execute)
1096        }
1097
1098        /// Streams each item in the collection.
1099        pub fn by_item(
1100            self,
1101        ) -> impl gax::paginator::ItemPaginator<
1102            crate::model::ListAddressGroupReferencesResponse,
1103            gax::error::Error,
1104        > {
1105            use gax::paginator::Paginator;
1106            self.by_page().items()
1107        }
1108
1109        /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
1110        ///
1111        /// This is a **required** field for requests.
1112        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
1113            self.0.request.address_group = v.into();
1114            self
1115        }
1116
1117        /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
1118        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1119            self.0.request.page_size = v.into();
1120            self
1121        }
1122
1123        /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
1124        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1125            self.0.request.page_token = v.into();
1126            self
1127        }
1128    }
1129
1130    #[doc(hidden)]
1131    impl gax::options::internal::RequestBuilder for ListAddressGroupReferences {
1132        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1133            &mut self.0.options
1134        }
1135    }
1136
1137    /// The request builder for [AddressGroupService::list_locations][crate::client::AddressGroupService::list_locations] calls.
1138    ///
1139    /// # Example
1140    /// ```no_run
1141    /// # use google_cloud_networksecurity_v1::builder;
1142    /// use builder::address_group_service::ListLocations;
1143    /// # tokio_test::block_on(async {
1144    /// use gax::paginator::ItemPaginator;
1145    ///
1146    /// let builder = prepare_request_builder();
1147    /// let mut items = builder.by_item();
1148    /// while let Some(result) = items.next().await {
1149    ///   let item = result?;
1150    /// }
1151    /// # gax::Result::<()>::Ok(()) });
1152    ///
1153    /// fn prepare_request_builder() -> ListLocations {
1154    ///   # panic!();
1155    ///   // ... details omitted ...
1156    /// }
1157    /// ```
1158    #[derive(Clone, Debug)]
1159    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1160
1161    impl ListLocations {
1162        pub(crate) fn new(
1163            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1164        ) -> Self {
1165            Self(RequestBuilder::new(stub))
1166        }
1167
1168        /// Sets the full request, replacing any prior values.
1169        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1170            mut self,
1171            v: V,
1172        ) -> Self {
1173            self.0.request = v.into();
1174            self
1175        }
1176
1177        /// Sets all the options, replacing any prior values.
1178        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1179            self.0.options = v.into();
1180            self
1181        }
1182
1183        /// Sends the request.
1184        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1185            (*self.0.stub)
1186                .list_locations(self.0.request, self.0.options)
1187                .await
1188                .map(gax::response::Response::into_body)
1189        }
1190
1191        /// Streams each page in the collection.
1192        pub fn by_page(
1193            self,
1194        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1195        {
1196            use std::clone::Clone;
1197            let token = self.0.request.page_token.clone();
1198            let execute = move |token: String| {
1199                let mut builder = self.clone();
1200                builder.0.request = builder.0.request.set_page_token(token);
1201                builder.send()
1202            };
1203            gax::paginator::internal::new_paginator(token, execute)
1204        }
1205
1206        /// Streams each item in the collection.
1207        pub fn by_item(
1208            self,
1209        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1210        {
1211            use gax::paginator::Paginator;
1212            self.by_page().items()
1213        }
1214
1215        /// Sets the value of [name][location::model::ListLocationsRequest::name].
1216        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1217            self.0.request.name = v.into();
1218            self
1219        }
1220
1221        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
1222        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1223            self.0.request.filter = v.into();
1224            self
1225        }
1226
1227        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
1228        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1229            self.0.request.page_size = v.into();
1230            self
1231        }
1232
1233        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
1234        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1235            self.0.request.page_token = v.into();
1236            self
1237        }
1238    }
1239
1240    #[doc(hidden)]
1241    impl gax::options::internal::RequestBuilder for ListLocations {
1242        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1243            &mut self.0.options
1244        }
1245    }
1246
1247    /// The request builder for [AddressGroupService::get_location][crate::client::AddressGroupService::get_location] calls.
1248    ///
1249    /// # Example
1250    /// ```no_run
1251    /// # use google_cloud_networksecurity_v1::builder;
1252    /// use builder::address_group_service::GetLocation;
1253    /// # tokio_test::block_on(async {
1254    ///
1255    /// let builder = prepare_request_builder();
1256    /// let response = builder.send().await?;
1257    /// # gax::Result::<()>::Ok(()) });
1258    ///
1259    /// fn prepare_request_builder() -> GetLocation {
1260    ///   # panic!();
1261    ///   // ... details omitted ...
1262    /// }
1263    /// ```
1264    #[derive(Clone, Debug)]
1265    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1266
1267    impl GetLocation {
1268        pub(crate) fn new(
1269            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1270        ) -> Self {
1271            Self(RequestBuilder::new(stub))
1272        }
1273
1274        /// Sets the full request, replacing any prior values.
1275        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1276            self.0.request = v.into();
1277            self
1278        }
1279
1280        /// Sets all the options, replacing any prior values.
1281        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1282            self.0.options = v.into();
1283            self
1284        }
1285
1286        /// Sends the request.
1287        pub async fn send(self) -> Result<location::model::Location> {
1288            (*self.0.stub)
1289                .get_location(self.0.request, self.0.options)
1290                .await
1291                .map(gax::response::Response::into_body)
1292        }
1293
1294        /// Sets the value of [name][location::model::GetLocationRequest::name].
1295        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1296            self.0.request.name = v.into();
1297            self
1298        }
1299    }
1300
1301    #[doc(hidden)]
1302    impl gax::options::internal::RequestBuilder for GetLocation {
1303        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1304            &mut self.0.options
1305        }
1306    }
1307
1308    /// The request builder for [AddressGroupService::set_iam_policy][crate::client::AddressGroupService::set_iam_policy] calls.
1309    ///
1310    /// # Example
1311    /// ```no_run
1312    /// # use google_cloud_networksecurity_v1::builder;
1313    /// use builder::address_group_service::SetIamPolicy;
1314    /// # tokio_test::block_on(async {
1315    ///
1316    /// let builder = prepare_request_builder();
1317    /// let response = builder.send().await?;
1318    /// # gax::Result::<()>::Ok(()) });
1319    ///
1320    /// fn prepare_request_builder() -> SetIamPolicy {
1321    ///   # panic!();
1322    ///   // ... details omitted ...
1323    /// }
1324    /// ```
1325    #[derive(Clone, Debug)]
1326    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1327
1328    impl SetIamPolicy {
1329        pub(crate) fn new(
1330            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1331        ) -> Self {
1332            Self(RequestBuilder::new(stub))
1333        }
1334
1335        /// Sets the full request, replacing any prior values.
1336        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1337            self.0.request = v.into();
1338            self
1339        }
1340
1341        /// Sets all the options, replacing any prior values.
1342        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1343            self.0.options = v.into();
1344            self
1345        }
1346
1347        /// Sends the request.
1348        pub async fn send(self) -> Result<iam_v1::model::Policy> {
1349            (*self.0.stub)
1350                .set_iam_policy(self.0.request, self.0.options)
1351                .await
1352                .map(gax::response::Response::into_body)
1353        }
1354
1355        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
1356        ///
1357        /// This is a **required** field for requests.
1358        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1359            self.0.request.resource = v.into();
1360            self
1361        }
1362
1363        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
1364        ///
1365        /// This is a **required** field for requests.
1366        pub fn set_policy<T>(mut self, v: T) -> Self
1367        where
1368            T: std::convert::Into<iam_v1::model::Policy>,
1369        {
1370            self.0.request.policy = std::option::Option::Some(v.into());
1371            self
1372        }
1373
1374        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
1375        ///
1376        /// This is a **required** field for requests.
1377        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1378        where
1379            T: std::convert::Into<iam_v1::model::Policy>,
1380        {
1381            self.0.request.policy = v.map(|x| x.into());
1382            self
1383        }
1384
1385        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
1386        pub fn set_update_mask<T>(mut self, v: T) -> Self
1387        where
1388            T: std::convert::Into<wkt::FieldMask>,
1389        {
1390            self.0.request.update_mask = std::option::Option::Some(v.into());
1391            self
1392        }
1393
1394        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
1395        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1396        where
1397            T: std::convert::Into<wkt::FieldMask>,
1398        {
1399            self.0.request.update_mask = v.map(|x| x.into());
1400            self
1401        }
1402    }
1403
1404    #[doc(hidden)]
1405    impl gax::options::internal::RequestBuilder for SetIamPolicy {
1406        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1407            &mut self.0.options
1408        }
1409    }
1410
1411    /// The request builder for [AddressGroupService::get_iam_policy][crate::client::AddressGroupService::get_iam_policy] calls.
1412    ///
1413    /// # Example
1414    /// ```no_run
1415    /// # use google_cloud_networksecurity_v1::builder;
1416    /// use builder::address_group_service::GetIamPolicy;
1417    /// # tokio_test::block_on(async {
1418    ///
1419    /// let builder = prepare_request_builder();
1420    /// let response = builder.send().await?;
1421    /// # gax::Result::<()>::Ok(()) });
1422    ///
1423    /// fn prepare_request_builder() -> GetIamPolicy {
1424    ///   # panic!();
1425    ///   // ... details omitted ...
1426    /// }
1427    /// ```
1428    #[derive(Clone, Debug)]
1429    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1430
1431    impl GetIamPolicy {
1432        pub(crate) fn new(
1433            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1434        ) -> Self {
1435            Self(RequestBuilder::new(stub))
1436        }
1437
1438        /// Sets the full request, replacing any prior values.
1439        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1440            self.0.request = v.into();
1441            self
1442        }
1443
1444        /// Sets all the options, replacing any prior values.
1445        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1446            self.0.options = v.into();
1447            self
1448        }
1449
1450        /// Sends the request.
1451        pub async fn send(self) -> Result<iam_v1::model::Policy> {
1452            (*self.0.stub)
1453                .get_iam_policy(self.0.request, self.0.options)
1454                .await
1455                .map(gax::response::Response::into_body)
1456        }
1457
1458        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
1459        ///
1460        /// This is a **required** field for requests.
1461        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1462            self.0.request.resource = v.into();
1463            self
1464        }
1465
1466        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
1467        pub fn set_options<T>(mut self, v: T) -> Self
1468        where
1469            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1470        {
1471            self.0.request.options = std::option::Option::Some(v.into());
1472            self
1473        }
1474
1475        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
1476        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1477        where
1478            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1479        {
1480            self.0.request.options = v.map(|x| x.into());
1481            self
1482        }
1483    }
1484
1485    #[doc(hidden)]
1486    impl gax::options::internal::RequestBuilder for GetIamPolicy {
1487        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1488            &mut self.0.options
1489        }
1490    }
1491
1492    /// The request builder for [AddressGroupService::test_iam_permissions][crate::client::AddressGroupService::test_iam_permissions] calls.
1493    ///
1494    /// # Example
1495    /// ```no_run
1496    /// # use google_cloud_networksecurity_v1::builder;
1497    /// use builder::address_group_service::TestIamPermissions;
1498    /// # tokio_test::block_on(async {
1499    ///
1500    /// let builder = prepare_request_builder();
1501    /// let response = builder.send().await?;
1502    /// # gax::Result::<()>::Ok(()) });
1503    ///
1504    /// fn prepare_request_builder() -> TestIamPermissions {
1505    ///   # panic!();
1506    ///   // ... details omitted ...
1507    /// }
1508    /// ```
1509    #[derive(Clone, Debug)]
1510    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1511
1512    impl TestIamPermissions {
1513        pub(crate) fn new(
1514            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1515        ) -> Self {
1516            Self(RequestBuilder::new(stub))
1517        }
1518
1519        /// Sets the full request, replacing any prior values.
1520        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1521            mut self,
1522            v: V,
1523        ) -> Self {
1524            self.0.request = v.into();
1525            self
1526        }
1527
1528        /// Sets all the options, replacing any prior values.
1529        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1530            self.0.options = v.into();
1531            self
1532        }
1533
1534        /// Sends the request.
1535        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1536            (*self.0.stub)
1537                .test_iam_permissions(self.0.request, self.0.options)
1538                .await
1539                .map(gax::response::Response::into_body)
1540        }
1541
1542        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
1543        ///
1544        /// This is a **required** field for requests.
1545        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1546            self.0.request.resource = v.into();
1547            self
1548        }
1549
1550        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
1551        ///
1552        /// This is a **required** field for requests.
1553        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1554        where
1555            T: std::iter::IntoIterator<Item = V>,
1556            V: std::convert::Into<std::string::String>,
1557        {
1558            use std::iter::Iterator;
1559            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1560            self
1561        }
1562    }
1563
1564    #[doc(hidden)]
1565    impl gax::options::internal::RequestBuilder for TestIamPermissions {
1566        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1567            &mut self.0.options
1568        }
1569    }
1570
1571    /// The request builder for [AddressGroupService::list_operations][crate::client::AddressGroupService::list_operations] calls.
1572    ///
1573    /// # Example
1574    /// ```no_run
1575    /// # use google_cloud_networksecurity_v1::builder;
1576    /// use builder::address_group_service::ListOperations;
1577    /// # tokio_test::block_on(async {
1578    /// use gax::paginator::ItemPaginator;
1579    ///
1580    /// let builder = prepare_request_builder();
1581    /// let mut items = builder.by_item();
1582    /// while let Some(result) = items.next().await {
1583    ///   let item = result?;
1584    /// }
1585    /// # gax::Result::<()>::Ok(()) });
1586    ///
1587    /// fn prepare_request_builder() -> ListOperations {
1588    ///   # panic!();
1589    ///   // ... details omitted ...
1590    /// }
1591    /// ```
1592    #[derive(Clone, Debug)]
1593    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1594
1595    impl ListOperations {
1596        pub(crate) fn new(
1597            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1598        ) -> Self {
1599            Self(RequestBuilder::new(stub))
1600        }
1601
1602        /// Sets the full request, replacing any prior values.
1603        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1604            mut self,
1605            v: V,
1606        ) -> Self {
1607            self.0.request = v.into();
1608            self
1609        }
1610
1611        /// Sets all the options, replacing any prior values.
1612        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1613            self.0.options = v.into();
1614            self
1615        }
1616
1617        /// Sends the request.
1618        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1619            (*self.0.stub)
1620                .list_operations(self.0.request, self.0.options)
1621                .await
1622                .map(gax::response::Response::into_body)
1623        }
1624
1625        /// Streams each page in the collection.
1626        pub fn by_page(
1627            self,
1628        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1629        {
1630            use std::clone::Clone;
1631            let token = self.0.request.page_token.clone();
1632            let execute = move |token: String| {
1633                let mut builder = self.clone();
1634                builder.0.request = builder.0.request.set_page_token(token);
1635                builder.send()
1636            };
1637            gax::paginator::internal::new_paginator(token, execute)
1638        }
1639
1640        /// Streams each item in the collection.
1641        pub fn by_item(
1642            self,
1643        ) -> impl gax::paginator::ItemPaginator<
1644            longrunning::model::ListOperationsResponse,
1645            gax::error::Error,
1646        > {
1647            use gax::paginator::Paginator;
1648            self.by_page().items()
1649        }
1650
1651        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
1652        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1653            self.0.request.name = v.into();
1654            self
1655        }
1656
1657        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
1658        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1659            self.0.request.filter = v.into();
1660            self
1661        }
1662
1663        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
1664        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1665            self.0.request.page_size = v.into();
1666            self
1667        }
1668
1669        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
1670        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1671            self.0.request.page_token = v.into();
1672            self
1673        }
1674
1675        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
1676        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1677            self.0.request.return_partial_success = v.into();
1678            self
1679        }
1680    }
1681
1682    #[doc(hidden)]
1683    impl gax::options::internal::RequestBuilder for ListOperations {
1684        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1685            &mut self.0.options
1686        }
1687    }
1688
1689    /// The request builder for [AddressGroupService::get_operation][crate::client::AddressGroupService::get_operation] calls.
1690    ///
1691    /// # Example
1692    /// ```no_run
1693    /// # use google_cloud_networksecurity_v1::builder;
1694    /// use builder::address_group_service::GetOperation;
1695    /// # tokio_test::block_on(async {
1696    ///
1697    /// let builder = prepare_request_builder();
1698    /// let response = builder.send().await?;
1699    /// # gax::Result::<()>::Ok(()) });
1700    ///
1701    /// fn prepare_request_builder() -> GetOperation {
1702    ///   # panic!();
1703    ///   // ... details omitted ...
1704    /// }
1705    /// ```
1706    #[derive(Clone, Debug)]
1707    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1708
1709    impl GetOperation {
1710        pub(crate) fn new(
1711            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1712        ) -> Self {
1713            Self(RequestBuilder::new(stub))
1714        }
1715
1716        /// Sets the full request, replacing any prior values.
1717        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1718            mut self,
1719            v: V,
1720        ) -> Self {
1721            self.0.request = v.into();
1722            self
1723        }
1724
1725        /// Sets all the options, replacing any prior values.
1726        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1727            self.0.options = v.into();
1728            self
1729        }
1730
1731        /// Sends the request.
1732        pub async fn send(self) -> Result<longrunning::model::Operation> {
1733            (*self.0.stub)
1734                .get_operation(self.0.request, self.0.options)
1735                .await
1736                .map(gax::response::Response::into_body)
1737        }
1738
1739        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1740        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1741            self.0.request.name = v.into();
1742            self
1743        }
1744    }
1745
1746    #[doc(hidden)]
1747    impl gax::options::internal::RequestBuilder for GetOperation {
1748        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1749            &mut self.0.options
1750        }
1751    }
1752
1753    /// The request builder for [AddressGroupService::delete_operation][crate::client::AddressGroupService::delete_operation] calls.
1754    ///
1755    /// # Example
1756    /// ```no_run
1757    /// # use google_cloud_networksecurity_v1::builder;
1758    /// use builder::address_group_service::DeleteOperation;
1759    /// # tokio_test::block_on(async {
1760    ///
1761    /// let builder = prepare_request_builder();
1762    /// let response = builder.send().await?;
1763    /// # gax::Result::<()>::Ok(()) });
1764    ///
1765    /// fn prepare_request_builder() -> DeleteOperation {
1766    ///   # panic!();
1767    ///   // ... details omitted ...
1768    /// }
1769    /// ```
1770    #[derive(Clone, Debug)]
1771    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1772
1773    impl DeleteOperation {
1774        pub(crate) fn new(
1775            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1776        ) -> Self {
1777            Self(RequestBuilder::new(stub))
1778        }
1779
1780        /// Sets the full request, replacing any prior values.
1781        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1782            mut self,
1783            v: V,
1784        ) -> Self {
1785            self.0.request = v.into();
1786            self
1787        }
1788
1789        /// Sets all the options, replacing any prior values.
1790        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1791            self.0.options = v.into();
1792            self
1793        }
1794
1795        /// Sends the request.
1796        pub async fn send(self) -> Result<()> {
1797            (*self.0.stub)
1798                .delete_operation(self.0.request, self.0.options)
1799                .await
1800                .map(gax::response::Response::into_body)
1801        }
1802
1803        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
1804        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1805            self.0.request.name = v.into();
1806            self
1807        }
1808    }
1809
1810    #[doc(hidden)]
1811    impl gax::options::internal::RequestBuilder for DeleteOperation {
1812        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1813            &mut self.0.options
1814        }
1815    }
1816
1817    /// The request builder for [AddressGroupService::cancel_operation][crate::client::AddressGroupService::cancel_operation] calls.
1818    ///
1819    /// # Example
1820    /// ```no_run
1821    /// # use google_cloud_networksecurity_v1::builder;
1822    /// use builder::address_group_service::CancelOperation;
1823    /// # tokio_test::block_on(async {
1824    ///
1825    /// let builder = prepare_request_builder();
1826    /// let response = builder.send().await?;
1827    /// # gax::Result::<()>::Ok(()) });
1828    ///
1829    /// fn prepare_request_builder() -> CancelOperation {
1830    ///   # panic!();
1831    ///   // ... details omitted ...
1832    /// }
1833    /// ```
1834    #[derive(Clone, Debug)]
1835    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1836
1837    impl CancelOperation {
1838        pub(crate) fn new(
1839            stub: std::sync::Arc<dyn super::super::stub::dynamic::AddressGroupService>,
1840        ) -> Self {
1841            Self(RequestBuilder::new(stub))
1842        }
1843
1844        /// Sets the full request, replacing any prior values.
1845        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1846            mut self,
1847            v: V,
1848        ) -> Self {
1849            self.0.request = v.into();
1850            self
1851        }
1852
1853        /// Sets all the options, replacing any prior values.
1854        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1855            self.0.options = v.into();
1856            self
1857        }
1858
1859        /// Sends the request.
1860        pub async fn send(self) -> Result<()> {
1861            (*self.0.stub)
1862                .cancel_operation(self.0.request, self.0.options)
1863                .await
1864                .map(gax::response::Response::into_body)
1865        }
1866
1867        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
1868        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1869            self.0.request.name = v.into();
1870            self
1871        }
1872    }
1873
1874    #[doc(hidden)]
1875    impl gax::options::internal::RequestBuilder for CancelOperation {
1876        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1877            &mut self.0.options
1878        }
1879    }
1880}
1881
1882pub mod organization_address_group_service {
1883    use crate::Result;
1884
1885    /// A builder for [OrganizationAddressGroupService][crate::client::OrganizationAddressGroupService].
1886    ///
1887    /// ```
1888    /// # tokio_test::block_on(async {
1889    /// # use google_cloud_networksecurity_v1::*;
1890    /// # use builder::organization_address_group_service::ClientBuilder;
1891    /// # use client::OrganizationAddressGroupService;
1892    /// let builder : ClientBuilder = OrganizationAddressGroupService::builder();
1893    /// let client = builder
1894    ///     .with_endpoint("https://networksecurity.googleapis.com")
1895    ///     .build().await?;
1896    /// # gax::client_builder::Result::<()>::Ok(()) });
1897    /// ```
1898    pub type ClientBuilder =
1899        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1900
1901    pub(crate) mod client {
1902        use super::super::super::client::OrganizationAddressGroupService;
1903        pub struct Factory;
1904        impl gax::client_builder::internal::ClientFactory for Factory {
1905            type Client = OrganizationAddressGroupService;
1906            type Credentials = gaxi::options::Credentials;
1907            async fn build(
1908                self,
1909                config: gaxi::options::ClientConfig,
1910            ) -> gax::client_builder::Result<Self::Client> {
1911                Self::Client::new(config).await
1912            }
1913        }
1914    }
1915
1916    /// Common implementation for [crate::client::OrganizationAddressGroupService] request builders.
1917    #[derive(Clone, Debug)]
1918    pub(crate) struct RequestBuilder<R: std::default::Default> {
1919        stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1920        request: R,
1921        options: gax::options::RequestOptions,
1922    }
1923
1924    impl<R> RequestBuilder<R>
1925    where
1926        R: std::default::Default,
1927    {
1928        pub(crate) fn new(
1929            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1930        ) -> Self {
1931            Self {
1932                stub,
1933                request: R::default(),
1934                options: gax::options::RequestOptions::default(),
1935            }
1936        }
1937    }
1938
1939    /// The request builder for [OrganizationAddressGroupService::list_address_groups][crate::client::OrganizationAddressGroupService::list_address_groups] calls.
1940    ///
1941    /// # Example
1942    /// ```no_run
1943    /// # use google_cloud_networksecurity_v1::builder;
1944    /// use builder::organization_address_group_service::ListAddressGroups;
1945    /// # tokio_test::block_on(async {
1946    /// use gax::paginator::ItemPaginator;
1947    ///
1948    /// let builder = prepare_request_builder();
1949    /// let mut items = builder.by_item();
1950    /// while let Some(result) = items.next().await {
1951    ///   let item = result?;
1952    /// }
1953    /// # gax::Result::<()>::Ok(()) });
1954    ///
1955    /// fn prepare_request_builder() -> ListAddressGroups {
1956    ///   # panic!();
1957    ///   // ... details omitted ...
1958    /// }
1959    /// ```
1960    #[derive(Clone, Debug)]
1961    pub struct ListAddressGroups(RequestBuilder<crate::model::ListAddressGroupsRequest>);
1962
1963    impl ListAddressGroups {
1964        pub(crate) fn new(
1965            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
1966        ) -> Self {
1967            Self(RequestBuilder::new(stub))
1968        }
1969
1970        /// Sets the full request, replacing any prior values.
1971        pub fn with_request<V: Into<crate::model::ListAddressGroupsRequest>>(
1972            mut self,
1973            v: V,
1974        ) -> Self {
1975            self.0.request = v.into();
1976            self
1977        }
1978
1979        /// Sets all the options, replacing any prior values.
1980        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1981            self.0.options = v.into();
1982            self
1983        }
1984
1985        /// Sends the request.
1986        pub async fn send(self) -> Result<crate::model::ListAddressGroupsResponse> {
1987            (*self.0.stub)
1988                .list_address_groups(self.0.request, self.0.options)
1989                .await
1990                .map(gax::response::Response::into_body)
1991        }
1992
1993        /// Streams each page in the collection.
1994        pub fn by_page(
1995            self,
1996        ) -> impl gax::paginator::Paginator<crate::model::ListAddressGroupsResponse, gax::error::Error>
1997        {
1998            use std::clone::Clone;
1999            let token = self.0.request.page_token.clone();
2000            let execute = move |token: String| {
2001                let mut builder = self.clone();
2002                builder.0.request = builder.0.request.set_page_token(token);
2003                builder.send()
2004            };
2005            gax::paginator::internal::new_paginator(token, execute)
2006        }
2007
2008        /// Streams each item in the collection.
2009        pub fn by_item(
2010            self,
2011        ) -> impl gax::paginator::ItemPaginator<crate::model::ListAddressGroupsResponse, gax::error::Error>
2012        {
2013            use gax::paginator::Paginator;
2014            self.by_page().items()
2015        }
2016
2017        /// Sets the value of [parent][crate::model::ListAddressGroupsRequest::parent].
2018        ///
2019        /// This is a **required** field for requests.
2020        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2021            self.0.request.parent = v.into();
2022            self
2023        }
2024
2025        /// Sets the value of [page_size][crate::model::ListAddressGroupsRequest::page_size].
2026        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2027            self.0.request.page_size = v.into();
2028            self
2029        }
2030
2031        /// Sets the value of [page_token][crate::model::ListAddressGroupsRequest::page_token].
2032        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2033            self.0.request.page_token = v.into();
2034            self
2035        }
2036
2037        /// Sets the value of [return_partial_success][crate::model::ListAddressGroupsRequest::return_partial_success].
2038        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2039            self.0.request.return_partial_success = v.into();
2040            self
2041        }
2042    }
2043
2044    #[doc(hidden)]
2045    impl gax::options::internal::RequestBuilder for ListAddressGroups {
2046        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2047            &mut self.0.options
2048        }
2049    }
2050
2051    /// The request builder for [OrganizationAddressGroupService::get_address_group][crate::client::OrganizationAddressGroupService::get_address_group] calls.
2052    ///
2053    /// # Example
2054    /// ```no_run
2055    /// # use google_cloud_networksecurity_v1::builder;
2056    /// use builder::organization_address_group_service::GetAddressGroup;
2057    /// # tokio_test::block_on(async {
2058    ///
2059    /// let builder = prepare_request_builder();
2060    /// let response = builder.send().await?;
2061    /// # gax::Result::<()>::Ok(()) });
2062    ///
2063    /// fn prepare_request_builder() -> GetAddressGroup {
2064    ///   # panic!();
2065    ///   // ... details omitted ...
2066    /// }
2067    /// ```
2068    #[derive(Clone, Debug)]
2069    pub struct GetAddressGroup(RequestBuilder<crate::model::GetAddressGroupRequest>);
2070
2071    impl GetAddressGroup {
2072        pub(crate) fn new(
2073            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2074        ) -> Self {
2075            Self(RequestBuilder::new(stub))
2076        }
2077
2078        /// Sets the full request, replacing any prior values.
2079        pub fn with_request<V: Into<crate::model::GetAddressGroupRequest>>(mut self, v: V) -> Self {
2080            self.0.request = v.into();
2081            self
2082        }
2083
2084        /// Sets all the options, replacing any prior values.
2085        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2086            self.0.options = v.into();
2087            self
2088        }
2089
2090        /// Sends the request.
2091        pub async fn send(self) -> Result<crate::model::AddressGroup> {
2092            (*self.0.stub)
2093                .get_address_group(self.0.request, self.0.options)
2094                .await
2095                .map(gax::response::Response::into_body)
2096        }
2097
2098        /// Sets the value of [name][crate::model::GetAddressGroupRequest::name].
2099        ///
2100        /// This is a **required** field for requests.
2101        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2102            self.0.request.name = v.into();
2103            self
2104        }
2105    }
2106
2107    #[doc(hidden)]
2108    impl gax::options::internal::RequestBuilder for GetAddressGroup {
2109        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2110            &mut self.0.options
2111        }
2112    }
2113
2114    /// The request builder for [OrganizationAddressGroupService::create_address_group][crate::client::OrganizationAddressGroupService::create_address_group] calls.
2115    ///
2116    /// # Example
2117    /// ```no_run
2118    /// # use google_cloud_networksecurity_v1::builder;
2119    /// use builder::organization_address_group_service::CreateAddressGroup;
2120    /// # tokio_test::block_on(async {
2121    /// use lro::Poller;
2122    ///
2123    /// let builder = prepare_request_builder();
2124    /// let response = builder.poller().until_done().await?;
2125    /// # gax::Result::<()>::Ok(()) });
2126    ///
2127    /// fn prepare_request_builder() -> CreateAddressGroup {
2128    ///   # panic!();
2129    ///   // ... details omitted ...
2130    /// }
2131    /// ```
2132    #[derive(Clone, Debug)]
2133    pub struct CreateAddressGroup(RequestBuilder<crate::model::CreateAddressGroupRequest>);
2134
2135    impl CreateAddressGroup {
2136        pub(crate) fn new(
2137            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2138        ) -> Self {
2139            Self(RequestBuilder::new(stub))
2140        }
2141
2142        /// Sets the full request, replacing any prior values.
2143        pub fn with_request<V: Into<crate::model::CreateAddressGroupRequest>>(
2144            mut self,
2145            v: V,
2146        ) -> Self {
2147            self.0.request = v.into();
2148            self
2149        }
2150
2151        /// Sets all the options, replacing any prior values.
2152        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2153            self.0.options = v.into();
2154            self
2155        }
2156
2157        /// Sends the request.
2158        ///
2159        /// # Long running operations
2160        ///
2161        /// This starts, but does not poll, a longrunning operation. More information
2162        /// on [create_address_group][crate::client::OrganizationAddressGroupService::create_address_group].
2163        pub async fn send(self) -> Result<longrunning::model::Operation> {
2164            (*self.0.stub)
2165                .create_address_group(self.0.request, self.0.options)
2166                .await
2167                .map(gax::response::Response::into_body)
2168        }
2169
2170        /// Creates a [Poller][lro::Poller] to work with `create_address_group`.
2171        pub fn poller(
2172            self,
2173        ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2174            type Operation = lro::internal::Operation<
2175                crate::model::AddressGroup,
2176                crate::model::OperationMetadata,
2177            >;
2178            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2179            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2180
2181            let stub = self.0.stub.clone();
2182            let mut options = self.0.options.clone();
2183            options.set_retry_policy(gax::retry_policy::NeverRetry);
2184            let query = move |name| {
2185                let stub = stub.clone();
2186                let options = options.clone();
2187                async {
2188                    let op = GetOperation::new(stub)
2189                        .set_name(name)
2190                        .with_options(options)
2191                        .send()
2192                        .await?;
2193                    Ok(Operation::new(op))
2194                }
2195            };
2196
2197            let start = move || async {
2198                let op = self.send().await?;
2199                Ok(Operation::new(op))
2200            };
2201
2202            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2203        }
2204
2205        /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
2206        ///
2207        /// This is a **required** field for requests.
2208        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2209            self.0.request.parent = v.into();
2210            self
2211        }
2212
2213        /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
2214        ///
2215        /// This is a **required** field for requests.
2216        pub fn set_address_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2217            self.0.request.address_group_id = v.into();
2218            self
2219        }
2220
2221        /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
2222        ///
2223        /// This is a **required** field for requests.
2224        pub fn set_address_group<T>(mut self, v: T) -> Self
2225        where
2226            T: std::convert::Into<crate::model::AddressGroup>,
2227        {
2228            self.0.request.address_group = std::option::Option::Some(v.into());
2229            self
2230        }
2231
2232        /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
2233        ///
2234        /// This is a **required** field for requests.
2235        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2236        where
2237            T: std::convert::Into<crate::model::AddressGroup>,
2238        {
2239            self.0.request.address_group = v.map(|x| x.into());
2240            self
2241        }
2242
2243        /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
2244        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2245            self.0.request.request_id = v.into();
2246            self
2247        }
2248    }
2249
2250    #[doc(hidden)]
2251    impl gax::options::internal::RequestBuilder for CreateAddressGroup {
2252        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2253            &mut self.0.options
2254        }
2255    }
2256
2257    /// The request builder for [OrganizationAddressGroupService::update_address_group][crate::client::OrganizationAddressGroupService::update_address_group] calls.
2258    ///
2259    /// # Example
2260    /// ```no_run
2261    /// # use google_cloud_networksecurity_v1::builder;
2262    /// use builder::organization_address_group_service::UpdateAddressGroup;
2263    /// # tokio_test::block_on(async {
2264    /// use lro::Poller;
2265    ///
2266    /// let builder = prepare_request_builder();
2267    /// let response = builder.poller().until_done().await?;
2268    /// # gax::Result::<()>::Ok(()) });
2269    ///
2270    /// fn prepare_request_builder() -> UpdateAddressGroup {
2271    ///   # panic!();
2272    ///   // ... details omitted ...
2273    /// }
2274    /// ```
2275    #[derive(Clone, Debug)]
2276    pub struct UpdateAddressGroup(RequestBuilder<crate::model::UpdateAddressGroupRequest>);
2277
2278    impl UpdateAddressGroup {
2279        pub(crate) fn new(
2280            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2281        ) -> Self {
2282            Self(RequestBuilder::new(stub))
2283        }
2284
2285        /// Sets the full request, replacing any prior values.
2286        pub fn with_request<V: Into<crate::model::UpdateAddressGroupRequest>>(
2287            mut self,
2288            v: V,
2289        ) -> Self {
2290            self.0.request = v.into();
2291            self
2292        }
2293
2294        /// Sets all the options, replacing any prior values.
2295        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2296            self.0.options = v.into();
2297            self
2298        }
2299
2300        /// Sends the request.
2301        ///
2302        /// # Long running operations
2303        ///
2304        /// This starts, but does not poll, a longrunning operation. More information
2305        /// on [update_address_group][crate::client::OrganizationAddressGroupService::update_address_group].
2306        pub async fn send(self) -> Result<longrunning::model::Operation> {
2307            (*self.0.stub)
2308                .update_address_group(self.0.request, self.0.options)
2309                .await
2310                .map(gax::response::Response::into_body)
2311        }
2312
2313        /// Creates a [Poller][lro::Poller] to work with `update_address_group`.
2314        pub fn poller(
2315            self,
2316        ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2317            type Operation = lro::internal::Operation<
2318                crate::model::AddressGroup,
2319                crate::model::OperationMetadata,
2320            >;
2321            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2322            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2323
2324            let stub = self.0.stub.clone();
2325            let mut options = self.0.options.clone();
2326            options.set_retry_policy(gax::retry_policy::NeverRetry);
2327            let query = move |name| {
2328                let stub = stub.clone();
2329                let options = options.clone();
2330                async {
2331                    let op = GetOperation::new(stub)
2332                        .set_name(name)
2333                        .with_options(options)
2334                        .send()
2335                        .await?;
2336                    Ok(Operation::new(op))
2337                }
2338            };
2339
2340            let start = move || async {
2341                let op = self.send().await?;
2342                Ok(Operation::new(op))
2343            };
2344
2345            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2346        }
2347
2348        /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
2349        pub fn set_update_mask<T>(mut self, v: T) -> Self
2350        where
2351            T: std::convert::Into<wkt::FieldMask>,
2352        {
2353            self.0.request.update_mask = std::option::Option::Some(v.into());
2354            self
2355        }
2356
2357        /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
2358        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2359        where
2360            T: std::convert::Into<wkt::FieldMask>,
2361        {
2362            self.0.request.update_mask = v.map(|x| x.into());
2363            self
2364        }
2365
2366        /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
2367        ///
2368        /// This is a **required** field for requests.
2369        pub fn set_address_group<T>(mut self, v: T) -> Self
2370        where
2371            T: std::convert::Into<crate::model::AddressGroup>,
2372        {
2373            self.0.request.address_group = std::option::Option::Some(v.into());
2374            self
2375        }
2376
2377        /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
2378        ///
2379        /// This is a **required** field for requests.
2380        pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
2381        where
2382            T: std::convert::Into<crate::model::AddressGroup>,
2383        {
2384            self.0.request.address_group = v.map(|x| x.into());
2385            self
2386        }
2387
2388        /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
2389        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2390            self.0.request.request_id = v.into();
2391            self
2392        }
2393    }
2394
2395    #[doc(hidden)]
2396    impl gax::options::internal::RequestBuilder for UpdateAddressGroup {
2397        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2398            &mut self.0.options
2399        }
2400    }
2401
2402    /// The request builder for [OrganizationAddressGroupService::add_address_group_items][crate::client::OrganizationAddressGroupService::add_address_group_items] calls.
2403    ///
2404    /// # Example
2405    /// ```no_run
2406    /// # use google_cloud_networksecurity_v1::builder;
2407    /// use builder::organization_address_group_service::AddAddressGroupItems;
2408    /// # tokio_test::block_on(async {
2409    /// use lro::Poller;
2410    ///
2411    /// let builder = prepare_request_builder();
2412    /// let response = builder.poller().until_done().await?;
2413    /// # gax::Result::<()>::Ok(()) });
2414    ///
2415    /// fn prepare_request_builder() -> AddAddressGroupItems {
2416    ///   # panic!();
2417    ///   // ... details omitted ...
2418    /// }
2419    /// ```
2420    #[derive(Clone, Debug)]
2421    pub struct AddAddressGroupItems(RequestBuilder<crate::model::AddAddressGroupItemsRequest>);
2422
2423    impl AddAddressGroupItems {
2424        pub(crate) fn new(
2425            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2426        ) -> Self {
2427            Self(RequestBuilder::new(stub))
2428        }
2429
2430        /// Sets the full request, replacing any prior values.
2431        pub fn with_request<V: Into<crate::model::AddAddressGroupItemsRequest>>(
2432            mut self,
2433            v: V,
2434        ) -> Self {
2435            self.0.request = v.into();
2436            self
2437        }
2438
2439        /// Sets all the options, replacing any prior values.
2440        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2441            self.0.options = v.into();
2442            self
2443        }
2444
2445        /// Sends the request.
2446        ///
2447        /// # Long running operations
2448        ///
2449        /// This starts, but does not poll, a longrunning operation. More information
2450        /// on [add_address_group_items][crate::client::OrganizationAddressGroupService::add_address_group_items].
2451        pub async fn send(self) -> Result<longrunning::model::Operation> {
2452            (*self.0.stub)
2453                .add_address_group_items(self.0.request, self.0.options)
2454                .await
2455                .map(gax::response::Response::into_body)
2456        }
2457
2458        /// Creates a [Poller][lro::Poller] to work with `add_address_group_items`.
2459        pub fn poller(
2460            self,
2461        ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2462            type Operation = lro::internal::Operation<
2463                crate::model::AddressGroup,
2464                crate::model::OperationMetadata,
2465            >;
2466            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2467            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2468
2469            let stub = self.0.stub.clone();
2470            let mut options = self.0.options.clone();
2471            options.set_retry_policy(gax::retry_policy::NeverRetry);
2472            let query = move |name| {
2473                let stub = stub.clone();
2474                let options = options.clone();
2475                async {
2476                    let op = GetOperation::new(stub)
2477                        .set_name(name)
2478                        .with_options(options)
2479                        .send()
2480                        .await?;
2481                    Ok(Operation::new(op))
2482                }
2483            };
2484
2485            let start = move || async {
2486                let op = self.send().await?;
2487                Ok(Operation::new(op))
2488            };
2489
2490            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2491        }
2492
2493        /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
2494        ///
2495        /// This is a **required** field for requests.
2496        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2497            self.0.request.address_group = v.into();
2498            self
2499        }
2500
2501        /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
2502        ///
2503        /// This is a **required** field for requests.
2504        pub fn set_items<T, V>(mut self, v: T) -> Self
2505        where
2506            T: std::iter::IntoIterator<Item = V>,
2507            V: std::convert::Into<std::string::String>,
2508        {
2509            use std::iter::Iterator;
2510            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2511            self
2512        }
2513
2514        /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
2515        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2516            self.0.request.request_id = v.into();
2517            self
2518        }
2519    }
2520
2521    #[doc(hidden)]
2522    impl gax::options::internal::RequestBuilder for AddAddressGroupItems {
2523        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2524            &mut self.0.options
2525        }
2526    }
2527
2528    /// The request builder for [OrganizationAddressGroupService::remove_address_group_items][crate::client::OrganizationAddressGroupService::remove_address_group_items] calls.
2529    ///
2530    /// # Example
2531    /// ```no_run
2532    /// # use google_cloud_networksecurity_v1::builder;
2533    /// use builder::organization_address_group_service::RemoveAddressGroupItems;
2534    /// # tokio_test::block_on(async {
2535    /// use lro::Poller;
2536    ///
2537    /// let builder = prepare_request_builder();
2538    /// let response = builder.poller().until_done().await?;
2539    /// # gax::Result::<()>::Ok(()) });
2540    ///
2541    /// fn prepare_request_builder() -> RemoveAddressGroupItems {
2542    ///   # panic!();
2543    ///   // ... details omitted ...
2544    /// }
2545    /// ```
2546    #[derive(Clone, Debug)]
2547    pub struct RemoveAddressGroupItems(
2548        RequestBuilder<crate::model::RemoveAddressGroupItemsRequest>,
2549    );
2550
2551    impl RemoveAddressGroupItems {
2552        pub(crate) fn new(
2553            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2554        ) -> Self {
2555            Self(RequestBuilder::new(stub))
2556        }
2557
2558        /// Sets the full request, replacing any prior values.
2559        pub fn with_request<V: Into<crate::model::RemoveAddressGroupItemsRequest>>(
2560            mut self,
2561            v: V,
2562        ) -> Self {
2563            self.0.request = v.into();
2564            self
2565        }
2566
2567        /// Sets all the options, replacing any prior values.
2568        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2569            self.0.options = v.into();
2570            self
2571        }
2572
2573        /// Sends the request.
2574        ///
2575        /// # Long running operations
2576        ///
2577        /// This starts, but does not poll, a longrunning operation. More information
2578        /// on [remove_address_group_items][crate::client::OrganizationAddressGroupService::remove_address_group_items].
2579        pub async fn send(self) -> Result<longrunning::model::Operation> {
2580            (*self.0.stub)
2581                .remove_address_group_items(self.0.request, self.0.options)
2582                .await
2583                .map(gax::response::Response::into_body)
2584        }
2585
2586        /// Creates a [Poller][lro::Poller] to work with `remove_address_group_items`.
2587        pub fn poller(
2588            self,
2589        ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2590            type Operation = lro::internal::Operation<
2591                crate::model::AddressGroup,
2592                crate::model::OperationMetadata,
2593            >;
2594            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2595            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2596
2597            let stub = self.0.stub.clone();
2598            let mut options = self.0.options.clone();
2599            options.set_retry_policy(gax::retry_policy::NeverRetry);
2600            let query = move |name| {
2601                let stub = stub.clone();
2602                let options = options.clone();
2603                async {
2604                    let op = GetOperation::new(stub)
2605                        .set_name(name)
2606                        .with_options(options)
2607                        .send()
2608                        .await?;
2609                    Ok(Operation::new(op))
2610                }
2611            };
2612
2613            let start = move || async {
2614                let op = self.send().await?;
2615                Ok(Operation::new(op))
2616            };
2617
2618            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2619        }
2620
2621        /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
2622        ///
2623        /// This is a **required** field for requests.
2624        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2625            self.0.request.address_group = v.into();
2626            self
2627        }
2628
2629        /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
2630        ///
2631        /// This is a **required** field for requests.
2632        pub fn set_items<T, V>(mut self, v: T) -> Self
2633        where
2634            T: std::iter::IntoIterator<Item = V>,
2635            V: std::convert::Into<std::string::String>,
2636        {
2637            use std::iter::Iterator;
2638            self.0.request.items = v.into_iter().map(|i| i.into()).collect();
2639            self
2640        }
2641
2642        /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
2643        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2644            self.0.request.request_id = v.into();
2645            self
2646        }
2647    }
2648
2649    #[doc(hidden)]
2650    impl gax::options::internal::RequestBuilder for RemoveAddressGroupItems {
2651        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2652            &mut self.0.options
2653        }
2654    }
2655
2656    /// The request builder for [OrganizationAddressGroupService::clone_address_group_items][crate::client::OrganizationAddressGroupService::clone_address_group_items] calls.
2657    ///
2658    /// # Example
2659    /// ```no_run
2660    /// # use google_cloud_networksecurity_v1::builder;
2661    /// use builder::organization_address_group_service::CloneAddressGroupItems;
2662    /// # tokio_test::block_on(async {
2663    /// use lro::Poller;
2664    ///
2665    /// let builder = prepare_request_builder();
2666    /// let response = builder.poller().until_done().await?;
2667    /// # gax::Result::<()>::Ok(()) });
2668    ///
2669    /// fn prepare_request_builder() -> CloneAddressGroupItems {
2670    ///   # panic!();
2671    ///   // ... details omitted ...
2672    /// }
2673    /// ```
2674    #[derive(Clone, Debug)]
2675    pub struct CloneAddressGroupItems(RequestBuilder<crate::model::CloneAddressGroupItemsRequest>);
2676
2677    impl CloneAddressGroupItems {
2678        pub(crate) fn new(
2679            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2680        ) -> Self {
2681            Self(RequestBuilder::new(stub))
2682        }
2683
2684        /// Sets the full request, replacing any prior values.
2685        pub fn with_request<V: Into<crate::model::CloneAddressGroupItemsRequest>>(
2686            mut self,
2687            v: V,
2688        ) -> Self {
2689            self.0.request = v.into();
2690            self
2691        }
2692
2693        /// Sets all the options, replacing any prior values.
2694        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2695            self.0.options = v.into();
2696            self
2697        }
2698
2699        /// Sends the request.
2700        ///
2701        /// # Long running operations
2702        ///
2703        /// This starts, but does not poll, a longrunning operation. More information
2704        /// on [clone_address_group_items][crate::client::OrganizationAddressGroupService::clone_address_group_items].
2705        pub async fn send(self) -> Result<longrunning::model::Operation> {
2706            (*self.0.stub)
2707                .clone_address_group_items(self.0.request, self.0.options)
2708                .await
2709                .map(gax::response::Response::into_body)
2710        }
2711
2712        /// Creates a [Poller][lro::Poller] to work with `clone_address_group_items`.
2713        pub fn poller(
2714            self,
2715        ) -> impl lro::Poller<crate::model::AddressGroup, crate::model::OperationMetadata> {
2716            type Operation = lro::internal::Operation<
2717                crate::model::AddressGroup,
2718                crate::model::OperationMetadata,
2719            >;
2720            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2721            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2722
2723            let stub = self.0.stub.clone();
2724            let mut options = self.0.options.clone();
2725            options.set_retry_policy(gax::retry_policy::NeverRetry);
2726            let query = move |name| {
2727                let stub = stub.clone();
2728                let options = options.clone();
2729                async {
2730                    let op = GetOperation::new(stub)
2731                        .set_name(name)
2732                        .with_options(options)
2733                        .send()
2734                        .await?;
2735                    Ok(Operation::new(op))
2736                }
2737            };
2738
2739            let start = move || async {
2740                let op = self.send().await?;
2741                Ok(Operation::new(op))
2742            };
2743
2744            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2745        }
2746
2747        /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
2748        ///
2749        /// This is a **required** field for requests.
2750        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2751            self.0.request.address_group = v.into();
2752            self
2753        }
2754
2755        /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
2756        ///
2757        /// This is a **required** field for requests.
2758        pub fn set_source_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2759            self.0.request.source_address_group = v.into();
2760            self
2761        }
2762
2763        /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
2764        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2765            self.0.request.request_id = v.into();
2766            self
2767        }
2768    }
2769
2770    #[doc(hidden)]
2771    impl gax::options::internal::RequestBuilder for CloneAddressGroupItems {
2772        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2773            &mut self.0.options
2774        }
2775    }
2776
2777    /// The request builder for [OrganizationAddressGroupService::delete_address_group][crate::client::OrganizationAddressGroupService::delete_address_group] calls.
2778    ///
2779    /// # Example
2780    /// ```no_run
2781    /// # use google_cloud_networksecurity_v1::builder;
2782    /// use builder::organization_address_group_service::DeleteAddressGroup;
2783    /// # tokio_test::block_on(async {
2784    /// use lro::Poller;
2785    ///
2786    /// let builder = prepare_request_builder();
2787    /// let response = builder.poller().until_done().await?;
2788    /// # gax::Result::<()>::Ok(()) });
2789    ///
2790    /// fn prepare_request_builder() -> DeleteAddressGroup {
2791    ///   # panic!();
2792    ///   // ... details omitted ...
2793    /// }
2794    /// ```
2795    #[derive(Clone, Debug)]
2796    pub struct DeleteAddressGroup(RequestBuilder<crate::model::DeleteAddressGroupRequest>);
2797
2798    impl DeleteAddressGroup {
2799        pub(crate) fn new(
2800            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2801        ) -> Self {
2802            Self(RequestBuilder::new(stub))
2803        }
2804
2805        /// Sets the full request, replacing any prior values.
2806        pub fn with_request<V: Into<crate::model::DeleteAddressGroupRequest>>(
2807            mut self,
2808            v: V,
2809        ) -> Self {
2810            self.0.request = v.into();
2811            self
2812        }
2813
2814        /// Sets all the options, replacing any prior values.
2815        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2816            self.0.options = v.into();
2817            self
2818        }
2819
2820        /// Sends the request.
2821        ///
2822        /// # Long running operations
2823        ///
2824        /// This starts, but does not poll, a longrunning operation. More information
2825        /// on [delete_address_group][crate::client::OrganizationAddressGroupService::delete_address_group].
2826        pub async fn send(self) -> Result<longrunning::model::Operation> {
2827            (*self.0.stub)
2828                .delete_address_group(self.0.request, self.0.options)
2829                .await
2830                .map(gax::response::Response::into_body)
2831        }
2832
2833        /// Creates a [Poller][lro::Poller] to work with `delete_address_group`.
2834        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2835            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2836            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2837            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2838
2839            let stub = self.0.stub.clone();
2840            let mut options = self.0.options.clone();
2841            options.set_retry_policy(gax::retry_policy::NeverRetry);
2842            let query = move |name| {
2843                let stub = stub.clone();
2844                let options = options.clone();
2845                async {
2846                    let op = GetOperation::new(stub)
2847                        .set_name(name)
2848                        .with_options(options)
2849                        .send()
2850                        .await?;
2851                    Ok(Operation::new(op))
2852                }
2853            };
2854
2855            let start = move || async {
2856                let op = self.send().await?;
2857                Ok(Operation::new(op))
2858            };
2859
2860            lro::internal::new_unit_response_poller(
2861                polling_error_policy,
2862                polling_backoff_policy,
2863                start,
2864                query,
2865            )
2866        }
2867
2868        /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
2869        ///
2870        /// This is a **required** field for requests.
2871        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2872            self.0.request.name = v.into();
2873            self
2874        }
2875
2876        /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
2877        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2878            self.0.request.request_id = v.into();
2879            self
2880        }
2881    }
2882
2883    #[doc(hidden)]
2884    impl gax::options::internal::RequestBuilder for DeleteAddressGroup {
2885        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2886            &mut self.0.options
2887        }
2888    }
2889
2890    /// The request builder for [OrganizationAddressGroupService::list_address_group_references][crate::client::OrganizationAddressGroupService::list_address_group_references] calls.
2891    ///
2892    /// # Example
2893    /// ```no_run
2894    /// # use google_cloud_networksecurity_v1::builder;
2895    /// use builder::organization_address_group_service::ListAddressGroupReferences;
2896    /// # tokio_test::block_on(async {
2897    /// use gax::paginator::ItemPaginator;
2898    ///
2899    /// let builder = prepare_request_builder();
2900    /// let mut items = builder.by_item();
2901    /// while let Some(result) = items.next().await {
2902    ///   let item = result?;
2903    /// }
2904    /// # gax::Result::<()>::Ok(()) });
2905    ///
2906    /// fn prepare_request_builder() -> ListAddressGroupReferences {
2907    ///   # panic!();
2908    ///   // ... details omitted ...
2909    /// }
2910    /// ```
2911    #[derive(Clone, Debug)]
2912    pub struct ListAddressGroupReferences(
2913        RequestBuilder<crate::model::ListAddressGroupReferencesRequest>,
2914    );
2915
2916    impl ListAddressGroupReferences {
2917        pub(crate) fn new(
2918            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
2919        ) -> Self {
2920            Self(RequestBuilder::new(stub))
2921        }
2922
2923        /// Sets the full request, replacing any prior values.
2924        pub fn with_request<V: Into<crate::model::ListAddressGroupReferencesRequest>>(
2925            mut self,
2926            v: V,
2927        ) -> Self {
2928            self.0.request = v.into();
2929            self
2930        }
2931
2932        /// Sets all the options, replacing any prior values.
2933        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2934            self.0.options = v.into();
2935            self
2936        }
2937
2938        /// Sends the request.
2939        pub async fn send(self) -> Result<crate::model::ListAddressGroupReferencesResponse> {
2940            (*self.0.stub)
2941                .list_address_group_references(self.0.request, self.0.options)
2942                .await
2943                .map(gax::response::Response::into_body)
2944        }
2945
2946        /// Streams each page in the collection.
2947        pub fn by_page(
2948            self,
2949        ) -> impl gax::paginator::Paginator<
2950            crate::model::ListAddressGroupReferencesResponse,
2951            gax::error::Error,
2952        > {
2953            use std::clone::Clone;
2954            let token = self.0.request.page_token.clone();
2955            let execute = move |token: String| {
2956                let mut builder = self.clone();
2957                builder.0.request = builder.0.request.set_page_token(token);
2958                builder.send()
2959            };
2960            gax::paginator::internal::new_paginator(token, execute)
2961        }
2962
2963        /// Streams each item in the collection.
2964        pub fn by_item(
2965            self,
2966        ) -> impl gax::paginator::ItemPaginator<
2967            crate::model::ListAddressGroupReferencesResponse,
2968            gax::error::Error,
2969        > {
2970            use gax::paginator::Paginator;
2971            self.by_page().items()
2972        }
2973
2974        /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
2975        ///
2976        /// This is a **required** field for requests.
2977        pub fn set_address_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
2978            self.0.request.address_group = v.into();
2979            self
2980        }
2981
2982        /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
2983        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2984            self.0.request.page_size = v.into();
2985            self
2986        }
2987
2988        /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
2989        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2990            self.0.request.page_token = v.into();
2991            self
2992        }
2993    }
2994
2995    #[doc(hidden)]
2996    impl gax::options::internal::RequestBuilder for ListAddressGroupReferences {
2997        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2998            &mut self.0.options
2999        }
3000    }
3001
3002    /// The request builder for [OrganizationAddressGroupService::list_locations][crate::client::OrganizationAddressGroupService::list_locations] calls.
3003    ///
3004    /// # Example
3005    /// ```no_run
3006    /// # use google_cloud_networksecurity_v1::builder;
3007    /// use builder::organization_address_group_service::ListLocations;
3008    /// # tokio_test::block_on(async {
3009    /// use gax::paginator::ItemPaginator;
3010    ///
3011    /// let builder = prepare_request_builder();
3012    /// let mut items = builder.by_item();
3013    /// while let Some(result) = items.next().await {
3014    ///   let item = result?;
3015    /// }
3016    /// # gax::Result::<()>::Ok(()) });
3017    ///
3018    /// fn prepare_request_builder() -> ListLocations {
3019    ///   # panic!();
3020    ///   // ... details omitted ...
3021    /// }
3022    /// ```
3023    #[derive(Clone, Debug)]
3024    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
3025
3026    impl ListLocations {
3027        pub(crate) fn new(
3028            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3029        ) -> Self {
3030            Self(RequestBuilder::new(stub))
3031        }
3032
3033        /// Sets the full request, replacing any prior values.
3034        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3035            mut self,
3036            v: V,
3037        ) -> Self {
3038            self.0.request = v.into();
3039            self
3040        }
3041
3042        /// Sets all the options, replacing any prior values.
3043        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3044            self.0.options = v.into();
3045            self
3046        }
3047
3048        /// Sends the request.
3049        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3050            (*self.0.stub)
3051                .list_locations(self.0.request, self.0.options)
3052                .await
3053                .map(gax::response::Response::into_body)
3054        }
3055
3056        /// Streams each page in the collection.
3057        pub fn by_page(
3058            self,
3059        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3060        {
3061            use std::clone::Clone;
3062            let token = self.0.request.page_token.clone();
3063            let execute = move |token: String| {
3064                let mut builder = self.clone();
3065                builder.0.request = builder.0.request.set_page_token(token);
3066                builder.send()
3067            };
3068            gax::paginator::internal::new_paginator(token, execute)
3069        }
3070
3071        /// Streams each item in the collection.
3072        pub fn by_item(
3073            self,
3074        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3075        {
3076            use gax::paginator::Paginator;
3077            self.by_page().items()
3078        }
3079
3080        /// Sets the value of [name][location::model::ListLocationsRequest::name].
3081        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3082            self.0.request.name = v.into();
3083            self
3084        }
3085
3086        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
3087        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3088            self.0.request.filter = v.into();
3089            self
3090        }
3091
3092        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
3093        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3094            self.0.request.page_size = v.into();
3095            self
3096        }
3097
3098        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
3099        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3100            self.0.request.page_token = v.into();
3101            self
3102        }
3103    }
3104
3105    #[doc(hidden)]
3106    impl gax::options::internal::RequestBuilder for ListLocations {
3107        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3108            &mut self.0.options
3109        }
3110    }
3111
3112    /// The request builder for [OrganizationAddressGroupService::get_location][crate::client::OrganizationAddressGroupService::get_location] calls.
3113    ///
3114    /// # Example
3115    /// ```no_run
3116    /// # use google_cloud_networksecurity_v1::builder;
3117    /// use builder::organization_address_group_service::GetLocation;
3118    /// # tokio_test::block_on(async {
3119    ///
3120    /// let builder = prepare_request_builder();
3121    /// let response = builder.send().await?;
3122    /// # gax::Result::<()>::Ok(()) });
3123    ///
3124    /// fn prepare_request_builder() -> GetLocation {
3125    ///   # panic!();
3126    ///   // ... details omitted ...
3127    /// }
3128    /// ```
3129    #[derive(Clone, Debug)]
3130    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3131
3132    impl GetLocation {
3133        pub(crate) fn new(
3134            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3135        ) -> Self {
3136            Self(RequestBuilder::new(stub))
3137        }
3138
3139        /// Sets the full request, replacing any prior values.
3140        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3141            self.0.request = v.into();
3142            self
3143        }
3144
3145        /// Sets all the options, replacing any prior values.
3146        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3147            self.0.options = v.into();
3148            self
3149        }
3150
3151        /// Sends the request.
3152        pub async fn send(self) -> Result<location::model::Location> {
3153            (*self.0.stub)
3154                .get_location(self.0.request, self.0.options)
3155                .await
3156                .map(gax::response::Response::into_body)
3157        }
3158
3159        /// Sets the value of [name][location::model::GetLocationRequest::name].
3160        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3161            self.0.request.name = v.into();
3162            self
3163        }
3164    }
3165
3166    #[doc(hidden)]
3167    impl gax::options::internal::RequestBuilder for GetLocation {
3168        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3169            &mut self.0.options
3170        }
3171    }
3172
3173    /// The request builder for [OrganizationAddressGroupService::set_iam_policy][crate::client::OrganizationAddressGroupService::set_iam_policy] calls.
3174    ///
3175    /// # Example
3176    /// ```no_run
3177    /// # use google_cloud_networksecurity_v1::builder;
3178    /// use builder::organization_address_group_service::SetIamPolicy;
3179    /// # tokio_test::block_on(async {
3180    ///
3181    /// let builder = prepare_request_builder();
3182    /// let response = builder.send().await?;
3183    /// # gax::Result::<()>::Ok(()) });
3184    ///
3185    /// fn prepare_request_builder() -> SetIamPolicy {
3186    ///   # panic!();
3187    ///   // ... details omitted ...
3188    /// }
3189    /// ```
3190    #[derive(Clone, Debug)]
3191    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
3192
3193    impl SetIamPolicy {
3194        pub(crate) fn new(
3195            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3196        ) -> Self {
3197            Self(RequestBuilder::new(stub))
3198        }
3199
3200        /// Sets the full request, replacing any prior values.
3201        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
3202            self.0.request = v.into();
3203            self
3204        }
3205
3206        /// Sets all the options, replacing any prior values.
3207        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3208            self.0.options = v.into();
3209            self
3210        }
3211
3212        /// Sends the request.
3213        pub async fn send(self) -> Result<iam_v1::model::Policy> {
3214            (*self.0.stub)
3215                .set_iam_policy(self.0.request, self.0.options)
3216                .await
3217                .map(gax::response::Response::into_body)
3218        }
3219
3220        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
3221        ///
3222        /// This is a **required** field for requests.
3223        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3224            self.0.request.resource = v.into();
3225            self
3226        }
3227
3228        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
3229        ///
3230        /// This is a **required** field for requests.
3231        pub fn set_policy<T>(mut self, v: T) -> Self
3232        where
3233            T: std::convert::Into<iam_v1::model::Policy>,
3234        {
3235            self.0.request.policy = std::option::Option::Some(v.into());
3236            self
3237        }
3238
3239        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
3240        ///
3241        /// This is a **required** field for requests.
3242        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3243        where
3244            T: std::convert::Into<iam_v1::model::Policy>,
3245        {
3246            self.0.request.policy = v.map(|x| x.into());
3247            self
3248        }
3249
3250        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
3251        pub fn set_update_mask<T>(mut self, v: T) -> Self
3252        where
3253            T: std::convert::Into<wkt::FieldMask>,
3254        {
3255            self.0.request.update_mask = std::option::Option::Some(v.into());
3256            self
3257        }
3258
3259        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
3260        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3261        where
3262            T: std::convert::Into<wkt::FieldMask>,
3263        {
3264            self.0.request.update_mask = v.map(|x| x.into());
3265            self
3266        }
3267    }
3268
3269    #[doc(hidden)]
3270    impl gax::options::internal::RequestBuilder for SetIamPolicy {
3271        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3272            &mut self.0.options
3273        }
3274    }
3275
3276    /// The request builder for [OrganizationAddressGroupService::get_iam_policy][crate::client::OrganizationAddressGroupService::get_iam_policy] calls.
3277    ///
3278    /// # Example
3279    /// ```no_run
3280    /// # use google_cloud_networksecurity_v1::builder;
3281    /// use builder::organization_address_group_service::GetIamPolicy;
3282    /// # tokio_test::block_on(async {
3283    ///
3284    /// let builder = prepare_request_builder();
3285    /// let response = builder.send().await?;
3286    /// # gax::Result::<()>::Ok(()) });
3287    ///
3288    /// fn prepare_request_builder() -> GetIamPolicy {
3289    ///   # panic!();
3290    ///   // ... details omitted ...
3291    /// }
3292    /// ```
3293    #[derive(Clone, Debug)]
3294    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
3295
3296    impl GetIamPolicy {
3297        pub(crate) fn new(
3298            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3299        ) -> Self {
3300            Self(RequestBuilder::new(stub))
3301        }
3302
3303        /// Sets the full request, replacing any prior values.
3304        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
3305            self.0.request = v.into();
3306            self
3307        }
3308
3309        /// Sets all the options, replacing any prior values.
3310        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3311            self.0.options = v.into();
3312            self
3313        }
3314
3315        /// Sends the request.
3316        pub async fn send(self) -> Result<iam_v1::model::Policy> {
3317            (*self.0.stub)
3318                .get_iam_policy(self.0.request, self.0.options)
3319                .await
3320                .map(gax::response::Response::into_body)
3321        }
3322
3323        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
3324        ///
3325        /// This is a **required** field for requests.
3326        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3327            self.0.request.resource = v.into();
3328            self
3329        }
3330
3331        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
3332        pub fn set_options<T>(mut self, v: T) -> Self
3333        where
3334            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3335        {
3336            self.0.request.options = std::option::Option::Some(v.into());
3337            self
3338        }
3339
3340        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
3341        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3342        where
3343            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3344        {
3345            self.0.request.options = v.map(|x| x.into());
3346            self
3347        }
3348    }
3349
3350    #[doc(hidden)]
3351    impl gax::options::internal::RequestBuilder for GetIamPolicy {
3352        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3353            &mut self.0.options
3354        }
3355    }
3356
3357    /// The request builder for [OrganizationAddressGroupService::test_iam_permissions][crate::client::OrganizationAddressGroupService::test_iam_permissions] calls.
3358    ///
3359    /// # Example
3360    /// ```no_run
3361    /// # use google_cloud_networksecurity_v1::builder;
3362    /// use builder::organization_address_group_service::TestIamPermissions;
3363    /// # tokio_test::block_on(async {
3364    ///
3365    /// let builder = prepare_request_builder();
3366    /// let response = builder.send().await?;
3367    /// # gax::Result::<()>::Ok(()) });
3368    ///
3369    /// fn prepare_request_builder() -> TestIamPermissions {
3370    ///   # panic!();
3371    ///   // ... details omitted ...
3372    /// }
3373    /// ```
3374    #[derive(Clone, Debug)]
3375    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
3376
3377    impl TestIamPermissions {
3378        pub(crate) fn new(
3379            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3380        ) -> Self {
3381            Self(RequestBuilder::new(stub))
3382        }
3383
3384        /// Sets the full request, replacing any prior values.
3385        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
3386            mut self,
3387            v: V,
3388        ) -> Self {
3389            self.0.request = v.into();
3390            self
3391        }
3392
3393        /// Sets all the options, replacing any prior values.
3394        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3395            self.0.options = v.into();
3396            self
3397        }
3398
3399        /// Sends the request.
3400        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
3401            (*self.0.stub)
3402                .test_iam_permissions(self.0.request, self.0.options)
3403                .await
3404                .map(gax::response::Response::into_body)
3405        }
3406
3407        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
3408        ///
3409        /// This is a **required** field for requests.
3410        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3411            self.0.request.resource = v.into();
3412            self
3413        }
3414
3415        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
3416        ///
3417        /// This is a **required** field for requests.
3418        pub fn set_permissions<T, V>(mut self, v: T) -> Self
3419        where
3420            T: std::iter::IntoIterator<Item = V>,
3421            V: std::convert::Into<std::string::String>,
3422        {
3423            use std::iter::Iterator;
3424            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3425            self
3426        }
3427    }
3428
3429    #[doc(hidden)]
3430    impl gax::options::internal::RequestBuilder for TestIamPermissions {
3431        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3432            &mut self.0.options
3433        }
3434    }
3435
3436    /// The request builder for [OrganizationAddressGroupService::list_operations][crate::client::OrganizationAddressGroupService::list_operations] calls.
3437    ///
3438    /// # Example
3439    /// ```no_run
3440    /// # use google_cloud_networksecurity_v1::builder;
3441    /// use builder::organization_address_group_service::ListOperations;
3442    /// # tokio_test::block_on(async {
3443    /// use gax::paginator::ItemPaginator;
3444    ///
3445    /// let builder = prepare_request_builder();
3446    /// let mut items = builder.by_item();
3447    /// while let Some(result) = items.next().await {
3448    ///   let item = result?;
3449    /// }
3450    /// # gax::Result::<()>::Ok(()) });
3451    ///
3452    /// fn prepare_request_builder() -> ListOperations {
3453    ///   # panic!();
3454    ///   // ... details omitted ...
3455    /// }
3456    /// ```
3457    #[derive(Clone, Debug)]
3458    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3459
3460    impl ListOperations {
3461        pub(crate) fn new(
3462            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3463        ) -> Self {
3464            Self(RequestBuilder::new(stub))
3465        }
3466
3467        /// Sets the full request, replacing any prior values.
3468        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3469            mut self,
3470            v: V,
3471        ) -> Self {
3472            self.0.request = v.into();
3473            self
3474        }
3475
3476        /// Sets all the options, replacing any prior values.
3477        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3478            self.0.options = v.into();
3479            self
3480        }
3481
3482        /// Sends the request.
3483        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3484            (*self.0.stub)
3485                .list_operations(self.0.request, self.0.options)
3486                .await
3487                .map(gax::response::Response::into_body)
3488        }
3489
3490        /// Streams each page in the collection.
3491        pub fn by_page(
3492            self,
3493        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3494        {
3495            use std::clone::Clone;
3496            let token = self.0.request.page_token.clone();
3497            let execute = move |token: String| {
3498                let mut builder = self.clone();
3499                builder.0.request = builder.0.request.set_page_token(token);
3500                builder.send()
3501            };
3502            gax::paginator::internal::new_paginator(token, execute)
3503        }
3504
3505        /// Streams each item in the collection.
3506        pub fn by_item(
3507            self,
3508        ) -> impl gax::paginator::ItemPaginator<
3509            longrunning::model::ListOperationsResponse,
3510            gax::error::Error,
3511        > {
3512            use gax::paginator::Paginator;
3513            self.by_page().items()
3514        }
3515
3516        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
3517        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3518            self.0.request.name = v.into();
3519            self
3520        }
3521
3522        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
3523        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3524            self.0.request.filter = v.into();
3525            self
3526        }
3527
3528        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
3529        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3530            self.0.request.page_size = v.into();
3531            self
3532        }
3533
3534        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
3535        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3536            self.0.request.page_token = v.into();
3537            self
3538        }
3539
3540        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
3541        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3542            self.0.request.return_partial_success = v.into();
3543            self
3544        }
3545    }
3546
3547    #[doc(hidden)]
3548    impl gax::options::internal::RequestBuilder for ListOperations {
3549        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3550            &mut self.0.options
3551        }
3552    }
3553
3554    /// The request builder for [OrganizationAddressGroupService::get_operation][crate::client::OrganizationAddressGroupService::get_operation] calls.
3555    ///
3556    /// # Example
3557    /// ```no_run
3558    /// # use google_cloud_networksecurity_v1::builder;
3559    /// use builder::organization_address_group_service::GetOperation;
3560    /// # tokio_test::block_on(async {
3561    ///
3562    /// let builder = prepare_request_builder();
3563    /// let response = builder.send().await?;
3564    /// # gax::Result::<()>::Ok(()) });
3565    ///
3566    /// fn prepare_request_builder() -> GetOperation {
3567    ///   # panic!();
3568    ///   // ... details omitted ...
3569    /// }
3570    /// ```
3571    #[derive(Clone, Debug)]
3572    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3573
3574    impl GetOperation {
3575        pub(crate) fn new(
3576            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3577        ) -> Self {
3578            Self(RequestBuilder::new(stub))
3579        }
3580
3581        /// Sets the full request, replacing any prior values.
3582        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3583            mut self,
3584            v: V,
3585        ) -> Self {
3586            self.0.request = v.into();
3587            self
3588        }
3589
3590        /// Sets all the options, replacing any prior values.
3591        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3592            self.0.options = v.into();
3593            self
3594        }
3595
3596        /// Sends the request.
3597        pub async fn send(self) -> Result<longrunning::model::Operation> {
3598            (*self.0.stub)
3599                .get_operation(self.0.request, self.0.options)
3600                .await
3601                .map(gax::response::Response::into_body)
3602        }
3603
3604        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
3605        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3606            self.0.request.name = v.into();
3607            self
3608        }
3609    }
3610
3611    #[doc(hidden)]
3612    impl gax::options::internal::RequestBuilder for GetOperation {
3613        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3614            &mut self.0.options
3615        }
3616    }
3617
3618    /// The request builder for [OrganizationAddressGroupService::delete_operation][crate::client::OrganizationAddressGroupService::delete_operation] calls.
3619    ///
3620    /// # Example
3621    /// ```no_run
3622    /// # use google_cloud_networksecurity_v1::builder;
3623    /// use builder::organization_address_group_service::DeleteOperation;
3624    /// # tokio_test::block_on(async {
3625    ///
3626    /// let builder = prepare_request_builder();
3627    /// let response = builder.send().await?;
3628    /// # gax::Result::<()>::Ok(()) });
3629    ///
3630    /// fn prepare_request_builder() -> DeleteOperation {
3631    ///   # panic!();
3632    ///   // ... details omitted ...
3633    /// }
3634    /// ```
3635    #[derive(Clone, Debug)]
3636    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3637
3638    impl DeleteOperation {
3639        pub(crate) fn new(
3640            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3641        ) -> Self {
3642            Self(RequestBuilder::new(stub))
3643        }
3644
3645        /// Sets the full request, replacing any prior values.
3646        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3647            mut self,
3648            v: V,
3649        ) -> Self {
3650            self.0.request = v.into();
3651            self
3652        }
3653
3654        /// Sets all the options, replacing any prior values.
3655        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3656            self.0.options = v.into();
3657            self
3658        }
3659
3660        /// Sends the request.
3661        pub async fn send(self) -> Result<()> {
3662            (*self.0.stub)
3663                .delete_operation(self.0.request, self.0.options)
3664                .await
3665                .map(gax::response::Response::into_body)
3666        }
3667
3668        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
3669        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3670            self.0.request.name = v.into();
3671            self
3672        }
3673    }
3674
3675    #[doc(hidden)]
3676    impl gax::options::internal::RequestBuilder for DeleteOperation {
3677        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3678            &mut self.0.options
3679        }
3680    }
3681
3682    /// The request builder for [OrganizationAddressGroupService::cancel_operation][crate::client::OrganizationAddressGroupService::cancel_operation] calls.
3683    ///
3684    /// # Example
3685    /// ```no_run
3686    /// # use google_cloud_networksecurity_v1::builder;
3687    /// use builder::organization_address_group_service::CancelOperation;
3688    /// # tokio_test::block_on(async {
3689    ///
3690    /// let builder = prepare_request_builder();
3691    /// let response = builder.send().await?;
3692    /// # gax::Result::<()>::Ok(()) });
3693    ///
3694    /// fn prepare_request_builder() -> CancelOperation {
3695    ///   # panic!();
3696    ///   // ... details omitted ...
3697    /// }
3698    /// ```
3699    #[derive(Clone, Debug)]
3700    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3701
3702    impl CancelOperation {
3703        pub(crate) fn new(
3704            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationAddressGroupService>,
3705        ) -> Self {
3706            Self(RequestBuilder::new(stub))
3707        }
3708
3709        /// Sets the full request, replacing any prior values.
3710        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3711            mut self,
3712            v: V,
3713        ) -> Self {
3714            self.0.request = v.into();
3715            self
3716        }
3717
3718        /// Sets all the options, replacing any prior values.
3719        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3720            self.0.options = v.into();
3721            self
3722        }
3723
3724        /// Sends the request.
3725        pub async fn send(self) -> Result<()> {
3726            (*self.0.stub)
3727                .cancel_operation(self.0.request, self.0.options)
3728                .await
3729                .map(gax::response::Response::into_body)
3730        }
3731
3732        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
3733        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3734            self.0.request.name = v.into();
3735            self
3736        }
3737    }
3738
3739    #[doc(hidden)]
3740    impl gax::options::internal::RequestBuilder for CancelOperation {
3741        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3742            &mut self.0.options
3743        }
3744    }
3745}
3746
3747pub mod network_security {
3748    use crate::Result;
3749
3750    /// A builder for [NetworkSecurity][crate::client::NetworkSecurity].
3751    ///
3752    /// ```
3753    /// # tokio_test::block_on(async {
3754    /// # use google_cloud_networksecurity_v1::*;
3755    /// # use builder::network_security::ClientBuilder;
3756    /// # use client::NetworkSecurity;
3757    /// let builder : ClientBuilder = NetworkSecurity::builder();
3758    /// let client = builder
3759    ///     .with_endpoint("https://networksecurity.googleapis.com")
3760    ///     .build().await?;
3761    /// # gax::client_builder::Result::<()>::Ok(()) });
3762    /// ```
3763    pub type ClientBuilder =
3764        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3765
3766    pub(crate) mod client {
3767        use super::super::super::client::NetworkSecurity;
3768        pub struct Factory;
3769        impl gax::client_builder::internal::ClientFactory for Factory {
3770            type Client = NetworkSecurity;
3771            type Credentials = gaxi::options::Credentials;
3772            async fn build(
3773                self,
3774                config: gaxi::options::ClientConfig,
3775            ) -> gax::client_builder::Result<Self::Client> {
3776                Self::Client::new(config).await
3777            }
3778        }
3779    }
3780
3781    /// Common implementation for [crate::client::NetworkSecurity] request builders.
3782    #[derive(Clone, Debug)]
3783    pub(crate) struct RequestBuilder<R: std::default::Default> {
3784        stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3785        request: R,
3786        options: gax::options::RequestOptions,
3787    }
3788
3789    impl<R> RequestBuilder<R>
3790    where
3791        R: std::default::Default,
3792    {
3793        pub(crate) fn new(
3794            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3795        ) -> Self {
3796            Self {
3797                stub,
3798                request: R::default(),
3799                options: gax::options::RequestOptions::default(),
3800            }
3801        }
3802    }
3803
3804    /// The request builder for [NetworkSecurity::list_authorization_policies][crate::client::NetworkSecurity::list_authorization_policies] calls.
3805    ///
3806    /// # Example
3807    /// ```no_run
3808    /// # use google_cloud_networksecurity_v1::builder;
3809    /// use builder::network_security::ListAuthorizationPolicies;
3810    /// # tokio_test::block_on(async {
3811    /// use gax::paginator::ItemPaginator;
3812    ///
3813    /// let builder = prepare_request_builder();
3814    /// let mut items = builder.by_item();
3815    /// while let Some(result) = items.next().await {
3816    ///   let item = result?;
3817    /// }
3818    /// # gax::Result::<()>::Ok(()) });
3819    ///
3820    /// fn prepare_request_builder() -> ListAuthorizationPolicies {
3821    ///   # panic!();
3822    ///   // ... details omitted ...
3823    /// }
3824    /// ```
3825    #[derive(Clone, Debug)]
3826    pub struct ListAuthorizationPolicies(
3827        RequestBuilder<crate::model::ListAuthorizationPoliciesRequest>,
3828    );
3829
3830    impl ListAuthorizationPolicies {
3831        pub(crate) fn new(
3832            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3833        ) -> Self {
3834            Self(RequestBuilder::new(stub))
3835        }
3836
3837        /// Sets the full request, replacing any prior values.
3838        pub fn with_request<V: Into<crate::model::ListAuthorizationPoliciesRequest>>(
3839            mut self,
3840            v: V,
3841        ) -> Self {
3842            self.0.request = v.into();
3843            self
3844        }
3845
3846        /// Sets all the options, replacing any prior values.
3847        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3848            self.0.options = v.into();
3849            self
3850        }
3851
3852        /// Sends the request.
3853        pub async fn send(self) -> Result<crate::model::ListAuthorizationPoliciesResponse> {
3854            (*self.0.stub)
3855                .list_authorization_policies(self.0.request, self.0.options)
3856                .await
3857                .map(gax::response::Response::into_body)
3858        }
3859
3860        /// Streams each page in the collection.
3861        pub fn by_page(
3862            self,
3863        ) -> impl gax::paginator::Paginator<
3864            crate::model::ListAuthorizationPoliciesResponse,
3865            gax::error::Error,
3866        > {
3867            use std::clone::Clone;
3868            let token = self.0.request.page_token.clone();
3869            let execute = move |token: String| {
3870                let mut builder = self.clone();
3871                builder.0.request = builder.0.request.set_page_token(token);
3872                builder.send()
3873            };
3874            gax::paginator::internal::new_paginator(token, execute)
3875        }
3876
3877        /// Streams each item in the collection.
3878        pub fn by_item(
3879            self,
3880        ) -> impl gax::paginator::ItemPaginator<
3881            crate::model::ListAuthorizationPoliciesResponse,
3882            gax::error::Error,
3883        > {
3884            use gax::paginator::Paginator;
3885            self.by_page().items()
3886        }
3887
3888        /// Sets the value of [parent][crate::model::ListAuthorizationPoliciesRequest::parent].
3889        ///
3890        /// This is a **required** field for requests.
3891        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3892            self.0.request.parent = v.into();
3893            self
3894        }
3895
3896        /// Sets the value of [page_size][crate::model::ListAuthorizationPoliciesRequest::page_size].
3897        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3898            self.0.request.page_size = v.into();
3899            self
3900        }
3901
3902        /// Sets the value of [page_token][crate::model::ListAuthorizationPoliciesRequest::page_token].
3903        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3904            self.0.request.page_token = v.into();
3905            self
3906        }
3907    }
3908
3909    #[doc(hidden)]
3910    impl gax::options::internal::RequestBuilder for ListAuthorizationPolicies {
3911        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3912            &mut self.0.options
3913        }
3914    }
3915
3916    /// The request builder for [NetworkSecurity::get_authorization_policy][crate::client::NetworkSecurity::get_authorization_policy] calls.
3917    ///
3918    /// # Example
3919    /// ```no_run
3920    /// # use google_cloud_networksecurity_v1::builder;
3921    /// use builder::network_security::GetAuthorizationPolicy;
3922    /// # tokio_test::block_on(async {
3923    ///
3924    /// let builder = prepare_request_builder();
3925    /// let response = builder.send().await?;
3926    /// # gax::Result::<()>::Ok(()) });
3927    ///
3928    /// fn prepare_request_builder() -> GetAuthorizationPolicy {
3929    ///   # panic!();
3930    ///   // ... details omitted ...
3931    /// }
3932    /// ```
3933    #[derive(Clone, Debug)]
3934    pub struct GetAuthorizationPolicy(RequestBuilder<crate::model::GetAuthorizationPolicyRequest>);
3935
3936    impl GetAuthorizationPolicy {
3937        pub(crate) fn new(
3938            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
3939        ) -> Self {
3940            Self(RequestBuilder::new(stub))
3941        }
3942
3943        /// Sets the full request, replacing any prior values.
3944        pub fn with_request<V: Into<crate::model::GetAuthorizationPolicyRequest>>(
3945            mut self,
3946            v: V,
3947        ) -> Self {
3948            self.0.request = v.into();
3949            self
3950        }
3951
3952        /// Sets all the options, replacing any prior values.
3953        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3954            self.0.options = v.into();
3955            self
3956        }
3957
3958        /// Sends the request.
3959        pub async fn send(self) -> Result<crate::model::AuthorizationPolicy> {
3960            (*self.0.stub)
3961                .get_authorization_policy(self.0.request, self.0.options)
3962                .await
3963                .map(gax::response::Response::into_body)
3964        }
3965
3966        /// Sets the value of [name][crate::model::GetAuthorizationPolicyRequest::name].
3967        ///
3968        /// This is a **required** field for requests.
3969        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3970            self.0.request.name = v.into();
3971            self
3972        }
3973    }
3974
3975    #[doc(hidden)]
3976    impl gax::options::internal::RequestBuilder for GetAuthorizationPolicy {
3977        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3978            &mut self.0.options
3979        }
3980    }
3981
3982    /// The request builder for [NetworkSecurity::create_authorization_policy][crate::client::NetworkSecurity::create_authorization_policy] calls.
3983    ///
3984    /// # Example
3985    /// ```no_run
3986    /// # use google_cloud_networksecurity_v1::builder;
3987    /// use builder::network_security::CreateAuthorizationPolicy;
3988    /// # tokio_test::block_on(async {
3989    /// use lro::Poller;
3990    ///
3991    /// let builder = prepare_request_builder();
3992    /// let response = builder.poller().until_done().await?;
3993    /// # gax::Result::<()>::Ok(()) });
3994    ///
3995    /// fn prepare_request_builder() -> CreateAuthorizationPolicy {
3996    ///   # panic!();
3997    ///   // ... details omitted ...
3998    /// }
3999    /// ```
4000    #[derive(Clone, Debug)]
4001    pub struct CreateAuthorizationPolicy(
4002        RequestBuilder<crate::model::CreateAuthorizationPolicyRequest>,
4003    );
4004
4005    impl CreateAuthorizationPolicy {
4006        pub(crate) fn new(
4007            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4008        ) -> Self {
4009            Self(RequestBuilder::new(stub))
4010        }
4011
4012        /// Sets the full request, replacing any prior values.
4013        pub fn with_request<V: Into<crate::model::CreateAuthorizationPolicyRequest>>(
4014            mut self,
4015            v: V,
4016        ) -> Self {
4017            self.0.request = v.into();
4018            self
4019        }
4020
4021        /// Sets all the options, replacing any prior values.
4022        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4023            self.0.options = v.into();
4024            self
4025        }
4026
4027        /// Sends the request.
4028        ///
4029        /// # Long running operations
4030        ///
4031        /// This starts, but does not poll, a longrunning operation. More information
4032        /// on [create_authorization_policy][crate::client::NetworkSecurity::create_authorization_policy].
4033        pub async fn send(self) -> Result<longrunning::model::Operation> {
4034            (*self.0.stub)
4035                .create_authorization_policy(self.0.request, self.0.options)
4036                .await
4037                .map(gax::response::Response::into_body)
4038        }
4039
4040        /// Creates a [Poller][lro::Poller] to work with `create_authorization_policy`.
4041        pub fn poller(
4042            self,
4043        ) -> impl lro::Poller<crate::model::AuthorizationPolicy, crate::model::OperationMetadata>
4044        {
4045            type Operation = lro::internal::Operation<
4046                crate::model::AuthorizationPolicy,
4047                crate::model::OperationMetadata,
4048            >;
4049            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4050            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4051
4052            let stub = self.0.stub.clone();
4053            let mut options = self.0.options.clone();
4054            options.set_retry_policy(gax::retry_policy::NeverRetry);
4055            let query = move |name| {
4056                let stub = stub.clone();
4057                let options = options.clone();
4058                async {
4059                    let op = GetOperation::new(stub)
4060                        .set_name(name)
4061                        .with_options(options)
4062                        .send()
4063                        .await?;
4064                    Ok(Operation::new(op))
4065                }
4066            };
4067
4068            let start = move || async {
4069                let op = self.send().await?;
4070                Ok(Operation::new(op))
4071            };
4072
4073            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4074        }
4075
4076        /// Sets the value of [parent][crate::model::CreateAuthorizationPolicyRequest::parent].
4077        ///
4078        /// This is a **required** field for requests.
4079        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4080            self.0.request.parent = v.into();
4081            self
4082        }
4083
4084        /// Sets the value of [authorization_policy_id][crate::model::CreateAuthorizationPolicyRequest::authorization_policy_id].
4085        ///
4086        /// This is a **required** field for requests.
4087        pub fn set_authorization_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4088            self.0.request.authorization_policy_id = v.into();
4089            self
4090        }
4091
4092        /// Sets the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
4093        ///
4094        /// This is a **required** field for requests.
4095        pub fn set_authorization_policy<T>(mut self, v: T) -> Self
4096        where
4097            T: std::convert::Into<crate::model::AuthorizationPolicy>,
4098        {
4099            self.0.request.authorization_policy = std::option::Option::Some(v.into());
4100            self
4101        }
4102
4103        /// Sets or clears the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
4104        ///
4105        /// This is a **required** field for requests.
4106        pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
4107        where
4108            T: std::convert::Into<crate::model::AuthorizationPolicy>,
4109        {
4110            self.0.request.authorization_policy = v.map(|x| x.into());
4111            self
4112        }
4113    }
4114
4115    #[doc(hidden)]
4116    impl gax::options::internal::RequestBuilder for CreateAuthorizationPolicy {
4117        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4118            &mut self.0.options
4119        }
4120    }
4121
4122    /// The request builder for [NetworkSecurity::update_authorization_policy][crate::client::NetworkSecurity::update_authorization_policy] calls.
4123    ///
4124    /// # Example
4125    /// ```no_run
4126    /// # use google_cloud_networksecurity_v1::builder;
4127    /// use builder::network_security::UpdateAuthorizationPolicy;
4128    /// # tokio_test::block_on(async {
4129    /// use lro::Poller;
4130    ///
4131    /// let builder = prepare_request_builder();
4132    /// let response = builder.poller().until_done().await?;
4133    /// # gax::Result::<()>::Ok(()) });
4134    ///
4135    /// fn prepare_request_builder() -> UpdateAuthorizationPolicy {
4136    ///   # panic!();
4137    ///   // ... details omitted ...
4138    /// }
4139    /// ```
4140    #[derive(Clone, Debug)]
4141    pub struct UpdateAuthorizationPolicy(
4142        RequestBuilder<crate::model::UpdateAuthorizationPolicyRequest>,
4143    );
4144
4145    impl UpdateAuthorizationPolicy {
4146        pub(crate) fn new(
4147            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4148        ) -> Self {
4149            Self(RequestBuilder::new(stub))
4150        }
4151
4152        /// Sets the full request, replacing any prior values.
4153        pub fn with_request<V: Into<crate::model::UpdateAuthorizationPolicyRequest>>(
4154            mut self,
4155            v: V,
4156        ) -> Self {
4157            self.0.request = v.into();
4158            self
4159        }
4160
4161        /// Sets all the options, replacing any prior values.
4162        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4163            self.0.options = v.into();
4164            self
4165        }
4166
4167        /// Sends the request.
4168        ///
4169        /// # Long running operations
4170        ///
4171        /// This starts, but does not poll, a longrunning operation. More information
4172        /// on [update_authorization_policy][crate::client::NetworkSecurity::update_authorization_policy].
4173        pub async fn send(self) -> Result<longrunning::model::Operation> {
4174            (*self.0.stub)
4175                .update_authorization_policy(self.0.request, self.0.options)
4176                .await
4177                .map(gax::response::Response::into_body)
4178        }
4179
4180        /// Creates a [Poller][lro::Poller] to work with `update_authorization_policy`.
4181        pub fn poller(
4182            self,
4183        ) -> impl lro::Poller<crate::model::AuthorizationPolicy, crate::model::OperationMetadata>
4184        {
4185            type Operation = lro::internal::Operation<
4186                crate::model::AuthorizationPolicy,
4187                crate::model::OperationMetadata,
4188            >;
4189            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4190            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4191
4192            let stub = self.0.stub.clone();
4193            let mut options = self.0.options.clone();
4194            options.set_retry_policy(gax::retry_policy::NeverRetry);
4195            let query = move |name| {
4196                let stub = stub.clone();
4197                let options = options.clone();
4198                async {
4199                    let op = GetOperation::new(stub)
4200                        .set_name(name)
4201                        .with_options(options)
4202                        .send()
4203                        .await?;
4204                    Ok(Operation::new(op))
4205                }
4206            };
4207
4208            let start = move || async {
4209                let op = self.send().await?;
4210                Ok(Operation::new(op))
4211            };
4212
4213            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4214        }
4215
4216        /// Sets the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
4217        pub fn set_update_mask<T>(mut self, v: T) -> Self
4218        where
4219            T: std::convert::Into<wkt::FieldMask>,
4220        {
4221            self.0.request.update_mask = std::option::Option::Some(v.into());
4222            self
4223        }
4224
4225        /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
4226        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4227        where
4228            T: std::convert::Into<wkt::FieldMask>,
4229        {
4230            self.0.request.update_mask = v.map(|x| x.into());
4231            self
4232        }
4233
4234        /// Sets the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
4235        ///
4236        /// This is a **required** field for requests.
4237        pub fn set_authorization_policy<T>(mut self, v: T) -> Self
4238        where
4239            T: std::convert::Into<crate::model::AuthorizationPolicy>,
4240        {
4241            self.0.request.authorization_policy = std::option::Option::Some(v.into());
4242            self
4243        }
4244
4245        /// Sets or clears the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
4246        ///
4247        /// This is a **required** field for requests.
4248        pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
4249        where
4250            T: std::convert::Into<crate::model::AuthorizationPolicy>,
4251        {
4252            self.0.request.authorization_policy = v.map(|x| x.into());
4253            self
4254        }
4255    }
4256
4257    #[doc(hidden)]
4258    impl gax::options::internal::RequestBuilder for UpdateAuthorizationPolicy {
4259        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4260            &mut self.0.options
4261        }
4262    }
4263
4264    /// The request builder for [NetworkSecurity::delete_authorization_policy][crate::client::NetworkSecurity::delete_authorization_policy] calls.
4265    ///
4266    /// # Example
4267    /// ```no_run
4268    /// # use google_cloud_networksecurity_v1::builder;
4269    /// use builder::network_security::DeleteAuthorizationPolicy;
4270    /// # tokio_test::block_on(async {
4271    /// use lro::Poller;
4272    ///
4273    /// let builder = prepare_request_builder();
4274    /// let response = builder.poller().until_done().await?;
4275    /// # gax::Result::<()>::Ok(()) });
4276    ///
4277    /// fn prepare_request_builder() -> DeleteAuthorizationPolicy {
4278    ///   # panic!();
4279    ///   // ... details omitted ...
4280    /// }
4281    /// ```
4282    #[derive(Clone, Debug)]
4283    pub struct DeleteAuthorizationPolicy(
4284        RequestBuilder<crate::model::DeleteAuthorizationPolicyRequest>,
4285    );
4286
4287    impl DeleteAuthorizationPolicy {
4288        pub(crate) fn new(
4289            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4290        ) -> Self {
4291            Self(RequestBuilder::new(stub))
4292        }
4293
4294        /// Sets the full request, replacing any prior values.
4295        pub fn with_request<V: Into<crate::model::DeleteAuthorizationPolicyRequest>>(
4296            mut self,
4297            v: V,
4298        ) -> Self {
4299            self.0.request = v.into();
4300            self
4301        }
4302
4303        /// Sets all the options, replacing any prior values.
4304        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4305            self.0.options = v.into();
4306            self
4307        }
4308
4309        /// Sends the request.
4310        ///
4311        /// # Long running operations
4312        ///
4313        /// This starts, but does not poll, a longrunning operation. More information
4314        /// on [delete_authorization_policy][crate::client::NetworkSecurity::delete_authorization_policy].
4315        pub async fn send(self) -> Result<longrunning::model::Operation> {
4316            (*self.0.stub)
4317                .delete_authorization_policy(self.0.request, self.0.options)
4318                .await
4319                .map(gax::response::Response::into_body)
4320        }
4321
4322        /// Creates a [Poller][lro::Poller] to work with `delete_authorization_policy`.
4323        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4324            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4325            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4326            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4327
4328            let stub = self.0.stub.clone();
4329            let mut options = self.0.options.clone();
4330            options.set_retry_policy(gax::retry_policy::NeverRetry);
4331            let query = move |name| {
4332                let stub = stub.clone();
4333                let options = options.clone();
4334                async {
4335                    let op = GetOperation::new(stub)
4336                        .set_name(name)
4337                        .with_options(options)
4338                        .send()
4339                        .await?;
4340                    Ok(Operation::new(op))
4341                }
4342            };
4343
4344            let start = move || async {
4345                let op = self.send().await?;
4346                Ok(Operation::new(op))
4347            };
4348
4349            lro::internal::new_unit_response_poller(
4350                polling_error_policy,
4351                polling_backoff_policy,
4352                start,
4353                query,
4354            )
4355        }
4356
4357        /// Sets the value of [name][crate::model::DeleteAuthorizationPolicyRequest::name].
4358        ///
4359        /// This is a **required** field for requests.
4360        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4361            self.0.request.name = v.into();
4362            self
4363        }
4364    }
4365
4366    #[doc(hidden)]
4367    impl gax::options::internal::RequestBuilder for DeleteAuthorizationPolicy {
4368        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4369            &mut self.0.options
4370        }
4371    }
4372
4373    /// The request builder for [NetworkSecurity::list_server_tls_policies][crate::client::NetworkSecurity::list_server_tls_policies] calls.
4374    ///
4375    /// # Example
4376    /// ```no_run
4377    /// # use google_cloud_networksecurity_v1::builder;
4378    /// use builder::network_security::ListServerTlsPolicies;
4379    /// # tokio_test::block_on(async {
4380    /// use gax::paginator::ItemPaginator;
4381    ///
4382    /// let builder = prepare_request_builder();
4383    /// let mut items = builder.by_item();
4384    /// while let Some(result) = items.next().await {
4385    ///   let item = result?;
4386    /// }
4387    /// # gax::Result::<()>::Ok(()) });
4388    ///
4389    /// fn prepare_request_builder() -> ListServerTlsPolicies {
4390    ///   # panic!();
4391    ///   // ... details omitted ...
4392    /// }
4393    /// ```
4394    #[derive(Clone, Debug)]
4395    pub struct ListServerTlsPolicies(RequestBuilder<crate::model::ListServerTlsPoliciesRequest>);
4396
4397    impl ListServerTlsPolicies {
4398        pub(crate) fn new(
4399            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4400        ) -> Self {
4401            Self(RequestBuilder::new(stub))
4402        }
4403
4404        /// Sets the full request, replacing any prior values.
4405        pub fn with_request<V: Into<crate::model::ListServerTlsPoliciesRequest>>(
4406            mut self,
4407            v: V,
4408        ) -> Self {
4409            self.0.request = v.into();
4410            self
4411        }
4412
4413        /// Sets all the options, replacing any prior values.
4414        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4415            self.0.options = v.into();
4416            self
4417        }
4418
4419        /// Sends the request.
4420        pub async fn send(self) -> Result<crate::model::ListServerTlsPoliciesResponse> {
4421            (*self.0.stub)
4422                .list_server_tls_policies(self.0.request, self.0.options)
4423                .await
4424                .map(gax::response::Response::into_body)
4425        }
4426
4427        /// Streams each page in the collection.
4428        pub fn by_page(
4429            self,
4430        ) -> impl gax::paginator::Paginator<crate::model::ListServerTlsPoliciesResponse, gax::error::Error>
4431        {
4432            use std::clone::Clone;
4433            let token = self.0.request.page_token.clone();
4434            let execute = move |token: String| {
4435                let mut builder = self.clone();
4436                builder.0.request = builder.0.request.set_page_token(token);
4437                builder.send()
4438            };
4439            gax::paginator::internal::new_paginator(token, execute)
4440        }
4441
4442        /// Streams each item in the collection.
4443        pub fn by_item(
4444            self,
4445        ) -> impl gax::paginator::ItemPaginator<
4446            crate::model::ListServerTlsPoliciesResponse,
4447            gax::error::Error,
4448        > {
4449            use gax::paginator::Paginator;
4450            self.by_page().items()
4451        }
4452
4453        /// Sets the value of [parent][crate::model::ListServerTlsPoliciesRequest::parent].
4454        ///
4455        /// This is a **required** field for requests.
4456        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4457            self.0.request.parent = v.into();
4458            self
4459        }
4460
4461        /// Sets the value of [page_size][crate::model::ListServerTlsPoliciesRequest::page_size].
4462        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4463            self.0.request.page_size = v.into();
4464            self
4465        }
4466
4467        /// Sets the value of [page_token][crate::model::ListServerTlsPoliciesRequest::page_token].
4468        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4469            self.0.request.page_token = v.into();
4470            self
4471        }
4472    }
4473
4474    #[doc(hidden)]
4475    impl gax::options::internal::RequestBuilder for ListServerTlsPolicies {
4476        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4477            &mut self.0.options
4478        }
4479    }
4480
4481    /// The request builder for [NetworkSecurity::get_server_tls_policy][crate::client::NetworkSecurity::get_server_tls_policy] calls.
4482    ///
4483    /// # Example
4484    /// ```no_run
4485    /// # use google_cloud_networksecurity_v1::builder;
4486    /// use builder::network_security::GetServerTlsPolicy;
4487    /// # tokio_test::block_on(async {
4488    ///
4489    /// let builder = prepare_request_builder();
4490    /// let response = builder.send().await?;
4491    /// # gax::Result::<()>::Ok(()) });
4492    ///
4493    /// fn prepare_request_builder() -> GetServerTlsPolicy {
4494    ///   # panic!();
4495    ///   // ... details omitted ...
4496    /// }
4497    /// ```
4498    #[derive(Clone, Debug)]
4499    pub struct GetServerTlsPolicy(RequestBuilder<crate::model::GetServerTlsPolicyRequest>);
4500
4501    impl GetServerTlsPolicy {
4502        pub(crate) fn new(
4503            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4504        ) -> Self {
4505            Self(RequestBuilder::new(stub))
4506        }
4507
4508        /// Sets the full request, replacing any prior values.
4509        pub fn with_request<V: Into<crate::model::GetServerTlsPolicyRequest>>(
4510            mut self,
4511            v: V,
4512        ) -> Self {
4513            self.0.request = v.into();
4514            self
4515        }
4516
4517        /// Sets all the options, replacing any prior values.
4518        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4519            self.0.options = v.into();
4520            self
4521        }
4522
4523        /// Sends the request.
4524        pub async fn send(self) -> Result<crate::model::ServerTlsPolicy> {
4525            (*self.0.stub)
4526                .get_server_tls_policy(self.0.request, self.0.options)
4527                .await
4528                .map(gax::response::Response::into_body)
4529        }
4530
4531        /// Sets the value of [name][crate::model::GetServerTlsPolicyRequest::name].
4532        ///
4533        /// This is a **required** field for requests.
4534        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4535            self.0.request.name = v.into();
4536            self
4537        }
4538    }
4539
4540    #[doc(hidden)]
4541    impl gax::options::internal::RequestBuilder for GetServerTlsPolicy {
4542        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4543            &mut self.0.options
4544        }
4545    }
4546
4547    /// The request builder for [NetworkSecurity::create_server_tls_policy][crate::client::NetworkSecurity::create_server_tls_policy] calls.
4548    ///
4549    /// # Example
4550    /// ```no_run
4551    /// # use google_cloud_networksecurity_v1::builder;
4552    /// use builder::network_security::CreateServerTlsPolicy;
4553    /// # tokio_test::block_on(async {
4554    /// use lro::Poller;
4555    ///
4556    /// let builder = prepare_request_builder();
4557    /// let response = builder.poller().until_done().await?;
4558    /// # gax::Result::<()>::Ok(()) });
4559    ///
4560    /// fn prepare_request_builder() -> CreateServerTlsPolicy {
4561    ///   # panic!();
4562    ///   // ... details omitted ...
4563    /// }
4564    /// ```
4565    #[derive(Clone, Debug)]
4566    pub struct CreateServerTlsPolicy(RequestBuilder<crate::model::CreateServerTlsPolicyRequest>);
4567
4568    impl CreateServerTlsPolicy {
4569        pub(crate) fn new(
4570            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4571        ) -> Self {
4572            Self(RequestBuilder::new(stub))
4573        }
4574
4575        /// Sets the full request, replacing any prior values.
4576        pub fn with_request<V: Into<crate::model::CreateServerTlsPolicyRequest>>(
4577            mut self,
4578            v: V,
4579        ) -> Self {
4580            self.0.request = v.into();
4581            self
4582        }
4583
4584        /// Sets all the options, replacing any prior values.
4585        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4586            self.0.options = v.into();
4587            self
4588        }
4589
4590        /// Sends the request.
4591        ///
4592        /// # Long running operations
4593        ///
4594        /// This starts, but does not poll, a longrunning operation. More information
4595        /// on [create_server_tls_policy][crate::client::NetworkSecurity::create_server_tls_policy].
4596        pub async fn send(self) -> Result<longrunning::model::Operation> {
4597            (*self.0.stub)
4598                .create_server_tls_policy(self.0.request, self.0.options)
4599                .await
4600                .map(gax::response::Response::into_body)
4601        }
4602
4603        /// Creates a [Poller][lro::Poller] to work with `create_server_tls_policy`.
4604        pub fn poller(
4605            self,
4606        ) -> impl lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
4607        {
4608            type Operation = lro::internal::Operation<
4609                crate::model::ServerTlsPolicy,
4610                crate::model::OperationMetadata,
4611            >;
4612            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4613            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4614
4615            let stub = self.0.stub.clone();
4616            let mut options = self.0.options.clone();
4617            options.set_retry_policy(gax::retry_policy::NeverRetry);
4618            let query = move |name| {
4619                let stub = stub.clone();
4620                let options = options.clone();
4621                async {
4622                    let op = GetOperation::new(stub)
4623                        .set_name(name)
4624                        .with_options(options)
4625                        .send()
4626                        .await?;
4627                    Ok(Operation::new(op))
4628                }
4629            };
4630
4631            let start = move || async {
4632                let op = self.send().await?;
4633                Ok(Operation::new(op))
4634            };
4635
4636            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4637        }
4638
4639        /// Sets the value of [parent][crate::model::CreateServerTlsPolicyRequest::parent].
4640        ///
4641        /// This is a **required** field for requests.
4642        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4643            self.0.request.parent = v.into();
4644            self
4645        }
4646
4647        /// Sets the value of [server_tls_policy_id][crate::model::CreateServerTlsPolicyRequest::server_tls_policy_id].
4648        ///
4649        /// This is a **required** field for requests.
4650        pub fn set_server_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4651            self.0.request.server_tls_policy_id = v.into();
4652            self
4653        }
4654
4655        /// Sets the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
4656        ///
4657        /// This is a **required** field for requests.
4658        pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
4659        where
4660            T: std::convert::Into<crate::model::ServerTlsPolicy>,
4661        {
4662            self.0.request.server_tls_policy = std::option::Option::Some(v.into());
4663            self
4664        }
4665
4666        /// Sets or clears the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
4667        ///
4668        /// This is a **required** field for requests.
4669        pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
4670        where
4671            T: std::convert::Into<crate::model::ServerTlsPolicy>,
4672        {
4673            self.0.request.server_tls_policy = v.map(|x| x.into());
4674            self
4675        }
4676    }
4677
4678    #[doc(hidden)]
4679    impl gax::options::internal::RequestBuilder for CreateServerTlsPolicy {
4680        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4681            &mut self.0.options
4682        }
4683    }
4684
4685    /// The request builder for [NetworkSecurity::update_server_tls_policy][crate::client::NetworkSecurity::update_server_tls_policy] calls.
4686    ///
4687    /// # Example
4688    /// ```no_run
4689    /// # use google_cloud_networksecurity_v1::builder;
4690    /// use builder::network_security::UpdateServerTlsPolicy;
4691    /// # tokio_test::block_on(async {
4692    /// use lro::Poller;
4693    ///
4694    /// let builder = prepare_request_builder();
4695    /// let response = builder.poller().until_done().await?;
4696    /// # gax::Result::<()>::Ok(()) });
4697    ///
4698    /// fn prepare_request_builder() -> UpdateServerTlsPolicy {
4699    ///   # panic!();
4700    ///   // ... details omitted ...
4701    /// }
4702    /// ```
4703    #[derive(Clone, Debug)]
4704    pub struct UpdateServerTlsPolicy(RequestBuilder<crate::model::UpdateServerTlsPolicyRequest>);
4705
4706    impl UpdateServerTlsPolicy {
4707        pub(crate) fn new(
4708            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4709        ) -> Self {
4710            Self(RequestBuilder::new(stub))
4711        }
4712
4713        /// Sets the full request, replacing any prior values.
4714        pub fn with_request<V: Into<crate::model::UpdateServerTlsPolicyRequest>>(
4715            mut self,
4716            v: V,
4717        ) -> Self {
4718            self.0.request = v.into();
4719            self
4720        }
4721
4722        /// Sets all the options, replacing any prior values.
4723        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4724            self.0.options = v.into();
4725            self
4726        }
4727
4728        /// Sends the request.
4729        ///
4730        /// # Long running operations
4731        ///
4732        /// This starts, but does not poll, a longrunning operation. More information
4733        /// on [update_server_tls_policy][crate::client::NetworkSecurity::update_server_tls_policy].
4734        pub async fn send(self) -> Result<longrunning::model::Operation> {
4735            (*self.0.stub)
4736                .update_server_tls_policy(self.0.request, self.0.options)
4737                .await
4738                .map(gax::response::Response::into_body)
4739        }
4740
4741        /// Creates a [Poller][lro::Poller] to work with `update_server_tls_policy`.
4742        pub fn poller(
4743            self,
4744        ) -> impl lro::Poller<crate::model::ServerTlsPolicy, crate::model::OperationMetadata>
4745        {
4746            type Operation = lro::internal::Operation<
4747                crate::model::ServerTlsPolicy,
4748                crate::model::OperationMetadata,
4749            >;
4750            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4751            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4752
4753            let stub = self.0.stub.clone();
4754            let mut options = self.0.options.clone();
4755            options.set_retry_policy(gax::retry_policy::NeverRetry);
4756            let query = move |name| {
4757                let stub = stub.clone();
4758                let options = options.clone();
4759                async {
4760                    let op = GetOperation::new(stub)
4761                        .set_name(name)
4762                        .with_options(options)
4763                        .send()
4764                        .await?;
4765                    Ok(Operation::new(op))
4766                }
4767            };
4768
4769            let start = move || async {
4770                let op = self.send().await?;
4771                Ok(Operation::new(op))
4772            };
4773
4774            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4775        }
4776
4777        /// Sets the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
4778        pub fn set_update_mask<T>(mut self, v: T) -> Self
4779        where
4780            T: std::convert::Into<wkt::FieldMask>,
4781        {
4782            self.0.request.update_mask = std::option::Option::Some(v.into());
4783            self
4784        }
4785
4786        /// Sets or clears the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
4787        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4788        where
4789            T: std::convert::Into<wkt::FieldMask>,
4790        {
4791            self.0.request.update_mask = v.map(|x| x.into());
4792            self
4793        }
4794
4795        /// Sets the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
4796        ///
4797        /// This is a **required** field for requests.
4798        pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
4799        where
4800            T: std::convert::Into<crate::model::ServerTlsPolicy>,
4801        {
4802            self.0.request.server_tls_policy = std::option::Option::Some(v.into());
4803            self
4804        }
4805
4806        /// Sets or clears the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
4807        ///
4808        /// This is a **required** field for requests.
4809        pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
4810        where
4811            T: std::convert::Into<crate::model::ServerTlsPolicy>,
4812        {
4813            self.0.request.server_tls_policy = v.map(|x| x.into());
4814            self
4815        }
4816    }
4817
4818    #[doc(hidden)]
4819    impl gax::options::internal::RequestBuilder for UpdateServerTlsPolicy {
4820        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4821            &mut self.0.options
4822        }
4823    }
4824
4825    /// The request builder for [NetworkSecurity::delete_server_tls_policy][crate::client::NetworkSecurity::delete_server_tls_policy] calls.
4826    ///
4827    /// # Example
4828    /// ```no_run
4829    /// # use google_cloud_networksecurity_v1::builder;
4830    /// use builder::network_security::DeleteServerTlsPolicy;
4831    /// # tokio_test::block_on(async {
4832    /// use lro::Poller;
4833    ///
4834    /// let builder = prepare_request_builder();
4835    /// let response = builder.poller().until_done().await?;
4836    /// # gax::Result::<()>::Ok(()) });
4837    ///
4838    /// fn prepare_request_builder() -> DeleteServerTlsPolicy {
4839    ///   # panic!();
4840    ///   // ... details omitted ...
4841    /// }
4842    /// ```
4843    #[derive(Clone, Debug)]
4844    pub struct DeleteServerTlsPolicy(RequestBuilder<crate::model::DeleteServerTlsPolicyRequest>);
4845
4846    impl DeleteServerTlsPolicy {
4847        pub(crate) fn new(
4848            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4849        ) -> Self {
4850            Self(RequestBuilder::new(stub))
4851        }
4852
4853        /// Sets the full request, replacing any prior values.
4854        pub fn with_request<V: Into<crate::model::DeleteServerTlsPolicyRequest>>(
4855            mut self,
4856            v: V,
4857        ) -> Self {
4858            self.0.request = v.into();
4859            self
4860        }
4861
4862        /// Sets all the options, replacing any prior values.
4863        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4864            self.0.options = v.into();
4865            self
4866        }
4867
4868        /// Sends the request.
4869        ///
4870        /// # Long running operations
4871        ///
4872        /// This starts, but does not poll, a longrunning operation. More information
4873        /// on [delete_server_tls_policy][crate::client::NetworkSecurity::delete_server_tls_policy].
4874        pub async fn send(self) -> Result<longrunning::model::Operation> {
4875            (*self.0.stub)
4876                .delete_server_tls_policy(self.0.request, self.0.options)
4877                .await
4878                .map(gax::response::Response::into_body)
4879        }
4880
4881        /// Creates a [Poller][lro::Poller] to work with `delete_server_tls_policy`.
4882        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4883            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4884            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4885            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4886
4887            let stub = self.0.stub.clone();
4888            let mut options = self.0.options.clone();
4889            options.set_retry_policy(gax::retry_policy::NeverRetry);
4890            let query = move |name| {
4891                let stub = stub.clone();
4892                let options = options.clone();
4893                async {
4894                    let op = GetOperation::new(stub)
4895                        .set_name(name)
4896                        .with_options(options)
4897                        .send()
4898                        .await?;
4899                    Ok(Operation::new(op))
4900                }
4901            };
4902
4903            let start = move || async {
4904                let op = self.send().await?;
4905                Ok(Operation::new(op))
4906            };
4907
4908            lro::internal::new_unit_response_poller(
4909                polling_error_policy,
4910                polling_backoff_policy,
4911                start,
4912                query,
4913            )
4914        }
4915
4916        /// Sets the value of [name][crate::model::DeleteServerTlsPolicyRequest::name].
4917        ///
4918        /// This is a **required** field for requests.
4919        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4920            self.0.request.name = v.into();
4921            self
4922        }
4923    }
4924
4925    #[doc(hidden)]
4926    impl gax::options::internal::RequestBuilder for DeleteServerTlsPolicy {
4927        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4928            &mut self.0.options
4929        }
4930    }
4931
4932    /// The request builder for [NetworkSecurity::list_client_tls_policies][crate::client::NetworkSecurity::list_client_tls_policies] calls.
4933    ///
4934    /// # Example
4935    /// ```no_run
4936    /// # use google_cloud_networksecurity_v1::builder;
4937    /// use builder::network_security::ListClientTlsPolicies;
4938    /// # tokio_test::block_on(async {
4939    /// use gax::paginator::ItemPaginator;
4940    ///
4941    /// let builder = prepare_request_builder();
4942    /// let mut items = builder.by_item();
4943    /// while let Some(result) = items.next().await {
4944    ///   let item = result?;
4945    /// }
4946    /// # gax::Result::<()>::Ok(()) });
4947    ///
4948    /// fn prepare_request_builder() -> ListClientTlsPolicies {
4949    ///   # panic!();
4950    ///   // ... details omitted ...
4951    /// }
4952    /// ```
4953    #[derive(Clone, Debug)]
4954    pub struct ListClientTlsPolicies(RequestBuilder<crate::model::ListClientTlsPoliciesRequest>);
4955
4956    impl ListClientTlsPolicies {
4957        pub(crate) fn new(
4958            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
4959        ) -> Self {
4960            Self(RequestBuilder::new(stub))
4961        }
4962
4963        /// Sets the full request, replacing any prior values.
4964        pub fn with_request<V: Into<crate::model::ListClientTlsPoliciesRequest>>(
4965            mut self,
4966            v: V,
4967        ) -> Self {
4968            self.0.request = v.into();
4969            self
4970        }
4971
4972        /// Sets all the options, replacing any prior values.
4973        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4974            self.0.options = v.into();
4975            self
4976        }
4977
4978        /// Sends the request.
4979        pub async fn send(self) -> Result<crate::model::ListClientTlsPoliciesResponse> {
4980            (*self.0.stub)
4981                .list_client_tls_policies(self.0.request, self.0.options)
4982                .await
4983                .map(gax::response::Response::into_body)
4984        }
4985
4986        /// Streams each page in the collection.
4987        pub fn by_page(
4988            self,
4989        ) -> impl gax::paginator::Paginator<crate::model::ListClientTlsPoliciesResponse, gax::error::Error>
4990        {
4991            use std::clone::Clone;
4992            let token = self.0.request.page_token.clone();
4993            let execute = move |token: String| {
4994                let mut builder = self.clone();
4995                builder.0.request = builder.0.request.set_page_token(token);
4996                builder.send()
4997            };
4998            gax::paginator::internal::new_paginator(token, execute)
4999        }
5000
5001        /// Streams each item in the collection.
5002        pub fn by_item(
5003            self,
5004        ) -> impl gax::paginator::ItemPaginator<
5005            crate::model::ListClientTlsPoliciesResponse,
5006            gax::error::Error,
5007        > {
5008            use gax::paginator::Paginator;
5009            self.by_page().items()
5010        }
5011
5012        /// Sets the value of [parent][crate::model::ListClientTlsPoliciesRequest::parent].
5013        ///
5014        /// This is a **required** field for requests.
5015        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5016            self.0.request.parent = v.into();
5017            self
5018        }
5019
5020        /// Sets the value of [page_size][crate::model::ListClientTlsPoliciesRequest::page_size].
5021        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5022            self.0.request.page_size = v.into();
5023            self
5024        }
5025
5026        /// Sets the value of [page_token][crate::model::ListClientTlsPoliciesRequest::page_token].
5027        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5028            self.0.request.page_token = v.into();
5029            self
5030        }
5031    }
5032
5033    #[doc(hidden)]
5034    impl gax::options::internal::RequestBuilder for ListClientTlsPolicies {
5035        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5036            &mut self.0.options
5037        }
5038    }
5039
5040    /// The request builder for [NetworkSecurity::get_client_tls_policy][crate::client::NetworkSecurity::get_client_tls_policy] calls.
5041    ///
5042    /// # Example
5043    /// ```no_run
5044    /// # use google_cloud_networksecurity_v1::builder;
5045    /// use builder::network_security::GetClientTlsPolicy;
5046    /// # tokio_test::block_on(async {
5047    ///
5048    /// let builder = prepare_request_builder();
5049    /// let response = builder.send().await?;
5050    /// # gax::Result::<()>::Ok(()) });
5051    ///
5052    /// fn prepare_request_builder() -> GetClientTlsPolicy {
5053    ///   # panic!();
5054    ///   // ... details omitted ...
5055    /// }
5056    /// ```
5057    #[derive(Clone, Debug)]
5058    pub struct GetClientTlsPolicy(RequestBuilder<crate::model::GetClientTlsPolicyRequest>);
5059
5060    impl GetClientTlsPolicy {
5061        pub(crate) fn new(
5062            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5063        ) -> Self {
5064            Self(RequestBuilder::new(stub))
5065        }
5066
5067        /// Sets the full request, replacing any prior values.
5068        pub fn with_request<V: Into<crate::model::GetClientTlsPolicyRequest>>(
5069            mut self,
5070            v: V,
5071        ) -> Self {
5072            self.0.request = v.into();
5073            self
5074        }
5075
5076        /// Sets all the options, replacing any prior values.
5077        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5078            self.0.options = v.into();
5079            self
5080        }
5081
5082        /// Sends the request.
5083        pub async fn send(self) -> Result<crate::model::ClientTlsPolicy> {
5084            (*self.0.stub)
5085                .get_client_tls_policy(self.0.request, self.0.options)
5086                .await
5087                .map(gax::response::Response::into_body)
5088        }
5089
5090        /// Sets the value of [name][crate::model::GetClientTlsPolicyRequest::name].
5091        ///
5092        /// This is a **required** field for requests.
5093        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5094            self.0.request.name = v.into();
5095            self
5096        }
5097    }
5098
5099    #[doc(hidden)]
5100    impl gax::options::internal::RequestBuilder for GetClientTlsPolicy {
5101        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5102            &mut self.0.options
5103        }
5104    }
5105
5106    /// The request builder for [NetworkSecurity::create_client_tls_policy][crate::client::NetworkSecurity::create_client_tls_policy] calls.
5107    ///
5108    /// # Example
5109    /// ```no_run
5110    /// # use google_cloud_networksecurity_v1::builder;
5111    /// use builder::network_security::CreateClientTlsPolicy;
5112    /// # tokio_test::block_on(async {
5113    /// use lro::Poller;
5114    ///
5115    /// let builder = prepare_request_builder();
5116    /// let response = builder.poller().until_done().await?;
5117    /// # gax::Result::<()>::Ok(()) });
5118    ///
5119    /// fn prepare_request_builder() -> CreateClientTlsPolicy {
5120    ///   # panic!();
5121    ///   // ... details omitted ...
5122    /// }
5123    /// ```
5124    #[derive(Clone, Debug)]
5125    pub struct CreateClientTlsPolicy(RequestBuilder<crate::model::CreateClientTlsPolicyRequest>);
5126
5127    impl CreateClientTlsPolicy {
5128        pub(crate) fn new(
5129            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5130        ) -> Self {
5131            Self(RequestBuilder::new(stub))
5132        }
5133
5134        /// Sets the full request, replacing any prior values.
5135        pub fn with_request<V: Into<crate::model::CreateClientTlsPolicyRequest>>(
5136            mut self,
5137            v: V,
5138        ) -> Self {
5139            self.0.request = v.into();
5140            self
5141        }
5142
5143        /// Sets all the options, replacing any prior values.
5144        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5145            self.0.options = v.into();
5146            self
5147        }
5148
5149        /// Sends the request.
5150        ///
5151        /// # Long running operations
5152        ///
5153        /// This starts, but does not poll, a longrunning operation. More information
5154        /// on [create_client_tls_policy][crate::client::NetworkSecurity::create_client_tls_policy].
5155        pub async fn send(self) -> Result<longrunning::model::Operation> {
5156            (*self.0.stub)
5157                .create_client_tls_policy(self.0.request, self.0.options)
5158                .await
5159                .map(gax::response::Response::into_body)
5160        }
5161
5162        /// Creates a [Poller][lro::Poller] to work with `create_client_tls_policy`.
5163        pub fn poller(
5164            self,
5165        ) -> impl lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
5166        {
5167            type Operation = lro::internal::Operation<
5168                crate::model::ClientTlsPolicy,
5169                crate::model::OperationMetadata,
5170            >;
5171            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5172            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5173
5174            let stub = self.0.stub.clone();
5175            let mut options = self.0.options.clone();
5176            options.set_retry_policy(gax::retry_policy::NeverRetry);
5177            let query = move |name| {
5178                let stub = stub.clone();
5179                let options = options.clone();
5180                async {
5181                    let op = GetOperation::new(stub)
5182                        .set_name(name)
5183                        .with_options(options)
5184                        .send()
5185                        .await?;
5186                    Ok(Operation::new(op))
5187                }
5188            };
5189
5190            let start = move || async {
5191                let op = self.send().await?;
5192                Ok(Operation::new(op))
5193            };
5194
5195            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5196        }
5197
5198        /// Sets the value of [parent][crate::model::CreateClientTlsPolicyRequest::parent].
5199        ///
5200        /// This is a **required** field for requests.
5201        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5202            self.0.request.parent = v.into();
5203            self
5204        }
5205
5206        /// Sets the value of [client_tls_policy_id][crate::model::CreateClientTlsPolicyRequest::client_tls_policy_id].
5207        ///
5208        /// This is a **required** field for requests.
5209        pub fn set_client_tls_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5210            self.0.request.client_tls_policy_id = v.into();
5211            self
5212        }
5213
5214        /// Sets the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
5215        ///
5216        /// This is a **required** field for requests.
5217        pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
5218        where
5219            T: std::convert::Into<crate::model::ClientTlsPolicy>,
5220        {
5221            self.0.request.client_tls_policy = std::option::Option::Some(v.into());
5222            self
5223        }
5224
5225        /// Sets or clears the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
5226        ///
5227        /// This is a **required** field for requests.
5228        pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
5229        where
5230            T: std::convert::Into<crate::model::ClientTlsPolicy>,
5231        {
5232            self.0.request.client_tls_policy = v.map(|x| x.into());
5233            self
5234        }
5235    }
5236
5237    #[doc(hidden)]
5238    impl gax::options::internal::RequestBuilder for CreateClientTlsPolicy {
5239        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5240            &mut self.0.options
5241        }
5242    }
5243
5244    /// The request builder for [NetworkSecurity::update_client_tls_policy][crate::client::NetworkSecurity::update_client_tls_policy] calls.
5245    ///
5246    /// # Example
5247    /// ```no_run
5248    /// # use google_cloud_networksecurity_v1::builder;
5249    /// use builder::network_security::UpdateClientTlsPolicy;
5250    /// # tokio_test::block_on(async {
5251    /// use lro::Poller;
5252    ///
5253    /// let builder = prepare_request_builder();
5254    /// let response = builder.poller().until_done().await?;
5255    /// # gax::Result::<()>::Ok(()) });
5256    ///
5257    /// fn prepare_request_builder() -> UpdateClientTlsPolicy {
5258    ///   # panic!();
5259    ///   // ... details omitted ...
5260    /// }
5261    /// ```
5262    #[derive(Clone, Debug)]
5263    pub struct UpdateClientTlsPolicy(RequestBuilder<crate::model::UpdateClientTlsPolicyRequest>);
5264
5265    impl UpdateClientTlsPolicy {
5266        pub(crate) fn new(
5267            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5268        ) -> Self {
5269            Self(RequestBuilder::new(stub))
5270        }
5271
5272        /// Sets the full request, replacing any prior values.
5273        pub fn with_request<V: Into<crate::model::UpdateClientTlsPolicyRequest>>(
5274            mut self,
5275            v: V,
5276        ) -> Self {
5277            self.0.request = v.into();
5278            self
5279        }
5280
5281        /// Sets all the options, replacing any prior values.
5282        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5283            self.0.options = v.into();
5284            self
5285        }
5286
5287        /// Sends the request.
5288        ///
5289        /// # Long running operations
5290        ///
5291        /// This starts, but does not poll, a longrunning operation. More information
5292        /// on [update_client_tls_policy][crate::client::NetworkSecurity::update_client_tls_policy].
5293        pub async fn send(self) -> Result<longrunning::model::Operation> {
5294            (*self.0.stub)
5295                .update_client_tls_policy(self.0.request, self.0.options)
5296                .await
5297                .map(gax::response::Response::into_body)
5298        }
5299
5300        /// Creates a [Poller][lro::Poller] to work with `update_client_tls_policy`.
5301        pub fn poller(
5302            self,
5303        ) -> impl lro::Poller<crate::model::ClientTlsPolicy, crate::model::OperationMetadata>
5304        {
5305            type Operation = lro::internal::Operation<
5306                crate::model::ClientTlsPolicy,
5307                crate::model::OperationMetadata,
5308            >;
5309            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5310            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5311
5312            let stub = self.0.stub.clone();
5313            let mut options = self.0.options.clone();
5314            options.set_retry_policy(gax::retry_policy::NeverRetry);
5315            let query = move |name| {
5316                let stub = stub.clone();
5317                let options = options.clone();
5318                async {
5319                    let op = GetOperation::new(stub)
5320                        .set_name(name)
5321                        .with_options(options)
5322                        .send()
5323                        .await?;
5324                    Ok(Operation::new(op))
5325                }
5326            };
5327
5328            let start = move || async {
5329                let op = self.send().await?;
5330                Ok(Operation::new(op))
5331            };
5332
5333            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5334        }
5335
5336        /// Sets the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
5337        pub fn set_update_mask<T>(mut self, v: T) -> Self
5338        where
5339            T: std::convert::Into<wkt::FieldMask>,
5340        {
5341            self.0.request.update_mask = std::option::Option::Some(v.into());
5342            self
5343        }
5344
5345        /// Sets or clears the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
5346        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5347        where
5348            T: std::convert::Into<wkt::FieldMask>,
5349        {
5350            self.0.request.update_mask = v.map(|x| x.into());
5351            self
5352        }
5353
5354        /// Sets the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
5355        ///
5356        /// This is a **required** field for requests.
5357        pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
5358        where
5359            T: std::convert::Into<crate::model::ClientTlsPolicy>,
5360        {
5361            self.0.request.client_tls_policy = std::option::Option::Some(v.into());
5362            self
5363        }
5364
5365        /// Sets or clears the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
5366        ///
5367        /// This is a **required** field for requests.
5368        pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
5369        where
5370            T: std::convert::Into<crate::model::ClientTlsPolicy>,
5371        {
5372            self.0.request.client_tls_policy = v.map(|x| x.into());
5373            self
5374        }
5375    }
5376
5377    #[doc(hidden)]
5378    impl gax::options::internal::RequestBuilder for UpdateClientTlsPolicy {
5379        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5380            &mut self.0.options
5381        }
5382    }
5383
5384    /// The request builder for [NetworkSecurity::delete_client_tls_policy][crate::client::NetworkSecurity::delete_client_tls_policy] calls.
5385    ///
5386    /// # Example
5387    /// ```no_run
5388    /// # use google_cloud_networksecurity_v1::builder;
5389    /// use builder::network_security::DeleteClientTlsPolicy;
5390    /// # tokio_test::block_on(async {
5391    /// use lro::Poller;
5392    ///
5393    /// let builder = prepare_request_builder();
5394    /// let response = builder.poller().until_done().await?;
5395    /// # gax::Result::<()>::Ok(()) });
5396    ///
5397    /// fn prepare_request_builder() -> DeleteClientTlsPolicy {
5398    ///   # panic!();
5399    ///   // ... details omitted ...
5400    /// }
5401    /// ```
5402    #[derive(Clone, Debug)]
5403    pub struct DeleteClientTlsPolicy(RequestBuilder<crate::model::DeleteClientTlsPolicyRequest>);
5404
5405    impl DeleteClientTlsPolicy {
5406        pub(crate) fn new(
5407            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5408        ) -> Self {
5409            Self(RequestBuilder::new(stub))
5410        }
5411
5412        /// Sets the full request, replacing any prior values.
5413        pub fn with_request<V: Into<crate::model::DeleteClientTlsPolicyRequest>>(
5414            mut self,
5415            v: V,
5416        ) -> Self {
5417            self.0.request = v.into();
5418            self
5419        }
5420
5421        /// Sets all the options, replacing any prior values.
5422        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5423            self.0.options = v.into();
5424            self
5425        }
5426
5427        /// Sends the request.
5428        ///
5429        /// # Long running operations
5430        ///
5431        /// This starts, but does not poll, a longrunning operation. More information
5432        /// on [delete_client_tls_policy][crate::client::NetworkSecurity::delete_client_tls_policy].
5433        pub async fn send(self) -> Result<longrunning::model::Operation> {
5434            (*self.0.stub)
5435                .delete_client_tls_policy(self.0.request, self.0.options)
5436                .await
5437                .map(gax::response::Response::into_body)
5438        }
5439
5440        /// Creates a [Poller][lro::Poller] to work with `delete_client_tls_policy`.
5441        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
5442            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5443            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5444            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5445
5446            let stub = self.0.stub.clone();
5447            let mut options = self.0.options.clone();
5448            options.set_retry_policy(gax::retry_policy::NeverRetry);
5449            let query = move |name| {
5450                let stub = stub.clone();
5451                let options = options.clone();
5452                async {
5453                    let op = GetOperation::new(stub)
5454                        .set_name(name)
5455                        .with_options(options)
5456                        .send()
5457                        .await?;
5458                    Ok(Operation::new(op))
5459                }
5460            };
5461
5462            let start = move || async {
5463                let op = self.send().await?;
5464                Ok(Operation::new(op))
5465            };
5466
5467            lro::internal::new_unit_response_poller(
5468                polling_error_policy,
5469                polling_backoff_policy,
5470                start,
5471                query,
5472            )
5473        }
5474
5475        /// Sets the value of [name][crate::model::DeleteClientTlsPolicyRequest::name].
5476        ///
5477        /// This is a **required** field for requests.
5478        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5479            self.0.request.name = v.into();
5480            self
5481        }
5482    }
5483
5484    #[doc(hidden)]
5485    impl gax::options::internal::RequestBuilder for DeleteClientTlsPolicy {
5486        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5487            &mut self.0.options
5488        }
5489    }
5490
5491    /// The request builder for [NetworkSecurity::list_locations][crate::client::NetworkSecurity::list_locations] calls.
5492    ///
5493    /// # Example
5494    /// ```no_run
5495    /// # use google_cloud_networksecurity_v1::builder;
5496    /// use builder::network_security::ListLocations;
5497    /// # tokio_test::block_on(async {
5498    /// use gax::paginator::ItemPaginator;
5499    ///
5500    /// let builder = prepare_request_builder();
5501    /// let mut items = builder.by_item();
5502    /// while let Some(result) = items.next().await {
5503    ///   let item = result?;
5504    /// }
5505    /// # gax::Result::<()>::Ok(()) });
5506    ///
5507    /// fn prepare_request_builder() -> ListLocations {
5508    ///   # panic!();
5509    ///   // ... details omitted ...
5510    /// }
5511    /// ```
5512    #[derive(Clone, Debug)]
5513    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5514
5515    impl ListLocations {
5516        pub(crate) fn new(
5517            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5518        ) -> Self {
5519            Self(RequestBuilder::new(stub))
5520        }
5521
5522        /// Sets the full request, replacing any prior values.
5523        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5524            mut self,
5525            v: V,
5526        ) -> Self {
5527            self.0.request = v.into();
5528            self
5529        }
5530
5531        /// Sets all the options, replacing any prior values.
5532        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5533            self.0.options = v.into();
5534            self
5535        }
5536
5537        /// Sends the request.
5538        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5539            (*self.0.stub)
5540                .list_locations(self.0.request, self.0.options)
5541                .await
5542                .map(gax::response::Response::into_body)
5543        }
5544
5545        /// Streams each page in the collection.
5546        pub fn by_page(
5547            self,
5548        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5549        {
5550            use std::clone::Clone;
5551            let token = self.0.request.page_token.clone();
5552            let execute = move |token: String| {
5553                let mut builder = self.clone();
5554                builder.0.request = builder.0.request.set_page_token(token);
5555                builder.send()
5556            };
5557            gax::paginator::internal::new_paginator(token, execute)
5558        }
5559
5560        /// Streams each item in the collection.
5561        pub fn by_item(
5562            self,
5563        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5564        {
5565            use gax::paginator::Paginator;
5566            self.by_page().items()
5567        }
5568
5569        /// Sets the value of [name][location::model::ListLocationsRequest::name].
5570        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5571            self.0.request.name = v.into();
5572            self
5573        }
5574
5575        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
5576        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5577            self.0.request.filter = v.into();
5578            self
5579        }
5580
5581        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
5582        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5583            self.0.request.page_size = v.into();
5584            self
5585        }
5586
5587        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
5588        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5589            self.0.request.page_token = v.into();
5590            self
5591        }
5592    }
5593
5594    #[doc(hidden)]
5595    impl gax::options::internal::RequestBuilder for ListLocations {
5596        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5597            &mut self.0.options
5598        }
5599    }
5600
5601    /// The request builder for [NetworkSecurity::get_location][crate::client::NetworkSecurity::get_location] calls.
5602    ///
5603    /// # Example
5604    /// ```no_run
5605    /// # use google_cloud_networksecurity_v1::builder;
5606    /// use builder::network_security::GetLocation;
5607    /// # tokio_test::block_on(async {
5608    ///
5609    /// let builder = prepare_request_builder();
5610    /// let response = builder.send().await?;
5611    /// # gax::Result::<()>::Ok(()) });
5612    ///
5613    /// fn prepare_request_builder() -> GetLocation {
5614    ///   # panic!();
5615    ///   // ... details omitted ...
5616    /// }
5617    /// ```
5618    #[derive(Clone, Debug)]
5619    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5620
5621    impl GetLocation {
5622        pub(crate) fn new(
5623            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5624        ) -> Self {
5625            Self(RequestBuilder::new(stub))
5626        }
5627
5628        /// Sets the full request, replacing any prior values.
5629        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5630            self.0.request = v.into();
5631            self
5632        }
5633
5634        /// Sets all the options, replacing any prior values.
5635        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5636            self.0.options = v.into();
5637            self
5638        }
5639
5640        /// Sends the request.
5641        pub async fn send(self) -> Result<location::model::Location> {
5642            (*self.0.stub)
5643                .get_location(self.0.request, self.0.options)
5644                .await
5645                .map(gax::response::Response::into_body)
5646        }
5647
5648        /// Sets the value of [name][location::model::GetLocationRequest::name].
5649        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5650            self.0.request.name = v.into();
5651            self
5652        }
5653    }
5654
5655    #[doc(hidden)]
5656    impl gax::options::internal::RequestBuilder for GetLocation {
5657        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5658            &mut self.0.options
5659        }
5660    }
5661
5662    /// The request builder for [NetworkSecurity::set_iam_policy][crate::client::NetworkSecurity::set_iam_policy] calls.
5663    ///
5664    /// # Example
5665    /// ```no_run
5666    /// # use google_cloud_networksecurity_v1::builder;
5667    /// use builder::network_security::SetIamPolicy;
5668    /// # tokio_test::block_on(async {
5669    ///
5670    /// let builder = prepare_request_builder();
5671    /// let response = builder.send().await?;
5672    /// # gax::Result::<()>::Ok(()) });
5673    ///
5674    /// fn prepare_request_builder() -> SetIamPolicy {
5675    ///   # panic!();
5676    ///   // ... details omitted ...
5677    /// }
5678    /// ```
5679    #[derive(Clone, Debug)]
5680    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5681
5682    impl SetIamPolicy {
5683        pub(crate) fn new(
5684            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5685        ) -> Self {
5686            Self(RequestBuilder::new(stub))
5687        }
5688
5689        /// Sets the full request, replacing any prior values.
5690        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> 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<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5697            self.0.options = v.into();
5698            self
5699        }
5700
5701        /// Sends the request.
5702        pub async fn send(self) -> Result<iam_v1::model::Policy> {
5703            (*self.0.stub)
5704                .set_iam_policy(self.0.request, self.0.options)
5705                .await
5706                .map(gax::response::Response::into_body)
5707        }
5708
5709        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
5710        ///
5711        /// This is a **required** field for requests.
5712        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5713            self.0.request.resource = v.into();
5714            self
5715        }
5716
5717        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
5718        ///
5719        /// This is a **required** field for requests.
5720        pub fn set_policy<T>(mut self, v: T) -> Self
5721        where
5722            T: std::convert::Into<iam_v1::model::Policy>,
5723        {
5724            self.0.request.policy = std::option::Option::Some(v.into());
5725            self
5726        }
5727
5728        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
5729        ///
5730        /// This is a **required** field for requests.
5731        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5732        where
5733            T: std::convert::Into<iam_v1::model::Policy>,
5734        {
5735            self.0.request.policy = v.map(|x| x.into());
5736            self
5737        }
5738
5739        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
5740        pub fn set_update_mask<T>(mut self, v: T) -> Self
5741        where
5742            T: std::convert::Into<wkt::FieldMask>,
5743        {
5744            self.0.request.update_mask = std::option::Option::Some(v.into());
5745            self
5746        }
5747
5748        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
5749        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5750        where
5751            T: std::convert::Into<wkt::FieldMask>,
5752        {
5753            self.0.request.update_mask = v.map(|x| x.into());
5754            self
5755        }
5756    }
5757
5758    #[doc(hidden)]
5759    impl gax::options::internal::RequestBuilder for SetIamPolicy {
5760        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5761            &mut self.0.options
5762        }
5763    }
5764
5765    /// The request builder for [NetworkSecurity::get_iam_policy][crate::client::NetworkSecurity::get_iam_policy] calls.
5766    ///
5767    /// # Example
5768    /// ```no_run
5769    /// # use google_cloud_networksecurity_v1::builder;
5770    /// use builder::network_security::GetIamPolicy;
5771    /// # tokio_test::block_on(async {
5772    ///
5773    /// let builder = prepare_request_builder();
5774    /// let response = builder.send().await?;
5775    /// # gax::Result::<()>::Ok(()) });
5776    ///
5777    /// fn prepare_request_builder() -> GetIamPolicy {
5778    ///   # panic!();
5779    ///   // ... details omitted ...
5780    /// }
5781    /// ```
5782    #[derive(Clone, Debug)]
5783    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5784
5785    impl GetIamPolicy {
5786        pub(crate) fn new(
5787            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5788        ) -> Self {
5789            Self(RequestBuilder::new(stub))
5790        }
5791
5792        /// Sets the full request, replacing any prior values.
5793        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5794            self.0.request = v.into();
5795            self
5796        }
5797
5798        /// Sets all the options, replacing any prior values.
5799        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5800            self.0.options = v.into();
5801            self
5802        }
5803
5804        /// Sends the request.
5805        pub async fn send(self) -> Result<iam_v1::model::Policy> {
5806            (*self.0.stub)
5807                .get_iam_policy(self.0.request, self.0.options)
5808                .await
5809                .map(gax::response::Response::into_body)
5810        }
5811
5812        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
5813        ///
5814        /// This is a **required** field for requests.
5815        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5816            self.0.request.resource = v.into();
5817            self
5818        }
5819
5820        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
5821        pub fn set_options<T>(mut self, v: T) -> Self
5822        where
5823            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5824        {
5825            self.0.request.options = std::option::Option::Some(v.into());
5826            self
5827        }
5828
5829        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
5830        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5831        where
5832            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5833        {
5834            self.0.request.options = v.map(|x| x.into());
5835            self
5836        }
5837    }
5838
5839    #[doc(hidden)]
5840    impl gax::options::internal::RequestBuilder for GetIamPolicy {
5841        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5842            &mut self.0.options
5843        }
5844    }
5845
5846    /// The request builder for [NetworkSecurity::test_iam_permissions][crate::client::NetworkSecurity::test_iam_permissions] calls.
5847    ///
5848    /// # Example
5849    /// ```no_run
5850    /// # use google_cloud_networksecurity_v1::builder;
5851    /// use builder::network_security::TestIamPermissions;
5852    /// # tokio_test::block_on(async {
5853    ///
5854    /// let builder = prepare_request_builder();
5855    /// let response = builder.send().await?;
5856    /// # gax::Result::<()>::Ok(()) });
5857    ///
5858    /// fn prepare_request_builder() -> TestIamPermissions {
5859    ///   # panic!();
5860    ///   // ... details omitted ...
5861    /// }
5862    /// ```
5863    #[derive(Clone, Debug)]
5864    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5865
5866    impl TestIamPermissions {
5867        pub(crate) fn new(
5868            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5869        ) -> Self {
5870            Self(RequestBuilder::new(stub))
5871        }
5872
5873        /// Sets the full request, replacing any prior values.
5874        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5875            mut self,
5876            v: V,
5877        ) -> Self {
5878            self.0.request = v.into();
5879            self
5880        }
5881
5882        /// Sets all the options, replacing any prior values.
5883        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5884            self.0.options = v.into();
5885            self
5886        }
5887
5888        /// Sends the request.
5889        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5890            (*self.0.stub)
5891                .test_iam_permissions(self.0.request, self.0.options)
5892                .await
5893                .map(gax::response::Response::into_body)
5894        }
5895
5896        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
5897        ///
5898        /// This is a **required** field for requests.
5899        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5900            self.0.request.resource = v.into();
5901            self
5902        }
5903
5904        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
5905        ///
5906        /// This is a **required** field for requests.
5907        pub fn set_permissions<T, V>(mut self, v: T) -> Self
5908        where
5909            T: std::iter::IntoIterator<Item = V>,
5910            V: std::convert::Into<std::string::String>,
5911        {
5912            use std::iter::Iterator;
5913            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5914            self
5915        }
5916    }
5917
5918    #[doc(hidden)]
5919    impl gax::options::internal::RequestBuilder for TestIamPermissions {
5920        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5921            &mut self.0.options
5922        }
5923    }
5924
5925    /// The request builder for [NetworkSecurity::list_operations][crate::client::NetworkSecurity::list_operations] calls.
5926    ///
5927    /// # Example
5928    /// ```no_run
5929    /// # use google_cloud_networksecurity_v1::builder;
5930    /// use builder::network_security::ListOperations;
5931    /// # tokio_test::block_on(async {
5932    /// use gax::paginator::ItemPaginator;
5933    ///
5934    /// let builder = prepare_request_builder();
5935    /// let mut items = builder.by_item();
5936    /// while let Some(result) = items.next().await {
5937    ///   let item = result?;
5938    /// }
5939    /// # gax::Result::<()>::Ok(()) });
5940    ///
5941    /// fn prepare_request_builder() -> ListOperations {
5942    ///   # panic!();
5943    ///   // ... details omitted ...
5944    /// }
5945    /// ```
5946    #[derive(Clone, Debug)]
5947    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5948
5949    impl ListOperations {
5950        pub(crate) fn new(
5951            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
5952        ) -> Self {
5953            Self(RequestBuilder::new(stub))
5954        }
5955
5956        /// Sets the full request, replacing any prior values.
5957        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5958            mut self,
5959            v: V,
5960        ) -> Self {
5961            self.0.request = v.into();
5962            self
5963        }
5964
5965        /// Sets all the options, replacing any prior values.
5966        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5967            self.0.options = v.into();
5968            self
5969        }
5970
5971        /// Sends the request.
5972        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5973            (*self.0.stub)
5974                .list_operations(self.0.request, self.0.options)
5975                .await
5976                .map(gax::response::Response::into_body)
5977        }
5978
5979        /// Streams each page in the collection.
5980        pub fn by_page(
5981            self,
5982        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5983        {
5984            use std::clone::Clone;
5985            let token = self.0.request.page_token.clone();
5986            let execute = move |token: String| {
5987                let mut builder = self.clone();
5988                builder.0.request = builder.0.request.set_page_token(token);
5989                builder.send()
5990            };
5991            gax::paginator::internal::new_paginator(token, execute)
5992        }
5993
5994        /// Streams each item in the collection.
5995        pub fn by_item(
5996            self,
5997        ) -> impl gax::paginator::ItemPaginator<
5998            longrunning::model::ListOperationsResponse,
5999            gax::error::Error,
6000        > {
6001            use gax::paginator::Paginator;
6002            self.by_page().items()
6003        }
6004
6005        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
6006        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6007            self.0.request.name = v.into();
6008            self
6009        }
6010
6011        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
6012        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6013            self.0.request.filter = v.into();
6014            self
6015        }
6016
6017        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
6018        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6019            self.0.request.page_size = v.into();
6020            self
6021        }
6022
6023        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
6024        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6025            self.0.request.page_token = v.into();
6026            self
6027        }
6028
6029        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
6030        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6031            self.0.request.return_partial_success = v.into();
6032            self
6033        }
6034    }
6035
6036    #[doc(hidden)]
6037    impl gax::options::internal::RequestBuilder for ListOperations {
6038        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6039            &mut self.0.options
6040        }
6041    }
6042
6043    /// The request builder for [NetworkSecurity::get_operation][crate::client::NetworkSecurity::get_operation] calls.
6044    ///
6045    /// # Example
6046    /// ```no_run
6047    /// # use google_cloud_networksecurity_v1::builder;
6048    /// use builder::network_security::GetOperation;
6049    /// # tokio_test::block_on(async {
6050    ///
6051    /// let builder = prepare_request_builder();
6052    /// let response = builder.send().await?;
6053    /// # gax::Result::<()>::Ok(()) });
6054    ///
6055    /// fn prepare_request_builder() -> GetOperation {
6056    ///   # panic!();
6057    ///   // ... details omitted ...
6058    /// }
6059    /// ```
6060    #[derive(Clone, Debug)]
6061    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6062
6063    impl GetOperation {
6064        pub(crate) fn new(
6065            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
6066        ) -> Self {
6067            Self(RequestBuilder::new(stub))
6068        }
6069
6070        /// Sets the full request, replacing any prior values.
6071        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6072            mut self,
6073            v: V,
6074        ) -> Self {
6075            self.0.request = v.into();
6076            self
6077        }
6078
6079        /// Sets all the options, replacing any prior values.
6080        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6081            self.0.options = v.into();
6082            self
6083        }
6084
6085        /// Sends the request.
6086        pub async fn send(self) -> Result<longrunning::model::Operation> {
6087            (*self.0.stub)
6088                .get_operation(self.0.request, self.0.options)
6089                .await
6090                .map(gax::response::Response::into_body)
6091        }
6092
6093        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
6094        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6095            self.0.request.name = v.into();
6096            self
6097        }
6098    }
6099
6100    #[doc(hidden)]
6101    impl gax::options::internal::RequestBuilder for GetOperation {
6102        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6103            &mut self.0.options
6104        }
6105    }
6106
6107    /// The request builder for [NetworkSecurity::delete_operation][crate::client::NetworkSecurity::delete_operation] calls.
6108    ///
6109    /// # Example
6110    /// ```no_run
6111    /// # use google_cloud_networksecurity_v1::builder;
6112    /// use builder::network_security::DeleteOperation;
6113    /// # tokio_test::block_on(async {
6114    ///
6115    /// let builder = prepare_request_builder();
6116    /// let response = builder.send().await?;
6117    /// # gax::Result::<()>::Ok(()) });
6118    ///
6119    /// fn prepare_request_builder() -> DeleteOperation {
6120    ///   # panic!();
6121    ///   // ... details omitted ...
6122    /// }
6123    /// ```
6124    #[derive(Clone, Debug)]
6125    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
6126
6127    impl DeleteOperation {
6128        pub(crate) fn new(
6129            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
6130        ) -> Self {
6131            Self(RequestBuilder::new(stub))
6132        }
6133
6134        /// Sets the full request, replacing any prior values.
6135        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
6136            mut self,
6137            v: V,
6138        ) -> Self {
6139            self.0.request = v.into();
6140            self
6141        }
6142
6143        /// Sets all the options, replacing any prior values.
6144        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6145            self.0.options = v.into();
6146            self
6147        }
6148
6149        /// Sends the request.
6150        pub async fn send(self) -> Result<()> {
6151            (*self.0.stub)
6152                .delete_operation(self.0.request, self.0.options)
6153                .await
6154                .map(gax::response::Response::into_body)
6155        }
6156
6157        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
6158        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6159            self.0.request.name = v.into();
6160            self
6161        }
6162    }
6163
6164    #[doc(hidden)]
6165    impl gax::options::internal::RequestBuilder for DeleteOperation {
6166        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6167            &mut self.0.options
6168        }
6169    }
6170
6171    /// The request builder for [NetworkSecurity::cancel_operation][crate::client::NetworkSecurity::cancel_operation] calls.
6172    ///
6173    /// # Example
6174    /// ```no_run
6175    /// # use google_cloud_networksecurity_v1::builder;
6176    /// use builder::network_security::CancelOperation;
6177    /// # tokio_test::block_on(async {
6178    ///
6179    /// let builder = prepare_request_builder();
6180    /// let response = builder.send().await?;
6181    /// # gax::Result::<()>::Ok(()) });
6182    ///
6183    /// fn prepare_request_builder() -> CancelOperation {
6184    ///   # panic!();
6185    ///   // ... details omitted ...
6186    /// }
6187    /// ```
6188    #[derive(Clone, Debug)]
6189    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
6190
6191    impl CancelOperation {
6192        pub(crate) fn new(
6193            stub: std::sync::Arc<dyn super::super::stub::dynamic::NetworkSecurity>,
6194        ) -> Self {
6195            Self(RequestBuilder::new(stub))
6196        }
6197
6198        /// Sets the full request, replacing any prior values.
6199        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
6200            mut self,
6201            v: V,
6202        ) -> Self {
6203            self.0.request = v.into();
6204            self
6205        }
6206
6207        /// Sets all the options, replacing any prior values.
6208        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6209            self.0.options = v.into();
6210            self
6211        }
6212
6213        /// Sends the request.
6214        pub async fn send(self) -> Result<()> {
6215            (*self.0.stub)
6216                .cancel_operation(self.0.request, self.0.options)
6217                .await
6218                .map(gax::response::Response::into_body)
6219        }
6220
6221        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
6222        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6223            self.0.request.name = v.into();
6224            self
6225        }
6226    }
6227
6228    #[doc(hidden)]
6229    impl gax::options::internal::RequestBuilder for CancelOperation {
6230        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6231            &mut self.0.options
6232        }
6233    }
6234}