1pub mod security_posture {
18 use crate::Result;
19 use std::sync::Arc;
20
21 #[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 #[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 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 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 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 #[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 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 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 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 #[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 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 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 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 #[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 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 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 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 #[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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 #[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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 #[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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 #[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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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}