1pub mod security_posture {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::SecurityPosture;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = SecurityPosture;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
43 Self::Client::new(config).await
44 }
45 }
46 }
47
48 #[derive(Clone, Debug)]
50 pub(crate) struct RequestBuilder<R: std::default::Default> {
51 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
52 request: R,
53 options: gax::options::RequestOptions,
54 }
55
56 impl<R> RequestBuilder<R>
57 where
58 R: std::default::Default,
59 {
60 pub(crate) fn new(
61 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
62 ) -> Self {
63 Self {
64 stub,
65 request: R::default(),
66 options: gax::options::RequestOptions::default(),
67 }
68 }
69 }
70
71 #[derive(Clone, Debug)]
92 pub struct ListPostures(RequestBuilder<crate::model::ListPosturesRequest>);
93
94 impl ListPostures {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 pub fn with_request<V: Into<crate::model::ListPosturesRequest>>(mut self, v: V) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 pub async fn send(self) -> Result<crate::model::ListPosturesResponse> {
115 (*self.0.stub)
116 .list_postures(self.0.request, self.0.options)
117 .await
118 .map(gax::response::Response::into_body)
119 }
120
121 pub fn by_page(
123 self,
124 ) -> impl gax::paginator::Paginator<crate::model::ListPosturesResponse, gax::error::Error>
125 {
126 use std::clone::Clone;
127 let token = self.0.request.page_token.clone();
128 let execute = move |token: String| {
129 let mut builder = self.clone();
130 builder.0.request = builder.0.request.set_page_token(token);
131 builder.send()
132 };
133 gax::paginator::internal::new_paginator(token, execute)
134 }
135
136 pub fn by_item(
138 self,
139 ) -> impl gax::paginator::ItemPaginator<crate::model::ListPosturesResponse, gax::error::Error>
140 {
141 use gax::paginator::Paginator;
142 self.by_page().items()
143 }
144
145 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
149 self.0.request.parent = v.into();
150 self
151 }
152
153 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
155 self.0.request.page_size = v.into();
156 self
157 }
158
159 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
161 self.0.request.page_token = v.into();
162 self
163 }
164 }
165
166 #[doc(hidden)]
167 impl gax::options::internal::RequestBuilder for ListPostures {
168 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
169 &mut self.0.options
170 }
171 }
172
173 #[derive(Clone, Debug)]
194 pub struct ListPostureRevisions(RequestBuilder<crate::model::ListPostureRevisionsRequest>);
195
196 impl ListPostureRevisions {
197 pub(crate) fn new(
198 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
199 ) -> Self {
200 Self(RequestBuilder::new(stub))
201 }
202
203 pub fn with_request<V: Into<crate::model::ListPostureRevisionsRequest>>(
205 mut self,
206 v: V,
207 ) -> Self {
208 self.0.request = v.into();
209 self
210 }
211
212 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
214 self.0.options = v.into();
215 self
216 }
217
218 pub async fn send(self) -> Result<crate::model::ListPostureRevisionsResponse> {
220 (*self.0.stub)
221 .list_posture_revisions(self.0.request, self.0.options)
222 .await
223 .map(gax::response::Response::into_body)
224 }
225
226 pub fn by_page(
228 self,
229 ) -> impl gax::paginator::Paginator<crate::model::ListPostureRevisionsResponse, gax::error::Error>
230 {
231 use std::clone::Clone;
232 let token = self.0.request.page_token.clone();
233 let execute = move |token: String| {
234 let mut builder = self.clone();
235 builder.0.request = builder.0.request.set_page_token(token);
236 builder.send()
237 };
238 gax::paginator::internal::new_paginator(token, execute)
239 }
240
241 pub fn by_item(
243 self,
244 ) -> impl gax::paginator::ItemPaginator<
245 crate::model::ListPostureRevisionsResponse,
246 gax::error::Error,
247 > {
248 use gax::paginator::Paginator;
249 self.by_page().items()
250 }
251
252 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
256 self.0.request.name = v.into();
257 self
258 }
259
260 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
262 self.0.request.page_size = v.into();
263 self
264 }
265
266 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
268 self.0.request.page_token = v.into();
269 self
270 }
271 }
272
273 #[doc(hidden)]
274 impl gax::options::internal::RequestBuilder for ListPostureRevisions {
275 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
276 &mut self.0.options
277 }
278 }
279
280 #[derive(Clone, Debug)]
297 pub struct GetPosture(RequestBuilder<crate::model::GetPostureRequest>);
298
299 impl GetPosture {
300 pub(crate) fn new(
301 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
302 ) -> Self {
303 Self(RequestBuilder::new(stub))
304 }
305
306 pub fn with_request<V: Into<crate::model::GetPostureRequest>>(mut self, v: V) -> Self {
308 self.0.request = v.into();
309 self
310 }
311
312 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
314 self.0.options = v.into();
315 self
316 }
317
318 pub async fn send(self) -> Result<crate::model::Posture> {
320 (*self.0.stub)
321 .get_posture(self.0.request, self.0.options)
322 .await
323 .map(gax::response::Response::into_body)
324 }
325
326 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
330 self.0.request.name = v.into();
331 self
332 }
333
334 pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
336 self.0.request.revision_id = v.into();
337 self
338 }
339 }
340
341 #[doc(hidden)]
342 impl gax::options::internal::RequestBuilder for GetPosture {
343 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
344 &mut self.0.options
345 }
346 }
347
348 #[derive(Clone, Debug)]
366 pub struct CreatePosture(RequestBuilder<crate::model::CreatePostureRequest>);
367
368 impl CreatePosture {
369 pub(crate) fn new(
370 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
371 ) -> Self {
372 Self(RequestBuilder::new(stub))
373 }
374
375 pub fn with_request<V: Into<crate::model::CreatePostureRequest>>(mut self, v: V) -> Self {
377 self.0.request = v.into();
378 self
379 }
380
381 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
383 self.0.options = v.into();
384 self
385 }
386
387 pub async fn send(self) -> Result<longrunning::model::Operation> {
394 (*self.0.stub)
395 .create_posture(self.0.request, self.0.options)
396 .await
397 .map(gax::response::Response::into_body)
398 }
399
400 pub fn poller(
402 self,
403 ) -> impl lro::Poller<crate::model::Posture, crate::model::OperationMetadata> {
404 type Operation =
405 lro::internal::Operation<crate::model::Posture, crate::model::OperationMetadata>;
406 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
407 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
408
409 let stub = self.0.stub.clone();
410 let mut options = self.0.options.clone();
411 options.set_retry_policy(gax::retry_policy::NeverRetry);
412 let query = move |name| {
413 let stub = stub.clone();
414 let options = options.clone();
415 async {
416 let op = GetOperation::new(stub)
417 .set_name(name)
418 .with_options(options)
419 .send()
420 .await?;
421 Ok(Operation::new(op))
422 }
423 };
424
425 let start = move || async {
426 let op = self.send().await?;
427 Ok(Operation::new(op))
428 };
429
430 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
431 }
432
433 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
437 self.0.request.parent = v.into();
438 self
439 }
440
441 pub fn set_posture_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
445 self.0.request.posture_id = v.into();
446 self
447 }
448
449 pub fn set_posture<T: Into<std::option::Option<crate::model::Posture>>>(
453 mut self,
454 v: T,
455 ) -> Self {
456 self.0.request.posture = v.into();
457 self
458 }
459 }
460
461 #[doc(hidden)]
462 impl gax::options::internal::RequestBuilder for CreatePosture {
463 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
464 &mut self.0.options
465 }
466 }
467
468 #[derive(Clone, Debug)]
486 pub struct UpdatePosture(RequestBuilder<crate::model::UpdatePostureRequest>);
487
488 impl UpdatePosture {
489 pub(crate) fn new(
490 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
491 ) -> Self {
492 Self(RequestBuilder::new(stub))
493 }
494
495 pub fn with_request<V: Into<crate::model::UpdatePostureRequest>>(mut self, v: V) -> Self {
497 self.0.request = v.into();
498 self
499 }
500
501 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
503 self.0.options = v.into();
504 self
505 }
506
507 pub async fn send(self) -> Result<longrunning::model::Operation> {
514 (*self.0.stub)
515 .update_posture(self.0.request, self.0.options)
516 .await
517 .map(gax::response::Response::into_body)
518 }
519
520 pub fn poller(
522 self,
523 ) -> impl lro::Poller<crate::model::Posture, crate::model::OperationMetadata> {
524 type Operation =
525 lro::internal::Operation<crate::model::Posture, crate::model::OperationMetadata>;
526 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
527 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
528
529 let stub = self.0.stub.clone();
530 let mut options = self.0.options.clone();
531 options.set_retry_policy(gax::retry_policy::NeverRetry);
532 let query = move |name| {
533 let stub = stub.clone();
534 let options = options.clone();
535 async {
536 let op = GetOperation::new(stub)
537 .set_name(name)
538 .with_options(options)
539 .send()
540 .await?;
541 Ok(Operation::new(op))
542 }
543 };
544
545 let start = move || async {
546 let op = self.send().await?;
547 Ok(Operation::new(op))
548 };
549
550 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
551 }
552
553 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
557 mut self,
558 v: T,
559 ) -> Self {
560 self.0.request.update_mask = v.into();
561 self
562 }
563
564 pub fn set_posture<T: Into<std::option::Option<crate::model::Posture>>>(
568 mut self,
569 v: T,
570 ) -> Self {
571 self.0.request.posture = v.into();
572 self
573 }
574
575 pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
579 self.0.request.revision_id = v.into();
580 self
581 }
582 }
583
584 #[doc(hidden)]
585 impl gax::options::internal::RequestBuilder for UpdatePosture {
586 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
587 &mut self.0.options
588 }
589 }
590
591 #[derive(Clone, Debug)]
609 pub struct DeletePosture(RequestBuilder<crate::model::DeletePostureRequest>);
610
611 impl DeletePosture {
612 pub(crate) fn new(
613 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
614 ) -> Self {
615 Self(RequestBuilder::new(stub))
616 }
617
618 pub fn with_request<V: Into<crate::model::DeletePostureRequest>>(mut self, v: V) -> Self {
620 self.0.request = v.into();
621 self
622 }
623
624 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
626 self.0.options = v.into();
627 self
628 }
629
630 pub async fn send(self) -> Result<longrunning::model::Operation> {
637 (*self.0.stub)
638 .delete_posture(self.0.request, self.0.options)
639 .await
640 .map(gax::response::Response::into_body)
641 }
642
643 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
645 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
646 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
647 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
648
649 let stub = self.0.stub.clone();
650 let mut options = self.0.options.clone();
651 options.set_retry_policy(gax::retry_policy::NeverRetry);
652 let query = move |name| {
653 let stub = stub.clone();
654 let options = options.clone();
655 async {
656 let op = GetOperation::new(stub)
657 .set_name(name)
658 .with_options(options)
659 .send()
660 .await?;
661 Ok(Operation::new(op))
662 }
663 };
664
665 let start = move || async {
666 let op = self.send().await?;
667 Ok(Operation::new(op))
668 };
669
670 lro::internal::new_unit_response_poller(
671 polling_error_policy,
672 polling_backoff_policy,
673 start,
674 query,
675 )
676 }
677
678 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
682 self.0.request.name = v.into();
683 self
684 }
685
686 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
688 self.0.request.etag = v.into();
689 self
690 }
691 }
692
693 #[doc(hidden)]
694 impl gax::options::internal::RequestBuilder for DeletePosture {
695 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
696 &mut self.0.options
697 }
698 }
699
700 #[derive(Clone, Debug)]
718 pub struct ExtractPosture(RequestBuilder<crate::model::ExtractPostureRequest>);
719
720 impl ExtractPosture {
721 pub(crate) fn new(
722 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
723 ) -> Self {
724 Self(RequestBuilder::new(stub))
725 }
726
727 pub fn with_request<V: Into<crate::model::ExtractPostureRequest>>(mut self, v: V) -> Self {
729 self.0.request = v.into();
730 self
731 }
732
733 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
735 self.0.options = v.into();
736 self
737 }
738
739 pub async fn send(self) -> Result<longrunning::model::Operation> {
746 (*self.0.stub)
747 .extract_posture(self.0.request, self.0.options)
748 .await
749 .map(gax::response::Response::into_body)
750 }
751
752 pub fn poller(
754 self,
755 ) -> impl lro::Poller<crate::model::Posture, crate::model::OperationMetadata> {
756 type Operation =
757 lro::internal::Operation<crate::model::Posture, crate::model::OperationMetadata>;
758 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
759 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
760
761 let stub = self.0.stub.clone();
762 let mut options = self.0.options.clone();
763 options.set_retry_policy(gax::retry_policy::NeverRetry);
764 let query = move |name| {
765 let stub = stub.clone();
766 let options = options.clone();
767 async {
768 let op = GetOperation::new(stub)
769 .set_name(name)
770 .with_options(options)
771 .send()
772 .await?;
773 Ok(Operation::new(op))
774 }
775 };
776
777 let start = move || async {
778 let op = self.send().await?;
779 Ok(Operation::new(op))
780 };
781
782 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
783 }
784
785 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
789 self.0.request.parent = v.into();
790 self
791 }
792
793 pub fn set_posture_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
797 self.0.request.posture_id = v.into();
798 self
799 }
800
801 pub fn set_workload<T: Into<std::string::String>>(mut self, v: T) -> Self {
805 self.0.request.workload = v.into();
806 self
807 }
808 }
809
810 #[doc(hidden)]
811 impl gax::options::internal::RequestBuilder for ExtractPosture {
812 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
813 &mut self.0.options
814 }
815 }
816
817 #[derive(Clone, Debug)]
838 pub struct ListPostureDeployments(RequestBuilder<crate::model::ListPostureDeploymentsRequest>);
839
840 impl ListPostureDeployments {
841 pub(crate) fn new(
842 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
843 ) -> Self {
844 Self(RequestBuilder::new(stub))
845 }
846
847 pub fn with_request<V: Into<crate::model::ListPostureDeploymentsRequest>>(
849 mut self,
850 v: V,
851 ) -> Self {
852 self.0.request = v.into();
853 self
854 }
855
856 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
858 self.0.options = v.into();
859 self
860 }
861
862 pub async fn send(self) -> Result<crate::model::ListPostureDeploymentsResponse> {
864 (*self.0.stub)
865 .list_posture_deployments(self.0.request, self.0.options)
866 .await
867 .map(gax::response::Response::into_body)
868 }
869
870 pub fn by_page(
872 self,
873 ) -> impl gax::paginator::Paginator<
874 crate::model::ListPostureDeploymentsResponse,
875 gax::error::Error,
876 > {
877 use std::clone::Clone;
878 let token = self.0.request.page_token.clone();
879 let execute = move |token: String| {
880 let mut builder = self.clone();
881 builder.0.request = builder.0.request.set_page_token(token);
882 builder.send()
883 };
884 gax::paginator::internal::new_paginator(token, execute)
885 }
886
887 pub fn by_item(
889 self,
890 ) -> impl gax::paginator::ItemPaginator<
891 crate::model::ListPostureDeploymentsResponse,
892 gax::error::Error,
893 > {
894 use gax::paginator::Paginator;
895 self.by_page().items()
896 }
897
898 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
902 self.0.request.parent = v.into();
903 self
904 }
905
906 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
908 self.0.request.page_size = v.into();
909 self
910 }
911
912 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
914 self.0.request.page_token = v.into();
915 self
916 }
917
918 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
920 self.0.request.filter = v.into();
921 self
922 }
923 }
924
925 #[doc(hidden)]
926 impl gax::options::internal::RequestBuilder for ListPostureDeployments {
927 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
928 &mut self.0.options
929 }
930 }
931
932 #[derive(Clone, Debug)]
949 pub struct GetPostureDeployment(RequestBuilder<crate::model::GetPostureDeploymentRequest>);
950
951 impl GetPostureDeployment {
952 pub(crate) fn new(
953 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
954 ) -> Self {
955 Self(RequestBuilder::new(stub))
956 }
957
958 pub fn with_request<V: Into<crate::model::GetPostureDeploymentRequest>>(
960 mut self,
961 v: V,
962 ) -> Self {
963 self.0.request = v.into();
964 self
965 }
966
967 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
969 self.0.options = v.into();
970 self
971 }
972
973 pub async fn send(self) -> Result<crate::model::PostureDeployment> {
975 (*self.0.stub)
976 .get_posture_deployment(self.0.request, self.0.options)
977 .await
978 .map(gax::response::Response::into_body)
979 }
980
981 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
985 self.0.request.name = v.into();
986 self
987 }
988 }
989
990 #[doc(hidden)]
991 impl gax::options::internal::RequestBuilder for GetPostureDeployment {
992 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
993 &mut self.0.options
994 }
995 }
996
997 #[derive(Clone, Debug)]
1015 pub struct CreatePostureDeployment(
1016 RequestBuilder<crate::model::CreatePostureDeploymentRequest>,
1017 );
1018
1019 impl CreatePostureDeployment {
1020 pub(crate) fn new(
1021 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1022 ) -> Self {
1023 Self(RequestBuilder::new(stub))
1024 }
1025
1026 pub fn with_request<V: Into<crate::model::CreatePostureDeploymentRequest>>(
1028 mut self,
1029 v: V,
1030 ) -> Self {
1031 self.0.request = v.into();
1032 self
1033 }
1034
1035 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1037 self.0.options = v.into();
1038 self
1039 }
1040
1041 pub async fn send(self) -> Result<longrunning::model::Operation> {
1048 (*self.0.stub)
1049 .create_posture_deployment(self.0.request, self.0.options)
1050 .await
1051 .map(gax::response::Response::into_body)
1052 }
1053
1054 pub fn poller(
1056 self,
1057 ) -> impl lro::Poller<crate::model::PostureDeployment, crate::model::OperationMetadata>
1058 {
1059 type Operation = lro::internal::Operation<
1060 crate::model::PostureDeployment,
1061 crate::model::OperationMetadata,
1062 >;
1063 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1064 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1065
1066 let stub = self.0.stub.clone();
1067 let mut options = self.0.options.clone();
1068 options.set_retry_policy(gax::retry_policy::NeverRetry);
1069 let query = move |name| {
1070 let stub = stub.clone();
1071 let options = options.clone();
1072 async {
1073 let op = GetOperation::new(stub)
1074 .set_name(name)
1075 .with_options(options)
1076 .send()
1077 .await?;
1078 Ok(Operation::new(op))
1079 }
1080 };
1081
1082 let start = move || async {
1083 let op = self.send().await?;
1084 Ok(Operation::new(op))
1085 };
1086
1087 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1088 }
1089
1090 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1094 self.0.request.parent = v.into();
1095 self
1096 }
1097
1098 pub fn set_posture_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1102 self.0.request.posture_deployment_id = v.into();
1103 self
1104 }
1105
1106 pub fn set_posture_deployment<
1110 T: Into<std::option::Option<crate::model::PostureDeployment>>,
1111 >(
1112 mut self,
1113 v: T,
1114 ) -> Self {
1115 self.0.request.posture_deployment = v.into();
1116 self
1117 }
1118 }
1119
1120 #[doc(hidden)]
1121 impl gax::options::internal::RequestBuilder for CreatePostureDeployment {
1122 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1123 &mut self.0.options
1124 }
1125 }
1126
1127 #[derive(Clone, Debug)]
1145 pub struct UpdatePostureDeployment(
1146 RequestBuilder<crate::model::UpdatePostureDeploymentRequest>,
1147 );
1148
1149 impl UpdatePostureDeployment {
1150 pub(crate) fn new(
1151 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1152 ) -> Self {
1153 Self(RequestBuilder::new(stub))
1154 }
1155
1156 pub fn with_request<V: Into<crate::model::UpdatePostureDeploymentRequest>>(
1158 mut self,
1159 v: V,
1160 ) -> Self {
1161 self.0.request = v.into();
1162 self
1163 }
1164
1165 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1167 self.0.options = v.into();
1168 self
1169 }
1170
1171 pub async fn send(self) -> Result<longrunning::model::Operation> {
1178 (*self.0.stub)
1179 .update_posture_deployment(self.0.request, self.0.options)
1180 .await
1181 .map(gax::response::Response::into_body)
1182 }
1183
1184 pub fn poller(
1186 self,
1187 ) -> impl lro::Poller<crate::model::PostureDeployment, crate::model::OperationMetadata>
1188 {
1189 type Operation = lro::internal::Operation<
1190 crate::model::PostureDeployment,
1191 crate::model::OperationMetadata,
1192 >;
1193 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1194 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1195
1196 let stub = self.0.stub.clone();
1197 let mut options = self.0.options.clone();
1198 options.set_retry_policy(gax::retry_policy::NeverRetry);
1199 let query = move |name| {
1200 let stub = stub.clone();
1201 let options = options.clone();
1202 async {
1203 let op = GetOperation::new(stub)
1204 .set_name(name)
1205 .with_options(options)
1206 .send()
1207 .await?;
1208 Ok(Operation::new(op))
1209 }
1210 };
1211
1212 let start = move || async {
1213 let op = self.send().await?;
1214 Ok(Operation::new(op))
1215 };
1216
1217 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1218 }
1219
1220 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
1224 mut self,
1225 v: T,
1226 ) -> Self {
1227 self.0.request.update_mask = v.into();
1228 self
1229 }
1230
1231 pub fn set_posture_deployment<
1235 T: Into<std::option::Option<crate::model::PostureDeployment>>,
1236 >(
1237 mut self,
1238 v: T,
1239 ) -> Self {
1240 self.0.request.posture_deployment = v.into();
1241 self
1242 }
1243 }
1244
1245 #[doc(hidden)]
1246 impl gax::options::internal::RequestBuilder for UpdatePostureDeployment {
1247 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1248 &mut self.0.options
1249 }
1250 }
1251
1252 #[derive(Clone, Debug)]
1270 pub struct DeletePostureDeployment(
1271 RequestBuilder<crate::model::DeletePostureDeploymentRequest>,
1272 );
1273
1274 impl DeletePostureDeployment {
1275 pub(crate) fn new(
1276 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1277 ) -> Self {
1278 Self(RequestBuilder::new(stub))
1279 }
1280
1281 pub fn with_request<V: Into<crate::model::DeletePostureDeploymentRequest>>(
1283 mut self,
1284 v: V,
1285 ) -> Self {
1286 self.0.request = v.into();
1287 self
1288 }
1289
1290 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1292 self.0.options = v.into();
1293 self
1294 }
1295
1296 pub async fn send(self) -> Result<longrunning::model::Operation> {
1303 (*self.0.stub)
1304 .delete_posture_deployment(self.0.request, self.0.options)
1305 .await
1306 .map(gax::response::Response::into_body)
1307 }
1308
1309 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1311 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1312 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1313 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1314
1315 let stub = self.0.stub.clone();
1316 let mut options = self.0.options.clone();
1317 options.set_retry_policy(gax::retry_policy::NeverRetry);
1318 let query = move |name| {
1319 let stub = stub.clone();
1320 let options = options.clone();
1321 async {
1322 let op = GetOperation::new(stub)
1323 .set_name(name)
1324 .with_options(options)
1325 .send()
1326 .await?;
1327 Ok(Operation::new(op))
1328 }
1329 };
1330
1331 let start = move || async {
1332 let op = self.send().await?;
1333 Ok(Operation::new(op))
1334 };
1335
1336 lro::internal::new_unit_response_poller(
1337 polling_error_policy,
1338 polling_backoff_policy,
1339 start,
1340 query,
1341 )
1342 }
1343
1344 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1348 self.0.request.name = v.into();
1349 self
1350 }
1351
1352 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1354 self.0.request.etag = v.into();
1355 self
1356 }
1357 }
1358
1359 #[doc(hidden)]
1360 impl gax::options::internal::RequestBuilder for DeletePostureDeployment {
1361 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1362 &mut self.0.options
1363 }
1364 }
1365
1366 #[derive(Clone, Debug)]
1387 pub struct ListPostureTemplates(RequestBuilder<crate::model::ListPostureTemplatesRequest>);
1388
1389 impl ListPostureTemplates {
1390 pub(crate) fn new(
1391 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1392 ) -> Self {
1393 Self(RequestBuilder::new(stub))
1394 }
1395
1396 pub fn with_request<V: Into<crate::model::ListPostureTemplatesRequest>>(
1398 mut self,
1399 v: V,
1400 ) -> Self {
1401 self.0.request = v.into();
1402 self
1403 }
1404
1405 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1407 self.0.options = v.into();
1408 self
1409 }
1410
1411 pub async fn send(self) -> Result<crate::model::ListPostureTemplatesResponse> {
1413 (*self.0.stub)
1414 .list_posture_templates(self.0.request, self.0.options)
1415 .await
1416 .map(gax::response::Response::into_body)
1417 }
1418
1419 pub fn by_page(
1421 self,
1422 ) -> impl gax::paginator::Paginator<crate::model::ListPostureTemplatesResponse, gax::error::Error>
1423 {
1424 use std::clone::Clone;
1425 let token = self.0.request.page_token.clone();
1426 let execute = move |token: String| {
1427 let mut builder = self.clone();
1428 builder.0.request = builder.0.request.set_page_token(token);
1429 builder.send()
1430 };
1431 gax::paginator::internal::new_paginator(token, execute)
1432 }
1433
1434 pub fn by_item(
1436 self,
1437 ) -> impl gax::paginator::ItemPaginator<
1438 crate::model::ListPostureTemplatesResponse,
1439 gax::error::Error,
1440 > {
1441 use gax::paginator::Paginator;
1442 self.by_page().items()
1443 }
1444
1445 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1449 self.0.request.parent = v.into();
1450 self
1451 }
1452
1453 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1455 self.0.request.page_size = v.into();
1456 self
1457 }
1458
1459 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1461 self.0.request.page_token = v.into();
1462 self
1463 }
1464
1465 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1467 self.0.request.filter = v.into();
1468 self
1469 }
1470 }
1471
1472 #[doc(hidden)]
1473 impl gax::options::internal::RequestBuilder for ListPostureTemplates {
1474 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1475 &mut self.0.options
1476 }
1477 }
1478
1479 #[derive(Clone, Debug)]
1496 pub struct GetPostureTemplate(RequestBuilder<crate::model::GetPostureTemplateRequest>);
1497
1498 impl GetPostureTemplate {
1499 pub(crate) fn new(
1500 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1501 ) -> Self {
1502 Self(RequestBuilder::new(stub))
1503 }
1504
1505 pub fn with_request<V: Into<crate::model::GetPostureTemplateRequest>>(
1507 mut self,
1508 v: V,
1509 ) -> Self {
1510 self.0.request = v.into();
1511 self
1512 }
1513
1514 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1516 self.0.options = v.into();
1517 self
1518 }
1519
1520 pub async fn send(self) -> Result<crate::model::PostureTemplate> {
1522 (*self.0.stub)
1523 .get_posture_template(self.0.request, self.0.options)
1524 .await
1525 .map(gax::response::Response::into_body)
1526 }
1527
1528 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1532 self.0.request.name = v.into();
1533 self
1534 }
1535
1536 pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1538 self.0.request.revision_id = v.into();
1539 self
1540 }
1541 }
1542
1543 #[doc(hidden)]
1544 impl gax::options::internal::RequestBuilder for GetPostureTemplate {
1545 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1546 &mut self.0.options
1547 }
1548 }
1549
1550 #[derive(Clone, Debug)]
1571 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1572
1573 impl ListLocations {
1574 pub(crate) fn new(
1575 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1576 ) -> Self {
1577 Self(RequestBuilder::new(stub))
1578 }
1579
1580 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1582 mut self,
1583 v: V,
1584 ) -> Self {
1585 self.0.request = v.into();
1586 self
1587 }
1588
1589 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1591 self.0.options = v.into();
1592 self
1593 }
1594
1595 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1597 (*self.0.stub)
1598 .list_locations(self.0.request, self.0.options)
1599 .await
1600 .map(gax::response::Response::into_body)
1601 }
1602
1603 pub fn by_page(
1605 self,
1606 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1607 {
1608 use std::clone::Clone;
1609 let token = self.0.request.page_token.clone();
1610 let execute = move |token: String| {
1611 let mut builder = self.clone();
1612 builder.0.request = builder.0.request.set_page_token(token);
1613 builder.send()
1614 };
1615 gax::paginator::internal::new_paginator(token, execute)
1616 }
1617
1618 pub fn by_item(
1620 self,
1621 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1622 {
1623 use gax::paginator::Paginator;
1624 self.by_page().items()
1625 }
1626
1627 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1629 self.0.request.name = v.into();
1630 self
1631 }
1632
1633 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1635 self.0.request.filter = v.into();
1636 self
1637 }
1638
1639 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1641 self.0.request.page_size = v.into();
1642 self
1643 }
1644
1645 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1647 self.0.request.page_token = v.into();
1648 self
1649 }
1650 }
1651
1652 #[doc(hidden)]
1653 impl gax::options::internal::RequestBuilder for ListLocations {
1654 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1655 &mut self.0.options
1656 }
1657 }
1658
1659 #[derive(Clone, Debug)]
1676 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1677
1678 impl GetLocation {
1679 pub(crate) fn new(
1680 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1681 ) -> Self {
1682 Self(RequestBuilder::new(stub))
1683 }
1684
1685 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1687 self.0.request = v.into();
1688 self
1689 }
1690
1691 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1693 self.0.options = v.into();
1694 self
1695 }
1696
1697 pub async fn send(self) -> Result<location::model::Location> {
1699 (*self.0.stub)
1700 .get_location(self.0.request, self.0.options)
1701 .await
1702 .map(gax::response::Response::into_body)
1703 }
1704
1705 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1707 self.0.request.name = v.into();
1708 self
1709 }
1710 }
1711
1712 #[doc(hidden)]
1713 impl gax::options::internal::RequestBuilder for GetLocation {
1714 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1715 &mut self.0.options
1716 }
1717 }
1718
1719 #[derive(Clone, Debug)]
1740 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1741
1742 impl ListOperations {
1743 pub(crate) fn new(
1744 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1745 ) -> Self {
1746 Self(RequestBuilder::new(stub))
1747 }
1748
1749 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1751 mut self,
1752 v: V,
1753 ) -> Self {
1754 self.0.request = v.into();
1755 self
1756 }
1757
1758 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1760 self.0.options = v.into();
1761 self
1762 }
1763
1764 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1766 (*self.0.stub)
1767 .list_operations(self.0.request, self.0.options)
1768 .await
1769 .map(gax::response::Response::into_body)
1770 }
1771
1772 pub fn by_page(
1774 self,
1775 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1776 {
1777 use std::clone::Clone;
1778 let token = self.0.request.page_token.clone();
1779 let execute = move |token: String| {
1780 let mut builder = self.clone();
1781 builder.0.request = builder.0.request.set_page_token(token);
1782 builder.send()
1783 };
1784 gax::paginator::internal::new_paginator(token, execute)
1785 }
1786
1787 pub fn by_item(
1789 self,
1790 ) -> impl gax::paginator::ItemPaginator<
1791 longrunning::model::ListOperationsResponse,
1792 gax::error::Error,
1793 > {
1794 use gax::paginator::Paginator;
1795 self.by_page().items()
1796 }
1797
1798 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1800 self.0.request.name = v.into();
1801 self
1802 }
1803
1804 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1806 self.0.request.filter = v.into();
1807 self
1808 }
1809
1810 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1812 self.0.request.page_size = v.into();
1813 self
1814 }
1815
1816 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1818 self.0.request.page_token = v.into();
1819 self
1820 }
1821 }
1822
1823 #[doc(hidden)]
1824 impl gax::options::internal::RequestBuilder for ListOperations {
1825 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1826 &mut self.0.options
1827 }
1828 }
1829
1830 #[derive(Clone, Debug)]
1847 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1848
1849 impl GetOperation {
1850 pub(crate) fn new(
1851 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1852 ) -> Self {
1853 Self(RequestBuilder::new(stub))
1854 }
1855
1856 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1858 mut self,
1859 v: V,
1860 ) -> Self {
1861 self.0.request = v.into();
1862 self
1863 }
1864
1865 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1867 self.0.options = v.into();
1868 self
1869 }
1870
1871 pub async fn send(self) -> Result<longrunning::model::Operation> {
1873 (*self.0.stub)
1874 .get_operation(self.0.request, self.0.options)
1875 .await
1876 .map(gax::response::Response::into_body)
1877 }
1878
1879 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1881 self.0.request.name = v.into();
1882 self
1883 }
1884 }
1885
1886 #[doc(hidden)]
1887 impl gax::options::internal::RequestBuilder for GetOperation {
1888 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1889 &mut self.0.options
1890 }
1891 }
1892
1893 #[derive(Clone, Debug)]
1910 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1911
1912 impl DeleteOperation {
1913 pub(crate) fn new(
1914 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1915 ) -> Self {
1916 Self(RequestBuilder::new(stub))
1917 }
1918
1919 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1921 mut self,
1922 v: V,
1923 ) -> Self {
1924 self.0.request = v.into();
1925 self
1926 }
1927
1928 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1930 self.0.options = v.into();
1931 self
1932 }
1933
1934 pub async fn send(self) -> Result<()> {
1936 (*self.0.stub)
1937 .delete_operation(self.0.request, self.0.options)
1938 .await
1939 .map(gax::response::Response::into_body)
1940 }
1941
1942 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1944 self.0.request.name = v.into();
1945 self
1946 }
1947 }
1948
1949 #[doc(hidden)]
1950 impl gax::options::internal::RequestBuilder for DeleteOperation {
1951 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1952 &mut self.0.options
1953 }
1954 }
1955
1956 #[derive(Clone, Debug)]
1973 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1974
1975 impl CancelOperation {
1976 pub(crate) fn new(
1977 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1978 ) -> Self {
1979 Self(RequestBuilder::new(stub))
1980 }
1981
1982 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1984 mut self,
1985 v: V,
1986 ) -> Self {
1987 self.0.request = v.into();
1988 self
1989 }
1990
1991 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1993 self.0.options = v.into();
1994 self
1995 }
1996
1997 pub async fn send(self) -> Result<()> {
1999 (*self.0.stub)
2000 .cancel_operation(self.0.request, self.0.options)
2001 .await
2002 .map(gax::response::Response::into_body)
2003 }
2004
2005 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2007 self.0.request.name = v.into();
2008 self
2009 }
2010 }
2011
2012 #[doc(hidden)]
2013 impl gax::options::internal::RequestBuilder for CancelOperation {
2014 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2015 &mut self.0.options
2016 }
2017 }
2018}