1pub mod audit {
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::Audit;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = Audit;
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::Audit>,
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(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: crate::RequestOptions::default(),
68 }
69 }
70 }
71
72 #[derive(Clone, Debug)]
89 pub struct GenerateFrameworkAuditScopeReport(
90 RequestBuilder<crate::model::GenerateFrameworkAuditScopeReportRequest>,
91 );
92
93 impl GenerateFrameworkAuditScopeReport {
94 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
95 Self(RequestBuilder::new(stub))
96 }
97
98 pub fn with_request<V: Into<crate::model::GenerateFrameworkAuditScopeReportRequest>>(
100 mut self,
101 v: V,
102 ) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 pub fn with_options<V: Into<crate::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::GenerateFrameworkAuditScopeReportResponse> {
115 (*self.0.stub)
116 .generate_framework_audit_scope_report(self.0.request, self.0.options)
117 .await
118 .map(crate::Response::into_body)
119 }
120
121 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
125 self.0.request.scope = v.into();
126 self
127 }
128
129 pub fn set_report_format<
133 T: Into<crate::model::generate_framework_audit_scope_report_request::Format>,
134 >(
135 mut self,
136 v: T,
137 ) -> Self {
138 self.0.request.report_format = v.into();
139 self
140 }
141
142 pub fn set_compliance_framework<T: Into<std::string::String>>(mut self, v: T) -> Self {
146 self.0.request.compliance_framework = v.into();
147 self
148 }
149 }
150
151 #[doc(hidden)]
152 impl crate::RequestBuilder for GenerateFrameworkAuditScopeReport {
153 fn request_options(&mut self) -> &mut crate::RequestOptions {
154 &mut self.0.options
155 }
156 }
157
158 #[derive(Clone, Debug)]
176 pub struct CreateFrameworkAudit(RequestBuilder<crate::model::CreateFrameworkAuditRequest>);
177
178 impl CreateFrameworkAudit {
179 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
180 Self(RequestBuilder::new(stub))
181 }
182
183 pub fn with_request<V: Into<crate::model::CreateFrameworkAuditRequest>>(
185 mut self,
186 v: V,
187 ) -> Self {
188 self.0.request = v.into();
189 self
190 }
191
192 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
194 self.0.options = v.into();
195 self
196 }
197
198 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
205 (*self.0.stub)
206 .create_framework_audit(self.0.request, self.0.options)
207 .await
208 .map(crate::Response::into_body)
209 }
210
211 pub fn poller(
213 self,
214 ) -> impl google_cloud_lro::Poller<crate::model::FrameworkAudit, crate::model::OperationMetadata>
215 {
216 type Operation = google_cloud_lro::internal::Operation<
217 crate::model::FrameworkAudit,
218 crate::model::OperationMetadata,
219 >;
220 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
221 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
222 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
223 if let Some(ref mut details) = poller_options.tracing {
224 details.method_name = "google_cloud_cloudsecuritycompliance_v1::client::Audit::create_framework_audit::until_done";
225 }
226
227 let stub = self.0.stub.clone();
228 let mut options = self.0.options.clone();
229 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
230 let query = move |name| {
231 let stub = stub.clone();
232 let options = options.clone();
233 async {
234 let op = GetOperation::new(stub)
235 .set_name(name)
236 .with_options(options)
237 .send()
238 .await?;
239 Ok(Operation::new(op))
240 }
241 };
242
243 let start = move || async {
244 let op = self.send().await?;
245 Ok(Operation::new(op))
246 };
247
248 use google_cloud_lro::internal::PollerExt;
249 {
250 google_cloud_lro::internal::new_poller(
251 polling_error_policy,
252 polling_backoff_policy,
253 start,
254 query,
255 )
256 }
257 .with_options(poller_options)
258 }
259
260 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
264 self.0.request.parent = v.into();
265 self
266 }
267
268 pub fn set_framework_audit_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
270 self.0.request.framework_audit_id = v.into();
271 self
272 }
273
274 pub fn set_framework_audit<T>(mut self, v: T) -> Self
278 where
279 T: std::convert::Into<crate::model::FrameworkAudit>,
280 {
281 self.0.request.framework_audit = std::option::Option::Some(v.into());
282 self
283 }
284
285 pub fn set_or_clear_framework_audit<T>(mut self, v: std::option::Option<T>) -> Self
289 where
290 T: std::convert::Into<crate::model::FrameworkAudit>,
291 {
292 self.0.request.framework_audit = v.map(|x| x.into());
293 self
294 }
295 }
296
297 #[doc(hidden)]
298 impl crate::RequestBuilder for CreateFrameworkAudit {
299 fn request_options(&mut self) -> &mut crate::RequestOptions {
300 &mut self.0.options
301 }
302 }
303
304 #[derive(Clone, Debug)]
325 pub struct ListFrameworkAudits(RequestBuilder<crate::model::ListFrameworkAuditsRequest>);
326
327 impl ListFrameworkAudits {
328 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
329 Self(RequestBuilder::new(stub))
330 }
331
332 pub fn with_request<V: Into<crate::model::ListFrameworkAuditsRequest>>(
334 mut self,
335 v: V,
336 ) -> Self {
337 self.0.request = v.into();
338 self
339 }
340
341 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
343 self.0.options = v.into();
344 self
345 }
346
347 pub async fn send(self) -> Result<crate::model::ListFrameworkAuditsResponse> {
349 (*self.0.stub)
350 .list_framework_audits(self.0.request, self.0.options)
351 .await
352 .map(crate::Response::into_body)
353 }
354
355 pub fn by_page(
357 self,
358 ) -> impl google_cloud_gax::paginator::Paginator<
359 crate::model::ListFrameworkAuditsResponse,
360 crate::Error,
361 > {
362 use std::clone::Clone;
363 let token = self.0.request.page_token.clone();
364 let execute = move |token: String| {
365 let mut builder = self.clone();
366 builder.0.request = builder.0.request.set_page_token(token);
367 builder.send()
368 };
369 google_cloud_gax::paginator::internal::new_paginator(token, execute)
370 }
371
372 pub fn by_item(
374 self,
375 ) -> impl google_cloud_gax::paginator::ItemPaginator<
376 crate::model::ListFrameworkAuditsResponse,
377 crate::Error,
378 > {
379 use google_cloud_gax::paginator::Paginator;
380 self.by_page().items()
381 }
382
383 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
387 self.0.request.parent = v.into();
388 self
389 }
390
391 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
393 self.0.request.page_size = v.into();
394 self
395 }
396
397 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
399 self.0.request.page_token = v.into();
400 self
401 }
402
403 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
405 self.0.request.filter = v.into();
406 self
407 }
408 }
409
410 #[doc(hidden)]
411 impl crate::RequestBuilder for ListFrameworkAudits {
412 fn request_options(&mut self) -> &mut crate::RequestOptions {
413 &mut self.0.options
414 }
415 }
416
417 #[derive(Clone, Debug)]
434 pub struct GetFrameworkAudit(RequestBuilder<crate::model::GetFrameworkAuditRequest>);
435
436 impl GetFrameworkAudit {
437 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
438 Self(RequestBuilder::new(stub))
439 }
440
441 pub fn with_request<V: Into<crate::model::GetFrameworkAuditRequest>>(
443 mut self,
444 v: V,
445 ) -> Self {
446 self.0.request = v.into();
447 self
448 }
449
450 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
452 self.0.options = v.into();
453 self
454 }
455
456 pub async fn send(self) -> Result<crate::model::FrameworkAudit> {
458 (*self.0.stub)
459 .get_framework_audit(self.0.request, self.0.options)
460 .await
461 .map(crate::Response::into_body)
462 }
463
464 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
468 self.0.request.name = v.into();
469 self
470 }
471 }
472
473 #[doc(hidden)]
474 impl crate::RequestBuilder for GetFrameworkAudit {
475 fn request_options(&mut self) -> &mut crate::RequestOptions {
476 &mut self.0.options
477 }
478 }
479
480 #[derive(Clone, Debug)]
501 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
502
503 impl ListLocations {
504 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
505 Self(RequestBuilder::new(stub))
506 }
507
508 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
510 mut self,
511 v: V,
512 ) -> Self {
513 self.0.request = v.into();
514 self
515 }
516
517 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
519 self.0.options = v.into();
520 self
521 }
522
523 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
525 (*self.0.stub)
526 .list_locations(self.0.request, self.0.options)
527 .await
528 .map(crate::Response::into_body)
529 }
530
531 pub fn by_page(
533 self,
534 ) -> impl google_cloud_gax::paginator::Paginator<
535 google_cloud_location::model::ListLocationsResponse,
536 crate::Error,
537 > {
538 use std::clone::Clone;
539 let token = self.0.request.page_token.clone();
540 let execute = move |token: String| {
541 let mut builder = self.clone();
542 builder.0.request = builder.0.request.set_page_token(token);
543 builder.send()
544 };
545 google_cloud_gax::paginator::internal::new_paginator(token, execute)
546 }
547
548 pub fn by_item(
550 self,
551 ) -> impl google_cloud_gax::paginator::ItemPaginator<
552 google_cloud_location::model::ListLocationsResponse,
553 crate::Error,
554 > {
555 use google_cloud_gax::paginator::Paginator;
556 self.by_page().items()
557 }
558
559 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
561 self.0.request.name = v.into();
562 self
563 }
564
565 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
567 self.0.request.filter = v.into();
568 self
569 }
570
571 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
573 self.0.request.page_size = v.into();
574 self
575 }
576
577 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
579 self.0.request.page_token = v.into();
580 self
581 }
582 }
583
584 #[doc(hidden)]
585 impl crate::RequestBuilder for ListLocations {
586 fn request_options(&mut self) -> &mut crate::RequestOptions {
587 &mut self.0.options
588 }
589 }
590
591 #[derive(Clone, Debug)]
608 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
609
610 impl GetLocation {
611 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
612 Self(RequestBuilder::new(stub))
613 }
614
615 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
617 mut self,
618 v: V,
619 ) -> Self {
620 self.0.request = v.into();
621 self
622 }
623
624 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
626 self.0.options = v.into();
627 self
628 }
629
630 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
632 (*self.0.stub)
633 .get_location(self.0.request, self.0.options)
634 .await
635 .map(crate::Response::into_body)
636 }
637
638 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
640 self.0.request.name = v.into();
641 self
642 }
643 }
644
645 #[doc(hidden)]
646 impl crate::RequestBuilder for GetLocation {
647 fn request_options(&mut self) -> &mut crate::RequestOptions {
648 &mut self.0.options
649 }
650 }
651
652 #[derive(Clone, Debug)]
673 pub struct ListOperations(
674 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
675 );
676
677 impl ListOperations {
678 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
679 Self(RequestBuilder::new(stub))
680 }
681
682 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
684 mut self,
685 v: V,
686 ) -> Self {
687 self.0.request = v.into();
688 self
689 }
690
691 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
693 self.0.options = v.into();
694 self
695 }
696
697 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
699 (*self.0.stub)
700 .list_operations(self.0.request, self.0.options)
701 .await
702 .map(crate::Response::into_body)
703 }
704
705 pub fn by_page(
707 self,
708 ) -> impl google_cloud_gax::paginator::Paginator<
709 google_cloud_longrunning::model::ListOperationsResponse,
710 crate::Error,
711 > {
712 use std::clone::Clone;
713 let token = self.0.request.page_token.clone();
714 let execute = move |token: String| {
715 let mut builder = self.clone();
716 builder.0.request = builder.0.request.set_page_token(token);
717 builder.send()
718 };
719 google_cloud_gax::paginator::internal::new_paginator(token, execute)
720 }
721
722 pub fn by_item(
724 self,
725 ) -> impl google_cloud_gax::paginator::ItemPaginator<
726 google_cloud_longrunning::model::ListOperationsResponse,
727 crate::Error,
728 > {
729 use google_cloud_gax::paginator::Paginator;
730 self.by_page().items()
731 }
732
733 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
735 self.0.request.name = v.into();
736 self
737 }
738
739 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
741 self.0.request.filter = v.into();
742 self
743 }
744
745 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
747 self.0.request.page_size = v.into();
748 self
749 }
750
751 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
753 self.0.request.page_token = v.into();
754 self
755 }
756
757 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
759 self.0.request.return_partial_success = v.into();
760 self
761 }
762 }
763
764 #[doc(hidden)]
765 impl crate::RequestBuilder for ListOperations {
766 fn request_options(&mut self) -> &mut crate::RequestOptions {
767 &mut self.0.options
768 }
769 }
770
771 #[derive(Clone, Debug)]
788 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
789
790 impl GetOperation {
791 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
792 Self(RequestBuilder::new(stub))
793 }
794
795 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
797 mut self,
798 v: V,
799 ) -> Self {
800 self.0.request = v.into();
801 self
802 }
803
804 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
806 self.0.options = v.into();
807 self
808 }
809
810 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
812 (*self.0.stub)
813 .get_operation(self.0.request, self.0.options)
814 .await
815 .map(crate::Response::into_body)
816 }
817
818 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
820 self.0.request.name = v.into();
821 self
822 }
823 }
824
825 #[doc(hidden)]
826 impl crate::RequestBuilder for GetOperation {
827 fn request_options(&mut self) -> &mut crate::RequestOptions {
828 &mut self.0.options
829 }
830 }
831
832 #[derive(Clone, Debug)]
849 pub struct DeleteOperation(
850 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
851 );
852
853 impl DeleteOperation {
854 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
855 Self(RequestBuilder::new(stub))
856 }
857
858 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
860 mut self,
861 v: V,
862 ) -> Self {
863 self.0.request = v.into();
864 self
865 }
866
867 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
869 self.0.options = v.into();
870 self
871 }
872
873 pub async fn send(self) -> Result<()> {
875 (*self.0.stub)
876 .delete_operation(self.0.request, self.0.options)
877 .await
878 .map(crate::Response::into_body)
879 }
880
881 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
883 self.0.request.name = v.into();
884 self
885 }
886 }
887
888 #[doc(hidden)]
889 impl crate::RequestBuilder for DeleteOperation {
890 fn request_options(&mut self) -> &mut crate::RequestOptions {
891 &mut self.0.options
892 }
893 }
894
895 #[derive(Clone, Debug)]
912 pub struct CancelOperation(
913 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
914 );
915
916 impl CancelOperation {
917 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
918 Self(RequestBuilder::new(stub))
919 }
920
921 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
923 mut self,
924 v: V,
925 ) -> Self {
926 self.0.request = v.into();
927 self
928 }
929
930 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
932 self.0.options = v.into();
933 self
934 }
935
936 pub async fn send(self) -> Result<()> {
938 (*self.0.stub)
939 .cancel_operation(self.0.request, self.0.options)
940 .await
941 .map(crate::Response::into_body)
942 }
943
944 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
946 self.0.request.name = v.into();
947 self
948 }
949 }
950
951 #[doc(hidden)]
952 impl crate::RequestBuilder for CancelOperation {
953 fn request_options(&mut self) -> &mut crate::RequestOptions {
954 &mut self.0.options
955 }
956 }
957}
958
959pub mod cm_enrollment_service {
961 use crate::Result;
962
963 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
977
978 pub(crate) mod client {
979 use super::super::super::client::CmEnrollmentService;
980 pub struct Factory;
981 impl crate::ClientFactory for Factory {
982 type Client = CmEnrollmentService;
983 type Credentials = gaxi::options::Credentials;
984 async fn build(
985 self,
986 config: gaxi::options::ClientConfig,
987 ) -> crate::ClientBuilderResult<Self::Client> {
988 Self::Client::new(config).await
989 }
990 }
991 }
992
993 #[derive(Clone, Debug)]
995 pub(crate) struct RequestBuilder<R: std::default::Default> {
996 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
997 request: R,
998 options: crate::RequestOptions,
999 }
1000
1001 impl<R> RequestBuilder<R>
1002 where
1003 R: std::default::Default,
1004 {
1005 pub(crate) fn new(
1006 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1007 ) -> Self {
1008 Self {
1009 stub,
1010 request: R::default(),
1011 options: crate::RequestOptions::default(),
1012 }
1013 }
1014 }
1015
1016 #[derive(Clone, Debug)]
1033 pub struct UpdateCmEnrollment(RequestBuilder<crate::model::UpdateCmEnrollmentRequest>);
1034
1035 impl UpdateCmEnrollment {
1036 pub(crate) fn new(
1037 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1038 ) -> Self {
1039 Self(RequestBuilder::new(stub))
1040 }
1041
1042 pub fn with_request<V: Into<crate::model::UpdateCmEnrollmentRequest>>(
1044 mut self,
1045 v: V,
1046 ) -> Self {
1047 self.0.request = v.into();
1048 self
1049 }
1050
1051 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1053 self.0.options = v.into();
1054 self
1055 }
1056
1057 pub async fn send(self) -> Result<crate::model::CmEnrollment> {
1059 (*self.0.stub)
1060 .update_cm_enrollment(self.0.request, self.0.options)
1061 .await
1062 .map(crate::Response::into_body)
1063 }
1064
1065 pub fn set_cm_enrollment<T>(mut self, v: T) -> Self
1069 where
1070 T: std::convert::Into<crate::model::CmEnrollment>,
1071 {
1072 self.0.request.cm_enrollment = std::option::Option::Some(v.into());
1073 self
1074 }
1075
1076 pub fn set_or_clear_cm_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
1080 where
1081 T: std::convert::Into<crate::model::CmEnrollment>,
1082 {
1083 self.0.request.cm_enrollment = v.map(|x| x.into());
1084 self
1085 }
1086
1087 pub fn set_update_mask<T>(mut self, v: T) -> Self
1089 where
1090 T: std::convert::Into<wkt::FieldMask>,
1091 {
1092 self.0.request.update_mask = std::option::Option::Some(v.into());
1093 self
1094 }
1095
1096 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1098 where
1099 T: std::convert::Into<wkt::FieldMask>,
1100 {
1101 self.0.request.update_mask = v.map(|x| x.into());
1102 self
1103 }
1104 }
1105
1106 #[doc(hidden)]
1107 impl crate::RequestBuilder for UpdateCmEnrollment {
1108 fn request_options(&mut self) -> &mut crate::RequestOptions {
1109 &mut self.0.options
1110 }
1111 }
1112
1113 #[derive(Clone, Debug)]
1130 pub struct CalculateEffectiveCmEnrollment(
1131 RequestBuilder<crate::model::CalculateEffectiveCmEnrollmentRequest>,
1132 );
1133
1134 impl CalculateEffectiveCmEnrollment {
1135 pub(crate) fn new(
1136 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1137 ) -> Self {
1138 Self(RequestBuilder::new(stub))
1139 }
1140
1141 pub fn with_request<V: Into<crate::model::CalculateEffectiveCmEnrollmentRequest>>(
1143 mut self,
1144 v: V,
1145 ) -> Self {
1146 self.0.request = v.into();
1147 self
1148 }
1149
1150 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1152 self.0.options = v.into();
1153 self
1154 }
1155
1156 pub async fn send(self) -> Result<crate::model::CalculateEffectiveCmEnrollmentResponse> {
1158 (*self.0.stub)
1159 .calculate_effective_cm_enrollment(self.0.request, self.0.options)
1160 .await
1161 .map(crate::Response::into_body)
1162 }
1163
1164 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1168 self.0.request.name = v.into();
1169 self
1170 }
1171 }
1172
1173 #[doc(hidden)]
1174 impl crate::RequestBuilder for CalculateEffectiveCmEnrollment {
1175 fn request_options(&mut self) -> &mut crate::RequestOptions {
1176 &mut self.0.options
1177 }
1178 }
1179
1180 #[derive(Clone, Debug)]
1201 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1202
1203 impl ListLocations {
1204 pub(crate) fn new(
1205 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1206 ) -> Self {
1207 Self(RequestBuilder::new(stub))
1208 }
1209
1210 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1212 mut self,
1213 v: V,
1214 ) -> Self {
1215 self.0.request = v.into();
1216 self
1217 }
1218
1219 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1221 self.0.options = v.into();
1222 self
1223 }
1224
1225 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1227 (*self.0.stub)
1228 .list_locations(self.0.request, self.0.options)
1229 .await
1230 .map(crate::Response::into_body)
1231 }
1232
1233 pub fn by_page(
1235 self,
1236 ) -> impl google_cloud_gax::paginator::Paginator<
1237 google_cloud_location::model::ListLocationsResponse,
1238 crate::Error,
1239 > {
1240 use std::clone::Clone;
1241 let token = self.0.request.page_token.clone();
1242 let execute = move |token: String| {
1243 let mut builder = self.clone();
1244 builder.0.request = builder.0.request.set_page_token(token);
1245 builder.send()
1246 };
1247 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1248 }
1249
1250 pub fn by_item(
1252 self,
1253 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1254 google_cloud_location::model::ListLocationsResponse,
1255 crate::Error,
1256 > {
1257 use google_cloud_gax::paginator::Paginator;
1258 self.by_page().items()
1259 }
1260
1261 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1263 self.0.request.name = v.into();
1264 self
1265 }
1266
1267 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1269 self.0.request.filter = v.into();
1270 self
1271 }
1272
1273 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1275 self.0.request.page_size = v.into();
1276 self
1277 }
1278
1279 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1281 self.0.request.page_token = v.into();
1282 self
1283 }
1284 }
1285
1286 #[doc(hidden)]
1287 impl crate::RequestBuilder for ListLocations {
1288 fn request_options(&mut self) -> &mut crate::RequestOptions {
1289 &mut self.0.options
1290 }
1291 }
1292
1293 #[derive(Clone, Debug)]
1310 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1311
1312 impl GetLocation {
1313 pub(crate) fn new(
1314 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1315 ) -> Self {
1316 Self(RequestBuilder::new(stub))
1317 }
1318
1319 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1321 mut self,
1322 v: V,
1323 ) -> Self {
1324 self.0.request = v.into();
1325 self
1326 }
1327
1328 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1330 self.0.options = v.into();
1331 self
1332 }
1333
1334 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1336 (*self.0.stub)
1337 .get_location(self.0.request, self.0.options)
1338 .await
1339 .map(crate::Response::into_body)
1340 }
1341
1342 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1344 self.0.request.name = v.into();
1345 self
1346 }
1347 }
1348
1349 #[doc(hidden)]
1350 impl crate::RequestBuilder for GetLocation {
1351 fn request_options(&mut self) -> &mut crate::RequestOptions {
1352 &mut self.0.options
1353 }
1354 }
1355
1356 #[derive(Clone, Debug)]
1377 pub struct ListOperations(
1378 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1379 );
1380
1381 impl ListOperations {
1382 pub(crate) fn new(
1383 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1384 ) -> Self {
1385 Self(RequestBuilder::new(stub))
1386 }
1387
1388 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1390 mut self,
1391 v: V,
1392 ) -> Self {
1393 self.0.request = v.into();
1394 self
1395 }
1396
1397 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1399 self.0.options = v.into();
1400 self
1401 }
1402
1403 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1405 (*self.0.stub)
1406 .list_operations(self.0.request, self.0.options)
1407 .await
1408 .map(crate::Response::into_body)
1409 }
1410
1411 pub fn by_page(
1413 self,
1414 ) -> impl google_cloud_gax::paginator::Paginator<
1415 google_cloud_longrunning::model::ListOperationsResponse,
1416 crate::Error,
1417 > {
1418 use std::clone::Clone;
1419 let token = self.0.request.page_token.clone();
1420 let execute = move |token: String| {
1421 let mut builder = self.clone();
1422 builder.0.request = builder.0.request.set_page_token(token);
1423 builder.send()
1424 };
1425 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1426 }
1427
1428 pub fn by_item(
1430 self,
1431 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1432 google_cloud_longrunning::model::ListOperationsResponse,
1433 crate::Error,
1434 > {
1435 use google_cloud_gax::paginator::Paginator;
1436 self.by_page().items()
1437 }
1438
1439 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1441 self.0.request.name = v.into();
1442 self
1443 }
1444
1445 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1447 self.0.request.filter = v.into();
1448 self
1449 }
1450
1451 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1453 self.0.request.page_size = v.into();
1454 self
1455 }
1456
1457 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1459 self.0.request.page_token = v.into();
1460 self
1461 }
1462
1463 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1465 self.0.request.return_partial_success = v.into();
1466 self
1467 }
1468 }
1469
1470 #[doc(hidden)]
1471 impl crate::RequestBuilder for ListOperations {
1472 fn request_options(&mut self) -> &mut crate::RequestOptions {
1473 &mut self.0.options
1474 }
1475 }
1476
1477 #[derive(Clone, Debug)]
1494 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1495
1496 impl GetOperation {
1497 pub(crate) fn new(
1498 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1499 ) -> Self {
1500 Self(RequestBuilder::new(stub))
1501 }
1502
1503 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1505 mut self,
1506 v: V,
1507 ) -> Self {
1508 self.0.request = v.into();
1509 self
1510 }
1511
1512 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1514 self.0.options = v.into();
1515 self
1516 }
1517
1518 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1520 (*self.0.stub)
1521 .get_operation(self.0.request, self.0.options)
1522 .await
1523 .map(crate::Response::into_body)
1524 }
1525
1526 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1528 self.0.request.name = v.into();
1529 self
1530 }
1531 }
1532
1533 #[doc(hidden)]
1534 impl crate::RequestBuilder for GetOperation {
1535 fn request_options(&mut self) -> &mut crate::RequestOptions {
1536 &mut self.0.options
1537 }
1538 }
1539
1540 #[derive(Clone, Debug)]
1557 pub struct DeleteOperation(
1558 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1559 );
1560
1561 impl DeleteOperation {
1562 pub(crate) fn new(
1563 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1564 ) -> Self {
1565 Self(RequestBuilder::new(stub))
1566 }
1567
1568 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1570 mut self,
1571 v: V,
1572 ) -> Self {
1573 self.0.request = v.into();
1574 self
1575 }
1576
1577 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1579 self.0.options = v.into();
1580 self
1581 }
1582
1583 pub async fn send(self) -> Result<()> {
1585 (*self.0.stub)
1586 .delete_operation(self.0.request, self.0.options)
1587 .await
1588 .map(crate::Response::into_body)
1589 }
1590
1591 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1593 self.0.request.name = v.into();
1594 self
1595 }
1596 }
1597
1598 #[doc(hidden)]
1599 impl crate::RequestBuilder for DeleteOperation {
1600 fn request_options(&mut self) -> &mut crate::RequestOptions {
1601 &mut self.0.options
1602 }
1603 }
1604
1605 #[derive(Clone, Debug)]
1622 pub struct CancelOperation(
1623 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1624 );
1625
1626 impl CancelOperation {
1627 pub(crate) fn new(
1628 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1629 ) -> Self {
1630 Self(RequestBuilder::new(stub))
1631 }
1632
1633 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1635 mut self,
1636 v: V,
1637 ) -> Self {
1638 self.0.request = v.into();
1639 self
1640 }
1641
1642 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1644 self.0.options = v.into();
1645 self
1646 }
1647
1648 pub async fn send(self) -> Result<()> {
1650 (*self.0.stub)
1651 .cancel_operation(self.0.request, self.0.options)
1652 .await
1653 .map(crate::Response::into_body)
1654 }
1655
1656 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1658 self.0.request.name = v.into();
1659 self
1660 }
1661 }
1662
1663 #[doc(hidden)]
1664 impl crate::RequestBuilder for CancelOperation {
1665 fn request_options(&mut self) -> &mut crate::RequestOptions {
1666 &mut self.0.options
1667 }
1668 }
1669}
1670
1671pub mod config {
1673 use crate::Result;
1674
1675 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1689
1690 pub(crate) mod client {
1691 use super::super::super::client::Config;
1692 pub struct Factory;
1693 impl crate::ClientFactory for Factory {
1694 type Client = Config;
1695 type Credentials = gaxi::options::Credentials;
1696 async fn build(
1697 self,
1698 config: gaxi::options::ClientConfig,
1699 ) -> crate::ClientBuilderResult<Self::Client> {
1700 Self::Client::new(config).await
1701 }
1702 }
1703 }
1704
1705 #[derive(Clone, Debug)]
1707 pub(crate) struct RequestBuilder<R: std::default::Default> {
1708 stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>,
1709 request: R,
1710 options: crate::RequestOptions,
1711 }
1712
1713 impl<R> RequestBuilder<R>
1714 where
1715 R: std::default::Default,
1716 {
1717 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1718 Self {
1719 stub,
1720 request: R::default(),
1721 options: crate::RequestOptions::default(),
1722 }
1723 }
1724 }
1725
1726 #[derive(Clone, Debug)]
1747 pub struct ListFrameworks(RequestBuilder<crate::model::ListFrameworksRequest>);
1748
1749 impl ListFrameworks {
1750 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1751 Self(RequestBuilder::new(stub))
1752 }
1753
1754 pub fn with_request<V: Into<crate::model::ListFrameworksRequest>>(mut self, v: V) -> Self {
1756 self.0.request = v.into();
1757 self
1758 }
1759
1760 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1762 self.0.options = v.into();
1763 self
1764 }
1765
1766 pub async fn send(self) -> Result<crate::model::ListFrameworksResponse> {
1768 (*self.0.stub)
1769 .list_frameworks(self.0.request, self.0.options)
1770 .await
1771 .map(crate::Response::into_body)
1772 }
1773
1774 pub fn by_page(
1776 self,
1777 ) -> impl google_cloud_gax::paginator::Paginator<
1778 crate::model::ListFrameworksResponse,
1779 crate::Error,
1780 > {
1781 use std::clone::Clone;
1782 let token = self.0.request.page_token.clone();
1783 let execute = move |token: String| {
1784 let mut builder = self.clone();
1785 builder.0.request = builder.0.request.set_page_token(token);
1786 builder.send()
1787 };
1788 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1789 }
1790
1791 pub fn by_item(
1793 self,
1794 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1795 crate::model::ListFrameworksResponse,
1796 crate::Error,
1797 > {
1798 use google_cloud_gax::paginator::Paginator;
1799 self.by_page().items()
1800 }
1801
1802 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1806 self.0.request.parent = 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 ListFrameworks {
1825 fn request_options(&mut self) -> &mut crate::RequestOptions {
1826 &mut self.0.options
1827 }
1828 }
1829
1830 #[derive(Clone, Debug)]
1847 pub struct GetFramework(RequestBuilder<crate::model::GetFrameworkRequest>);
1848
1849 impl GetFramework {
1850 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1851 Self(RequestBuilder::new(stub))
1852 }
1853
1854 pub fn with_request<V: Into<crate::model::GetFrameworkRequest>>(mut self, v: V) -> Self {
1856 self.0.request = v.into();
1857 self
1858 }
1859
1860 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1862 self.0.options = v.into();
1863 self
1864 }
1865
1866 pub async fn send(self) -> Result<crate::model::Framework> {
1868 (*self.0.stub)
1869 .get_framework(self.0.request, self.0.options)
1870 .await
1871 .map(crate::Response::into_body)
1872 }
1873
1874 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1878 self.0.request.name = v.into();
1879 self
1880 }
1881
1882 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
1884 self.0.request.major_revision_id = v.into();
1885 self
1886 }
1887 }
1888
1889 #[doc(hidden)]
1890 impl crate::RequestBuilder for GetFramework {
1891 fn request_options(&mut self) -> &mut crate::RequestOptions {
1892 &mut self.0.options
1893 }
1894 }
1895
1896 #[derive(Clone, Debug)]
1913 pub struct CreateFramework(RequestBuilder<crate::model::CreateFrameworkRequest>);
1914
1915 impl CreateFramework {
1916 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1917 Self(RequestBuilder::new(stub))
1918 }
1919
1920 pub fn with_request<V: Into<crate::model::CreateFrameworkRequest>>(mut self, v: V) -> Self {
1922 self.0.request = v.into();
1923 self
1924 }
1925
1926 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1928 self.0.options = v.into();
1929 self
1930 }
1931
1932 pub async fn send(self) -> Result<crate::model::Framework> {
1934 (*self.0.stub)
1935 .create_framework(self.0.request, self.0.options)
1936 .await
1937 .map(crate::Response::into_body)
1938 }
1939
1940 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1944 self.0.request.parent = v.into();
1945 self
1946 }
1947
1948 pub fn set_framework_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1952 self.0.request.framework_id = v.into();
1953 self
1954 }
1955
1956 pub fn set_framework<T>(mut self, v: T) -> Self
1960 where
1961 T: std::convert::Into<crate::model::Framework>,
1962 {
1963 self.0.request.framework = std::option::Option::Some(v.into());
1964 self
1965 }
1966
1967 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
1971 where
1972 T: std::convert::Into<crate::model::Framework>,
1973 {
1974 self.0.request.framework = v.map(|x| x.into());
1975 self
1976 }
1977 }
1978
1979 #[doc(hidden)]
1980 impl crate::RequestBuilder for CreateFramework {
1981 fn request_options(&mut self) -> &mut crate::RequestOptions {
1982 &mut self.0.options
1983 }
1984 }
1985
1986 #[derive(Clone, Debug)]
2003 pub struct UpdateFramework(RequestBuilder<crate::model::UpdateFrameworkRequest>);
2004
2005 impl UpdateFramework {
2006 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2007 Self(RequestBuilder::new(stub))
2008 }
2009
2010 pub fn with_request<V: Into<crate::model::UpdateFrameworkRequest>>(mut self, v: V) -> Self {
2012 self.0.request = v.into();
2013 self
2014 }
2015
2016 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2018 self.0.options = v.into();
2019 self
2020 }
2021
2022 pub async fn send(self) -> Result<crate::model::Framework> {
2024 (*self.0.stub)
2025 .update_framework(self.0.request, self.0.options)
2026 .await
2027 .map(crate::Response::into_body)
2028 }
2029
2030 pub fn set_update_mask<T>(mut self, v: T) -> Self
2032 where
2033 T: std::convert::Into<wkt::FieldMask>,
2034 {
2035 self.0.request.update_mask = std::option::Option::Some(v.into());
2036 self
2037 }
2038
2039 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2041 where
2042 T: std::convert::Into<wkt::FieldMask>,
2043 {
2044 self.0.request.update_mask = v.map(|x| x.into());
2045 self
2046 }
2047
2048 pub fn set_framework<T>(mut self, v: T) -> Self
2052 where
2053 T: std::convert::Into<crate::model::Framework>,
2054 {
2055 self.0.request.framework = std::option::Option::Some(v.into());
2056 self
2057 }
2058
2059 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
2063 where
2064 T: std::convert::Into<crate::model::Framework>,
2065 {
2066 self.0.request.framework = v.map(|x| x.into());
2067 self
2068 }
2069
2070 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
2072 self.0.request.major_revision_id = v.into();
2073 self
2074 }
2075 }
2076
2077 #[doc(hidden)]
2078 impl crate::RequestBuilder for UpdateFramework {
2079 fn request_options(&mut self) -> &mut crate::RequestOptions {
2080 &mut self.0.options
2081 }
2082 }
2083
2084 #[derive(Clone, Debug)]
2101 pub struct DeleteFramework(RequestBuilder<crate::model::DeleteFrameworkRequest>);
2102
2103 impl DeleteFramework {
2104 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2105 Self(RequestBuilder::new(stub))
2106 }
2107
2108 pub fn with_request<V: Into<crate::model::DeleteFrameworkRequest>>(mut self, v: V) -> 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_framework(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 {
2132 self.0.request.name = v.into();
2133 self
2134 }
2135 }
2136
2137 #[doc(hidden)]
2138 impl crate::RequestBuilder for DeleteFramework {
2139 fn request_options(&mut self) -> &mut crate::RequestOptions {
2140 &mut self.0.options
2141 }
2142 }
2143
2144 #[derive(Clone, Debug)]
2165 pub struct ListCloudControls(RequestBuilder<crate::model::ListCloudControlsRequest>);
2166
2167 impl ListCloudControls {
2168 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2169 Self(RequestBuilder::new(stub))
2170 }
2171
2172 pub fn with_request<V: Into<crate::model::ListCloudControlsRequest>>(
2174 mut self,
2175 v: V,
2176 ) -> Self {
2177 self.0.request = v.into();
2178 self
2179 }
2180
2181 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2183 self.0.options = v.into();
2184 self
2185 }
2186
2187 pub async fn send(self) -> Result<crate::model::ListCloudControlsResponse> {
2189 (*self.0.stub)
2190 .list_cloud_controls(self.0.request, self.0.options)
2191 .await
2192 .map(crate::Response::into_body)
2193 }
2194
2195 pub fn by_page(
2197 self,
2198 ) -> impl google_cloud_gax::paginator::Paginator<
2199 crate::model::ListCloudControlsResponse,
2200 crate::Error,
2201 > {
2202 use std::clone::Clone;
2203 let token = self.0.request.page_token.clone();
2204 let execute = move |token: String| {
2205 let mut builder = self.clone();
2206 builder.0.request = builder.0.request.set_page_token(token);
2207 builder.send()
2208 };
2209 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2210 }
2211
2212 pub fn by_item(
2214 self,
2215 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2216 crate::model::ListCloudControlsResponse,
2217 crate::Error,
2218 > {
2219 use google_cloud_gax::paginator::Paginator;
2220 self.by_page().items()
2221 }
2222
2223 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2227 self.0.request.parent = v.into();
2228 self
2229 }
2230
2231 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2233 self.0.request.page_size = v.into();
2234 self
2235 }
2236
2237 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2239 self.0.request.page_token = v.into();
2240 self
2241 }
2242 }
2243
2244 #[doc(hidden)]
2245 impl crate::RequestBuilder for ListCloudControls {
2246 fn request_options(&mut self) -> &mut crate::RequestOptions {
2247 &mut self.0.options
2248 }
2249 }
2250
2251 #[derive(Clone, Debug)]
2268 pub struct GetCloudControl(RequestBuilder<crate::model::GetCloudControlRequest>);
2269
2270 impl GetCloudControl {
2271 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2272 Self(RequestBuilder::new(stub))
2273 }
2274
2275 pub fn with_request<V: Into<crate::model::GetCloudControlRequest>>(mut self, v: V) -> Self {
2277 self.0.request = v.into();
2278 self
2279 }
2280
2281 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2283 self.0.options = v.into();
2284 self
2285 }
2286
2287 pub async fn send(self) -> Result<crate::model::CloudControl> {
2289 (*self.0.stub)
2290 .get_cloud_control(self.0.request, self.0.options)
2291 .await
2292 .map(crate::Response::into_body)
2293 }
2294
2295 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2299 self.0.request.name = v.into();
2300 self
2301 }
2302
2303 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
2305 self.0.request.major_revision_id = v.into();
2306 self
2307 }
2308 }
2309
2310 #[doc(hidden)]
2311 impl crate::RequestBuilder for GetCloudControl {
2312 fn request_options(&mut self) -> &mut crate::RequestOptions {
2313 &mut self.0.options
2314 }
2315 }
2316
2317 #[derive(Clone, Debug)]
2334 pub struct CreateCloudControl(RequestBuilder<crate::model::CreateCloudControlRequest>);
2335
2336 impl CreateCloudControl {
2337 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2338 Self(RequestBuilder::new(stub))
2339 }
2340
2341 pub fn with_request<V: Into<crate::model::CreateCloudControlRequest>>(
2343 mut self,
2344 v: V,
2345 ) -> Self {
2346 self.0.request = v.into();
2347 self
2348 }
2349
2350 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2352 self.0.options = v.into();
2353 self
2354 }
2355
2356 pub async fn send(self) -> Result<crate::model::CloudControl> {
2358 (*self.0.stub)
2359 .create_cloud_control(self.0.request, self.0.options)
2360 .await
2361 .map(crate::Response::into_body)
2362 }
2363
2364 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2368 self.0.request.parent = v.into();
2369 self
2370 }
2371
2372 pub fn set_cloud_control_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2376 self.0.request.cloud_control_id = v.into();
2377 self
2378 }
2379
2380 pub fn set_cloud_control<T>(mut self, v: T) -> Self
2384 where
2385 T: std::convert::Into<crate::model::CloudControl>,
2386 {
2387 self.0.request.cloud_control = std::option::Option::Some(v.into());
2388 self
2389 }
2390
2391 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
2395 where
2396 T: std::convert::Into<crate::model::CloudControl>,
2397 {
2398 self.0.request.cloud_control = v.map(|x| x.into());
2399 self
2400 }
2401 }
2402
2403 #[doc(hidden)]
2404 impl crate::RequestBuilder for CreateCloudControl {
2405 fn request_options(&mut self) -> &mut crate::RequestOptions {
2406 &mut self.0.options
2407 }
2408 }
2409
2410 #[derive(Clone, Debug)]
2427 pub struct UpdateCloudControl(RequestBuilder<crate::model::UpdateCloudControlRequest>);
2428
2429 impl UpdateCloudControl {
2430 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2431 Self(RequestBuilder::new(stub))
2432 }
2433
2434 pub fn with_request<V: Into<crate::model::UpdateCloudControlRequest>>(
2436 mut self,
2437 v: V,
2438 ) -> Self {
2439 self.0.request = v.into();
2440 self
2441 }
2442
2443 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2445 self.0.options = v.into();
2446 self
2447 }
2448
2449 pub async fn send(self) -> Result<crate::model::CloudControl> {
2451 (*self.0.stub)
2452 .update_cloud_control(self.0.request, self.0.options)
2453 .await
2454 .map(crate::Response::into_body)
2455 }
2456
2457 pub fn set_update_mask<T>(mut self, v: T) -> Self
2459 where
2460 T: std::convert::Into<wkt::FieldMask>,
2461 {
2462 self.0.request.update_mask = std::option::Option::Some(v.into());
2463 self
2464 }
2465
2466 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2468 where
2469 T: std::convert::Into<wkt::FieldMask>,
2470 {
2471 self.0.request.update_mask = v.map(|x| x.into());
2472 self
2473 }
2474
2475 pub fn set_cloud_control<T>(mut self, v: T) -> Self
2479 where
2480 T: std::convert::Into<crate::model::CloudControl>,
2481 {
2482 self.0.request.cloud_control = std::option::Option::Some(v.into());
2483 self
2484 }
2485
2486 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
2490 where
2491 T: std::convert::Into<crate::model::CloudControl>,
2492 {
2493 self.0.request.cloud_control = v.map(|x| x.into());
2494 self
2495 }
2496 }
2497
2498 #[doc(hidden)]
2499 impl crate::RequestBuilder for UpdateCloudControl {
2500 fn request_options(&mut self) -> &mut crate::RequestOptions {
2501 &mut self.0.options
2502 }
2503 }
2504
2505 #[derive(Clone, Debug)]
2522 pub struct DeleteCloudControl(RequestBuilder<crate::model::DeleteCloudControlRequest>);
2523
2524 impl DeleteCloudControl {
2525 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2526 Self(RequestBuilder::new(stub))
2527 }
2528
2529 pub fn with_request<V: Into<crate::model::DeleteCloudControlRequest>>(
2531 mut self,
2532 v: V,
2533 ) -> Self {
2534 self.0.request = v.into();
2535 self
2536 }
2537
2538 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2540 self.0.options = v.into();
2541 self
2542 }
2543
2544 pub async fn send(self) -> Result<()> {
2546 (*self.0.stub)
2547 .delete_cloud_control(self.0.request, self.0.options)
2548 .await
2549 .map(crate::Response::into_body)
2550 }
2551
2552 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2556 self.0.request.name = v.into();
2557 self
2558 }
2559 }
2560
2561 #[doc(hidden)]
2562 impl crate::RequestBuilder for DeleteCloudControl {
2563 fn request_options(&mut self) -> &mut crate::RequestOptions {
2564 &mut self.0.options
2565 }
2566 }
2567
2568 #[derive(Clone, Debug)]
2589 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2590
2591 impl ListLocations {
2592 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2593 Self(RequestBuilder::new(stub))
2594 }
2595
2596 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2598 mut self,
2599 v: V,
2600 ) -> Self {
2601 self.0.request = v.into();
2602 self
2603 }
2604
2605 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2607 self.0.options = v.into();
2608 self
2609 }
2610
2611 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2613 (*self.0.stub)
2614 .list_locations(self.0.request, self.0.options)
2615 .await
2616 .map(crate::Response::into_body)
2617 }
2618
2619 pub fn by_page(
2621 self,
2622 ) -> impl google_cloud_gax::paginator::Paginator<
2623 google_cloud_location::model::ListLocationsResponse,
2624 crate::Error,
2625 > {
2626 use std::clone::Clone;
2627 let token = self.0.request.page_token.clone();
2628 let execute = move |token: String| {
2629 let mut builder = self.clone();
2630 builder.0.request = builder.0.request.set_page_token(token);
2631 builder.send()
2632 };
2633 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2634 }
2635
2636 pub fn by_item(
2638 self,
2639 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2640 google_cloud_location::model::ListLocationsResponse,
2641 crate::Error,
2642 > {
2643 use google_cloud_gax::paginator::Paginator;
2644 self.by_page().items()
2645 }
2646
2647 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2649 self.0.request.name = v.into();
2650 self
2651 }
2652
2653 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2655 self.0.request.filter = v.into();
2656 self
2657 }
2658
2659 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2661 self.0.request.page_size = v.into();
2662 self
2663 }
2664
2665 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2667 self.0.request.page_token = v.into();
2668 self
2669 }
2670 }
2671
2672 #[doc(hidden)]
2673 impl crate::RequestBuilder for ListLocations {
2674 fn request_options(&mut self) -> &mut crate::RequestOptions {
2675 &mut self.0.options
2676 }
2677 }
2678
2679 #[derive(Clone, Debug)]
2696 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2697
2698 impl GetLocation {
2699 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2700 Self(RequestBuilder::new(stub))
2701 }
2702
2703 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2705 mut self,
2706 v: V,
2707 ) -> Self {
2708 self.0.request = v.into();
2709 self
2710 }
2711
2712 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2714 self.0.options = v.into();
2715 self
2716 }
2717
2718 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2720 (*self.0.stub)
2721 .get_location(self.0.request, self.0.options)
2722 .await
2723 .map(crate::Response::into_body)
2724 }
2725
2726 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2728 self.0.request.name = v.into();
2729 self
2730 }
2731 }
2732
2733 #[doc(hidden)]
2734 impl crate::RequestBuilder for GetLocation {
2735 fn request_options(&mut self) -> &mut crate::RequestOptions {
2736 &mut self.0.options
2737 }
2738 }
2739
2740 #[derive(Clone, Debug)]
2761 pub struct ListOperations(
2762 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2763 );
2764
2765 impl ListOperations {
2766 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2767 Self(RequestBuilder::new(stub))
2768 }
2769
2770 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2772 mut self,
2773 v: V,
2774 ) -> Self {
2775 self.0.request = v.into();
2776 self
2777 }
2778
2779 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2781 self.0.options = v.into();
2782 self
2783 }
2784
2785 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2787 (*self.0.stub)
2788 .list_operations(self.0.request, self.0.options)
2789 .await
2790 .map(crate::Response::into_body)
2791 }
2792
2793 pub fn by_page(
2795 self,
2796 ) -> impl google_cloud_gax::paginator::Paginator<
2797 google_cloud_longrunning::model::ListOperationsResponse,
2798 crate::Error,
2799 > {
2800 use std::clone::Clone;
2801 let token = self.0.request.page_token.clone();
2802 let execute = move |token: String| {
2803 let mut builder = self.clone();
2804 builder.0.request = builder.0.request.set_page_token(token);
2805 builder.send()
2806 };
2807 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2808 }
2809
2810 pub fn by_item(
2812 self,
2813 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2814 google_cloud_longrunning::model::ListOperationsResponse,
2815 crate::Error,
2816 > {
2817 use google_cloud_gax::paginator::Paginator;
2818 self.by_page().items()
2819 }
2820
2821 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2823 self.0.request.name = v.into();
2824 self
2825 }
2826
2827 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2829 self.0.request.filter = v.into();
2830 self
2831 }
2832
2833 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2835 self.0.request.page_size = v.into();
2836 self
2837 }
2838
2839 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2841 self.0.request.page_token = v.into();
2842 self
2843 }
2844
2845 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2847 self.0.request.return_partial_success = v.into();
2848 self
2849 }
2850 }
2851
2852 #[doc(hidden)]
2853 impl crate::RequestBuilder for ListOperations {
2854 fn request_options(&mut self) -> &mut crate::RequestOptions {
2855 &mut self.0.options
2856 }
2857 }
2858
2859 #[derive(Clone, Debug)]
2876 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2877
2878 impl GetOperation {
2879 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2880 Self(RequestBuilder::new(stub))
2881 }
2882
2883 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2885 mut self,
2886 v: V,
2887 ) -> Self {
2888 self.0.request = v.into();
2889 self
2890 }
2891
2892 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2894 self.0.options = v.into();
2895 self
2896 }
2897
2898 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2900 (*self.0.stub)
2901 .get_operation(self.0.request, self.0.options)
2902 .await
2903 .map(crate::Response::into_body)
2904 }
2905
2906 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2908 self.0.request.name = v.into();
2909 self
2910 }
2911 }
2912
2913 #[doc(hidden)]
2914 impl crate::RequestBuilder for GetOperation {
2915 fn request_options(&mut self) -> &mut crate::RequestOptions {
2916 &mut self.0.options
2917 }
2918 }
2919
2920 #[derive(Clone, Debug)]
2937 pub struct DeleteOperation(
2938 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2939 );
2940
2941 impl DeleteOperation {
2942 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2943 Self(RequestBuilder::new(stub))
2944 }
2945
2946 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2948 mut self,
2949 v: V,
2950 ) -> Self {
2951 self.0.request = v.into();
2952 self
2953 }
2954
2955 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2957 self.0.options = v.into();
2958 self
2959 }
2960
2961 pub async fn send(self) -> Result<()> {
2963 (*self.0.stub)
2964 .delete_operation(self.0.request, self.0.options)
2965 .await
2966 .map(crate::Response::into_body)
2967 }
2968
2969 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2971 self.0.request.name = v.into();
2972 self
2973 }
2974 }
2975
2976 #[doc(hidden)]
2977 impl crate::RequestBuilder for DeleteOperation {
2978 fn request_options(&mut self) -> &mut crate::RequestOptions {
2979 &mut self.0.options
2980 }
2981 }
2982
2983 #[derive(Clone, Debug)]
3000 pub struct CancelOperation(
3001 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3002 );
3003
3004 impl CancelOperation {
3005 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3006 Self(RequestBuilder::new(stub))
3007 }
3008
3009 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3011 mut self,
3012 v: V,
3013 ) -> Self {
3014 self.0.request = v.into();
3015 self
3016 }
3017
3018 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3020 self.0.options = v.into();
3021 self
3022 }
3023
3024 pub async fn send(self) -> Result<()> {
3026 (*self.0.stub)
3027 .cancel_operation(self.0.request, self.0.options)
3028 .await
3029 .map(crate::Response::into_body)
3030 }
3031
3032 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3034 self.0.request.name = v.into();
3035 self
3036 }
3037 }
3038
3039 #[doc(hidden)]
3040 impl crate::RequestBuilder for CancelOperation {
3041 fn request_options(&mut self) -> &mut crate::RequestOptions {
3042 &mut self.0.options
3043 }
3044 }
3045}
3046
3047pub mod deployment {
3049 use crate::Result;
3050
3051 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3065
3066 pub(crate) mod client {
3067 use super::super::super::client::Deployment;
3068 pub struct Factory;
3069 impl crate::ClientFactory for Factory {
3070 type Client = Deployment;
3071 type Credentials = gaxi::options::Credentials;
3072 async fn build(
3073 self,
3074 config: gaxi::options::ClientConfig,
3075 ) -> crate::ClientBuilderResult<Self::Client> {
3076 Self::Client::new(config).await
3077 }
3078 }
3079 }
3080
3081 #[derive(Clone, Debug)]
3083 pub(crate) struct RequestBuilder<R: std::default::Default> {
3084 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3085 request: R,
3086 options: crate::RequestOptions,
3087 }
3088
3089 impl<R> RequestBuilder<R>
3090 where
3091 R: std::default::Default,
3092 {
3093 pub(crate) fn new(
3094 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3095 ) -> Self {
3096 Self {
3097 stub,
3098 request: R::default(),
3099 options: crate::RequestOptions::default(),
3100 }
3101 }
3102 }
3103
3104 #[derive(Clone, Debug)]
3122 pub struct CreateFrameworkDeployment(
3123 RequestBuilder<crate::model::CreateFrameworkDeploymentRequest>,
3124 );
3125
3126 impl CreateFrameworkDeployment {
3127 pub(crate) fn new(
3128 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3129 ) -> Self {
3130 Self(RequestBuilder::new(stub))
3131 }
3132
3133 pub fn with_request<V: Into<crate::model::CreateFrameworkDeploymentRequest>>(
3135 mut self,
3136 v: V,
3137 ) -> Self {
3138 self.0.request = v.into();
3139 self
3140 }
3141
3142 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3144 self.0.options = v.into();
3145 self
3146 }
3147
3148 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3155 (*self.0.stub)
3156 .create_framework_deployment(self.0.request, self.0.options)
3157 .await
3158 .map(crate::Response::into_body)
3159 }
3160
3161 pub fn poller(
3163 self,
3164 ) -> impl google_cloud_lro::Poller<
3165 crate::model::FrameworkDeployment,
3166 crate::model::OperationMetadata,
3167 > {
3168 type Operation = google_cloud_lro::internal::Operation<
3169 crate::model::FrameworkDeployment,
3170 crate::model::OperationMetadata,
3171 >;
3172 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3173 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3174 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3175 if let Some(ref mut details) = poller_options.tracing {
3176 details.method_name = "google_cloud_cloudsecuritycompliance_v1::client::Deployment::create_framework_deployment::until_done";
3177 }
3178
3179 let stub = self.0.stub.clone();
3180 let mut options = self.0.options.clone();
3181 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3182 let query = move |name| {
3183 let stub = stub.clone();
3184 let options = options.clone();
3185 async {
3186 let op = GetOperation::new(stub)
3187 .set_name(name)
3188 .with_options(options)
3189 .send()
3190 .await?;
3191 Ok(Operation::new(op))
3192 }
3193 };
3194
3195 let start = move || async {
3196 let op = self.send().await?;
3197 Ok(Operation::new(op))
3198 };
3199
3200 use google_cloud_lro::internal::PollerExt;
3201 {
3202 google_cloud_lro::internal::new_poller(
3203 polling_error_policy,
3204 polling_backoff_policy,
3205 start,
3206 query,
3207 )
3208 }
3209 .with_options(poller_options)
3210 }
3211
3212 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3216 self.0.request.parent = v.into();
3217 self
3218 }
3219
3220 pub fn set_framework_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3222 self.0.request.framework_deployment_id = v.into();
3223 self
3224 }
3225
3226 pub fn set_framework_deployment<T>(mut self, v: T) -> Self
3230 where
3231 T: std::convert::Into<crate::model::FrameworkDeployment>,
3232 {
3233 self.0.request.framework_deployment = std::option::Option::Some(v.into());
3234 self
3235 }
3236
3237 pub fn set_or_clear_framework_deployment<T>(mut self, v: std::option::Option<T>) -> Self
3241 where
3242 T: std::convert::Into<crate::model::FrameworkDeployment>,
3243 {
3244 self.0.request.framework_deployment = v.map(|x| x.into());
3245 self
3246 }
3247 }
3248
3249 #[doc(hidden)]
3250 impl crate::RequestBuilder for CreateFrameworkDeployment {
3251 fn request_options(&mut self) -> &mut crate::RequestOptions {
3252 &mut self.0.options
3253 }
3254 }
3255
3256 #[derive(Clone, Debug)]
3274 pub struct DeleteFrameworkDeployment(
3275 RequestBuilder<crate::model::DeleteFrameworkDeploymentRequest>,
3276 );
3277
3278 impl DeleteFrameworkDeployment {
3279 pub(crate) fn new(
3280 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3281 ) -> Self {
3282 Self(RequestBuilder::new(stub))
3283 }
3284
3285 pub fn with_request<V: Into<crate::model::DeleteFrameworkDeploymentRequest>>(
3287 mut self,
3288 v: V,
3289 ) -> Self {
3290 self.0.request = v.into();
3291 self
3292 }
3293
3294 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3296 self.0.options = v.into();
3297 self
3298 }
3299
3300 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3307 (*self.0.stub)
3308 .delete_framework_deployment(self.0.request, self.0.options)
3309 .await
3310 .map(crate::Response::into_body)
3311 }
3312
3313 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3315 type Operation =
3316 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3317 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3318 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3319 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3320 if let Some(ref mut details) = poller_options.tracing {
3321 details.method_name = "google_cloud_cloudsecuritycompliance_v1::client::Deployment::delete_framework_deployment::until_done";
3322 }
3323
3324 let stub = self.0.stub.clone();
3325 let mut options = self.0.options.clone();
3326 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3327 let query = move |name| {
3328 let stub = stub.clone();
3329 let options = options.clone();
3330 async {
3331 let op = GetOperation::new(stub)
3332 .set_name(name)
3333 .with_options(options)
3334 .send()
3335 .await?;
3336 Ok(Operation::new(op))
3337 }
3338 };
3339
3340 let start = move || async {
3341 let op = self.send().await?;
3342 Ok(Operation::new(op))
3343 };
3344
3345 use google_cloud_lro::internal::PollerExt;
3346 {
3347 google_cloud_lro::internal::new_unit_response_poller(
3348 polling_error_policy,
3349 polling_backoff_policy,
3350 start,
3351 query,
3352 )
3353 }
3354 .with_options(poller_options)
3355 }
3356
3357 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3361 self.0.request.name = v.into();
3362 self
3363 }
3364
3365 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3367 self.0.request.etag = v.into();
3368 self
3369 }
3370 }
3371
3372 #[doc(hidden)]
3373 impl crate::RequestBuilder for DeleteFrameworkDeployment {
3374 fn request_options(&mut self) -> &mut crate::RequestOptions {
3375 &mut self.0.options
3376 }
3377 }
3378
3379 #[derive(Clone, Debug)]
3396 pub struct GetFrameworkDeployment(RequestBuilder<crate::model::GetFrameworkDeploymentRequest>);
3397
3398 impl GetFrameworkDeployment {
3399 pub(crate) fn new(
3400 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3401 ) -> Self {
3402 Self(RequestBuilder::new(stub))
3403 }
3404
3405 pub fn with_request<V: Into<crate::model::GetFrameworkDeploymentRequest>>(
3407 mut self,
3408 v: V,
3409 ) -> Self {
3410 self.0.request = v.into();
3411 self
3412 }
3413
3414 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3416 self.0.options = v.into();
3417 self
3418 }
3419
3420 pub async fn send(self) -> Result<crate::model::FrameworkDeployment> {
3422 (*self.0.stub)
3423 .get_framework_deployment(self.0.request, self.0.options)
3424 .await
3425 .map(crate::Response::into_body)
3426 }
3427
3428 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3432 self.0.request.name = v.into();
3433 self
3434 }
3435 }
3436
3437 #[doc(hidden)]
3438 impl crate::RequestBuilder for GetFrameworkDeployment {
3439 fn request_options(&mut self) -> &mut crate::RequestOptions {
3440 &mut self.0.options
3441 }
3442 }
3443
3444 #[derive(Clone, Debug)]
3465 pub struct ListFrameworkDeployments(
3466 RequestBuilder<crate::model::ListFrameworkDeploymentsRequest>,
3467 );
3468
3469 impl ListFrameworkDeployments {
3470 pub(crate) fn new(
3471 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3472 ) -> Self {
3473 Self(RequestBuilder::new(stub))
3474 }
3475
3476 pub fn with_request<V: Into<crate::model::ListFrameworkDeploymentsRequest>>(
3478 mut self,
3479 v: V,
3480 ) -> Self {
3481 self.0.request = v.into();
3482 self
3483 }
3484
3485 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3487 self.0.options = v.into();
3488 self
3489 }
3490
3491 pub async fn send(self) -> Result<crate::model::ListFrameworkDeploymentsResponse> {
3493 (*self.0.stub)
3494 .list_framework_deployments(self.0.request, self.0.options)
3495 .await
3496 .map(crate::Response::into_body)
3497 }
3498
3499 pub fn by_page(
3501 self,
3502 ) -> impl google_cloud_gax::paginator::Paginator<
3503 crate::model::ListFrameworkDeploymentsResponse,
3504 crate::Error,
3505 > {
3506 use std::clone::Clone;
3507 let token = self.0.request.page_token.clone();
3508 let execute = move |token: String| {
3509 let mut builder = self.clone();
3510 builder.0.request = builder.0.request.set_page_token(token);
3511 builder.send()
3512 };
3513 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3514 }
3515
3516 pub fn by_item(
3518 self,
3519 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3520 crate::model::ListFrameworkDeploymentsResponse,
3521 crate::Error,
3522 > {
3523 use google_cloud_gax::paginator::Paginator;
3524 self.by_page().items()
3525 }
3526
3527 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3531 self.0.request.parent = v.into();
3532 self
3533 }
3534
3535 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3537 self.0.request.page_size = v.into();
3538 self
3539 }
3540
3541 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3543 self.0.request.page_token = v.into();
3544 self
3545 }
3546
3547 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3549 self.0.request.filter = v.into();
3550 self
3551 }
3552
3553 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3555 self.0.request.order_by = v.into();
3556 self
3557 }
3558 }
3559
3560 #[doc(hidden)]
3561 impl crate::RequestBuilder for ListFrameworkDeployments {
3562 fn request_options(&mut self) -> &mut crate::RequestOptions {
3563 &mut self.0.options
3564 }
3565 }
3566
3567 #[derive(Clone, Debug)]
3584 pub struct GetCloudControlDeployment(
3585 RequestBuilder<crate::model::GetCloudControlDeploymentRequest>,
3586 );
3587
3588 impl GetCloudControlDeployment {
3589 pub(crate) fn new(
3590 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3591 ) -> Self {
3592 Self(RequestBuilder::new(stub))
3593 }
3594
3595 pub fn with_request<V: Into<crate::model::GetCloudControlDeploymentRequest>>(
3597 mut self,
3598 v: V,
3599 ) -> Self {
3600 self.0.request = v.into();
3601 self
3602 }
3603
3604 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3606 self.0.options = v.into();
3607 self
3608 }
3609
3610 pub async fn send(self) -> Result<crate::model::CloudControlDeployment> {
3612 (*self.0.stub)
3613 .get_cloud_control_deployment(self.0.request, self.0.options)
3614 .await
3615 .map(crate::Response::into_body)
3616 }
3617
3618 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3622 self.0.request.name = v.into();
3623 self
3624 }
3625 }
3626
3627 #[doc(hidden)]
3628 impl crate::RequestBuilder for GetCloudControlDeployment {
3629 fn request_options(&mut self) -> &mut crate::RequestOptions {
3630 &mut self.0.options
3631 }
3632 }
3633
3634 #[derive(Clone, Debug)]
3655 pub struct ListCloudControlDeployments(
3656 RequestBuilder<crate::model::ListCloudControlDeploymentsRequest>,
3657 );
3658
3659 impl ListCloudControlDeployments {
3660 pub(crate) fn new(
3661 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3662 ) -> Self {
3663 Self(RequestBuilder::new(stub))
3664 }
3665
3666 pub fn with_request<V: Into<crate::model::ListCloudControlDeploymentsRequest>>(
3668 mut self,
3669 v: V,
3670 ) -> Self {
3671 self.0.request = v.into();
3672 self
3673 }
3674
3675 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3677 self.0.options = v.into();
3678 self
3679 }
3680
3681 pub async fn send(self) -> Result<crate::model::ListCloudControlDeploymentsResponse> {
3683 (*self.0.stub)
3684 .list_cloud_control_deployments(self.0.request, self.0.options)
3685 .await
3686 .map(crate::Response::into_body)
3687 }
3688
3689 pub fn by_page(
3691 self,
3692 ) -> impl google_cloud_gax::paginator::Paginator<
3693 crate::model::ListCloudControlDeploymentsResponse,
3694 crate::Error,
3695 > {
3696 use std::clone::Clone;
3697 let token = self.0.request.page_token.clone();
3698 let execute = move |token: String| {
3699 let mut builder = self.clone();
3700 builder.0.request = builder.0.request.set_page_token(token);
3701 builder.send()
3702 };
3703 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3704 }
3705
3706 pub fn by_item(
3708 self,
3709 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3710 crate::model::ListCloudControlDeploymentsResponse,
3711 crate::Error,
3712 > {
3713 use google_cloud_gax::paginator::Paginator;
3714 self.by_page().items()
3715 }
3716
3717 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3721 self.0.request.parent = v.into();
3722 self
3723 }
3724
3725 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3727 self.0.request.page_size = v.into();
3728 self
3729 }
3730
3731 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3733 self.0.request.page_token = v.into();
3734 self
3735 }
3736
3737 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3739 self.0.request.filter = v.into();
3740 self
3741 }
3742
3743 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3745 self.0.request.order_by = v.into();
3746 self
3747 }
3748 }
3749
3750 #[doc(hidden)]
3751 impl crate::RequestBuilder for ListCloudControlDeployments {
3752 fn request_options(&mut self) -> &mut crate::RequestOptions {
3753 &mut self.0.options
3754 }
3755 }
3756
3757 #[derive(Clone, Debug)]
3778 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3779
3780 impl ListLocations {
3781 pub(crate) fn new(
3782 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3783 ) -> Self {
3784 Self(RequestBuilder::new(stub))
3785 }
3786
3787 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3789 mut self,
3790 v: V,
3791 ) -> Self {
3792 self.0.request = v.into();
3793 self
3794 }
3795
3796 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3798 self.0.options = v.into();
3799 self
3800 }
3801
3802 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3804 (*self.0.stub)
3805 .list_locations(self.0.request, self.0.options)
3806 .await
3807 .map(crate::Response::into_body)
3808 }
3809
3810 pub fn by_page(
3812 self,
3813 ) -> impl google_cloud_gax::paginator::Paginator<
3814 google_cloud_location::model::ListLocationsResponse,
3815 crate::Error,
3816 > {
3817 use std::clone::Clone;
3818 let token = self.0.request.page_token.clone();
3819 let execute = move |token: String| {
3820 let mut builder = self.clone();
3821 builder.0.request = builder.0.request.set_page_token(token);
3822 builder.send()
3823 };
3824 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3825 }
3826
3827 pub fn by_item(
3829 self,
3830 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3831 google_cloud_location::model::ListLocationsResponse,
3832 crate::Error,
3833 > {
3834 use google_cloud_gax::paginator::Paginator;
3835 self.by_page().items()
3836 }
3837
3838 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3840 self.0.request.name = v.into();
3841 self
3842 }
3843
3844 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3846 self.0.request.filter = v.into();
3847 self
3848 }
3849
3850 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3852 self.0.request.page_size = v.into();
3853 self
3854 }
3855
3856 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3858 self.0.request.page_token = v.into();
3859 self
3860 }
3861 }
3862
3863 #[doc(hidden)]
3864 impl crate::RequestBuilder for ListLocations {
3865 fn request_options(&mut self) -> &mut crate::RequestOptions {
3866 &mut self.0.options
3867 }
3868 }
3869
3870 #[derive(Clone, Debug)]
3887 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3888
3889 impl GetLocation {
3890 pub(crate) fn new(
3891 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3892 ) -> Self {
3893 Self(RequestBuilder::new(stub))
3894 }
3895
3896 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3898 mut self,
3899 v: V,
3900 ) -> Self {
3901 self.0.request = v.into();
3902 self
3903 }
3904
3905 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3907 self.0.options = v.into();
3908 self
3909 }
3910
3911 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3913 (*self.0.stub)
3914 .get_location(self.0.request, self.0.options)
3915 .await
3916 .map(crate::Response::into_body)
3917 }
3918
3919 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3921 self.0.request.name = v.into();
3922 self
3923 }
3924 }
3925
3926 #[doc(hidden)]
3927 impl crate::RequestBuilder for GetLocation {
3928 fn request_options(&mut self) -> &mut crate::RequestOptions {
3929 &mut self.0.options
3930 }
3931 }
3932
3933 #[derive(Clone, Debug)]
3954 pub struct ListOperations(
3955 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3956 );
3957
3958 impl ListOperations {
3959 pub(crate) fn new(
3960 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3961 ) -> Self {
3962 Self(RequestBuilder::new(stub))
3963 }
3964
3965 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3967 mut self,
3968 v: V,
3969 ) -> Self {
3970 self.0.request = v.into();
3971 self
3972 }
3973
3974 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3976 self.0.options = v.into();
3977 self
3978 }
3979
3980 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3982 (*self.0.stub)
3983 .list_operations(self.0.request, self.0.options)
3984 .await
3985 .map(crate::Response::into_body)
3986 }
3987
3988 pub fn by_page(
3990 self,
3991 ) -> impl google_cloud_gax::paginator::Paginator<
3992 google_cloud_longrunning::model::ListOperationsResponse,
3993 crate::Error,
3994 > {
3995 use std::clone::Clone;
3996 let token = self.0.request.page_token.clone();
3997 let execute = move |token: String| {
3998 let mut builder = self.clone();
3999 builder.0.request = builder.0.request.set_page_token(token);
4000 builder.send()
4001 };
4002 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4003 }
4004
4005 pub fn by_item(
4007 self,
4008 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4009 google_cloud_longrunning::model::ListOperationsResponse,
4010 crate::Error,
4011 > {
4012 use google_cloud_gax::paginator::Paginator;
4013 self.by_page().items()
4014 }
4015
4016 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4018 self.0.request.name = v.into();
4019 self
4020 }
4021
4022 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4024 self.0.request.filter = v.into();
4025 self
4026 }
4027
4028 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4030 self.0.request.page_size = v.into();
4031 self
4032 }
4033
4034 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4036 self.0.request.page_token = v.into();
4037 self
4038 }
4039
4040 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4042 self.0.request.return_partial_success = v.into();
4043 self
4044 }
4045 }
4046
4047 #[doc(hidden)]
4048 impl crate::RequestBuilder for ListOperations {
4049 fn request_options(&mut self) -> &mut crate::RequestOptions {
4050 &mut self.0.options
4051 }
4052 }
4053
4054 #[derive(Clone, Debug)]
4071 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4072
4073 impl GetOperation {
4074 pub(crate) fn new(
4075 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
4076 ) -> Self {
4077 Self(RequestBuilder::new(stub))
4078 }
4079
4080 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4082 mut self,
4083 v: V,
4084 ) -> Self {
4085 self.0.request = v.into();
4086 self
4087 }
4088
4089 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4091 self.0.options = v.into();
4092 self
4093 }
4094
4095 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4097 (*self.0.stub)
4098 .get_operation(self.0.request, self.0.options)
4099 .await
4100 .map(crate::Response::into_body)
4101 }
4102
4103 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4105 self.0.request.name = v.into();
4106 self
4107 }
4108 }
4109
4110 #[doc(hidden)]
4111 impl crate::RequestBuilder for GetOperation {
4112 fn request_options(&mut self) -> &mut crate::RequestOptions {
4113 &mut self.0.options
4114 }
4115 }
4116
4117 #[derive(Clone, Debug)]
4134 pub struct DeleteOperation(
4135 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4136 );
4137
4138 impl DeleteOperation {
4139 pub(crate) fn new(
4140 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
4141 ) -> Self {
4142 Self(RequestBuilder::new(stub))
4143 }
4144
4145 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4147 mut self,
4148 v: V,
4149 ) -> Self {
4150 self.0.request = v.into();
4151 self
4152 }
4153
4154 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4156 self.0.options = v.into();
4157 self
4158 }
4159
4160 pub async fn send(self) -> Result<()> {
4162 (*self.0.stub)
4163 .delete_operation(self.0.request, self.0.options)
4164 .await
4165 .map(crate::Response::into_body)
4166 }
4167
4168 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4170 self.0.request.name = v.into();
4171 self
4172 }
4173 }
4174
4175 #[doc(hidden)]
4176 impl crate::RequestBuilder for DeleteOperation {
4177 fn request_options(&mut self) -> &mut crate::RequestOptions {
4178 &mut self.0.options
4179 }
4180 }
4181
4182 #[derive(Clone, Debug)]
4199 pub struct CancelOperation(
4200 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4201 );
4202
4203 impl CancelOperation {
4204 pub(crate) fn new(
4205 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
4206 ) -> Self {
4207 Self(RequestBuilder::new(stub))
4208 }
4209
4210 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4212 mut self,
4213 v: V,
4214 ) -> Self {
4215 self.0.request = v.into();
4216 self
4217 }
4218
4219 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4221 self.0.options = v.into();
4222 self
4223 }
4224
4225 pub async fn send(self) -> Result<()> {
4227 (*self.0.stub)
4228 .cancel_operation(self.0.request, self.0.options)
4229 .await
4230 .map(crate::Response::into_body)
4231 }
4232
4233 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4235 self.0.request.name = v.into();
4236 self
4237 }
4238 }
4239
4240 #[doc(hidden)]
4241 impl crate::RequestBuilder for CancelOperation {
4242 fn request_options(&mut self) -> &mut crate::RequestOptions {
4243 &mut self.0.options
4244 }
4245 }
4246}
4247
4248pub mod monitoring {
4250 use crate::Result;
4251
4252 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4266
4267 pub(crate) mod client {
4268 use super::super::super::client::Monitoring;
4269 pub struct Factory;
4270 impl crate::ClientFactory for Factory {
4271 type Client = Monitoring;
4272 type Credentials = gaxi::options::Credentials;
4273 async fn build(
4274 self,
4275 config: gaxi::options::ClientConfig,
4276 ) -> crate::ClientBuilderResult<Self::Client> {
4277 Self::Client::new(config).await
4278 }
4279 }
4280 }
4281
4282 #[derive(Clone, Debug)]
4284 pub(crate) struct RequestBuilder<R: std::default::Default> {
4285 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4286 request: R,
4287 options: crate::RequestOptions,
4288 }
4289
4290 impl<R> RequestBuilder<R>
4291 where
4292 R: std::default::Default,
4293 {
4294 pub(crate) fn new(
4295 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4296 ) -> Self {
4297 Self {
4298 stub,
4299 request: R::default(),
4300 options: crate::RequestOptions::default(),
4301 }
4302 }
4303 }
4304
4305 #[derive(Clone, Debug)]
4326 pub struct ListFrameworkComplianceSummaries(
4327 RequestBuilder<crate::model::ListFrameworkComplianceSummariesRequest>,
4328 );
4329
4330 impl ListFrameworkComplianceSummaries {
4331 pub(crate) fn new(
4332 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4333 ) -> Self {
4334 Self(RequestBuilder::new(stub))
4335 }
4336
4337 pub fn with_request<V: Into<crate::model::ListFrameworkComplianceSummariesRequest>>(
4339 mut self,
4340 v: V,
4341 ) -> Self {
4342 self.0.request = v.into();
4343 self
4344 }
4345
4346 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4348 self.0.options = v.into();
4349 self
4350 }
4351
4352 pub async fn send(self) -> Result<crate::model::ListFrameworkComplianceSummariesResponse> {
4354 (*self.0.stub)
4355 .list_framework_compliance_summaries(self.0.request, self.0.options)
4356 .await
4357 .map(crate::Response::into_body)
4358 }
4359
4360 pub fn by_page(
4362 self,
4363 ) -> impl google_cloud_gax::paginator::Paginator<
4364 crate::model::ListFrameworkComplianceSummariesResponse,
4365 crate::Error,
4366 > {
4367 use std::clone::Clone;
4368 let token = self.0.request.page_token.clone();
4369 let execute = move |token: String| {
4370 let mut builder = self.clone();
4371 builder.0.request = builder.0.request.set_page_token(token);
4372 builder.send()
4373 };
4374 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4375 }
4376
4377 pub fn by_item(
4379 self,
4380 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4381 crate::model::ListFrameworkComplianceSummariesResponse,
4382 crate::Error,
4383 > {
4384 use google_cloud_gax::paginator::Paginator;
4385 self.by_page().items()
4386 }
4387
4388 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4392 self.0.request.parent = v.into();
4393 self
4394 }
4395
4396 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4398 self.0.request.page_size = v.into();
4399 self
4400 }
4401
4402 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4404 self.0.request.page_token = v.into();
4405 self
4406 }
4407
4408 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4410 self.0.request.filter = v.into();
4411 self
4412 }
4413
4414 pub fn set_view<T: Into<crate::model::FrameworkComplianceSummaryView>>(
4416 mut self,
4417 v: T,
4418 ) -> Self {
4419 self.0.request.view = v.into();
4420 self
4421 }
4422 }
4423
4424 #[doc(hidden)]
4425 impl crate::RequestBuilder for ListFrameworkComplianceSummaries {
4426 fn request_options(&mut self) -> &mut crate::RequestOptions {
4427 &mut self.0.options
4428 }
4429 }
4430
4431 #[derive(Clone, Debug)]
4452 pub struct ListFindingSummaries(RequestBuilder<crate::model::ListFindingSummariesRequest>);
4453
4454 impl ListFindingSummaries {
4455 pub(crate) fn new(
4456 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4457 ) -> Self {
4458 Self(RequestBuilder::new(stub))
4459 }
4460
4461 pub fn with_request<V: Into<crate::model::ListFindingSummariesRequest>>(
4463 mut self,
4464 v: V,
4465 ) -> Self {
4466 self.0.request = v.into();
4467 self
4468 }
4469
4470 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4472 self.0.options = v.into();
4473 self
4474 }
4475
4476 pub async fn send(self) -> Result<crate::model::ListFindingSummariesResponse> {
4478 (*self.0.stub)
4479 .list_finding_summaries(self.0.request, self.0.options)
4480 .await
4481 .map(crate::Response::into_body)
4482 }
4483
4484 pub fn by_page(
4486 self,
4487 ) -> impl google_cloud_gax::paginator::Paginator<
4488 crate::model::ListFindingSummariesResponse,
4489 crate::Error,
4490 > {
4491 use std::clone::Clone;
4492 let token = self.0.request.page_token.clone();
4493 let execute = move |token: String| {
4494 let mut builder = self.clone();
4495 builder.0.request = builder.0.request.set_page_token(token);
4496 builder.send()
4497 };
4498 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4499 }
4500
4501 pub fn by_item(
4503 self,
4504 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4505 crate::model::ListFindingSummariesResponse,
4506 crate::Error,
4507 > {
4508 use google_cloud_gax::paginator::Paginator;
4509 self.by_page().items()
4510 }
4511
4512 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4516 self.0.request.parent = v.into();
4517 self
4518 }
4519
4520 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4522 self.0.request.page_size = v.into();
4523 self
4524 }
4525
4526 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4528 self.0.request.page_token = v.into();
4529 self
4530 }
4531
4532 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4534 self.0.request.filter = v.into();
4535 self
4536 }
4537
4538 #[deprecated]
4540 pub fn set_end_time<T>(mut self, v: T) -> Self
4541 where
4542 T: std::convert::Into<wkt::Timestamp>,
4543 {
4544 self.0.request.end_time = std::option::Option::Some(v.into());
4545 self
4546 }
4547
4548 #[deprecated]
4550 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4551 where
4552 T: std::convert::Into<wkt::Timestamp>,
4553 {
4554 self.0.request.end_time = v.map(|x| x.into());
4555 self
4556 }
4557 }
4558
4559 #[doc(hidden)]
4560 impl crate::RequestBuilder for ListFindingSummaries {
4561 fn request_options(&mut self) -> &mut crate::RequestOptions {
4562 &mut self.0.options
4563 }
4564 }
4565
4566 #[derive(Clone, Debug)]
4583 pub struct FetchFrameworkComplianceReport(
4584 RequestBuilder<crate::model::FetchFrameworkComplianceReportRequest>,
4585 );
4586
4587 impl FetchFrameworkComplianceReport {
4588 pub(crate) fn new(
4589 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4590 ) -> Self {
4591 Self(RequestBuilder::new(stub))
4592 }
4593
4594 pub fn with_request<V: Into<crate::model::FetchFrameworkComplianceReportRequest>>(
4596 mut self,
4597 v: V,
4598 ) -> Self {
4599 self.0.request = v.into();
4600 self
4601 }
4602
4603 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4605 self.0.options = v.into();
4606 self
4607 }
4608
4609 pub async fn send(self) -> Result<crate::model::FrameworkComplianceReport> {
4611 (*self.0.stub)
4612 .fetch_framework_compliance_report(self.0.request, self.0.options)
4613 .await
4614 .map(crate::Response::into_body)
4615 }
4616
4617 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4621 self.0.request.name = v.into();
4622 self
4623 }
4624
4625 pub fn set_end_time<T>(mut self, v: T) -> Self
4627 where
4628 T: std::convert::Into<wkt::Timestamp>,
4629 {
4630 self.0.request.end_time = std::option::Option::Some(v.into());
4631 self
4632 }
4633
4634 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4636 where
4637 T: std::convert::Into<wkt::Timestamp>,
4638 {
4639 self.0.request.end_time = v.map(|x| x.into());
4640 self
4641 }
4642
4643 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4645 self.0.request.filter = v.into();
4646 self
4647 }
4648 }
4649
4650 #[doc(hidden)]
4651 impl crate::RequestBuilder for FetchFrameworkComplianceReport {
4652 fn request_options(&mut self) -> &mut crate::RequestOptions {
4653 &mut self.0.options
4654 }
4655 }
4656
4657 #[derive(Clone, Debug)]
4678 pub struct ListControlComplianceSummaries(
4679 RequestBuilder<crate::model::ListControlComplianceSummariesRequest>,
4680 );
4681
4682 impl ListControlComplianceSummaries {
4683 pub(crate) fn new(
4684 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4685 ) -> Self {
4686 Self(RequestBuilder::new(stub))
4687 }
4688
4689 pub fn with_request<V: Into<crate::model::ListControlComplianceSummariesRequest>>(
4691 mut self,
4692 v: V,
4693 ) -> Self {
4694 self.0.request = v.into();
4695 self
4696 }
4697
4698 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4700 self.0.options = v.into();
4701 self
4702 }
4703
4704 pub async fn send(self) -> Result<crate::model::ListControlComplianceSummariesResponse> {
4706 (*self.0.stub)
4707 .list_control_compliance_summaries(self.0.request, self.0.options)
4708 .await
4709 .map(crate::Response::into_body)
4710 }
4711
4712 pub fn by_page(
4714 self,
4715 ) -> impl google_cloud_gax::paginator::Paginator<
4716 crate::model::ListControlComplianceSummariesResponse,
4717 crate::Error,
4718 > {
4719 use std::clone::Clone;
4720 let token = self.0.request.page_token.clone();
4721 let execute = move |token: String| {
4722 let mut builder = self.clone();
4723 builder.0.request = builder.0.request.set_page_token(token);
4724 builder.send()
4725 };
4726 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4727 }
4728
4729 pub fn by_item(
4731 self,
4732 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4733 crate::model::ListControlComplianceSummariesResponse,
4734 crate::Error,
4735 > {
4736 use google_cloud_gax::paginator::Paginator;
4737 self.by_page().items()
4738 }
4739
4740 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4744 self.0.request.parent = v.into();
4745 self
4746 }
4747
4748 #[deprecated]
4750 pub fn set_end_time<T>(mut self, v: T) -> Self
4751 where
4752 T: std::convert::Into<wkt::Timestamp>,
4753 {
4754 self.0.request.end_time = std::option::Option::Some(v.into());
4755 self
4756 }
4757
4758 #[deprecated]
4760 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4761 where
4762 T: std::convert::Into<wkt::Timestamp>,
4763 {
4764 self.0.request.end_time = v.map(|x| x.into());
4765 self
4766 }
4767
4768 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4770 self.0.request.page_size = v.into();
4771 self
4772 }
4773
4774 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4776 self.0.request.page_token = v.into();
4777 self
4778 }
4779
4780 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4782 self.0.request.filter = v.into();
4783 self
4784 }
4785 }
4786
4787 #[doc(hidden)]
4788 impl crate::RequestBuilder for ListControlComplianceSummaries {
4789 fn request_options(&mut self) -> &mut crate::RequestOptions {
4790 &mut self.0.options
4791 }
4792 }
4793
4794 #[derive(Clone, Debug)]
4811 pub struct AggregateFrameworkComplianceReport(
4812 RequestBuilder<crate::model::AggregateFrameworkComplianceReportRequest>,
4813 );
4814
4815 impl AggregateFrameworkComplianceReport {
4816 pub(crate) fn new(
4817 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4818 ) -> Self {
4819 Self(RequestBuilder::new(stub))
4820 }
4821
4822 pub fn with_request<V: Into<crate::model::AggregateFrameworkComplianceReportRequest>>(
4824 mut self,
4825 v: V,
4826 ) -> Self {
4827 self.0.request = v.into();
4828 self
4829 }
4830
4831 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4833 self.0.options = v.into();
4834 self
4835 }
4836
4837 pub async fn send(
4839 self,
4840 ) -> Result<crate::model::AggregateFrameworkComplianceReportResponse> {
4841 (*self.0.stub)
4842 .aggregate_framework_compliance_report(self.0.request, self.0.options)
4843 .await
4844 .map(crate::Response::into_body)
4845 }
4846
4847 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4851 self.0.request.name = v.into();
4852 self
4853 }
4854
4855 pub fn set_interval<T>(mut self, v: T) -> Self
4857 where
4858 T: std::convert::Into<google_cloud_type::model::Interval>,
4859 {
4860 self.0.request.interval = std::option::Option::Some(v.into());
4861 self
4862 }
4863
4864 pub fn set_or_clear_interval<T>(mut self, v: std::option::Option<T>) -> Self
4866 where
4867 T: std::convert::Into<google_cloud_type::model::Interval>,
4868 {
4869 self.0.request.interval = v.map(|x| x.into());
4870 self
4871 }
4872
4873 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4875 self.0.request.filter = v.into();
4876 self
4877 }
4878 }
4879
4880 #[doc(hidden)]
4881 impl crate::RequestBuilder for AggregateFrameworkComplianceReport {
4882 fn request_options(&mut self) -> &mut crate::RequestOptions {
4883 &mut self.0.options
4884 }
4885 }
4886
4887 #[derive(Clone, Debug)]
4908 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4909
4910 impl ListLocations {
4911 pub(crate) fn new(
4912 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4913 ) -> Self {
4914 Self(RequestBuilder::new(stub))
4915 }
4916
4917 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4919 mut self,
4920 v: V,
4921 ) -> Self {
4922 self.0.request = v.into();
4923 self
4924 }
4925
4926 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4928 self.0.options = v.into();
4929 self
4930 }
4931
4932 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4934 (*self.0.stub)
4935 .list_locations(self.0.request, self.0.options)
4936 .await
4937 .map(crate::Response::into_body)
4938 }
4939
4940 pub fn by_page(
4942 self,
4943 ) -> impl google_cloud_gax::paginator::Paginator<
4944 google_cloud_location::model::ListLocationsResponse,
4945 crate::Error,
4946 > {
4947 use std::clone::Clone;
4948 let token = self.0.request.page_token.clone();
4949 let execute = move |token: String| {
4950 let mut builder = self.clone();
4951 builder.0.request = builder.0.request.set_page_token(token);
4952 builder.send()
4953 };
4954 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4955 }
4956
4957 pub fn by_item(
4959 self,
4960 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4961 google_cloud_location::model::ListLocationsResponse,
4962 crate::Error,
4963 > {
4964 use google_cloud_gax::paginator::Paginator;
4965 self.by_page().items()
4966 }
4967
4968 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4970 self.0.request.name = v.into();
4971 self
4972 }
4973
4974 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4976 self.0.request.filter = v.into();
4977 self
4978 }
4979
4980 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4982 self.0.request.page_size = v.into();
4983 self
4984 }
4985
4986 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4988 self.0.request.page_token = v.into();
4989 self
4990 }
4991 }
4992
4993 #[doc(hidden)]
4994 impl crate::RequestBuilder for ListLocations {
4995 fn request_options(&mut self) -> &mut crate::RequestOptions {
4996 &mut self.0.options
4997 }
4998 }
4999
5000 #[derive(Clone, Debug)]
5017 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
5018
5019 impl GetLocation {
5020 pub(crate) fn new(
5021 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5022 ) -> Self {
5023 Self(RequestBuilder::new(stub))
5024 }
5025
5026 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
5028 mut self,
5029 v: V,
5030 ) -> Self {
5031 self.0.request = v.into();
5032 self
5033 }
5034
5035 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5037 self.0.options = v.into();
5038 self
5039 }
5040
5041 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
5043 (*self.0.stub)
5044 .get_location(self.0.request, self.0.options)
5045 .await
5046 .map(crate::Response::into_body)
5047 }
5048
5049 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5051 self.0.request.name = v.into();
5052 self
5053 }
5054 }
5055
5056 #[doc(hidden)]
5057 impl crate::RequestBuilder for GetLocation {
5058 fn request_options(&mut self) -> &mut crate::RequestOptions {
5059 &mut self.0.options
5060 }
5061 }
5062
5063 #[derive(Clone, Debug)]
5084 pub struct ListOperations(
5085 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5086 );
5087
5088 impl ListOperations {
5089 pub(crate) fn new(
5090 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5091 ) -> Self {
5092 Self(RequestBuilder::new(stub))
5093 }
5094
5095 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5097 mut self,
5098 v: V,
5099 ) -> Self {
5100 self.0.request = v.into();
5101 self
5102 }
5103
5104 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5106 self.0.options = v.into();
5107 self
5108 }
5109
5110 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5112 (*self.0.stub)
5113 .list_operations(self.0.request, self.0.options)
5114 .await
5115 .map(crate::Response::into_body)
5116 }
5117
5118 pub fn by_page(
5120 self,
5121 ) -> impl google_cloud_gax::paginator::Paginator<
5122 google_cloud_longrunning::model::ListOperationsResponse,
5123 crate::Error,
5124 > {
5125 use std::clone::Clone;
5126 let token = self.0.request.page_token.clone();
5127 let execute = move |token: String| {
5128 let mut builder = self.clone();
5129 builder.0.request = builder.0.request.set_page_token(token);
5130 builder.send()
5131 };
5132 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5133 }
5134
5135 pub fn by_item(
5137 self,
5138 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5139 google_cloud_longrunning::model::ListOperationsResponse,
5140 crate::Error,
5141 > {
5142 use google_cloud_gax::paginator::Paginator;
5143 self.by_page().items()
5144 }
5145
5146 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5148 self.0.request.name = v.into();
5149 self
5150 }
5151
5152 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5154 self.0.request.filter = v.into();
5155 self
5156 }
5157
5158 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5160 self.0.request.page_size = v.into();
5161 self
5162 }
5163
5164 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5166 self.0.request.page_token = v.into();
5167 self
5168 }
5169
5170 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5172 self.0.request.return_partial_success = v.into();
5173 self
5174 }
5175 }
5176
5177 #[doc(hidden)]
5178 impl crate::RequestBuilder for ListOperations {
5179 fn request_options(&mut self) -> &mut crate::RequestOptions {
5180 &mut self.0.options
5181 }
5182 }
5183
5184 #[derive(Clone, Debug)]
5201 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5202
5203 impl GetOperation {
5204 pub(crate) fn new(
5205 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5206 ) -> Self {
5207 Self(RequestBuilder::new(stub))
5208 }
5209
5210 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5212 mut self,
5213 v: V,
5214 ) -> Self {
5215 self.0.request = v.into();
5216 self
5217 }
5218
5219 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5221 self.0.options = v.into();
5222 self
5223 }
5224
5225 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5227 (*self.0.stub)
5228 .get_operation(self.0.request, self.0.options)
5229 .await
5230 .map(crate::Response::into_body)
5231 }
5232
5233 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5235 self.0.request.name = v.into();
5236 self
5237 }
5238 }
5239
5240 #[doc(hidden)]
5241 impl crate::RequestBuilder for GetOperation {
5242 fn request_options(&mut self) -> &mut crate::RequestOptions {
5243 &mut self.0.options
5244 }
5245 }
5246
5247 #[derive(Clone, Debug)]
5264 pub struct DeleteOperation(
5265 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5266 );
5267
5268 impl DeleteOperation {
5269 pub(crate) fn new(
5270 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5271 ) -> Self {
5272 Self(RequestBuilder::new(stub))
5273 }
5274
5275 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5277 mut self,
5278 v: V,
5279 ) -> Self {
5280 self.0.request = v.into();
5281 self
5282 }
5283
5284 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5286 self.0.options = v.into();
5287 self
5288 }
5289
5290 pub async fn send(self) -> Result<()> {
5292 (*self.0.stub)
5293 .delete_operation(self.0.request, self.0.options)
5294 .await
5295 .map(crate::Response::into_body)
5296 }
5297
5298 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5300 self.0.request.name = v.into();
5301 self
5302 }
5303 }
5304
5305 #[doc(hidden)]
5306 impl crate::RequestBuilder for DeleteOperation {
5307 fn request_options(&mut self) -> &mut crate::RequestOptions {
5308 &mut self.0.options
5309 }
5310 }
5311
5312 #[derive(Clone, Debug)]
5329 pub struct CancelOperation(
5330 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5331 );
5332
5333 impl CancelOperation {
5334 pub(crate) fn new(
5335 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5336 ) -> Self {
5337 Self(RequestBuilder::new(stub))
5338 }
5339
5340 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5342 mut self,
5343 v: V,
5344 ) -> Self {
5345 self.0.request = v.into();
5346 self
5347 }
5348
5349 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5351 self.0.options = v.into();
5352 self
5353 }
5354
5355 pub async fn send(self) -> Result<()> {
5357 (*self.0.stub)
5358 .cancel_operation(self.0.request, self.0.options)
5359 .await
5360 .map(crate::Response::into_body)
5361 }
5362
5363 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5365 self.0.request.name = v.into();
5366 self
5367 }
5368 }
5369
5370 #[doc(hidden)]
5371 impl crate::RequestBuilder for CancelOperation {
5372 fn request_options(&mut self) -> &mut crate::RequestOptions {
5373 &mut self.0.options
5374 }
5375 }
5376}