Skip to main content

google_cloud_securityposture_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17/// Request and client builders for [SecurityPosture][crate::client::SecurityPosture].
18pub mod security_posture {
19    use crate::Result;
20
21    /// A builder for [SecurityPosture][crate::client::SecurityPosture].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_securityposture_v1::*;
26    /// # use builder::security_posture::ClientBuilder;
27    /// # use client::SecurityPosture;
28    /// let builder : ClientBuilder = SecurityPosture::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://securityposture.googleapis.com")
31    ///     .build().await?;
32    /// # Ok(()) }
33    /// ```
34    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::SecurityPosture;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = SecurityPosture;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> crate::ClientBuilderResult<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::SecurityPosture] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
55        request: R,
56        options: crate::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [SecurityPosture::list_postures][crate::client::SecurityPosture::list_postures] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_securityposture_v1::builder::security_posture::ListPostures;
79    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
80    /// use google_cloud_gax::paginator::ItemPaginator;
81    ///
82    /// let builder = prepare_request_builder();
83    /// let mut items = builder.by_item();
84    /// while let Some(result) = items.next().await {
85    ///   let item = result?;
86    /// }
87    /// # Ok(()) }
88    ///
89    /// fn prepare_request_builder() -> ListPostures {
90    ///   # panic!();
91    ///   // ... details omitted ...
92    /// }
93    /// ```
94    #[derive(Clone, Debug)]
95    pub struct ListPostures(RequestBuilder<crate::model::ListPosturesRequest>);
96
97    impl ListPostures {
98        pub(crate) fn new(
99            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
100        ) -> Self {
101            Self(RequestBuilder::new(stub))
102        }
103
104        /// Sets the full request, replacing any prior values.
105        pub fn with_request<V: Into<crate::model::ListPosturesRequest>>(mut self, v: V) -> Self {
106            self.0.request = v.into();
107            self
108        }
109
110        /// Sets all the options, replacing any prior values.
111        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112            self.0.options = v.into();
113            self
114        }
115
116        /// Sends the request.
117        pub async fn send(self) -> Result<crate::model::ListPosturesResponse> {
118            (*self.0.stub)
119                .list_postures(self.0.request, self.0.options)
120                .await
121                .map(crate::Response::into_body)
122        }
123
124        /// Streams each page in the collection.
125        pub fn by_page(
126            self,
127        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListPosturesResponse, crate::Error>
128        {
129            use std::clone::Clone;
130            let token = self.0.request.page_token.clone();
131            let execute = move |token: String| {
132                let mut builder = self.clone();
133                builder.0.request = builder.0.request.set_page_token(token);
134                builder.send()
135            };
136            google_cloud_gax::paginator::internal::new_paginator(token, execute)
137        }
138
139        /// Streams each item in the collection.
140        pub fn by_item(
141            self,
142        ) -> impl google_cloud_gax::paginator::ItemPaginator<
143            crate::model::ListPosturesResponse,
144            crate::Error,
145        > {
146            use google_cloud_gax::paginator::Paginator;
147            self.by_page().items()
148        }
149
150        /// Sets the value of [parent][crate::model::ListPosturesRequest::parent].
151        ///
152        /// This is a **required** field for requests.
153        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
154            self.0.request.parent = v.into();
155            self
156        }
157
158        /// Sets the value of [page_size][crate::model::ListPosturesRequest::page_size].
159        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
160            self.0.request.page_size = v.into();
161            self
162        }
163
164        /// Sets the value of [page_token][crate::model::ListPosturesRequest::page_token].
165        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
166            self.0.request.page_token = v.into();
167            self
168        }
169    }
170
171    #[doc(hidden)]
172    impl crate::RequestBuilder for ListPostures {
173        fn request_options(&mut self) -> &mut crate::RequestOptions {
174            &mut self.0.options
175        }
176    }
177
178    /// The request builder for [SecurityPosture::list_posture_revisions][crate::client::SecurityPosture::list_posture_revisions] calls.
179    ///
180    /// # Example
181    /// ```
182    /// # use google_cloud_securityposture_v1::builder::security_posture::ListPostureRevisions;
183    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
184    /// use google_cloud_gax::paginator::ItemPaginator;
185    ///
186    /// let builder = prepare_request_builder();
187    /// let mut items = builder.by_item();
188    /// while let Some(result) = items.next().await {
189    ///   let item = result?;
190    /// }
191    /// # Ok(()) }
192    ///
193    /// fn prepare_request_builder() -> ListPostureRevisions {
194    ///   # panic!();
195    ///   // ... details omitted ...
196    /// }
197    /// ```
198    #[derive(Clone, Debug)]
199    pub struct ListPostureRevisions(RequestBuilder<crate::model::ListPostureRevisionsRequest>);
200
201    impl ListPostureRevisions {
202        pub(crate) fn new(
203            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
204        ) -> Self {
205            Self(RequestBuilder::new(stub))
206        }
207
208        /// Sets the full request, replacing any prior values.
209        pub fn with_request<V: Into<crate::model::ListPostureRevisionsRequest>>(
210            mut self,
211            v: V,
212        ) -> Self {
213            self.0.request = v.into();
214            self
215        }
216
217        /// Sets all the options, replacing any prior values.
218        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
219            self.0.options = v.into();
220            self
221        }
222
223        /// Sends the request.
224        pub async fn send(self) -> Result<crate::model::ListPostureRevisionsResponse> {
225            (*self.0.stub)
226                .list_posture_revisions(self.0.request, self.0.options)
227                .await
228                .map(crate::Response::into_body)
229        }
230
231        /// Streams each page in the collection.
232        pub fn by_page(
233            self,
234        ) -> impl google_cloud_gax::paginator::Paginator<
235            crate::model::ListPostureRevisionsResponse,
236            crate::Error,
237        > {
238            use std::clone::Clone;
239            let token = self.0.request.page_token.clone();
240            let execute = move |token: String| {
241                let mut builder = self.clone();
242                builder.0.request = builder.0.request.set_page_token(token);
243                builder.send()
244            };
245            google_cloud_gax::paginator::internal::new_paginator(token, execute)
246        }
247
248        /// Streams each item in the collection.
249        pub fn by_item(
250            self,
251        ) -> impl google_cloud_gax::paginator::ItemPaginator<
252            crate::model::ListPostureRevisionsResponse,
253            crate::Error,
254        > {
255            use google_cloud_gax::paginator::Paginator;
256            self.by_page().items()
257        }
258
259        /// Sets the value of [name][crate::model::ListPostureRevisionsRequest::name].
260        ///
261        /// This is a **required** field for requests.
262        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
263            self.0.request.name = v.into();
264            self
265        }
266
267        /// Sets the value of [page_size][crate::model::ListPostureRevisionsRequest::page_size].
268        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
269            self.0.request.page_size = v.into();
270            self
271        }
272
273        /// Sets the value of [page_token][crate::model::ListPostureRevisionsRequest::page_token].
274        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
275            self.0.request.page_token = v.into();
276            self
277        }
278    }
279
280    #[doc(hidden)]
281    impl crate::RequestBuilder for ListPostureRevisions {
282        fn request_options(&mut self) -> &mut crate::RequestOptions {
283            &mut self.0.options
284        }
285    }
286
287    /// The request builder for [SecurityPosture::get_posture][crate::client::SecurityPosture::get_posture] calls.
288    ///
289    /// # Example
290    /// ```
291    /// # use google_cloud_securityposture_v1::builder::security_posture::GetPosture;
292    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
293    ///
294    /// let builder = prepare_request_builder();
295    /// let response = builder.send().await?;
296    /// # Ok(()) }
297    ///
298    /// fn prepare_request_builder() -> GetPosture {
299    ///   # panic!();
300    ///   // ... details omitted ...
301    /// }
302    /// ```
303    #[derive(Clone, Debug)]
304    pub struct GetPosture(RequestBuilder<crate::model::GetPostureRequest>);
305
306    impl GetPosture {
307        pub(crate) fn new(
308            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
309        ) -> Self {
310            Self(RequestBuilder::new(stub))
311        }
312
313        /// Sets the full request, replacing any prior values.
314        pub fn with_request<V: Into<crate::model::GetPostureRequest>>(mut self, v: V) -> Self {
315            self.0.request = v.into();
316            self
317        }
318
319        /// Sets all the options, replacing any prior values.
320        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
321            self.0.options = v.into();
322            self
323        }
324
325        /// Sends the request.
326        pub async fn send(self) -> Result<crate::model::Posture> {
327            (*self.0.stub)
328                .get_posture(self.0.request, self.0.options)
329                .await
330                .map(crate::Response::into_body)
331        }
332
333        /// Sets the value of [name][crate::model::GetPostureRequest::name].
334        ///
335        /// This is a **required** field for requests.
336        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
337            self.0.request.name = v.into();
338            self
339        }
340
341        /// Sets the value of [revision_id][crate::model::GetPostureRequest::revision_id].
342        pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
343            self.0.request.revision_id = v.into();
344            self
345        }
346    }
347
348    #[doc(hidden)]
349    impl crate::RequestBuilder for GetPosture {
350        fn request_options(&mut self) -> &mut crate::RequestOptions {
351            &mut self.0.options
352        }
353    }
354
355    /// The request builder for [SecurityPosture::create_posture][crate::client::SecurityPosture::create_posture] calls.
356    ///
357    /// # Example
358    /// ```
359    /// # use google_cloud_securityposture_v1::builder::security_posture::CreatePosture;
360    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
361    /// use google_cloud_lro::Poller;
362    ///
363    /// let builder = prepare_request_builder();
364    /// let response = builder.poller().until_done().await?;
365    /// # Ok(()) }
366    ///
367    /// fn prepare_request_builder() -> CreatePosture {
368    ///   # panic!();
369    ///   // ... details omitted ...
370    /// }
371    /// ```
372    #[derive(Clone, Debug)]
373    pub struct CreatePosture(RequestBuilder<crate::model::CreatePostureRequest>);
374
375    impl CreatePosture {
376        pub(crate) fn new(
377            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
378        ) -> Self {
379            Self(RequestBuilder::new(stub))
380        }
381
382        /// Sets the full request, replacing any prior values.
383        pub fn with_request<V: Into<crate::model::CreatePostureRequest>>(mut self, v: V) -> Self {
384            self.0.request = v.into();
385            self
386        }
387
388        /// Sets all the options, replacing any prior values.
389        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
390            self.0.options = v.into();
391            self
392        }
393
394        /// Sends the request.
395        ///
396        /// # Long running operations
397        ///
398        /// This starts, but does not poll, a longrunning operation. More information
399        /// on [create_posture][crate::client::SecurityPosture::create_posture].
400        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
401            (*self.0.stub)
402                .create_posture(self.0.request, self.0.options)
403                .await
404                .map(crate::Response::into_body)
405        }
406
407        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_posture`.
408        pub fn poller(
409            self,
410        ) -> impl google_cloud_lro::Poller<crate::model::Posture, crate::model::OperationMetadata>
411        {
412            type Operation = google_cloud_lro::internal::Operation<
413                crate::model::Posture,
414                crate::model::OperationMetadata,
415            >;
416            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
417            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
418            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
419            if let Some(ref mut details) = poller_options.tracing {
420                details.method_name = "google_cloud_securityposture_v1::client::SecurityPosture::create_posture::until_done";
421            }
422
423            let stub = self.0.stub.clone();
424            let mut options = self.0.options.clone();
425            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
426            let query = move |name| {
427                let stub = stub.clone();
428                let options = options.clone();
429                async {
430                    let op = GetOperation::new(stub)
431                        .set_name(name)
432                        .with_options(options)
433                        .send()
434                        .await?;
435                    Ok(Operation::new(op))
436                }
437            };
438
439            let start = move || async {
440                let op = self.send().await?;
441                Ok(Operation::new(op))
442            };
443
444            use google_cloud_lro::internal::PollerExt;
445            {
446                google_cloud_lro::internal::new_poller(
447                    polling_error_policy,
448                    polling_backoff_policy,
449                    start,
450                    query,
451                )
452            }
453            .with_options(poller_options)
454        }
455
456        /// Sets the value of [parent][crate::model::CreatePostureRequest::parent].
457        ///
458        /// This is a **required** field for requests.
459        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
460            self.0.request.parent = v.into();
461            self
462        }
463
464        /// Sets the value of [posture_id][crate::model::CreatePostureRequest::posture_id].
465        ///
466        /// This is a **required** field for requests.
467        pub fn set_posture_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
468            self.0.request.posture_id = v.into();
469            self
470        }
471
472        /// Sets the value of [posture][crate::model::CreatePostureRequest::posture].
473        ///
474        /// This is a **required** field for requests.
475        pub fn set_posture<T>(mut self, v: T) -> Self
476        where
477            T: std::convert::Into<crate::model::Posture>,
478        {
479            self.0.request.posture = std::option::Option::Some(v.into());
480            self
481        }
482
483        /// Sets or clears the value of [posture][crate::model::CreatePostureRequest::posture].
484        ///
485        /// This is a **required** field for requests.
486        pub fn set_or_clear_posture<T>(mut self, v: std::option::Option<T>) -> Self
487        where
488            T: std::convert::Into<crate::model::Posture>,
489        {
490            self.0.request.posture = v.map(|x| x.into());
491            self
492        }
493    }
494
495    #[doc(hidden)]
496    impl crate::RequestBuilder for CreatePosture {
497        fn request_options(&mut self) -> &mut crate::RequestOptions {
498            &mut self.0.options
499        }
500    }
501
502    /// The request builder for [SecurityPosture::update_posture][crate::client::SecurityPosture::update_posture] calls.
503    ///
504    /// # Example
505    /// ```
506    /// # use google_cloud_securityposture_v1::builder::security_posture::UpdatePosture;
507    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
508    /// use google_cloud_lro::Poller;
509    ///
510    /// let builder = prepare_request_builder();
511    /// let response = builder.poller().until_done().await?;
512    /// # Ok(()) }
513    ///
514    /// fn prepare_request_builder() -> UpdatePosture {
515    ///   # panic!();
516    ///   // ... details omitted ...
517    /// }
518    /// ```
519    #[derive(Clone, Debug)]
520    pub struct UpdatePosture(RequestBuilder<crate::model::UpdatePostureRequest>);
521
522    impl UpdatePosture {
523        pub(crate) fn new(
524            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
525        ) -> Self {
526            Self(RequestBuilder::new(stub))
527        }
528
529        /// Sets the full request, replacing any prior values.
530        pub fn with_request<V: Into<crate::model::UpdatePostureRequest>>(mut self, v: V) -> Self {
531            self.0.request = v.into();
532            self
533        }
534
535        /// Sets all the options, replacing any prior values.
536        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
537            self.0.options = v.into();
538            self
539        }
540
541        /// Sends the request.
542        ///
543        /// # Long running operations
544        ///
545        /// This starts, but does not poll, a longrunning operation. More information
546        /// on [update_posture][crate::client::SecurityPosture::update_posture].
547        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
548            (*self.0.stub)
549                .update_posture(self.0.request, self.0.options)
550                .await
551                .map(crate::Response::into_body)
552        }
553
554        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_posture`.
555        pub fn poller(
556            self,
557        ) -> impl google_cloud_lro::Poller<crate::model::Posture, crate::model::OperationMetadata>
558        {
559            type Operation = google_cloud_lro::internal::Operation<
560                crate::model::Posture,
561                crate::model::OperationMetadata,
562            >;
563            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
564            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
565            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
566            if let Some(ref mut details) = poller_options.tracing {
567                details.method_name = "google_cloud_securityposture_v1::client::SecurityPosture::update_posture::until_done";
568            }
569
570            let stub = self.0.stub.clone();
571            let mut options = self.0.options.clone();
572            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
573            let query = move |name| {
574                let stub = stub.clone();
575                let options = options.clone();
576                async {
577                    let op = GetOperation::new(stub)
578                        .set_name(name)
579                        .with_options(options)
580                        .send()
581                        .await?;
582                    Ok(Operation::new(op))
583                }
584            };
585
586            let start = move || async {
587                let op = self.send().await?;
588                Ok(Operation::new(op))
589            };
590
591            use google_cloud_lro::internal::PollerExt;
592            {
593                google_cloud_lro::internal::new_poller(
594                    polling_error_policy,
595                    polling_backoff_policy,
596                    start,
597                    query,
598                )
599            }
600            .with_options(poller_options)
601        }
602
603        /// Sets the value of [update_mask][crate::model::UpdatePostureRequest::update_mask].
604        ///
605        /// This is a **required** field for requests.
606        pub fn set_update_mask<T>(mut self, v: T) -> Self
607        where
608            T: std::convert::Into<wkt::FieldMask>,
609        {
610            self.0.request.update_mask = std::option::Option::Some(v.into());
611            self
612        }
613
614        /// Sets or clears the value of [update_mask][crate::model::UpdatePostureRequest::update_mask].
615        ///
616        /// This is a **required** field for requests.
617        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
618        where
619            T: std::convert::Into<wkt::FieldMask>,
620        {
621            self.0.request.update_mask = v.map(|x| x.into());
622            self
623        }
624
625        /// Sets the value of [posture][crate::model::UpdatePostureRequest::posture].
626        ///
627        /// This is a **required** field for requests.
628        pub fn set_posture<T>(mut self, v: T) -> Self
629        where
630            T: std::convert::Into<crate::model::Posture>,
631        {
632            self.0.request.posture = std::option::Option::Some(v.into());
633            self
634        }
635
636        /// Sets or clears the value of [posture][crate::model::UpdatePostureRequest::posture].
637        ///
638        /// This is a **required** field for requests.
639        pub fn set_or_clear_posture<T>(mut self, v: std::option::Option<T>) -> Self
640        where
641            T: std::convert::Into<crate::model::Posture>,
642        {
643            self.0.request.posture = v.map(|x| x.into());
644            self
645        }
646
647        /// Sets the value of [revision_id][crate::model::UpdatePostureRequest::revision_id].
648        ///
649        /// This is a **required** field for requests.
650        pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
651            self.0.request.revision_id = v.into();
652            self
653        }
654    }
655
656    #[doc(hidden)]
657    impl crate::RequestBuilder for UpdatePosture {
658        fn request_options(&mut self) -> &mut crate::RequestOptions {
659            &mut self.0.options
660        }
661    }
662
663    /// The request builder for [SecurityPosture::delete_posture][crate::client::SecurityPosture::delete_posture] calls.
664    ///
665    /// # Example
666    /// ```
667    /// # use google_cloud_securityposture_v1::builder::security_posture::DeletePosture;
668    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
669    /// use google_cloud_lro::Poller;
670    ///
671    /// let builder = prepare_request_builder();
672    /// let response = builder.poller().until_done().await?;
673    /// # Ok(()) }
674    ///
675    /// fn prepare_request_builder() -> DeletePosture {
676    ///   # panic!();
677    ///   // ... details omitted ...
678    /// }
679    /// ```
680    #[derive(Clone, Debug)]
681    pub struct DeletePosture(RequestBuilder<crate::model::DeletePostureRequest>);
682
683    impl DeletePosture {
684        pub(crate) fn new(
685            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
686        ) -> Self {
687            Self(RequestBuilder::new(stub))
688        }
689
690        /// Sets the full request, replacing any prior values.
691        pub fn with_request<V: Into<crate::model::DeletePostureRequest>>(mut self, v: V) -> Self {
692            self.0.request = v.into();
693            self
694        }
695
696        /// Sets all the options, replacing any prior values.
697        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
698            self.0.options = v.into();
699            self
700        }
701
702        /// Sends the request.
703        ///
704        /// # Long running operations
705        ///
706        /// This starts, but does not poll, a longrunning operation. More information
707        /// on [delete_posture][crate::client::SecurityPosture::delete_posture].
708        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
709            (*self.0.stub)
710                .delete_posture(self.0.request, self.0.options)
711                .await
712                .map(crate::Response::into_body)
713        }
714
715        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_posture`.
716        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
717            type Operation =
718                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
719            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
720            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
721            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
722            if let Some(ref mut details) = poller_options.tracing {
723                details.method_name = "google_cloud_securityposture_v1::client::SecurityPosture::delete_posture::until_done";
724            }
725
726            let stub = self.0.stub.clone();
727            let mut options = self.0.options.clone();
728            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
729            let query = move |name| {
730                let stub = stub.clone();
731                let options = options.clone();
732                async {
733                    let op = GetOperation::new(stub)
734                        .set_name(name)
735                        .with_options(options)
736                        .send()
737                        .await?;
738                    Ok(Operation::new(op))
739                }
740            };
741
742            let start = move || async {
743                let op = self.send().await?;
744                Ok(Operation::new(op))
745            };
746
747            use google_cloud_lro::internal::PollerExt;
748            {
749                google_cloud_lro::internal::new_unit_response_poller(
750                    polling_error_policy,
751                    polling_backoff_policy,
752                    start,
753                    query,
754                )
755            }
756            .with_options(poller_options)
757        }
758
759        /// Sets the value of [name][crate::model::DeletePostureRequest::name].
760        ///
761        /// This is a **required** field for requests.
762        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
763            self.0.request.name = v.into();
764            self
765        }
766
767        /// Sets the value of [etag][crate::model::DeletePostureRequest::etag].
768        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
769            self.0.request.etag = v.into();
770            self
771        }
772    }
773
774    #[doc(hidden)]
775    impl crate::RequestBuilder for DeletePosture {
776        fn request_options(&mut self) -> &mut crate::RequestOptions {
777            &mut self.0.options
778        }
779    }
780
781    /// The request builder for [SecurityPosture::extract_posture][crate::client::SecurityPosture::extract_posture] calls.
782    ///
783    /// # Example
784    /// ```
785    /// # use google_cloud_securityposture_v1::builder::security_posture::ExtractPosture;
786    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
787    /// use google_cloud_lro::Poller;
788    ///
789    /// let builder = prepare_request_builder();
790    /// let response = builder.poller().until_done().await?;
791    /// # Ok(()) }
792    ///
793    /// fn prepare_request_builder() -> ExtractPosture {
794    ///   # panic!();
795    ///   // ... details omitted ...
796    /// }
797    /// ```
798    #[derive(Clone, Debug)]
799    pub struct ExtractPosture(RequestBuilder<crate::model::ExtractPostureRequest>);
800
801    impl ExtractPosture {
802        pub(crate) fn new(
803            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
804        ) -> Self {
805            Self(RequestBuilder::new(stub))
806        }
807
808        /// Sets the full request, replacing any prior values.
809        pub fn with_request<V: Into<crate::model::ExtractPostureRequest>>(mut self, v: V) -> Self {
810            self.0.request = v.into();
811            self
812        }
813
814        /// Sets all the options, replacing any prior values.
815        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
816            self.0.options = v.into();
817            self
818        }
819
820        /// Sends the request.
821        ///
822        /// # Long running operations
823        ///
824        /// This starts, but does not poll, a longrunning operation. More information
825        /// on [extract_posture][crate::client::SecurityPosture::extract_posture].
826        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
827            (*self.0.stub)
828                .extract_posture(self.0.request, self.0.options)
829                .await
830                .map(crate::Response::into_body)
831        }
832
833        /// Creates a [Poller][google_cloud_lro::Poller] to work with `extract_posture`.
834        pub fn poller(
835            self,
836        ) -> impl google_cloud_lro::Poller<crate::model::Posture, crate::model::OperationMetadata>
837        {
838            type Operation = google_cloud_lro::internal::Operation<
839                crate::model::Posture,
840                crate::model::OperationMetadata,
841            >;
842            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
843            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
844            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
845            if let Some(ref mut details) = poller_options.tracing {
846                details.method_name = "google_cloud_securityposture_v1::client::SecurityPosture::extract_posture::until_done";
847            }
848
849            let stub = self.0.stub.clone();
850            let mut options = self.0.options.clone();
851            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
852            let query = move |name| {
853                let stub = stub.clone();
854                let options = options.clone();
855                async {
856                    let op = GetOperation::new(stub)
857                        .set_name(name)
858                        .with_options(options)
859                        .send()
860                        .await?;
861                    Ok(Operation::new(op))
862                }
863            };
864
865            let start = move || async {
866                let op = self.send().await?;
867                Ok(Operation::new(op))
868            };
869
870            use google_cloud_lro::internal::PollerExt;
871            {
872                google_cloud_lro::internal::new_poller(
873                    polling_error_policy,
874                    polling_backoff_policy,
875                    start,
876                    query,
877                )
878            }
879            .with_options(poller_options)
880        }
881
882        /// Sets the value of [parent][crate::model::ExtractPostureRequest::parent].
883        ///
884        /// This is a **required** field for requests.
885        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
886            self.0.request.parent = v.into();
887            self
888        }
889
890        /// Sets the value of [posture_id][crate::model::ExtractPostureRequest::posture_id].
891        ///
892        /// This is a **required** field for requests.
893        pub fn set_posture_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
894            self.0.request.posture_id = v.into();
895            self
896        }
897
898        /// Sets the value of [workload][crate::model::ExtractPostureRequest::workload].
899        ///
900        /// This is a **required** field for requests.
901        pub fn set_workload<T: Into<std::string::String>>(mut self, v: T) -> Self {
902            self.0.request.workload = v.into();
903            self
904        }
905    }
906
907    #[doc(hidden)]
908    impl crate::RequestBuilder for ExtractPosture {
909        fn request_options(&mut self) -> &mut crate::RequestOptions {
910            &mut self.0.options
911        }
912    }
913
914    /// The request builder for [SecurityPosture::list_posture_deployments][crate::client::SecurityPosture::list_posture_deployments] calls.
915    ///
916    /// # Example
917    /// ```
918    /// # use google_cloud_securityposture_v1::builder::security_posture::ListPostureDeployments;
919    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
920    /// use google_cloud_gax::paginator::ItemPaginator;
921    ///
922    /// let builder = prepare_request_builder();
923    /// let mut items = builder.by_item();
924    /// while let Some(result) = items.next().await {
925    ///   let item = result?;
926    /// }
927    /// # Ok(()) }
928    ///
929    /// fn prepare_request_builder() -> ListPostureDeployments {
930    ///   # panic!();
931    ///   // ... details omitted ...
932    /// }
933    /// ```
934    #[derive(Clone, Debug)]
935    pub struct ListPostureDeployments(RequestBuilder<crate::model::ListPostureDeploymentsRequest>);
936
937    impl ListPostureDeployments {
938        pub(crate) fn new(
939            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
940        ) -> Self {
941            Self(RequestBuilder::new(stub))
942        }
943
944        /// Sets the full request, replacing any prior values.
945        pub fn with_request<V: Into<crate::model::ListPostureDeploymentsRequest>>(
946            mut self,
947            v: V,
948        ) -> Self {
949            self.0.request = v.into();
950            self
951        }
952
953        /// Sets all the options, replacing any prior values.
954        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
955            self.0.options = v.into();
956            self
957        }
958
959        /// Sends the request.
960        pub async fn send(self) -> Result<crate::model::ListPostureDeploymentsResponse> {
961            (*self.0.stub)
962                .list_posture_deployments(self.0.request, self.0.options)
963                .await
964                .map(crate::Response::into_body)
965        }
966
967        /// Streams each page in the collection.
968        pub fn by_page(
969            self,
970        ) -> impl google_cloud_gax::paginator::Paginator<
971            crate::model::ListPostureDeploymentsResponse,
972            crate::Error,
973        > {
974            use std::clone::Clone;
975            let token = self.0.request.page_token.clone();
976            let execute = move |token: String| {
977                let mut builder = self.clone();
978                builder.0.request = builder.0.request.set_page_token(token);
979                builder.send()
980            };
981            google_cloud_gax::paginator::internal::new_paginator(token, execute)
982        }
983
984        /// Streams each item in the collection.
985        pub fn by_item(
986            self,
987        ) -> impl google_cloud_gax::paginator::ItemPaginator<
988            crate::model::ListPostureDeploymentsResponse,
989            crate::Error,
990        > {
991            use google_cloud_gax::paginator::Paginator;
992            self.by_page().items()
993        }
994
995        /// Sets the value of [parent][crate::model::ListPostureDeploymentsRequest::parent].
996        ///
997        /// This is a **required** field for requests.
998        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
999            self.0.request.parent = v.into();
1000            self
1001        }
1002
1003        /// Sets the value of [page_size][crate::model::ListPostureDeploymentsRequest::page_size].
1004        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1005            self.0.request.page_size = v.into();
1006            self
1007        }
1008
1009        /// Sets the value of [page_token][crate::model::ListPostureDeploymentsRequest::page_token].
1010        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1011            self.0.request.page_token = v.into();
1012            self
1013        }
1014
1015        /// Sets the value of [filter][crate::model::ListPostureDeploymentsRequest::filter].
1016        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1017            self.0.request.filter = v.into();
1018            self
1019        }
1020    }
1021
1022    #[doc(hidden)]
1023    impl crate::RequestBuilder for ListPostureDeployments {
1024        fn request_options(&mut self) -> &mut crate::RequestOptions {
1025            &mut self.0.options
1026        }
1027    }
1028
1029    /// The request builder for [SecurityPosture::get_posture_deployment][crate::client::SecurityPosture::get_posture_deployment] calls.
1030    ///
1031    /// # Example
1032    /// ```
1033    /// # use google_cloud_securityposture_v1::builder::security_posture::GetPostureDeployment;
1034    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
1035    ///
1036    /// let builder = prepare_request_builder();
1037    /// let response = builder.send().await?;
1038    /// # Ok(()) }
1039    ///
1040    /// fn prepare_request_builder() -> GetPostureDeployment {
1041    ///   # panic!();
1042    ///   // ... details omitted ...
1043    /// }
1044    /// ```
1045    #[derive(Clone, Debug)]
1046    pub struct GetPostureDeployment(RequestBuilder<crate::model::GetPostureDeploymentRequest>);
1047
1048    impl GetPostureDeployment {
1049        pub(crate) fn new(
1050            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1051        ) -> Self {
1052            Self(RequestBuilder::new(stub))
1053        }
1054
1055        /// Sets the full request, replacing any prior values.
1056        pub fn with_request<V: Into<crate::model::GetPostureDeploymentRequest>>(
1057            mut self,
1058            v: V,
1059        ) -> Self {
1060            self.0.request = v.into();
1061            self
1062        }
1063
1064        /// Sets all the options, replacing any prior values.
1065        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1066            self.0.options = v.into();
1067            self
1068        }
1069
1070        /// Sends the request.
1071        pub async fn send(self) -> Result<crate::model::PostureDeployment> {
1072            (*self.0.stub)
1073                .get_posture_deployment(self.0.request, self.0.options)
1074                .await
1075                .map(crate::Response::into_body)
1076        }
1077
1078        /// Sets the value of [name][crate::model::GetPostureDeploymentRequest::name].
1079        ///
1080        /// This is a **required** field for requests.
1081        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1082            self.0.request.name = v.into();
1083            self
1084        }
1085    }
1086
1087    #[doc(hidden)]
1088    impl crate::RequestBuilder for GetPostureDeployment {
1089        fn request_options(&mut self) -> &mut crate::RequestOptions {
1090            &mut self.0.options
1091        }
1092    }
1093
1094    /// The request builder for [SecurityPosture::create_posture_deployment][crate::client::SecurityPosture::create_posture_deployment] calls.
1095    ///
1096    /// # Example
1097    /// ```
1098    /// # use google_cloud_securityposture_v1::builder::security_posture::CreatePostureDeployment;
1099    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
1100    /// use google_cloud_lro::Poller;
1101    ///
1102    /// let builder = prepare_request_builder();
1103    /// let response = builder.poller().until_done().await?;
1104    /// # Ok(()) }
1105    ///
1106    /// fn prepare_request_builder() -> CreatePostureDeployment {
1107    ///   # panic!();
1108    ///   // ... details omitted ...
1109    /// }
1110    /// ```
1111    #[derive(Clone, Debug)]
1112    pub struct CreatePostureDeployment(
1113        RequestBuilder<crate::model::CreatePostureDeploymentRequest>,
1114    );
1115
1116    impl CreatePostureDeployment {
1117        pub(crate) fn new(
1118            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1119        ) -> Self {
1120            Self(RequestBuilder::new(stub))
1121        }
1122
1123        /// Sets the full request, replacing any prior values.
1124        pub fn with_request<V: Into<crate::model::CreatePostureDeploymentRequest>>(
1125            mut self,
1126            v: V,
1127        ) -> Self {
1128            self.0.request = v.into();
1129            self
1130        }
1131
1132        /// Sets all the options, replacing any prior values.
1133        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1134            self.0.options = v.into();
1135            self
1136        }
1137
1138        /// Sends the request.
1139        ///
1140        /// # Long running operations
1141        ///
1142        /// This starts, but does not poll, a longrunning operation. More information
1143        /// on [create_posture_deployment][crate::client::SecurityPosture::create_posture_deployment].
1144        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1145            (*self.0.stub)
1146                .create_posture_deployment(self.0.request, self.0.options)
1147                .await
1148                .map(crate::Response::into_body)
1149        }
1150
1151        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_posture_deployment`.
1152        pub fn poller(
1153            self,
1154        ) -> impl google_cloud_lro::Poller<
1155            crate::model::PostureDeployment,
1156            crate::model::OperationMetadata,
1157        > {
1158            type Operation = google_cloud_lro::internal::Operation<
1159                crate::model::PostureDeployment,
1160                crate::model::OperationMetadata,
1161            >;
1162            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1163            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1164            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1165            if let Some(ref mut details) = poller_options.tracing {
1166                details.method_name = "google_cloud_securityposture_v1::client::SecurityPosture::create_posture_deployment::until_done";
1167            }
1168
1169            let stub = self.0.stub.clone();
1170            let mut options = self.0.options.clone();
1171            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1172            let query = move |name| {
1173                let stub = stub.clone();
1174                let options = options.clone();
1175                async {
1176                    let op = GetOperation::new(stub)
1177                        .set_name(name)
1178                        .with_options(options)
1179                        .send()
1180                        .await?;
1181                    Ok(Operation::new(op))
1182                }
1183            };
1184
1185            let start = move || async {
1186                let op = self.send().await?;
1187                Ok(Operation::new(op))
1188            };
1189
1190            use google_cloud_lro::internal::PollerExt;
1191            {
1192                google_cloud_lro::internal::new_poller(
1193                    polling_error_policy,
1194                    polling_backoff_policy,
1195                    start,
1196                    query,
1197                )
1198            }
1199            .with_options(poller_options)
1200        }
1201
1202        /// Sets the value of [parent][crate::model::CreatePostureDeploymentRequest::parent].
1203        ///
1204        /// This is a **required** field for requests.
1205        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1206            self.0.request.parent = v.into();
1207            self
1208        }
1209
1210        /// Sets the value of [posture_deployment_id][crate::model::CreatePostureDeploymentRequest::posture_deployment_id].
1211        ///
1212        /// This is a **required** field for requests.
1213        pub fn set_posture_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1214            self.0.request.posture_deployment_id = v.into();
1215            self
1216        }
1217
1218        /// Sets the value of [posture_deployment][crate::model::CreatePostureDeploymentRequest::posture_deployment].
1219        ///
1220        /// This is a **required** field for requests.
1221        pub fn set_posture_deployment<T>(mut self, v: T) -> Self
1222        where
1223            T: std::convert::Into<crate::model::PostureDeployment>,
1224        {
1225            self.0.request.posture_deployment = std::option::Option::Some(v.into());
1226            self
1227        }
1228
1229        /// Sets or clears the value of [posture_deployment][crate::model::CreatePostureDeploymentRequest::posture_deployment].
1230        ///
1231        /// This is a **required** field for requests.
1232        pub fn set_or_clear_posture_deployment<T>(mut self, v: std::option::Option<T>) -> Self
1233        where
1234            T: std::convert::Into<crate::model::PostureDeployment>,
1235        {
1236            self.0.request.posture_deployment = v.map(|x| x.into());
1237            self
1238        }
1239    }
1240
1241    #[doc(hidden)]
1242    impl crate::RequestBuilder for CreatePostureDeployment {
1243        fn request_options(&mut self) -> &mut crate::RequestOptions {
1244            &mut self.0.options
1245        }
1246    }
1247
1248    /// The request builder for [SecurityPosture::update_posture_deployment][crate::client::SecurityPosture::update_posture_deployment] calls.
1249    ///
1250    /// # Example
1251    /// ```
1252    /// # use google_cloud_securityposture_v1::builder::security_posture::UpdatePostureDeployment;
1253    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
1254    /// use google_cloud_lro::Poller;
1255    ///
1256    /// let builder = prepare_request_builder();
1257    /// let response = builder.poller().until_done().await?;
1258    /// # Ok(()) }
1259    ///
1260    /// fn prepare_request_builder() -> UpdatePostureDeployment {
1261    ///   # panic!();
1262    ///   // ... details omitted ...
1263    /// }
1264    /// ```
1265    #[derive(Clone, Debug)]
1266    pub struct UpdatePostureDeployment(
1267        RequestBuilder<crate::model::UpdatePostureDeploymentRequest>,
1268    );
1269
1270    impl UpdatePostureDeployment {
1271        pub(crate) fn new(
1272            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1273        ) -> Self {
1274            Self(RequestBuilder::new(stub))
1275        }
1276
1277        /// Sets the full request, replacing any prior values.
1278        pub fn with_request<V: Into<crate::model::UpdatePostureDeploymentRequest>>(
1279            mut self,
1280            v: V,
1281        ) -> Self {
1282            self.0.request = v.into();
1283            self
1284        }
1285
1286        /// Sets all the options, replacing any prior values.
1287        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1288            self.0.options = v.into();
1289            self
1290        }
1291
1292        /// Sends the request.
1293        ///
1294        /// # Long running operations
1295        ///
1296        /// This starts, but does not poll, a longrunning operation. More information
1297        /// on [update_posture_deployment][crate::client::SecurityPosture::update_posture_deployment].
1298        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1299            (*self.0.stub)
1300                .update_posture_deployment(self.0.request, self.0.options)
1301                .await
1302                .map(crate::Response::into_body)
1303        }
1304
1305        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_posture_deployment`.
1306        pub fn poller(
1307            self,
1308        ) -> impl google_cloud_lro::Poller<
1309            crate::model::PostureDeployment,
1310            crate::model::OperationMetadata,
1311        > {
1312            type Operation = google_cloud_lro::internal::Operation<
1313                crate::model::PostureDeployment,
1314                crate::model::OperationMetadata,
1315            >;
1316            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1317            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1318            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1319            if let Some(ref mut details) = poller_options.tracing {
1320                details.method_name = "google_cloud_securityposture_v1::client::SecurityPosture::update_posture_deployment::until_done";
1321            }
1322
1323            let stub = self.0.stub.clone();
1324            let mut options = self.0.options.clone();
1325            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1326            let query = move |name| {
1327                let stub = stub.clone();
1328                let options = options.clone();
1329                async {
1330                    let op = GetOperation::new(stub)
1331                        .set_name(name)
1332                        .with_options(options)
1333                        .send()
1334                        .await?;
1335                    Ok(Operation::new(op))
1336                }
1337            };
1338
1339            let start = move || async {
1340                let op = self.send().await?;
1341                Ok(Operation::new(op))
1342            };
1343
1344            use google_cloud_lro::internal::PollerExt;
1345            {
1346                google_cloud_lro::internal::new_poller(
1347                    polling_error_policy,
1348                    polling_backoff_policy,
1349                    start,
1350                    query,
1351                )
1352            }
1353            .with_options(poller_options)
1354        }
1355
1356        /// Sets the value of [update_mask][crate::model::UpdatePostureDeploymentRequest::update_mask].
1357        ///
1358        /// This is a **required** field for requests.
1359        pub fn set_update_mask<T>(mut self, v: T) -> Self
1360        where
1361            T: std::convert::Into<wkt::FieldMask>,
1362        {
1363            self.0.request.update_mask = std::option::Option::Some(v.into());
1364            self
1365        }
1366
1367        /// Sets or clears the value of [update_mask][crate::model::UpdatePostureDeploymentRequest::update_mask].
1368        ///
1369        /// This is a **required** field for requests.
1370        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1371        where
1372            T: std::convert::Into<wkt::FieldMask>,
1373        {
1374            self.0.request.update_mask = v.map(|x| x.into());
1375            self
1376        }
1377
1378        /// Sets the value of [posture_deployment][crate::model::UpdatePostureDeploymentRequest::posture_deployment].
1379        ///
1380        /// This is a **required** field for requests.
1381        pub fn set_posture_deployment<T>(mut self, v: T) -> Self
1382        where
1383            T: std::convert::Into<crate::model::PostureDeployment>,
1384        {
1385            self.0.request.posture_deployment = std::option::Option::Some(v.into());
1386            self
1387        }
1388
1389        /// Sets or clears the value of [posture_deployment][crate::model::UpdatePostureDeploymentRequest::posture_deployment].
1390        ///
1391        /// This is a **required** field for requests.
1392        pub fn set_or_clear_posture_deployment<T>(mut self, v: std::option::Option<T>) -> Self
1393        where
1394            T: std::convert::Into<crate::model::PostureDeployment>,
1395        {
1396            self.0.request.posture_deployment = v.map(|x| x.into());
1397            self
1398        }
1399    }
1400
1401    #[doc(hidden)]
1402    impl crate::RequestBuilder for UpdatePostureDeployment {
1403        fn request_options(&mut self) -> &mut crate::RequestOptions {
1404            &mut self.0.options
1405        }
1406    }
1407
1408    /// The request builder for [SecurityPosture::delete_posture_deployment][crate::client::SecurityPosture::delete_posture_deployment] calls.
1409    ///
1410    /// # Example
1411    /// ```
1412    /// # use google_cloud_securityposture_v1::builder::security_posture::DeletePostureDeployment;
1413    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
1414    /// use google_cloud_lro::Poller;
1415    ///
1416    /// let builder = prepare_request_builder();
1417    /// let response = builder.poller().until_done().await?;
1418    /// # Ok(()) }
1419    ///
1420    /// fn prepare_request_builder() -> DeletePostureDeployment {
1421    ///   # panic!();
1422    ///   // ... details omitted ...
1423    /// }
1424    /// ```
1425    #[derive(Clone, Debug)]
1426    pub struct DeletePostureDeployment(
1427        RequestBuilder<crate::model::DeletePostureDeploymentRequest>,
1428    );
1429
1430    impl DeletePostureDeployment {
1431        pub(crate) fn new(
1432            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1433        ) -> Self {
1434            Self(RequestBuilder::new(stub))
1435        }
1436
1437        /// Sets the full request, replacing any prior values.
1438        pub fn with_request<V: Into<crate::model::DeletePostureDeploymentRequest>>(
1439            mut self,
1440            v: V,
1441        ) -> Self {
1442            self.0.request = v.into();
1443            self
1444        }
1445
1446        /// Sets all the options, replacing any prior values.
1447        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1448            self.0.options = v.into();
1449            self
1450        }
1451
1452        /// Sends the request.
1453        ///
1454        /// # Long running operations
1455        ///
1456        /// This starts, but does not poll, a longrunning operation. More information
1457        /// on [delete_posture_deployment][crate::client::SecurityPosture::delete_posture_deployment].
1458        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1459            (*self.0.stub)
1460                .delete_posture_deployment(self.0.request, self.0.options)
1461                .await
1462                .map(crate::Response::into_body)
1463        }
1464
1465        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_posture_deployment`.
1466        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1467            type Operation =
1468                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1469            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1470            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1471            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1472            if let Some(ref mut details) = poller_options.tracing {
1473                details.method_name = "google_cloud_securityposture_v1::client::SecurityPosture::delete_posture_deployment::until_done";
1474            }
1475
1476            let stub = self.0.stub.clone();
1477            let mut options = self.0.options.clone();
1478            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1479            let query = move |name| {
1480                let stub = stub.clone();
1481                let options = options.clone();
1482                async {
1483                    let op = GetOperation::new(stub)
1484                        .set_name(name)
1485                        .with_options(options)
1486                        .send()
1487                        .await?;
1488                    Ok(Operation::new(op))
1489                }
1490            };
1491
1492            let start = move || async {
1493                let op = self.send().await?;
1494                Ok(Operation::new(op))
1495            };
1496
1497            use google_cloud_lro::internal::PollerExt;
1498            {
1499                google_cloud_lro::internal::new_unit_response_poller(
1500                    polling_error_policy,
1501                    polling_backoff_policy,
1502                    start,
1503                    query,
1504                )
1505            }
1506            .with_options(poller_options)
1507        }
1508
1509        /// Sets the value of [name][crate::model::DeletePostureDeploymentRequest::name].
1510        ///
1511        /// This is a **required** field for requests.
1512        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1513            self.0.request.name = v.into();
1514            self
1515        }
1516
1517        /// Sets the value of [etag][crate::model::DeletePostureDeploymentRequest::etag].
1518        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1519            self.0.request.etag = v.into();
1520            self
1521        }
1522    }
1523
1524    #[doc(hidden)]
1525    impl crate::RequestBuilder for DeletePostureDeployment {
1526        fn request_options(&mut self) -> &mut crate::RequestOptions {
1527            &mut self.0.options
1528        }
1529    }
1530
1531    /// The request builder for [SecurityPosture::list_posture_templates][crate::client::SecurityPosture::list_posture_templates] calls.
1532    ///
1533    /// # Example
1534    /// ```
1535    /// # use google_cloud_securityposture_v1::builder::security_posture::ListPostureTemplates;
1536    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
1537    /// use google_cloud_gax::paginator::ItemPaginator;
1538    ///
1539    /// let builder = prepare_request_builder();
1540    /// let mut items = builder.by_item();
1541    /// while let Some(result) = items.next().await {
1542    ///   let item = result?;
1543    /// }
1544    /// # Ok(()) }
1545    ///
1546    /// fn prepare_request_builder() -> ListPostureTemplates {
1547    ///   # panic!();
1548    ///   // ... details omitted ...
1549    /// }
1550    /// ```
1551    #[derive(Clone, Debug)]
1552    pub struct ListPostureTemplates(RequestBuilder<crate::model::ListPostureTemplatesRequest>);
1553
1554    impl ListPostureTemplates {
1555        pub(crate) fn new(
1556            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1557        ) -> Self {
1558            Self(RequestBuilder::new(stub))
1559        }
1560
1561        /// Sets the full request, replacing any prior values.
1562        pub fn with_request<V: Into<crate::model::ListPostureTemplatesRequest>>(
1563            mut self,
1564            v: V,
1565        ) -> Self {
1566            self.0.request = v.into();
1567            self
1568        }
1569
1570        /// Sets all the options, replacing any prior values.
1571        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1572            self.0.options = v.into();
1573            self
1574        }
1575
1576        /// Sends the request.
1577        pub async fn send(self) -> Result<crate::model::ListPostureTemplatesResponse> {
1578            (*self.0.stub)
1579                .list_posture_templates(self.0.request, self.0.options)
1580                .await
1581                .map(crate::Response::into_body)
1582        }
1583
1584        /// Streams each page in the collection.
1585        pub fn by_page(
1586            self,
1587        ) -> impl google_cloud_gax::paginator::Paginator<
1588            crate::model::ListPostureTemplatesResponse,
1589            crate::Error,
1590        > {
1591            use std::clone::Clone;
1592            let token = self.0.request.page_token.clone();
1593            let execute = move |token: String| {
1594                let mut builder = self.clone();
1595                builder.0.request = builder.0.request.set_page_token(token);
1596                builder.send()
1597            };
1598            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1599        }
1600
1601        /// Streams each item in the collection.
1602        pub fn by_item(
1603            self,
1604        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1605            crate::model::ListPostureTemplatesResponse,
1606            crate::Error,
1607        > {
1608            use google_cloud_gax::paginator::Paginator;
1609            self.by_page().items()
1610        }
1611
1612        /// Sets the value of [parent][crate::model::ListPostureTemplatesRequest::parent].
1613        ///
1614        /// This is a **required** field for requests.
1615        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1616            self.0.request.parent = v.into();
1617            self
1618        }
1619
1620        /// Sets the value of [page_size][crate::model::ListPostureTemplatesRequest::page_size].
1621        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1622            self.0.request.page_size = v.into();
1623            self
1624        }
1625
1626        /// Sets the value of [page_token][crate::model::ListPostureTemplatesRequest::page_token].
1627        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1628            self.0.request.page_token = v.into();
1629            self
1630        }
1631
1632        /// Sets the value of [filter][crate::model::ListPostureTemplatesRequest::filter].
1633        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1634            self.0.request.filter = v.into();
1635            self
1636        }
1637    }
1638
1639    #[doc(hidden)]
1640    impl crate::RequestBuilder for ListPostureTemplates {
1641        fn request_options(&mut self) -> &mut crate::RequestOptions {
1642            &mut self.0.options
1643        }
1644    }
1645
1646    /// The request builder for [SecurityPosture::get_posture_template][crate::client::SecurityPosture::get_posture_template] calls.
1647    ///
1648    /// # Example
1649    /// ```
1650    /// # use google_cloud_securityposture_v1::builder::security_posture::GetPostureTemplate;
1651    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
1652    ///
1653    /// let builder = prepare_request_builder();
1654    /// let response = builder.send().await?;
1655    /// # Ok(()) }
1656    ///
1657    /// fn prepare_request_builder() -> GetPostureTemplate {
1658    ///   # panic!();
1659    ///   // ... details omitted ...
1660    /// }
1661    /// ```
1662    #[derive(Clone, Debug)]
1663    pub struct GetPostureTemplate(RequestBuilder<crate::model::GetPostureTemplateRequest>);
1664
1665    impl GetPostureTemplate {
1666        pub(crate) fn new(
1667            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1668        ) -> Self {
1669            Self(RequestBuilder::new(stub))
1670        }
1671
1672        /// Sets the full request, replacing any prior values.
1673        pub fn with_request<V: Into<crate::model::GetPostureTemplateRequest>>(
1674            mut self,
1675            v: V,
1676        ) -> Self {
1677            self.0.request = v.into();
1678            self
1679        }
1680
1681        /// Sets all the options, replacing any prior values.
1682        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1683            self.0.options = v.into();
1684            self
1685        }
1686
1687        /// Sends the request.
1688        pub async fn send(self) -> Result<crate::model::PostureTemplate> {
1689            (*self.0.stub)
1690                .get_posture_template(self.0.request, self.0.options)
1691                .await
1692                .map(crate::Response::into_body)
1693        }
1694
1695        /// Sets the value of [name][crate::model::GetPostureTemplateRequest::name].
1696        ///
1697        /// This is a **required** field for requests.
1698        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1699            self.0.request.name = v.into();
1700            self
1701        }
1702
1703        /// Sets the value of [revision_id][crate::model::GetPostureTemplateRequest::revision_id].
1704        pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1705            self.0.request.revision_id = v.into();
1706            self
1707        }
1708    }
1709
1710    #[doc(hidden)]
1711    impl crate::RequestBuilder for GetPostureTemplate {
1712        fn request_options(&mut self) -> &mut crate::RequestOptions {
1713            &mut self.0.options
1714        }
1715    }
1716
1717    /// The request builder for [SecurityPosture::list_locations][crate::client::SecurityPosture::list_locations] calls.
1718    ///
1719    /// # Example
1720    /// ```
1721    /// # use google_cloud_securityposture_v1::builder::security_posture::ListLocations;
1722    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
1723    /// use google_cloud_gax::paginator::ItemPaginator;
1724    ///
1725    /// let builder = prepare_request_builder();
1726    /// let mut items = builder.by_item();
1727    /// while let Some(result) = items.next().await {
1728    ///   let item = result?;
1729    /// }
1730    /// # Ok(()) }
1731    ///
1732    /// fn prepare_request_builder() -> ListLocations {
1733    ///   # panic!();
1734    ///   // ... details omitted ...
1735    /// }
1736    /// ```
1737    #[derive(Clone, Debug)]
1738    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1739
1740    impl ListLocations {
1741        pub(crate) fn new(
1742            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1743        ) -> Self {
1744            Self(RequestBuilder::new(stub))
1745        }
1746
1747        /// Sets the full request, replacing any prior values.
1748        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1749            mut self,
1750            v: V,
1751        ) -> Self {
1752            self.0.request = v.into();
1753            self
1754        }
1755
1756        /// Sets all the options, replacing any prior values.
1757        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1758            self.0.options = v.into();
1759            self
1760        }
1761
1762        /// Sends the request.
1763        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1764            (*self.0.stub)
1765                .list_locations(self.0.request, self.0.options)
1766                .await
1767                .map(crate::Response::into_body)
1768        }
1769
1770        /// Streams each page in the collection.
1771        pub fn by_page(
1772            self,
1773        ) -> impl google_cloud_gax::paginator::Paginator<
1774            google_cloud_location::model::ListLocationsResponse,
1775            crate::Error,
1776        > {
1777            use std::clone::Clone;
1778            let token = self.0.request.page_token.clone();
1779            let execute = move |token: String| {
1780                let mut builder = self.clone();
1781                builder.0.request = builder.0.request.set_page_token(token);
1782                builder.send()
1783            };
1784            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1785        }
1786
1787        /// Streams each item in the collection.
1788        pub fn by_item(
1789            self,
1790        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1791            google_cloud_location::model::ListLocationsResponse,
1792            crate::Error,
1793        > {
1794            use google_cloud_gax::paginator::Paginator;
1795            self.by_page().items()
1796        }
1797
1798        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1799        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1800            self.0.request.name = v.into();
1801            self
1802        }
1803
1804        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1805        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1806            self.0.request.filter = v.into();
1807            self
1808        }
1809
1810        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1811        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1812            self.0.request.page_size = v.into();
1813            self
1814        }
1815
1816        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1817        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1818            self.0.request.page_token = v.into();
1819            self
1820        }
1821    }
1822
1823    #[doc(hidden)]
1824    impl crate::RequestBuilder for ListLocations {
1825        fn request_options(&mut self) -> &mut crate::RequestOptions {
1826            &mut self.0.options
1827        }
1828    }
1829
1830    /// The request builder for [SecurityPosture::get_location][crate::client::SecurityPosture::get_location] calls.
1831    ///
1832    /// # Example
1833    /// ```
1834    /// # use google_cloud_securityposture_v1::builder::security_posture::GetLocation;
1835    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
1836    ///
1837    /// let builder = prepare_request_builder();
1838    /// let response = builder.send().await?;
1839    /// # Ok(()) }
1840    ///
1841    /// fn prepare_request_builder() -> GetLocation {
1842    ///   # panic!();
1843    ///   // ... details omitted ...
1844    /// }
1845    /// ```
1846    #[derive(Clone, Debug)]
1847    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1848
1849    impl GetLocation {
1850        pub(crate) fn new(
1851            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1852        ) -> Self {
1853            Self(RequestBuilder::new(stub))
1854        }
1855
1856        /// Sets the full request, replacing any prior values.
1857        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1858            mut self,
1859            v: V,
1860        ) -> Self {
1861            self.0.request = v.into();
1862            self
1863        }
1864
1865        /// Sets all the options, replacing any prior values.
1866        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1867            self.0.options = v.into();
1868            self
1869        }
1870
1871        /// Sends the request.
1872        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1873            (*self.0.stub)
1874                .get_location(self.0.request, self.0.options)
1875                .await
1876                .map(crate::Response::into_body)
1877        }
1878
1879        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1880        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1881            self.0.request.name = v.into();
1882            self
1883        }
1884    }
1885
1886    #[doc(hidden)]
1887    impl crate::RequestBuilder for GetLocation {
1888        fn request_options(&mut self) -> &mut crate::RequestOptions {
1889            &mut self.0.options
1890        }
1891    }
1892
1893    /// The request builder for [SecurityPosture::list_operations][crate::client::SecurityPosture::list_operations] calls.
1894    ///
1895    /// # Example
1896    /// ```
1897    /// # use google_cloud_securityposture_v1::builder::security_posture::ListOperations;
1898    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
1899    /// use google_cloud_gax::paginator::ItemPaginator;
1900    ///
1901    /// let builder = prepare_request_builder();
1902    /// let mut items = builder.by_item();
1903    /// while let Some(result) = items.next().await {
1904    ///   let item = result?;
1905    /// }
1906    /// # Ok(()) }
1907    ///
1908    /// fn prepare_request_builder() -> ListOperations {
1909    ///   # panic!();
1910    ///   // ... details omitted ...
1911    /// }
1912    /// ```
1913    #[derive(Clone, Debug)]
1914    pub struct ListOperations(
1915        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1916    );
1917
1918    impl ListOperations {
1919        pub(crate) fn new(
1920            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1921        ) -> Self {
1922            Self(RequestBuilder::new(stub))
1923        }
1924
1925        /// Sets the full request, replacing any prior values.
1926        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1927            mut self,
1928            v: V,
1929        ) -> Self {
1930            self.0.request = v.into();
1931            self
1932        }
1933
1934        /// Sets all the options, replacing any prior values.
1935        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1936            self.0.options = v.into();
1937            self
1938        }
1939
1940        /// Sends the request.
1941        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1942            (*self.0.stub)
1943                .list_operations(self.0.request, self.0.options)
1944                .await
1945                .map(crate::Response::into_body)
1946        }
1947
1948        /// Streams each page in the collection.
1949        pub fn by_page(
1950            self,
1951        ) -> impl google_cloud_gax::paginator::Paginator<
1952            google_cloud_longrunning::model::ListOperationsResponse,
1953            crate::Error,
1954        > {
1955            use std::clone::Clone;
1956            let token = self.0.request.page_token.clone();
1957            let execute = move |token: String| {
1958                let mut builder = self.clone();
1959                builder.0.request = builder.0.request.set_page_token(token);
1960                builder.send()
1961            };
1962            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1963        }
1964
1965        /// Streams each item in the collection.
1966        pub fn by_item(
1967            self,
1968        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1969            google_cloud_longrunning::model::ListOperationsResponse,
1970            crate::Error,
1971        > {
1972            use google_cloud_gax::paginator::Paginator;
1973            self.by_page().items()
1974        }
1975
1976        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1977        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1978            self.0.request.name = v.into();
1979            self
1980        }
1981
1982        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1983        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1984            self.0.request.filter = v.into();
1985            self
1986        }
1987
1988        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1989        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1990            self.0.request.page_size = v.into();
1991            self
1992        }
1993
1994        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1995        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1996            self.0.request.page_token = v.into();
1997            self
1998        }
1999
2000        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2001        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2002            self.0.request.return_partial_success = v.into();
2003            self
2004        }
2005    }
2006
2007    #[doc(hidden)]
2008    impl crate::RequestBuilder for ListOperations {
2009        fn request_options(&mut self) -> &mut crate::RequestOptions {
2010            &mut self.0.options
2011        }
2012    }
2013
2014    /// The request builder for [SecurityPosture::get_operation][crate::client::SecurityPosture::get_operation] calls.
2015    ///
2016    /// # Example
2017    /// ```
2018    /// # use google_cloud_securityposture_v1::builder::security_posture::GetOperation;
2019    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
2020    ///
2021    /// let builder = prepare_request_builder();
2022    /// let response = builder.send().await?;
2023    /// # Ok(()) }
2024    ///
2025    /// fn prepare_request_builder() -> GetOperation {
2026    ///   # panic!();
2027    ///   // ... details omitted ...
2028    /// }
2029    /// ```
2030    #[derive(Clone, Debug)]
2031    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2032
2033    impl GetOperation {
2034        pub(crate) fn new(
2035            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
2036        ) -> Self {
2037            Self(RequestBuilder::new(stub))
2038        }
2039
2040        /// Sets the full request, replacing any prior values.
2041        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2042            mut self,
2043            v: V,
2044        ) -> Self {
2045            self.0.request = v.into();
2046            self
2047        }
2048
2049        /// Sets all the options, replacing any prior values.
2050        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2051            self.0.options = v.into();
2052            self
2053        }
2054
2055        /// Sends the request.
2056        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2057            (*self.0.stub)
2058                .get_operation(self.0.request, self.0.options)
2059                .await
2060                .map(crate::Response::into_body)
2061        }
2062
2063        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2064        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2065            self.0.request.name = v.into();
2066            self
2067        }
2068    }
2069
2070    #[doc(hidden)]
2071    impl crate::RequestBuilder for GetOperation {
2072        fn request_options(&mut self) -> &mut crate::RequestOptions {
2073            &mut self.0.options
2074        }
2075    }
2076
2077    /// The request builder for [SecurityPosture::delete_operation][crate::client::SecurityPosture::delete_operation] calls.
2078    ///
2079    /// # Example
2080    /// ```
2081    /// # use google_cloud_securityposture_v1::builder::security_posture::DeleteOperation;
2082    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
2083    ///
2084    /// let builder = prepare_request_builder();
2085    /// let response = builder.send().await?;
2086    /// # Ok(()) }
2087    ///
2088    /// fn prepare_request_builder() -> DeleteOperation {
2089    ///   # panic!();
2090    ///   // ... details omitted ...
2091    /// }
2092    /// ```
2093    #[derive(Clone, Debug)]
2094    pub struct DeleteOperation(
2095        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2096    );
2097
2098    impl DeleteOperation {
2099        pub(crate) fn new(
2100            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
2101        ) -> Self {
2102            Self(RequestBuilder::new(stub))
2103        }
2104
2105        /// Sets the full request, replacing any prior values.
2106        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2107            mut self,
2108            v: V,
2109        ) -> Self {
2110            self.0.request = v.into();
2111            self
2112        }
2113
2114        /// Sets all the options, replacing any prior values.
2115        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2116            self.0.options = v.into();
2117            self
2118        }
2119
2120        /// Sends the request.
2121        pub async fn send(self) -> Result<()> {
2122            (*self.0.stub)
2123                .delete_operation(self.0.request, self.0.options)
2124                .await
2125                .map(crate::Response::into_body)
2126        }
2127
2128        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
2129        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2130            self.0.request.name = v.into();
2131            self
2132        }
2133    }
2134
2135    #[doc(hidden)]
2136    impl crate::RequestBuilder for DeleteOperation {
2137        fn request_options(&mut self) -> &mut crate::RequestOptions {
2138            &mut self.0.options
2139        }
2140    }
2141
2142    /// The request builder for [SecurityPosture::cancel_operation][crate::client::SecurityPosture::cancel_operation] calls.
2143    ///
2144    /// # Example
2145    /// ```
2146    /// # use google_cloud_securityposture_v1::builder::security_posture::CancelOperation;
2147    /// # async fn sample() -> google_cloud_securityposture_v1::Result<()> {
2148    ///
2149    /// let builder = prepare_request_builder();
2150    /// let response = builder.send().await?;
2151    /// # Ok(()) }
2152    ///
2153    /// fn prepare_request_builder() -> CancelOperation {
2154    ///   # panic!();
2155    ///   // ... details omitted ...
2156    /// }
2157    /// ```
2158    #[derive(Clone, Debug)]
2159    pub struct CancelOperation(
2160        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2161    );
2162
2163    impl CancelOperation {
2164        pub(crate) fn new(
2165            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
2166        ) -> Self {
2167            Self(RequestBuilder::new(stub))
2168        }
2169
2170        /// Sets the full request, replacing any prior values.
2171        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2172            mut self,
2173            v: V,
2174        ) -> Self {
2175            self.0.request = v.into();
2176            self
2177        }
2178
2179        /// Sets all the options, replacing any prior values.
2180        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2181            self.0.options = v.into();
2182            self
2183        }
2184
2185        /// Sends the request.
2186        pub async fn send(self) -> Result<()> {
2187            (*self.0.stub)
2188                .cancel_operation(self.0.request, self.0.options)
2189                .await
2190                .map(crate::Response::into_body)
2191        }
2192
2193        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2194        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2195            self.0.request.name = v.into();
2196            self
2197        }
2198    }
2199
2200    #[doc(hidden)]
2201    impl crate::RequestBuilder for CancelOperation {
2202        fn request_options(&mut self) -> &mut crate::RequestOptions {
2203            &mut self.0.options
2204        }
2205    }
2206}