1pub mod audit {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::Audit;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = Audit;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: gax::options::RequestOptions::default(),
68 }
69 }
70 }
71
72 #[derive(Clone, Debug)]
89 pub struct GenerateFrameworkAuditScopeReport(
90 RequestBuilder<crate::model::GenerateFrameworkAuditScopeReportRequest>,
91 );
92
93 impl GenerateFrameworkAuditScopeReport {
94 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
95 Self(RequestBuilder::new(stub))
96 }
97
98 pub fn with_request<V: Into<crate::model::GenerateFrameworkAuditScopeReportRequest>>(
100 mut self,
101 v: V,
102 ) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 pub async fn send(self) -> Result<crate::model::GenerateFrameworkAuditScopeReportResponse> {
115 (*self.0.stub)
116 .generate_framework_audit_scope_report(self.0.request, self.0.options)
117 .await
118 .map(gax::response::Response::into_body)
119 }
120
121 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
125 self.0.request.scope = v.into();
126 self
127 }
128
129 pub fn set_report_format<
133 T: Into<crate::model::generate_framework_audit_scope_report_request::Format>,
134 >(
135 mut self,
136 v: T,
137 ) -> Self {
138 self.0.request.report_format = v.into();
139 self
140 }
141
142 pub fn set_compliance_framework<T: Into<std::string::String>>(mut self, v: T) -> Self {
146 self.0.request.compliance_framework = v.into();
147 self
148 }
149 }
150
151 #[doc(hidden)]
152 impl gax::options::internal::RequestBuilder for GenerateFrameworkAuditScopeReport {
153 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
154 &mut self.0.options
155 }
156 }
157
158 #[derive(Clone, Debug)]
176 pub struct CreateFrameworkAudit(RequestBuilder<crate::model::CreateFrameworkAuditRequest>);
177
178 impl CreateFrameworkAudit {
179 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
180 Self(RequestBuilder::new(stub))
181 }
182
183 pub fn with_request<V: Into<crate::model::CreateFrameworkAuditRequest>>(
185 mut self,
186 v: V,
187 ) -> Self {
188 self.0.request = v.into();
189 self
190 }
191
192 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
194 self.0.options = v.into();
195 self
196 }
197
198 pub async fn send(self) -> Result<longrunning::model::Operation> {
205 (*self.0.stub)
206 .create_framework_audit(self.0.request, self.0.options)
207 .await
208 .map(gax::response::Response::into_body)
209 }
210
211 pub fn poller(
213 self,
214 ) -> impl lro::Poller<crate::model::FrameworkAudit, crate::model::OperationMetadata>
215 {
216 type Operation = lro::internal::Operation<
217 crate::model::FrameworkAudit,
218 crate::model::OperationMetadata,
219 >;
220 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
221 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
222
223 let stub = self.0.stub.clone();
224 let mut options = self.0.options.clone();
225 options.set_retry_policy(gax::retry_policy::NeverRetry);
226 let query = move |name| {
227 let stub = stub.clone();
228 let options = options.clone();
229 async {
230 let op = GetOperation::new(stub)
231 .set_name(name)
232 .with_options(options)
233 .send()
234 .await?;
235 Ok(Operation::new(op))
236 }
237 };
238
239 let start = move || async {
240 let op = self.send().await?;
241 Ok(Operation::new(op))
242 };
243
244 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
245 }
246
247 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
251 self.0.request.parent = v.into();
252 self
253 }
254
255 pub fn set_framework_audit_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
257 self.0.request.framework_audit_id = v.into();
258 self
259 }
260
261 pub fn set_framework_audit<T>(mut self, v: T) -> Self
265 where
266 T: std::convert::Into<crate::model::FrameworkAudit>,
267 {
268 self.0.request.framework_audit = std::option::Option::Some(v.into());
269 self
270 }
271
272 pub fn set_or_clear_framework_audit<T>(mut self, v: std::option::Option<T>) -> Self
276 where
277 T: std::convert::Into<crate::model::FrameworkAudit>,
278 {
279 self.0.request.framework_audit = v.map(|x| x.into());
280 self
281 }
282 }
283
284 #[doc(hidden)]
285 impl gax::options::internal::RequestBuilder for CreateFrameworkAudit {
286 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
287 &mut self.0.options
288 }
289 }
290
291 #[derive(Clone, Debug)]
312 pub struct ListFrameworkAudits(RequestBuilder<crate::model::ListFrameworkAuditsRequest>);
313
314 impl ListFrameworkAudits {
315 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
316 Self(RequestBuilder::new(stub))
317 }
318
319 pub fn with_request<V: Into<crate::model::ListFrameworkAuditsRequest>>(
321 mut self,
322 v: V,
323 ) -> Self {
324 self.0.request = v.into();
325 self
326 }
327
328 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
330 self.0.options = v.into();
331 self
332 }
333
334 pub async fn send(self) -> Result<crate::model::ListFrameworkAuditsResponse> {
336 (*self.0.stub)
337 .list_framework_audits(self.0.request, self.0.options)
338 .await
339 .map(gax::response::Response::into_body)
340 }
341
342 pub fn by_page(
344 self,
345 ) -> impl gax::paginator::Paginator<crate::model::ListFrameworkAuditsResponse, gax::error::Error>
346 {
347 use std::clone::Clone;
348 let token = self.0.request.page_token.clone();
349 let execute = move |token: String| {
350 let mut builder = self.clone();
351 builder.0.request = builder.0.request.set_page_token(token);
352 builder.send()
353 };
354 gax::paginator::internal::new_paginator(token, execute)
355 }
356
357 pub fn by_item(
359 self,
360 ) -> impl gax::paginator::ItemPaginator<
361 crate::model::ListFrameworkAuditsResponse,
362 gax::error::Error,
363 > {
364 use gax::paginator::Paginator;
365 self.by_page().items()
366 }
367
368 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
372 self.0.request.parent = v.into();
373 self
374 }
375
376 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
378 self.0.request.page_size = v.into();
379 self
380 }
381
382 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
384 self.0.request.page_token = v.into();
385 self
386 }
387
388 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
390 self.0.request.filter = v.into();
391 self
392 }
393 }
394
395 #[doc(hidden)]
396 impl gax::options::internal::RequestBuilder for ListFrameworkAudits {
397 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
398 &mut self.0.options
399 }
400 }
401
402 #[derive(Clone, Debug)]
419 pub struct GetFrameworkAudit(RequestBuilder<crate::model::GetFrameworkAuditRequest>);
420
421 impl GetFrameworkAudit {
422 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
423 Self(RequestBuilder::new(stub))
424 }
425
426 pub fn with_request<V: Into<crate::model::GetFrameworkAuditRequest>>(
428 mut self,
429 v: V,
430 ) -> Self {
431 self.0.request = v.into();
432 self
433 }
434
435 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
437 self.0.options = v.into();
438 self
439 }
440
441 pub async fn send(self) -> Result<crate::model::FrameworkAudit> {
443 (*self.0.stub)
444 .get_framework_audit(self.0.request, self.0.options)
445 .await
446 .map(gax::response::Response::into_body)
447 }
448
449 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
453 self.0.request.name = v.into();
454 self
455 }
456 }
457
458 #[doc(hidden)]
459 impl gax::options::internal::RequestBuilder for GetFrameworkAudit {
460 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
461 &mut self.0.options
462 }
463 }
464
465 #[derive(Clone, Debug)]
486 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
487
488 impl ListLocations {
489 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
490 Self(RequestBuilder::new(stub))
491 }
492
493 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
495 mut self,
496 v: V,
497 ) -> Self {
498 self.0.request = v.into();
499 self
500 }
501
502 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
504 self.0.options = v.into();
505 self
506 }
507
508 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
510 (*self.0.stub)
511 .list_locations(self.0.request, self.0.options)
512 .await
513 .map(gax::response::Response::into_body)
514 }
515
516 pub fn by_page(
518 self,
519 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
520 {
521 use std::clone::Clone;
522 let token = self.0.request.page_token.clone();
523 let execute = move |token: String| {
524 let mut builder = self.clone();
525 builder.0.request = builder.0.request.set_page_token(token);
526 builder.send()
527 };
528 gax::paginator::internal::new_paginator(token, execute)
529 }
530
531 pub fn by_item(
533 self,
534 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
535 {
536 use gax::paginator::Paginator;
537 self.by_page().items()
538 }
539
540 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
542 self.0.request.name = v.into();
543 self
544 }
545
546 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
548 self.0.request.filter = v.into();
549 self
550 }
551
552 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
554 self.0.request.page_size = v.into();
555 self
556 }
557
558 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
560 self.0.request.page_token = v.into();
561 self
562 }
563 }
564
565 #[doc(hidden)]
566 impl gax::options::internal::RequestBuilder for ListLocations {
567 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
568 &mut self.0.options
569 }
570 }
571
572 #[derive(Clone, Debug)]
589 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
590
591 impl GetLocation {
592 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
593 Self(RequestBuilder::new(stub))
594 }
595
596 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
598 self.0.request = v.into();
599 self
600 }
601
602 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
604 self.0.options = v.into();
605 self
606 }
607
608 pub async fn send(self) -> Result<location::model::Location> {
610 (*self.0.stub)
611 .get_location(self.0.request, self.0.options)
612 .await
613 .map(gax::response::Response::into_body)
614 }
615
616 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
618 self.0.request.name = v.into();
619 self
620 }
621 }
622
623 #[doc(hidden)]
624 impl gax::options::internal::RequestBuilder for GetLocation {
625 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
626 &mut self.0.options
627 }
628 }
629
630 #[derive(Clone, Debug)]
651 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
652
653 impl ListOperations {
654 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
655 Self(RequestBuilder::new(stub))
656 }
657
658 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
660 mut self,
661 v: V,
662 ) -> Self {
663 self.0.request = v.into();
664 self
665 }
666
667 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
669 self.0.options = v.into();
670 self
671 }
672
673 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
675 (*self.0.stub)
676 .list_operations(self.0.request, self.0.options)
677 .await
678 .map(gax::response::Response::into_body)
679 }
680
681 pub fn by_page(
683 self,
684 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
685 {
686 use std::clone::Clone;
687 let token = self.0.request.page_token.clone();
688 let execute = move |token: String| {
689 let mut builder = self.clone();
690 builder.0.request = builder.0.request.set_page_token(token);
691 builder.send()
692 };
693 gax::paginator::internal::new_paginator(token, execute)
694 }
695
696 pub fn by_item(
698 self,
699 ) -> impl gax::paginator::ItemPaginator<
700 longrunning::model::ListOperationsResponse,
701 gax::error::Error,
702 > {
703 use gax::paginator::Paginator;
704 self.by_page().items()
705 }
706
707 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
709 self.0.request.name = v.into();
710 self
711 }
712
713 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
715 self.0.request.filter = v.into();
716 self
717 }
718
719 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
721 self.0.request.page_size = v.into();
722 self
723 }
724
725 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
727 self.0.request.page_token = v.into();
728 self
729 }
730
731 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
733 self.0.request.return_partial_success = v.into();
734 self
735 }
736 }
737
738 #[doc(hidden)]
739 impl gax::options::internal::RequestBuilder for ListOperations {
740 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
741 &mut self.0.options
742 }
743 }
744
745 #[derive(Clone, Debug)]
762 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
763
764 impl GetOperation {
765 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
766 Self(RequestBuilder::new(stub))
767 }
768
769 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
771 mut self,
772 v: V,
773 ) -> Self {
774 self.0.request = v.into();
775 self
776 }
777
778 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
780 self.0.options = v.into();
781 self
782 }
783
784 pub async fn send(self) -> Result<longrunning::model::Operation> {
786 (*self.0.stub)
787 .get_operation(self.0.request, self.0.options)
788 .await
789 .map(gax::response::Response::into_body)
790 }
791
792 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
794 self.0.request.name = v.into();
795 self
796 }
797 }
798
799 #[doc(hidden)]
800 impl gax::options::internal::RequestBuilder for GetOperation {
801 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
802 &mut self.0.options
803 }
804 }
805
806 #[derive(Clone, Debug)]
823 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
824
825 impl DeleteOperation {
826 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
827 Self(RequestBuilder::new(stub))
828 }
829
830 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
832 mut self,
833 v: V,
834 ) -> Self {
835 self.0.request = v.into();
836 self
837 }
838
839 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
841 self.0.options = v.into();
842 self
843 }
844
845 pub async fn send(self) -> Result<()> {
847 (*self.0.stub)
848 .delete_operation(self.0.request, self.0.options)
849 .await
850 .map(gax::response::Response::into_body)
851 }
852
853 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
855 self.0.request.name = v.into();
856 self
857 }
858 }
859
860 #[doc(hidden)]
861 impl gax::options::internal::RequestBuilder for DeleteOperation {
862 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
863 &mut self.0.options
864 }
865 }
866
867 #[derive(Clone, Debug)]
884 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
885
886 impl CancelOperation {
887 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
888 Self(RequestBuilder::new(stub))
889 }
890
891 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
893 mut self,
894 v: V,
895 ) -> Self {
896 self.0.request = v.into();
897 self
898 }
899
900 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
902 self.0.options = v.into();
903 self
904 }
905
906 pub async fn send(self) -> Result<()> {
908 (*self.0.stub)
909 .cancel_operation(self.0.request, self.0.options)
910 .await
911 .map(gax::response::Response::into_body)
912 }
913
914 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
916 self.0.request.name = v.into();
917 self
918 }
919 }
920
921 #[doc(hidden)]
922 impl gax::options::internal::RequestBuilder for CancelOperation {
923 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
924 &mut self.0.options
925 }
926 }
927}
928
929pub mod cm_enrollment_service {
930 use crate::Result;
931
932 pub type ClientBuilder =
946 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
947
948 pub(crate) mod client {
949 use super::super::super::client::CmEnrollmentService;
950 pub struct Factory;
951 impl gax::client_builder::internal::ClientFactory for Factory {
952 type Client = CmEnrollmentService;
953 type Credentials = gaxi::options::Credentials;
954 async fn build(
955 self,
956 config: gaxi::options::ClientConfig,
957 ) -> gax::client_builder::Result<Self::Client> {
958 Self::Client::new(config).await
959 }
960 }
961 }
962
963 #[derive(Clone, Debug)]
965 pub(crate) struct RequestBuilder<R: std::default::Default> {
966 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
967 request: R,
968 options: gax::options::RequestOptions,
969 }
970
971 impl<R> RequestBuilder<R>
972 where
973 R: std::default::Default,
974 {
975 pub(crate) fn new(
976 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
977 ) -> Self {
978 Self {
979 stub,
980 request: R::default(),
981 options: gax::options::RequestOptions::default(),
982 }
983 }
984 }
985
986 #[derive(Clone, Debug)]
1003 pub struct UpdateCmEnrollment(RequestBuilder<crate::model::UpdateCmEnrollmentRequest>);
1004
1005 impl UpdateCmEnrollment {
1006 pub(crate) fn new(
1007 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1008 ) -> Self {
1009 Self(RequestBuilder::new(stub))
1010 }
1011
1012 pub fn with_request<V: Into<crate::model::UpdateCmEnrollmentRequest>>(
1014 mut self,
1015 v: V,
1016 ) -> Self {
1017 self.0.request = v.into();
1018 self
1019 }
1020
1021 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1023 self.0.options = v.into();
1024 self
1025 }
1026
1027 pub async fn send(self) -> Result<crate::model::CmEnrollment> {
1029 (*self.0.stub)
1030 .update_cm_enrollment(self.0.request, self.0.options)
1031 .await
1032 .map(gax::response::Response::into_body)
1033 }
1034
1035 pub fn set_cm_enrollment<T>(mut self, v: T) -> Self
1039 where
1040 T: std::convert::Into<crate::model::CmEnrollment>,
1041 {
1042 self.0.request.cm_enrollment = std::option::Option::Some(v.into());
1043 self
1044 }
1045
1046 pub fn set_or_clear_cm_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
1050 where
1051 T: std::convert::Into<crate::model::CmEnrollment>,
1052 {
1053 self.0.request.cm_enrollment = v.map(|x| x.into());
1054 self
1055 }
1056
1057 pub fn set_update_mask<T>(mut self, v: T) -> Self
1059 where
1060 T: std::convert::Into<wkt::FieldMask>,
1061 {
1062 self.0.request.update_mask = std::option::Option::Some(v.into());
1063 self
1064 }
1065
1066 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1068 where
1069 T: std::convert::Into<wkt::FieldMask>,
1070 {
1071 self.0.request.update_mask = v.map(|x| x.into());
1072 self
1073 }
1074 }
1075
1076 #[doc(hidden)]
1077 impl gax::options::internal::RequestBuilder for UpdateCmEnrollment {
1078 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1079 &mut self.0.options
1080 }
1081 }
1082
1083 #[derive(Clone, Debug)]
1100 pub struct CalculateEffectiveCmEnrollment(
1101 RequestBuilder<crate::model::CalculateEffectiveCmEnrollmentRequest>,
1102 );
1103
1104 impl CalculateEffectiveCmEnrollment {
1105 pub(crate) fn new(
1106 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1107 ) -> Self {
1108 Self(RequestBuilder::new(stub))
1109 }
1110
1111 pub fn with_request<V: Into<crate::model::CalculateEffectiveCmEnrollmentRequest>>(
1113 mut self,
1114 v: V,
1115 ) -> Self {
1116 self.0.request = v.into();
1117 self
1118 }
1119
1120 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1122 self.0.options = v.into();
1123 self
1124 }
1125
1126 pub async fn send(self) -> Result<crate::model::CalculateEffectiveCmEnrollmentResponse> {
1128 (*self.0.stub)
1129 .calculate_effective_cm_enrollment(self.0.request, self.0.options)
1130 .await
1131 .map(gax::response::Response::into_body)
1132 }
1133
1134 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1138 self.0.request.name = v.into();
1139 self
1140 }
1141 }
1142
1143 #[doc(hidden)]
1144 impl gax::options::internal::RequestBuilder for CalculateEffectiveCmEnrollment {
1145 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1146 &mut self.0.options
1147 }
1148 }
1149
1150 #[derive(Clone, Debug)]
1171 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1172
1173 impl ListLocations {
1174 pub(crate) fn new(
1175 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1176 ) -> Self {
1177 Self(RequestBuilder::new(stub))
1178 }
1179
1180 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1182 mut self,
1183 v: V,
1184 ) -> Self {
1185 self.0.request = v.into();
1186 self
1187 }
1188
1189 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1191 self.0.options = v.into();
1192 self
1193 }
1194
1195 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1197 (*self.0.stub)
1198 .list_locations(self.0.request, self.0.options)
1199 .await
1200 .map(gax::response::Response::into_body)
1201 }
1202
1203 pub fn by_page(
1205 self,
1206 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1207 {
1208 use std::clone::Clone;
1209 let token = self.0.request.page_token.clone();
1210 let execute = move |token: String| {
1211 let mut builder = self.clone();
1212 builder.0.request = builder.0.request.set_page_token(token);
1213 builder.send()
1214 };
1215 gax::paginator::internal::new_paginator(token, execute)
1216 }
1217
1218 pub fn by_item(
1220 self,
1221 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1222 {
1223 use gax::paginator::Paginator;
1224 self.by_page().items()
1225 }
1226
1227 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1229 self.0.request.name = v.into();
1230 self
1231 }
1232
1233 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1235 self.0.request.filter = v.into();
1236 self
1237 }
1238
1239 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1241 self.0.request.page_size = v.into();
1242 self
1243 }
1244
1245 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1247 self.0.request.page_token = v.into();
1248 self
1249 }
1250 }
1251
1252 #[doc(hidden)]
1253 impl gax::options::internal::RequestBuilder for ListLocations {
1254 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1255 &mut self.0.options
1256 }
1257 }
1258
1259 #[derive(Clone, Debug)]
1276 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1277
1278 impl GetLocation {
1279 pub(crate) fn new(
1280 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1281 ) -> Self {
1282 Self(RequestBuilder::new(stub))
1283 }
1284
1285 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1287 self.0.request = v.into();
1288 self
1289 }
1290
1291 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1293 self.0.options = v.into();
1294 self
1295 }
1296
1297 pub async fn send(self) -> Result<location::model::Location> {
1299 (*self.0.stub)
1300 .get_location(self.0.request, self.0.options)
1301 .await
1302 .map(gax::response::Response::into_body)
1303 }
1304
1305 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1307 self.0.request.name = v.into();
1308 self
1309 }
1310 }
1311
1312 #[doc(hidden)]
1313 impl gax::options::internal::RequestBuilder for GetLocation {
1314 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1315 &mut self.0.options
1316 }
1317 }
1318
1319 #[derive(Clone, Debug)]
1340 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1341
1342 impl ListOperations {
1343 pub(crate) fn new(
1344 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1345 ) -> Self {
1346 Self(RequestBuilder::new(stub))
1347 }
1348
1349 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1351 mut self,
1352 v: V,
1353 ) -> Self {
1354 self.0.request = v.into();
1355 self
1356 }
1357
1358 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1360 self.0.options = v.into();
1361 self
1362 }
1363
1364 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1366 (*self.0.stub)
1367 .list_operations(self.0.request, self.0.options)
1368 .await
1369 .map(gax::response::Response::into_body)
1370 }
1371
1372 pub fn by_page(
1374 self,
1375 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1376 {
1377 use std::clone::Clone;
1378 let token = self.0.request.page_token.clone();
1379 let execute = move |token: String| {
1380 let mut builder = self.clone();
1381 builder.0.request = builder.0.request.set_page_token(token);
1382 builder.send()
1383 };
1384 gax::paginator::internal::new_paginator(token, execute)
1385 }
1386
1387 pub fn by_item(
1389 self,
1390 ) -> impl gax::paginator::ItemPaginator<
1391 longrunning::model::ListOperationsResponse,
1392 gax::error::Error,
1393 > {
1394 use gax::paginator::Paginator;
1395 self.by_page().items()
1396 }
1397
1398 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1400 self.0.request.name = v.into();
1401 self
1402 }
1403
1404 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1406 self.0.request.filter = v.into();
1407 self
1408 }
1409
1410 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1412 self.0.request.page_size = v.into();
1413 self
1414 }
1415
1416 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1418 self.0.request.page_token = v.into();
1419 self
1420 }
1421
1422 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1424 self.0.request.return_partial_success = v.into();
1425 self
1426 }
1427 }
1428
1429 #[doc(hidden)]
1430 impl gax::options::internal::RequestBuilder for ListOperations {
1431 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1432 &mut self.0.options
1433 }
1434 }
1435
1436 #[derive(Clone, Debug)]
1453 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1454
1455 impl GetOperation {
1456 pub(crate) fn new(
1457 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1458 ) -> Self {
1459 Self(RequestBuilder::new(stub))
1460 }
1461
1462 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1464 mut self,
1465 v: V,
1466 ) -> Self {
1467 self.0.request = v.into();
1468 self
1469 }
1470
1471 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1473 self.0.options = v.into();
1474 self
1475 }
1476
1477 pub async fn send(self) -> Result<longrunning::model::Operation> {
1479 (*self.0.stub)
1480 .get_operation(self.0.request, self.0.options)
1481 .await
1482 .map(gax::response::Response::into_body)
1483 }
1484
1485 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1487 self.0.request.name = v.into();
1488 self
1489 }
1490 }
1491
1492 #[doc(hidden)]
1493 impl gax::options::internal::RequestBuilder for GetOperation {
1494 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1495 &mut self.0.options
1496 }
1497 }
1498
1499 #[derive(Clone, Debug)]
1516 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1517
1518 impl DeleteOperation {
1519 pub(crate) fn new(
1520 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1521 ) -> Self {
1522 Self(RequestBuilder::new(stub))
1523 }
1524
1525 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1527 mut self,
1528 v: V,
1529 ) -> Self {
1530 self.0.request = v.into();
1531 self
1532 }
1533
1534 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1536 self.0.options = v.into();
1537 self
1538 }
1539
1540 pub async fn send(self) -> Result<()> {
1542 (*self.0.stub)
1543 .delete_operation(self.0.request, self.0.options)
1544 .await
1545 .map(gax::response::Response::into_body)
1546 }
1547
1548 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1550 self.0.request.name = v.into();
1551 self
1552 }
1553 }
1554
1555 #[doc(hidden)]
1556 impl gax::options::internal::RequestBuilder for DeleteOperation {
1557 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1558 &mut self.0.options
1559 }
1560 }
1561
1562 #[derive(Clone, Debug)]
1579 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1580
1581 impl CancelOperation {
1582 pub(crate) fn new(
1583 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1584 ) -> Self {
1585 Self(RequestBuilder::new(stub))
1586 }
1587
1588 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1590 mut self,
1591 v: V,
1592 ) -> Self {
1593 self.0.request = v.into();
1594 self
1595 }
1596
1597 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1599 self.0.options = v.into();
1600 self
1601 }
1602
1603 pub async fn send(self) -> Result<()> {
1605 (*self.0.stub)
1606 .cancel_operation(self.0.request, self.0.options)
1607 .await
1608 .map(gax::response::Response::into_body)
1609 }
1610
1611 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1613 self.0.request.name = v.into();
1614 self
1615 }
1616 }
1617
1618 #[doc(hidden)]
1619 impl gax::options::internal::RequestBuilder for CancelOperation {
1620 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1621 &mut self.0.options
1622 }
1623 }
1624}
1625
1626pub mod config {
1627 use crate::Result;
1628
1629 pub type ClientBuilder =
1643 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1644
1645 pub(crate) mod client {
1646 use super::super::super::client::Config;
1647 pub struct Factory;
1648 impl gax::client_builder::internal::ClientFactory for Factory {
1649 type Client = Config;
1650 type Credentials = gaxi::options::Credentials;
1651 async fn build(
1652 self,
1653 config: gaxi::options::ClientConfig,
1654 ) -> gax::client_builder::Result<Self::Client> {
1655 Self::Client::new(config).await
1656 }
1657 }
1658 }
1659
1660 #[derive(Clone, Debug)]
1662 pub(crate) struct RequestBuilder<R: std::default::Default> {
1663 stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>,
1664 request: R,
1665 options: gax::options::RequestOptions,
1666 }
1667
1668 impl<R> RequestBuilder<R>
1669 where
1670 R: std::default::Default,
1671 {
1672 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1673 Self {
1674 stub,
1675 request: R::default(),
1676 options: gax::options::RequestOptions::default(),
1677 }
1678 }
1679 }
1680
1681 #[derive(Clone, Debug)]
1702 pub struct ListFrameworks(RequestBuilder<crate::model::ListFrameworksRequest>);
1703
1704 impl ListFrameworks {
1705 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1706 Self(RequestBuilder::new(stub))
1707 }
1708
1709 pub fn with_request<V: Into<crate::model::ListFrameworksRequest>>(mut self, v: V) -> Self {
1711 self.0.request = v.into();
1712 self
1713 }
1714
1715 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1717 self.0.options = v.into();
1718 self
1719 }
1720
1721 pub async fn send(self) -> Result<crate::model::ListFrameworksResponse> {
1723 (*self.0.stub)
1724 .list_frameworks(self.0.request, self.0.options)
1725 .await
1726 .map(gax::response::Response::into_body)
1727 }
1728
1729 pub fn by_page(
1731 self,
1732 ) -> impl gax::paginator::Paginator<crate::model::ListFrameworksResponse, gax::error::Error>
1733 {
1734 use std::clone::Clone;
1735 let token = self.0.request.page_token.clone();
1736 let execute = move |token: String| {
1737 let mut builder = self.clone();
1738 builder.0.request = builder.0.request.set_page_token(token);
1739 builder.send()
1740 };
1741 gax::paginator::internal::new_paginator(token, execute)
1742 }
1743
1744 pub fn by_item(
1746 self,
1747 ) -> impl gax::paginator::ItemPaginator<crate::model::ListFrameworksResponse, gax::error::Error>
1748 {
1749 use gax::paginator::Paginator;
1750 self.by_page().items()
1751 }
1752
1753 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1757 self.0.request.parent = v.into();
1758 self
1759 }
1760
1761 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1763 self.0.request.page_size = v.into();
1764 self
1765 }
1766
1767 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1769 self.0.request.page_token = v.into();
1770 self
1771 }
1772 }
1773
1774 #[doc(hidden)]
1775 impl gax::options::internal::RequestBuilder for ListFrameworks {
1776 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1777 &mut self.0.options
1778 }
1779 }
1780
1781 #[derive(Clone, Debug)]
1798 pub struct GetFramework(RequestBuilder<crate::model::GetFrameworkRequest>);
1799
1800 impl GetFramework {
1801 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1802 Self(RequestBuilder::new(stub))
1803 }
1804
1805 pub fn with_request<V: Into<crate::model::GetFrameworkRequest>>(mut self, v: V) -> Self {
1807 self.0.request = v.into();
1808 self
1809 }
1810
1811 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1813 self.0.options = v.into();
1814 self
1815 }
1816
1817 pub async fn send(self) -> Result<crate::model::Framework> {
1819 (*self.0.stub)
1820 .get_framework(self.0.request, self.0.options)
1821 .await
1822 .map(gax::response::Response::into_body)
1823 }
1824
1825 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1829 self.0.request.name = v.into();
1830 self
1831 }
1832
1833 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
1835 self.0.request.major_revision_id = v.into();
1836 self
1837 }
1838 }
1839
1840 #[doc(hidden)]
1841 impl gax::options::internal::RequestBuilder for GetFramework {
1842 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1843 &mut self.0.options
1844 }
1845 }
1846
1847 #[derive(Clone, Debug)]
1864 pub struct CreateFramework(RequestBuilder<crate::model::CreateFrameworkRequest>);
1865
1866 impl CreateFramework {
1867 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1868 Self(RequestBuilder::new(stub))
1869 }
1870
1871 pub fn with_request<V: Into<crate::model::CreateFrameworkRequest>>(mut self, v: V) -> Self {
1873 self.0.request = v.into();
1874 self
1875 }
1876
1877 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1879 self.0.options = v.into();
1880 self
1881 }
1882
1883 pub async fn send(self) -> Result<crate::model::Framework> {
1885 (*self.0.stub)
1886 .create_framework(self.0.request, self.0.options)
1887 .await
1888 .map(gax::response::Response::into_body)
1889 }
1890
1891 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1895 self.0.request.parent = v.into();
1896 self
1897 }
1898
1899 pub fn set_framework_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1903 self.0.request.framework_id = v.into();
1904 self
1905 }
1906
1907 pub fn set_framework<T>(mut self, v: T) -> Self
1911 where
1912 T: std::convert::Into<crate::model::Framework>,
1913 {
1914 self.0.request.framework = std::option::Option::Some(v.into());
1915 self
1916 }
1917
1918 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
1922 where
1923 T: std::convert::Into<crate::model::Framework>,
1924 {
1925 self.0.request.framework = v.map(|x| x.into());
1926 self
1927 }
1928 }
1929
1930 #[doc(hidden)]
1931 impl gax::options::internal::RequestBuilder for CreateFramework {
1932 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1933 &mut self.0.options
1934 }
1935 }
1936
1937 #[derive(Clone, Debug)]
1954 pub struct UpdateFramework(RequestBuilder<crate::model::UpdateFrameworkRequest>);
1955
1956 impl UpdateFramework {
1957 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1958 Self(RequestBuilder::new(stub))
1959 }
1960
1961 pub fn with_request<V: Into<crate::model::UpdateFrameworkRequest>>(mut self, v: V) -> Self {
1963 self.0.request = v.into();
1964 self
1965 }
1966
1967 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1969 self.0.options = v.into();
1970 self
1971 }
1972
1973 pub async fn send(self) -> Result<crate::model::Framework> {
1975 (*self.0.stub)
1976 .update_framework(self.0.request, self.0.options)
1977 .await
1978 .map(gax::response::Response::into_body)
1979 }
1980
1981 pub fn set_update_mask<T>(mut self, v: T) -> Self
1983 where
1984 T: std::convert::Into<wkt::FieldMask>,
1985 {
1986 self.0.request.update_mask = std::option::Option::Some(v.into());
1987 self
1988 }
1989
1990 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1992 where
1993 T: std::convert::Into<wkt::FieldMask>,
1994 {
1995 self.0.request.update_mask = v.map(|x| x.into());
1996 self
1997 }
1998
1999 pub fn set_framework<T>(mut self, v: T) -> Self
2003 where
2004 T: std::convert::Into<crate::model::Framework>,
2005 {
2006 self.0.request.framework = std::option::Option::Some(v.into());
2007 self
2008 }
2009
2010 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
2014 where
2015 T: std::convert::Into<crate::model::Framework>,
2016 {
2017 self.0.request.framework = v.map(|x| x.into());
2018 self
2019 }
2020
2021 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
2023 self.0.request.major_revision_id = v.into();
2024 self
2025 }
2026 }
2027
2028 #[doc(hidden)]
2029 impl gax::options::internal::RequestBuilder for UpdateFramework {
2030 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2031 &mut self.0.options
2032 }
2033 }
2034
2035 #[derive(Clone, Debug)]
2052 pub struct DeleteFramework(RequestBuilder<crate::model::DeleteFrameworkRequest>);
2053
2054 impl DeleteFramework {
2055 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2056 Self(RequestBuilder::new(stub))
2057 }
2058
2059 pub fn with_request<V: Into<crate::model::DeleteFrameworkRequest>>(mut self, v: V) -> Self {
2061 self.0.request = v.into();
2062 self
2063 }
2064
2065 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2067 self.0.options = v.into();
2068 self
2069 }
2070
2071 pub async fn send(self) -> Result<()> {
2073 (*self.0.stub)
2074 .delete_framework(self.0.request, self.0.options)
2075 .await
2076 .map(gax::response::Response::into_body)
2077 }
2078
2079 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2083 self.0.request.name = v.into();
2084 self
2085 }
2086 }
2087
2088 #[doc(hidden)]
2089 impl gax::options::internal::RequestBuilder for DeleteFramework {
2090 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2091 &mut self.0.options
2092 }
2093 }
2094
2095 #[derive(Clone, Debug)]
2116 pub struct ListCloudControls(RequestBuilder<crate::model::ListCloudControlsRequest>);
2117
2118 impl ListCloudControls {
2119 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2120 Self(RequestBuilder::new(stub))
2121 }
2122
2123 pub fn with_request<V: Into<crate::model::ListCloudControlsRequest>>(
2125 mut self,
2126 v: V,
2127 ) -> Self {
2128 self.0.request = v.into();
2129 self
2130 }
2131
2132 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2134 self.0.options = v.into();
2135 self
2136 }
2137
2138 pub async fn send(self) -> Result<crate::model::ListCloudControlsResponse> {
2140 (*self.0.stub)
2141 .list_cloud_controls(self.0.request, self.0.options)
2142 .await
2143 .map(gax::response::Response::into_body)
2144 }
2145
2146 pub fn by_page(
2148 self,
2149 ) -> impl gax::paginator::Paginator<crate::model::ListCloudControlsResponse, gax::error::Error>
2150 {
2151 use std::clone::Clone;
2152 let token = self.0.request.page_token.clone();
2153 let execute = move |token: String| {
2154 let mut builder = self.clone();
2155 builder.0.request = builder.0.request.set_page_token(token);
2156 builder.send()
2157 };
2158 gax::paginator::internal::new_paginator(token, execute)
2159 }
2160
2161 pub fn by_item(
2163 self,
2164 ) -> impl gax::paginator::ItemPaginator<crate::model::ListCloudControlsResponse, gax::error::Error>
2165 {
2166 use gax::paginator::Paginator;
2167 self.by_page().items()
2168 }
2169
2170 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2174 self.0.request.parent = v.into();
2175 self
2176 }
2177
2178 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2180 self.0.request.page_size = v.into();
2181 self
2182 }
2183
2184 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2186 self.0.request.page_token = v.into();
2187 self
2188 }
2189 }
2190
2191 #[doc(hidden)]
2192 impl gax::options::internal::RequestBuilder for ListCloudControls {
2193 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2194 &mut self.0.options
2195 }
2196 }
2197
2198 #[derive(Clone, Debug)]
2215 pub struct GetCloudControl(RequestBuilder<crate::model::GetCloudControlRequest>);
2216
2217 impl GetCloudControl {
2218 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2219 Self(RequestBuilder::new(stub))
2220 }
2221
2222 pub fn with_request<V: Into<crate::model::GetCloudControlRequest>>(mut self, v: V) -> Self {
2224 self.0.request = v.into();
2225 self
2226 }
2227
2228 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2230 self.0.options = v.into();
2231 self
2232 }
2233
2234 pub async fn send(self) -> Result<crate::model::CloudControl> {
2236 (*self.0.stub)
2237 .get_cloud_control(self.0.request, self.0.options)
2238 .await
2239 .map(gax::response::Response::into_body)
2240 }
2241
2242 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2246 self.0.request.name = v.into();
2247 self
2248 }
2249
2250 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
2252 self.0.request.major_revision_id = v.into();
2253 self
2254 }
2255 }
2256
2257 #[doc(hidden)]
2258 impl gax::options::internal::RequestBuilder for GetCloudControl {
2259 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2260 &mut self.0.options
2261 }
2262 }
2263
2264 #[derive(Clone, Debug)]
2281 pub struct CreateCloudControl(RequestBuilder<crate::model::CreateCloudControlRequest>);
2282
2283 impl CreateCloudControl {
2284 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2285 Self(RequestBuilder::new(stub))
2286 }
2287
2288 pub fn with_request<V: Into<crate::model::CreateCloudControlRequest>>(
2290 mut self,
2291 v: V,
2292 ) -> Self {
2293 self.0.request = v.into();
2294 self
2295 }
2296
2297 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2299 self.0.options = v.into();
2300 self
2301 }
2302
2303 pub async fn send(self) -> Result<crate::model::CloudControl> {
2305 (*self.0.stub)
2306 .create_cloud_control(self.0.request, self.0.options)
2307 .await
2308 .map(gax::response::Response::into_body)
2309 }
2310
2311 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2315 self.0.request.parent = v.into();
2316 self
2317 }
2318
2319 pub fn set_cloud_control_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2323 self.0.request.cloud_control_id = v.into();
2324 self
2325 }
2326
2327 pub fn set_cloud_control<T>(mut self, v: T) -> Self
2331 where
2332 T: std::convert::Into<crate::model::CloudControl>,
2333 {
2334 self.0.request.cloud_control = std::option::Option::Some(v.into());
2335 self
2336 }
2337
2338 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
2342 where
2343 T: std::convert::Into<crate::model::CloudControl>,
2344 {
2345 self.0.request.cloud_control = v.map(|x| x.into());
2346 self
2347 }
2348 }
2349
2350 #[doc(hidden)]
2351 impl gax::options::internal::RequestBuilder for CreateCloudControl {
2352 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2353 &mut self.0.options
2354 }
2355 }
2356
2357 #[derive(Clone, Debug)]
2374 pub struct UpdateCloudControl(RequestBuilder<crate::model::UpdateCloudControlRequest>);
2375
2376 impl UpdateCloudControl {
2377 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2378 Self(RequestBuilder::new(stub))
2379 }
2380
2381 pub fn with_request<V: Into<crate::model::UpdateCloudControlRequest>>(
2383 mut self,
2384 v: V,
2385 ) -> Self {
2386 self.0.request = v.into();
2387 self
2388 }
2389
2390 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2392 self.0.options = v.into();
2393 self
2394 }
2395
2396 pub async fn send(self) -> Result<crate::model::CloudControl> {
2398 (*self.0.stub)
2399 .update_cloud_control(self.0.request, self.0.options)
2400 .await
2401 .map(gax::response::Response::into_body)
2402 }
2403
2404 pub fn set_update_mask<T>(mut self, v: T) -> Self
2406 where
2407 T: std::convert::Into<wkt::FieldMask>,
2408 {
2409 self.0.request.update_mask = std::option::Option::Some(v.into());
2410 self
2411 }
2412
2413 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2415 where
2416 T: std::convert::Into<wkt::FieldMask>,
2417 {
2418 self.0.request.update_mask = v.map(|x| x.into());
2419 self
2420 }
2421
2422 pub fn set_cloud_control<T>(mut self, v: T) -> Self
2426 where
2427 T: std::convert::Into<crate::model::CloudControl>,
2428 {
2429 self.0.request.cloud_control = std::option::Option::Some(v.into());
2430 self
2431 }
2432
2433 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
2437 where
2438 T: std::convert::Into<crate::model::CloudControl>,
2439 {
2440 self.0.request.cloud_control = v.map(|x| x.into());
2441 self
2442 }
2443 }
2444
2445 #[doc(hidden)]
2446 impl gax::options::internal::RequestBuilder for UpdateCloudControl {
2447 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2448 &mut self.0.options
2449 }
2450 }
2451
2452 #[derive(Clone, Debug)]
2469 pub struct DeleteCloudControl(RequestBuilder<crate::model::DeleteCloudControlRequest>);
2470
2471 impl DeleteCloudControl {
2472 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2473 Self(RequestBuilder::new(stub))
2474 }
2475
2476 pub fn with_request<V: Into<crate::model::DeleteCloudControlRequest>>(
2478 mut self,
2479 v: V,
2480 ) -> Self {
2481 self.0.request = v.into();
2482 self
2483 }
2484
2485 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2487 self.0.options = v.into();
2488 self
2489 }
2490
2491 pub async fn send(self) -> Result<()> {
2493 (*self.0.stub)
2494 .delete_cloud_control(self.0.request, self.0.options)
2495 .await
2496 .map(gax::response::Response::into_body)
2497 }
2498
2499 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2503 self.0.request.name = v.into();
2504 self
2505 }
2506 }
2507
2508 #[doc(hidden)]
2509 impl gax::options::internal::RequestBuilder for DeleteCloudControl {
2510 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2511 &mut self.0.options
2512 }
2513 }
2514
2515 #[derive(Clone, Debug)]
2536 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2537
2538 impl ListLocations {
2539 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2540 Self(RequestBuilder::new(stub))
2541 }
2542
2543 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2545 mut self,
2546 v: V,
2547 ) -> Self {
2548 self.0.request = v.into();
2549 self
2550 }
2551
2552 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2554 self.0.options = v.into();
2555 self
2556 }
2557
2558 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2560 (*self.0.stub)
2561 .list_locations(self.0.request, self.0.options)
2562 .await
2563 .map(gax::response::Response::into_body)
2564 }
2565
2566 pub fn by_page(
2568 self,
2569 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2570 {
2571 use std::clone::Clone;
2572 let token = self.0.request.page_token.clone();
2573 let execute = move |token: String| {
2574 let mut builder = self.clone();
2575 builder.0.request = builder.0.request.set_page_token(token);
2576 builder.send()
2577 };
2578 gax::paginator::internal::new_paginator(token, execute)
2579 }
2580
2581 pub fn by_item(
2583 self,
2584 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2585 {
2586 use gax::paginator::Paginator;
2587 self.by_page().items()
2588 }
2589
2590 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2592 self.0.request.name = v.into();
2593 self
2594 }
2595
2596 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2598 self.0.request.filter = v.into();
2599 self
2600 }
2601
2602 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2604 self.0.request.page_size = v.into();
2605 self
2606 }
2607
2608 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2610 self.0.request.page_token = v.into();
2611 self
2612 }
2613 }
2614
2615 #[doc(hidden)]
2616 impl gax::options::internal::RequestBuilder for ListLocations {
2617 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2618 &mut self.0.options
2619 }
2620 }
2621
2622 #[derive(Clone, Debug)]
2639 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2640
2641 impl GetLocation {
2642 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2643 Self(RequestBuilder::new(stub))
2644 }
2645
2646 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2648 self.0.request = v.into();
2649 self
2650 }
2651
2652 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2654 self.0.options = v.into();
2655 self
2656 }
2657
2658 pub async fn send(self) -> Result<location::model::Location> {
2660 (*self.0.stub)
2661 .get_location(self.0.request, self.0.options)
2662 .await
2663 .map(gax::response::Response::into_body)
2664 }
2665
2666 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2668 self.0.request.name = v.into();
2669 self
2670 }
2671 }
2672
2673 #[doc(hidden)]
2674 impl gax::options::internal::RequestBuilder for GetLocation {
2675 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2676 &mut self.0.options
2677 }
2678 }
2679
2680 #[derive(Clone, Debug)]
2701 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2702
2703 impl ListOperations {
2704 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2705 Self(RequestBuilder::new(stub))
2706 }
2707
2708 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2710 mut self,
2711 v: V,
2712 ) -> Self {
2713 self.0.request = v.into();
2714 self
2715 }
2716
2717 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2719 self.0.options = v.into();
2720 self
2721 }
2722
2723 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2725 (*self.0.stub)
2726 .list_operations(self.0.request, self.0.options)
2727 .await
2728 .map(gax::response::Response::into_body)
2729 }
2730
2731 pub fn by_page(
2733 self,
2734 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2735 {
2736 use std::clone::Clone;
2737 let token = self.0.request.page_token.clone();
2738 let execute = move |token: String| {
2739 let mut builder = self.clone();
2740 builder.0.request = builder.0.request.set_page_token(token);
2741 builder.send()
2742 };
2743 gax::paginator::internal::new_paginator(token, execute)
2744 }
2745
2746 pub fn by_item(
2748 self,
2749 ) -> impl gax::paginator::ItemPaginator<
2750 longrunning::model::ListOperationsResponse,
2751 gax::error::Error,
2752 > {
2753 use gax::paginator::Paginator;
2754 self.by_page().items()
2755 }
2756
2757 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2759 self.0.request.name = v.into();
2760 self
2761 }
2762
2763 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2765 self.0.request.filter = v.into();
2766 self
2767 }
2768
2769 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2771 self.0.request.page_size = v.into();
2772 self
2773 }
2774
2775 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2777 self.0.request.page_token = v.into();
2778 self
2779 }
2780
2781 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2783 self.0.request.return_partial_success = v.into();
2784 self
2785 }
2786 }
2787
2788 #[doc(hidden)]
2789 impl gax::options::internal::RequestBuilder for ListOperations {
2790 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2791 &mut self.0.options
2792 }
2793 }
2794
2795 #[derive(Clone, Debug)]
2812 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2813
2814 impl GetOperation {
2815 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2816 Self(RequestBuilder::new(stub))
2817 }
2818
2819 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2821 mut self,
2822 v: V,
2823 ) -> Self {
2824 self.0.request = v.into();
2825 self
2826 }
2827
2828 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2830 self.0.options = v.into();
2831 self
2832 }
2833
2834 pub async fn send(self) -> Result<longrunning::model::Operation> {
2836 (*self.0.stub)
2837 .get_operation(self.0.request, self.0.options)
2838 .await
2839 .map(gax::response::Response::into_body)
2840 }
2841
2842 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2844 self.0.request.name = v.into();
2845 self
2846 }
2847 }
2848
2849 #[doc(hidden)]
2850 impl gax::options::internal::RequestBuilder for GetOperation {
2851 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2852 &mut self.0.options
2853 }
2854 }
2855
2856 #[derive(Clone, Debug)]
2873 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2874
2875 impl DeleteOperation {
2876 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2877 Self(RequestBuilder::new(stub))
2878 }
2879
2880 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2882 mut self,
2883 v: V,
2884 ) -> Self {
2885 self.0.request = v.into();
2886 self
2887 }
2888
2889 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2891 self.0.options = v.into();
2892 self
2893 }
2894
2895 pub async fn send(self) -> Result<()> {
2897 (*self.0.stub)
2898 .delete_operation(self.0.request, self.0.options)
2899 .await
2900 .map(gax::response::Response::into_body)
2901 }
2902
2903 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2905 self.0.request.name = v.into();
2906 self
2907 }
2908 }
2909
2910 #[doc(hidden)]
2911 impl gax::options::internal::RequestBuilder for DeleteOperation {
2912 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2913 &mut self.0.options
2914 }
2915 }
2916
2917 #[derive(Clone, Debug)]
2934 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2935
2936 impl CancelOperation {
2937 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2938 Self(RequestBuilder::new(stub))
2939 }
2940
2941 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2943 mut self,
2944 v: V,
2945 ) -> Self {
2946 self.0.request = v.into();
2947 self
2948 }
2949
2950 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2952 self.0.options = v.into();
2953 self
2954 }
2955
2956 pub async fn send(self) -> Result<()> {
2958 (*self.0.stub)
2959 .cancel_operation(self.0.request, self.0.options)
2960 .await
2961 .map(gax::response::Response::into_body)
2962 }
2963
2964 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2966 self.0.request.name = v.into();
2967 self
2968 }
2969 }
2970
2971 #[doc(hidden)]
2972 impl gax::options::internal::RequestBuilder for CancelOperation {
2973 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2974 &mut self.0.options
2975 }
2976 }
2977}
2978
2979pub mod deployment {
2980 use crate::Result;
2981
2982 pub type ClientBuilder =
2996 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2997
2998 pub(crate) mod client {
2999 use super::super::super::client::Deployment;
3000 pub struct Factory;
3001 impl gax::client_builder::internal::ClientFactory for Factory {
3002 type Client = Deployment;
3003 type Credentials = gaxi::options::Credentials;
3004 async fn build(
3005 self,
3006 config: gaxi::options::ClientConfig,
3007 ) -> gax::client_builder::Result<Self::Client> {
3008 Self::Client::new(config).await
3009 }
3010 }
3011 }
3012
3013 #[derive(Clone, Debug)]
3015 pub(crate) struct RequestBuilder<R: std::default::Default> {
3016 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3017 request: R,
3018 options: gax::options::RequestOptions,
3019 }
3020
3021 impl<R> RequestBuilder<R>
3022 where
3023 R: std::default::Default,
3024 {
3025 pub(crate) fn new(
3026 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3027 ) -> Self {
3028 Self {
3029 stub,
3030 request: R::default(),
3031 options: gax::options::RequestOptions::default(),
3032 }
3033 }
3034 }
3035
3036 #[derive(Clone, Debug)]
3054 pub struct CreateFrameworkDeployment(
3055 RequestBuilder<crate::model::CreateFrameworkDeploymentRequest>,
3056 );
3057
3058 impl CreateFrameworkDeployment {
3059 pub(crate) fn new(
3060 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3061 ) -> Self {
3062 Self(RequestBuilder::new(stub))
3063 }
3064
3065 pub fn with_request<V: Into<crate::model::CreateFrameworkDeploymentRequest>>(
3067 mut self,
3068 v: V,
3069 ) -> Self {
3070 self.0.request = v.into();
3071 self
3072 }
3073
3074 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3076 self.0.options = v.into();
3077 self
3078 }
3079
3080 pub async fn send(self) -> Result<longrunning::model::Operation> {
3087 (*self.0.stub)
3088 .create_framework_deployment(self.0.request, self.0.options)
3089 .await
3090 .map(gax::response::Response::into_body)
3091 }
3092
3093 pub fn poller(
3095 self,
3096 ) -> impl lro::Poller<crate::model::FrameworkDeployment, crate::model::OperationMetadata>
3097 {
3098 type Operation = lro::internal::Operation<
3099 crate::model::FrameworkDeployment,
3100 crate::model::OperationMetadata,
3101 >;
3102 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3103 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3104
3105 let stub = self.0.stub.clone();
3106 let mut options = self.0.options.clone();
3107 options.set_retry_policy(gax::retry_policy::NeverRetry);
3108 let query = move |name| {
3109 let stub = stub.clone();
3110 let options = options.clone();
3111 async {
3112 let op = GetOperation::new(stub)
3113 .set_name(name)
3114 .with_options(options)
3115 .send()
3116 .await?;
3117 Ok(Operation::new(op))
3118 }
3119 };
3120
3121 let start = move || async {
3122 let op = self.send().await?;
3123 Ok(Operation::new(op))
3124 };
3125
3126 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3127 }
3128
3129 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3133 self.0.request.parent = v.into();
3134 self
3135 }
3136
3137 pub fn set_framework_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3139 self.0.request.framework_deployment_id = v.into();
3140 self
3141 }
3142
3143 pub fn set_framework_deployment<T>(mut self, v: T) -> Self
3147 where
3148 T: std::convert::Into<crate::model::FrameworkDeployment>,
3149 {
3150 self.0.request.framework_deployment = std::option::Option::Some(v.into());
3151 self
3152 }
3153
3154 pub fn set_or_clear_framework_deployment<T>(mut self, v: std::option::Option<T>) -> Self
3158 where
3159 T: std::convert::Into<crate::model::FrameworkDeployment>,
3160 {
3161 self.0.request.framework_deployment = v.map(|x| x.into());
3162 self
3163 }
3164 }
3165
3166 #[doc(hidden)]
3167 impl gax::options::internal::RequestBuilder for CreateFrameworkDeployment {
3168 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3169 &mut self.0.options
3170 }
3171 }
3172
3173 #[derive(Clone, Debug)]
3191 pub struct DeleteFrameworkDeployment(
3192 RequestBuilder<crate::model::DeleteFrameworkDeploymentRequest>,
3193 );
3194
3195 impl DeleteFrameworkDeployment {
3196 pub(crate) fn new(
3197 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3198 ) -> Self {
3199 Self(RequestBuilder::new(stub))
3200 }
3201
3202 pub fn with_request<V: Into<crate::model::DeleteFrameworkDeploymentRequest>>(
3204 mut self,
3205 v: V,
3206 ) -> Self {
3207 self.0.request = v.into();
3208 self
3209 }
3210
3211 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3213 self.0.options = v.into();
3214 self
3215 }
3216
3217 pub async fn send(self) -> Result<longrunning::model::Operation> {
3224 (*self.0.stub)
3225 .delete_framework_deployment(self.0.request, self.0.options)
3226 .await
3227 .map(gax::response::Response::into_body)
3228 }
3229
3230 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3232 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3233 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3234 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3235
3236 let stub = self.0.stub.clone();
3237 let mut options = self.0.options.clone();
3238 options.set_retry_policy(gax::retry_policy::NeverRetry);
3239 let query = move |name| {
3240 let stub = stub.clone();
3241 let options = options.clone();
3242 async {
3243 let op = GetOperation::new(stub)
3244 .set_name(name)
3245 .with_options(options)
3246 .send()
3247 .await?;
3248 Ok(Operation::new(op))
3249 }
3250 };
3251
3252 let start = move || async {
3253 let op = self.send().await?;
3254 Ok(Operation::new(op))
3255 };
3256
3257 lro::internal::new_unit_response_poller(
3258 polling_error_policy,
3259 polling_backoff_policy,
3260 start,
3261 query,
3262 )
3263 }
3264
3265 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3269 self.0.request.name = v.into();
3270 self
3271 }
3272
3273 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3275 self.0.request.etag = v.into();
3276 self
3277 }
3278 }
3279
3280 #[doc(hidden)]
3281 impl gax::options::internal::RequestBuilder for DeleteFrameworkDeployment {
3282 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3283 &mut self.0.options
3284 }
3285 }
3286
3287 #[derive(Clone, Debug)]
3304 pub struct GetFrameworkDeployment(RequestBuilder<crate::model::GetFrameworkDeploymentRequest>);
3305
3306 impl GetFrameworkDeployment {
3307 pub(crate) fn new(
3308 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3309 ) -> Self {
3310 Self(RequestBuilder::new(stub))
3311 }
3312
3313 pub fn with_request<V: Into<crate::model::GetFrameworkDeploymentRequest>>(
3315 mut self,
3316 v: V,
3317 ) -> Self {
3318 self.0.request = v.into();
3319 self
3320 }
3321
3322 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3324 self.0.options = v.into();
3325 self
3326 }
3327
3328 pub async fn send(self) -> Result<crate::model::FrameworkDeployment> {
3330 (*self.0.stub)
3331 .get_framework_deployment(self.0.request, self.0.options)
3332 .await
3333 .map(gax::response::Response::into_body)
3334 }
3335
3336 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3340 self.0.request.name = v.into();
3341 self
3342 }
3343 }
3344
3345 #[doc(hidden)]
3346 impl gax::options::internal::RequestBuilder for GetFrameworkDeployment {
3347 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3348 &mut self.0.options
3349 }
3350 }
3351
3352 #[derive(Clone, Debug)]
3373 pub struct ListFrameworkDeployments(
3374 RequestBuilder<crate::model::ListFrameworkDeploymentsRequest>,
3375 );
3376
3377 impl ListFrameworkDeployments {
3378 pub(crate) fn new(
3379 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3380 ) -> Self {
3381 Self(RequestBuilder::new(stub))
3382 }
3383
3384 pub fn with_request<V: Into<crate::model::ListFrameworkDeploymentsRequest>>(
3386 mut self,
3387 v: V,
3388 ) -> Self {
3389 self.0.request = v.into();
3390 self
3391 }
3392
3393 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3395 self.0.options = v.into();
3396 self
3397 }
3398
3399 pub async fn send(self) -> Result<crate::model::ListFrameworkDeploymentsResponse> {
3401 (*self.0.stub)
3402 .list_framework_deployments(self.0.request, self.0.options)
3403 .await
3404 .map(gax::response::Response::into_body)
3405 }
3406
3407 pub fn by_page(
3409 self,
3410 ) -> impl gax::paginator::Paginator<
3411 crate::model::ListFrameworkDeploymentsResponse,
3412 gax::error::Error,
3413 > {
3414 use std::clone::Clone;
3415 let token = self.0.request.page_token.clone();
3416 let execute = move |token: String| {
3417 let mut builder = self.clone();
3418 builder.0.request = builder.0.request.set_page_token(token);
3419 builder.send()
3420 };
3421 gax::paginator::internal::new_paginator(token, execute)
3422 }
3423
3424 pub fn by_item(
3426 self,
3427 ) -> impl gax::paginator::ItemPaginator<
3428 crate::model::ListFrameworkDeploymentsResponse,
3429 gax::error::Error,
3430 > {
3431 use gax::paginator::Paginator;
3432 self.by_page().items()
3433 }
3434
3435 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3439 self.0.request.parent = v.into();
3440 self
3441 }
3442
3443 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3445 self.0.request.page_size = v.into();
3446 self
3447 }
3448
3449 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3451 self.0.request.page_token = v.into();
3452 self
3453 }
3454
3455 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3457 self.0.request.filter = v.into();
3458 self
3459 }
3460
3461 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3463 self.0.request.order_by = v.into();
3464 self
3465 }
3466 }
3467
3468 #[doc(hidden)]
3469 impl gax::options::internal::RequestBuilder for ListFrameworkDeployments {
3470 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3471 &mut self.0.options
3472 }
3473 }
3474
3475 #[derive(Clone, Debug)]
3492 pub struct GetCloudControlDeployment(
3493 RequestBuilder<crate::model::GetCloudControlDeploymentRequest>,
3494 );
3495
3496 impl GetCloudControlDeployment {
3497 pub(crate) fn new(
3498 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3499 ) -> Self {
3500 Self(RequestBuilder::new(stub))
3501 }
3502
3503 pub fn with_request<V: Into<crate::model::GetCloudControlDeploymentRequest>>(
3505 mut self,
3506 v: V,
3507 ) -> Self {
3508 self.0.request = v.into();
3509 self
3510 }
3511
3512 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3514 self.0.options = v.into();
3515 self
3516 }
3517
3518 pub async fn send(self) -> Result<crate::model::CloudControlDeployment> {
3520 (*self.0.stub)
3521 .get_cloud_control_deployment(self.0.request, self.0.options)
3522 .await
3523 .map(gax::response::Response::into_body)
3524 }
3525
3526 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3530 self.0.request.name = v.into();
3531 self
3532 }
3533 }
3534
3535 #[doc(hidden)]
3536 impl gax::options::internal::RequestBuilder for GetCloudControlDeployment {
3537 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3538 &mut self.0.options
3539 }
3540 }
3541
3542 #[derive(Clone, Debug)]
3563 pub struct ListCloudControlDeployments(
3564 RequestBuilder<crate::model::ListCloudControlDeploymentsRequest>,
3565 );
3566
3567 impl ListCloudControlDeployments {
3568 pub(crate) fn new(
3569 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3570 ) -> Self {
3571 Self(RequestBuilder::new(stub))
3572 }
3573
3574 pub fn with_request<V: Into<crate::model::ListCloudControlDeploymentsRequest>>(
3576 mut self,
3577 v: V,
3578 ) -> Self {
3579 self.0.request = v.into();
3580 self
3581 }
3582
3583 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3585 self.0.options = v.into();
3586 self
3587 }
3588
3589 pub async fn send(self) -> Result<crate::model::ListCloudControlDeploymentsResponse> {
3591 (*self.0.stub)
3592 .list_cloud_control_deployments(self.0.request, self.0.options)
3593 .await
3594 .map(gax::response::Response::into_body)
3595 }
3596
3597 pub fn by_page(
3599 self,
3600 ) -> impl gax::paginator::Paginator<
3601 crate::model::ListCloudControlDeploymentsResponse,
3602 gax::error::Error,
3603 > {
3604 use std::clone::Clone;
3605 let token = self.0.request.page_token.clone();
3606 let execute = move |token: String| {
3607 let mut builder = self.clone();
3608 builder.0.request = builder.0.request.set_page_token(token);
3609 builder.send()
3610 };
3611 gax::paginator::internal::new_paginator(token, execute)
3612 }
3613
3614 pub fn by_item(
3616 self,
3617 ) -> impl gax::paginator::ItemPaginator<
3618 crate::model::ListCloudControlDeploymentsResponse,
3619 gax::error::Error,
3620 > {
3621 use gax::paginator::Paginator;
3622 self.by_page().items()
3623 }
3624
3625 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3629 self.0.request.parent = v.into();
3630 self
3631 }
3632
3633 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3635 self.0.request.page_size = v.into();
3636 self
3637 }
3638
3639 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3641 self.0.request.page_token = v.into();
3642 self
3643 }
3644
3645 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3647 self.0.request.filter = v.into();
3648 self
3649 }
3650
3651 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3653 self.0.request.order_by = v.into();
3654 self
3655 }
3656 }
3657
3658 #[doc(hidden)]
3659 impl gax::options::internal::RequestBuilder for ListCloudControlDeployments {
3660 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3661 &mut self.0.options
3662 }
3663 }
3664
3665 #[derive(Clone, Debug)]
3686 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
3687
3688 impl ListLocations {
3689 pub(crate) fn new(
3690 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3691 ) -> Self {
3692 Self(RequestBuilder::new(stub))
3693 }
3694
3695 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3697 mut self,
3698 v: V,
3699 ) -> Self {
3700 self.0.request = v.into();
3701 self
3702 }
3703
3704 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3706 self.0.options = v.into();
3707 self
3708 }
3709
3710 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3712 (*self.0.stub)
3713 .list_locations(self.0.request, self.0.options)
3714 .await
3715 .map(gax::response::Response::into_body)
3716 }
3717
3718 pub fn by_page(
3720 self,
3721 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3722 {
3723 use std::clone::Clone;
3724 let token = self.0.request.page_token.clone();
3725 let execute = move |token: String| {
3726 let mut builder = self.clone();
3727 builder.0.request = builder.0.request.set_page_token(token);
3728 builder.send()
3729 };
3730 gax::paginator::internal::new_paginator(token, execute)
3731 }
3732
3733 pub fn by_item(
3735 self,
3736 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3737 {
3738 use gax::paginator::Paginator;
3739 self.by_page().items()
3740 }
3741
3742 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3744 self.0.request.name = v.into();
3745 self
3746 }
3747
3748 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3750 self.0.request.filter = v.into();
3751 self
3752 }
3753
3754 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3756 self.0.request.page_size = v.into();
3757 self
3758 }
3759
3760 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3762 self.0.request.page_token = v.into();
3763 self
3764 }
3765 }
3766
3767 #[doc(hidden)]
3768 impl gax::options::internal::RequestBuilder for ListLocations {
3769 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3770 &mut self.0.options
3771 }
3772 }
3773
3774 #[derive(Clone, Debug)]
3791 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3792
3793 impl GetLocation {
3794 pub(crate) fn new(
3795 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3796 ) -> Self {
3797 Self(RequestBuilder::new(stub))
3798 }
3799
3800 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3802 self.0.request = v.into();
3803 self
3804 }
3805
3806 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3808 self.0.options = v.into();
3809 self
3810 }
3811
3812 pub async fn send(self) -> Result<location::model::Location> {
3814 (*self.0.stub)
3815 .get_location(self.0.request, self.0.options)
3816 .await
3817 .map(gax::response::Response::into_body)
3818 }
3819
3820 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3822 self.0.request.name = v.into();
3823 self
3824 }
3825 }
3826
3827 #[doc(hidden)]
3828 impl gax::options::internal::RequestBuilder for GetLocation {
3829 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3830 &mut self.0.options
3831 }
3832 }
3833
3834 #[derive(Clone, Debug)]
3855 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3856
3857 impl ListOperations {
3858 pub(crate) fn new(
3859 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3860 ) -> Self {
3861 Self(RequestBuilder::new(stub))
3862 }
3863
3864 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3866 mut self,
3867 v: V,
3868 ) -> Self {
3869 self.0.request = v.into();
3870 self
3871 }
3872
3873 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3875 self.0.options = v.into();
3876 self
3877 }
3878
3879 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3881 (*self.0.stub)
3882 .list_operations(self.0.request, self.0.options)
3883 .await
3884 .map(gax::response::Response::into_body)
3885 }
3886
3887 pub fn by_page(
3889 self,
3890 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3891 {
3892 use std::clone::Clone;
3893 let token = self.0.request.page_token.clone();
3894 let execute = move |token: String| {
3895 let mut builder = self.clone();
3896 builder.0.request = builder.0.request.set_page_token(token);
3897 builder.send()
3898 };
3899 gax::paginator::internal::new_paginator(token, execute)
3900 }
3901
3902 pub fn by_item(
3904 self,
3905 ) -> impl gax::paginator::ItemPaginator<
3906 longrunning::model::ListOperationsResponse,
3907 gax::error::Error,
3908 > {
3909 use gax::paginator::Paginator;
3910 self.by_page().items()
3911 }
3912
3913 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3915 self.0.request.name = v.into();
3916 self
3917 }
3918
3919 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3921 self.0.request.filter = v.into();
3922 self
3923 }
3924
3925 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3927 self.0.request.page_size = v.into();
3928 self
3929 }
3930
3931 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3933 self.0.request.page_token = v.into();
3934 self
3935 }
3936
3937 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3939 self.0.request.return_partial_success = v.into();
3940 self
3941 }
3942 }
3943
3944 #[doc(hidden)]
3945 impl gax::options::internal::RequestBuilder for ListOperations {
3946 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3947 &mut self.0.options
3948 }
3949 }
3950
3951 #[derive(Clone, Debug)]
3968 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3969
3970 impl GetOperation {
3971 pub(crate) fn new(
3972 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3973 ) -> Self {
3974 Self(RequestBuilder::new(stub))
3975 }
3976
3977 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3979 mut self,
3980 v: V,
3981 ) -> Self {
3982 self.0.request = v.into();
3983 self
3984 }
3985
3986 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3988 self.0.options = v.into();
3989 self
3990 }
3991
3992 pub async fn send(self) -> Result<longrunning::model::Operation> {
3994 (*self.0.stub)
3995 .get_operation(self.0.request, self.0.options)
3996 .await
3997 .map(gax::response::Response::into_body)
3998 }
3999
4000 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4002 self.0.request.name = v.into();
4003 self
4004 }
4005 }
4006
4007 #[doc(hidden)]
4008 impl gax::options::internal::RequestBuilder for GetOperation {
4009 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4010 &mut self.0.options
4011 }
4012 }
4013
4014 #[derive(Clone, Debug)]
4031 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4032
4033 impl DeleteOperation {
4034 pub(crate) fn new(
4035 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
4036 ) -> Self {
4037 Self(RequestBuilder::new(stub))
4038 }
4039
4040 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4042 mut self,
4043 v: V,
4044 ) -> Self {
4045 self.0.request = v.into();
4046 self
4047 }
4048
4049 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4051 self.0.options = v.into();
4052 self
4053 }
4054
4055 pub async fn send(self) -> Result<()> {
4057 (*self.0.stub)
4058 .delete_operation(self.0.request, self.0.options)
4059 .await
4060 .map(gax::response::Response::into_body)
4061 }
4062
4063 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4065 self.0.request.name = v.into();
4066 self
4067 }
4068 }
4069
4070 #[doc(hidden)]
4071 impl gax::options::internal::RequestBuilder for DeleteOperation {
4072 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4073 &mut self.0.options
4074 }
4075 }
4076
4077 #[derive(Clone, Debug)]
4094 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4095
4096 impl CancelOperation {
4097 pub(crate) fn new(
4098 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
4099 ) -> Self {
4100 Self(RequestBuilder::new(stub))
4101 }
4102
4103 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4105 mut self,
4106 v: V,
4107 ) -> Self {
4108 self.0.request = v.into();
4109 self
4110 }
4111
4112 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4114 self.0.options = v.into();
4115 self
4116 }
4117
4118 pub async fn send(self) -> Result<()> {
4120 (*self.0.stub)
4121 .cancel_operation(self.0.request, self.0.options)
4122 .await
4123 .map(gax::response::Response::into_body)
4124 }
4125
4126 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4128 self.0.request.name = v.into();
4129 self
4130 }
4131 }
4132
4133 #[doc(hidden)]
4134 impl gax::options::internal::RequestBuilder for CancelOperation {
4135 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4136 &mut self.0.options
4137 }
4138 }
4139}
4140
4141pub mod monitoring {
4142 use crate::Result;
4143
4144 pub type ClientBuilder =
4158 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4159
4160 pub(crate) mod client {
4161 use super::super::super::client::Monitoring;
4162 pub struct Factory;
4163 impl gax::client_builder::internal::ClientFactory for Factory {
4164 type Client = Monitoring;
4165 type Credentials = gaxi::options::Credentials;
4166 async fn build(
4167 self,
4168 config: gaxi::options::ClientConfig,
4169 ) -> gax::client_builder::Result<Self::Client> {
4170 Self::Client::new(config).await
4171 }
4172 }
4173 }
4174
4175 #[derive(Clone, Debug)]
4177 pub(crate) struct RequestBuilder<R: std::default::Default> {
4178 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4179 request: R,
4180 options: gax::options::RequestOptions,
4181 }
4182
4183 impl<R> RequestBuilder<R>
4184 where
4185 R: std::default::Default,
4186 {
4187 pub(crate) fn new(
4188 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4189 ) -> Self {
4190 Self {
4191 stub,
4192 request: R::default(),
4193 options: gax::options::RequestOptions::default(),
4194 }
4195 }
4196 }
4197
4198 #[derive(Clone, Debug)]
4219 pub struct ListFrameworkComplianceSummaries(
4220 RequestBuilder<crate::model::ListFrameworkComplianceSummariesRequest>,
4221 );
4222
4223 impl ListFrameworkComplianceSummaries {
4224 pub(crate) fn new(
4225 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4226 ) -> Self {
4227 Self(RequestBuilder::new(stub))
4228 }
4229
4230 pub fn with_request<V: Into<crate::model::ListFrameworkComplianceSummariesRequest>>(
4232 mut self,
4233 v: V,
4234 ) -> Self {
4235 self.0.request = v.into();
4236 self
4237 }
4238
4239 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4241 self.0.options = v.into();
4242 self
4243 }
4244
4245 pub async fn send(self) -> Result<crate::model::ListFrameworkComplianceSummariesResponse> {
4247 (*self.0.stub)
4248 .list_framework_compliance_summaries(self.0.request, self.0.options)
4249 .await
4250 .map(gax::response::Response::into_body)
4251 }
4252
4253 pub fn by_page(
4255 self,
4256 ) -> impl gax::paginator::Paginator<
4257 crate::model::ListFrameworkComplianceSummariesResponse,
4258 gax::error::Error,
4259 > {
4260 use std::clone::Clone;
4261 let token = self.0.request.page_token.clone();
4262 let execute = move |token: String| {
4263 let mut builder = self.clone();
4264 builder.0.request = builder.0.request.set_page_token(token);
4265 builder.send()
4266 };
4267 gax::paginator::internal::new_paginator(token, execute)
4268 }
4269
4270 pub fn by_item(
4272 self,
4273 ) -> impl gax::paginator::ItemPaginator<
4274 crate::model::ListFrameworkComplianceSummariesResponse,
4275 gax::error::Error,
4276 > {
4277 use gax::paginator::Paginator;
4278 self.by_page().items()
4279 }
4280
4281 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4285 self.0.request.parent = v.into();
4286 self
4287 }
4288
4289 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4291 self.0.request.page_size = v.into();
4292 self
4293 }
4294
4295 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4297 self.0.request.page_token = v.into();
4298 self
4299 }
4300
4301 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4303 self.0.request.filter = v.into();
4304 self
4305 }
4306 }
4307
4308 #[doc(hidden)]
4309 impl gax::options::internal::RequestBuilder for ListFrameworkComplianceSummaries {
4310 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4311 &mut self.0.options
4312 }
4313 }
4314
4315 #[derive(Clone, Debug)]
4336 pub struct ListFindingSummaries(RequestBuilder<crate::model::ListFindingSummariesRequest>);
4337
4338 impl ListFindingSummaries {
4339 pub(crate) fn new(
4340 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4341 ) -> Self {
4342 Self(RequestBuilder::new(stub))
4343 }
4344
4345 pub fn with_request<V: Into<crate::model::ListFindingSummariesRequest>>(
4347 mut self,
4348 v: V,
4349 ) -> Self {
4350 self.0.request = v.into();
4351 self
4352 }
4353
4354 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4356 self.0.options = v.into();
4357 self
4358 }
4359
4360 pub async fn send(self) -> Result<crate::model::ListFindingSummariesResponse> {
4362 (*self.0.stub)
4363 .list_finding_summaries(self.0.request, self.0.options)
4364 .await
4365 .map(gax::response::Response::into_body)
4366 }
4367
4368 pub fn by_page(
4370 self,
4371 ) -> impl gax::paginator::Paginator<crate::model::ListFindingSummariesResponse, gax::error::Error>
4372 {
4373 use std::clone::Clone;
4374 let token = self.0.request.page_token.clone();
4375 let execute = move |token: String| {
4376 let mut builder = self.clone();
4377 builder.0.request = builder.0.request.set_page_token(token);
4378 builder.send()
4379 };
4380 gax::paginator::internal::new_paginator(token, execute)
4381 }
4382
4383 pub fn by_item(
4385 self,
4386 ) -> impl gax::paginator::ItemPaginator<
4387 crate::model::ListFindingSummariesResponse,
4388 gax::error::Error,
4389 > {
4390 use gax::paginator::Paginator;
4391 self.by_page().items()
4392 }
4393
4394 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4398 self.0.request.parent = v.into();
4399 self
4400 }
4401
4402 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4404 self.0.request.page_size = v.into();
4405 self
4406 }
4407
4408 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4410 self.0.request.page_token = v.into();
4411 self
4412 }
4413
4414 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4416 self.0.request.filter = v.into();
4417 self
4418 }
4419
4420 #[deprecated]
4422 pub fn set_end_time<T>(mut self, v: T) -> Self
4423 where
4424 T: std::convert::Into<wkt::Timestamp>,
4425 {
4426 self.0.request.end_time = std::option::Option::Some(v.into());
4427 self
4428 }
4429
4430 #[deprecated]
4432 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4433 where
4434 T: std::convert::Into<wkt::Timestamp>,
4435 {
4436 self.0.request.end_time = v.map(|x| x.into());
4437 self
4438 }
4439 }
4440
4441 #[doc(hidden)]
4442 impl gax::options::internal::RequestBuilder for ListFindingSummaries {
4443 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4444 &mut self.0.options
4445 }
4446 }
4447
4448 #[derive(Clone, Debug)]
4465 pub struct FetchFrameworkComplianceReport(
4466 RequestBuilder<crate::model::FetchFrameworkComplianceReportRequest>,
4467 );
4468
4469 impl FetchFrameworkComplianceReport {
4470 pub(crate) fn new(
4471 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4472 ) -> Self {
4473 Self(RequestBuilder::new(stub))
4474 }
4475
4476 pub fn with_request<V: Into<crate::model::FetchFrameworkComplianceReportRequest>>(
4478 mut self,
4479 v: V,
4480 ) -> Self {
4481 self.0.request = v.into();
4482 self
4483 }
4484
4485 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4487 self.0.options = v.into();
4488 self
4489 }
4490
4491 pub async fn send(self) -> Result<crate::model::FrameworkComplianceReport> {
4493 (*self.0.stub)
4494 .fetch_framework_compliance_report(self.0.request, self.0.options)
4495 .await
4496 .map(gax::response::Response::into_body)
4497 }
4498
4499 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4503 self.0.request.name = v.into();
4504 self
4505 }
4506
4507 pub fn set_end_time<T>(mut self, v: T) -> Self
4509 where
4510 T: std::convert::Into<wkt::Timestamp>,
4511 {
4512 self.0.request.end_time = std::option::Option::Some(v.into());
4513 self
4514 }
4515
4516 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4518 where
4519 T: std::convert::Into<wkt::Timestamp>,
4520 {
4521 self.0.request.end_time = v.map(|x| x.into());
4522 self
4523 }
4524 }
4525
4526 #[doc(hidden)]
4527 impl gax::options::internal::RequestBuilder for FetchFrameworkComplianceReport {
4528 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4529 &mut self.0.options
4530 }
4531 }
4532
4533 #[derive(Clone, Debug)]
4554 pub struct ListControlComplianceSummaries(
4555 RequestBuilder<crate::model::ListControlComplianceSummariesRequest>,
4556 );
4557
4558 impl ListControlComplianceSummaries {
4559 pub(crate) fn new(
4560 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4561 ) -> Self {
4562 Self(RequestBuilder::new(stub))
4563 }
4564
4565 pub fn with_request<V: Into<crate::model::ListControlComplianceSummariesRequest>>(
4567 mut self,
4568 v: V,
4569 ) -> Self {
4570 self.0.request = v.into();
4571 self
4572 }
4573
4574 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4576 self.0.options = v.into();
4577 self
4578 }
4579
4580 pub async fn send(self) -> Result<crate::model::ListControlComplianceSummariesResponse> {
4582 (*self.0.stub)
4583 .list_control_compliance_summaries(self.0.request, self.0.options)
4584 .await
4585 .map(gax::response::Response::into_body)
4586 }
4587
4588 pub fn by_page(
4590 self,
4591 ) -> impl gax::paginator::Paginator<
4592 crate::model::ListControlComplianceSummariesResponse,
4593 gax::error::Error,
4594 > {
4595 use std::clone::Clone;
4596 let token = self.0.request.page_token.clone();
4597 let execute = move |token: String| {
4598 let mut builder = self.clone();
4599 builder.0.request = builder.0.request.set_page_token(token);
4600 builder.send()
4601 };
4602 gax::paginator::internal::new_paginator(token, execute)
4603 }
4604
4605 pub fn by_item(
4607 self,
4608 ) -> impl gax::paginator::ItemPaginator<
4609 crate::model::ListControlComplianceSummariesResponse,
4610 gax::error::Error,
4611 > {
4612 use gax::paginator::Paginator;
4613 self.by_page().items()
4614 }
4615
4616 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4620 self.0.request.parent = v.into();
4621 self
4622 }
4623
4624 #[deprecated]
4626 pub fn set_end_time<T>(mut self, v: T) -> Self
4627 where
4628 T: std::convert::Into<wkt::Timestamp>,
4629 {
4630 self.0.request.end_time = std::option::Option::Some(v.into());
4631 self
4632 }
4633
4634 #[deprecated]
4636 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4637 where
4638 T: std::convert::Into<wkt::Timestamp>,
4639 {
4640 self.0.request.end_time = v.map(|x| x.into());
4641 self
4642 }
4643
4644 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4646 self.0.request.page_size = v.into();
4647 self
4648 }
4649
4650 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4652 self.0.request.page_token = v.into();
4653 self
4654 }
4655
4656 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4658 self.0.request.filter = v.into();
4659 self
4660 }
4661 }
4662
4663 #[doc(hidden)]
4664 impl gax::options::internal::RequestBuilder for ListControlComplianceSummaries {
4665 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4666 &mut self.0.options
4667 }
4668 }
4669
4670 #[derive(Clone, Debug)]
4687 pub struct AggregateFrameworkComplianceReport(
4688 RequestBuilder<crate::model::AggregateFrameworkComplianceReportRequest>,
4689 );
4690
4691 impl AggregateFrameworkComplianceReport {
4692 pub(crate) fn new(
4693 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4694 ) -> Self {
4695 Self(RequestBuilder::new(stub))
4696 }
4697
4698 pub fn with_request<V: Into<crate::model::AggregateFrameworkComplianceReportRequest>>(
4700 mut self,
4701 v: V,
4702 ) -> Self {
4703 self.0.request = v.into();
4704 self
4705 }
4706
4707 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4709 self.0.options = v.into();
4710 self
4711 }
4712
4713 pub async fn send(
4715 self,
4716 ) -> Result<crate::model::AggregateFrameworkComplianceReportResponse> {
4717 (*self.0.stub)
4718 .aggregate_framework_compliance_report(self.0.request, self.0.options)
4719 .await
4720 .map(gax::response::Response::into_body)
4721 }
4722
4723 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4727 self.0.request.name = v.into();
4728 self
4729 }
4730
4731 pub fn set_interval<T>(mut self, v: T) -> Self
4733 where
4734 T: std::convert::Into<gtype::model::Interval>,
4735 {
4736 self.0.request.interval = std::option::Option::Some(v.into());
4737 self
4738 }
4739
4740 pub fn set_or_clear_interval<T>(mut self, v: std::option::Option<T>) -> Self
4742 where
4743 T: std::convert::Into<gtype::model::Interval>,
4744 {
4745 self.0.request.interval = v.map(|x| x.into());
4746 self
4747 }
4748
4749 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4751 self.0.request.filter = v.into();
4752 self
4753 }
4754 }
4755
4756 #[doc(hidden)]
4757 impl gax::options::internal::RequestBuilder for AggregateFrameworkComplianceReport {
4758 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4759 &mut self.0.options
4760 }
4761 }
4762
4763 #[derive(Clone, Debug)]
4784 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4785
4786 impl ListLocations {
4787 pub(crate) fn new(
4788 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4789 ) -> Self {
4790 Self(RequestBuilder::new(stub))
4791 }
4792
4793 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4795 mut self,
4796 v: V,
4797 ) -> Self {
4798 self.0.request = v.into();
4799 self
4800 }
4801
4802 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4804 self.0.options = v.into();
4805 self
4806 }
4807
4808 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4810 (*self.0.stub)
4811 .list_locations(self.0.request, self.0.options)
4812 .await
4813 .map(gax::response::Response::into_body)
4814 }
4815
4816 pub fn by_page(
4818 self,
4819 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4820 {
4821 use std::clone::Clone;
4822 let token = self.0.request.page_token.clone();
4823 let execute = move |token: String| {
4824 let mut builder = self.clone();
4825 builder.0.request = builder.0.request.set_page_token(token);
4826 builder.send()
4827 };
4828 gax::paginator::internal::new_paginator(token, execute)
4829 }
4830
4831 pub fn by_item(
4833 self,
4834 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4835 {
4836 use gax::paginator::Paginator;
4837 self.by_page().items()
4838 }
4839
4840 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4842 self.0.request.name = v.into();
4843 self
4844 }
4845
4846 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4848 self.0.request.filter = v.into();
4849 self
4850 }
4851
4852 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4854 self.0.request.page_size = v.into();
4855 self
4856 }
4857
4858 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4860 self.0.request.page_token = v.into();
4861 self
4862 }
4863 }
4864
4865 #[doc(hidden)]
4866 impl gax::options::internal::RequestBuilder for ListLocations {
4867 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4868 &mut self.0.options
4869 }
4870 }
4871
4872 #[derive(Clone, Debug)]
4889 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4890
4891 impl GetLocation {
4892 pub(crate) fn new(
4893 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4894 ) -> Self {
4895 Self(RequestBuilder::new(stub))
4896 }
4897
4898 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4900 self.0.request = v.into();
4901 self
4902 }
4903
4904 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4906 self.0.options = v.into();
4907 self
4908 }
4909
4910 pub async fn send(self) -> Result<location::model::Location> {
4912 (*self.0.stub)
4913 .get_location(self.0.request, self.0.options)
4914 .await
4915 .map(gax::response::Response::into_body)
4916 }
4917
4918 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4920 self.0.request.name = v.into();
4921 self
4922 }
4923 }
4924
4925 #[doc(hidden)]
4926 impl gax::options::internal::RequestBuilder for GetLocation {
4927 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4928 &mut self.0.options
4929 }
4930 }
4931
4932 #[derive(Clone, Debug)]
4953 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4954
4955 impl ListOperations {
4956 pub(crate) fn new(
4957 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4958 ) -> Self {
4959 Self(RequestBuilder::new(stub))
4960 }
4961
4962 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4964 mut self,
4965 v: V,
4966 ) -> Self {
4967 self.0.request = v.into();
4968 self
4969 }
4970
4971 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4973 self.0.options = v.into();
4974 self
4975 }
4976
4977 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4979 (*self.0.stub)
4980 .list_operations(self.0.request, self.0.options)
4981 .await
4982 .map(gax::response::Response::into_body)
4983 }
4984
4985 pub fn by_page(
4987 self,
4988 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4989 {
4990 use std::clone::Clone;
4991 let token = self.0.request.page_token.clone();
4992 let execute = move |token: String| {
4993 let mut builder = self.clone();
4994 builder.0.request = builder.0.request.set_page_token(token);
4995 builder.send()
4996 };
4997 gax::paginator::internal::new_paginator(token, execute)
4998 }
4999
5000 pub fn by_item(
5002 self,
5003 ) -> impl gax::paginator::ItemPaginator<
5004 longrunning::model::ListOperationsResponse,
5005 gax::error::Error,
5006 > {
5007 use gax::paginator::Paginator;
5008 self.by_page().items()
5009 }
5010
5011 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5013 self.0.request.name = v.into();
5014 self
5015 }
5016
5017 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5019 self.0.request.filter = v.into();
5020 self
5021 }
5022
5023 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5025 self.0.request.page_size = v.into();
5026 self
5027 }
5028
5029 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5031 self.0.request.page_token = v.into();
5032 self
5033 }
5034
5035 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5037 self.0.request.return_partial_success = v.into();
5038 self
5039 }
5040 }
5041
5042 #[doc(hidden)]
5043 impl gax::options::internal::RequestBuilder for ListOperations {
5044 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5045 &mut self.0.options
5046 }
5047 }
5048
5049 #[derive(Clone, Debug)]
5066 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5067
5068 impl GetOperation {
5069 pub(crate) fn new(
5070 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5071 ) -> Self {
5072 Self(RequestBuilder::new(stub))
5073 }
5074
5075 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5077 mut self,
5078 v: V,
5079 ) -> Self {
5080 self.0.request = v.into();
5081 self
5082 }
5083
5084 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5086 self.0.options = v.into();
5087 self
5088 }
5089
5090 pub async fn send(self) -> Result<longrunning::model::Operation> {
5092 (*self.0.stub)
5093 .get_operation(self.0.request, self.0.options)
5094 .await
5095 .map(gax::response::Response::into_body)
5096 }
5097
5098 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5100 self.0.request.name = v.into();
5101 self
5102 }
5103 }
5104
5105 #[doc(hidden)]
5106 impl gax::options::internal::RequestBuilder for GetOperation {
5107 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5108 &mut self.0.options
5109 }
5110 }
5111
5112 #[derive(Clone, Debug)]
5129 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5130
5131 impl DeleteOperation {
5132 pub(crate) fn new(
5133 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5134 ) -> Self {
5135 Self(RequestBuilder::new(stub))
5136 }
5137
5138 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5140 mut self,
5141 v: V,
5142 ) -> Self {
5143 self.0.request = v.into();
5144 self
5145 }
5146
5147 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5149 self.0.options = v.into();
5150 self
5151 }
5152
5153 pub async fn send(self) -> Result<()> {
5155 (*self.0.stub)
5156 .delete_operation(self.0.request, self.0.options)
5157 .await
5158 .map(gax::response::Response::into_body)
5159 }
5160
5161 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5163 self.0.request.name = v.into();
5164 self
5165 }
5166 }
5167
5168 #[doc(hidden)]
5169 impl gax::options::internal::RequestBuilder for DeleteOperation {
5170 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5171 &mut self.0.options
5172 }
5173 }
5174
5175 #[derive(Clone, Debug)]
5192 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5193
5194 impl CancelOperation {
5195 pub(crate) fn new(
5196 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5197 ) -> Self {
5198 Self(RequestBuilder::new(stub))
5199 }
5200
5201 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5203 mut self,
5204 v: V,
5205 ) -> Self {
5206 self.0.request = v.into();
5207 self
5208 }
5209
5210 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5212 self.0.options = v.into();
5213 self
5214 }
5215
5216 pub async fn send(self) -> Result<()> {
5218 (*self.0.stub)
5219 .cancel_operation(self.0.request, self.0.options)
5220 .await
5221 .map(gax::response::Response::into_body)
5222 }
5223
5224 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5226 self.0.request.name = v.into();
5227 self
5228 }
5229 }
5230
5231 #[doc(hidden)]
5232 impl gax::options::internal::RequestBuilder for CancelOperation {
5233 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5234 &mut self.0.options
5235 }
5236 }
5237}