1pub mod audit {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::Audit;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = Audit;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
63 Self {
64 stub,
65 request: R::default(),
66 options: crate::RequestOptions::default(),
67 }
68 }
69 }
70
71 #[derive(Clone, Debug)]
88 pub struct GenerateFrameworkAuditScopeReport(
89 RequestBuilder<crate::model::GenerateFrameworkAuditScopeReportRequest>,
90 );
91
92 impl GenerateFrameworkAuditScopeReport {
93 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
94 Self(RequestBuilder::new(stub))
95 }
96
97 pub fn with_request<V: Into<crate::model::GenerateFrameworkAuditScopeReportRequest>>(
99 mut self,
100 v: V,
101 ) -> Self {
102 self.0.request = v.into();
103 self
104 }
105
106 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
108 self.0.options = v.into();
109 self
110 }
111
112 pub async fn send(self) -> Result<crate::model::GenerateFrameworkAuditScopeReportResponse> {
114 (*self.0.stub)
115 .generate_framework_audit_scope_report(self.0.request, self.0.options)
116 .await
117 .map(crate::Response::into_body)
118 }
119
120 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
124 self.0.request.scope = v.into();
125 self
126 }
127
128 pub fn set_report_format<
132 T: Into<crate::model::generate_framework_audit_scope_report_request::Format>,
133 >(
134 mut self,
135 v: T,
136 ) -> Self {
137 self.0.request.report_format = v.into();
138 self
139 }
140
141 pub fn set_compliance_framework<T: Into<std::string::String>>(mut self, v: T) -> Self {
145 self.0.request.compliance_framework = v.into();
146 self
147 }
148 }
149
150 #[doc(hidden)]
151 impl crate::RequestBuilder for GenerateFrameworkAuditScopeReport {
152 fn request_options(&mut self) -> &mut crate::RequestOptions {
153 &mut self.0.options
154 }
155 }
156
157 #[derive(Clone, Debug)]
175 pub struct CreateFrameworkAudit(RequestBuilder<crate::model::CreateFrameworkAuditRequest>);
176
177 impl CreateFrameworkAudit {
178 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
179 Self(RequestBuilder::new(stub))
180 }
181
182 pub fn with_request<V: Into<crate::model::CreateFrameworkAuditRequest>>(
184 mut self,
185 v: V,
186 ) -> Self {
187 self.0.request = v.into();
188 self
189 }
190
191 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
193 self.0.options = v.into();
194 self
195 }
196
197 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
204 (*self.0.stub)
205 .create_framework_audit(self.0.request, self.0.options)
206 .await
207 .map(crate::Response::into_body)
208 }
209
210 pub fn poller(
212 self,
213 ) -> impl google_cloud_lro::Poller<crate::model::FrameworkAudit, crate::model::OperationMetadata>
214 {
215 type Operation = google_cloud_lro::internal::Operation<
216 crate::model::FrameworkAudit,
217 crate::model::OperationMetadata,
218 >;
219 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
220 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
221
222 let stub = self.0.stub.clone();
223 let mut options = self.0.options.clone();
224 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
225 let query = move |name| {
226 let stub = stub.clone();
227 let options = options.clone();
228 async {
229 let op = GetOperation::new(stub)
230 .set_name(name)
231 .with_options(options)
232 .send()
233 .await?;
234 Ok(Operation::new(op))
235 }
236 };
237
238 let start = move || async {
239 let op = self.send().await?;
240 Ok(Operation::new(op))
241 };
242
243 google_cloud_lro::internal::new_poller(
244 polling_error_policy,
245 polling_backoff_policy,
246 start,
247 query,
248 )
249 }
250
251 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
255 self.0.request.parent = v.into();
256 self
257 }
258
259 pub fn set_framework_audit_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
261 self.0.request.framework_audit_id = v.into();
262 self
263 }
264
265 pub fn set_framework_audit<T>(mut self, v: T) -> Self
269 where
270 T: std::convert::Into<crate::model::FrameworkAudit>,
271 {
272 self.0.request.framework_audit = std::option::Option::Some(v.into());
273 self
274 }
275
276 pub fn set_or_clear_framework_audit<T>(mut self, v: std::option::Option<T>) -> Self
280 where
281 T: std::convert::Into<crate::model::FrameworkAudit>,
282 {
283 self.0.request.framework_audit = v.map(|x| x.into());
284 self
285 }
286 }
287
288 #[doc(hidden)]
289 impl crate::RequestBuilder for CreateFrameworkAudit {
290 fn request_options(&mut self) -> &mut crate::RequestOptions {
291 &mut self.0.options
292 }
293 }
294
295 #[derive(Clone, Debug)]
316 pub struct ListFrameworkAudits(RequestBuilder<crate::model::ListFrameworkAuditsRequest>);
317
318 impl ListFrameworkAudits {
319 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
320 Self(RequestBuilder::new(stub))
321 }
322
323 pub fn with_request<V: Into<crate::model::ListFrameworkAuditsRequest>>(
325 mut self,
326 v: V,
327 ) -> Self {
328 self.0.request = v.into();
329 self
330 }
331
332 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
334 self.0.options = v.into();
335 self
336 }
337
338 pub async fn send(self) -> Result<crate::model::ListFrameworkAuditsResponse> {
340 (*self.0.stub)
341 .list_framework_audits(self.0.request, self.0.options)
342 .await
343 .map(crate::Response::into_body)
344 }
345
346 pub fn by_page(
348 self,
349 ) -> impl google_cloud_gax::paginator::Paginator<
350 crate::model::ListFrameworkAuditsResponse,
351 crate::Error,
352 > {
353 use std::clone::Clone;
354 let token = self.0.request.page_token.clone();
355 let execute = move |token: String| {
356 let mut builder = self.clone();
357 builder.0.request = builder.0.request.set_page_token(token);
358 builder.send()
359 };
360 google_cloud_gax::paginator::internal::new_paginator(token, execute)
361 }
362
363 pub fn by_item(
365 self,
366 ) -> impl google_cloud_gax::paginator::ItemPaginator<
367 crate::model::ListFrameworkAuditsResponse,
368 crate::Error,
369 > {
370 use google_cloud_gax::paginator::Paginator;
371 self.by_page().items()
372 }
373
374 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
378 self.0.request.parent = v.into();
379 self
380 }
381
382 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
384 self.0.request.page_size = v.into();
385 self
386 }
387
388 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
390 self.0.request.page_token = v.into();
391 self
392 }
393
394 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
396 self.0.request.filter = v.into();
397 self
398 }
399 }
400
401 #[doc(hidden)]
402 impl crate::RequestBuilder for ListFrameworkAudits {
403 fn request_options(&mut self) -> &mut crate::RequestOptions {
404 &mut self.0.options
405 }
406 }
407
408 #[derive(Clone, Debug)]
425 pub struct GetFrameworkAudit(RequestBuilder<crate::model::GetFrameworkAuditRequest>);
426
427 impl GetFrameworkAudit {
428 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
429 Self(RequestBuilder::new(stub))
430 }
431
432 pub fn with_request<V: Into<crate::model::GetFrameworkAuditRequest>>(
434 mut self,
435 v: V,
436 ) -> Self {
437 self.0.request = v.into();
438 self
439 }
440
441 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
443 self.0.options = v.into();
444 self
445 }
446
447 pub async fn send(self) -> Result<crate::model::FrameworkAudit> {
449 (*self.0.stub)
450 .get_framework_audit(self.0.request, self.0.options)
451 .await
452 .map(crate::Response::into_body)
453 }
454
455 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
459 self.0.request.name = v.into();
460 self
461 }
462 }
463
464 #[doc(hidden)]
465 impl crate::RequestBuilder for GetFrameworkAudit {
466 fn request_options(&mut self) -> &mut crate::RequestOptions {
467 &mut self.0.options
468 }
469 }
470
471 #[derive(Clone, Debug)]
492 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
493
494 impl ListLocations {
495 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
496 Self(RequestBuilder::new(stub))
497 }
498
499 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
501 mut self,
502 v: V,
503 ) -> Self {
504 self.0.request = v.into();
505 self
506 }
507
508 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
510 self.0.options = v.into();
511 self
512 }
513
514 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
516 (*self.0.stub)
517 .list_locations(self.0.request, self.0.options)
518 .await
519 .map(crate::Response::into_body)
520 }
521
522 pub fn by_page(
524 self,
525 ) -> impl google_cloud_gax::paginator::Paginator<
526 google_cloud_location::model::ListLocationsResponse,
527 crate::Error,
528 > {
529 use std::clone::Clone;
530 let token = self.0.request.page_token.clone();
531 let execute = move |token: String| {
532 let mut builder = self.clone();
533 builder.0.request = builder.0.request.set_page_token(token);
534 builder.send()
535 };
536 google_cloud_gax::paginator::internal::new_paginator(token, execute)
537 }
538
539 pub fn by_item(
541 self,
542 ) -> impl google_cloud_gax::paginator::ItemPaginator<
543 google_cloud_location::model::ListLocationsResponse,
544 crate::Error,
545 > {
546 use google_cloud_gax::paginator::Paginator;
547 self.by_page().items()
548 }
549
550 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
552 self.0.request.name = v.into();
553 self
554 }
555
556 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
558 self.0.request.filter = v.into();
559 self
560 }
561
562 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
564 self.0.request.page_size = v.into();
565 self
566 }
567
568 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
570 self.0.request.page_token = v.into();
571 self
572 }
573 }
574
575 #[doc(hidden)]
576 impl crate::RequestBuilder for ListLocations {
577 fn request_options(&mut self) -> &mut crate::RequestOptions {
578 &mut self.0.options
579 }
580 }
581
582 #[derive(Clone, Debug)]
599 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
600
601 impl GetLocation {
602 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
603 Self(RequestBuilder::new(stub))
604 }
605
606 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
608 mut self,
609 v: V,
610 ) -> Self {
611 self.0.request = v.into();
612 self
613 }
614
615 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
617 self.0.options = v.into();
618 self
619 }
620
621 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
623 (*self.0.stub)
624 .get_location(self.0.request, self.0.options)
625 .await
626 .map(crate::Response::into_body)
627 }
628
629 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
631 self.0.request.name = v.into();
632 self
633 }
634 }
635
636 #[doc(hidden)]
637 impl crate::RequestBuilder for GetLocation {
638 fn request_options(&mut self) -> &mut crate::RequestOptions {
639 &mut self.0.options
640 }
641 }
642
643 #[derive(Clone, Debug)]
664 pub struct ListOperations(
665 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
666 );
667
668 impl ListOperations {
669 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
670 Self(RequestBuilder::new(stub))
671 }
672
673 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
675 mut self,
676 v: V,
677 ) -> Self {
678 self.0.request = v.into();
679 self
680 }
681
682 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
684 self.0.options = v.into();
685 self
686 }
687
688 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
690 (*self.0.stub)
691 .list_operations(self.0.request, self.0.options)
692 .await
693 .map(crate::Response::into_body)
694 }
695
696 pub fn by_page(
698 self,
699 ) -> impl google_cloud_gax::paginator::Paginator<
700 google_cloud_longrunning::model::ListOperationsResponse,
701 crate::Error,
702 > {
703 use std::clone::Clone;
704 let token = self.0.request.page_token.clone();
705 let execute = move |token: String| {
706 let mut builder = self.clone();
707 builder.0.request = builder.0.request.set_page_token(token);
708 builder.send()
709 };
710 google_cloud_gax::paginator::internal::new_paginator(token, execute)
711 }
712
713 pub fn by_item(
715 self,
716 ) -> impl google_cloud_gax::paginator::ItemPaginator<
717 google_cloud_longrunning::model::ListOperationsResponse,
718 crate::Error,
719 > {
720 use google_cloud_gax::paginator::Paginator;
721 self.by_page().items()
722 }
723
724 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
726 self.0.request.name = v.into();
727 self
728 }
729
730 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
732 self.0.request.filter = v.into();
733 self
734 }
735
736 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
738 self.0.request.page_size = v.into();
739 self
740 }
741
742 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
744 self.0.request.page_token = v.into();
745 self
746 }
747
748 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
750 self.0.request.return_partial_success = v.into();
751 self
752 }
753 }
754
755 #[doc(hidden)]
756 impl crate::RequestBuilder for ListOperations {
757 fn request_options(&mut self) -> &mut crate::RequestOptions {
758 &mut self.0.options
759 }
760 }
761
762 #[derive(Clone, Debug)]
779 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
780
781 impl GetOperation {
782 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
783 Self(RequestBuilder::new(stub))
784 }
785
786 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
788 mut self,
789 v: V,
790 ) -> Self {
791 self.0.request = v.into();
792 self
793 }
794
795 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
797 self.0.options = v.into();
798 self
799 }
800
801 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
803 (*self.0.stub)
804 .get_operation(self.0.request, self.0.options)
805 .await
806 .map(crate::Response::into_body)
807 }
808
809 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
811 self.0.request.name = v.into();
812 self
813 }
814 }
815
816 #[doc(hidden)]
817 impl crate::RequestBuilder for GetOperation {
818 fn request_options(&mut self) -> &mut crate::RequestOptions {
819 &mut self.0.options
820 }
821 }
822
823 #[derive(Clone, Debug)]
840 pub struct DeleteOperation(
841 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
842 );
843
844 impl DeleteOperation {
845 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
846 Self(RequestBuilder::new(stub))
847 }
848
849 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
851 mut self,
852 v: V,
853 ) -> Self {
854 self.0.request = v.into();
855 self
856 }
857
858 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
860 self.0.options = v.into();
861 self
862 }
863
864 pub async fn send(self) -> Result<()> {
866 (*self.0.stub)
867 .delete_operation(self.0.request, self.0.options)
868 .await
869 .map(crate::Response::into_body)
870 }
871
872 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
874 self.0.request.name = v.into();
875 self
876 }
877 }
878
879 #[doc(hidden)]
880 impl crate::RequestBuilder for DeleteOperation {
881 fn request_options(&mut self) -> &mut crate::RequestOptions {
882 &mut self.0.options
883 }
884 }
885
886 #[derive(Clone, Debug)]
903 pub struct CancelOperation(
904 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
905 );
906
907 impl CancelOperation {
908 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
909 Self(RequestBuilder::new(stub))
910 }
911
912 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
914 mut self,
915 v: V,
916 ) -> Self {
917 self.0.request = v.into();
918 self
919 }
920
921 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
923 self.0.options = v.into();
924 self
925 }
926
927 pub async fn send(self) -> Result<()> {
929 (*self.0.stub)
930 .cancel_operation(self.0.request, self.0.options)
931 .await
932 .map(crate::Response::into_body)
933 }
934
935 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
937 self.0.request.name = v.into();
938 self
939 }
940 }
941
942 #[doc(hidden)]
943 impl crate::RequestBuilder for CancelOperation {
944 fn request_options(&mut self) -> &mut crate::RequestOptions {
945 &mut self.0.options
946 }
947 }
948}
949
950pub mod cm_enrollment_service {
951 use crate::Result;
952
953 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
967
968 pub(crate) mod client {
969 use super::super::super::client::CmEnrollmentService;
970 pub struct Factory;
971 impl crate::ClientFactory for Factory {
972 type Client = CmEnrollmentService;
973 type Credentials = gaxi::options::Credentials;
974 async fn build(
975 self,
976 config: gaxi::options::ClientConfig,
977 ) -> crate::ClientBuilderResult<Self::Client> {
978 Self::Client::new(config).await
979 }
980 }
981 }
982
983 #[derive(Clone, Debug)]
985 pub(crate) struct RequestBuilder<R: std::default::Default> {
986 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
987 request: R,
988 options: crate::RequestOptions,
989 }
990
991 impl<R> RequestBuilder<R>
992 where
993 R: std::default::Default,
994 {
995 pub(crate) fn new(
996 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
997 ) -> Self {
998 Self {
999 stub,
1000 request: R::default(),
1001 options: crate::RequestOptions::default(),
1002 }
1003 }
1004 }
1005
1006 #[derive(Clone, Debug)]
1023 pub struct UpdateCmEnrollment(RequestBuilder<crate::model::UpdateCmEnrollmentRequest>);
1024
1025 impl UpdateCmEnrollment {
1026 pub(crate) fn new(
1027 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1028 ) -> Self {
1029 Self(RequestBuilder::new(stub))
1030 }
1031
1032 pub fn with_request<V: Into<crate::model::UpdateCmEnrollmentRequest>>(
1034 mut self,
1035 v: V,
1036 ) -> Self {
1037 self.0.request = v.into();
1038 self
1039 }
1040
1041 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1043 self.0.options = v.into();
1044 self
1045 }
1046
1047 pub async fn send(self) -> Result<crate::model::CmEnrollment> {
1049 (*self.0.stub)
1050 .update_cm_enrollment(self.0.request, self.0.options)
1051 .await
1052 .map(crate::Response::into_body)
1053 }
1054
1055 pub fn set_cm_enrollment<T>(mut self, v: T) -> Self
1059 where
1060 T: std::convert::Into<crate::model::CmEnrollment>,
1061 {
1062 self.0.request.cm_enrollment = std::option::Option::Some(v.into());
1063 self
1064 }
1065
1066 pub fn set_or_clear_cm_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
1070 where
1071 T: std::convert::Into<crate::model::CmEnrollment>,
1072 {
1073 self.0.request.cm_enrollment = v.map(|x| x.into());
1074 self
1075 }
1076
1077 pub fn set_update_mask<T>(mut self, v: T) -> Self
1079 where
1080 T: std::convert::Into<wkt::FieldMask>,
1081 {
1082 self.0.request.update_mask = std::option::Option::Some(v.into());
1083 self
1084 }
1085
1086 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1088 where
1089 T: std::convert::Into<wkt::FieldMask>,
1090 {
1091 self.0.request.update_mask = v.map(|x| x.into());
1092 self
1093 }
1094 }
1095
1096 #[doc(hidden)]
1097 impl crate::RequestBuilder for UpdateCmEnrollment {
1098 fn request_options(&mut self) -> &mut crate::RequestOptions {
1099 &mut self.0.options
1100 }
1101 }
1102
1103 #[derive(Clone, Debug)]
1120 pub struct CalculateEffectiveCmEnrollment(
1121 RequestBuilder<crate::model::CalculateEffectiveCmEnrollmentRequest>,
1122 );
1123
1124 impl CalculateEffectiveCmEnrollment {
1125 pub(crate) fn new(
1126 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1127 ) -> Self {
1128 Self(RequestBuilder::new(stub))
1129 }
1130
1131 pub fn with_request<V: Into<crate::model::CalculateEffectiveCmEnrollmentRequest>>(
1133 mut self,
1134 v: V,
1135 ) -> Self {
1136 self.0.request = v.into();
1137 self
1138 }
1139
1140 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1142 self.0.options = v.into();
1143 self
1144 }
1145
1146 pub async fn send(self) -> Result<crate::model::CalculateEffectiveCmEnrollmentResponse> {
1148 (*self.0.stub)
1149 .calculate_effective_cm_enrollment(self.0.request, self.0.options)
1150 .await
1151 .map(crate::Response::into_body)
1152 }
1153
1154 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1158 self.0.request.name = v.into();
1159 self
1160 }
1161 }
1162
1163 #[doc(hidden)]
1164 impl crate::RequestBuilder for CalculateEffectiveCmEnrollment {
1165 fn request_options(&mut self) -> &mut crate::RequestOptions {
1166 &mut self.0.options
1167 }
1168 }
1169
1170 #[derive(Clone, Debug)]
1191 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1192
1193 impl ListLocations {
1194 pub(crate) fn new(
1195 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1196 ) -> Self {
1197 Self(RequestBuilder::new(stub))
1198 }
1199
1200 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1202 mut self,
1203 v: V,
1204 ) -> Self {
1205 self.0.request = v.into();
1206 self
1207 }
1208
1209 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1211 self.0.options = v.into();
1212 self
1213 }
1214
1215 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1217 (*self.0.stub)
1218 .list_locations(self.0.request, self.0.options)
1219 .await
1220 .map(crate::Response::into_body)
1221 }
1222
1223 pub fn by_page(
1225 self,
1226 ) -> impl google_cloud_gax::paginator::Paginator<
1227 google_cloud_location::model::ListLocationsResponse,
1228 crate::Error,
1229 > {
1230 use std::clone::Clone;
1231 let token = self.0.request.page_token.clone();
1232 let execute = move |token: String| {
1233 let mut builder = self.clone();
1234 builder.0.request = builder.0.request.set_page_token(token);
1235 builder.send()
1236 };
1237 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1238 }
1239
1240 pub fn by_item(
1242 self,
1243 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1244 google_cloud_location::model::ListLocationsResponse,
1245 crate::Error,
1246 > {
1247 use google_cloud_gax::paginator::Paginator;
1248 self.by_page().items()
1249 }
1250
1251 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1253 self.0.request.name = v.into();
1254 self
1255 }
1256
1257 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1259 self.0.request.filter = v.into();
1260 self
1261 }
1262
1263 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1265 self.0.request.page_size = v.into();
1266 self
1267 }
1268
1269 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1271 self.0.request.page_token = v.into();
1272 self
1273 }
1274 }
1275
1276 #[doc(hidden)]
1277 impl crate::RequestBuilder for ListLocations {
1278 fn request_options(&mut self) -> &mut crate::RequestOptions {
1279 &mut self.0.options
1280 }
1281 }
1282
1283 #[derive(Clone, Debug)]
1300 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1301
1302 impl GetLocation {
1303 pub(crate) fn new(
1304 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1305 ) -> Self {
1306 Self(RequestBuilder::new(stub))
1307 }
1308
1309 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1311 mut self,
1312 v: V,
1313 ) -> Self {
1314 self.0.request = v.into();
1315 self
1316 }
1317
1318 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1320 self.0.options = v.into();
1321 self
1322 }
1323
1324 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1326 (*self.0.stub)
1327 .get_location(self.0.request, self.0.options)
1328 .await
1329 .map(crate::Response::into_body)
1330 }
1331
1332 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1334 self.0.request.name = v.into();
1335 self
1336 }
1337 }
1338
1339 #[doc(hidden)]
1340 impl crate::RequestBuilder for GetLocation {
1341 fn request_options(&mut self) -> &mut crate::RequestOptions {
1342 &mut self.0.options
1343 }
1344 }
1345
1346 #[derive(Clone, Debug)]
1367 pub struct ListOperations(
1368 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1369 );
1370
1371 impl ListOperations {
1372 pub(crate) fn new(
1373 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1374 ) -> Self {
1375 Self(RequestBuilder::new(stub))
1376 }
1377
1378 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1380 mut self,
1381 v: V,
1382 ) -> Self {
1383 self.0.request = v.into();
1384 self
1385 }
1386
1387 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1389 self.0.options = v.into();
1390 self
1391 }
1392
1393 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1395 (*self.0.stub)
1396 .list_operations(self.0.request, self.0.options)
1397 .await
1398 .map(crate::Response::into_body)
1399 }
1400
1401 pub fn by_page(
1403 self,
1404 ) -> impl google_cloud_gax::paginator::Paginator<
1405 google_cloud_longrunning::model::ListOperationsResponse,
1406 crate::Error,
1407 > {
1408 use std::clone::Clone;
1409 let token = self.0.request.page_token.clone();
1410 let execute = move |token: String| {
1411 let mut builder = self.clone();
1412 builder.0.request = builder.0.request.set_page_token(token);
1413 builder.send()
1414 };
1415 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1416 }
1417
1418 pub fn by_item(
1420 self,
1421 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1422 google_cloud_longrunning::model::ListOperationsResponse,
1423 crate::Error,
1424 > {
1425 use google_cloud_gax::paginator::Paginator;
1426 self.by_page().items()
1427 }
1428
1429 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1431 self.0.request.name = v.into();
1432 self
1433 }
1434
1435 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1437 self.0.request.filter = v.into();
1438 self
1439 }
1440
1441 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1443 self.0.request.page_size = v.into();
1444 self
1445 }
1446
1447 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1449 self.0.request.page_token = v.into();
1450 self
1451 }
1452
1453 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1455 self.0.request.return_partial_success = v.into();
1456 self
1457 }
1458 }
1459
1460 #[doc(hidden)]
1461 impl crate::RequestBuilder for ListOperations {
1462 fn request_options(&mut self) -> &mut crate::RequestOptions {
1463 &mut self.0.options
1464 }
1465 }
1466
1467 #[derive(Clone, Debug)]
1484 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1485
1486 impl GetOperation {
1487 pub(crate) fn new(
1488 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1489 ) -> Self {
1490 Self(RequestBuilder::new(stub))
1491 }
1492
1493 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1495 mut self,
1496 v: V,
1497 ) -> Self {
1498 self.0.request = v.into();
1499 self
1500 }
1501
1502 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1504 self.0.options = v.into();
1505 self
1506 }
1507
1508 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1510 (*self.0.stub)
1511 .get_operation(self.0.request, self.0.options)
1512 .await
1513 .map(crate::Response::into_body)
1514 }
1515
1516 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1518 self.0.request.name = v.into();
1519 self
1520 }
1521 }
1522
1523 #[doc(hidden)]
1524 impl crate::RequestBuilder for GetOperation {
1525 fn request_options(&mut self) -> &mut crate::RequestOptions {
1526 &mut self.0.options
1527 }
1528 }
1529
1530 #[derive(Clone, Debug)]
1547 pub struct DeleteOperation(
1548 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1549 );
1550
1551 impl DeleteOperation {
1552 pub(crate) fn new(
1553 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1554 ) -> Self {
1555 Self(RequestBuilder::new(stub))
1556 }
1557
1558 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1560 mut self,
1561 v: V,
1562 ) -> Self {
1563 self.0.request = v.into();
1564 self
1565 }
1566
1567 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1569 self.0.options = v.into();
1570 self
1571 }
1572
1573 pub async fn send(self) -> Result<()> {
1575 (*self.0.stub)
1576 .delete_operation(self.0.request, self.0.options)
1577 .await
1578 .map(crate::Response::into_body)
1579 }
1580
1581 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1583 self.0.request.name = v.into();
1584 self
1585 }
1586 }
1587
1588 #[doc(hidden)]
1589 impl crate::RequestBuilder for DeleteOperation {
1590 fn request_options(&mut self) -> &mut crate::RequestOptions {
1591 &mut self.0.options
1592 }
1593 }
1594
1595 #[derive(Clone, Debug)]
1612 pub struct CancelOperation(
1613 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1614 );
1615
1616 impl CancelOperation {
1617 pub(crate) fn new(
1618 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1619 ) -> Self {
1620 Self(RequestBuilder::new(stub))
1621 }
1622
1623 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1625 mut self,
1626 v: V,
1627 ) -> Self {
1628 self.0.request = v.into();
1629 self
1630 }
1631
1632 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1634 self.0.options = v.into();
1635 self
1636 }
1637
1638 pub async fn send(self) -> Result<()> {
1640 (*self.0.stub)
1641 .cancel_operation(self.0.request, self.0.options)
1642 .await
1643 .map(crate::Response::into_body)
1644 }
1645
1646 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1648 self.0.request.name = v.into();
1649 self
1650 }
1651 }
1652
1653 #[doc(hidden)]
1654 impl crate::RequestBuilder for CancelOperation {
1655 fn request_options(&mut self) -> &mut crate::RequestOptions {
1656 &mut self.0.options
1657 }
1658 }
1659}
1660
1661pub mod config {
1662 use crate::Result;
1663
1664 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1678
1679 pub(crate) mod client {
1680 use super::super::super::client::Config;
1681 pub struct Factory;
1682 impl crate::ClientFactory for Factory {
1683 type Client = Config;
1684 type Credentials = gaxi::options::Credentials;
1685 async fn build(
1686 self,
1687 config: gaxi::options::ClientConfig,
1688 ) -> crate::ClientBuilderResult<Self::Client> {
1689 Self::Client::new(config).await
1690 }
1691 }
1692 }
1693
1694 #[derive(Clone, Debug)]
1696 pub(crate) struct RequestBuilder<R: std::default::Default> {
1697 stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>,
1698 request: R,
1699 options: crate::RequestOptions,
1700 }
1701
1702 impl<R> RequestBuilder<R>
1703 where
1704 R: std::default::Default,
1705 {
1706 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1707 Self {
1708 stub,
1709 request: R::default(),
1710 options: crate::RequestOptions::default(),
1711 }
1712 }
1713 }
1714
1715 #[derive(Clone, Debug)]
1736 pub struct ListFrameworks(RequestBuilder<crate::model::ListFrameworksRequest>);
1737
1738 impl ListFrameworks {
1739 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1740 Self(RequestBuilder::new(stub))
1741 }
1742
1743 pub fn with_request<V: Into<crate::model::ListFrameworksRequest>>(mut self, v: V) -> Self {
1745 self.0.request = v.into();
1746 self
1747 }
1748
1749 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1751 self.0.options = v.into();
1752 self
1753 }
1754
1755 pub async fn send(self) -> Result<crate::model::ListFrameworksResponse> {
1757 (*self.0.stub)
1758 .list_frameworks(self.0.request, self.0.options)
1759 .await
1760 .map(crate::Response::into_body)
1761 }
1762
1763 pub fn by_page(
1765 self,
1766 ) -> impl google_cloud_gax::paginator::Paginator<
1767 crate::model::ListFrameworksResponse,
1768 crate::Error,
1769 > {
1770 use std::clone::Clone;
1771 let token = self.0.request.page_token.clone();
1772 let execute = move |token: String| {
1773 let mut builder = self.clone();
1774 builder.0.request = builder.0.request.set_page_token(token);
1775 builder.send()
1776 };
1777 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1778 }
1779
1780 pub fn by_item(
1782 self,
1783 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1784 crate::model::ListFrameworksResponse,
1785 crate::Error,
1786 > {
1787 use google_cloud_gax::paginator::Paginator;
1788 self.by_page().items()
1789 }
1790
1791 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1795 self.0.request.parent = v.into();
1796 self
1797 }
1798
1799 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1801 self.0.request.page_size = v.into();
1802 self
1803 }
1804
1805 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1807 self.0.request.page_token = v.into();
1808 self
1809 }
1810 }
1811
1812 #[doc(hidden)]
1813 impl crate::RequestBuilder for ListFrameworks {
1814 fn request_options(&mut self) -> &mut crate::RequestOptions {
1815 &mut self.0.options
1816 }
1817 }
1818
1819 #[derive(Clone, Debug)]
1836 pub struct GetFramework(RequestBuilder<crate::model::GetFrameworkRequest>);
1837
1838 impl GetFramework {
1839 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1840 Self(RequestBuilder::new(stub))
1841 }
1842
1843 pub fn with_request<V: Into<crate::model::GetFrameworkRequest>>(mut self, v: V) -> Self {
1845 self.0.request = v.into();
1846 self
1847 }
1848
1849 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1851 self.0.options = v.into();
1852 self
1853 }
1854
1855 pub async fn send(self) -> Result<crate::model::Framework> {
1857 (*self.0.stub)
1858 .get_framework(self.0.request, self.0.options)
1859 .await
1860 .map(crate::Response::into_body)
1861 }
1862
1863 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1867 self.0.request.name = v.into();
1868 self
1869 }
1870
1871 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
1873 self.0.request.major_revision_id = v.into();
1874 self
1875 }
1876 }
1877
1878 #[doc(hidden)]
1879 impl crate::RequestBuilder for GetFramework {
1880 fn request_options(&mut self) -> &mut crate::RequestOptions {
1881 &mut self.0.options
1882 }
1883 }
1884
1885 #[derive(Clone, Debug)]
1902 pub struct CreateFramework(RequestBuilder<crate::model::CreateFrameworkRequest>);
1903
1904 impl CreateFramework {
1905 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1906 Self(RequestBuilder::new(stub))
1907 }
1908
1909 pub fn with_request<V: Into<crate::model::CreateFrameworkRequest>>(mut self, v: V) -> Self {
1911 self.0.request = v.into();
1912 self
1913 }
1914
1915 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1917 self.0.options = v.into();
1918 self
1919 }
1920
1921 pub async fn send(self) -> Result<crate::model::Framework> {
1923 (*self.0.stub)
1924 .create_framework(self.0.request, self.0.options)
1925 .await
1926 .map(crate::Response::into_body)
1927 }
1928
1929 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1933 self.0.request.parent = v.into();
1934 self
1935 }
1936
1937 pub fn set_framework_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1941 self.0.request.framework_id = v.into();
1942 self
1943 }
1944
1945 pub fn set_framework<T>(mut self, v: T) -> Self
1949 where
1950 T: std::convert::Into<crate::model::Framework>,
1951 {
1952 self.0.request.framework = std::option::Option::Some(v.into());
1953 self
1954 }
1955
1956 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
1960 where
1961 T: std::convert::Into<crate::model::Framework>,
1962 {
1963 self.0.request.framework = v.map(|x| x.into());
1964 self
1965 }
1966 }
1967
1968 #[doc(hidden)]
1969 impl crate::RequestBuilder for CreateFramework {
1970 fn request_options(&mut self) -> &mut crate::RequestOptions {
1971 &mut self.0.options
1972 }
1973 }
1974
1975 #[derive(Clone, Debug)]
1992 pub struct UpdateFramework(RequestBuilder<crate::model::UpdateFrameworkRequest>);
1993
1994 impl UpdateFramework {
1995 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1996 Self(RequestBuilder::new(stub))
1997 }
1998
1999 pub fn with_request<V: Into<crate::model::UpdateFrameworkRequest>>(mut self, v: V) -> Self {
2001 self.0.request = v.into();
2002 self
2003 }
2004
2005 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2007 self.0.options = v.into();
2008 self
2009 }
2010
2011 pub async fn send(self) -> Result<crate::model::Framework> {
2013 (*self.0.stub)
2014 .update_framework(self.0.request, self.0.options)
2015 .await
2016 .map(crate::Response::into_body)
2017 }
2018
2019 pub fn set_update_mask<T>(mut self, v: T) -> Self
2021 where
2022 T: std::convert::Into<wkt::FieldMask>,
2023 {
2024 self.0.request.update_mask = std::option::Option::Some(v.into());
2025 self
2026 }
2027
2028 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2030 where
2031 T: std::convert::Into<wkt::FieldMask>,
2032 {
2033 self.0.request.update_mask = v.map(|x| x.into());
2034 self
2035 }
2036
2037 pub fn set_framework<T>(mut self, v: T) -> Self
2041 where
2042 T: std::convert::Into<crate::model::Framework>,
2043 {
2044 self.0.request.framework = std::option::Option::Some(v.into());
2045 self
2046 }
2047
2048 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
2052 where
2053 T: std::convert::Into<crate::model::Framework>,
2054 {
2055 self.0.request.framework = v.map(|x| x.into());
2056 self
2057 }
2058
2059 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
2061 self.0.request.major_revision_id = v.into();
2062 self
2063 }
2064 }
2065
2066 #[doc(hidden)]
2067 impl crate::RequestBuilder for UpdateFramework {
2068 fn request_options(&mut self) -> &mut crate::RequestOptions {
2069 &mut self.0.options
2070 }
2071 }
2072
2073 #[derive(Clone, Debug)]
2090 pub struct DeleteFramework(RequestBuilder<crate::model::DeleteFrameworkRequest>);
2091
2092 impl DeleteFramework {
2093 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2094 Self(RequestBuilder::new(stub))
2095 }
2096
2097 pub fn with_request<V: Into<crate::model::DeleteFrameworkRequest>>(mut self, v: V) -> Self {
2099 self.0.request = v.into();
2100 self
2101 }
2102
2103 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2105 self.0.options = v.into();
2106 self
2107 }
2108
2109 pub async fn send(self) -> Result<()> {
2111 (*self.0.stub)
2112 .delete_framework(self.0.request, self.0.options)
2113 .await
2114 .map(crate::Response::into_body)
2115 }
2116
2117 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2121 self.0.request.name = v.into();
2122 self
2123 }
2124 }
2125
2126 #[doc(hidden)]
2127 impl crate::RequestBuilder for DeleteFramework {
2128 fn request_options(&mut self) -> &mut crate::RequestOptions {
2129 &mut self.0.options
2130 }
2131 }
2132
2133 #[derive(Clone, Debug)]
2154 pub struct ListCloudControls(RequestBuilder<crate::model::ListCloudControlsRequest>);
2155
2156 impl ListCloudControls {
2157 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2158 Self(RequestBuilder::new(stub))
2159 }
2160
2161 pub fn with_request<V: Into<crate::model::ListCloudControlsRequest>>(
2163 mut self,
2164 v: V,
2165 ) -> Self {
2166 self.0.request = v.into();
2167 self
2168 }
2169
2170 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2172 self.0.options = v.into();
2173 self
2174 }
2175
2176 pub async fn send(self) -> Result<crate::model::ListCloudControlsResponse> {
2178 (*self.0.stub)
2179 .list_cloud_controls(self.0.request, self.0.options)
2180 .await
2181 .map(crate::Response::into_body)
2182 }
2183
2184 pub fn by_page(
2186 self,
2187 ) -> impl google_cloud_gax::paginator::Paginator<
2188 crate::model::ListCloudControlsResponse,
2189 crate::Error,
2190 > {
2191 use std::clone::Clone;
2192 let token = self.0.request.page_token.clone();
2193 let execute = move |token: String| {
2194 let mut builder = self.clone();
2195 builder.0.request = builder.0.request.set_page_token(token);
2196 builder.send()
2197 };
2198 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2199 }
2200
2201 pub fn by_item(
2203 self,
2204 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2205 crate::model::ListCloudControlsResponse,
2206 crate::Error,
2207 > {
2208 use google_cloud_gax::paginator::Paginator;
2209 self.by_page().items()
2210 }
2211
2212 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2216 self.0.request.parent = v.into();
2217 self
2218 }
2219
2220 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2222 self.0.request.page_size = v.into();
2223 self
2224 }
2225
2226 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2228 self.0.request.page_token = v.into();
2229 self
2230 }
2231 }
2232
2233 #[doc(hidden)]
2234 impl crate::RequestBuilder for ListCloudControls {
2235 fn request_options(&mut self) -> &mut crate::RequestOptions {
2236 &mut self.0.options
2237 }
2238 }
2239
2240 #[derive(Clone, Debug)]
2257 pub struct GetCloudControl(RequestBuilder<crate::model::GetCloudControlRequest>);
2258
2259 impl GetCloudControl {
2260 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2261 Self(RequestBuilder::new(stub))
2262 }
2263
2264 pub fn with_request<V: Into<crate::model::GetCloudControlRequest>>(mut self, v: V) -> Self {
2266 self.0.request = v.into();
2267 self
2268 }
2269
2270 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2272 self.0.options = v.into();
2273 self
2274 }
2275
2276 pub async fn send(self) -> Result<crate::model::CloudControl> {
2278 (*self.0.stub)
2279 .get_cloud_control(self.0.request, self.0.options)
2280 .await
2281 .map(crate::Response::into_body)
2282 }
2283
2284 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2288 self.0.request.name = v.into();
2289 self
2290 }
2291
2292 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
2294 self.0.request.major_revision_id = v.into();
2295 self
2296 }
2297 }
2298
2299 #[doc(hidden)]
2300 impl crate::RequestBuilder for GetCloudControl {
2301 fn request_options(&mut self) -> &mut crate::RequestOptions {
2302 &mut self.0.options
2303 }
2304 }
2305
2306 #[derive(Clone, Debug)]
2323 pub struct CreateCloudControl(RequestBuilder<crate::model::CreateCloudControlRequest>);
2324
2325 impl CreateCloudControl {
2326 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2327 Self(RequestBuilder::new(stub))
2328 }
2329
2330 pub fn with_request<V: Into<crate::model::CreateCloudControlRequest>>(
2332 mut self,
2333 v: V,
2334 ) -> Self {
2335 self.0.request = v.into();
2336 self
2337 }
2338
2339 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2341 self.0.options = v.into();
2342 self
2343 }
2344
2345 pub async fn send(self) -> Result<crate::model::CloudControl> {
2347 (*self.0.stub)
2348 .create_cloud_control(self.0.request, self.0.options)
2349 .await
2350 .map(crate::Response::into_body)
2351 }
2352
2353 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2357 self.0.request.parent = v.into();
2358 self
2359 }
2360
2361 pub fn set_cloud_control_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2365 self.0.request.cloud_control_id = v.into();
2366 self
2367 }
2368
2369 pub fn set_cloud_control<T>(mut self, v: T) -> Self
2373 where
2374 T: std::convert::Into<crate::model::CloudControl>,
2375 {
2376 self.0.request.cloud_control = std::option::Option::Some(v.into());
2377 self
2378 }
2379
2380 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
2384 where
2385 T: std::convert::Into<crate::model::CloudControl>,
2386 {
2387 self.0.request.cloud_control = v.map(|x| x.into());
2388 self
2389 }
2390 }
2391
2392 #[doc(hidden)]
2393 impl crate::RequestBuilder for CreateCloudControl {
2394 fn request_options(&mut self) -> &mut crate::RequestOptions {
2395 &mut self.0.options
2396 }
2397 }
2398
2399 #[derive(Clone, Debug)]
2416 pub struct UpdateCloudControl(RequestBuilder<crate::model::UpdateCloudControlRequest>);
2417
2418 impl UpdateCloudControl {
2419 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2420 Self(RequestBuilder::new(stub))
2421 }
2422
2423 pub fn with_request<V: Into<crate::model::UpdateCloudControlRequest>>(
2425 mut self,
2426 v: V,
2427 ) -> Self {
2428 self.0.request = v.into();
2429 self
2430 }
2431
2432 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2434 self.0.options = v.into();
2435 self
2436 }
2437
2438 pub async fn send(self) -> Result<crate::model::CloudControl> {
2440 (*self.0.stub)
2441 .update_cloud_control(self.0.request, self.0.options)
2442 .await
2443 .map(crate::Response::into_body)
2444 }
2445
2446 pub fn set_update_mask<T>(mut self, v: T) -> Self
2448 where
2449 T: std::convert::Into<wkt::FieldMask>,
2450 {
2451 self.0.request.update_mask = std::option::Option::Some(v.into());
2452 self
2453 }
2454
2455 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2457 where
2458 T: std::convert::Into<wkt::FieldMask>,
2459 {
2460 self.0.request.update_mask = v.map(|x| x.into());
2461 self
2462 }
2463
2464 pub fn set_cloud_control<T>(mut self, v: T) -> Self
2468 where
2469 T: std::convert::Into<crate::model::CloudControl>,
2470 {
2471 self.0.request.cloud_control = std::option::Option::Some(v.into());
2472 self
2473 }
2474
2475 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
2479 where
2480 T: std::convert::Into<crate::model::CloudControl>,
2481 {
2482 self.0.request.cloud_control = v.map(|x| x.into());
2483 self
2484 }
2485 }
2486
2487 #[doc(hidden)]
2488 impl crate::RequestBuilder for UpdateCloudControl {
2489 fn request_options(&mut self) -> &mut crate::RequestOptions {
2490 &mut self.0.options
2491 }
2492 }
2493
2494 #[derive(Clone, Debug)]
2511 pub struct DeleteCloudControl(RequestBuilder<crate::model::DeleteCloudControlRequest>);
2512
2513 impl DeleteCloudControl {
2514 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2515 Self(RequestBuilder::new(stub))
2516 }
2517
2518 pub fn with_request<V: Into<crate::model::DeleteCloudControlRequest>>(
2520 mut self,
2521 v: V,
2522 ) -> Self {
2523 self.0.request = v.into();
2524 self
2525 }
2526
2527 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2529 self.0.options = v.into();
2530 self
2531 }
2532
2533 pub async fn send(self) -> Result<()> {
2535 (*self.0.stub)
2536 .delete_cloud_control(self.0.request, self.0.options)
2537 .await
2538 .map(crate::Response::into_body)
2539 }
2540
2541 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2545 self.0.request.name = v.into();
2546 self
2547 }
2548 }
2549
2550 #[doc(hidden)]
2551 impl crate::RequestBuilder for DeleteCloudControl {
2552 fn request_options(&mut self) -> &mut crate::RequestOptions {
2553 &mut self.0.options
2554 }
2555 }
2556
2557 #[derive(Clone, Debug)]
2578 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2579
2580 impl ListLocations {
2581 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2582 Self(RequestBuilder::new(stub))
2583 }
2584
2585 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2587 mut self,
2588 v: V,
2589 ) -> Self {
2590 self.0.request = v.into();
2591 self
2592 }
2593
2594 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2596 self.0.options = v.into();
2597 self
2598 }
2599
2600 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2602 (*self.0.stub)
2603 .list_locations(self.0.request, self.0.options)
2604 .await
2605 .map(crate::Response::into_body)
2606 }
2607
2608 pub fn by_page(
2610 self,
2611 ) -> impl google_cloud_gax::paginator::Paginator<
2612 google_cloud_location::model::ListLocationsResponse,
2613 crate::Error,
2614 > {
2615 use std::clone::Clone;
2616 let token = self.0.request.page_token.clone();
2617 let execute = move |token: String| {
2618 let mut builder = self.clone();
2619 builder.0.request = builder.0.request.set_page_token(token);
2620 builder.send()
2621 };
2622 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2623 }
2624
2625 pub fn by_item(
2627 self,
2628 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2629 google_cloud_location::model::ListLocationsResponse,
2630 crate::Error,
2631 > {
2632 use google_cloud_gax::paginator::Paginator;
2633 self.by_page().items()
2634 }
2635
2636 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2638 self.0.request.name = v.into();
2639 self
2640 }
2641
2642 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2644 self.0.request.filter = v.into();
2645 self
2646 }
2647
2648 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2650 self.0.request.page_size = v.into();
2651 self
2652 }
2653
2654 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2656 self.0.request.page_token = v.into();
2657 self
2658 }
2659 }
2660
2661 #[doc(hidden)]
2662 impl crate::RequestBuilder for ListLocations {
2663 fn request_options(&mut self) -> &mut crate::RequestOptions {
2664 &mut self.0.options
2665 }
2666 }
2667
2668 #[derive(Clone, Debug)]
2685 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2686
2687 impl GetLocation {
2688 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2689 Self(RequestBuilder::new(stub))
2690 }
2691
2692 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2694 mut self,
2695 v: V,
2696 ) -> Self {
2697 self.0.request = v.into();
2698 self
2699 }
2700
2701 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2703 self.0.options = v.into();
2704 self
2705 }
2706
2707 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2709 (*self.0.stub)
2710 .get_location(self.0.request, self.0.options)
2711 .await
2712 .map(crate::Response::into_body)
2713 }
2714
2715 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2717 self.0.request.name = v.into();
2718 self
2719 }
2720 }
2721
2722 #[doc(hidden)]
2723 impl crate::RequestBuilder for GetLocation {
2724 fn request_options(&mut self) -> &mut crate::RequestOptions {
2725 &mut self.0.options
2726 }
2727 }
2728
2729 #[derive(Clone, Debug)]
2750 pub struct ListOperations(
2751 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2752 );
2753
2754 impl ListOperations {
2755 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2756 Self(RequestBuilder::new(stub))
2757 }
2758
2759 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2761 mut self,
2762 v: V,
2763 ) -> Self {
2764 self.0.request = v.into();
2765 self
2766 }
2767
2768 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2770 self.0.options = v.into();
2771 self
2772 }
2773
2774 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2776 (*self.0.stub)
2777 .list_operations(self.0.request, self.0.options)
2778 .await
2779 .map(crate::Response::into_body)
2780 }
2781
2782 pub fn by_page(
2784 self,
2785 ) -> impl google_cloud_gax::paginator::Paginator<
2786 google_cloud_longrunning::model::ListOperationsResponse,
2787 crate::Error,
2788 > {
2789 use std::clone::Clone;
2790 let token = self.0.request.page_token.clone();
2791 let execute = move |token: String| {
2792 let mut builder = self.clone();
2793 builder.0.request = builder.0.request.set_page_token(token);
2794 builder.send()
2795 };
2796 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2797 }
2798
2799 pub fn by_item(
2801 self,
2802 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2803 google_cloud_longrunning::model::ListOperationsResponse,
2804 crate::Error,
2805 > {
2806 use google_cloud_gax::paginator::Paginator;
2807 self.by_page().items()
2808 }
2809
2810 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2812 self.0.request.name = v.into();
2813 self
2814 }
2815
2816 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2818 self.0.request.filter = v.into();
2819 self
2820 }
2821
2822 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2824 self.0.request.page_size = v.into();
2825 self
2826 }
2827
2828 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2830 self.0.request.page_token = v.into();
2831 self
2832 }
2833
2834 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2836 self.0.request.return_partial_success = v.into();
2837 self
2838 }
2839 }
2840
2841 #[doc(hidden)]
2842 impl crate::RequestBuilder for ListOperations {
2843 fn request_options(&mut self) -> &mut crate::RequestOptions {
2844 &mut self.0.options
2845 }
2846 }
2847
2848 #[derive(Clone, Debug)]
2865 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2866
2867 impl GetOperation {
2868 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2869 Self(RequestBuilder::new(stub))
2870 }
2871
2872 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2874 mut self,
2875 v: V,
2876 ) -> Self {
2877 self.0.request = v.into();
2878 self
2879 }
2880
2881 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2883 self.0.options = v.into();
2884 self
2885 }
2886
2887 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2889 (*self.0.stub)
2890 .get_operation(self.0.request, self.0.options)
2891 .await
2892 .map(crate::Response::into_body)
2893 }
2894
2895 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2897 self.0.request.name = v.into();
2898 self
2899 }
2900 }
2901
2902 #[doc(hidden)]
2903 impl crate::RequestBuilder for GetOperation {
2904 fn request_options(&mut self) -> &mut crate::RequestOptions {
2905 &mut self.0.options
2906 }
2907 }
2908
2909 #[derive(Clone, Debug)]
2926 pub struct DeleteOperation(
2927 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2928 );
2929
2930 impl DeleteOperation {
2931 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2932 Self(RequestBuilder::new(stub))
2933 }
2934
2935 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2937 mut self,
2938 v: V,
2939 ) -> Self {
2940 self.0.request = v.into();
2941 self
2942 }
2943
2944 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2946 self.0.options = v.into();
2947 self
2948 }
2949
2950 pub async fn send(self) -> Result<()> {
2952 (*self.0.stub)
2953 .delete_operation(self.0.request, self.0.options)
2954 .await
2955 .map(crate::Response::into_body)
2956 }
2957
2958 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2960 self.0.request.name = v.into();
2961 self
2962 }
2963 }
2964
2965 #[doc(hidden)]
2966 impl crate::RequestBuilder for DeleteOperation {
2967 fn request_options(&mut self) -> &mut crate::RequestOptions {
2968 &mut self.0.options
2969 }
2970 }
2971
2972 #[derive(Clone, Debug)]
2989 pub struct CancelOperation(
2990 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2991 );
2992
2993 impl CancelOperation {
2994 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2995 Self(RequestBuilder::new(stub))
2996 }
2997
2998 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3000 mut self,
3001 v: V,
3002 ) -> Self {
3003 self.0.request = v.into();
3004 self
3005 }
3006
3007 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3009 self.0.options = v.into();
3010 self
3011 }
3012
3013 pub async fn send(self) -> Result<()> {
3015 (*self.0.stub)
3016 .cancel_operation(self.0.request, self.0.options)
3017 .await
3018 .map(crate::Response::into_body)
3019 }
3020
3021 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3023 self.0.request.name = v.into();
3024 self
3025 }
3026 }
3027
3028 #[doc(hidden)]
3029 impl crate::RequestBuilder for CancelOperation {
3030 fn request_options(&mut self) -> &mut crate::RequestOptions {
3031 &mut self.0.options
3032 }
3033 }
3034}
3035
3036pub mod deployment {
3037 use crate::Result;
3038
3039 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3053
3054 pub(crate) mod client {
3055 use super::super::super::client::Deployment;
3056 pub struct Factory;
3057 impl crate::ClientFactory for Factory {
3058 type Client = Deployment;
3059 type Credentials = gaxi::options::Credentials;
3060 async fn build(
3061 self,
3062 config: gaxi::options::ClientConfig,
3063 ) -> crate::ClientBuilderResult<Self::Client> {
3064 Self::Client::new(config).await
3065 }
3066 }
3067 }
3068
3069 #[derive(Clone, Debug)]
3071 pub(crate) struct RequestBuilder<R: std::default::Default> {
3072 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3073 request: R,
3074 options: crate::RequestOptions,
3075 }
3076
3077 impl<R> RequestBuilder<R>
3078 where
3079 R: std::default::Default,
3080 {
3081 pub(crate) fn new(
3082 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3083 ) -> Self {
3084 Self {
3085 stub,
3086 request: R::default(),
3087 options: crate::RequestOptions::default(),
3088 }
3089 }
3090 }
3091
3092 #[derive(Clone, Debug)]
3110 pub struct CreateFrameworkDeployment(
3111 RequestBuilder<crate::model::CreateFrameworkDeploymentRequest>,
3112 );
3113
3114 impl CreateFrameworkDeployment {
3115 pub(crate) fn new(
3116 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3117 ) -> Self {
3118 Self(RequestBuilder::new(stub))
3119 }
3120
3121 pub fn with_request<V: Into<crate::model::CreateFrameworkDeploymentRequest>>(
3123 mut self,
3124 v: V,
3125 ) -> Self {
3126 self.0.request = v.into();
3127 self
3128 }
3129
3130 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3132 self.0.options = v.into();
3133 self
3134 }
3135
3136 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3143 (*self.0.stub)
3144 .create_framework_deployment(self.0.request, self.0.options)
3145 .await
3146 .map(crate::Response::into_body)
3147 }
3148
3149 pub fn poller(
3151 self,
3152 ) -> impl google_cloud_lro::Poller<
3153 crate::model::FrameworkDeployment,
3154 crate::model::OperationMetadata,
3155 > {
3156 type Operation = google_cloud_lro::internal::Operation<
3157 crate::model::FrameworkDeployment,
3158 crate::model::OperationMetadata,
3159 >;
3160 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3161 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3162
3163 let stub = self.0.stub.clone();
3164 let mut options = self.0.options.clone();
3165 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3166 let query = move |name| {
3167 let stub = stub.clone();
3168 let options = options.clone();
3169 async {
3170 let op = GetOperation::new(stub)
3171 .set_name(name)
3172 .with_options(options)
3173 .send()
3174 .await?;
3175 Ok(Operation::new(op))
3176 }
3177 };
3178
3179 let start = move || async {
3180 let op = self.send().await?;
3181 Ok(Operation::new(op))
3182 };
3183
3184 google_cloud_lro::internal::new_poller(
3185 polling_error_policy,
3186 polling_backoff_policy,
3187 start,
3188 query,
3189 )
3190 }
3191
3192 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3196 self.0.request.parent = v.into();
3197 self
3198 }
3199
3200 pub fn set_framework_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3202 self.0.request.framework_deployment_id = v.into();
3203 self
3204 }
3205
3206 pub fn set_framework_deployment<T>(mut self, v: T) -> Self
3210 where
3211 T: std::convert::Into<crate::model::FrameworkDeployment>,
3212 {
3213 self.0.request.framework_deployment = std::option::Option::Some(v.into());
3214 self
3215 }
3216
3217 pub fn set_or_clear_framework_deployment<T>(mut self, v: std::option::Option<T>) -> Self
3221 where
3222 T: std::convert::Into<crate::model::FrameworkDeployment>,
3223 {
3224 self.0.request.framework_deployment = v.map(|x| x.into());
3225 self
3226 }
3227 }
3228
3229 #[doc(hidden)]
3230 impl crate::RequestBuilder for CreateFrameworkDeployment {
3231 fn request_options(&mut self) -> &mut crate::RequestOptions {
3232 &mut self.0.options
3233 }
3234 }
3235
3236 #[derive(Clone, Debug)]
3254 pub struct DeleteFrameworkDeployment(
3255 RequestBuilder<crate::model::DeleteFrameworkDeploymentRequest>,
3256 );
3257
3258 impl DeleteFrameworkDeployment {
3259 pub(crate) fn new(
3260 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3261 ) -> Self {
3262 Self(RequestBuilder::new(stub))
3263 }
3264
3265 pub fn with_request<V: Into<crate::model::DeleteFrameworkDeploymentRequest>>(
3267 mut self,
3268 v: V,
3269 ) -> Self {
3270 self.0.request = v.into();
3271 self
3272 }
3273
3274 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3276 self.0.options = v.into();
3277 self
3278 }
3279
3280 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3287 (*self.0.stub)
3288 .delete_framework_deployment(self.0.request, self.0.options)
3289 .await
3290 .map(crate::Response::into_body)
3291 }
3292
3293 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3295 type Operation =
3296 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3297 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3298 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3299
3300 let stub = self.0.stub.clone();
3301 let mut options = self.0.options.clone();
3302 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3303 let query = move |name| {
3304 let stub = stub.clone();
3305 let options = options.clone();
3306 async {
3307 let op = GetOperation::new(stub)
3308 .set_name(name)
3309 .with_options(options)
3310 .send()
3311 .await?;
3312 Ok(Operation::new(op))
3313 }
3314 };
3315
3316 let start = move || async {
3317 let op = self.send().await?;
3318 Ok(Operation::new(op))
3319 };
3320
3321 google_cloud_lro::internal::new_unit_response_poller(
3322 polling_error_policy,
3323 polling_backoff_policy,
3324 start,
3325 query,
3326 )
3327 }
3328
3329 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3333 self.0.request.name = v.into();
3334 self
3335 }
3336
3337 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3339 self.0.request.etag = v.into();
3340 self
3341 }
3342 }
3343
3344 #[doc(hidden)]
3345 impl crate::RequestBuilder for DeleteFrameworkDeployment {
3346 fn request_options(&mut self) -> &mut crate::RequestOptions {
3347 &mut self.0.options
3348 }
3349 }
3350
3351 #[derive(Clone, Debug)]
3368 pub struct GetFrameworkDeployment(RequestBuilder<crate::model::GetFrameworkDeploymentRequest>);
3369
3370 impl GetFrameworkDeployment {
3371 pub(crate) fn new(
3372 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3373 ) -> Self {
3374 Self(RequestBuilder::new(stub))
3375 }
3376
3377 pub fn with_request<V: Into<crate::model::GetFrameworkDeploymentRequest>>(
3379 mut self,
3380 v: V,
3381 ) -> Self {
3382 self.0.request = v.into();
3383 self
3384 }
3385
3386 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3388 self.0.options = v.into();
3389 self
3390 }
3391
3392 pub async fn send(self) -> Result<crate::model::FrameworkDeployment> {
3394 (*self.0.stub)
3395 .get_framework_deployment(self.0.request, self.0.options)
3396 .await
3397 .map(crate::Response::into_body)
3398 }
3399
3400 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3404 self.0.request.name = v.into();
3405 self
3406 }
3407 }
3408
3409 #[doc(hidden)]
3410 impl crate::RequestBuilder for GetFrameworkDeployment {
3411 fn request_options(&mut self) -> &mut crate::RequestOptions {
3412 &mut self.0.options
3413 }
3414 }
3415
3416 #[derive(Clone, Debug)]
3437 pub struct ListFrameworkDeployments(
3438 RequestBuilder<crate::model::ListFrameworkDeploymentsRequest>,
3439 );
3440
3441 impl ListFrameworkDeployments {
3442 pub(crate) fn new(
3443 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3444 ) -> Self {
3445 Self(RequestBuilder::new(stub))
3446 }
3447
3448 pub fn with_request<V: Into<crate::model::ListFrameworkDeploymentsRequest>>(
3450 mut self,
3451 v: V,
3452 ) -> Self {
3453 self.0.request = v.into();
3454 self
3455 }
3456
3457 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3459 self.0.options = v.into();
3460 self
3461 }
3462
3463 pub async fn send(self) -> Result<crate::model::ListFrameworkDeploymentsResponse> {
3465 (*self.0.stub)
3466 .list_framework_deployments(self.0.request, self.0.options)
3467 .await
3468 .map(crate::Response::into_body)
3469 }
3470
3471 pub fn by_page(
3473 self,
3474 ) -> impl google_cloud_gax::paginator::Paginator<
3475 crate::model::ListFrameworkDeploymentsResponse,
3476 crate::Error,
3477 > {
3478 use std::clone::Clone;
3479 let token = self.0.request.page_token.clone();
3480 let execute = move |token: String| {
3481 let mut builder = self.clone();
3482 builder.0.request = builder.0.request.set_page_token(token);
3483 builder.send()
3484 };
3485 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3486 }
3487
3488 pub fn by_item(
3490 self,
3491 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3492 crate::model::ListFrameworkDeploymentsResponse,
3493 crate::Error,
3494 > {
3495 use google_cloud_gax::paginator::Paginator;
3496 self.by_page().items()
3497 }
3498
3499 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3503 self.0.request.parent = v.into();
3504 self
3505 }
3506
3507 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3509 self.0.request.page_size = v.into();
3510 self
3511 }
3512
3513 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3515 self.0.request.page_token = v.into();
3516 self
3517 }
3518
3519 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3521 self.0.request.filter = v.into();
3522 self
3523 }
3524
3525 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3527 self.0.request.order_by = v.into();
3528 self
3529 }
3530 }
3531
3532 #[doc(hidden)]
3533 impl crate::RequestBuilder for ListFrameworkDeployments {
3534 fn request_options(&mut self) -> &mut crate::RequestOptions {
3535 &mut self.0.options
3536 }
3537 }
3538
3539 #[derive(Clone, Debug)]
3556 pub struct GetCloudControlDeployment(
3557 RequestBuilder<crate::model::GetCloudControlDeploymentRequest>,
3558 );
3559
3560 impl GetCloudControlDeployment {
3561 pub(crate) fn new(
3562 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3563 ) -> Self {
3564 Self(RequestBuilder::new(stub))
3565 }
3566
3567 pub fn with_request<V: Into<crate::model::GetCloudControlDeploymentRequest>>(
3569 mut self,
3570 v: V,
3571 ) -> Self {
3572 self.0.request = v.into();
3573 self
3574 }
3575
3576 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3578 self.0.options = v.into();
3579 self
3580 }
3581
3582 pub async fn send(self) -> Result<crate::model::CloudControlDeployment> {
3584 (*self.0.stub)
3585 .get_cloud_control_deployment(self.0.request, self.0.options)
3586 .await
3587 .map(crate::Response::into_body)
3588 }
3589
3590 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3594 self.0.request.name = v.into();
3595 self
3596 }
3597 }
3598
3599 #[doc(hidden)]
3600 impl crate::RequestBuilder for GetCloudControlDeployment {
3601 fn request_options(&mut self) -> &mut crate::RequestOptions {
3602 &mut self.0.options
3603 }
3604 }
3605
3606 #[derive(Clone, Debug)]
3627 pub struct ListCloudControlDeployments(
3628 RequestBuilder<crate::model::ListCloudControlDeploymentsRequest>,
3629 );
3630
3631 impl ListCloudControlDeployments {
3632 pub(crate) fn new(
3633 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3634 ) -> Self {
3635 Self(RequestBuilder::new(stub))
3636 }
3637
3638 pub fn with_request<V: Into<crate::model::ListCloudControlDeploymentsRequest>>(
3640 mut self,
3641 v: V,
3642 ) -> Self {
3643 self.0.request = v.into();
3644 self
3645 }
3646
3647 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3649 self.0.options = v.into();
3650 self
3651 }
3652
3653 pub async fn send(self) -> Result<crate::model::ListCloudControlDeploymentsResponse> {
3655 (*self.0.stub)
3656 .list_cloud_control_deployments(self.0.request, self.0.options)
3657 .await
3658 .map(crate::Response::into_body)
3659 }
3660
3661 pub fn by_page(
3663 self,
3664 ) -> impl google_cloud_gax::paginator::Paginator<
3665 crate::model::ListCloudControlDeploymentsResponse,
3666 crate::Error,
3667 > {
3668 use std::clone::Clone;
3669 let token = self.0.request.page_token.clone();
3670 let execute = move |token: String| {
3671 let mut builder = self.clone();
3672 builder.0.request = builder.0.request.set_page_token(token);
3673 builder.send()
3674 };
3675 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3676 }
3677
3678 pub fn by_item(
3680 self,
3681 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3682 crate::model::ListCloudControlDeploymentsResponse,
3683 crate::Error,
3684 > {
3685 use google_cloud_gax::paginator::Paginator;
3686 self.by_page().items()
3687 }
3688
3689 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3693 self.0.request.parent = v.into();
3694 self
3695 }
3696
3697 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3699 self.0.request.page_size = v.into();
3700 self
3701 }
3702
3703 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3705 self.0.request.page_token = v.into();
3706 self
3707 }
3708
3709 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3711 self.0.request.filter = v.into();
3712 self
3713 }
3714
3715 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3717 self.0.request.order_by = v.into();
3718 self
3719 }
3720 }
3721
3722 #[doc(hidden)]
3723 impl crate::RequestBuilder for ListCloudControlDeployments {
3724 fn request_options(&mut self) -> &mut crate::RequestOptions {
3725 &mut self.0.options
3726 }
3727 }
3728
3729 #[derive(Clone, Debug)]
3750 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3751
3752 impl ListLocations {
3753 pub(crate) fn new(
3754 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3755 ) -> Self {
3756 Self(RequestBuilder::new(stub))
3757 }
3758
3759 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3761 mut self,
3762 v: V,
3763 ) -> Self {
3764 self.0.request = v.into();
3765 self
3766 }
3767
3768 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3770 self.0.options = v.into();
3771 self
3772 }
3773
3774 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3776 (*self.0.stub)
3777 .list_locations(self.0.request, self.0.options)
3778 .await
3779 .map(crate::Response::into_body)
3780 }
3781
3782 pub fn by_page(
3784 self,
3785 ) -> impl google_cloud_gax::paginator::Paginator<
3786 google_cloud_location::model::ListLocationsResponse,
3787 crate::Error,
3788 > {
3789 use std::clone::Clone;
3790 let token = self.0.request.page_token.clone();
3791 let execute = move |token: String| {
3792 let mut builder = self.clone();
3793 builder.0.request = builder.0.request.set_page_token(token);
3794 builder.send()
3795 };
3796 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3797 }
3798
3799 pub fn by_item(
3801 self,
3802 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3803 google_cloud_location::model::ListLocationsResponse,
3804 crate::Error,
3805 > {
3806 use google_cloud_gax::paginator::Paginator;
3807 self.by_page().items()
3808 }
3809
3810 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3812 self.0.request.name = v.into();
3813 self
3814 }
3815
3816 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3818 self.0.request.filter = v.into();
3819 self
3820 }
3821
3822 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3824 self.0.request.page_size = v.into();
3825 self
3826 }
3827
3828 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3830 self.0.request.page_token = v.into();
3831 self
3832 }
3833 }
3834
3835 #[doc(hidden)]
3836 impl crate::RequestBuilder for ListLocations {
3837 fn request_options(&mut self) -> &mut crate::RequestOptions {
3838 &mut self.0.options
3839 }
3840 }
3841
3842 #[derive(Clone, Debug)]
3859 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3860
3861 impl GetLocation {
3862 pub(crate) fn new(
3863 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3864 ) -> Self {
3865 Self(RequestBuilder::new(stub))
3866 }
3867
3868 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3870 mut self,
3871 v: V,
3872 ) -> Self {
3873 self.0.request = v.into();
3874 self
3875 }
3876
3877 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3879 self.0.options = v.into();
3880 self
3881 }
3882
3883 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3885 (*self.0.stub)
3886 .get_location(self.0.request, self.0.options)
3887 .await
3888 .map(crate::Response::into_body)
3889 }
3890
3891 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3893 self.0.request.name = v.into();
3894 self
3895 }
3896 }
3897
3898 #[doc(hidden)]
3899 impl crate::RequestBuilder for GetLocation {
3900 fn request_options(&mut self) -> &mut crate::RequestOptions {
3901 &mut self.0.options
3902 }
3903 }
3904
3905 #[derive(Clone, Debug)]
3926 pub struct ListOperations(
3927 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3928 );
3929
3930 impl ListOperations {
3931 pub(crate) fn new(
3932 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3933 ) -> Self {
3934 Self(RequestBuilder::new(stub))
3935 }
3936
3937 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3939 mut self,
3940 v: V,
3941 ) -> Self {
3942 self.0.request = v.into();
3943 self
3944 }
3945
3946 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3948 self.0.options = v.into();
3949 self
3950 }
3951
3952 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3954 (*self.0.stub)
3955 .list_operations(self.0.request, self.0.options)
3956 .await
3957 .map(crate::Response::into_body)
3958 }
3959
3960 pub fn by_page(
3962 self,
3963 ) -> impl google_cloud_gax::paginator::Paginator<
3964 google_cloud_longrunning::model::ListOperationsResponse,
3965 crate::Error,
3966 > {
3967 use std::clone::Clone;
3968 let token = self.0.request.page_token.clone();
3969 let execute = move |token: String| {
3970 let mut builder = self.clone();
3971 builder.0.request = builder.0.request.set_page_token(token);
3972 builder.send()
3973 };
3974 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3975 }
3976
3977 pub fn by_item(
3979 self,
3980 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3981 google_cloud_longrunning::model::ListOperationsResponse,
3982 crate::Error,
3983 > {
3984 use google_cloud_gax::paginator::Paginator;
3985 self.by_page().items()
3986 }
3987
3988 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3990 self.0.request.name = v.into();
3991 self
3992 }
3993
3994 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3996 self.0.request.filter = v.into();
3997 self
3998 }
3999
4000 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4002 self.0.request.page_size = v.into();
4003 self
4004 }
4005
4006 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4008 self.0.request.page_token = v.into();
4009 self
4010 }
4011
4012 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4014 self.0.request.return_partial_success = v.into();
4015 self
4016 }
4017 }
4018
4019 #[doc(hidden)]
4020 impl crate::RequestBuilder for ListOperations {
4021 fn request_options(&mut self) -> &mut crate::RequestOptions {
4022 &mut self.0.options
4023 }
4024 }
4025
4026 #[derive(Clone, Debug)]
4043 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4044
4045 impl GetOperation {
4046 pub(crate) fn new(
4047 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
4048 ) -> Self {
4049 Self(RequestBuilder::new(stub))
4050 }
4051
4052 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4054 mut self,
4055 v: V,
4056 ) -> Self {
4057 self.0.request = v.into();
4058 self
4059 }
4060
4061 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4063 self.0.options = v.into();
4064 self
4065 }
4066
4067 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4069 (*self.0.stub)
4070 .get_operation(self.0.request, self.0.options)
4071 .await
4072 .map(crate::Response::into_body)
4073 }
4074
4075 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4077 self.0.request.name = v.into();
4078 self
4079 }
4080 }
4081
4082 #[doc(hidden)]
4083 impl crate::RequestBuilder for GetOperation {
4084 fn request_options(&mut self) -> &mut crate::RequestOptions {
4085 &mut self.0.options
4086 }
4087 }
4088
4089 #[derive(Clone, Debug)]
4106 pub struct DeleteOperation(
4107 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4108 );
4109
4110 impl DeleteOperation {
4111 pub(crate) fn new(
4112 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
4113 ) -> Self {
4114 Self(RequestBuilder::new(stub))
4115 }
4116
4117 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4119 mut self,
4120 v: V,
4121 ) -> Self {
4122 self.0.request = v.into();
4123 self
4124 }
4125
4126 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4128 self.0.options = v.into();
4129 self
4130 }
4131
4132 pub async fn send(self) -> Result<()> {
4134 (*self.0.stub)
4135 .delete_operation(self.0.request, self.0.options)
4136 .await
4137 .map(crate::Response::into_body)
4138 }
4139
4140 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4142 self.0.request.name = v.into();
4143 self
4144 }
4145 }
4146
4147 #[doc(hidden)]
4148 impl crate::RequestBuilder for DeleteOperation {
4149 fn request_options(&mut self) -> &mut crate::RequestOptions {
4150 &mut self.0.options
4151 }
4152 }
4153
4154 #[derive(Clone, Debug)]
4171 pub struct CancelOperation(
4172 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4173 );
4174
4175 impl CancelOperation {
4176 pub(crate) fn new(
4177 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
4178 ) -> Self {
4179 Self(RequestBuilder::new(stub))
4180 }
4181
4182 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4184 mut self,
4185 v: V,
4186 ) -> Self {
4187 self.0.request = v.into();
4188 self
4189 }
4190
4191 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4193 self.0.options = v.into();
4194 self
4195 }
4196
4197 pub async fn send(self) -> Result<()> {
4199 (*self.0.stub)
4200 .cancel_operation(self.0.request, self.0.options)
4201 .await
4202 .map(crate::Response::into_body)
4203 }
4204
4205 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4207 self.0.request.name = v.into();
4208 self
4209 }
4210 }
4211
4212 #[doc(hidden)]
4213 impl crate::RequestBuilder for CancelOperation {
4214 fn request_options(&mut self) -> &mut crate::RequestOptions {
4215 &mut self.0.options
4216 }
4217 }
4218}
4219
4220pub mod monitoring {
4221 use crate::Result;
4222
4223 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4237
4238 pub(crate) mod client {
4239 use super::super::super::client::Monitoring;
4240 pub struct Factory;
4241 impl crate::ClientFactory for Factory {
4242 type Client = Monitoring;
4243 type Credentials = gaxi::options::Credentials;
4244 async fn build(
4245 self,
4246 config: gaxi::options::ClientConfig,
4247 ) -> crate::ClientBuilderResult<Self::Client> {
4248 Self::Client::new(config).await
4249 }
4250 }
4251 }
4252
4253 #[derive(Clone, Debug)]
4255 pub(crate) struct RequestBuilder<R: std::default::Default> {
4256 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4257 request: R,
4258 options: crate::RequestOptions,
4259 }
4260
4261 impl<R> RequestBuilder<R>
4262 where
4263 R: std::default::Default,
4264 {
4265 pub(crate) fn new(
4266 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4267 ) -> Self {
4268 Self {
4269 stub,
4270 request: R::default(),
4271 options: crate::RequestOptions::default(),
4272 }
4273 }
4274 }
4275
4276 #[derive(Clone, Debug)]
4297 pub struct ListFrameworkComplianceSummaries(
4298 RequestBuilder<crate::model::ListFrameworkComplianceSummariesRequest>,
4299 );
4300
4301 impl ListFrameworkComplianceSummaries {
4302 pub(crate) fn new(
4303 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4304 ) -> Self {
4305 Self(RequestBuilder::new(stub))
4306 }
4307
4308 pub fn with_request<V: Into<crate::model::ListFrameworkComplianceSummariesRequest>>(
4310 mut self,
4311 v: V,
4312 ) -> Self {
4313 self.0.request = v.into();
4314 self
4315 }
4316
4317 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4319 self.0.options = v.into();
4320 self
4321 }
4322
4323 pub async fn send(self) -> Result<crate::model::ListFrameworkComplianceSummariesResponse> {
4325 (*self.0.stub)
4326 .list_framework_compliance_summaries(self.0.request, self.0.options)
4327 .await
4328 .map(crate::Response::into_body)
4329 }
4330
4331 pub fn by_page(
4333 self,
4334 ) -> impl google_cloud_gax::paginator::Paginator<
4335 crate::model::ListFrameworkComplianceSummariesResponse,
4336 crate::Error,
4337 > {
4338 use std::clone::Clone;
4339 let token = self.0.request.page_token.clone();
4340 let execute = move |token: String| {
4341 let mut builder = self.clone();
4342 builder.0.request = builder.0.request.set_page_token(token);
4343 builder.send()
4344 };
4345 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4346 }
4347
4348 pub fn by_item(
4350 self,
4351 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4352 crate::model::ListFrameworkComplianceSummariesResponse,
4353 crate::Error,
4354 > {
4355 use google_cloud_gax::paginator::Paginator;
4356 self.by_page().items()
4357 }
4358
4359 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4363 self.0.request.parent = v.into();
4364 self
4365 }
4366
4367 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4369 self.0.request.page_size = v.into();
4370 self
4371 }
4372
4373 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4375 self.0.request.page_token = v.into();
4376 self
4377 }
4378
4379 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4381 self.0.request.filter = v.into();
4382 self
4383 }
4384 }
4385
4386 #[doc(hidden)]
4387 impl crate::RequestBuilder for ListFrameworkComplianceSummaries {
4388 fn request_options(&mut self) -> &mut crate::RequestOptions {
4389 &mut self.0.options
4390 }
4391 }
4392
4393 #[derive(Clone, Debug)]
4414 pub struct ListFindingSummaries(RequestBuilder<crate::model::ListFindingSummariesRequest>);
4415
4416 impl ListFindingSummaries {
4417 pub(crate) fn new(
4418 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4419 ) -> Self {
4420 Self(RequestBuilder::new(stub))
4421 }
4422
4423 pub fn with_request<V: Into<crate::model::ListFindingSummariesRequest>>(
4425 mut self,
4426 v: V,
4427 ) -> Self {
4428 self.0.request = v.into();
4429 self
4430 }
4431
4432 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4434 self.0.options = v.into();
4435 self
4436 }
4437
4438 pub async fn send(self) -> Result<crate::model::ListFindingSummariesResponse> {
4440 (*self.0.stub)
4441 .list_finding_summaries(self.0.request, self.0.options)
4442 .await
4443 .map(crate::Response::into_body)
4444 }
4445
4446 pub fn by_page(
4448 self,
4449 ) -> impl google_cloud_gax::paginator::Paginator<
4450 crate::model::ListFindingSummariesResponse,
4451 crate::Error,
4452 > {
4453 use std::clone::Clone;
4454 let token = self.0.request.page_token.clone();
4455 let execute = move |token: String| {
4456 let mut builder = self.clone();
4457 builder.0.request = builder.0.request.set_page_token(token);
4458 builder.send()
4459 };
4460 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4461 }
4462
4463 pub fn by_item(
4465 self,
4466 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4467 crate::model::ListFindingSummariesResponse,
4468 crate::Error,
4469 > {
4470 use google_cloud_gax::paginator::Paginator;
4471 self.by_page().items()
4472 }
4473
4474 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4478 self.0.request.parent = v.into();
4479 self
4480 }
4481
4482 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4484 self.0.request.page_size = v.into();
4485 self
4486 }
4487
4488 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4490 self.0.request.page_token = v.into();
4491 self
4492 }
4493
4494 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4496 self.0.request.filter = v.into();
4497 self
4498 }
4499
4500 #[deprecated]
4502 pub fn set_end_time<T>(mut self, v: T) -> Self
4503 where
4504 T: std::convert::Into<wkt::Timestamp>,
4505 {
4506 self.0.request.end_time = std::option::Option::Some(v.into());
4507 self
4508 }
4509
4510 #[deprecated]
4512 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4513 where
4514 T: std::convert::Into<wkt::Timestamp>,
4515 {
4516 self.0.request.end_time = v.map(|x| x.into());
4517 self
4518 }
4519 }
4520
4521 #[doc(hidden)]
4522 impl crate::RequestBuilder for ListFindingSummaries {
4523 fn request_options(&mut self) -> &mut crate::RequestOptions {
4524 &mut self.0.options
4525 }
4526 }
4527
4528 #[derive(Clone, Debug)]
4545 pub struct FetchFrameworkComplianceReport(
4546 RequestBuilder<crate::model::FetchFrameworkComplianceReportRequest>,
4547 );
4548
4549 impl FetchFrameworkComplianceReport {
4550 pub(crate) fn new(
4551 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4552 ) -> Self {
4553 Self(RequestBuilder::new(stub))
4554 }
4555
4556 pub fn with_request<V: Into<crate::model::FetchFrameworkComplianceReportRequest>>(
4558 mut self,
4559 v: V,
4560 ) -> Self {
4561 self.0.request = v.into();
4562 self
4563 }
4564
4565 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4567 self.0.options = v.into();
4568 self
4569 }
4570
4571 pub async fn send(self) -> Result<crate::model::FrameworkComplianceReport> {
4573 (*self.0.stub)
4574 .fetch_framework_compliance_report(self.0.request, self.0.options)
4575 .await
4576 .map(crate::Response::into_body)
4577 }
4578
4579 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4583 self.0.request.name = v.into();
4584 self
4585 }
4586
4587 pub fn set_end_time<T>(mut self, v: T) -> Self
4589 where
4590 T: std::convert::Into<wkt::Timestamp>,
4591 {
4592 self.0.request.end_time = std::option::Option::Some(v.into());
4593 self
4594 }
4595
4596 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4598 where
4599 T: std::convert::Into<wkt::Timestamp>,
4600 {
4601 self.0.request.end_time = v.map(|x| x.into());
4602 self
4603 }
4604 }
4605
4606 #[doc(hidden)]
4607 impl crate::RequestBuilder for FetchFrameworkComplianceReport {
4608 fn request_options(&mut self) -> &mut crate::RequestOptions {
4609 &mut self.0.options
4610 }
4611 }
4612
4613 #[derive(Clone, Debug)]
4634 pub struct ListControlComplianceSummaries(
4635 RequestBuilder<crate::model::ListControlComplianceSummariesRequest>,
4636 );
4637
4638 impl ListControlComplianceSummaries {
4639 pub(crate) fn new(
4640 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4641 ) -> Self {
4642 Self(RequestBuilder::new(stub))
4643 }
4644
4645 pub fn with_request<V: Into<crate::model::ListControlComplianceSummariesRequest>>(
4647 mut self,
4648 v: V,
4649 ) -> Self {
4650 self.0.request = v.into();
4651 self
4652 }
4653
4654 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4656 self.0.options = v.into();
4657 self
4658 }
4659
4660 pub async fn send(self) -> Result<crate::model::ListControlComplianceSummariesResponse> {
4662 (*self.0.stub)
4663 .list_control_compliance_summaries(self.0.request, self.0.options)
4664 .await
4665 .map(crate::Response::into_body)
4666 }
4667
4668 pub fn by_page(
4670 self,
4671 ) -> impl google_cloud_gax::paginator::Paginator<
4672 crate::model::ListControlComplianceSummariesResponse,
4673 crate::Error,
4674 > {
4675 use std::clone::Clone;
4676 let token = self.0.request.page_token.clone();
4677 let execute = move |token: String| {
4678 let mut builder = self.clone();
4679 builder.0.request = builder.0.request.set_page_token(token);
4680 builder.send()
4681 };
4682 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4683 }
4684
4685 pub fn by_item(
4687 self,
4688 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4689 crate::model::ListControlComplianceSummariesResponse,
4690 crate::Error,
4691 > {
4692 use google_cloud_gax::paginator::Paginator;
4693 self.by_page().items()
4694 }
4695
4696 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4700 self.0.request.parent = v.into();
4701 self
4702 }
4703
4704 #[deprecated]
4706 pub fn set_end_time<T>(mut self, v: T) -> Self
4707 where
4708 T: std::convert::Into<wkt::Timestamp>,
4709 {
4710 self.0.request.end_time = std::option::Option::Some(v.into());
4711 self
4712 }
4713
4714 #[deprecated]
4716 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4717 where
4718 T: std::convert::Into<wkt::Timestamp>,
4719 {
4720 self.0.request.end_time = v.map(|x| x.into());
4721 self
4722 }
4723
4724 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4726 self.0.request.page_size = v.into();
4727 self
4728 }
4729
4730 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4732 self.0.request.page_token = v.into();
4733 self
4734 }
4735
4736 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4738 self.0.request.filter = v.into();
4739 self
4740 }
4741 }
4742
4743 #[doc(hidden)]
4744 impl crate::RequestBuilder for ListControlComplianceSummaries {
4745 fn request_options(&mut self) -> &mut crate::RequestOptions {
4746 &mut self.0.options
4747 }
4748 }
4749
4750 #[derive(Clone, Debug)]
4767 pub struct AggregateFrameworkComplianceReport(
4768 RequestBuilder<crate::model::AggregateFrameworkComplianceReportRequest>,
4769 );
4770
4771 impl AggregateFrameworkComplianceReport {
4772 pub(crate) fn new(
4773 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4774 ) -> Self {
4775 Self(RequestBuilder::new(stub))
4776 }
4777
4778 pub fn with_request<V: Into<crate::model::AggregateFrameworkComplianceReportRequest>>(
4780 mut self,
4781 v: V,
4782 ) -> Self {
4783 self.0.request = v.into();
4784 self
4785 }
4786
4787 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4789 self.0.options = v.into();
4790 self
4791 }
4792
4793 pub async fn send(
4795 self,
4796 ) -> Result<crate::model::AggregateFrameworkComplianceReportResponse> {
4797 (*self.0.stub)
4798 .aggregate_framework_compliance_report(self.0.request, self.0.options)
4799 .await
4800 .map(crate::Response::into_body)
4801 }
4802
4803 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4807 self.0.request.name = v.into();
4808 self
4809 }
4810
4811 pub fn set_interval<T>(mut self, v: T) -> Self
4813 where
4814 T: std::convert::Into<google_cloud_type::model::Interval>,
4815 {
4816 self.0.request.interval = std::option::Option::Some(v.into());
4817 self
4818 }
4819
4820 pub fn set_or_clear_interval<T>(mut self, v: std::option::Option<T>) -> Self
4822 where
4823 T: std::convert::Into<google_cloud_type::model::Interval>,
4824 {
4825 self.0.request.interval = v.map(|x| x.into());
4826 self
4827 }
4828
4829 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4831 self.0.request.filter = v.into();
4832 self
4833 }
4834 }
4835
4836 #[doc(hidden)]
4837 impl crate::RequestBuilder for AggregateFrameworkComplianceReport {
4838 fn request_options(&mut self) -> &mut crate::RequestOptions {
4839 &mut self.0.options
4840 }
4841 }
4842
4843 #[derive(Clone, Debug)]
4864 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4865
4866 impl ListLocations {
4867 pub(crate) fn new(
4868 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4869 ) -> Self {
4870 Self(RequestBuilder::new(stub))
4871 }
4872
4873 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4875 mut self,
4876 v: V,
4877 ) -> Self {
4878 self.0.request = v.into();
4879 self
4880 }
4881
4882 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4884 self.0.options = v.into();
4885 self
4886 }
4887
4888 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4890 (*self.0.stub)
4891 .list_locations(self.0.request, self.0.options)
4892 .await
4893 .map(crate::Response::into_body)
4894 }
4895
4896 pub fn by_page(
4898 self,
4899 ) -> impl google_cloud_gax::paginator::Paginator<
4900 google_cloud_location::model::ListLocationsResponse,
4901 crate::Error,
4902 > {
4903 use std::clone::Clone;
4904 let token = self.0.request.page_token.clone();
4905 let execute = move |token: String| {
4906 let mut builder = self.clone();
4907 builder.0.request = builder.0.request.set_page_token(token);
4908 builder.send()
4909 };
4910 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4911 }
4912
4913 pub fn by_item(
4915 self,
4916 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4917 google_cloud_location::model::ListLocationsResponse,
4918 crate::Error,
4919 > {
4920 use google_cloud_gax::paginator::Paginator;
4921 self.by_page().items()
4922 }
4923
4924 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4926 self.0.request.name = v.into();
4927 self
4928 }
4929
4930 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4932 self.0.request.filter = v.into();
4933 self
4934 }
4935
4936 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4938 self.0.request.page_size = v.into();
4939 self
4940 }
4941
4942 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4944 self.0.request.page_token = v.into();
4945 self
4946 }
4947 }
4948
4949 #[doc(hidden)]
4950 impl crate::RequestBuilder for ListLocations {
4951 fn request_options(&mut self) -> &mut crate::RequestOptions {
4952 &mut self.0.options
4953 }
4954 }
4955
4956 #[derive(Clone, Debug)]
4973 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4974
4975 impl GetLocation {
4976 pub(crate) fn new(
4977 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4978 ) -> Self {
4979 Self(RequestBuilder::new(stub))
4980 }
4981
4982 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4984 mut self,
4985 v: V,
4986 ) -> Self {
4987 self.0.request = v.into();
4988 self
4989 }
4990
4991 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4993 self.0.options = v.into();
4994 self
4995 }
4996
4997 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4999 (*self.0.stub)
5000 .get_location(self.0.request, self.0.options)
5001 .await
5002 .map(crate::Response::into_body)
5003 }
5004
5005 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5007 self.0.request.name = v.into();
5008 self
5009 }
5010 }
5011
5012 #[doc(hidden)]
5013 impl crate::RequestBuilder for GetLocation {
5014 fn request_options(&mut self) -> &mut crate::RequestOptions {
5015 &mut self.0.options
5016 }
5017 }
5018
5019 #[derive(Clone, Debug)]
5040 pub struct ListOperations(
5041 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5042 );
5043
5044 impl ListOperations {
5045 pub(crate) fn new(
5046 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5047 ) -> Self {
5048 Self(RequestBuilder::new(stub))
5049 }
5050
5051 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5053 mut self,
5054 v: V,
5055 ) -> Self {
5056 self.0.request = v.into();
5057 self
5058 }
5059
5060 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5062 self.0.options = v.into();
5063 self
5064 }
5065
5066 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5068 (*self.0.stub)
5069 .list_operations(self.0.request, self.0.options)
5070 .await
5071 .map(crate::Response::into_body)
5072 }
5073
5074 pub fn by_page(
5076 self,
5077 ) -> impl google_cloud_gax::paginator::Paginator<
5078 google_cloud_longrunning::model::ListOperationsResponse,
5079 crate::Error,
5080 > {
5081 use std::clone::Clone;
5082 let token = self.0.request.page_token.clone();
5083 let execute = move |token: String| {
5084 let mut builder = self.clone();
5085 builder.0.request = builder.0.request.set_page_token(token);
5086 builder.send()
5087 };
5088 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5089 }
5090
5091 pub fn by_item(
5093 self,
5094 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5095 google_cloud_longrunning::model::ListOperationsResponse,
5096 crate::Error,
5097 > {
5098 use google_cloud_gax::paginator::Paginator;
5099 self.by_page().items()
5100 }
5101
5102 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5104 self.0.request.name = v.into();
5105 self
5106 }
5107
5108 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5110 self.0.request.filter = v.into();
5111 self
5112 }
5113
5114 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5116 self.0.request.page_size = v.into();
5117 self
5118 }
5119
5120 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5122 self.0.request.page_token = v.into();
5123 self
5124 }
5125
5126 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5128 self.0.request.return_partial_success = v.into();
5129 self
5130 }
5131 }
5132
5133 #[doc(hidden)]
5134 impl crate::RequestBuilder for ListOperations {
5135 fn request_options(&mut self) -> &mut crate::RequestOptions {
5136 &mut self.0.options
5137 }
5138 }
5139
5140 #[derive(Clone, Debug)]
5157 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5158
5159 impl GetOperation {
5160 pub(crate) fn new(
5161 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5162 ) -> Self {
5163 Self(RequestBuilder::new(stub))
5164 }
5165
5166 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5168 mut self,
5169 v: V,
5170 ) -> Self {
5171 self.0.request = v.into();
5172 self
5173 }
5174
5175 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5177 self.0.options = v.into();
5178 self
5179 }
5180
5181 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5183 (*self.0.stub)
5184 .get_operation(self.0.request, self.0.options)
5185 .await
5186 .map(crate::Response::into_body)
5187 }
5188
5189 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5191 self.0.request.name = v.into();
5192 self
5193 }
5194 }
5195
5196 #[doc(hidden)]
5197 impl crate::RequestBuilder for GetOperation {
5198 fn request_options(&mut self) -> &mut crate::RequestOptions {
5199 &mut self.0.options
5200 }
5201 }
5202
5203 #[derive(Clone, Debug)]
5220 pub struct DeleteOperation(
5221 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5222 );
5223
5224 impl DeleteOperation {
5225 pub(crate) fn new(
5226 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5227 ) -> Self {
5228 Self(RequestBuilder::new(stub))
5229 }
5230
5231 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5233 mut self,
5234 v: V,
5235 ) -> Self {
5236 self.0.request = v.into();
5237 self
5238 }
5239
5240 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5242 self.0.options = v.into();
5243 self
5244 }
5245
5246 pub async fn send(self) -> Result<()> {
5248 (*self.0.stub)
5249 .delete_operation(self.0.request, self.0.options)
5250 .await
5251 .map(crate::Response::into_body)
5252 }
5253
5254 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5256 self.0.request.name = v.into();
5257 self
5258 }
5259 }
5260
5261 #[doc(hidden)]
5262 impl crate::RequestBuilder for DeleteOperation {
5263 fn request_options(&mut self) -> &mut crate::RequestOptions {
5264 &mut self.0.options
5265 }
5266 }
5267
5268 #[derive(Clone, Debug)]
5285 pub struct CancelOperation(
5286 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5287 );
5288
5289 impl CancelOperation {
5290 pub(crate) fn new(
5291 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5292 ) -> Self {
5293 Self(RequestBuilder::new(stub))
5294 }
5295
5296 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5298 mut self,
5299 v: V,
5300 ) -> Self {
5301 self.0.request = v.into();
5302 self
5303 }
5304
5305 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5307 self.0.options = v.into();
5308 self
5309 }
5310
5311 pub async fn send(self) -> Result<()> {
5313 (*self.0.stub)
5314 .cancel_operation(self.0.request, self.0.options)
5315 .await
5316 .map(crate::Response::into_body)
5317 }
5318
5319 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5321 self.0.request.name = v.into();
5322 self
5323 }
5324 }
5325
5326 #[doc(hidden)]
5327 impl crate::RequestBuilder for CancelOperation {
5328 fn request_options(&mut self) -> &mut crate::RequestOptions {
5329 &mut self.0.options
5330 }
5331 }
5332}