Skip to main content

google_cloud_networksecurity_v1/
builder.rs

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