Skip to main content

google_cloud_networksecurity_v1/
builder.rs

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