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
223 let stub = self.0.stub.clone();
224 let mut options = self.0.options.clone();
225 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
226 let query = move |name| {
227 let stub = stub.clone();
228 let options = options.clone();
229 async {
230 let op = GetOperation::new(stub)
231 .set_name(name)
232 .with_options(options)
233 .send()
234 .await?;
235 Ok(Operation::new(op))
236 }
237 };
238
239 let start = move || async {
240 let op = self.send().await?;
241 Ok(Operation::new(op))
242 };
243
244 google_cloud_lro::internal::new_poller(
245 polling_error_policy,
246 polling_backoff_policy,
247 start,
248 query,
249 )
250 }
251
252 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
256 self.0.request.parent = v.into();
257 self
258 }
259
260 pub fn set_framework_audit_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
262 self.0.request.framework_audit_id = v.into();
263 self
264 }
265
266 pub fn set_framework_audit<T>(mut self, v: T) -> Self
270 where
271 T: std::convert::Into<crate::model::FrameworkAudit>,
272 {
273 self.0.request.framework_audit = std::option::Option::Some(v.into());
274 self
275 }
276
277 pub fn set_or_clear_framework_audit<T>(mut self, v: std::option::Option<T>) -> Self
281 where
282 T: std::convert::Into<crate::model::FrameworkAudit>,
283 {
284 self.0.request.framework_audit = v.map(|x| x.into());
285 self
286 }
287 }
288
289 #[doc(hidden)]
290 impl crate::RequestBuilder for CreateFrameworkAudit {
291 fn request_options(&mut self) -> &mut crate::RequestOptions {
292 &mut self.0.options
293 }
294 }
295
296 #[derive(Clone, Debug)]
317 pub struct ListFrameworkAudits(RequestBuilder<crate::model::ListFrameworkAuditsRequest>);
318
319 impl ListFrameworkAudits {
320 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
321 Self(RequestBuilder::new(stub))
322 }
323
324 pub fn with_request<V: Into<crate::model::ListFrameworkAuditsRequest>>(
326 mut self,
327 v: V,
328 ) -> Self {
329 self.0.request = v.into();
330 self
331 }
332
333 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
335 self.0.options = v.into();
336 self
337 }
338
339 pub async fn send(self) -> Result<crate::model::ListFrameworkAuditsResponse> {
341 (*self.0.stub)
342 .list_framework_audits(self.0.request, self.0.options)
343 .await
344 .map(crate::Response::into_body)
345 }
346
347 pub fn by_page(
349 self,
350 ) -> impl google_cloud_gax::paginator::Paginator<
351 crate::model::ListFrameworkAuditsResponse,
352 crate::Error,
353 > {
354 use std::clone::Clone;
355 let token = self.0.request.page_token.clone();
356 let execute = move |token: String| {
357 let mut builder = self.clone();
358 builder.0.request = builder.0.request.set_page_token(token);
359 builder.send()
360 };
361 google_cloud_gax::paginator::internal::new_paginator(token, execute)
362 }
363
364 pub fn by_item(
366 self,
367 ) -> impl google_cloud_gax::paginator::ItemPaginator<
368 crate::model::ListFrameworkAuditsResponse,
369 crate::Error,
370 > {
371 use google_cloud_gax::paginator::Paginator;
372 self.by_page().items()
373 }
374
375 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
379 self.0.request.parent = v.into();
380 self
381 }
382
383 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
385 self.0.request.page_size = v.into();
386 self
387 }
388
389 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
391 self.0.request.page_token = v.into();
392 self
393 }
394
395 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
397 self.0.request.filter = v.into();
398 self
399 }
400 }
401
402 #[doc(hidden)]
403 impl crate::RequestBuilder for ListFrameworkAudits {
404 fn request_options(&mut self) -> &mut crate::RequestOptions {
405 &mut self.0.options
406 }
407 }
408
409 #[derive(Clone, Debug)]
426 pub struct GetFrameworkAudit(RequestBuilder<crate::model::GetFrameworkAuditRequest>);
427
428 impl GetFrameworkAudit {
429 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
430 Self(RequestBuilder::new(stub))
431 }
432
433 pub fn with_request<V: Into<crate::model::GetFrameworkAuditRequest>>(
435 mut self,
436 v: V,
437 ) -> Self {
438 self.0.request = v.into();
439 self
440 }
441
442 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
444 self.0.options = v.into();
445 self
446 }
447
448 pub async fn send(self) -> Result<crate::model::FrameworkAudit> {
450 (*self.0.stub)
451 .get_framework_audit(self.0.request, self.0.options)
452 .await
453 .map(crate::Response::into_body)
454 }
455
456 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
460 self.0.request.name = v.into();
461 self
462 }
463 }
464
465 #[doc(hidden)]
466 impl crate::RequestBuilder for GetFrameworkAudit {
467 fn request_options(&mut self) -> &mut crate::RequestOptions {
468 &mut self.0.options
469 }
470 }
471
472 #[derive(Clone, Debug)]
493 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
494
495 impl ListLocations {
496 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
497 Self(RequestBuilder::new(stub))
498 }
499
500 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
502 mut self,
503 v: V,
504 ) -> Self {
505 self.0.request = v.into();
506 self
507 }
508
509 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
511 self.0.options = v.into();
512 self
513 }
514
515 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
517 (*self.0.stub)
518 .list_locations(self.0.request, self.0.options)
519 .await
520 .map(crate::Response::into_body)
521 }
522
523 pub fn by_page(
525 self,
526 ) -> impl google_cloud_gax::paginator::Paginator<
527 google_cloud_location::model::ListLocationsResponse,
528 crate::Error,
529 > {
530 use std::clone::Clone;
531 let token = self.0.request.page_token.clone();
532 let execute = move |token: String| {
533 let mut builder = self.clone();
534 builder.0.request = builder.0.request.set_page_token(token);
535 builder.send()
536 };
537 google_cloud_gax::paginator::internal::new_paginator(token, execute)
538 }
539
540 pub fn by_item(
542 self,
543 ) -> impl google_cloud_gax::paginator::ItemPaginator<
544 google_cloud_location::model::ListLocationsResponse,
545 crate::Error,
546 > {
547 use google_cloud_gax::paginator::Paginator;
548 self.by_page().items()
549 }
550
551 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
553 self.0.request.name = v.into();
554 self
555 }
556
557 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
559 self.0.request.filter = v.into();
560 self
561 }
562
563 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
565 self.0.request.page_size = v.into();
566 self
567 }
568
569 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
571 self.0.request.page_token = v.into();
572 self
573 }
574 }
575
576 #[doc(hidden)]
577 impl crate::RequestBuilder for ListLocations {
578 fn request_options(&mut self) -> &mut crate::RequestOptions {
579 &mut self.0.options
580 }
581 }
582
583 #[derive(Clone, Debug)]
600 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
601
602 impl GetLocation {
603 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
604 Self(RequestBuilder::new(stub))
605 }
606
607 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
609 mut self,
610 v: V,
611 ) -> Self {
612 self.0.request = v.into();
613 self
614 }
615
616 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
618 self.0.options = v.into();
619 self
620 }
621
622 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
624 (*self.0.stub)
625 .get_location(self.0.request, self.0.options)
626 .await
627 .map(crate::Response::into_body)
628 }
629
630 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
632 self.0.request.name = v.into();
633 self
634 }
635 }
636
637 #[doc(hidden)]
638 impl crate::RequestBuilder for GetLocation {
639 fn request_options(&mut self) -> &mut crate::RequestOptions {
640 &mut self.0.options
641 }
642 }
643
644 #[derive(Clone, Debug)]
665 pub struct ListOperations(
666 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
667 );
668
669 impl ListOperations {
670 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
671 Self(RequestBuilder::new(stub))
672 }
673
674 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
676 mut self,
677 v: V,
678 ) -> Self {
679 self.0.request = v.into();
680 self
681 }
682
683 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
685 self.0.options = v.into();
686 self
687 }
688
689 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
691 (*self.0.stub)
692 .list_operations(self.0.request, self.0.options)
693 .await
694 .map(crate::Response::into_body)
695 }
696
697 pub fn by_page(
699 self,
700 ) -> impl google_cloud_gax::paginator::Paginator<
701 google_cloud_longrunning::model::ListOperationsResponse,
702 crate::Error,
703 > {
704 use std::clone::Clone;
705 let token = self.0.request.page_token.clone();
706 let execute = move |token: String| {
707 let mut builder = self.clone();
708 builder.0.request = builder.0.request.set_page_token(token);
709 builder.send()
710 };
711 google_cloud_gax::paginator::internal::new_paginator(token, execute)
712 }
713
714 pub fn by_item(
716 self,
717 ) -> impl google_cloud_gax::paginator::ItemPaginator<
718 google_cloud_longrunning::model::ListOperationsResponse,
719 crate::Error,
720 > {
721 use google_cloud_gax::paginator::Paginator;
722 self.by_page().items()
723 }
724
725 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
727 self.0.request.name = v.into();
728 self
729 }
730
731 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
733 self.0.request.filter = v.into();
734 self
735 }
736
737 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
739 self.0.request.page_size = v.into();
740 self
741 }
742
743 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
745 self.0.request.page_token = v.into();
746 self
747 }
748
749 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
751 self.0.request.return_partial_success = v.into();
752 self
753 }
754 }
755
756 #[doc(hidden)]
757 impl crate::RequestBuilder for ListOperations {
758 fn request_options(&mut self) -> &mut crate::RequestOptions {
759 &mut self.0.options
760 }
761 }
762
763 #[derive(Clone, Debug)]
780 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
781
782 impl GetOperation {
783 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
784 Self(RequestBuilder::new(stub))
785 }
786
787 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
789 mut self,
790 v: V,
791 ) -> Self {
792 self.0.request = v.into();
793 self
794 }
795
796 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
798 self.0.options = v.into();
799 self
800 }
801
802 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
804 (*self.0.stub)
805 .get_operation(self.0.request, self.0.options)
806 .await
807 .map(crate::Response::into_body)
808 }
809
810 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
812 self.0.request.name = v.into();
813 self
814 }
815 }
816
817 #[doc(hidden)]
818 impl crate::RequestBuilder for GetOperation {
819 fn request_options(&mut self) -> &mut crate::RequestOptions {
820 &mut self.0.options
821 }
822 }
823
824 #[derive(Clone, Debug)]
841 pub struct DeleteOperation(
842 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
843 );
844
845 impl DeleteOperation {
846 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
847 Self(RequestBuilder::new(stub))
848 }
849
850 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
852 mut self,
853 v: V,
854 ) -> Self {
855 self.0.request = v.into();
856 self
857 }
858
859 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
861 self.0.options = v.into();
862 self
863 }
864
865 pub async fn send(self) -> Result<()> {
867 (*self.0.stub)
868 .delete_operation(self.0.request, self.0.options)
869 .await
870 .map(crate::Response::into_body)
871 }
872
873 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
875 self.0.request.name = v.into();
876 self
877 }
878 }
879
880 #[doc(hidden)]
881 impl crate::RequestBuilder for DeleteOperation {
882 fn request_options(&mut self) -> &mut crate::RequestOptions {
883 &mut self.0.options
884 }
885 }
886
887 #[derive(Clone, Debug)]
904 pub struct CancelOperation(
905 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
906 );
907
908 impl CancelOperation {
909 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
910 Self(RequestBuilder::new(stub))
911 }
912
913 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
915 mut self,
916 v: V,
917 ) -> Self {
918 self.0.request = v.into();
919 self
920 }
921
922 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
924 self.0.options = v.into();
925 self
926 }
927
928 pub async fn send(self) -> Result<()> {
930 (*self.0.stub)
931 .cancel_operation(self.0.request, self.0.options)
932 .await
933 .map(crate::Response::into_body)
934 }
935
936 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
938 self.0.request.name = v.into();
939 self
940 }
941 }
942
943 #[doc(hidden)]
944 impl crate::RequestBuilder for CancelOperation {
945 fn request_options(&mut self) -> &mut crate::RequestOptions {
946 &mut self.0.options
947 }
948 }
949}
950
951pub mod cm_enrollment_service {
953 use crate::Result;
954
955 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
969
970 pub(crate) mod client {
971 use super::super::super::client::CmEnrollmentService;
972 pub struct Factory;
973 impl crate::ClientFactory for Factory {
974 type Client = CmEnrollmentService;
975 type Credentials = gaxi::options::Credentials;
976 async fn build(
977 self,
978 config: gaxi::options::ClientConfig,
979 ) -> crate::ClientBuilderResult<Self::Client> {
980 Self::Client::new(config).await
981 }
982 }
983 }
984
985 #[derive(Clone, Debug)]
987 pub(crate) struct RequestBuilder<R: std::default::Default> {
988 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
989 request: R,
990 options: crate::RequestOptions,
991 }
992
993 impl<R> RequestBuilder<R>
994 where
995 R: std::default::Default,
996 {
997 pub(crate) fn new(
998 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
999 ) -> Self {
1000 Self {
1001 stub,
1002 request: R::default(),
1003 options: crate::RequestOptions::default(),
1004 }
1005 }
1006 }
1007
1008 #[derive(Clone, Debug)]
1025 pub struct UpdateCmEnrollment(RequestBuilder<crate::model::UpdateCmEnrollmentRequest>);
1026
1027 impl UpdateCmEnrollment {
1028 pub(crate) fn new(
1029 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1030 ) -> Self {
1031 Self(RequestBuilder::new(stub))
1032 }
1033
1034 pub fn with_request<V: Into<crate::model::UpdateCmEnrollmentRequest>>(
1036 mut self,
1037 v: V,
1038 ) -> Self {
1039 self.0.request = v.into();
1040 self
1041 }
1042
1043 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1045 self.0.options = v.into();
1046 self
1047 }
1048
1049 pub async fn send(self) -> Result<crate::model::CmEnrollment> {
1051 (*self.0.stub)
1052 .update_cm_enrollment(self.0.request, self.0.options)
1053 .await
1054 .map(crate::Response::into_body)
1055 }
1056
1057 pub fn set_cm_enrollment<T>(mut self, v: T) -> Self
1061 where
1062 T: std::convert::Into<crate::model::CmEnrollment>,
1063 {
1064 self.0.request.cm_enrollment = std::option::Option::Some(v.into());
1065 self
1066 }
1067
1068 pub fn set_or_clear_cm_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
1072 where
1073 T: std::convert::Into<crate::model::CmEnrollment>,
1074 {
1075 self.0.request.cm_enrollment = v.map(|x| x.into());
1076 self
1077 }
1078
1079 pub fn set_update_mask<T>(mut self, v: T) -> Self
1081 where
1082 T: std::convert::Into<wkt::FieldMask>,
1083 {
1084 self.0.request.update_mask = std::option::Option::Some(v.into());
1085 self
1086 }
1087
1088 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1090 where
1091 T: std::convert::Into<wkt::FieldMask>,
1092 {
1093 self.0.request.update_mask = v.map(|x| x.into());
1094 self
1095 }
1096 }
1097
1098 #[doc(hidden)]
1099 impl crate::RequestBuilder for UpdateCmEnrollment {
1100 fn request_options(&mut self) -> &mut crate::RequestOptions {
1101 &mut self.0.options
1102 }
1103 }
1104
1105 #[derive(Clone, Debug)]
1122 pub struct CalculateEffectiveCmEnrollment(
1123 RequestBuilder<crate::model::CalculateEffectiveCmEnrollmentRequest>,
1124 );
1125
1126 impl CalculateEffectiveCmEnrollment {
1127 pub(crate) fn new(
1128 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1129 ) -> Self {
1130 Self(RequestBuilder::new(stub))
1131 }
1132
1133 pub fn with_request<V: Into<crate::model::CalculateEffectiveCmEnrollmentRequest>>(
1135 mut self,
1136 v: V,
1137 ) -> Self {
1138 self.0.request = v.into();
1139 self
1140 }
1141
1142 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1144 self.0.options = v.into();
1145 self
1146 }
1147
1148 pub async fn send(self) -> Result<crate::model::CalculateEffectiveCmEnrollmentResponse> {
1150 (*self.0.stub)
1151 .calculate_effective_cm_enrollment(self.0.request, self.0.options)
1152 .await
1153 .map(crate::Response::into_body)
1154 }
1155
1156 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1160 self.0.request.name = v.into();
1161 self
1162 }
1163 }
1164
1165 #[doc(hidden)]
1166 impl crate::RequestBuilder for CalculateEffectiveCmEnrollment {
1167 fn request_options(&mut self) -> &mut crate::RequestOptions {
1168 &mut self.0.options
1169 }
1170 }
1171
1172 #[derive(Clone, Debug)]
1193 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1194
1195 impl ListLocations {
1196 pub(crate) fn new(
1197 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1198 ) -> Self {
1199 Self(RequestBuilder::new(stub))
1200 }
1201
1202 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1204 mut self,
1205 v: V,
1206 ) -> Self {
1207 self.0.request = v.into();
1208 self
1209 }
1210
1211 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1213 self.0.options = v.into();
1214 self
1215 }
1216
1217 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1219 (*self.0.stub)
1220 .list_locations(self.0.request, self.0.options)
1221 .await
1222 .map(crate::Response::into_body)
1223 }
1224
1225 pub fn by_page(
1227 self,
1228 ) -> impl google_cloud_gax::paginator::Paginator<
1229 google_cloud_location::model::ListLocationsResponse,
1230 crate::Error,
1231 > {
1232 use std::clone::Clone;
1233 let token = self.0.request.page_token.clone();
1234 let execute = move |token: String| {
1235 let mut builder = self.clone();
1236 builder.0.request = builder.0.request.set_page_token(token);
1237 builder.send()
1238 };
1239 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1240 }
1241
1242 pub fn by_item(
1244 self,
1245 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1246 google_cloud_location::model::ListLocationsResponse,
1247 crate::Error,
1248 > {
1249 use google_cloud_gax::paginator::Paginator;
1250 self.by_page().items()
1251 }
1252
1253 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1255 self.0.request.name = v.into();
1256 self
1257 }
1258
1259 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1261 self.0.request.filter = v.into();
1262 self
1263 }
1264
1265 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1267 self.0.request.page_size = v.into();
1268 self
1269 }
1270
1271 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1273 self.0.request.page_token = v.into();
1274 self
1275 }
1276 }
1277
1278 #[doc(hidden)]
1279 impl crate::RequestBuilder for ListLocations {
1280 fn request_options(&mut self) -> &mut crate::RequestOptions {
1281 &mut self.0.options
1282 }
1283 }
1284
1285 #[derive(Clone, Debug)]
1302 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1303
1304 impl GetLocation {
1305 pub(crate) fn new(
1306 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1307 ) -> Self {
1308 Self(RequestBuilder::new(stub))
1309 }
1310
1311 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1313 mut self,
1314 v: V,
1315 ) -> Self {
1316 self.0.request = v.into();
1317 self
1318 }
1319
1320 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1322 self.0.options = v.into();
1323 self
1324 }
1325
1326 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1328 (*self.0.stub)
1329 .get_location(self.0.request, self.0.options)
1330 .await
1331 .map(crate::Response::into_body)
1332 }
1333
1334 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1336 self.0.request.name = v.into();
1337 self
1338 }
1339 }
1340
1341 #[doc(hidden)]
1342 impl crate::RequestBuilder for GetLocation {
1343 fn request_options(&mut self) -> &mut crate::RequestOptions {
1344 &mut self.0.options
1345 }
1346 }
1347
1348 #[derive(Clone, Debug)]
1369 pub struct ListOperations(
1370 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1371 );
1372
1373 impl ListOperations {
1374 pub(crate) fn new(
1375 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1376 ) -> Self {
1377 Self(RequestBuilder::new(stub))
1378 }
1379
1380 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1382 mut self,
1383 v: V,
1384 ) -> Self {
1385 self.0.request = v.into();
1386 self
1387 }
1388
1389 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1391 self.0.options = v.into();
1392 self
1393 }
1394
1395 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1397 (*self.0.stub)
1398 .list_operations(self.0.request, self.0.options)
1399 .await
1400 .map(crate::Response::into_body)
1401 }
1402
1403 pub fn by_page(
1405 self,
1406 ) -> impl google_cloud_gax::paginator::Paginator<
1407 google_cloud_longrunning::model::ListOperationsResponse,
1408 crate::Error,
1409 > {
1410 use std::clone::Clone;
1411 let token = self.0.request.page_token.clone();
1412 let execute = move |token: String| {
1413 let mut builder = self.clone();
1414 builder.0.request = builder.0.request.set_page_token(token);
1415 builder.send()
1416 };
1417 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1418 }
1419
1420 pub fn by_item(
1422 self,
1423 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1424 google_cloud_longrunning::model::ListOperationsResponse,
1425 crate::Error,
1426 > {
1427 use google_cloud_gax::paginator::Paginator;
1428 self.by_page().items()
1429 }
1430
1431 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1433 self.0.request.name = v.into();
1434 self
1435 }
1436
1437 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1439 self.0.request.filter = v.into();
1440 self
1441 }
1442
1443 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1445 self.0.request.page_size = v.into();
1446 self
1447 }
1448
1449 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1451 self.0.request.page_token = v.into();
1452 self
1453 }
1454
1455 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1457 self.0.request.return_partial_success = v.into();
1458 self
1459 }
1460 }
1461
1462 #[doc(hidden)]
1463 impl crate::RequestBuilder for ListOperations {
1464 fn request_options(&mut self) -> &mut crate::RequestOptions {
1465 &mut self.0.options
1466 }
1467 }
1468
1469 #[derive(Clone, Debug)]
1486 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1487
1488 impl GetOperation {
1489 pub(crate) fn new(
1490 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1491 ) -> Self {
1492 Self(RequestBuilder::new(stub))
1493 }
1494
1495 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1497 mut self,
1498 v: V,
1499 ) -> Self {
1500 self.0.request = v.into();
1501 self
1502 }
1503
1504 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1506 self.0.options = v.into();
1507 self
1508 }
1509
1510 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1512 (*self.0.stub)
1513 .get_operation(self.0.request, self.0.options)
1514 .await
1515 .map(crate::Response::into_body)
1516 }
1517
1518 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1520 self.0.request.name = v.into();
1521 self
1522 }
1523 }
1524
1525 #[doc(hidden)]
1526 impl crate::RequestBuilder for GetOperation {
1527 fn request_options(&mut self) -> &mut crate::RequestOptions {
1528 &mut self.0.options
1529 }
1530 }
1531
1532 #[derive(Clone, Debug)]
1549 pub struct DeleteOperation(
1550 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1551 );
1552
1553 impl DeleteOperation {
1554 pub(crate) fn new(
1555 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1556 ) -> Self {
1557 Self(RequestBuilder::new(stub))
1558 }
1559
1560 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1562 mut self,
1563 v: V,
1564 ) -> Self {
1565 self.0.request = v.into();
1566 self
1567 }
1568
1569 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1571 self.0.options = v.into();
1572 self
1573 }
1574
1575 pub async fn send(self) -> Result<()> {
1577 (*self.0.stub)
1578 .delete_operation(self.0.request, self.0.options)
1579 .await
1580 .map(crate::Response::into_body)
1581 }
1582
1583 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1585 self.0.request.name = v.into();
1586 self
1587 }
1588 }
1589
1590 #[doc(hidden)]
1591 impl crate::RequestBuilder for DeleteOperation {
1592 fn request_options(&mut self) -> &mut crate::RequestOptions {
1593 &mut self.0.options
1594 }
1595 }
1596
1597 #[derive(Clone, Debug)]
1614 pub struct CancelOperation(
1615 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1616 );
1617
1618 impl CancelOperation {
1619 pub(crate) fn new(
1620 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1621 ) -> Self {
1622 Self(RequestBuilder::new(stub))
1623 }
1624
1625 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1627 mut self,
1628 v: V,
1629 ) -> Self {
1630 self.0.request = v.into();
1631 self
1632 }
1633
1634 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1636 self.0.options = v.into();
1637 self
1638 }
1639
1640 pub async fn send(self) -> Result<()> {
1642 (*self.0.stub)
1643 .cancel_operation(self.0.request, self.0.options)
1644 .await
1645 .map(crate::Response::into_body)
1646 }
1647
1648 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1650 self.0.request.name = v.into();
1651 self
1652 }
1653 }
1654
1655 #[doc(hidden)]
1656 impl crate::RequestBuilder for CancelOperation {
1657 fn request_options(&mut self) -> &mut crate::RequestOptions {
1658 &mut self.0.options
1659 }
1660 }
1661}
1662
1663pub mod config {
1665 use crate::Result;
1666
1667 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1681
1682 pub(crate) mod client {
1683 use super::super::super::client::Config;
1684 pub struct Factory;
1685 impl crate::ClientFactory for Factory {
1686 type Client = Config;
1687 type Credentials = gaxi::options::Credentials;
1688 async fn build(
1689 self,
1690 config: gaxi::options::ClientConfig,
1691 ) -> crate::ClientBuilderResult<Self::Client> {
1692 Self::Client::new(config).await
1693 }
1694 }
1695 }
1696
1697 #[derive(Clone, Debug)]
1699 pub(crate) struct RequestBuilder<R: std::default::Default> {
1700 stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>,
1701 request: R,
1702 options: crate::RequestOptions,
1703 }
1704
1705 impl<R> RequestBuilder<R>
1706 where
1707 R: std::default::Default,
1708 {
1709 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1710 Self {
1711 stub,
1712 request: R::default(),
1713 options: crate::RequestOptions::default(),
1714 }
1715 }
1716 }
1717
1718 #[derive(Clone, Debug)]
1739 pub struct ListFrameworks(RequestBuilder<crate::model::ListFrameworksRequest>);
1740
1741 impl ListFrameworks {
1742 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1743 Self(RequestBuilder::new(stub))
1744 }
1745
1746 pub fn with_request<V: Into<crate::model::ListFrameworksRequest>>(mut self, v: V) -> Self {
1748 self.0.request = v.into();
1749 self
1750 }
1751
1752 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1754 self.0.options = v.into();
1755 self
1756 }
1757
1758 pub async fn send(self) -> Result<crate::model::ListFrameworksResponse> {
1760 (*self.0.stub)
1761 .list_frameworks(self.0.request, self.0.options)
1762 .await
1763 .map(crate::Response::into_body)
1764 }
1765
1766 pub fn by_page(
1768 self,
1769 ) -> impl google_cloud_gax::paginator::Paginator<
1770 crate::model::ListFrameworksResponse,
1771 crate::Error,
1772 > {
1773 use std::clone::Clone;
1774 let token = self.0.request.page_token.clone();
1775 let execute = move |token: String| {
1776 let mut builder = self.clone();
1777 builder.0.request = builder.0.request.set_page_token(token);
1778 builder.send()
1779 };
1780 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1781 }
1782
1783 pub fn by_item(
1785 self,
1786 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1787 crate::model::ListFrameworksResponse,
1788 crate::Error,
1789 > {
1790 use google_cloud_gax::paginator::Paginator;
1791 self.by_page().items()
1792 }
1793
1794 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1798 self.0.request.parent = v.into();
1799 self
1800 }
1801
1802 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1804 self.0.request.page_size = v.into();
1805 self
1806 }
1807
1808 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1810 self.0.request.page_token = v.into();
1811 self
1812 }
1813 }
1814
1815 #[doc(hidden)]
1816 impl crate::RequestBuilder for ListFrameworks {
1817 fn request_options(&mut self) -> &mut crate::RequestOptions {
1818 &mut self.0.options
1819 }
1820 }
1821
1822 #[derive(Clone, Debug)]
1839 pub struct GetFramework(RequestBuilder<crate::model::GetFrameworkRequest>);
1840
1841 impl GetFramework {
1842 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1843 Self(RequestBuilder::new(stub))
1844 }
1845
1846 pub fn with_request<V: Into<crate::model::GetFrameworkRequest>>(mut self, v: V) -> Self {
1848 self.0.request = v.into();
1849 self
1850 }
1851
1852 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1854 self.0.options = v.into();
1855 self
1856 }
1857
1858 pub async fn send(self) -> Result<crate::model::Framework> {
1860 (*self.0.stub)
1861 .get_framework(self.0.request, self.0.options)
1862 .await
1863 .map(crate::Response::into_body)
1864 }
1865
1866 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1870 self.0.request.name = v.into();
1871 self
1872 }
1873
1874 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
1876 self.0.request.major_revision_id = v.into();
1877 self
1878 }
1879 }
1880
1881 #[doc(hidden)]
1882 impl crate::RequestBuilder for GetFramework {
1883 fn request_options(&mut self) -> &mut crate::RequestOptions {
1884 &mut self.0.options
1885 }
1886 }
1887
1888 #[derive(Clone, Debug)]
1905 pub struct CreateFramework(RequestBuilder<crate::model::CreateFrameworkRequest>);
1906
1907 impl CreateFramework {
1908 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1909 Self(RequestBuilder::new(stub))
1910 }
1911
1912 pub fn with_request<V: Into<crate::model::CreateFrameworkRequest>>(mut self, v: V) -> Self {
1914 self.0.request = v.into();
1915 self
1916 }
1917
1918 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1920 self.0.options = v.into();
1921 self
1922 }
1923
1924 pub async fn send(self) -> Result<crate::model::Framework> {
1926 (*self.0.stub)
1927 .create_framework(self.0.request, self.0.options)
1928 .await
1929 .map(crate::Response::into_body)
1930 }
1931
1932 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1936 self.0.request.parent = v.into();
1937 self
1938 }
1939
1940 pub fn set_framework_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1944 self.0.request.framework_id = v.into();
1945 self
1946 }
1947
1948 pub fn set_framework<T>(mut self, v: T) -> Self
1952 where
1953 T: std::convert::Into<crate::model::Framework>,
1954 {
1955 self.0.request.framework = std::option::Option::Some(v.into());
1956 self
1957 }
1958
1959 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
1963 where
1964 T: std::convert::Into<crate::model::Framework>,
1965 {
1966 self.0.request.framework = v.map(|x| x.into());
1967 self
1968 }
1969 }
1970
1971 #[doc(hidden)]
1972 impl crate::RequestBuilder for CreateFramework {
1973 fn request_options(&mut self) -> &mut crate::RequestOptions {
1974 &mut self.0.options
1975 }
1976 }
1977
1978 #[derive(Clone, Debug)]
1995 pub struct UpdateFramework(RequestBuilder<crate::model::UpdateFrameworkRequest>);
1996
1997 impl UpdateFramework {
1998 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1999 Self(RequestBuilder::new(stub))
2000 }
2001
2002 pub fn with_request<V: Into<crate::model::UpdateFrameworkRequest>>(mut self, v: V) -> Self {
2004 self.0.request = v.into();
2005 self
2006 }
2007
2008 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2010 self.0.options = v.into();
2011 self
2012 }
2013
2014 pub async fn send(self) -> Result<crate::model::Framework> {
2016 (*self.0.stub)
2017 .update_framework(self.0.request, self.0.options)
2018 .await
2019 .map(crate::Response::into_body)
2020 }
2021
2022 pub fn set_update_mask<T>(mut self, v: T) -> Self
2024 where
2025 T: std::convert::Into<wkt::FieldMask>,
2026 {
2027 self.0.request.update_mask = std::option::Option::Some(v.into());
2028 self
2029 }
2030
2031 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2033 where
2034 T: std::convert::Into<wkt::FieldMask>,
2035 {
2036 self.0.request.update_mask = v.map(|x| x.into());
2037 self
2038 }
2039
2040 pub fn set_framework<T>(mut self, v: T) -> Self
2044 where
2045 T: std::convert::Into<crate::model::Framework>,
2046 {
2047 self.0.request.framework = std::option::Option::Some(v.into());
2048 self
2049 }
2050
2051 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
2055 where
2056 T: std::convert::Into<crate::model::Framework>,
2057 {
2058 self.0.request.framework = v.map(|x| x.into());
2059 self
2060 }
2061
2062 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
2064 self.0.request.major_revision_id = v.into();
2065 self
2066 }
2067 }
2068
2069 #[doc(hidden)]
2070 impl crate::RequestBuilder for UpdateFramework {
2071 fn request_options(&mut self) -> &mut crate::RequestOptions {
2072 &mut self.0.options
2073 }
2074 }
2075
2076 #[derive(Clone, Debug)]
2093 pub struct DeleteFramework(RequestBuilder<crate::model::DeleteFrameworkRequest>);
2094
2095 impl DeleteFramework {
2096 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2097 Self(RequestBuilder::new(stub))
2098 }
2099
2100 pub fn with_request<V: Into<crate::model::DeleteFrameworkRequest>>(mut self, v: V) -> Self {
2102 self.0.request = v.into();
2103 self
2104 }
2105
2106 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2108 self.0.options = v.into();
2109 self
2110 }
2111
2112 pub async fn send(self) -> Result<()> {
2114 (*self.0.stub)
2115 .delete_framework(self.0.request, self.0.options)
2116 .await
2117 .map(crate::Response::into_body)
2118 }
2119
2120 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2124 self.0.request.name = v.into();
2125 self
2126 }
2127 }
2128
2129 #[doc(hidden)]
2130 impl crate::RequestBuilder for DeleteFramework {
2131 fn request_options(&mut self) -> &mut crate::RequestOptions {
2132 &mut self.0.options
2133 }
2134 }
2135
2136 #[derive(Clone, Debug)]
2157 pub struct ListCloudControls(RequestBuilder<crate::model::ListCloudControlsRequest>);
2158
2159 impl ListCloudControls {
2160 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2161 Self(RequestBuilder::new(stub))
2162 }
2163
2164 pub fn with_request<V: Into<crate::model::ListCloudControlsRequest>>(
2166 mut self,
2167 v: V,
2168 ) -> Self {
2169 self.0.request = v.into();
2170 self
2171 }
2172
2173 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2175 self.0.options = v.into();
2176 self
2177 }
2178
2179 pub async fn send(self) -> Result<crate::model::ListCloudControlsResponse> {
2181 (*self.0.stub)
2182 .list_cloud_controls(self.0.request, self.0.options)
2183 .await
2184 .map(crate::Response::into_body)
2185 }
2186
2187 pub fn by_page(
2189 self,
2190 ) -> impl google_cloud_gax::paginator::Paginator<
2191 crate::model::ListCloudControlsResponse,
2192 crate::Error,
2193 > {
2194 use std::clone::Clone;
2195 let token = self.0.request.page_token.clone();
2196 let execute = move |token: String| {
2197 let mut builder = self.clone();
2198 builder.0.request = builder.0.request.set_page_token(token);
2199 builder.send()
2200 };
2201 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2202 }
2203
2204 pub fn by_item(
2206 self,
2207 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2208 crate::model::ListCloudControlsResponse,
2209 crate::Error,
2210 > {
2211 use google_cloud_gax::paginator::Paginator;
2212 self.by_page().items()
2213 }
2214
2215 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2219 self.0.request.parent = v.into();
2220 self
2221 }
2222
2223 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2225 self.0.request.page_size = v.into();
2226 self
2227 }
2228
2229 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2231 self.0.request.page_token = v.into();
2232 self
2233 }
2234 }
2235
2236 #[doc(hidden)]
2237 impl crate::RequestBuilder for ListCloudControls {
2238 fn request_options(&mut self) -> &mut crate::RequestOptions {
2239 &mut self.0.options
2240 }
2241 }
2242
2243 #[derive(Clone, Debug)]
2260 pub struct GetCloudControl(RequestBuilder<crate::model::GetCloudControlRequest>);
2261
2262 impl GetCloudControl {
2263 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2264 Self(RequestBuilder::new(stub))
2265 }
2266
2267 pub fn with_request<V: Into<crate::model::GetCloudControlRequest>>(mut self, v: V) -> Self {
2269 self.0.request = v.into();
2270 self
2271 }
2272
2273 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2275 self.0.options = v.into();
2276 self
2277 }
2278
2279 pub async fn send(self) -> Result<crate::model::CloudControl> {
2281 (*self.0.stub)
2282 .get_cloud_control(self.0.request, self.0.options)
2283 .await
2284 .map(crate::Response::into_body)
2285 }
2286
2287 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2291 self.0.request.name = v.into();
2292 self
2293 }
2294
2295 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
2297 self.0.request.major_revision_id = v.into();
2298 self
2299 }
2300 }
2301
2302 #[doc(hidden)]
2303 impl crate::RequestBuilder for GetCloudControl {
2304 fn request_options(&mut self) -> &mut crate::RequestOptions {
2305 &mut self.0.options
2306 }
2307 }
2308
2309 #[derive(Clone, Debug)]
2326 pub struct CreateCloudControl(RequestBuilder<crate::model::CreateCloudControlRequest>);
2327
2328 impl CreateCloudControl {
2329 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2330 Self(RequestBuilder::new(stub))
2331 }
2332
2333 pub fn with_request<V: Into<crate::model::CreateCloudControlRequest>>(
2335 mut self,
2336 v: V,
2337 ) -> Self {
2338 self.0.request = v.into();
2339 self
2340 }
2341
2342 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2344 self.0.options = v.into();
2345 self
2346 }
2347
2348 pub async fn send(self) -> Result<crate::model::CloudControl> {
2350 (*self.0.stub)
2351 .create_cloud_control(self.0.request, self.0.options)
2352 .await
2353 .map(crate::Response::into_body)
2354 }
2355
2356 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2360 self.0.request.parent = v.into();
2361 self
2362 }
2363
2364 pub fn set_cloud_control_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2368 self.0.request.cloud_control_id = v.into();
2369 self
2370 }
2371
2372 pub fn set_cloud_control<T>(mut self, v: T) -> Self
2376 where
2377 T: std::convert::Into<crate::model::CloudControl>,
2378 {
2379 self.0.request.cloud_control = std::option::Option::Some(v.into());
2380 self
2381 }
2382
2383 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
2387 where
2388 T: std::convert::Into<crate::model::CloudControl>,
2389 {
2390 self.0.request.cloud_control = v.map(|x| x.into());
2391 self
2392 }
2393 }
2394
2395 #[doc(hidden)]
2396 impl crate::RequestBuilder for CreateCloudControl {
2397 fn request_options(&mut self) -> &mut crate::RequestOptions {
2398 &mut self.0.options
2399 }
2400 }
2401
2402 #[derive(Clone, Debug)]
2419 pub struct UpdateCloudControl(RequestBuilder<crate::model::UpdateCloudControlRequest>);
2420
2421 impl UpdateCloudControl {
2422 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2423 Self(RequestBuilder::new(stub))
2424 }
2425
2426 pub fn with_request<V: Into<crate::model::UpdateCloudControlRequest>>(
2428 mut self,
2429 v: V,
2430 ) -> Self {
2431 self.0.request = v.into();
2432 self
2433 }
2434
2435 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2437 self.0.options = v.into();
2438 self
2439 }
2440
2441 pub async fn send(self) -> Result<crate::model::CloudControl> {
2443 (*self.0.stub)
2444 .update_cloud_control(self.0.request, self.0.options)
2445 .await
2446 .map(crate::Response::into_body)
2447 }
2448
2449 pub fn set_update_mask<T>(mut self, v: T) -> Self
2451 where
2452 T: std::convert::Into<wkt::FieldMask>,
2453 {
2454 self.0.request.update_mask = std::option::Option::Some(v.into());
2455 self
2456 }
2457
2458 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2460 where
2461 T: std::convert::Into<wkt::FieldMask>,
2462 {
2463 self.0.request.update_mask = v.map(|x| x.into());
2464 self
2465 }
2466
2467 pub fn set_cloud_control<T>(mut self, v: T) -> Self
2471 where
2472 T: std::convert::Into<crate::model::CloudControl>,
2473 {
2474 self.0.request.cloud_control = std::option::Option::Some(v.into());
2475 self
2476 }
2477
2478 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
2482 where
2483 T: std::convert::Into<crate::model::CloudControl>,
2484 {
2485 self.0.request.cloud_control = v.map(|x| x.into());
2486 self
2487 }
2488 }
2489
2490 #[doc(hidden)]
2491 impl crate::RequestBuilder for UpdateCloudControl {
2492 fn request_options(&mut self) -> &mut crate::RequestOptions {
2493 &mut self.0.options
2494 }
2495 }
2496
2497 #[derive(Clone, Debug)]
2514 pub struct DeleteCloudControl(RequestBuilder<crate::model::DeleteCloudControlRequest>);
2515
2516 impl DeleteCloudControl {
2517 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2518 Self(RequestBuilder::new(stub))
2519 }
2520
2521 pub fn with_request<V: Into<crate::model::DeleteCloudControlRequest>>(
2523 mut self,
2524 v: V,
2525 ) -> Self {
2526 self.0.request = v.into();
2527 self
2528 }
2529
2530 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2532 self.0.options = v.into();
2533 self
2534 }
2535
2536 pub async fn send(self) -> Result<()> {
2538 (*self.0.stub)
2539 .delete_cloud_control(self.0.request, self.0.options)
2540 .await
2541 .map(crate::Response::into_body)
2542 }
2543
2544 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2548 self.0.request.name = v.into();
2549 self
2550 }
2551 }
2552
2553 #[doc(hidden)]
2554 impl crate::RequestBuilder for DeleteCloudControl {
2555 fn request_options(&mut self) -> &mut crate::RequestOptions {
2556 &mut self.0.options
2557 }
2558 }
2559
2560 #[derive(Clone, Debug)]
2581 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2582
2583 impl ListLocations {
2584 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2585 Self(RequestBuilder::new(stub))
2586 }
2587
2588 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2590 mut self,
2591 v: V,
2592 ) -> Self {
2593 self.0.request = v.into();
2594 self
2595 }
2596
2597 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2599 self.0.options = v.into();
2600 self
2601 }
2602
2603 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2605 (*self.0.stub)
2606 .list_locations(self.0.request, self.0.options)
2607 .await
2608 .map(crate::Response::into_body)
2609 }
2610
2611 pub fn by_page(
2613 self,
2614 ) -> impl google_cloud_gax::paginator::Paginator<
2615 google_cloud_location::model::ListLocationsResponse,
2616 crate::Error,
2617 > {
2618 use std::clone::Clone;
2619 let token = self.0.request.page_token.clone();
2620 let execute = move |token: String| {
2621 let mut builder = self.clone();
2622 builder.0.request = builder.0.request.set_page_token(token);
2623 builder.send()
2624 };
2625 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2626 }
2627
2628 pub fn by_item(
2630 self,
2631 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2632 google_cloud_location::model::ListLocationsResponse,
2633 crate::Error,
2634 > {
2635 use google_cloud_gax::paginator::Paginator;
2636 self.by_page().items()
2637 }
2638
2639 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2641 self.0.request.name = v.into();
2642 self
2643 }
2644
2645 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2647 self.0.request.filter = v.into();
2648 self
2649 }
2650
2651 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2653 self.0.request.page_size = v.into();
2654 self
2655 }
2656
2657 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2659 self.0.request.page_token = v.into();
2660 self
2661 }
2662 }
2663
2664 #[doc(hidden)]
2665 impl crate::RequestBuilder for ListLocations {
2666 fn request_options(&mut self) -> &mut crate::RequestOptions {
2667 &mut self.0.options
2668 }
2669 }
2670
2671 #[derive(Clone, Debug)]
2688 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2689
2690 impl GetLocation {
2691 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2692 Self(RequestBuilder::new(stub))
2693 }
2694
2695 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2697 mut self,
2698 v: V,
2699 ) -> Self {
2700 self.0.request = v.into();
2701 self
2702 }
2703
2704 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2706 self.0.options = v.into();
2707 self
2708 }
2709
2710 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2712 (*self.0.stub)
2713 .get_location(self.0.request, self.0.options)
2714 .await
2715 .map(crate::Response::into_body)
2716 }
2717
2718 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2720 self.0.request.name = v.into();
2721 self
2722 }
2723 }
2724
2725 #[doc(hidden)]
2726 impl crate::RequestBuilder for GetLocation {
2727 fn request_options(&mut self) -> &mut crate::RequestOptions {
2728 &mut self.0.options
2729 }
2730 }
2731
2732 #[derive(Clone, Debug)]
2753 pub struct ListOperations(
2754 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2755 );
2756
2757 impl ListOperations {
2758 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2759 Self(RequestBuilder::new(stub))
2760 }
2761
2762 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2764 mut self,
2765 v: V,
2766 ) -> Self {
2767 self.0.request = v.into();
2768 self
2769 }
2770
2771 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2773 self.0.options = v.into();
2774 self
2775 }
2776
2777 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2779 (*self.0.stub)
2780 .list_operations(self.0.request, self.0.options)
2781 .await
2782 .map(crate::Response::into_body)
2783 }
2784
2785 pub fn by_page(
2787 self,
2788 ) -> impl google_cloud_gax::paginator::Paginator<
2789 google_cloud_longrunning::model::ListOperationsResponse,
2790 crate::Error,
2791 > {
2792 use std::clone::Clone;
2793 let token = self.0.request.page_token.clone();
2794 let execute = move |token: String| {
2795 let mut builder = self.clone();
2796 builder.0.request = builder.0.request.set_page_token(token);
2797 builder.send()
2798 };
2799 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2800 }
2801
2802 pub fn by_item(
2804 self,
2805 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2806 google_cloud_longrunning::model::ListOperationsResponse,
2807 crate::Error,
2808 > {
2809 use google_cloud_gax::paginator::Paginator;
2810 self.by_page().items()
2811 }
2812
2813 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2815 self.0.request.name = v.into();
2816 self
2817 }
2818
2819 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2821 self.0.request.filter = v.into();
2822 self
2823 }
2824
2825 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2827 self.0.request.page_size = v.into();
2828 self
2829 }
2830
2831 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2833 self.0.request.page_token = v.into();
2834 self
2835 }
2836
2837 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2839 self.0.request.return_partial_success = v.into();
2840 self
2841 }
2842 }
2843
2844 #[doc(hidden)]
2845 impl crate::RequestBuilder for ListOperations {
2846 fn request_options(&mut self) -> &mut crate::RequestOptions {
2847 &mut self.0.options
2848 }
2849 }
2850
2851 #[derive(Clone, Debug)]
2868 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2869
2870 impl GetOperation {
2871 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2872 Self(RequestBuilder::new(stub))
2873 }
2874
2875 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2877 mut self,
2878 v: V,
2879 ) -> Self {
2880 self.0.request = v.into();
2881 self
2882 }
2883
2884 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2886 self.0.options = v.into();
2887 self
2888 }
2889
2890 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2892 (*self.0.stub)
2893 .get_operation(self.0.request, self.0.options)
2894 .await
2895 .map(crate::Response::into_body)
2896 }
2897
2898 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2900 self.0.request.name = v.into();
2901 self
2902 }
2903 }
2904
2905 #[doc(hidden)]
2906 impl crate::RequestBuilder for GetOperation {
2907 fn request_options(&mut self) -> &mut crate::RequestOptions {
2908 &mut self.0.options
2909 }
2910 }
2911
2912 #[derive(Clone, Debug)]
2929 pub struct DeleteOperation(
2930 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2931 );
2932
2933 impl DeleteOperation {
2934 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2935 Self(RequestBuilder::new(stub))
2936 }
2937
2938 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2940 mut self,
2941 v: V,
2942 ) -> Self {
2943 self.0.request = v.into();
2944 self
2945 }
2946
2947 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2949 self.0.options = v.into();
2950 self
2951 }
2952
2953 pub async fn send(self) -> Result<()> {
2955 (*self.0.stub)
2956 .delete_operation(self.0.request, self.0.options)
2957 .await
2958 .map(crate::Response::into_body)
2959 }
2960
2961 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2963 self.0.request.name = v.into();
2964 self
2965 }
2966 }
2967
2968 #[doc(hidden)]
2969 impl crate::RequestBuilder for DeleteOperation {
2970 fn request_options(&mut self) -> &mut crate::RequestOptions {
2971 &mut self.0.options
2972 }
2973 }
2974
2975 #[derive(Clone, Debug)]
2992 pub struct CancelOperation(
2993 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2994 );
2995
2996 impl CancelOperation {
2997 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2998 Self(RequestBuilder::new(stub))
2999 }
3000
3001 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3003 mut self,
3004 v: V,
3005 ) -> Self {
3006 self.0.request = v.into();
3007 self
3008 }
3009
3010 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3012 self.0.options = v.into();
3013 self
3014 }
3015
3016 pub async fn send(self) -> Result<()> {
3018 (*self.0.stub)
3019 .cancel_operation(self.0.request, self.0.options)
3020 .await
3021 .map(crate::Response::into_body)
3022 }
3023
3024 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3026 self.0.request.name = v.into();
3027 self
3028 }
3029 }
3030
3031 #[doc(hidden)]
3032 impl crate::RequestBuilder for CancelOperation {
3033 fn request_options(&mut self) -> &mut crate::RequestOptions {
3034 &mut self.0.options
3035 }
3036 }
3037}
3038
3039pub mod deployment {
3041 use crate::Result;
3042
3043 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3057
3058 pub(crate) mod client {
3059 use super::super::super::client::Deployment;
3060 pub struct Factory;
3061 impl crate::ClientFactory for Factory {
3062 type Client = Deployment;
3063 type Credentials = gaxi::options::Credentials;
3064 async fn build(
3065 self,
3066 config: gaxi::options::ClientConfig,
3067 ) -> crate::ClientBuilderResult<Self::Client> {
3068 Self::Client::new(config).await
3069 }
3070 }
3071 }
3072
3073 #[derive(Clone, Debug)]
3075 pub(crate) struct RequestBuilder<R: std::default::Default> {
3076 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3077 request: R,
3078 options: crate::RequestOptions,
3079 }
3080
3081 impl<R> RequestBuilder<R>
3082 where
3083 R: std::default::Default,
3084 {
3085 pub(crate) fn new(
3086 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3087 ) -> Self {
3088 Self {
3089 stub,
3090 request: R::default(),
3091 options: crate::RequestOptions::default(),
3092 }
3093 }
3094 }
3095
3096 #[derive(Clone, Debug)]
3114 pub struct CreateFrameworkDeployment(
3115 RequestBuilder<crate::model::CreateFrameworkDeploymentRequest>,
3116 );
3117
3118 impl CreateFrameworkDeployment {
3119 pub(crate) fn new(
3120 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3121 ) -> Self {
3122 Self(RequestBuilder::new(stub))
3123 }
3124
3125 pub fn with_request<V: Into<crate::model::CreateFrameworkDeploymentRequest>>(
3127 mut self,
3128 v: V,
3129 ) -> Self {
3130 self.0.request = v.into();
3131 self
3132 }
3133
3134 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3136 self.0.options = v.into();
3137 self
3138 }
3139
3140 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3147 (*self.0.stub)
3148 .create_framework_deployment(self.0.request, self.0.options)
3149 .await
3150 .map(crate::Response::into_body)
3151 }
3152
3153 pub fn poller(
3155 self,
3156 ) -> impl google_cloud_lro::Poller<
3157 crate::model::FrameworkDeployment,
3158 crate::model::OperationMetadata,
3159 > {
3160 type Operation = google_cloud_lro::internal::Operation<
3161 crate::model::FrameworkDeployment,
3162 crate::model::OperationMetadata,
3163 >;
3164 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3165 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3166
3167 let stub = self.0.stub.clone();
3168 let mut options = self.0.options.clone();
3169 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3170 let query = move |name| {
3171 let stub = stub.clone();
3172 let options = options.clone();
3173 async {
3174 let op = GetOperation::new(stub)
3175 .set_name(name)
3176 .with_options(options)
3177 .send()
3178 .await?;
3179 Ok(Operation::new(op))
3180 }
3181 };
3182
3183 let start = move || async {
3184 let op = self.send().await?;
3185 Ok(Operation::new(op))
3186 };
3187
3188 google_cloud_lro::internal::new_poller(
3189 polling_error_policy,
3190 polling_backoff_policy,
3191 start,
3192 query,
3193 )
3194 }
3195
3196 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3200 self.0.request.parent = v.into();
3201 self
3202 }
3203
3204 pub fn set_framework_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3206 self.0.request.framework_deployment_id = v.into();
3207 self
3208 }
3209
3210 pub fn set_framework_deployment<T>(mut self, v: T) -> Self
3214 where
3215 T: std::convert::Into<crate::model::FrameworkDeployment>,
3216 {
3217 self.0.request.framework_deployment = std::option::Option::Some(v.into());
3218 self
3219 }
3220
3221 pub fn set_or_clear_framework_deployment<T>(mut self, v: std::option::Option<T>) -> Self
3225 where
3226 T: std::convert::Into<crate::model::FrameworkDeployment>,
3227 {
3228 self.0.request.framework_deployment = v.map(|x| x.into());
3229 self
3230 }
3231 }
3232
3233 #[doc(hidden)]
3234 impl crate::RequestBuilder for CreateFrameworkDeployment {
3235 fn request_options(&mut self) -> &mut crate::RequestOptions {
3236 &mut self.0.options
3237 }
3238 }
3239
3240 #[derive(Clone, Debug)]
3258 pub struct DeleteFrameworkDeployment(
3259 RequestBuilder<crate::model::DeleteFrameworkDeploymentRequest>,
3260 );
3261
3262 impl DeleteFrameworkDeployment {
3263 pub(crate) fn new(
3264 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3265 ) -> Self {
3266 Self(RequestBuilder::new(stub))
3267 }
3268
3269 pub fn with_request<V: Into<crate::model::DeleteFrameworkDeploymentRequest>>(
3271 mut self,
3272 v: V,
3273 ) -> Self {
3274 self.0.request = v.into();
3275 self
3276 }
3277
3278 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3280 self.0.options = v.into();
3281 self
3282 }
3283
3284 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3291 (*self.0.stub)
3292 .delete_framework_deployment(self.0.request, self.0.options)
3293 .await
3294 .map(crate::Response::into_body)
3295 }
3296
3297 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3299 type Operation =
3300 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3301 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3302 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3303
3304 let stub = self.0.stub.clone();
3305 let mut options = self.0.options.clone();
3306 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3307 let query = move |name| {
3308 let stub = stub.clone();
3309 let options = options.clone();
3310 async {
3311 let op = GetOperation::new(stub)
3312 .set_name(name)
3313 .with_options(options)
3314 .send()
3315 .await?;
3316 Ok(Operation::new(op))
3317 }
3318 };
3319
3320 let start = move || async {
3321 let op = self.send().await?;
3322 Ok(Operation::new(op))
3323 };
3324
3325 google_cloud_lro::internal::new_unit_response_poller(
3326 polling_error_policy,
3327 polling_backoff_policy,
3328 start,
3329 query,
3330 )
3331 }
3332
3333 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3337 self.0.request.name = v.into();
3338 self
3339 }
3340
3341 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3343 self.0.request.etag = v.into();
3344 self
3345 }
3346 }
3347
3348 #[doc(hidden)]
3349 impl crate::RequestBuilder for DeleteFrameworkDeployment {
3350 fn request_options(&mut self) -> &mut crate::RequestOptions {
3351 &mut self.0.options
3352 }
3353 }
3354
3355 #[derive(Clone, Debug)]
3372 pub struct GetFrameworkDeployment(RequestBuilder<crate::model::GetFrameworkDeploymentRequest>);
3373
3374 impl GetFrameworkDeployment {
3375 pub(crate) fn new(
3376 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3377 ) -> Self {
3378 Self(RequestBuilder::new(stub))
3379 }
3380
3381 pub fn with_request<V: Into<crate::model::GetFrameworkDeploymentRequest>>(
3383 mut self,
3384 v: V,
3385 ) -> Self {
3386 self.0.request = v.into();
3387 self
3388 }
3389
3390 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3392 self.0.options = v.into();
3393 self
3394 }
3395
3396 pub async fn send(self) -> Result<crate::model::FrameworkDeployment> {
3398 (*self.0.stub)
3399 .get_framework_deployment(self.0.request, self.0.options)
3400 .await
3401 .map(crate::Response::into_body)
3402 }
3403
3404 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3408 self.0.request.name = v.into();
3409 self
3410 }
3411 }
3412
3413 #[doc(hidden)]
3414 impl crate::RequestBuilder for GetFrameworkDeployment {
3415 fn request_options(&mut self) -> &mut crate::RequestOptions {
3416 &mut self.0.options
3417 }
3418 }
3419
3420 #[derive(Clone, Debug)]
3441 pub struct ListFrameworkDeployments(
3442 RequestBuilder<crate::model::ListFrameworkDeploymentsRequest>,
3443 );
3444
3445 impl ListFrameworkDeployments {
3446 pub(crate) fn new(
3447 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3448 ) -> Self {
3449 Self(RequestBuilder::new(stub))
3450 }
3451
3452 pub fn with_request<V: Into<crate::model::ListFrameworkDeploymentsRequest>>(
3454 mut self,
3455 v: V,
3456 ) -> Self {
3457 self.0.request = v.into();
3458 self
3459 }
3460
3461 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3463 self.0.options = v.into();
3464 self
3465 }
3466
3467 pub async fn send(self) -> Result<crate::model::ListFrameworkDeploymentsResponse> {
3469 (*self.0.stub)
3470 .list_framework_deployments(self.0.request, self.0.options)
3471 .await
3472 .map(crate::Response::into_body)
3473 }
3474
3475 pub fn by_page(
3477 self,
3478 ) -> impl google_cloud_gax::paginator::Paginator<
3479 crate::model::ListFrameworkDeploymentsResponse,
3480 crate::Error,
3481 > {
3482 use std::clone::Clone;
3483 let token = self.0.request.page_token.clone();
3484 let execute = move |token: String| {
3485 let mut builder = self.clone();
3486 builder.0.request = builder.0.request.set_page_token(token);
3487 builder.send()
3488 };
3489 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3490 }
3491
3492 pub fn by_item(
3494 self,
3495 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3496 crate::model::ListFrameworkDeploymentsResponse,
3497 crate::Error,
3498 > {
3499 use google_cloud_gax::paginator::Paginator;
3500 self.by_page().items()
3501 }
3502
3503 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3507 self.0.request.parent = v.into();
3508 self
3509 }
3510
3511 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3513 self.0.request.page_size = v.into();
3514 self
3515 }
3516
3517 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3519 self.0.request.page_token = v.into();
3520 self
3521 }
3522
3523 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3525 self.0.request.filter = v.into();
3526 self
3527 }
3528
3529 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3531 self.0.request.order_by = v.into();
3532 self
3533 }
3534 }
3535
3536 #[doc(hidden)]
3537 impl crate::RequestBuilder for ListFrameworkDeployments {
3538 fn request_options(&mut self) -> &mut crate::RequestOptions {
3539 &mut self.0.options
3540 }
3541 }
3542
3543 #[derive(Clone, Debug)]
3560 pub struct GetCloudControlDeployment(
3561 RequestBuilder<crate::model::GetCloudControlDeploymentRequest>,
3562 );
3563
3564 impl GetCloudControlDeployment {
3565 pub(crate) fn new(
3566 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3567 ) -> Self {
3568 Self(RequestBuilder::new(stub))
3569 }
3570
3571 pub fn with_request<V: Into<crate::model::GetCloudControlDeploymentRequest>>(
3573 mut self,
3574 v: V,
3575 ) -> Self {
3576 self.0.request = v.into();
3577 self
3578 }
3579
3580 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3582 self.0.options = v.into();
3583 self
3584 }
3585
3586 pub async fn send(self) -> Result<crate::model::CloudControlDeployment> {
3588 (*self.0.stub)
3589 .get_cloud_control_deployment(self.0.request, self.0.options)
3590 .await
3591 .map(crate::Response::into_body)
3592 }
3593
3594 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3598 self.0.request.name = v.into();
3599 self
3600 }
3601 }
3602
3603 #[doc(hidden)]
3604 impl crate::RequestBuilder for GetCloudControlDeployment {
3605 fn request_options(&mut self) -> &mut crate::RequestOptions {
3606 &mut self.0.options
3607 }
3608 }
3609
3610 #[derive(Clone, Debug)]
3631 pub struct ListCloudControlDeployments(
3632 RequestBuilder<crate::model::ListCloudControlDeploymentsRequest>,
3633 );
3634
3635 impl ListCloudControlDeployments {
3636 pub(crate) fn new(
3637 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3638 ) -> Self {
3639 Self(RequestBuilder::new(stub))
3640 }
3641
3642 pub fn with_request<V: Into<crate::model::ListCloudControlDeploymentsRequest>>(
3644 mut self,
3645 v: V,
3646 ) -> Self {
3647 self.0.request = v.into();
3648 self
3649 }
3650
3651 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3653 self.0.options = v.into();
3654 self
3655 }
3656
3657 pub async fn send(self) -> Result<crate::model::ListCloudControlDeploymentsResponse> {
3659 (*self.0.stub)
3660 .list_cloud_control_deployments(self.0.request, self.0.options)
3661 .await
3662 .map(crate::Response::into_body)
3663 }
3664
3665 pub fn by_page(
3667 self,
3668 ) -> impl google_cloud_gax::paginator::Paginator<
3669 crate::model::ListCloudControlDeploymentsResponse,
3670 crate::Error,
3671 > {
3672 use std::clone::Clone;
3673 let token = self.0.request.page_token.clone();
3674 let execute = move |token: String| {
3675 let mut builder = self.clone();
3676 builder.0.request = builder.0.request.set_page_token(token);
3677 builder.send()
3678 };
3679 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3680 }
3681
3682 pub fn by_item(
3684 self,
3685 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3686 crate::model::ListCloudControlDeploymentsResponse,
3687 crate::Error,
3688 > {
3689 use google_cloud_gax::paginator::Paginator;
3690 self.by_page().items()
3691 }
3692
3693 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3697 self.0.request.parent = v.into();
3698 self
3699 }
3700
3701 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3703 self.0.request.page_size = v.into();
3704 self
3705 }
3706
3707 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3709 self.0.request.page_token = v.into();
3710 self
3711 }
3712
3713 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3715 self.0.request.filter = v.into();
3716 self
3717 }
3718
3719 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3721 self.0.request.order_by = v.into();
3722 self
3723 }
3724 }
3725
3726 #[doc(hidden)]
3727 impl crate::RequestBuilder for ListCloudControlDeployments {
3728 fn request_options(&mut self) -> &mut crate::RequestOptions {
3729 &mut self.0.options
3730 }
3731 }
3732
3733 #[derive(Clone, Debug)]
3754 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3755
3756 impl ListLocations {
3757 pub(crate) fn new(
3758 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3759 ) -> Self {
3760 Self(RequestBuilder::new(stub))
3761 }
3762
3763 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3765 mut self,
3766 v: V,
3767 ) -> Self {
3768 self.0.request = v.into();
3769 self
3770 }
3771
3772 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3774 self.0.options = v.into();
3775 self
3776 }
3777
3778 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3780 (*self.0.stub)
3781 .list_locations(self.0.request, self.0.options)
3782 .await
3783 .map(crate::Response::into_body)
3784 }
3785
3786 pub fn by_page(
3788 self,
3789 ) -> impl google_cloud_gax::paginator::Paginator<
3790 google_cloud_location::model::ListLocationsResponse,
3791 crate::Error,
3792 > {
3793 use std::clone::Clone;
3794 let token = self.0.request.page_token.clone();
3795 let execute = move |token: String| {
3796 let mut builder = self.clone();
3797 builder.0.request = builder.0.request.set_page_token(token);
3798 builder.send()
3799 };
3800 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3801 }
3802
3803 pub fn by_item(
3805 self,
3806 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3807 google_cloud_location::model::ListLocationsResponse,
3808 crate::Error,
3809 > {
3810 use google_cloud_gax::paginator::Paginator;
3811 self.by_page().items()
3812 }
3813
3814 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3816 self.0.request.name = v.into();
3817 self
3818 }
3819
3820 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3822 self.0.request.filter = v.into();
3823 self
3824 }
3825
3826 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3828 self.0.request.page_size = v.into();
3829 self
3830 }
3831
3832 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3834 self.0.request.page_token = v.into();
3835 self
3836 }
3837 }
3838
3839 #[doc(hidden)]
3840 impl crate::RequestBuilder for ListLocations {
3841 fn request_options(&mut self) -> &mut crate::RequestOptions {
3842 &mut self.0.options
3843 }
3844 }
3845
3846 #[derive(Clone, Debug)]
3863 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3864
3865 impl GetLocation {
3866 pub(crate) fn new(
3867 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3868 ) -> Self {
3869 Self(RequestBuilder::new(stub))
3870 }
3871
3872 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3874 mut self,
3875 v: V,
3876 ) -> Self {
3877 self.0.request = v.into();
3878 self
3879 }
3880
3881 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3883 self.0.options = v.into();
3884 self
3885 }
3886
3887 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3889 (*self.0.stub)
3890 .get_location(self.0.request, self.0.options)
3891 .await
3892 .map(crate::Response::into_body)
3893 }
3894
3895 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3897 self.0.request.name = v.into();
3898 self
3899 }
3900 }
3901
3902 #[doc(hidden)]
3903 impl crate::RequestBuilder for GetLocation {
3904 fn request_options(&mut self) -> &mut crate::RequestOptions {
3905 &mut self.0.options
3906 }
3907 }
3908
3909 #[derive(Clone, Debug)]
3930 pub struct ListOperations(
3931 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3932 );
3933
3934 impl ListOperations {
3935 pub(crate) fn new(
3936 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3937 ) -> Self {
3938 Self(RequestBuilder::new(stub))
3939 }
3940
3941 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3943 mut self,
3944 v: V,
3945 ) -> Self {
3946 self.0.request = v.into();
3947 self
3948 }
3949
3950 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3952 self.0.options = v.into();
3953 self
3954 }
3955
3956 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3958 (*self.0.stub)
3959 .list_operations(self.0.request, self.0.options)
3960 .await
3961 .map(crate::Response::into_body)
3962 }
3963
3964 pub fn by_page(
3966 self,
3967 ) -> impl google_cloud_gax::paginator::Paginator<
3968 google_cloud_longrunning::model::ListOperationsResponse,
3969 crate::Error,
3970 > {
3971 use std::clone::Clone;
3972 let token = self.0.request.page_token.clone();
3973 let execute = move |token: String| {
3974 let mut builder = self.clone();
3975 builder.0.request = builder.0.request.set_page_token(token);
3976 builder.send()
3977 };
3978 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3979 }
3980
3981 pub fn by_item(
3983 self,
3984 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3985 google_cloud_longrunning::model::ListOperationsResponse,
3986 crate::Error,
3987 > {
3988 use google_cloud_gax::paginator::Paginator;
3989 self.by_page().items()
3990 }
3991
3992 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3994 self.0.request.name = v.into();
3995 self
3996 }
3997
3998 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4000 self.0.request.filter = v.into();
4001 self
4002 }
4003
4004 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4006 self.0.request.page_size = v.into();
4007 self
4008 }
4009
4010 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4012 self.0.request.page_token = v.into();
4013 self
4014 }
4015
4016 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4018 self.0.request.return_partial_success = v.into();
4019 self
4020 }
4021 }
4022
4023 #[doc(hidden)]
4024 impl crate::RequestBuilder for ListOperations {
4025 fn request_options(&mut self) -> &mut crate::RequestOptions {
4026 &mut self.0.options
4027 }
4028 }
4029
4030 #[derive(Clone, Debug)]
4047 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4048
4049 impl GetOperation {
4050 pub(crate) fn new(
4051 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
4052 ) -> Self {
4053 Self(RequestBuilder::new(stub))
4054 }
4055
4056 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4058 mut self,
4059 v: V,
4060 ) -> Self {
4061 self.0.request = v.into();
4062 self
4063 }
4064
4065 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4067 self.0.options = v.into();
4068 self
4069 }
4070
4071 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4073 (*self.0.stub)
4074 .get_operation(self.0.request, self.0.options)
4075 .await
4076 .map(crate::Response::into_body)
4077 }
4078
4079 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4081 self.0.request.name = v.into();
4082 self
4083 }
4084 }
4085
4086 #[doc(hidden)]
4087 impl crate::RequestBuilder for GetOperation {
4088 fn request_options(&mut self) -> &mut crate::RequestOptions {
4089 &mut self.0.options
4090 }
4091 }
4092
4093 #[derive(Clone, Debug)]
4110 pub struct DeleteOperation(
4111 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4112 );
4113
4114 impl DeleteOperation {
4115 pub(crate) fn new(
4116 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
4117 ) -> Self {
4118 Self(RequestBuilder::new(stub))
4119 }
4120
4121 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4123 mut self,
4124 v: V,
4125 ) -> Self {
4126 self.0.request = v.into();
4127 self
4128 }
4129
4130 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4132 self.0.options = v.into();
4133 self
4134 }
4135
4136 pub async fn send(self) -> Result<()> {
4138 (*self.0.stub)
4139 .delete_operation(self.0.request, self.0.options)
4140 .await
4141 .map(crate::Response::into_body)
4142 }
4143
4144 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4146 self.0.request.name = v.into();
4147 self
4148 }
4149 }
4150
4151 #[doc(hidden)]
4152 impl crate::RequestBuilder for DeleteOperation {
4153 fn request_options(&mut self) -> &mut crate::RequestOptions {
4154 &mut self.0.options
4155 }
4156 }
4157
4158 #[derive(Clone, Debug)]
4175 pub struct CancelOperation(
4176 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4177 );
4178
4179 impl CancelOperation {
4180 pub(crate) fn new(
4181 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
4182 ) -> Self {
4183 Self(RequestBuilder::new(stub))
4184 }
4185
4186 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4188 mut self,
4189 v: V,
4190 ) -> Self {
4191 self.0.request = v.into();
4192 self
4193 }
4194
4195 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4197 self.0.options = v.into();
4198 self
4199 }
4200
4201 pub async fn send(self) -> Result<()> {
4203 (*self.0.stub)
4204 .cancel_operation(self.0.request, self.0.options)
4205 .await
4206 .map(crate::Response::into_body)
4207 }
4208
4209 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4211 self.0.request.name = v.into();
4212 self
4213 }
4214 }
4215
4216 #[doc(hidden)]
4217 impl crate::RequestBuilder for CancelOperation {
4218 fn request_options(&mut self) -> &mut crate::RequestOptions {
4219 &mut self.0.options
4220 }
4221 }
4222}
4223
4224pub mod monitoring {
4226 use crate::Result;
4227
4228 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4242
4243 pub(crate) mod client {
4244 use super::super::super::client::Monitoring;
4245 pub struct Factory;
4246 impl crate::ClientFactory for Factory {
4247 type Client = Monitoring;
4248 type Credentials = gaxi::options::Credentials;
4249 async fn build(
4250 self,
4251 config: gaxi::options::ClientConfig,
4252 ) -> crate::ClientBuilderResult<Self::Client> {
4253 Self::Client::new(config).await
4254 }
4255 }
4256 }
4257
4258 #[derive(Clone, Debug)]
4260 pub(crate) struct RequestBuilder<R: std::default::Default> {
4261 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4262 request: R,
4263 options: crate::RequestOptions,
4264 }
4265
4266 impl<R> RequestBuilder<R>
4267 where
4268 R: std::default::Default,
4269 {
4270 pub(crate) fn new(
4271 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4272 ) -> Self {
4273 Self {
4274 stub,
4275 request: R::default(),
4276 options: crate::RequestOptions::default(),
4277 }
4278 }
4279 }
4280
4281 #[derive(Clone, Debug)]
4302 pub struct ListFrameworkComplianceSummaries(
4303 RequestBuilder<crate::model::ListFrameworkComplianceSummariesRequest>,
4304 );
4305
4306 impl ListFrameworkComplianceSummaries {
4307 pub(crate) fn new(
4308 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4309 ) -> Self {
4310 Self(RequestBuilder::new(stub))
4311 }
4312
4313 pub fn with_request<V: Into<crate::model::ListFrameworkComplianceSummariesRequest>>(
4315 mut self,
4316 v: V,
4317 ) -> Self {
4318 self.0.request = v.into();
4319 self
4320 }
4321
4322 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4324 self.0.options = v.into();
4325 self
4326 }
4327
4328 pub async fn send(self) -> Result<crate::model::ListFrameworkComplianceSummariesResponse> {
4330 (*self.0.stub)
4331 .list_framework_compliance_summaries(self.0.request, self.0.options)
4332 .await
4333 .map(crate::Response::into_body)
4334 }
4335
4336 pub fn by_page(
4338 self,
4339 ) -> impl google_cloud_gax::paginator::Paginator<
4340 crate::model::ListFrameworkComplianceSummariesResponse,
4341 crate::Error,
4342 > {
4343 use std::clone::Clone;
4344 let token = self.0.request.page_token.clone();
4345 let execute = move |token: String| {
4346 let mut builder = self.clone();
4347 builder.0.request = builder.0.request.set_page_token(token);
4348 builder.send()
4349 };
4350 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4351 }
4352
4353 pub fn by_item(
4355 self,
4356 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4357 crate::model::ListFrameworkComplianceSummariesResponse,
4358 crate::Error,
4359 > {
4360 use google_cloud_gax::paginator::Paginator;
4361 self.by_page().items()
4362 }
4363
4364 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4368 self.0.request.parent = v.into();
4369 self
4370 }
4371
4372 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4374 self.0.request.page_size = v.into();
4375 self
4376 }
4377
4378 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4380 self.0.request.page_token = v.into();
4381 self
4382 }
4383
4384 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4386 self.0.request.filter = v.into();
4387 self
4388 }
4389
4390 pub fn set_view<T: Into<crate::model::FrameworkComplianceSummaryView>>(
4392 mut self,
4393 v: T,
4394 ) -> Self {
4395 self.0.request.view = v.into();
4396 self
4397 }
4398 }
4399
4400 #[doc(hidden)]
4401 impl crate::RequestBuilder for ListFrameworkComplianceSummaries {
4402 fn request_options(&mut self) -> &mut crate::RequestOptions {
4403 &mut self.0.options
4404 }
4405 }
4406
4407 #[derive(Clone, Debug)]
4428 pub struct ListFindingSummaries(RequestBuilder<crate::model::ListFindingSummariesRequest>);
4429
4430 impl ListFindingSummaries {
4431 pub(crate) fn new(
4432 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4433 ) -> Self {
4434 Self(RequestBuilder::new(stub))
4435 }
4436
4437 pub fn with_request<V: Into<crate::model::ListFindingSummariesRequest>>(
4439 mut self,
4440 v: V,
4441 ) -> Self {
4442 self.0.request = v.into();
4443 self
4444 }
4445
4446 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4448 self.0.options = v.into();
4449 self
4450 }
4451
4452 pub async fn send(self) -> Result<crate::model::ListFindingSummariesResponse> {
4454 (*self.0.stub)
4455 .list_finding_summaries(self.0.request, self.0.options)
4456 .await
4457 .map(crate::Response::into_body)
4458 }
4459
4460 pub fn by_page(
4462 self,
4463 ) -> impl google_cloud_gax::paginator::Paginator<
4464 crate::model::ListFindingSummariesResponse,
4465 crate::Error,
4466 > {
4467 use std::clone::Clone;
4468 let token = self.0.request.page_token.clone();
4469 let execute = move |token: String| {
4470 let mut builder = self.clone();
4471 builder.0.request = builder.0.request.set_page_token(token);
4472 builder.send()
4473 };
4474 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4475 }
4476
4477 pub fn by_item(
4479 self,
4480 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4481 crate::model::ListFindingSummariesResponse,
4482 crate::Error,
4483 > {
4484 use google_cloud_gax::paginator::Paginator;
4485 self.by_page().items()
4486 }
4487
4488 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4492 self.0.request.parent = v.into();
4493 self
4494 }
4495
4496 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4498 self.0.request.page_size = v.into();
4499 self
4500 }
4501
4502 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4504 self.0.request.page_token = v.into();
4505 self
4506 }
4507
4508 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4510 self.0.request.filter = v.into();
4511 self
4512 }
4513
4514 #[deprecated]
4516 pub fn set_end_time<T>(mut self, v: T) -> Self
4517 where
4518 T: std::convert::Into<wkt::Timestamp>,
4519 {
4520 self.0.request.end_time = std::option::Option::Some(v.into());
4521 self
4522 }
4523
4524 #[deprecated]
4526 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4527 where
4528 T: std::convert::Into<wkt::Timestamp>,
4529 {
4530 self.0.request.end_time = v.map(|x| x.into());
4531 self
4532 }
4533 }
4534
4535 #[doc(hidden)]
4536 impl crate::RequestBuilder for ListFindingSummaries {
4537 fn request_options(&mut self) -> &mut crate::RequestOptions {
4538 &mut self.0.options
4539 }
4540 }
4541
4542 #[derive(Clone, Debug)]
4559 pub struct FetchFrameworkComplianceReport(
4560 RequestBuilder<crate::model::FetchFrameworkComplianceReportRequest>,
4561 );
4562
4563 impl FetchFrameworkComplianceReport {
4564 pub(crate) fn new(
4565 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4566 ) -> Self {
4567 Self(RequestBuilder::new(stub))
4568 }
4569
4570 pub fn with_request<V: Into<crate::model::FetchFrameworkComplianceReportRequest>>(
4572 mut self,
4573 v: V,
4574 ) -> Self {
4575 self.0.request = v.into();
4576 self
4577 }
4578
4579 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4581 self.0.options = v.into();
4582 self
4583 }
4584
4585 pub async fn send(self) -> Result<crate::model::FrameworkComplianceReport> {
4587 (*self.0.stub)
4588 .fetch_framework_compliance_report(self.0.request, self.0.options)
4589 .await
4590 .map(crate::Response::into_body)
4591 }
4592
4593 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4597 self.0.request.name = v.into();
4598 self
4599 }
4600
4601 pub fn set_end_time<T>(mut self, v: T) -> Self
4603 where
4604 T: std::convert::Into<wkt::Timestamp>,
4605 {
4606 self.0.request.end_time = std::option::Option::Some(v.into());
4607 self
4608 }
4609
4610 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4612 where
4613 T: std::convert::Into<wkt::Timestamp>,
4614 {
4615 self.0.request.end_time = v.map(|x| x.into());
4616 self
4617 }
4618
4619 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4621 self.0.request.filter = v.into();
4622 self
4623 }
4624 }
4625
4626 #[doc(hidden)]
4627 impl crate::RequestBuilder for FetchFrameworkComplianceReport {
4628 fn request_options(&mut self) -> &mut crate::RequestOptions {
4629 &mut self.0.options
4630 }
4631 }
4632
4633 #[derive(Clone, Debug)]
4654 pub struct ListControlComplianceSummaries(
4655 RequestBuilder<crate::model::ListControlComplianceSummariesRequest>,
4656 );
4657
4658 impl ListControlComplianceSummaries {
4659 pub(crate) fn new(
4660 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4661 ) -> Self {
4662 Self(RequestBuilder::new(stub))
4663 }
4664
4665 pub fn with_request<V: Into<crate::model::ListControlComplianceSummariesRequest>>(
4667 mut self,
4668 v: V,
4669 ) -> Self {
4670 self.0.request = v.into();
4671 self
4672 }
4673
4674 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4676 self.0.options = v.into();
4677 self
4678 }
4679
4680 pub async fn send(self) -> Result<crate::model::ListControlComplianceSummariesResponse> {
4682 (*self.0.stub)
4683 .list_control_compliance_summaries(self.0.request, self.0.options)
4684 .await
4685 .map(crate::Response::into_body)
4686 }
4687
4688 pub fn by_page(
4690 self,
4691 ) -> impl google_cloud_gax::paginator::Paginator<
4692 crate::model::ListControlComplianceSummariesResponse,
4693 crate::Error,
4694 > {
4695 use std::clone::Clone;
4696 let token = self.0.request.page_token.clone();
4697 let execute = move |token: String| {
4698 let mut builder = self.clone();
4699 builder.0.request = builder.0.request.set_page_token(token);
4700 builder.send()
4701 };
4702 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4703 }
4704
4705 pub fn by_item(
4707 self,
4708 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4709 crate::model::ListControlComplianceSummariesResponse,
4710 crate::Error,
4711 > {
4712 use google_cloud_gax::paginator::Paginator;
4713 self.by_page().items()
4714 }
4715
4716 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4720 self.0.request.parent = v.into();
4721 self
4722 }
4723
4724 #[deprecated]
4726 pub fn set_end_time<T>(mut self, v: T) -> Self
4727 where
4728 T: std::convert::Into<wkt::Timestamp>,
4729 {
4730 self.0.request.end_time = std::option::Option::Some(v.into());
4731 self
4732 }
4733
4734 #[deprecated]
4736 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4737 where
4738 T: std::convert::Into<wkt::Timestamp>,
4739 {
4740 self.0.request.end_time = v.map(|x| x.into());
4741 self
4742 }
4743
4744 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4746 self.0.request.page_size = v.into();
4747 self
4748 }
4749
4750 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4752 self.0.request.page_token = v.into();
4753 self
4754 }
4755
4756 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4758 self.0.request.filter = v.into();
4759 self
4760 }
4761 }
4762
4763 #[doc(hidden)]
4764 impl crate::RequestBuilder for ListControlComplianceSummaries {
4765 fn request_options(&mut self) -> &mut crate::RequestOptions {
4766 &mut self.0.options
4767 }
4768 }
4769
4770 #[derive(Clone, Debug)]
4787 pub struct AggregateFrameworkComplianceReport(
4788 RequestBuilder<crate::model::AggregateFrameworkComplianceReportRequest>,
4789 );
4790
4791 impl AggregateFrameworkComplianceReport {
4792 pub(crate) fn new(
4793 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4794 ) -> Self {
4795 Self(RequestBuilder::new(stub))
4796 }
4797
4798 pub fn with_request<V: Into<crate::model::AggregateFrameworkComplianceReportRequest>>(
4800 mut self,
4801 v: V,
4802 ) -> Self {
4803 self.0.request = v.into();
4804 self
4805 }
4806
4807 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4809 self.0.options = v.into();
4810 self
4811 }
4812
4813 pub async fn send(
4815 self,
4816 ) -> Result<crate::model::AggregateFrameworkComplianceReportResponse> {
4817 (*self.0.stub)
4818 .aggregate_framework_compliance_report(self.0.request, self.0.options)
4819 .await
4820 .map(crate::Response::into_body)
4821 }
4822
4823 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4827 self.0.request.name = v.into();
4828 self
4829 }
4830
4831 pub fn set_interval<T>(mut self, v: T) -> Self
4833 where
4834 T: std::convert::Into<google_cloud_type::model::Interval>,
4835 {
4836 self.0.request.interval = std::option::Option::Some(v.into());
4837 self
4838 }
4839
4840 pub fn set_or_clear_interval<T>(mut self, v: std::option::Option<T>) -> Self
4842 where
4843 T: std::convert::Into<google_cloud_type::model::Interval>,
4844 {
4845 self.0.request.interval = v.map(|x| x.into());
4846 self
4847 }
4848
4849 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4851 self.0.request.filter = v.into();
4852 self
4853 }
4854 }
4855
4856 #[doc(hidden)]
4857 impl crate::RequestBuilder for AggregateFrameworkComplianceReport {
4858 fn request_options(&mut self) -> &mut crate::RequestOptions {
4859 &mut self.0.options
4860 }
4861 }
4862
4863 #[derive(Clone, Debug)]
4884 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4885
4886 impl ListLocations {
4887 pub(crate) fn new(
4888 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4889 ) -> Self {
4890 Self(RequestBuilder::new(stub))
4891 }
4892
4893 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4895 mut self,
4896 v: V,
4897 ) -> Self {
4898 self.0.request = v.into();
4899 self
4900 }
4901
4902 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4904 self.0.options = v.into();
4905 self
4906 }
4907
4908 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4910 (*self.0.stub)
4911 .list_locations(self.0.request, self.0.options)
4912 .await
4913 .map(crate::Response::into_body)
4914 }
4915
4916 pub fn by_page(
4918 self,
4919 ) -> impl google_cloud_gax::paginator::Paginator<
4920 google_cloud_location::model::ListLocationsResponse,
4921 crate::Error,
4922 > {
4923 use std::clone::Clone;
4924 let token = self.0.request.page_token.clone();
4925 let execute = move |token: String| {
4926 let mut builder = self.clone();
4927 builder.0.request = builder.0.request.set_page_token(token);
4928 builder.send()
4929 };
4930 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4931 }
4932
4933 pub fn by_item(
4935 self,
4936 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4937 google_cloud_location::model::ListLocationsResponse,
4938 crate::Error,
4939 > {
4940 use google_cloud_gax::paginator::Paginator;
4941 self.by_page().items()
4942 }
4943
4944 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4946 self.0.request.name = v.into();
4947 self
4948 }
4949
4950 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4952 self.0.request.filter = v.into();
4953 self
4954 }
4955
4956 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4958 self.0.request.page_size = v.into();
4959 self
4960 }
4961
4962 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4964 self.0.request.page_token = v.into();
4965 self
4966 }
4967 }
4968
4969 #[doc(hidden)]
4970 impl crate::RequestBuilder for ListLocations {
4971 fn request_options(&mut self) -> &mut crate::RequestOptions {
4972 &mut self.0.options
4973 }
4974 }
4975
4976 #[derive(Clone, Debug)]
4993 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4994
4995 impl GetLocation {
4996 pub(crate) fn new(
4997 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4998 ) -> Self {
4999 Self(RequestBuilder::new(stub))
5000 }
5001
5002 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
5004 mut self,
5005 v: V,
5006 ) -> Self {
5007 self.0.request = v.into();
5008 self
5009 }
5010
5011 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5013 self.0.options = v.into();
5014 self
5015 }
5016
5017 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
5019 (*self.0.stub)
5020 .get_location(self.0.request, self.0.options)
5021 .await
5022 .map(crate::Response::into_body)
5023 }
5024
5025 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5027 self.0.request.name = v.into();
5028 self
5029 }
5030 }
5031
5032 #[doc(hidden)]
5033 impl crate::RequestBuilder for GetLocation {
5034 fn request_options(&mut self) -> &mut crate::RequestOptions {
5035 &mut self.0.options
5036 }
5037 }
5038
5039 #[derive(Clone, Debug)]
5060 pub struct ListOperations(
5061 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5062 );
5063
5064 impl ListOperations {
5065 pub(crate) fn new(
5066 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5067 ) -> Self {
5068 Self(RequestBuilder::new(stub))
5069 }
5070
5071 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5073 mut self,
5074 v: V,
5075 ) -> Self {
5076 self.0.request = v.into();
5077 self
5078 }
5079
5080 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5082 self.0.options = v.into();
5083 self
5084 }
5085
5086 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5088 (*self.0.stub)
5089 .list_operations(self.0.request, self.0.options)
5090 .await
5091 .map(crate::Response::into_body)
5092 }
5093
5094 pub fn by_page(
5096 self,
5097 ) -> impl google_cloud_gax::paginator::Paginator<
5098 google_cloud_longrunning::model::ListOperationsResponse,
5099 crate::Error,
5100 > {
5101 use std::clone::Clone;
5102 let token = self.0.request.page_token.clone();
5103 let execute = move |token: String| {
5104 let mut builder = self.clone();
5105 builder.0.request = builder.0.request.set_page_token(token);
5106 builder.send()
5107 };
5108 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5109 }
5110
5111 pub fn by_item(
5113 self,
5114 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5115 google_cloud_longrunning::model::ListOperationsResponse,
5116 crate::Error,
5117 > {
5118 use google_cloud_gax::paginator::Paginator;
5119 self.by_page().items()
5120 }
5121
5122 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5124 self.0.request.name = v.into();
5125 self
5126 }
5127
5128 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5130 self.0.request.filter = v.into();
5131 self
5132 }
5133
5134 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5136 self.0.request.page_size = v.into();
5137 self
5138 }
5139
5140 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5142 self.0.request.page_token = v.into();
5143 self
5144 }
5145
5146 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5148 self.0.request.return_partial_success = v.into();
5149 self
5150 }
5151 }
5152
5153 #[doc(hidden)]
5154 impl crate::RequestBuilder for ListOperations {
5155 fn request_options(&mut self) -> &mut crate::RequestOptions {
5156 &mut self.0.options
5157 }
5158 }
5159
5160 #[derive(Clone, Debug)]
5177 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5178
5179 impl GetOperation {
5180 pub(crate) fn new(
5181 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5182 ) -> Self {
5183 Self(RequestBuilder::new(stub))
5184 }
5185
5186 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5188 mut self,
5189 v: V,
5190 ) -> Self {
5191 self.0.request = v.into();
5192 self
5193 }
5194
5195 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5197 self.0.options = v.into();
5198 self
5199 }
5200
5201 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5203 (*self.0.stub)
5204 .get_operation(self.0.request, self.0.options)
5205 .await
5206 .map(crate::Response::into_body)
5207 }
5208
5209 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5211 self.0.request.name = v.into();
5212 self
5213 }
5214 }
5215
5216 #[doc(hidden)]
5217 impl crate::RequestBuilder for GetOperation {
5218 fn request_options(&mut self) -> &mut crate::RequestOptions {
5219 &mut self.0.options
5220 }
5221 }
5222
5223 #[derive(Clone, Debug)]
5240 pub struct DeleteOperation(
5241 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5242 );
5243
5244 impl DeleteOperation {
5245 pub(crate) fn new(
5246 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5247 ) -> Self {
5248 Self(RequestBuilder::new(stub))
5249 }
5250
5251 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5253 mut self,
5254 v: V,
5255 ) -> Self {
5256 self.0.request = v.into();
5257 self
5258 }
5259
5260 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5262 self.0.options = v.into();
5263 self
5264 }
5265
5266 pub async fn send(self) -> Result<()> {
5268 (*self.0.stub)
5269 .delete_operation(self.0.request, self.0.options)
5270 .await
5271 .map(crate::Response::into_body)
5272 }
5273
5274 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5276 self.0.request.name = v.into();
5277 self
5278 }
5279 }
5280
5281 #[doc(hidden)]
5282 impl crate::RequestBuilder for DeleteOperation {
5283 fn request_options(&mut self) -> &mut crate::RequestOptions {
5284 &mut self.0.options
5285 }
5286 }
5287
5288 #[derive(Clone, Debug)]
5305 pub struct CancelOperation(
5306 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5307 );
5308
5309 impl CancelOperation {
5310 pub(crate) fn new(
5311 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5312 ) -> Self {
5313 Self(RequestBuilder::new(stub))
5314 }
5315
5316 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5318 mut self,
5319 v: V,
5320 ) -> Self {
5321 self.0.request = v.into();
5322 self
5323 }
5324
5325 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5327 self.0.options = v.into();
5328 self
5329 }
5330
5331 pub async fn send(self) -> Result<()> {
5333 (*self.0.stub)
5334 .cancel_operation(self.0.request, self.0.options)
5335 .await
5336 .map(crate::Response::into_body)
5337 }
5338
5339 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5341 self.0.request.name = v.into();
5342 self
5343 }
5344 }
5345
5346 #[doc(hidden)]
5347 impl crate::RequestBuilder for CancelOperation {
5348 fn request_options(&mut self) -> &mut crate::RequestOptions {
5349 &mut self.0.options
5350 }
5351 }
5352}