1pub mod security_posture {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::SecurityPosture;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = SecurityPosture;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct ListPostures(RequestBuilder<crate::model::ListPosturesRequest>);
96
97 impl ListPostures {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListPosturesRequest>>(mut self, v: V) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<crate::model::ListPosturesResponse> {
118 (*self.0.stub)
119 .list_postures(self.0.request, self.0.options)
120 .await
121 .map(crate::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListPosturesResponse, crate::Error>
128 {
129 use std::clone::Clone;
130 let token = self.0.request.page_token.clone();
131 let execute = move |token: String| {
132 let mut builder = self.clone();
133 builder.0.request = builder.0.request.set_page_token(token);
134 builder.send()
135 };
136 google_cloud_gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl google_cloud_gax::paginator::ItemPaginator<
143 crate::model::ListPosturesResponse,
144 crate::Error,
145 > {
146 use google_cloud_gax::paginator::Paginator;
147 self.by_page().items()
148 }
149
150 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
154 self.0.request.parent = v.into();
155 self
156 }
157
158 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
160 self.0.request.page_size = v.into();
161 self
162 }
163
164 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
166 self.0.request.page_token = v.into();
167 self
168 }
169 }
170
171 #[doc(hidden)]
172 impl crate::RequestBuilder for ListPostures {
173 fn request_options(&mut self) -> &mut crate::RequestOptions {
174 &mut self.0.options
175 }
176 }
177
178 #[derive(Clone, Debug)]
199 pub struct ListPostureRevisions(RequestBuilder<crate::model::ListPostureRevisionsRequest>);
200
201 impl ListPostureRevisions {
202 pub(crate) fn new(
203 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
204 ) -> Self {
205 Self(RequestBuilder::new(stub))
206 }
207
208 pub fn with_request<V: Into<crate::model::ListPostureRevisionsRequest>>(
210 mut self,
211 v: V,
212 ) -> Self {
213 self.0.request = v.into();
214 self
215 }
216
217 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
219 self.0.options = v.into();
220 self
221 }
222
223 pub async fn send(self) -> Result<crate::model::ListPostureRevisionsResponse> {
225 (*self.0.stub)
226 .list_posture_revisions(self.0.request, self.0.options)
227 .await
228 .map(crate::Response::into_body)
229 }
230
231 pub fn by_page(
233 self,
234 ) -> impl google_cloud_gax::paginator::Paginator<
235 crate::model::ListPostureRevisionsResponse,
236 crate::Error,
237 > {
238 use std::clone::Clone;
239 let token = self.0.request.page_token.clone();
240 let execute = move |token: String| {
241 let mut builder = self.clone();
242 builder.0.request = builder.0.request.set_page_token(token);
243 builder.send()
244 };
245 google_cloud_gax::paginator::internal::new_paginator(token, execute)
246 }
247
248 pub fn by_item(
250 self,
251 ) -> impl google_cloud_gax::paginator::ItemPaginator<
252 crate::model::ListPostureRevisionsResponse,
253 crate::Error,
254 > {
255 use google_cloud_gax::paginator::Paginator;
256 self.by_page().items()
257 }
258
259 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
263 self.0.request.name = v.into();
264 self
265 }
266
267 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
269 self.0.request.page_size = v.into();
270 self
271 }
272
273 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
275 self.0.request.page_token = v.into();
276 self
277 }
278 }
279
280 #[doc(hidden)]
281 impl crate::RequestBuilder for ListPostureRevisions {
282 fn request_options(&mut self) -> &mut crate::RequestOptions {
283 &mut self.0.options
284 }
285 }
286
287 #[derive(Clone, Debug)]
304 pub struct GetPosture(RequestBuilder<crate::model::GetPostureRequest>);
305
306 impl GetPosture {
307 pub(crate) fn new(
308 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
309 ) -> Self {
310 Self(RequestBuilder::new(stub))
311 }
312
313 pub fn with_request<V: Into<crate::model::GetPostureRequest>>(mut self, v: V) -> Self {
315 self.0.request = v.into();
316 self
317 }
318
319 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
321 self.0.options = v.into();
322 self
323 }
324
325 pub async fn send(self) -> Result<crate::model::Posture> {
327 (*self.0.stub)
328 .get_posture(self.0.request, self.0.options)
329 .await
330 .map(crate::Response::into_body)
331 }
332
333 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
337 self.0.request.name = v.into();
338 self
339 }
340
341 pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
343 self.0.request.revision_id = v.into();
344 self
345 }
346 }
347
348 #[doc(hidden)]
349 impl crate::RequestBuilder for GetPosture {
350 fn request_options(&mut self) -> &mut crate::RequestOptions {
351 &mut self.0.options
352 }
353 }
354
355 #[derive(Clone, Debug)]
373 pub struct CreatePosture(RequestBuilder<crate::model::CreatePostureRequest>);
374
375 impl CreatePosture {
376 pub(crate) fn new(
377 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
378 ) -> Self {
379 Self(RequestBuilder::new(stub))
380 }
381
382 pub fn with_request<V: Into<crate::model::CreatePostureRequest>>(mut self, v: V) -> Self {
384 self.0.request = v.into();
385 self
386 }
387
388 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
390 self.0.options = v.into();
391 self
392 }
393
394 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
401 (*self.0.stub)
402 .create_posture(self.0.request, self.0.options)
403 .await
404 .map(crate::Response::into_body)
405 }
406
407 pub fn poller(
409 self,
410 ) -> impl google_cloud_lro::Poller<crate::model::Posture, crate::model::OperationMetadata>
411 {
412 type Operation = google_cloud_lro::internal::Operation<
413 crate::model::Posture,
414 crate::model::OperationMetadata,
415 >;
416 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
417 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
418 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
419 if let Some(ref mut details) = poller_options.tracing {
420 details.method_name = "google_cloud_securityposture_v1::client::SecurityPosture::create_posture::until_done";
421 }
422
423 let stub = self.0.stub.clone();
424 let mut options = self.0.options.clone();
425 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
426 let query = move |name| {
427 let stub = stub.clone();
428 let options = options.clone();
429 async {
430 let op = GetOperation::new(stub)
431 .set_name(name)
432 .with_options(options)
433 .send()
434 .await?;
435 Ok(Operation::new(op))
436 }
437 };
438
439 let start = move || async {
440 let op = self.send().await?;
441 Ok(Operation::new(op))
442 };
443
444 use google_cloud_lro::internal::PollerExt;
445 {
446 google_cloud_lro::internal::new_poller(
447 polling_error_policy,
448 polling_backoff_policy,
449 start,
450 query,
451 )
452 }
453 .with_options(poller_options)
454 }
455
456 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
460 self.0.request.parent = v.into();
461 self
462 }
463
464 pub fn set_posture_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
468 self.0.request.posture_id = v.into();
469 self
470 }
471
472 pub fn set_posture<T>(mut self, v: T) -> Self
476 where
477 T: std::convert::Into<crate::model::Posture>,
478 {
479 self.0.request.posture = std::option::Option::Some(v.into());
480 self
481 }
482
483 pub fn set_or_clear_posture<T>(mut self, v: std::option::Option<T>) -> Self
487 where
488 T: std::convert::Into<crate::model::Posture>,
489 {
490 self.0.request.posture = v.map(|x| x.into());
491 self
492 }
493 }
494
495 #[doc(hidden)]
496 impl crate::RequestBuilder for CreatePosture {
497 fn request_options(&mut self) -> &mut crate::RequestOptions {
498 &mut self.0.options
499 }
500 }
501
502 #[derive(Clone, Debug)]
520 pub struct UpdatePosture(RequestBuilder<crate::model::UpdatePostureRequest>);
521
522 impl UpdatePosture {
523 pub(crate) fn new(
524 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
525 ) -> Self {
526 Self(RequestBuilder::new(stub))
527 }
528
529 pub fn with_request<V: Into<crate::model::UpdatePostureRequest>>(mut self, v: V) -> Self {
531 self.0.request = v.into();
532 self
533 }
534
535 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
537 self.0.options = v.into();
538 self
539 }
540
541 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
548 (*self.0.stub)
549 .update_posture(self.0.request, self.0.options)
550 .await
551 .map(crate::Response::into_body)
552 }
553
554 pub fn poller(
556 self,
557 ) -> impl google_cloud_lro::Poller<crate::model::Posture, crate::model::OperationMetadata>
558 {
559 type Operation = google_cloud_lro::internal::Operation<
560 crate::model::Posture,
561 crate::model::OperationMetadata,
562 >;
563 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
564 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
565 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
566 if let Some(ref mut details) = poller_options.tracing {
567 details.method_name = "google_cloud_securityposture_v1::client::SecurityPosture::update_posture::until_done";
568 }
569
570 let stub = self.0.stub.clone();
571 let mut options = self.0.options.clone();
572 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
573 let query = move |name| {
574 let stub = stub.clone();
575 let options = options.clone();
576 async {
577 let op = GetOperation::new(stub)
578 .set_name(name)
579 .with_options(options)
580 .send()
581 .await?;
582 Ok(Operation::new(op))
583 }
584 };
585
586 let start = move || async {
587 let op = self.send().await?;
588 Ok(Operation::new(op))
589 };
590
591 use google_cloud_lro::internal::PollerExt;
592 {
593 google_cloud_lro::internal::new_poller(
594 polling_error_policy,
595 polling_backoff_policy,
596 start,
597 query,
598 )
599 }
600 .with_options(poller_options)
601 }
602
603 pub fn set_update_mask<T>(mut self, v: T) -> Self
607 where
608 T: std::convert::Into<wkt::FieldMask>,
609 {
610 self.0.request.update_mask = std::option::Option::Some(v.into());
611 self
612 }
613
614 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
618 where
619 T: std::convert::Into<wkt::FieldMask>,
620 {
621 self.0.request.update_mask = v.map(|x| x.into());
622 self
623 }
624
625 pub fn set_posture<T>(mut self, v: T) -> Self
629 where
630 T: std::convert::Into<crate::model::Posture>,
631 {
632 self.0.request.posture = std::option::Option::Some(v.into());
633 self
634 }
635
636 pub fn set_or_clear_posture<T>(mut self, v: std::option::Option<T>) -> Self
640 where
641 T: std::convert::Into<crate::model::Posture>,
642 {
643 self.0.request.posture = v.map(|x| x.into());
644 self
645 }
646
647 pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
651 self.0.request.revision_id = v.into();
652 self
653 }
654 }
655
656 #[doc(hidden)]
657 impl crate::RequestBuilder for UpdatePosture {
658 fn request_options(&mut self) -> &mut crate::RequestOptions {
659 &mut self.0.options
660 }
661 }
662
663 #[derive(Clone, Debug)]
681 pub struct DeletePosture(RequestBuilder<crate::model::DeletePostureRequest>);
682
683 impl DeletePosture {
684 pub(crate) fn new(
685 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
686 ) -> Self {
687 Self(RequestBuilder::new(stub))
688 }
689
690 pub fn with_request<V: Into<crate::model::DeletePostureRequest>>(mut self, v: V) -> Self {
692 self.0.request = v.into();
693 self
694 }
695
696 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
698 self.0.options = v.into();
699 self
700 }
701
702 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
709 (*self.0.stub)
710 .delete_posture(self.0.request, self.0.options)
711 .await
712 .map(crate::Response::into_body)
713 }
714
715 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
717 type Operation =
718 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
719 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
720 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
721 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
722 if let Some(ref mut details) = poller_options.tracing {
723 details.method_name = "google_cloud_securityposture_v1::client::SecurityPosture::delete_posture::until_done";
724 }
725
726 let stub = self.0.stub.clone();
727 let mut options = self.0.options.clone();
728 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
729 let query = move |name| {
730 let stub = stub.clone();
731 let options = options.clone();
732 async {
733 let op = GetOperation::new(stub)
734 .set_name(name)
735 .with_options(options)
736 .send()
737 .await?;
738 Ok(Operation::new(op))
739 }
740 };
741
742 let start = move || async {
743 let op = self.send().await?;
744 Ok(Operation::new(op))
745 };
746
747 use google_cloud_lro::internal::PollerExt;
748 {
749 google_cloud_lro::internal::new_unit_response_poller(
750 polling_error_policy,
751 polling_backoff_policy,
752 start,
753 query,
754 )
755 }
756 .with_options(poller_options)
757 }
758
759 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
763 self.0.request.name = v.into();
764 self
765 }
766
767 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
769 self.0.request.etag = v.into();
770 self
771 }
772 }
773
774 #[doc(hidden)]
775 impl crate::RequestBuilder for DeletePosture {
776 fn request_options(&mut self) -> &mut crate::RequestOptions {
777 &mut self.0.options
778 }
779 }
780
781 #[derive(Clone, Debug)]
799 pub struct ExtractPosture(RequestBuilder<crate::model::ExtractPostureRequest>);
800
801 impl ExtractPosture {
802 pub(crate) fn new(
803 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
804 ) -> Self {
805 Self(RequestBuilder::new(stub))
806 }
807
808 pub fn with_request<V: Into<crate::model::ExtractPostureRequest>>(mut self, v: V) -> Self {
810 self.0.request = v.into();
811 self
812 }
813
814 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
816 self.0.options = v.into();
817 self
818 }
819
820 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
827 (*self.0.stub)
828 .extract_posture(self.0.request, self.0.options)
829 .await
830 .map(crate::Response::into_body)
831 }
832
833 pub fn poller(
835 self,
836 ) -> impl google_cloud_lro::Poller<crate::model::Posture, crate::model::OperationMetadata>
837 {
838 type Operation = google_cloud_lro::internal::Operation<
839 crate::model::Posture,
840 crate::model::OperationMetadata,
841 >;
842 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
843 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
844 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
845 if let Some(ref mut details) = poller_options.tracing {
846 details.method_name = "google_cloud_securityposture_v1::client::SecurityPosture::extract_posture::until_done";
847 }
848
849 let stub = self.0.stub.clone();
850 let mut options = self.0.options.clone();
851 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
852 let query = move |name| {
853 let stub = stub.clone();
854 let options = options.clone();
855 async {
856 let op = GetOperation::new(stub)
857 .set_name(name)
858 .with_options(options)
859 .send()
860 .await?;
861 Ok(Operation::new(op))
862 }
863 };
864
865 let start = move || async {
866 let op = self.send().await?;
867 Ok(Operation::new(op))
868 };
869
870 use google_cloud_lro::internal::PollerExt;
871 {
872 google_cloud_lro::internal::new_poller(
873 polling_error_policy,
874 polling_backoff_policy,
875 start,
876 query,
877 )
878 }
879 .with_options(poller_options)
880 }
881
882 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
886 self.0.request.parent = v.into();
887 self
888 }
889
890 pub fn set_posture_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
894 self.0.request.posture_id = v.into();
895 self
896 }
897
898 pub fn set_workload<T: Into<std::string::String>>(mut self, v: T) -> Self {
902 self.0.request.workload = v.into();
903 self
904 }
905 }
906
907 #[doc(hidden)]
908 impl crate::RequestBuilder for ExtractPosture {
909 fn request_options(&mut self) -> &mut crate::RequestOptions {
910 &mut self.0.options
911 }
912 }
913
914 #[derive(Clone, Debug)]
935 pub struct ListPostureDeployments(RequestBuilder<crate::model::ListPostureDeploymentsRequest>);
936
937 impl ListPostureDeployments {
938 pub(crate) fn new(
939 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
940 ) -> Self {
941 Self(RequestBuilder::new(stub))
942 }
943
944 pub fn with_request<V: Into<crate::model::ListPostureDeploymentsRequest>>(
946 mut self,
947 v: V,
948 ) -> Self {
949 self.0.request = v.into();
950 self
951 }
952
953 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
955 self.0.options = v.into();
956 self
957 }
958
959 pub async fn send(self) -> Result<crate::model::ListPostureDeploymentsResponse> {
961 (*self.0.stub)
962 .list_posture_deployments(self.0.request, self.0.options)
963 .await
964 .map(crate::Response::into_body)
965 }
966
967 pub fn by_page(
969 self,
970 ) -> impl google_cloud_gax::paginator::Paginator<
971 crate::model::ListPostureDeploymentsResponse,
972 crate::Error,
973 > {
974 use std::clone::Clone;
975 let token = self.0.request.page_token.clone();
976 let execute = move |token: String| {
977 let mut builder = self.clone();
978 builder.0.request = builder.0.request.set_page_token(token);
979 builder.send()
980 };
981 google_cloud_gax::paginator::internal::new_paginator(token, execute)
982 }
983
984 pub fn by_item(
986 self,
987 ) -> impl google_cloud_gax::paginator::ItemPaginator<
988 crate::model::ListPostureDeploymentsResponse,
989 crate::Error,
990 > {
991 use google_cloud_gax::paginator::Paginator;
992 self.by_page().items()
993 }
994
995 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
999 self.0.request.parent = v.into();
1000 self
1001 }
1002
1003 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1005 self.0.request.page_size = v.into();
1006 self
1007 }
1008
1009 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1011 self.0.request.page_token = v.into();
1012 self
1013 }
1014
1015 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1017 self.0.request.filter = v.into();
1018 self
1019 }
1020 }
1021
1022 #[doc(hidden)]
1023 impl crate::RequestBuilder for ListPostureDeployments {
1024 fn request_options(&mut self) -> &mut crate::RequestOptions {
1025 &mut self.0.options
1026 }
1027 }
1028
1029 #[derive(Clone, Debug)]
1046 pub struct GetPostureDeployment(RequestBuilder<crate::model::GetPostureDeploymentRequest>);
1047
1048 impl GetPostureDeployment {
1049 pub(crate) fn new(
1050 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1051 ) -> Self {
1052 Self(RequestBuilder::new(stub))
1053 }
1054
1055 pub fn with_request<V: Into<crate::model::GetPostureDeploymentRequest>>(
1057 mut self,
1058 v: V,
1059 ) -> Self {
1060 self.0.request = v.into();
1061 self
1062 }
1063
1064 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1066 self.0.options = v.into();
1067 self
1068 }
1069
1070 pub async fn send(self) -> Result<crate::model::PostureDeployment> {
1072 (*self.0.stub)
1073 .get_posture_deployment(self.0.request, self.0.options)
1074 .await
1075 .map(crate::Response::into_body)
1076 }
1077
1078 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1082 self.0.request.name = v.into();
1083 self
1084 }
1085 }
1086
1087 #[doc(hidden)]
1088 impl crate::RequestBuilder for GetPostureDeployment {
1089 fn request_options(&mut self) -> &mut crate::RequestOptions {
1090 &mut self.0.options
1091 }
1092 }
1093
1094 #[derive(Clone, Debug)]
1112 pub struct CreatePostureDeployment(
1113 RequestBuilder<crate::model::CreatePostureDeploymentRequest>,
1114 );
1115
1116 impl CreatePostureDeployment {
1117 pub(crate) fn new(
1118 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1119 ) -> Self {
1120 Self(RequestBuilder::new(stub))
1121 }
1122
1123 pub fn with_request<V: Into<crate::model::CreatePostureDeploymentRequest>>(
1125 mut self,
1126 v: V,
1127 ) -> Self {
1128 self.0.request = v.into();
1129 self
1130 }
1131
1132 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1134 self.0.options = v.into();
1135 self
1136 }
1137
1138 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1145 (*self.0.stub)
1146 .create_posture_deployment(self.0.request, self.0.options)
1147 .await
1148 .map(crate::Response::into_body)
1149 }
1150
1151 pub fn poller(
1153 self,
1154 ) -> impl google_cloud_lro::Poller<
1155 crate::model::PostureDeployment,
1156 crate::model::OperationMetadata,
1157 > {
1158 type Operation = google_cloud_lro::internal::Operation<
1159 crate::model::PostureDeployment,
1160 crate::model::OperationMetadata,
1161 >;
1162 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1163 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1164 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1165 if let Some(ref mut details) = poller_options.tracing {
1166 details.method_name = "google_cloud_securityposture_v1::client::SecurityPosture::create_posture_deployment::until_done";
1167 }
1168
1169 let stub = self.0.stub.clone();
1170 let mut options = self.0.options.clone();
1171 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1172 let query = move |name| {
1173 let stub = stub.clone();
1174 let options = options.clone();
1175 async {
1176 let op = GetOperation::new(stub)
1177 .set_name(name)
1178 .with_options(options)
1179 .send()
1180 .await?;
1181 Ok(Operation::new(op))
1182 }
1183 };
1184
1185 let start = move || async {
1186 let op = self.send().await?;
1187 Ok(Operation::new(op))
1188 };
1189
1190 use google_cloud_lro::internal::PollerExt;
1191 {
1192 google_cloud_lro::internal::new_poller(
1193 polling_error_policy,
1194 polling_backoff_policy,
1195 start,
1196 query,
1197 )
1198 }
1199 .with_options(poller_options)
1200 }
1201
1202 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1206 self.0.request.parent = v.into();
1207 self
1208 }
1209
1210 pub fn set_posture_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1214 self.0.request.posture_deployment_id = v.into();
1215 self
1216 }
1217
1218 pub fn set_posture_deployment<T>(mut self, v: T) -> Self
1222 where
1223 T: std::convert::Into<crate::model::PostureDeployment>,
1224 {
1225 self.0.request.posture_deployment = std::option::Option::Some(v.into());
1226 self
1227 }
1228
1229 pub fn set_or_clear_posture_deployment<T>(mut self, v: std::option::Option<T>) -> Self
1233 where
1234 T: std::convert::Into<crate::model::PostureDeployment>,
1235 {
1236 self.0.request.posture_deployment = v.map(|x| x.into());
1237 self
1238 }
1239 }
1240
1241 #[doc(hidden)]
1242 impl crate::RequestBuilder for CreatePostureDeployment {
1243 fn request_options(&mut self) -> &mut crate::RequestOptions {
1244 &mut self.0.options
1245 }
1246 }
1247
1248 #[derive(Clone, Debug)]
1266 pub struct UpdatePostureDeployment(
1267 RequestBuilder<crate::model::UpdatePostureDeploymentRequest>,
1268 );
1269
1270 impl UpdatePostureDeployment {
1271 pub(crate) fn new(
1272 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1273 ) -> Self {
1274 Self(RequestBuilder::new(stub))
1275 }
1276
1277 pub fn with_request<V: Into<crate::model::UpdatePostureDeploymentRequest>>(
1279 mut self,
1280 v: V,
1281 ) -> Self {
1282 self.0.request = v.into();
1283 self
1284 }
1285
1286 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1288 self.0.options = v.into();
1289 self
1290 }
1291
1292 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1299 (*self.0.stub)
1300 .update_posture_deployment(self.0.request, self.0.options)
1301 .await
1302 .map(crate::Response::into_body)
1303 }
1304
1305 pub fn poller(
1307 self,
1308 ) -> impl google_cloud_lro::Poller<
1309 crate::model::PostureDeployment,
1310 crate::model::OperationMetadata,
1311 > {
1312 type Operation = google_cloud_lro::internal::Operation<
1313 crate::model::PostureDeployment,
1314 crate::model::OperationMetadata,
1315 >;
1316 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1317 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1318 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1319 if let Some(ref mut details) = poller_options.tracing {
1320 details.method_name = "google_cloud_securityposture_v1::client::SecurityPosture::update_posture_deployment::until_done";
1321 }
1322
1323 let stub = self.0.stub.clone();
1324 let mut options = self.0.options.clone();
1325 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1326 let query = move |name| {
1327 let stub = stub.clone();
1328 let options = options.clone();
1329 async {
1330 let op = GetOperation::new(stub)
1331 .set_name(name)
1332 .with_options(options)
1333 .send()
1334 .await?;
1335 Ok(Operation::new(op))
1336 }
1337 };
1338
1339 let start = move || async {
1340 let op = self.send().await?;
1341 Ok(Operation::new(op))
1342 };
1343
1344 use google_cloud_lro::internal::PollerExt;
1345 {
1346 google_cloud_lro::internal::new_poller(
1347 polling_error_policy,
1348 polling_backoff_policy,
1349 start,
1350 query,
1351 )
1352 }
1353 .with_options(poller_options)
1354 }
1355
1356 pub fn set_update_mask<T>(mut self, v: T) -> Self
1360 where
1361 T: std::convert::Into<wkt::FieldMask>,
1362 {
1363 self.0.request.update_mask = std::option::Option::Some(v.into());
1364 self
1365 }
1366
1367 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1371 where
1372 T: std::convert::Into<wkt::FieldMask>,
1373 {
1374 self.0.request.update_mask = v.map(|x| x.into());
1375 self
1376 }
1377
1378 pub fn set_posture_deployment<T>(mut self, v: T) -> Self
1382 where
1383 T: std::convert::Into<crate::model::PostureDeployment>,
1384 {
1385 self.0.request.posture_deployment = std::option::Option::Some(v.into());
1386 self
1387 }
1388
1389 pub fn set_or_clear_posture_deployment<T>(mut self, v: std::option::Option<T>) -> Self
1393 where
1394 T: std::convert::Into<crate::model::PostureDeployment>,
1395 {
1396 self.0.request.posture_deployment = v.map(|x| x.into());
1397 self
1398 }
1399 }
1400
1401 #[doc(hidden)]
1402 impl crate::RequestBuilder for UpdatePostureDeployment {
1403 fn request_options(&mut self) -> &mut crate::RequestOptions {
1404 &mut self.0.options
1405 }
1406 }
1407
1408 #[derive(Clone, Debug)]
1426 pub struct DeletePostureDeployment(
1427 RequestBuilder<crate::model::DeletePostureDeploymentRequest>,
1428 );
1429
1430 impl DeletePostureDeployment {
1431 pub(crate) fn new(
1432 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1433 ) -> Self {
1434 Self(RequestBuilder::new(stub))
1435 }
1436
1437 pub fn with_request<V: Into<crate::model::DeletePostureDeploymentRequest>>(
1439 mut self,
1440 v: V,
1441 ) -> Self {
1442 self.0.request = v.into();
1443 self
1444 }
1445
1446 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1448 self.0.options = v.into();
1449 self
1450 }
1451
1452 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1459 (*self.0.stub)
1460 .delete_posture_deployment(self.0.request, self.0.options)
1461 .await
1462 .map(crate::Response::into_body)
1463 }
1464
1465 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1467 type Operation =
1468 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1469 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1470 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1471 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1472 if let Some(ref mut details) = poller_options.tracing {
1473 details.method_name = "google_cloud_securityposture_v1::client::SecurityPosture::delete_posture_deployment::until_done";
1474 }
1475
1476 let stub = self.0.stub.clone();
1477 let mut options = self.0.options.clone();
1478 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1479 let query = move |name| {
1480 let stub = stub.clone();
1481 let options = options.clone();
1482 async {
1483 let op = GetOperation::new(stub)
1484 .set_name(name)
1485 .with_options(options)
1486 .send()
1487 .await?;
1488 Ok(Operation::new(op))
1489 }
1490 };
1491
1492 let start = move || async {
1493 let op = self.send().await?;
1494 Ok(Operation::new(op))
1495 };
1496
1497 use google_cloud_lro::internal::PollerExt;
1498 {
1499 google_cloud_lro::internal::new_unit_response_poller(
1500 polling_error_policy,
1501 polling_backoff_policy,
1502 start,
1503 query,
1504 )
1505 }
1506 .with_options(poller_options)
1507 }
1508
1509 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1513 self.0.request.name = v.into();
1514 self
1515 }
1516
1517 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1519 self.0.request.etag = v.into();
1520 self
1521 }
1522 }
1523
1524 #[doc(hidden)]
1525 impl crate::RequestBuilder for DeletePostureDeployment {
1526 fn request_options(&mut self) -> &mut crate::RequestOptions {
1527 &mut self.0.options
1528 }
1529 }
1530
1531 #[derive(Clone, Debug)]
1552 pub struct ListPostureTemplates(RequestBuilder<crate::model::ListPostureTemplatesRequest>);
1553
1554 impl ListPostureTemplates {
1555 pub(crate) fn new(
1556 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1557 ) -> Self {
1558 Self(RequestBuilder::new(stub))
1559 }
1560
1561 pub fn with_request<V: Into<crate::model::ListPostureTemplatesRequest>>(
1563 mut self,
1564 v: V,
1565 ) -> Self {
1566 self.0.request = v.into();
1567 self
1568 }
1569
1570 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1572 self.0.options = v.into();
1573 self
1574 }
1575
1576 pub async fn send(self) -> Result<crate::model::ListPostureTemplatesResponse> {
1578 (*self.0.stub)
1579 .list_posture_templates(self.0.request, self.0.options)
1580 .await
1581 .map(crate::Response::into_body)
1582 }
1583
1584 pub fn by_page(
1586 self,
1587 ) -> impl google_cloud_gax::paginator::Paginator<
1588 crate::model::ListPostureTemplatesResponse,
1589 crate::Error,
1590 > {
1591 use std::clone::Clone;
1592 let token = self.0.request.page_token.clone();
1593 let execute = move |token: String| {
1594 let mut builder = self.clone();
1595 builder.0.request = builder.0.request.set_page_token(token);
1596 builder.send()
1597 };
1598 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1599 }
1600
1601 pub fn by_item(
1603 self,
1604 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1605 crate::model::ListPostureTemplatesResponse,
1606 crate::Error,
1607 > {
1608 use google_cloud_gax::paginator::Paginator;
1609 self.by_page().items()
1610 }
1611
1612 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1616 self.0.request.parent = v.into();
1617 self
1618 }
1619
1620 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1622 self.0.request.page_size = v.into();
1623 self
1624 }
1625
1626 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1628 self.0.request.page_token = v.into();
1629 self
1630 }
1631
1632 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1634 self.0.request.filter = v.into();
1635 self
1636 }
1637 }
1638
1639 #[doc(hidden)]
1640 impl crate::RequestBuilder for ListPostureTemplates {
1641 fn request_options(&mut self) -> &mut crate::RequestOptions {
1642 &mut self.0.options
1643 }
1644 }
1645
1646 #[derive(Clone, Debug)]
1663 pub struct GetPostureTemplate(RequestBuilder<crate::model::GetPostureTemplateRequest>);
1664
1665 impl GetPostureTemplate {
1666 pub(crate) fn new(
1667 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1668 ) -> Self {
1669 Self(RequestBuilder::new(stub))
1670 }
1671
1672 pub fn with_request<V: Into<crate::model::GetPostureTemplateRequest>>(
1674 mut self,
1675 v: V,
1676 ) -> Self {
1677 self.0.request = v.into();
1678 self
1679 }
1680
1681 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1683 self.0.options = v.into();
1684 self
1685 }
1686
1687 pub async fn send(self) -> Result<crate::model::PostureTemplate> {
1689 (*self.0.stub)
1690 .get_posture_template(self.0.request, self.0.options)
1691 .await
1692 .map(crate::Response::into_body)
1693 }
1694
1695 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1699 self.0.request.name = v.into();
1700 self
1701 }
1702
1703 pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1705 self.0.request.revision_id = v.into();
1706 self
1707 }
1708 }
1709
1710 #[doc(hidden)]
1711 impl crate::RequestBuilder for GetPostureTemplate {
1712 fn request_options(&mut self) -> &mut crate::RequestOptions {
1713 &mut self.0.options
1714 }
1715 }
1716
1717 #[derive(Clone, Debug)]
1738 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1739
1740 impl ListLocations {
1741 pub(crate) fn new(
1742 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1743 ) -> Self {
1744 Self(RequestBuilder::new(stub))
1745 }
1746
1747 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1749 mut self,
1750 v: V,
1751 ) -> Self {
1752 self.0.request = v.into();
1753 self
1754 }
1755
1756 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1758 self.0.options = v.into();
1759 self
1760 }
1761
1762 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1764 (*self.0.stub)
1765 .list_locations(self.0.request, self.0.options)
1766 .await
1767 .map(crate::Response::into_body)
1768 }
1769
1770 pub fn by_page(
1772 self,
1773 ) -> impl google_cloud_gax::paginator::Paginator<
1774 google_cloud_location::model::ListLocationsResponse,
1775 crate::Error,
1776 > {
1777 use std::clone::Clone;
1778 let token = self.0.request.page_token.clone();
1779 let execute = move |token: String| {
1780 let mut builder = self.clone();
1781 builder.0.request = builder.0.request.set_page_token(token);
1782 builder.send()
1783 };
1784 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1785 }
1786
1787 pub fn by_item(
1789 self,
1790 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1791 google_cloud_location::model::ListLocationsResponse,
1792 crate::Error,
1793 > {
1794 use google_cloud_gax::paginator::Paginator;
1795 self.by_page().items()
1796 }
1797
1798 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 crate::RequestBuilder for ListLocations {
1825 fn request_options(&mut self) -> &mut crate::RequestOptions {
1826 &mut self.0.options
1827 }
1828 }
1829
1830 #[derive(Clone, Debug)]
1847 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1848
1849 impl GetLocation {
1850 pub(crate) fn new(
1851 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1852 ) -> Self {
1853 Self(RequestBuilder::new(stub))
1854 }
1855
1856 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1858 mut self,
1859 v: V,
1860 ) -> Self {
1861 self.0.request = v.into();
1862 self
1863 }
1864
1865 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1867 self.0.options = v.into();
1868 self
1869 }
1870
1871 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1873 (*self.0.stub)
1874 .get_location(self.0.request, self.0.options)
1875 .await
1876 .map(crate::Response::into_body)
1877 }
1878
1879 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1881 self.0.request.name = v.into();
1882 self
1883 }
1884 }
1885
1886 #[doc(hidden)]
1887 impl crate::RequestBuilder for GetLocation {
1888 fn request_options(&mut self) -> &mut crate::RequestOptions {
1889 &mut self.0.options
1890 }
1891 }
1892
1893 #[derive(Clone, Debug)]
1914 pub struct ListOperations(
1915 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1916 );
1917
1918 impl ListOperations {
1919 pub(crate) fn new(
1920 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
1921 ) -> Self {
1922 Self(RequestBuilder::new(stub))
1923 }
1924
1925 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1927 mut self,
1928 v: V,
1929 ) -> Self {
1930 self.0.request = v.into();
1931 self
1932 }
1933
1934 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1936 self.0.options = v.into();
1937 self
1938 }
1939
1940 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1942 (*self.0.stub)
1943 .list_operations(self.0.request, self.0.options)
1944 .await
1945 .map(crate::Response::into_body)
1946 }
1947
1948 pub fn by_page(
1950 self,
1951 ) -> impl google_cloud_gax::paginator::Paginator<
1952 google_cloud_longrunning::model::ListOperationsResponse,
1953 crate::Error,
1954 > {
1955 use std::clone::Clone;
1956 let token = self.0.request.page_token.clone();
1957 let execute = move |token: String| {
1958 let mut builder = self.clone();
1959 builder.0.request = builder.0.request.set_page_token(token);
1960 builder.send()
1961 };
1962 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1963 }
1964
1965 pub fn by_item(
1967 self,
1968 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1969 google_cloud_longrunning::model::ListOperationsResponse,
1970 crate::Error,
1971 > {
1972 use google_cloud_gax::paginator::Paginator;
1973 self.by_page().items()
1974 }
1975
1976 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1978 self.0.request.name = v.into();
1979 self
1980 }
1981
1982 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1984 self.0.request.filter = v.into();
1985 self
1986 }
1987
1988 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1990 self.0.request.page_size = v.into();
1991 self
1992 }
1993
1994 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1996 self.0.request.page_token = v.into();
1997 self
1998 }
1999
2000 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2002 self.0.request.return_partial_success = v.into();
2003 self
2004 }
2005 }
2006
2007 #[doc(hidden)]
2008 impl crate::RequestBuilder for ListOperations {
2009 fn request_options(&mut self) -> &mut crate::RequestOptions {
2010 &mut self.0.options
2011 }
2012 }
2013
2014 #[derive(Clone, Debug)]
2031 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2032
2033 impl GetOperation {
2034 pub(crate) fn new(
2035 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
2036 ) -> Self {
2037 Self(RequestBuilder::new(stub))
2038 }
2039
2040 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2042 mut self,
2043 v: V,
2044 ) -> Self {
2045 self.0.request = v.into();
2046 self
2047 }
2048
2049 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2051 self.0.options = v.into();
2052 self
2053 }
2054
2055 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2057 (*self.0.stub)
2058 .get_operation(self.0.request, self.0.options)
2059 .await
2060 .map(crate::Response::into_body)
2061 }
2062
2063 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2065 self.0.request.name = v.into();
2066 self
2067 }
2068 }
2069
2070 #[doc(hidden)]
2071 impl crate::RequestBuilder for GetOperation {
2072 fn request_options(&mut self) -> &mut crate::RequestOptions {
2073 &mut self.0.options
2074 }
2075 }
2076
2077 #[derive(Clone, Debug)]
2094 pub struct DeleteOperation(
2095 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2096 );
2097
2098 impl DeleteOperation {
2099 pub(crate) fn new(
2100 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
2101 ) -> Self {
2102 Self(RequestBuilder::new(stub))
2103 }
2104
2105 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2107 mut self,
2108 v: V,
2109 ) -> Self {
2110 self.0.request = v.into();
2111 self
2112 }
2113
2114 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2116 self.0.options = v.into();
2117 self
2118 }
2119
2120 pub async fn send(self) -> Result<()> {
2122 (*self.0.stub)
2123 .delete_operation(self.0.request, self.0.options)
2124 .await
2125 .map(crate::Response::into_body)
2126 }
2127
2128 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2130 self.0.request.name = v.into();
2131 self
2132 }
2133 }
2134
2135 #[doc(hidden)]
2136 impl crate::RequestBuilder for DeleteOperation {
2137 fn request_options(&mut self) -> &mut crate::RequestOptions {
2138 &mut self.0.options
2139 }
2140 }
2141
2142 #[derive(Clone, Debug)]
2159 pub struct CancelOperation(
2160 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2161 );
2162
2163 impl CancelOperation {
2164 pub(crate) fn new(
2165 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityPosture>,
2166 ) -> Self {
2167 Self(RequestBuilder::new(stub))
2168 }
2169
2170 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2172 mut self,
2173 v: V,
2174 ) -> Self {
2175 self.0.request = v.into();
2176 self
2177 }
2178
2179 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2181 self.0.options = v.into();
2182 self
2183 }
2184
2185 pub async fn send(self) -> Result<()> {
2187 (*self.0.stub)
2188 .cancel_operation(self.0.request, self.0.options)
2189 .await
2190 .map(crate::Response::into_body)
2191 }
2192
2193 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2195 self.0.request.name = v.into();
2196 self
2197 }
2198 }
2199
2200 #[doc(hidden)]
2201 impl crate::RequestBuilder for CancelOperation {
2202 fn request_options(&mut self) -> &mut crate::RequestOptions {
2203 &mut self.0.options
2204 }
2205 }
2206}