google_cloud_securityposture_v1/
builders.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    use std::sync::Arc;
20
21    /// Common implementation for [crate::client::SecurityPosture] request builders.
22    #[derive(Clone, Debug)]
23    pub struct RequestBuilder<R: std::default::Default> {
24        stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>,
25        request: R,
26        options: gax::options::RequestOptions,
27    }
28
29    impl<R> RequestBuilder<R>
30    where
31        R: std::default::Default,
32    {
33        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
34            Self {
35                stub,
36                request: R::default(),
37                options: gax::options::RequestOptions::default(),
38            }
39        }
40    }
41
42    /// The request builder for a SecurityPosture::list_postures call.
43    #[derive(Clone, Debug)]
44    pub struct ListPostures(RequestBuilder<crate::model::ListPosturesRequest>);
45
46    impl ListPostures {
47        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
48            Self(RequestBuilder::new(stub))
49        }
50
51        /// Sets the full request, replacing any prior values.
52        pub fn with_request<V: Into<crate::model::ListPosturesRequest>>(mut self, v: V) -> Self {
53            self.0.request = v.into();
54            self
55        }
56
57        /// Sets all the options, replacing any prior values.
58        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
59            self.0.options = v.into();
60            self
61        }
62
63        /// Sends the request.
64        pub async fn send(self) -> Result<crate::model::ListPosturesResponse> {
65            (*self.0.stub)
66                .list_postures(self.0.request, self.0.options)
67                .await
68        }
69
70        /// Streams the responses back.
71        #[cfg(feature = "unstable-stream")]
72        pub async fn stream(
73            self,
74        ) -> gax::paginator::Paginator<crate::model::ListPosturesResponse, gax::error::Error>
75        {
76            let token = gax::paginator::extract_token(&self.0.request.page_token);
77            let execute = move |token: String| {
78                let mut builder = self.clone();
79                builder.0.request = builder.0.request.set_page_token(token);
80                builder.send()
81            };
82            gax::paginator::Paginator::new(token, execute)
83        }
84
85        /// Sets the value of [parent][crate::model::ListPosturesRequest::parent].
86        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
87            self.0.request.parent = v.into();
88            self
89        }
90
91        /// Sets the value of [page_size][crate::model::ListPosturesRequest::page_size].
92        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
93            self.0.request.page_size = v.into();
94            self
95        }
96
97        /// Sets the value of [page_token][crate::model::ListPosturesRequest::page_token].
98        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
99            self.0.request.page_token = v.into();
100            self
101        }
102    }
103
104    impl gax::options::RequestBuilder for ListPostures {
105        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
106            &mut self.0.options
107        }
108    }
109
110    /// The request builder for a SecurityPosture::list_posture_revisions call.
111    #[derive(Clone, Debug)]
112    pub struct ListPostureRevisions(RequestBuilder<crate::model::ListPostureRevisionsRequest>);
113
114    impl ListPostureRevisions {
115        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
116            Self(RequestBuilder::new(stub))
117        }
118
119        /// Sets the full request, replacing any prior values.
120        pub fn with_request<V: Into<crate::model::ListPostureRevisionsRequest>>(
121            mut self,
122            v: V,
123        ) -> Self {
124            self.0.request = v.into();
125            self
126        }
127
128        /// Sets all the options, replacing any prior values.
129        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
130            self.0.options = v.into();
131            self
132        }
133
134        /// Sends the request.
135        pub async fn send(self) -> Result<crate::model::ListPostureRevisionsResponse> {
136            (*self.0.stub)
137                .list_posture_revisions(self.0.request, self.0.options)
138                .await
139        }
140
141        /// Streams the responses back.
142        #[cfg(feature = "unstable-stream")]
143        pub async fn stream(
144            self,
145        ) -> gax::paginator::Paginator<crate::model::ListPostureRevisionsResponse, gax::error::Error>
146        {
147            let token = gax::paginator::extract_token(&self.0.request.page_token);
148            let execute = move |token: String| {
149                let mut builder = self.clone();
150                builder.0.request = builder.0.request.set_page_token(token);
151                builder.send()
152            };
153            gax::paginator::Paginator::new(token, execute)
154        }
155
156        /// Sets the value of [name][crate::model::ListPostureRevisionsRequest::name].
157        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
158            self.0.request.name = v.into();
159            self
160        }
161
162        /// Sets the value of [page_size][crate::model::ListPostureRevisionsRequest::page_size].
163        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
164            self.0.request.page_size = v.into();
165            self
166        }
167
168        /// Sets the value of [page_token][crate::model::ListPostureRevisionsRequest::page_token].
169        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
170            self.0.request.page_token = v.into();
171            self
172        }
173    }
174
175    impl gax::options::RequestBuilder for ListPostureRevisions {
176        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
177            &mut self.0.options
178        }
179    }
180
181    /// The request builder for a SecurityPosture::get_posture call.
182    #[derive(Clone, Debug)]
183    pub struct GetPosture(RequestBuilder<crate::model::GetPostureRequest>);
184
185    impl GetPosture {
186        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
187            Self(RequestBuilder::new(stub))
188        }
189
190        /// Sets the full request, replacing any prior values.
191        pub fn with_request<V: Into<crate::model::GetPostureRequest>>(mut self, v: V) -> Self {
192            self.0.request = v.into();
193            self
194        }
195
196        /// Sets all the options, replacing any prior values.
197        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
198            self.0.options = v.into();
199            self
200        }
201
202        /// Sends the request.
203        pub async fn send(self) -> Result<crate::model::Posture> {
204            (*self.0.stub)
205                .get_posture(self.0.request, self.0.options)
206                .await
207        }
208
209        /// Sets the value of [name][crate::model::GetPostureRequest::name].
210        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
211            self.0.request.name = v.into();
212            self
213        }
214
215        /// Sets the value of [revision_id][crate::model::GetPostureRequest::revision_id].
216        pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
217            self.0.request.revision_id = v.into();
218            self
219        }
220    }
221
222    impl gax::options::RequestBuilder for GetPosture {
223        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
224            &mut self.0.options
225        }
226    }
227
228    /// The request builder for a SecurityPosture::create_posture call.
229    #[derive(Clone, Debug)]
230    pub struct CreatePosture(RequestBuilder<crate::model::CreatePostureRequest>);
231
232    impl CreatePosture {
233        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
234            Self(RequestBuilder::new(stub))
235        }
236
237        /// Sets the full request, replacing any prior values.
238        pub fn with_request<V: Into<crate::model::CreatePostureRequest>>(mut self, v: V) -> Self {
239            self.0.request = v.into();
240            self
241        }
242
243        /// Sets all the options, replacing any prior values.
244        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
245            self.0.options = v.into();
246            self
247        }
248
249        /// Sends the request.
250        ///
251        /// # Long running operations
252        ///
253        /// This starts, but does not poll, a longrunning operation. More information
254        /// on [create_posture][crate::client::SecurityPosture::create_posture].
255        pub async fn send(self) -> Result<longrunning::model::Operation> {
256            (*self.0.stub)
257                .create_posture(self.0.request, self.0.options)
258                .await
259        }
260
261        /// Creates a [Poller][lro::Poller] to work with `create_posture`.
262        pub fn poller(
263            self,
264        ) -> impl lro::Poller<crate::model::Posture, crate::model::OperationMetadata> {
265            type Operation = lro::Operation<crate::model::Posture, crate::model::OperationMetadata>;
266            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
267            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
268
269            let stub = self.0.stub.clone();
270            let mut options = self.0.options.clone();
271            options.set_retry_policy(gax::retry_policy::NeverRetry);
272            let query = move |name| {
273                let stub = stub.clone();
274                let options = options.clone();
275                async {
276                    let op = GetOperation::new(stub)
277                        .set_name(name)
278                        .with_options(options)
279                        .send()
280                        .await?;
281                    Ok(Operation::new(op))
282                }
283            };
284
285            let start = move || async {
286                let op = self.send().await?;
287                Ok(Operation::new(op))
288            };
289
290            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
291        }
292
293        /// Sets the value of [parent][crate::model::CreatePostureRequest::parent].
294        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
295            self.0.request.parent = v.into();
296            self
297        }
298
299        /// Sets the value of [posture_id][crate::model::CreatePostureRequest::posture_id].
300        pub fn set_posture_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
301            self.0.request.posture_id = v.into();
302            self
303        }
304
305        /// Sets the value of [posture][crate::model::CreatePostureRequest::posture].
306        pub fn set_posture<T: Into<std::option::Option<crate::model::Posture>>>(
307            mut self,
308            v: T,
309        ) -> Self {
310            self.0.request.posture = v.into();
311            self
312        }
313    }
314
315    impl gax::options::RequestBuilder for CreatePosture {
316        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
317            &mut self.0.options
318        }
319    }
320
321    /// The request builder for a SecurityPosture::update_posture call.
322    #[derive(Clone, Debug)]
323    pub struct UpdatePosture(RequestBuilder<crate::model::UpdatePostureRequest>);
324
325    impl UpdatePosture {
326        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
327            Self(RequestBuilder::new(stub))
328        }
329
330        /// Sets the full request, replacing any prior values.
331        pub fn with_request<V: Into<crate::model::UpdatePostureRequest>>(mut self, v: V) -> Self {
332            self.0.request = v.into();
333            self
334        }
335
336        /// Sets all the options, replacing any prior values.
337        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
338            self.0.options = v.into();
339            self
340        }
341
342        /// Sends the request.
343        ///
344        /// # Long running operations
345        ///
346        /// This starts, but does not poll, a longrunning operation. More information
347        /// on [update_posture][crate::client::SecurityPosture::update_posture].
348        pub async fn send(self) -> Result<longrunning::model::Operation> {
349            (*self.0.stub)
350                .update_posture(self.0.request, self.0.options)
351                .await
352        }
353
354        /// Creates a [Poller][lro::Poller] to work with `update_posture`.
355        pub fn poller(
356            self,
357        ) -> impl lro::Poller<crate::model::Posture, crate::model::OperationMetadata> {
358            type Operation = lro::Operation<crate::model::Posture, crate::model::OperationMetadata>;
359            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
360            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
361
362            let stub = self.0.stub.clone();
363            let mut options = self.0.options.clone();
364            options.set_retry_policy(gax::retry_policy::NeverRetry);
365            let query = move |name| {
366                let stub = stub.clone();
367                let options = options.clone();
368                async {
369                    let op = GetOperation::new(stub)
370                        .set_name(name)
371                        .with_options(options)
372                        .send()
373                        .await?;
374                    Ok(Operation::new(op))
375                }
376            };
377
378            let start = move || async {
379                let op = self.send().await?;
380                Ok(Operation::new(op))
381            };
382
383            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
384        }
385
386        /// Sets the value of [update_mask][crate::model::UpdatePostureRequest::update_mask].
387        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
388            mut self,
389            v: T,
390        ) -> Self {
391            self.0.request.update_mask = v.into();
392            self
393        }
394
395        /// Sets the value of [posture][crate::model::UpdatePostureRequest::posture].
396        pub fn set_posture<T: Into<std::option::Option<crate::model::Posture>>>(
397            mut self,
398            v: T,
399        ) -> Self {
400            self.0.request.posture = v.into();
401            self
402        }
403
404        /// Sets the value of [revision_id][crate::model::UpdatePostureRequest::revision_id].
405        pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
406            self.0.request.revision_id = v.into();
407            self
408        }
409    }
410
411    impl gax::options::RequestBuilder for UpdatePosture {
412        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
413            &mut self.0.options
414        }
415    }
416
417    /// The request builder for a SecurityPosture::delete_posture call.
418    #[derive(Clone, Debug)]
419    pub struct DeletePosture(RequestBuilder<crate::model::DeletePostureRequest>);
420
421    impl DeletePosture {
422        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
423            Self(RequestBuilder::new(stub))
424        }
425
426        /// Sets the full request, replacing any prior values.
427        pub fn with_request<V: Into<crate::model::DeletePostureRequest>>(mut self, v: V) -> Self {
428            self.0.request = v.into();
429            self
430        }
431
432        /// Sets all the options, replacing any prior values.
433        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
434            self.0.options = v.into();
435            self
436        }
437
438        /// Sends the request.
439        ///
440        /// # Long running operations
441        ///
442        /// This starts, but does not poll, a longrunning operation. More information
443        /// on [delete_posture][crate::client::SecurityPosture::delete_posture].
444        pub async fn send(self) -> Result<longrunning::model::Operation> {
445            (*self.0.stub)
446                .delete_posture(self.0.request, self.0.options)
447                .await
448        }
449
450        /// Creates a [Poller][lro::Poller] to work with `delete_posture`.
451        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
452            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
453            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
454            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
455
456            let stub = self.0.stub.clone();
457            let mut options = self.0.options.clone();
458            options.set_retry_policy(gax::retry_policy::NeverRetry);
459            let query = move |name| {
460                let stub = stub.clone();
461                let options = options.clone();
462                async {
463                    let op = GetOperation::new(stub)
464                        .set_name(name)
465                        .with_options(options)
466                        .send()
467                        .await?;
468                    Ok(Operation::new(op))
469                }
470            };
471
472            let start = move || async {
473                let op = self.send().await?;
474                Ok(Operation::new(op))
475            };
476
477            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
478        }
479
480        /// Sets the value of [name][crate::model::DeletePostureRequest::name].
481        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
482            self.0.request.name = v.into();
483            self
484        }
485
486        /// Sets the value of [etag][crate::model::DeletePostureRequest::etag].
487        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
488            self.0.request.etag = v.into();
489            self
490        }
491    }
492
493    impl gax::options::RequestBuilder for DeletePosture {
494        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
495            &mut self.0.options
496        }
497    }
498
499    /// The request builder for a SecurityPosture::extract_posture call.
500    #[derive(Clone, Debug)]
501    pub struct ExtractPosture(RequestBuilder<crate::model::ExtractPostureRequest>);
502
503    impl ExtractPosture {
504        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
505            Self(RequestBuilder::new(stub))
506        }
507
508        /// Sets the full request, replacing any prior values.
509        pub fn with_request<V: Into<crate::model::ExtractPostureRequest>>(mut self, v: V) -> Self {
510            self.0.request = v.into();
511            self
512        }
513
514        /// Sets all the options, replacing any prior values.
515        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
516            self.0.options = v.into();
517            self
518        }
519
520        /// Sends the request.
521        ///
522        /// # Long running operations
523        ///
524        /// This starts, but does not poll, a longrunning operation. More information
525        /// on [extract_posture][crate::client::SecurityPosture::extract_posture].
526        pub async fn send(self) -> Result<longrunning::model::Operation> {
527            (*self.0.stub)
528                .extract_posture(self.0.request, self.0.options)
529                .await
530        }
531
532        /// Creates a [Poller][lro::Poller] to work with `extract_posture`.
533        pub fn poller(
534            self,
535        ) -> impl lro::Poller<crate::model::Posture, crate::model::OperationMetadata> {
536            type Operation = lro::Operation<crate::model::Posture, crate::model::OperationMetadata>;
537            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
538            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
539
540            let stub = self.0.stub.clone();
541            let mut options = self.0.options.clone();
542            options.set_retry_policy(gax::retry_policy::NeverRetry);
543            let query = move |name| {
544                let stub = stub.clone();
545                let options = options.clone();
546                async {
547                    let op = GetOperation::new(stub)
548                        .set_name(name)
549                        .with_options(options)
550                        .send()
551                        .await?;
552                    Ok(Operation::new(op))
553                }
554            };
555
556            let start = move || async {
557                let op = self.send().await?;
558                Ok(Operation::new(op))
559            };
560
561            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
562        }
563
564        /// Sets the value of [parent][crate::model::ExtractPostureRequest::parent].
565        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
566            self.0.request.parent = v.into();
567            self
568        }
569
570        /// Sets the value of [posture_id][crate::model::ExtractPostureRequest::posture_id].
571        pub fn set_posture_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
572            self.0.request.posture_id = v.into();
573            self
574        }
575
576        /// Sets the value of [workload][crate::model::ExtractPostureRequest::workload].
577        pub fn set_workload<T: Into<std::string::String>>(mut self, v: T) -> Self {
578            self.0.request.workload = v.into();
579            self
580        }
581    }
582
583    impl gax::options::RequestBuilder for ExtractPosture {
584        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
585            &mut self.0.options
586        }
587    }
588
589    /// The request builder for a SecurityPosture::list_posture_deployments call.
590    #[derive(Clone, Debug)]
591    pub struct ListPostureDeployments(RequestBuilder<crate::model::ListPostureDeploymentsRequest>);
592
593    impl ListPostureDeployments {
594        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
595            Self(RequestBuilder::new(stub))
596        }
597
598        /// Sets the full request, replacing any prior values.
599        pub fn with_request<V: Into<crate::model::ListPostureDeploymentsRequest>>(
600            mut self,
601            v: V,
602        ) -> Self {
603            self.0.request = v.into();
604            self
605        }
606
607        /// Sets all the options, replacing any prior values.
608        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
609            self.0.options = v.into();
610            self
611        }
612
613        /// Sends the request.
614        pub async fn send(self) -> Result<crate::model::ListPostureDeploymentsResponse> {
615            (*self.0.stub)
616                .list_posture_deployments(self.0.request, self.0.options)
617                .await
618        }
619
620        /// Streams the responses back.
621        #[cfg(feature = "unstable-stream")]
622        pub async fn stream(
623            self,
624        ) -> gax::paginator::Paginator<
625            crate::model::ListPostureDeploymentsResponse,
626            gax::error::Error,
627        > {
628            let token = gax::paginator::extract_token(&self.0.request.page_token);
629            let execute = move |token: String| {
630                let mut builder = self.clone();
631                builder.0.request = builder.0.request.set_page_token(token);
632                builder.send()
633            };
634            gax::paginator::Paginator::new(token, execute)
635        }
636
637        /// Sets the value of [parent][crate::model::ListPostureDeploymentsRequest::parent].
638        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
639            self.0.request.parent = v.into();
640            self
641        }
642
643        /// Sets the value of [page_size][crate::model::ListPostureDeploymentsRequest::page_size].
644        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
645            self.0.request.page_size = v.into();
646            self
647        }
648
649        /// Sets the value of [page_token][crate::model::ListPostureDeploymentsRequest::page_token].
650        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
651            self.0.request.page_token = v.into();
652            self
653        }
654
655        /// Sets the value of [filter][crate::model::ListPostureDeploymentsRequest::filter].
656        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
657            self.0.request.filter = v.into();
658            self
659        }
660    }
661
662    impl gax::options::RequestBuilder for ListPostureDeployments {
663        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
664            &mut self.0.options
665        }
666    }
667
668    /// The request builder for a SecurityPosture::get_posture_deployment call.
669    #[derive(Clone, Debug)]
670    pub struct GetPostureDeployment(RequestBuilder<crate::model::GetPostureDeploymentRequest>);
671
672    impl GetPostureDeployment {
673        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
674            Self(RequestBuilder::new(stub))
675        }
676
677        /// Sets the full request, replacing any prior values.
678        pub fn with_request<V: Into<crate::model::GetPostureDeploymentRequest>>(
679            mut self,
680            v: V,
681        ) -> Self {
682            self.0.request = v.into();
683            self
684        }
685
686        /// Sets all the options, replacing any prior values.
687        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
688            self.0.options = v.into();
689            self
690        }
691
692        /// Sends the request.
693        pub async fn send(self) -> Result<crate::model::PostureDeployment> {
694            (*self.0.stub)
695                .get_posture_deployment(self.0.request, self.0.options)
696                .await
697        }
698
699        /// Sets the value of [name][crate::model::GetPostureDeploymentRequest::name].
700        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
701            self.0.request.name = v.into();
702            self
703        }
704    }
705
706    impl gax::options::RequestBuilder for GetPostureDeployment {
707        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
708            &mut self.0.options
709        }
710    }
711
712    /// The request builder for a SecurityPosture::create_posture_deployment call.
713    #[derive(Clone, Debug)]
714    pub struct CreatePostureDeployment(
715        RequestBuilder<crate::model::CreatePostureDeploymentRequest>,
716    );
717
718    impl CreatePostureDeployment {
719        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
720            Self(RequestBuilder::new(stub))
721        }
722
723        /// Sets the full request, replacing any prior values.
724        pub fn with_request<V: Into<crate::model::CreatePostureDeploymentRequest>>(
725            mut self,
726            v: V,
727        ) -> Self {
728            self.0.request = v.into();
729            self
730        }
731
732        /// Sets all the options, replacing any prior values.
733        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
734            self.0.options = v.into();
735            self
736        }
737
738        /// Sends the request.
739        ///
740        /// # Long running operations
741        ///
742        /// This starts, but does not poll, a longrunning operation. More information
743        /// on [create_posture_deployment][crate::client::SecurityPosture::create_posture_deployment].
744        pub async fn send(self) -> Result<longrunning::model::Operation> {
745            (*self.0.stub)
746                .create_posture_deployment(self.0.request, self.0.options)
747                .await
748        }
749
750        /// Creates a [Poller][lro::Poller] to work with `create_posture_deployment`.
751        pub fn poller(
752            self,
753        ) -> impl lro::Poller<crate::model::PostureDeployment, crate::model::OperationMetadata>
754        {
755            type Operation =
756                lro::Operation<crate::model::PostureDeployment, crate::model::OperationMetadata>;
757            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
758            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
759
760            let stub = self.0.stub.clone();
761            let mut options = self.0.options.clone();
762            options.set_retry_policy(gax::retry_policy::NeverRetry);
763            let query = move |name| {
764                let stub = stub.clone();
765                let options = options.clone();
766                async {
767                    let op = GetOperation::new(stub)
768                        .set_name(name)
769                        .with_options(options)
770                        .send()
771                        .await?;
772                    Ok(Operation::new(op))
773                }
774            };
775
776            let start = move || async {
777                let op = self.send().await?;
778                Ok(Operation::new(op))
779            };
780
781            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
782        }
783
784        /// Sets the value of [parent][crate::model::CreatePostureDeploymentRequest::parent].
785        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
786            self.0.request.parent = v.into();
787            self
788        }
789
790        /// Sets the value of [posture_deployment_id][crate::model::CreatePostureDeploymentRequest::posture_deployment_id].
791        pub fn set_posture_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
792            self.0.request.posture_deployment_id = v.into();
793            self
794        }
795
796        /// Sets the value of [posture_deployment][crate::model::CreatePostureDeploymentRequest::posture_deployment].
797        pub fn set_posture_deployment<
798            T: Into<std::option::Option<crate::model::PostureDeployment>>,
799        >(
800            mut self,
801            v: T,
802        ) -> Self {
803            self.0.request.posture_deployment = v.into();
804            self
805        }
806    }
807
808    impl gax::options::RequestBuilder for CreatePostureDeployment {
809        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
810            &mut self.0.options
811        }
812    }
813
814    /// The request builder for a SecurityPosture::update_posture_deployment call.
815    #[derive(Clone, Debug)]
816    pub struct UpdatePostureDeployment(
817        RequestBuilder<crate::model::UpdatePostureDeploymentRequest>,
818    );
819
820    impl UpdatePostureDeployment {
821        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
822            Self(RequestBuilder::new(stub))
823        }
824
825        /// Sets the full request, replacing any prior values.
826        pub fn with_request<V: Into<crate::model::UpdatePostureDeploymentRequest>>(
827            mut self,
828            v: V,
829        ) -> Self {
830            self.0.request = v.into();
831            self
832        }
833
834        /// Sets all the options, replacing any prior values.
835        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
836            self.0.options = v.into();
837            self
838        }
839
840        /// Sends the request.
841        ///
842        /// # Long running operations
843        ///
844        /// This starts, but does not poll, a longrunning operation. More information
845        /// on [update_posture_deployment][crate::client::SecurityPosture::update_posture_deployment].
846        pub async fn send(self) -> Result<longrunning::model::Operation> {
847            (*self.0.stub)
848                .update_posture_deployment(self.0.request, self.0.options)
849                .await
850        }
851
852        /// Creates a [Poller][lro::Poller] to work with `update_posture_deployment`.
853        pub fn poller(
854            self,
855        ) -> impl lro::Poller<crate::model::PostureDeployment, crate::model::OperationMetadata>
856        {
857            type Operation =
858                lro::Operation<crate::model::PostureDeployment, crate::model::OperationMetadata>;
859            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
860            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
861
862            let stub = self.0.stub.clone();
863            let mut options = self.0.options.clone();
864            options.set_retry_policy(gax::retry_policy::NeverRetry);
865            let query = move |name| {
866                let stub = stub.clone();
867                let options = options.clone();
868                async {
869                    let op = GetOperation::new(stub)
870                        .set_name(name)
871                        .with_options(options)
872                        .send()
873                        .await?;
874                    Ok(Operation::new(op))
875                }
876            };
877
878            let start = move || async {
879                let op = self.send().await?;
880                Ok(Operation::new(op))
881            };
882
883            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
884        }
885
886        /// Sets the value of [update_mask][crate::model::UpdatePostureDeploymentRequest::update_mask].
887        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
888            mut self,
889            v: T,
890        ) -> Self {
891            self.0.request.update_mask = v.into();
892            self
893        }
894
895        /// Sets the value of [posture_deployment][crate::model::UpdatePostureDeploymentRequest::posture_deployment].
896        pub fn set_posture_deployment<
897            T: Into<std::option::Option<crate::model::PostureDeployment>>,
898        >(
899            mut self,
900            v: T,
901        ) -> Self {
902            self.0.request.posture_deployment = v.into();
903            self
904        }
905    }
906
907    impl gax::options::RequestBuilder for UpdatePostureDeployment {
908        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
909            &mut self.0.options
910        }
911    }
912
913    /// The request builder for a SecurityPosture::delete_posture_deployment call.
914    #[derive(Clone, Debug)]
915    pub struct DeletePostureDeployment(
916        RequestBuilder<crate::model::DeletePostureDeploymentRequest>,
917    );
918
919    impl DeletePostureDeployment {
920        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
921            Self(RequestBuilder::new(stub))
922        }
923
924        /// Sets the full request, replacing any prior values.
925        pub fn with_request<V: Into<crate::model::DeletePostureDeploymentRequest>>(
926            mut self,
927            v: V,
928        ) -> Self {
929            self.0.request = v.into();
930            self
931        }
932
933        /// Sets all the options, replacing any prior values.
934        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
935            self.0.options = v.into();
936            self
937        }
938
939        /// Sends the request.
940        ///
941        /// # Long running operations
942        ///
943        /// This starts, but does not poll, a longrunning operation. More information
944        /// on [delete_posture_deployment][crate::client::SecurityPosture::delete_posture_deployment].
945        pub async fn send(self) -> Result<longrunning::model::Operation> {
946            (*self.0.stub)
947                .delete_posture_deployment(self.0.request, self.0.options)
948                .await
949        }
950
951        /// Creates a [Poller][lro::Poller] to work with `delete_posture_deployment`.
952        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
953            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
954            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
955            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
956
957            let stub = self.0.stub.clone();
958            let mut options = self.0.options.clone();
959            options.set_retry_policy(gax::retry_policy::NeverRetry);
960            let query = move |name| {
961                let stub = stub.clone();
962                let options = options.clone();
963                async {
964                    let op = GetOperation::new(stub)
965                        .set_name(name)
966                        .with_options(options)
967                        .send()
968                        .await?;
969                    Ok(Operation::new(op))
970                }
971            };
972
973            let start = move || async {
974                let op = self.send().await?;
975                Ok(Operation::new(op))
976            };
977
978            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
979        }
980
981        /// Sets the value of [name][crate::model::DeletePostureDeploymentRequest::name].
982        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
983            self.0.request.name = v.into();
984            self
985        }
986
987        /// Sets the value of [etag][crate::model::DeletePostureDeploymentRequest::etag].
988        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
989            self.0.request.etag = v.into();
990            self
991        }
992    }
993
994    impl gax::options::RequestBuilder for DeletePostureDeployment {
995        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
996            &mut self.0.options
997        }
998    }
999
1000    /// The request builder for a SecurityPosture::list_posture_templates call.
1001    #[derive(Clone, Debug)]
1002    pub struct ListPostureTemplates(RequestBuilder<crate::model::ListPostureTemplatesRequest>);
1003
1004    impl ListPostureTemplates {
1005        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
1006            Self(RequestBuilder::new(stub))
1007        }
1008
1009        /// Sets the full request, replacing any prior values.
1010        pub fn with_request<V: Into<crate::model::ListPostureTemplatesRequest>>(
1011            mut self,
1012            v: V,
1013        ) -> Self {
1014            self.0.request = v.into();
1015            self
1016        }
1017
1018        /// Sets all the options, replacing any prior values.
1019        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1020            self.0.options = v.into();
1021            self
1022        }
1023
1024        /// Sends the request.
1025        pub async fn send(self) -> Result<crate::model::ListPostureTemplatesResponse> {
1026            (*self.0.stub)
1027                .list_posture_templates(self.0.request, self.0.options)
1028                .await
1029        }
1030
1031        /// Streams the responses back.
1032        #[cfg(feature = "unstable-stream")]
1033        pub async fn stream(
1034            self,
1035        ) -> gax::paginator::Paginator<crate::model::ListPostureTemplatesResponse, gax::error::Error>
1036        {
1037            let token = gax::paginator::extract_token(&self.0.request.page_token);
1038            let execute = move |token: String| {
1039                let mut builder = self.clone();
1040                builder.0.request = builder.0.request.set_page_token(token);
1041                builder.send()
1042            };
1043            gax::paginator::Paginator::new(token, execute)
1044        }
1045
1046        /// Sets the value of [parent][crate::model::ListPostureTemplatesRequest::parent].
1047        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1048            self.0.request.parent = v.into();
1049            self
1050        }
1051
1052        /// Sets the value of [page_size][crate::model::ListPostureTemplatesRequest::page_size].
1053        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1054            self.0.request.page_size = v.into();
1055            self
1056        }
1057
1058        /// Sets the value of [page_token][crate::model::ListPostureTemplatesRequest::page_token].
1059        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1060            self.0.request.page_token = v.into();
1061            self
1062        }
1063
1064        /// Sets the value of [filter][crate::model::ListPostureTemplatesRequest::filter].
1065        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1066            self.0.request.filter = v.into();
1067            self
1068        }
1069    }
1070
1071    impl gax::options::RequestBuilder for ListPostureTemplates {
1072        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1073            &mut self.0.options
1074        }
1075    }
1076
1077    /// The request builder for a SecurityPosture::get_posture_template call.
1078    #[derive(Clone, Debug)]
1079    pub struct GetPostureTemplate(RequestBuilder<crate::model::GetPostureTemplateRequest>);
1080
1081    impl GetPostureTemplate {
1082        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
1083            Self(RequestBuilder::new(stub))
1084        }
1085
1086        /// Sets the full request, replacing any prior values.
1087        pub fn with_request<V: Into<crate::model::GetPostureTemplateRequest>>(
1088            mut self,
1089            v: V,
1090        ) -> Self {
1091            self.0.request = v.into();
1092            self
1093        }
1094
1095        /// Sets all the options, replacing any prior values.
1096        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1097            self.0.options = v.into();
1098            self
1099        }
1100
1101        /// Sends the request.
1102        pub async fn send(self) -> Result<crate::model::PostureTemplate> {
1103            (*self.0.stub)
1104                .get_posture_template(self.0.request, self.0.options)
1105                .await
1106        }
1107
1108        /// Sets the value of [name][crate::model::GetPostureTemplateRequest::name].
1109        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1110            self.0.request.name = v.into();
1111            self
1112        }
1113
1114        /// Sets the value of [revision_id][crate::model::GetPostureTemplateRequest::revision_id].
1115        pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1116            self.0.request.revision_id = v.into();
1117            self
1118        }
1119    }
1120
1121    impl gax::options::RequestBuilder for GetPostureTemplate {
1122        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1123            &mut self.0.options
1124        }
1125    }
1126
1127    /// The request builder for a SecurityPosture::list_locations call.
1128    #[derive(Clone, Debug)]
1129    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1130
1131    impl ListLocations {
1132        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
1133            Self(RequestBuilder::new(stub))
1134        }
1135
1136        /// Sets the full request, replacing any prior values.
1137        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1138            mut self,
1139            v: V,
1140        ) -> Self {
1141            self.0.request = v.into();
1142            self
1143        }
1144
1145        /// Sets all the options, replacing any prior values.
1146        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1147            self.0.options = v.into();
1148            self
1149        }
1150
1151        /// Sends the request.
1152        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1153            (*self.0.stub)
1154                .list_locations(self.0.request, self.0.options)
1155                .await
1156        }
1157
1158        /// Streams the responses back.
1159        #[cfg(feature = "unstable-stream")]
1160        pub async fn stream(
1161            self,
1162        ) -> gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1163        {
1164            let token = gax::paginator::extract_token(&self.0.request.page_token);
1165            let execute = move |token: String| {
1166                let mut builder = self.clone();
1167                builder.0.request = builder.0.request.set_page_token(token);
1168                builder.send()
1169            };
1170            gax::paginator::Paginator::new(token, execute)
1171        }
1172
1173        /// Sets the value of [name][location::model::ListLocationsRequest::name].
1174        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1175            self.0.request.name = v.into();
1176            self
1177        }
1178
1179        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
1180        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1181            self.0.request.filter = v.into();
1182            self
1183        }
1184
1185        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
1186        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1187            self.0.request.page_size = v.into();
1188            self
1189        }
1190
1191        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
1192        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1193            self.0.request.page_token = v.into();
1194            self
1195        }
1196    }
1197
1198    impl gax::options::RequestBuilder for ListLocations {
1199        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1200            &mut self.0.options
1201        }
1202    }
1203
1204    /// The request builder for a SecurityPosture::get_location call.
1205    #[derive(Clone, Debug)]
1206    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1207
1208    impl GetLocation {
1209        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
1210            Self(RequestBuilder::new(stub))
1211        }
1212
1213        /// Sets the full request, replacing any prior values.
1214        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1215            self.0.request = v.into();
1216            self
1217        }
1218
1219        /// Sets all the options, replacing any prior values.
1220        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1221            self.0.options = v.into();
1222            self
1223        }
1224
1225        /// Sends the request.
1226        pub async fn send(self) -> Result<location::model::Location> {
1227            (*self.0.stub)
1228                .get_location(self.0.request, self.0.options)
1229                .await
1230        }
1231
1232        /// Sets the value of [name][location::model::GetLocationRequest::name].
1233        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1234            self.0.request.name = v.into();
1235            self
1236        }
1237    }
1238
1239    impl gax::options::RequestBuilder for GetLocation {
1240        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1241            &mut self.0.options
1242        }
1243    }
1244
1245    /// The request builder for a SecurityPosture::list_operations call.
1246    #[derive(Clone, Debug)]
1247    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1248
1249    impl ListOperations {
1250        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
1251            Self(RequestBuilder::new(stub))
1252        }
1253
1254        /// Sets the full request, replacing any prior values.
1255        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1256            mut self,
1257            v: V,
1258        ) -> Self {
1259            self.0.request = v.into();
1260            self
1261        }
1262
1263        /// Sets all the options, replacing any prior values.
1264        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1265            self.0.options = v.into();
1266            self
1267        }
1268
1269        /// Sends the request.
1270        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1271            (*self.0.stub)
1272                .list_operations(self.0.request, self.0.options)
1273                .await
1274        }
1275
1276        /// Streams the responses back.
1277        #[cfg(feature = "unstable-stream")]
1278        pub async fn stream(
1279            self,
1280        ) -> gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1281        {
1282            let token = gax::paginator::extract_token(&self.0.request.page_token);
1283            let execute = move |token: String| {
1284                let mut builder = self.clone();
1285                builder.0.request = builder.0.request.set_page_token(token);
1286                builder.send()
1287            };
1288            gax::paginator::Paginator::new(token, execute)
1289        }
1290
1291        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
1292        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1293            self.0.request.name = v.into();
1294            self
1295        }
1296
1297        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
1298        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1299            self.0.request.filter = v.into();
1300            self
1301        }
1302
1303        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
1304        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1305            self.0.request.page_size = v.into();
1306            self
1307        }
1308
1309        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
1310        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1311            self.0.request.page_token = v.into();
1312            self
1313        }
1314    }
1315
1316    impl gax::options::RequestBuilder for ListOperations {
1317        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1318            &mut self.0.options
1319        }
1320    }
1321
1322    /// The request builder for a SecurityPosture::get_operation call.
1323    #[derive(Clone, Debug)]
1324    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1325
1326    impl GetOperation {
1327        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
1328            Self(RequestBuilder::new(stub))
1329        }
1330
1331        /// Sets the full request, replacing any prior values.
1332        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1333            mut self,
1334            v: V,
1335        ) -> Self {
1336            self.0.request = v.into();
1337            self
1338        }
1339
1340        /// Sets all the options, replacing any prior values.
1341        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1342            self.0.options = v.into();
1343            self
1344        }
1345
1346        /// Sends the request.
1347        pub async fn send(self) -> Result<longrunning::model::Operation> {
1348            (*self.0.stub)
1349                .get_operation(self.0.request, self.0.options)
1350                .await
1351        }
1352
1353        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1354        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1355            self.0.request.name = v.into();
1356            self
1357        }
1358    }
1359
1360    impl gax::options::RequestBuilder for GetOperation {
1361        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1362            &mut self.0.options
1363        }
1364    }
1365
1366    /// The request builder for a SecurityPosture::delete_operation call.
1367    #[derive(Clone, Debug)]
1368    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1369
1370    impl DeleteOperation {
1371        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
1372            Self(RequestBuilder::new(stub))
1373        }
1374
1375        /// Sets the full request, replacing any prior values.
1376        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1377            mut self,
1378            v: V,
1379        ) -> Self {
1380            self.0.request = v.into();
1381            self
1382        }
1383
1384        /// Sets all the options, replacing any prior values.
1385        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1386            self.0.options = v.into();
1387            self
1388        }
1389
1390        /// Sends the request.
1391        pub async fn send(self) -> Result<wkt::Empty> {
1392            (*self.0.stub)
1393                .delete_operation(self.0.request, self.0.options)
1394                .await
1395        }
1396
1397        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
1398        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1399            self.0.request.name = v.into();
1400            self
1401        }
1402    }
1403
1404    impl gax::options::RequestBuilder for DeleteOperation {
1405        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1406            &mut self.0.options
1407        }
1408    }
1409
1410    /// The request builder for a SecurityPosture::cancel_operation call.
1411    #[derive(Clone, Debug)]
1412    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1413
1414    impl CancelOperation {
1415        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SecurityPosture>) -> Self {
1416            Self(RequestBuilder::new(stub))
1417        }
1418
1419        /// Sets the full request, replacing any prior values.
1420        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1421            mut self,
1422            v: V,
1423        ) -> Self {
1424            self.0.request = v.into();
1425            self
1426        }
1427
1428        /// Sets all the options, replacing any prior values.
1429        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1430            self.0.options = v.into();
1431            self
1432        }
1433
1434        /// Sends the request.
1435        pub async fn send(self) -> Result<wkt::Empty> {
1436            (*self.0.stub)
1437                .cancel_operation(self.0.request, self.0.options)
1438                .await
1439        }
1440
1441        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
1442        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1443            self.0.request.name = v.into();
1444            self
1445        }
1446    }
1447
1448    impl gax::options::RequestBuilder for CancelOperation {
1449        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1450            &mut self.0.options
1451        }
1452    }
1453}