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