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)]
90 pub struct GenerateFrameworkAuditScopeReport(
91 RequestBuilder<crate::model::GenerateFrameworkAuditScopeReportRequest>,
92 );
93
94 impl GenerateFrameworkAuditScopeReport {
95 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
96 Self(RequestBuilder::new(stub))
97 }
98
99 pub fn with_request<V: Into<crate::model::GenerateFrameworkAuditScopeReportRequest>>(
101 mut self,
102 v: V,
103 ) -> Self {
104 self.0.request = v.into();
105 self
106 }
107
108 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
110 self.0.options = v.into();
111 self
112 }
113
114 pub async fn send(self) -> Result<crate::model::GenerateFrameworkAuditScopeReportResponse> {
116 (*self.0.stub)
117 .generate_framework_audit_scope_report(self.0.request, self.0.options)
118 .await
119 .map(gax::response::Response::into_body)
120 }
121
122 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
126 self.0.request.scope = v.into();
127 self
128 }
129
130 pub fn set_report_format<
134 T: Into<crate::model::generate_framework_audit_scope_report_request::Format>,
135 >(
136 mut self,
137 v: T,
138 ) -> Self {
139 self.0.request.report_format = v.into();
140 self
141 }
142
143 pub fn set_compliance_framework<T: Into<std::string::String>>(mut self, v: T) -> Self {
147 self.0.request.compliance_framework = v.into();
148 self
149 }
150 }
151
152 #[doc(hidden)]
153 impl gax::options::internal::RequestBuilder for GenerateFrameworkAuditScopeReport {
154 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
155 &mut self.0.options
156 }
157 }
158
159 #[derive(Clone, Debug)]
178 pub struct CreateFrameworkAudit(RequestBuilder<crate::model::CreateFrameworkAuditRequest>);
179
180 impl CreateFrameworkAudit {
181 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
182 Self(RequestBuilder::new(stub))
183 }
184
185 pub fn with_request<V: Into<crate::model::CreateFrameworkAuditRequest>>(
187 mut self,
188 v: V,
189 ) -> Self {
190 self.0.request = v.into();
191 self
192 }
193
194 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
196 self.0.options = v.into();
197 self
198 }
199
200 pub async fn send(self) -> Result<longrunning::model::Operation> {
207 (*self.0.stub)
208 .create_framework_audit(self.0.request, self.0.options)
209 .await
210 .map(gax::response::Response::into_body)
211 }
212
213 pub fn poller(
215 self,
216 ) -> impl lro::Poller<crate::model::FrameworkAudit, crate::model::OperationMetadata>
217 {
218 type Operation = lro::internal::Operation<
219 crate::model::FrameworkAudit,
220 crate::model::OperationMetadata,
221 >;
222 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
223 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
224
225 let stub = self.0.stub.clone();
226 let mut options = self.0.options.clone();
227 options.set_retry_policy(gax::retry_policy::NeverRetry);
228 let query = move |name| {
229 let stub = stub.clone();
230 let options = options.clone();
231 async {
232 let op = GetOperation::new(stub)
233 .set_name(name)
234 .with_options(options)
235 .send()
236 .await?;
237 Ok(Operation::new(op))
238 }
239 };
240
241 let start = move || async {
242 let op = self.send().await?;
243 Ok(Operation::new(op))
244 };
245
246 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
247 }
248
249 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
253 self.0.request.parent = v.into();
254 self
255 }
256
257 pub fn set_framework_audit_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
259 self.0.request.framework_audit_id = v.into();
260 self
261 }
262
263 pub fn set_framework_audit<T>(mut self, v: T) -> Self
267 where
268 T: std::convert::Into<crate::model::FrameworkAudit>,
269 {
270 self.0.request.framework_audit = std::option::Option::Some(v.into());
271 self
272 }
273
274 pub fn set_or_clear_framework_audit<T>(mut self, v: std::option::Option<T>) -> Self
278 where
279 T: std::convert::Into<crate::model::FrameworkAudit>,
280 {
281 self.0.request.framework_audit = v.map(|x| x.into());
282 self
283 }
284 }
285
286 #[doc(hidden)]
287 impl gax::options::internal::RequestBuilder for CreateFrameworkAudit {
288 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
289 &mut self.0.options
290 }
291 }
292
293 #[derive(Clone, Debug)]
315 pub struct ListFrameworkAudits(RequestBuilder<crate::model::ListFrameworkAuditsRequest>);
316
317 impl ListFrameworkAudits {
318 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
319 Self(RequestBuilder::new(stub))
320 }
321
322 pub fn with_request<V: Into<crate::model::ListFrameworkAuditsRequest>>(
324 mut self,
325 v: V,
326 ) -> Self {
327 self.0.request = v.into();
328 self
329 }
330
331 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
333 self.0.options = v.into();
334 self
335 }
336
337 pub async fn send(self) -> Result<crate::model::ListFrameworkAuditsResponse> {
339 (*self.0.stub)
340 .list_framework_audits(self.0.request, self.0.options)
341 .await
342 .map(gax::response::Response::into_body)
343 }
344
345 pub fn by_page(
347 self,
348 ) -> impl gax::paginator::Paginator<crate::model::ListFrameworkAuditsResponse, gax::error::Error>
349 {
350 use std::clone::Clone;
351 let token = self.0.request.page_token.clone();
352 let execute = move |token: String| {
353 let mut builder = self.clone();
354 builder.0.request = builder.0.request.set_page_token(token);
355 builder.send()
356 };
357 gax::paginator::internal::new_paginator(token, execute)
358 }
359
360 pub fn by_item(
362 self,
363 ) -> impl gax::paginator::ItemPaginator<
364 crate::model::ListFrameworkAuditsResponse,
365 gax::error::Error,
366 > {
367 use gax::paginator::Paginator;
368 self.by_page().items()
369 }
370
371 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
375 self.0.request.parent = v.into();
376 self
377 }
378
379 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
381 self.0.request.page_size = v.into();
382 self
383 }
384
385 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
387 self.0.request.page_token = v.into();
388 self
389 }
390
391 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
393 self.0.request.filter = v.into();
394 self
395 }
396 }
397
398 #[doc(hidden)]
399 impl gax::options::internal::RequestBuilder for ListFrameworkAudits {
400 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
401 &mut self.0.options
402 }
403 }
404
405 #[derive(Clone, Debug)]
423 pub struct GetFrameworkAudit(RequestBuilder<crate::model::GetFrameworkAuditRequest>);
424
425 impl GetFrameworkAudit {
426 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
427 Self(RequestBuilder::new(stub))
428 }
429
430 pub fn with_request<V: Into<crate::model::GetFrameworkAuditRequest>>(
432 mut self,
433 v: V,
434 ) -> Self {
435 self.0.request = v.into();
436 self
437 }
438
439 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
441 self.0.options = v.into();
442 self
443 }
444
445 pub async fn send(self) -> Result<crate::model::FrameworkAudit> {
447 (*self.0.stub)
448 .get_framework_audit(self.0.request, self.0.options)
449 .await
450 .map(gax::response::Response::into_body)
451 }
452
453 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
457 self.0.request.name = v.into();
458 self
459 }
460 }
461
462 #[doc(hidden)]
463 impl gax::options::internal::RequestBuilder for GetFrameworkAudit {
464 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
465 &mut self.0.options
466 }
467 }
468
469 #[derive(Clone, Debug)]
491 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
492
493 impl ListLocations {
494 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
495 Self(RequestBuilder::new(stub))
496 }
497
498 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
500 mut self,
501 v: V,
502 ) -> Self {
503 self.0.request = v.into();
504 self
505 }
506
507 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
509 self.0.options = v.into();
510 self
511 }
512
513 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
515 (*self.0.stub)
516 .list_locations(self.0.request, self.0.options)
517 .await
518 .map(gax::response::Response::into_body)
519 }
520
521 pub fn by_page(
523 self,
524 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
525 {
526 use std::clone::Clone;
527 let token = self.0.request.page_token.clone();
528 let execute = move |token: String| {
529 let mut builder = self.clone();
530 builder.0.request = builder.0.request.set_page_token(token);
531 builder.send()
532 };
533 gax::paginator::internal::new_paginator(token, execute)
534 }
535
536 pub fn by_item(
538 self,
539 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
540 {
541 use gax::paginator::Paginator;
542 self.by_page().items()
543 }
544
545 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
547 self.0.request.name = v.into();
548 self
549 }
550
551 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
553 self.0.request.filter = v.into();
554 self
555 }
556
557 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
559 self.0.request.page_size = v.into();
560 self
561 }
562
563 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
565 self.0.request.page_token = v.into();
566 self
567 }
568 }
569
570 #[doc(hidden)]
571 impl gax::options::internal::RequestBuilder for ListLocations {
572 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
573 &mut self.0.options
574 }
575 }
576
577 #[derive(Clone, Debug)]
595 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
596
597 impl GetLocation {
598 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
599 Self(RequestBuilder::new(stub))
600 }
601
602 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
604 self.0.request = v.into();
605 self
606 }
607
608 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
610 self.0.options = v.into();
611 self
612 }
613
614 pub async fn send(self) -> Result<location::model::Location> {
616 (*self.0.stub)
617 .get_location(self.0.request, self.0.options)
618 .await
619 .map(gax::response::Response::into_body)
620 }
621
622 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
624 self.0.request.name = v.into();
625 self
626 }
627 }
628
629 #[doc(hidden)]
630 impl gax::options::internal::RequestBuilder for GetLocation {
631 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
632 &mut self.0.options
633 }
634 }
635
636 #[derive(Clone, Debug)]
658 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
659
660 impl ListOperations {
661 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
662 Self(RequestBuilder::new(stub))
663 }
664
665 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
667 mut self,
668 v: V,
669 ) -> Self {
670 self.0.request = v.into();
671 self
672 }
673
674 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
676 self.0.options = v.into();
677 self
678 }
679
680 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
682 (*self.0.stub)
683 .list_operations(self.0.request, self.0.options)
684 .await
685 .map(gax::response::Response::into_body)
686 }
687
688 pub fn by_page(
690 self,
691 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
692 {
693 use std::clone::Clone;
694 let token = self.0.request.page_token.clone();
695 let execute = move |token: String| {
696 let mut builder = self.clone();
697 builder.0.request = builder.0.request.set_page_token(token);
698 builder.send()
699 };
700 gax::paginator::internal::new_paginator(token, execute)
701 }
702
703 pub fn by_item(
705 self,
706 ) -> impl gax::paginator::ItemPaginator<
707 longrunning::model::ListOperationsResponse,
708 gax::error::Error,
709 > {
710 use gax::paginator::Paginator;
711 self.by_page().items()
712 }
713
714 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
716 self.0.request.name = v.into();
717 self
718 }
719
720 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
722 self.0.request.filter = v.into();
723 self
724 }
725
726 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
728 self.0.request.page_size = v.into();
729 self
730 }
731
732 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
734 self.0.request.page_token = v.into();
735 self
736 }
737
738 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
740 self.0.request.return_partial_success = v.into();
741 self
742 }
743 }
744
745 #[doc(hidden)]
746 impl gax::options::internal::RequestBuilder for ListOperations {
747 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
748 &mut self.0.options
749 }
750 }
751
752 #[derive(Clone, Debug)]
770 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
771
772 impl GetOperation {
773 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
774 Self(RequestBuilder::new(stub))
775 }
776
777 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
779 mut self,
780 v: V,
781 ) -> Self {
782 self.0.request = v.into();
783 self
784 }
785
786 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
788 self.0.options = v.into();
789 self
790 }
791
792 pub async fn send(self) -> Result<longrunning::model::Operation> {
794 (*self.0.stub)
795 .get_operation(self.0.request, self.0.options)
796 .await
797 .map(gax::response::Response::into_body)
798 }
799
800 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
802 self.0.request.name = v.into();
803 self
804 }
805 }
806
807 #[doc(hidden)]
808 impl gax::options::internal::RequestBuilder for GetOperation {
809 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
810 &mut self.0.options
811 }
812 }
813
814 #[derive(Clone, Debug)]
832 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
833
834 impl DeleteOperation {
835 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
836 Self(RequestBuilder::new(stub))
837 }
838
839 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
841 mut self,
842 v: V,
843 ) -> Self {
844 self.0.request = v.into();
845 self
846 }
847
848 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
850 self.0.options = v.into();
851 self
852 }
853
854 pub async fn send(self) -> Result<()> {
856 (*self.0.stub)
857 .delete_operation(self.0.request, self.0.options)
858 .await
859 .map(gax::response::Response::into_body)
860 }
861
862 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
864 self.0.request.name = v.into();
865 self
866 }
867 }
868
869 #[doc(hidden)]
870 impl gax::options::internal::RequestBuilder for DeleteOperation {
871 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
872 &mut self.0.options
873 }
874 }
875
876 #[derive(Clone, Debug)]
894 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
895
896 impl CancelOperation {
897 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Audit>) -> Self {
898 Self(RequestBuilder::new(stub))
899 }
900
901 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
903 mut self,
904 v: V,
905 ) -> Self {
906 self.0.request = v.into();
907 self
908 }
909
910 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
912 self.0.options = v.into();
913 self
914 }
915
916 pub async fn send(self) -> Result<()> {
918 (*self.0.stub)
919 .cancel_operation(self.0.request, self.0.options)
920 .await
921 .map(gax::response::Response::into_body)
922 }
923
924 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
926 self.0.request.name = v.into();
927 self
928 }
929 }
930
931 #[doc(hidden)]
932 impl gax::options::internal::RequestBuilder for CancelOperation {
933 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
934 &mut self.0.options
935 }
936 }
937}
938
939pub mod cm_enrollment_service {
940 use crate::Result;
941
942 pub type ClientBuilder =
956 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
957
958 pub(crate) mod client {
959 use super::super::super::client::CmEnrollmentService;
960 pub struct Factory;
961 impl gax::client_builder::internal::ClientFactory for Factory {
962 type Client = CmEnrollmentService;
963 type Credentials = gaxi::options::Credentials;
964 async fn build(
965 self,
966 config: gaxi::options::ClientConfig,
967 ) -> gax::client_builder::Result<Self::Client> {
968 Self::Client::new(config).await
969 }
970 }
971 }
972
973 #[derive(Clone, Debug)]
975 pub(crate) struct RequestBuilder<R: std::default::Default> {
976 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
977 request: R,
978 options: gax::options::RequestOptions,
979 }
980
981 impl<R> RequestBuilder<R>
982 where
983 R: std::default::Default,
984 {
985 pub(crate) fn new(
986 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
987 ) -> Self {
988 Self {
989 stub,
990 request: R::default(),
991 options: gax::options::RequestOptions::default(),
992 }
993 }
994 }
995
996 #[derive(Clone, Debug)]
1014 pub struct UpdateCmEnrollment(RequestBuilder<crate::model::UpdateCmEnrollmentRequest>);
1015
1016 impl UpdateCmEnrollment {
1017 pub(crate) fn new(
1018 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1019 ) -> Self {
1020 Self(RequestBuilder::new(stub))
1021 }
1022
1023 pub fn with_request<V: Into<crate::model::UpdateCmEnrollmentRequest>>(
1025 mut self,
1026 v: V,
1027 ) -> Self {
1028 self.0.request = v.into();
1029 self
1030 }
1031
1032 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1034 self.0.options = v.into();
1035 self
1036 }
1037
1038 pub async fn send(self) -> Result<crate::model::CmEnrollment> {
1040 (*self.0.stub)
1041 .update_cm_enrollment(self.0.request, self.0.options)
1042 .await
1043 .map(gax::response::Response::into_body)
1044 }
1045
1046 pub fn set_cm_enrollment<T>(mut self, v: T) -> Self
1050 where
1051 T: std::convert::Into<crate::model::CmEnrollment>,
1052 {
1053 self.0.request.cm_enrollment = std::option::Option::Some(v.into());
1054 self
1055 }
1056
1057 pub fn set_or_clear_cm_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
1061 where
1062 T: std::convert::Into<crate::model::CmEnrollment>,
1063 {
1064 self.0.request.cm_enrollment = v.map(|x| x.into());
1065 self
1066 }
1067
1068 pub fn set_update_mask<T>(mut self, v: T) -> Self
1070 where
1071 T: std::convert::Into<wkt::FieldMask>,
1072 {
1073 self.0.request.update_mask = std::option::Option::Some(v.into());
1074 self
1075 }
1076
1077 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1079 where
1080 T: std::convert::Into<wkt::FieldMask>,
1081 {
1082 self.0.request.update_mask = v.map(|x| x.into());
1083 self
1084 }
1085 }
1086
1087 #[doc(hidden)]
1088 impl gax::options::internal::RequestBuilder for UpdateCmEnrollment {
1089 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1090 &mut self.0.options
1091 }
1092 }
1093
1094 #[derive(Clone, Debug)]
1112 pub struct CalculateEffectiveCmEnrollment(
1113 RequestBuilder<crate::model::CalculateEffectiveCmEnrollmentRequest>,
1114 );
1115
1116 impl CalculateEffectiveCmEnrollment {
1117 pub(crate) fn new(
1118 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1119 ) -> Self {
1120 Self(RequestBuilder::new(stub))
1121 }
1122
1123 pub fn with_request<V: Into<crate::model::CalculateEffectiveCmEnrollmentRequest>>(
1125 mut self,
1126 v: V,
1127 ) -> Self {
1128 self.0.request = v.into();
1129 self
1130 }
1131
1132 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1134 self.0.options = v.into();
1135 self
1136 }
1137
1138 pub async fn send(self) -> Result<crate::model::CalculateEffectiveCmEnrollmentResponse> {
1140 (*self.0.stub)
1141 .calculate_effective_cm_enrollment(self.0.request, self.0.options)
1142 .await
1143 .map(gax::response::Response::into_body)
1144 }
1145
1146 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1150 self.0.request.name = v.into();
1151 self
1152 }
1153 }
1154
1155 #[doc(hidden)]
1156 impl gax::options::internal::RequestBuilder for CalculateEffectiveCmEnrollment {
1157 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1158 &mut self.0.options
1159 }
1160 }
1161
1162 #[derive(Clone, Debug)]
1184 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1185
1186 impl ListLocations {
1187 pub(crate) fn new(
1188 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1189 ) -> Self {
1190 Self(RequestBuilder::new(stub))
1191 }
1192
1193 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1195 mut self,
1196 v: V,
1197 ) -> Self {
1198 self.0.request = v.into();
1199 self
1200 }
1201
1202 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1204 self.0.options = v.into();
1205 self
1206 }
1207
1208 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1210 (*self.0.stub)
1211 .list_locations(self.0.request, self.0.options)
1212 .await
1213 .map(gax::response::Response::into_body)
1214 }
1215
1216 pub fn by_page(
1218 self,
1219 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1220 {
1221 use std::clone::Clone;
1222 let token = self.0.request.page_token.clone();
1223 let execute = move |token: String| {
1224 let mut builder = self.clone();
1225 builder.0.request = builder.0.request.set_page_token(token);
1226 builder.send()
1227 };
1228 gax::paginator::internal::new_paginator(token, execute)
1229 }
1230
1231 pub fn by_item(
1233 self,
1234 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1235 {
1236 use gax::paginator::Paginator;
1237 self.by_page().items()
1238 }
1239
1240 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1242 self.0.request.name = v.into();
1243 self
1244 }
1245
1246 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1248 self.0.request.filter = v.into();
1249 self
1250 }
1251
1252 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1254 self.0.request.page_size = v.into();
1255 self
1256 }
1257
1258 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1260 self.0.request.page_token = v.into();
1261 self
1262 }
1263 }
1264
1265 #[doc(hidden)]
1266 impl gax::options::internal::RequestBuilder for ListLocations {
1267 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1268 &mut self.0.options
1269 }
1270 }
1271
1272 #[derive(Clone, Debug)]
1290 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1291
1292 impl GetLocation {
1293 pub(crate) fn new(
1294 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1295 ) -> Self {
1296 Self(RequestBuilder::new(stub))
1297 }
1298
1299 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1301 self.0.request = v.into();
1302 self
1303 }
1304
1305 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1307 self.0.options = v.into();
1308 self
1309 }
1310
1311 pub async fn send(self) -> Result<location::model::Location> {
1313 (*self.0.stub)
1314 .get_location(self.0.request, self.0.options)
1315 .await
1316 .map(gax::response::Response::into_body)
1317 }
1318
1319 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1321 self.0.request.name = v.into();
1322 self
1323 }
1324 }
1325
1326 #[doc(hidden)]
1327 impl gax::options::internal::RequestBuilder for GetLocation {
1328 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1329 &mut self.0.options
1330 }
1331 }
1332
1333 #[derive(Clone, Debug)]
1355 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1356
1357 impl ListOperations {
1358 pub(crate) fn new(
1359 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1360 ) -> Self {
1361 Self(RequestBuilder::new(stub))
1362 }
1363
1364 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1366 mut self,
1367 v: V,
1368 ) -> Self {
1369 self.0.request = v.into();
1370 self
1371 }
1372
1373 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1375 self.0.options = v.into();
1376 self
1377 }
1378
1379 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1381 (*self.0.stub)
1382 .list_operations(self.0.request, self.0.options)
1383 .await
1384 .map(gax::response::Response::into_body)
1385 }
1386
1387 pub fn by_page(
1389 self,
1390 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1391 {
1392 use std::clone::Clone;
1393 let token = self.0.request.page_token.clone();
1394 let execute = move |token: String| {
1395 let mut builder = self.clone();
1396 builder.0.request = builder.0.request.set_page_token(token);
1397 builder.send()
1398 };
1399 gax::paginator::internal::new_paginator(token, execute)
1400 }
1401
1402 pub fn by_item(
1404 self,
1405 ) -> impl gax::paginator::ItemPaginator<
1406 longrunning::model::ListOperationsResponse,
1407 gax::error::Error,
1408 > {
1409 use gax::paginator::Paginator;
1410 self.by_page().items()
1411 }
1412
1413 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1415 self.0.request.name = v.into();
1416 self
1417 }
1418
1419 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1421 self.0.request.filter = v.into();
1422 self
1423 }
1424
1425 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1427 self.0.request.page_size = v.into();
1428 self
1429 }
1430
1431 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1433 self.0.request.page_token = v.into();
1434 self
1435 }
1436
1437 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1439 self.0.request.return_partial_success = v.into();
1440 self
1441 }
1442 }
1443
1444 #[doc(hidden)]
1445 impl gax::options::internal::RequestBuilder for ListOperations {
1446 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1447 &mut self.0.options
1448 }
1449 }
1450
1451 #[derive(Clone, Debug)]
1469 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1470
1471 impl GetOperation {
1472 pub(crate) fn new(
1473 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1474 ) -> Self {
1475 Self(RequestBuilder::new(stub))
1476 }
1477
1478 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1480 mut self,
1481 v: V,
1482 ) -> Self {
1483 self.0.request = v.into();
1484 self
1485 }
1486
1487 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1489 self.0.options = v.into();
1490 self
1491 }
1492
1493 pub async fn send(self) -> Result<longrunning::model::Operation> {
1495 (*self.0.stub)
1496 .get_operation(self.0.request, self.0.options)
1497 .await
1498 .map(gax::response::Response::into_body)
1499 }
1500
1501 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1503 self.0.request.name = v.into();
1504 self
1505 }
1506 }
1507
1508 #[doc(hidden)]
1509 impl gax::options::internal::RequestBuilder for GetOperation {
1510 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1511 &mut self.0.options
1512 }
1513 }
1514
1515 #[derive(Clone, Debug)]
1533 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1534
1535 impl DeleteOperation {
1536 pub(crate) fn new(
1537 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1538 ) -> Self {
1539 Self(RequestBuilder::new(stub))
1540 }
1541
1542 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1544 mut self,
1545 v: V,
1546 ) -> Self {
1547 self.0.request = v.into();
1548 self
1549 }
1550
1551 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1553 self.0.options = v.into();
1554 self
1555 }
1556
1557 pub async fn send(self) -> Result<()> {
1559 (*self.0.stub)
1560 .delete_operation(self.0.request, self.0.options)
1561 .await
1562 .map(gax::response::Response::into_body)
1563 }
1564
1565 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1567 self.0.request.name = v.into();
1568 self
1569 }
1570 }
1571
1572 #[doc(hidden)]
1573 impl gax::options::internal::RequestBuilder for DeleteOperation {
1574 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1575 &mut self.0.options
1576 }
1577 }
1578
1579 #[derive(Clone, Debug)]
1597 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1598
1599 impl CancelOperation {
1600 pub(crate) fn new(
1601 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmEnrollmentService>,
1602 ) -> Self {
1603 Self(RequestBuilder::new(stub))
1604 }
1605
1606 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1608 mut self,
1609 v: V,
1610 ) -> Self {
1611 self.0.request = v.into();
1612 self
1613 }
1614
1615 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1617 self.0.options = v.into();
1618 self
1619 }
1620
1621 pub async fn send(self) -> Result<()> {
1623 (*self.0.stub)
1624 .cancel_operation(self.0.request, self.0.options)
1625 .await
1626 .map(gax::response::Response::into_body)
1627 }
1628
1629 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1631 self.0.request.name = v.into();
1632 self
1633 }
1634 }
1635
1636 #[doc(hidden)]
1637 impl gax::options::internal::RequestBuilder for CancelOperation {
1638 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1639 &mut self.0.options
1640 }
1641 }
1642}
1643
1644pub mod config {
1645 use crate::Result;
1646
1647 pub type ClientBuilder =
1661 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1662
1663 pub(crate) mod client {
1664 use super::super::super::client::Config;
1665 pub struct Factory;
1666 impl gax::client_builder::internal::ClientFactory for Factory {
1667 type Client = Config;
1668 type Credentials = gaxi::options::Credentials;
1669 async fn build(
1670 self,
1671 config: gaxi::options::ClientConfig,
1672 ) -> gax::client_builder::Result<Self::Client> {
1673 Self::Client::new(config).await
1674 }
1675 }
1676 }
1677
1678 #[derive(Clone, Debug)]
1680 pub(crate) struct RequestBuilder<R: std::default::Default> {
1681 stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>,
1682 request: R,
1683 options: gax::options::RequestOptions,
1684 }
1685
1686 impl<R> RequestBuilder<R>
1687 where
1688 R: std::default::Default,
1689 {
1690 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1691 Self {
1692 stub,
1693 request: R::default(),
1694 options: gax::options::RequestOptions::default(),
1695 }
1696 }
1697 }
1698
1699 #[derive(Clone, Debug)]
1721 pub struct ListFrameworks(RequestBuilder<crate::model::ListFrameworksRequest>);
1722
1723 impl ListFrameworks {
1724 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1725 Self(RequestBuilder::new(stub))
1726 }
1727
1728 pub fn with_request<V: Into<crate::model::ListFrameworksRequest>>(mut self, v: V) -> Self {
1730 self.0.request = v.into();
1731 self
1732 }
1733
1734 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1736 self.0.options = v.into();
1737 self
1738 }
1739
1740 pub async fn send(self) -> Result<crate::model::ListFrameworksResponse> {
1742 (*self.0.stub)
1743 .list_frameworks(self.0.request, self.0.options)
1744 .await
1745 .map(gax::response::Response::into_body)
1746 }
1747
1748 pub fn by_page(
1750 self,
1751 ) -> impl gax::paginator::Paginator<crate::model::ListFrameworksResponse, gax::error::Error>
1752 {
1753 use std::clone::Clone;
1754 let token = self.0.request.page_token.clone();
1755 let execute = move |token: String| {
1756 let mut builder = self.clone();
1757 builder.0.request = builder.0.request.set_page_token(token);
1758 builder.send()
1759 };
1760 gax::paginator::internal::new_paginator(token, execute)
1761 }
1762
1763 pub fn by_item(
1765 self,
1766 ) -> impl gax::paginator::ItemPaginator<crate::model::ListFrameworksResponse, gax::error::Error>
1767 {
1768 use gax::paginator::Paginator;
1769 self.by_page().items()
1770 }
1771
1772 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1776 self.0.request.parent = v.into();
1777 self
1778 }
1779
1780 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1782 self.0.request.page_size = v.into();
1783 self
1784 }
1785
1786 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1788 self.0.request.page_token = v.into();
1789 self
1790 }
1791 }
1792
1793 #[doc(hidden)]
1794 impl gax::options::internal::RequestBuilder for ListFrameworks {
1795 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1796 &mut self.0.options
1797 }
1798 }
1799
1800 #[derive(Clone, Debug)]
1818 pub struct GetFramework(RequestBuilder<crate::model::GetFrameworkRequest>);
1819
1820 impl GetFramework {
1821 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1822 Self(RequestBuilder::new(stub))
1823 }
1824
1825 pub fn with_request<V: Into<crate::model::GetFrameworkRequest>>(mut self, v: V) -> Self {
1827 self.0.request = v.into();
1828 self
1829 }
1830
1831 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1833 self.0.options = v.into();
1834 self
1835 }
1836
1837 pub async fn send(self) -> Result<crate::model::Framework> {
1839 (*self.0.stub)
1840 .get_framework(self.0.request, self.0.options)
1841 .await
1842 .map(gax::response::Response::into_body)
1843 }
1844
1845 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1849 self.0.request.name = v.into();
1850 self
1851 }
1852
1853 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
1855 self.0.request.major_revision_id = v.into();
1856 self
1857 }
1858 }
1859
1860 #[doc(hidden)]
1861 impl gax::options::internal::RequestBuilder for GetFramework {
1862 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1863 &mut self.0.options
1864 }
1865 }
1866
1867 #[derive(Clone, Debug)]
1885 pub struct CreateFramework(RequestBuilder<crate::model::CreateFrameworkRequest>);
1886
1887 impl CreateFramework {
1888 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1889 Self(RequestBuilder::new(stub))
1890 }
1891
1892 pub fn with_request<V: Into<crate::model::CreateFrameworkRequest>>(mut self, v: V) -> Self {
1894 self.0.request = v.into();
1895 self
1896 }
1897
1898 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1900 self.0.options = v.into();
1901 self
1902 }
1903
1904 pub async fn send(self) -> Result<crate::model::Framework> {
1906 (*self.0.stub)
1907 .create_framework(self.0.request, self.0.options)
1908 .await
1909 .map(gax::response::Response::into_body)
1910 }
1911
1912 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1916 self.0.request.parent = v.into();
1917 self
1918 }
1919
1920 pub fn set_framework_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1924 self.0.request.framework_id = v.into();
1925 self
1926 }
1927
1928 pub fn set_framework<T>(mut self, v: T) -> Self
1932 where
1933 T: std::convert::Into<crate::model::Framework>,
1934 {
1935 self.0.request.framework = std::option::Option::Some(v.into());
1936 self
1937 }
1938
1939 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
1943 where
1944 T: std::convert::Into<crate::model::Framework>,
1945 {
1946 self.0.request.framework = v.map(|x| x.into());
1947 self
1948 }
1949 }
1950
1951 #[doc(hidden)]
1952 impl gax::options::internal::RequestBuilder for CreateFramework {
1953 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1954 &mut self.0.options
1955 }
1956 }
1957
1958 #[derive(Clone, Debug)]
1976 pub struct UpdateFramework(RequestBuilder<crate::model::UpdateFrameworkRequest>);
1977
1978 impl UpdateFramework {
1979 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1980 Self(RequestBuilder::new(stub))
1981 }
1982
1983 pub fn with_request<V: Into<crate::model::UpdateFrameworkRequest>>(mut self, v: V) -> Self {
1985 self.0.request = v.into();
1986 self
1987 }
1988
1989 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1991 self.0.options = v.into();
1992 self
1993 }
1994
1995 pub async fn send(self) -> Result<crate::model::Framework> {
1997 (*self.0.stub)
1998 .update_framework(self.0.request, self.0.options)
1999 .await
2000 .map(gax::response::Response::into_body)
2001 }
2002
2003 pub fn set_update_mask<T>(mut self, v: T) -> Self
2005 where
2006 T: std::convert::Into<wkt::FieldMask>,
2007 {
2008 self.0.request.update_mask = std::option::Option::Some(v.into());
2009 self
2010 }
2011
2012 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2014 where
2015 T: std::convert::Into<wkt::FieldMask>,
2016 {
2017 self.0.request.update_mask = v.map(|x| x.into());
2018 self
2019 }
2020
2021 pub fn set_framework<T>(mut self, v: T) -> Self
2025 where
2026 T: std::convert::Into<crate::model::Framework>,
2027 {
2028 self.0.request.framework = std::option::Option::Some(v.into());
2029 self
2030 }
2031
2032 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
2036 where
2037 T: std::convert::Into<crate::model::Framework>,
2038 {
2039 self.0.request.framework = v.map(|x| x.into());
2040 self
2041 }
2042
2043 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
2045 self.0.request.major_revision_id = v.into();
2046 self
2047 }
2048 }
2049
2050 #[doc(hidden)]
2051 impl gax::options::internal::RequestBuilder for UpdateFramework {
2052 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2053 &mut self.0.options
2054 }
2055 }
2056
2057 #[derive(Clone, Debug)]
2075 pub struct DeleteFramework(RequestBuilder<crate::model::DeleteFrameworkRequest>);
2076
2077 impl DeleteFramework {
2078 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2079 Self(RequestBuilder::new(stub))
2080 }
2081
2082 pub fn with_request<V: Into<crate::model::DeleteFrameworkRequest>>(mut self, v: V) -> Self {
2084 self.0.request = v.into();
2085 self
2086 }
2087
2088 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2090 self.0.options = v.into();
2091 self
2092 }
2093
2094 pub async fn send(self) -> Result<()> {
2096 (*self.0.stub)
2097 .delete_framework(self.0.request, self.0.options)
2098 .await
2099 .map(gax::response::Response::into_body)
2100 }
2101
2102 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2106 self.0.request.name = v.into();
2107 self
2108 }
2109 }
2110
2111 #[doc(hidden)]
2112 impl gax::options::internal::RequestBuilder for DeleteFramework {
2113 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2114 &mut self.0.options
2115 }
2116 }
2117
2118 #[derive(Clone, Debug)]
2140 pub struct ListCloudControls(RequestBuilder<crate::model::ListCloudControlsRequest>);
2141
2142 impl ListCloudControls {
2143 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2144 Self(RequestBuilder::new(stub))
2145 }
2146
2147 pub fn with_request<V: Into<crate::model::ListCloudControlsRequest>>(
2149 mut self,
2150 v: V,
2151 ) -> Self {
2152 self.0.request = v.into();
2153 self
2154 }
2155
2156 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2158 self.0.options = v.into();
2159 self
2160 }
2161
2162 pub async fn send(self) -> Result<crate::model::ListCloudControlsResponse> {
2164 (*self.0.stub)
2165 .list_cloud_controls(self.0.request, self.0.options)
2166 .await
2167 .map(gax::response::Response::into_body)
2168 }
2169
2170 pub fn by_page(
2172 self,
2173 ) -> impl gax::paginator::Paginator<crate::model::ListCloudControlsResponse, gax::error::Error>
2174 {
2175 use std::clone::Clone;
2176 let token = self.0.request.page_token.clone();
2177 let execute = move |token: String| {
2178 let mut builder = self.clone();
2179 builder.0.request = builder.0.request.set_page_token(token);
2180 builder.send()
2181 };
2182 gax::paginator::internal::new_paginator(token, execute)
2183 }
2184
2185 pub fn by_item(
2187 self,
2188 ) -> impl gax::paginator::ItemPaginator<crate::model::ListCloudControlsResponse, gax::error::Error>
2189 {
2190 use gax::paginator::Paginator;
2191 self.by_page().items()
2192 }
2193
2194 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2198 self.0.request.parent = v.into();
2199 self
2200 }
2201
2202 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2204 self.0.request.page_size = v.into();
2205 self
2206 }
2207
2208 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2210 self.0.request.page_token = v.into();
2211 self
2212 }
2213 }
2214
2215 #[doc(hidden)]
2216 impl gax::options::internal::RequestBuilder for ListCloudControls {
2217 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2218 &mut self.0.options
2219 }
2220 }
2221
2222 #[derive(Clone, Debug)]
2240 pub struct GetCloudControl(RequestBuilder<crate::model::GetCloudControlRequest>);
2241
2242 impl GetCloudControl {
2243 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2244 Self(RequestBuilder::new(stub))
2245 }
2246
2247 pub fn with_request<V: Into<crate::model::GetCloudControlRequest>>(mut self, v: V) -> Self {
2249 self.0.request = v.into();
2250 self
2251 }
2252
2253 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2255 self.0.options = v.into();
2256 self
2257 }
2258
2259 pub async fn send(self) -> Result<crate::model::CloudControl> {
2261 (*self.0.stub)
2262 .get_cloud_control(self.0.request, self.0.options)
2263 .await
2264 .map(gax::response::Response::into_body)
2265 }
2266
2267 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2271 self.0.request.name = v.into();
2272 self
2273 }
2274
2275 pub fn set_major_revision_id<T: Into<i64>>(mut self, v: T) -> Self {
2277 self.0.request.major_revision_id = v.into();
2278 self
2279 }
2280 }
2281
2282 #[doc(hidden)]
2283 impl gax::options::internal::RequestBuilder for GetCloudControl {
2284 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2285 &mut self.0.options
2286 }
2287 }
2288
2289 #[derive(Clone, Debug)]
2307 pub struct CreateCloudControl(RequestBuilder<crate::model::CreateCloudControlRequest>);
2308
2309 impl CreateCloudControl {
2310 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2311 Self(RequestBuilder::new(stub))
2312 }
2313
2314 pub fn with_request<V: Into<crate::model::CreateCloudControlRequest>>(
2316 mut self,
2317 v: V,
2318 ) -> Self {
2319 self.0.request = v.into();
2320 self
2321 }
2322
2323 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2325 self.0.options = v.into();
2326 self
2327 }
2328
2329 pub async fn send(self) -> Result<crate::model::CloudControl> {
2331 (*self.0.stub)
2332 .create_cloud_control(self.0.request, self.0.options)
2333 .await
2334 .map(gax::response::Response::into_body)
2335 }
2336
2337 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2341 self.0.request.parent = v.into();
2342 self
2343 }
2344
2345 pub fn set_cloud_control_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2349 self.0.request.cloud_control_id = v.into();
2350 self
2351 }
2352
2353 pub fn set_cloud_control<T>(mut self, v: T) -> Self
2357 where
2358 T: std::convert::Into<crate::model::CloudControl>,
2359 {
2360 self.0.request.cloud_control = std::option::Option::Some(v.into());
2361 self
2362 }
2363
2364 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
2368 where
2369 T: std::convert::Into<crate::model::CloudControl>,
2370 {
2371 self.0.request.cloud_control = v.map(|x| x.into());
2372 self
2373 }
2374 }
2375
2376 #[doc(hidden)]
2377 impl gax::options::internal::RequestBuilder for CreateCloudControl {
2378 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2379 &mut self.0.options
2380 }
2381 }
2382
2383 #[derive(Clone, Debug)]
2401 pub struct UpdateCloudControl(RequestBuilder<crate::model::UpdateCloudControlRequest>);
2402
2403 impl UpdateCloudControl {
2404 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2405 Self(RequestBuilder::new(stub))
2406 }
2407
2408 pub fn with_request<V: Into<crate::model::UpdateCloudControlRequest>>(
2410 mut self,
2411 v: V,
2412 ) -> Self {
2413 self.0.request = v.into();
2414 self
2415 }
2416
2417 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2419 self.0.options = v.into();
2420 self
2421 }
2422
2423 pub async fn send(self) -> Result<crate::model::CloudControl> {
2425 (*self.0.stub)
2426 .update_cloud_control(self.0.request, self.0.options)
2427 .await
2428 .map(gax::response::Response::into_body)
2429 }
2430
2431 pub fn set_update_mask<T>(mut self, v: T) -> Self
2433 where
2434 T: std::convert::Into<wkt::FieldMask>,
2435 {
2436 self.0.request.update_mask = std::option::Option::Some(v.into());
2437 self
2438 }
2439
2440 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2442 where
2443 T: std::convert::Into<wkt::FieldMask>,
2444 {
2445 self.0.request.update_mask = v.map(|x| x.into());
2446 self
2447 }
2448
2449 pub fn set_cloud_control<T>(mut self, v: T) -> Self
2453 where
2454 T: std::convert::Into<crate::model::CloudControl>,
2455 {
2456 self.0.request.cloud_control = std::option::Option::Some(v.into());
2457 self
2458 }
2459
2460 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
2464 where
2465 T: std::convert::Into<crate::model::CloudControl>,
2466 {
2467 self.0.request.cloud_control = v.map(|x| x.into());
2468 self
2469 }
2470 }
2471
2472 #[doc(hidden)]
2473 impl gax::options::internal::RequestBuilder for UpdateCloudControl {
2474 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2475 &mut self.0.options
2476 }
2477 }
2478
2479 #[derive(Clone, Debug)]
2497 pub struct DeleteCloudControl(RequestBuilder<crate::model::DeleteCloudControlRequest>);
2498
2499 impl DeleteCloudControl {
2500 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2501 Self(RequestBuilder::new(stub))
2502 }
2503
2504 pub fn with_request<V: Into<crate::model::DeleteCloudControlRequest>>(
2506 mut self,
2507 v: V,
2508 ) -> Self {
2509 self.0.request = v.into();
2510 self
2511 }
2512
2513 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2515 self.0.options = v.into();
2516 self
2517 }
2518
2519 pub async fn send(self) -> Result<()> {
2521 (*self.0.stub)
2522 .delete_cloud_control(self.0.request, self.0.options)
2523 .await
2524 .map(gax::response::Response::into_body)
2525 }
2526
2527 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2531 self.0.request.name = v.into();
2532 self
2533 }
2534 }
2535
2536 #[doc(hidden)]
2537 impl gax::options::internal::RequestBuilder for DeleteCloudControl {
2538 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2539 &mut self.0.options
2540 }
2541 }
2542
2543 #[derive(Clone, Debug)]
2565 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2566
2567 impl ListLocations {
2568 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2569 Self(RequestBuilder::new(stub))
2570 }
2571
2572 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2574 mut self,
2575 v: V,
2576 ) -> Self {
2577 self.0.request = v.into();
2578 self
2579 }
2580
2581 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2583 self.0.options = v.into();
2584 self
2585 }
2586
2587 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2589 (*self.0.stub)
2590 .list_locations(self.0.request, self.0.options)
2591 .await
2592 .map(gax::response::Response::into_body)
2593 }
2594
2595 pub fn by_page(
2597 self,
2598 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2599 {
2600 use std::clone::Clone;
2601 let token = self.0.request.page_token.clone();
2602 let execute = move |token: String| {
2603 let mut builder = self.clone();
2604 builder.0.request = builder.0.request.set_page_token(token);
2605 builder.send()
2606 };
2607 gax::paginator::internal::new_paginator(token, execute)
2608 }
2609
2610 pub fn by_item(
2612 self,
2613 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2614 {
2615 use gax::paginator::Paginator;
2616 self.by_page().items()
2617 }
2618
2619 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2621 self.0.request.name = v.into();
2622 self
2623 }
2624
2625 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2627 self.0.request.filter = v.into();
2628 self
2629 }
2630
2631 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2633 self.0.request.page_size = v.into();
2634 self
2635 }
2636
2637 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2639 self.0.request.page_token = v.into();
2640 self
2641 }
2642 }
2643
2644 #[doc(hidden)]
2645 impl gax::options::internal::RequestBuilder for ListLocations {
2646 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2647 &mut self.0.options
2648 }
2649 }
2650
2651 #[derive(Clone, Debug)]
2669 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2670
2671 impl GetLocation {
2672 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2673 Self(RequestBuilder::new(stub))
2674 }
2675
2676 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2678 self.0.request = v.into();
2679 self
2680 }
2681
2682 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2684 self.0.options = v.into();
2685 self
2686 }
2687
2688 pub async fn send(self) -> Result<location::model::Location> {
2690 (*self.0.stub)
2691 .get_location(self.0.request, self.0.options)
2692 .await
2693 .map(gax::response::Response::into_body)
2694 }
2695
2696 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2698 self.0.request.name = v.into();
2699 self
2700 }
2701 }
2702
2703 #[doc(hidden)]
2704 impl gax::options::internal::RequestBuilder for GetLocation {
2705 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2706 &mut self.0.options
2707 }
2708 }
2709
2710 #[derive(Clone, Debug)]
2732 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2733
2734 impl ListOperations {
2735 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2736 Self(RequestBuilder::new(stub))
2737 }
2738
2739 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2741 mut self,
2742 v: V,
2743 ) -> Self {
2744 self.0.request = v.into();
2745 self
2746 }
2747
2748 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2750 self.0.options = v.into();
2751 self
2752 }
2753
2754 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2756 (*self.0.stub)
2757 .list_operations(self.0.request, self.0.options)
2758 .await
2759 .map(gax::response::Response::into_body)
2760 }
2761
2762 pub fn by_page(
2764 self,
2765 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2766 {
2767 use std::clone::Clone;
2768 let token = self.0.request.page_token.clone();
2769 let execute = move |token: String| {
2770 let mut builder = self.clone();
2771 builder.0.request = builder.0.request.set_page_token(token);
2772 builder.send()
2773 };
2774 gax::paginator::internal::new_paginator(token, execute)
2775 }
2776
2777 pub fn by_item(
2779 self,
2780 ) -> impl gax::paginator::ItemPaginator<
2781 longrunning::model::ListOperationsResponse,
2782 gax::error::Error,
2783 > {
2784 use gax::paginator::Paginator;
2785 self.by_page().items()
2786 }
2787
2788 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2790 self.0.request.name = v.into();
2791 self
2792 }
2793
2794 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2796 self.0.request.filter = v.into();
2797 self
2798 }
2799
2800 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2802 self.0.request.page_size = v.into();
2803 self
2804 }
2805
2806 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2808 self.0.request.page_token = v.into();
2809 self
2810 }
2811
2812 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2814 self.0.request.return_partial_success = v.into();
2815 self
2816 }
2817 }
2818
2819 #[doc(hidden)]
2820 impl gax::options::internal::RequestBuilder for ListOperations {
2821 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2822 &mut self.0.options
2823 }
2824 }
2825
2826 #[derive(Clone, Debug)]
2844 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2845
2846 impl GetOperation {
2847 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2848 Self(RequestBuilder::new(stub))
2849 }
2850
2851 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2853 mut self,
2854 v: V,
2855 ) -> Self {
2856 self.0.request = v.into();
2857 self
2858 }
2859
2860 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2862 self.0.options = v.into();
2863 self
2864 }
2865
2866 pub async fn send(self) -> Result<longrunning::model::Operation> {
2868 (*self.0.stub)
2869 .get_operation(self.0.request, self.0.options)
2870 .await
2871 .map(gax::response::Response::into_body)
2872 }
2873
2874 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2876 self.0.request.name = v.into();
2877 self
2878 }
2879 }
2880
2881 #[doc(hidden)]
2882 impl gax::options::internal::RequestBuilder for GetOperation {
2883 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2884 &mut self.0.options
2885 }
2886 }
2887
2888 #[derive(Clone, Debug)]
2906 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2907
2908 impl DeleteOperation {
2909 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2910 Self(RequestBuilder::new(stub))
2911 }
2912
2913 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2915 mut self,
2916 v: V,
2917 ) -> Self {
2918 self.0.request = v.into();
2919 self
2920 }
2921
2922 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2924 self.0.options = v.into();
2925 self
2926 }
2927
2928 pub async fn send(self) -> Result<()> {
2930 (*self.0.stub)
2931 .delete_operation(self.0.request, self.0.options)
2932 .await
2933 .map(gax::response::Response::into_body)
2934 }
2935
2936 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2938 self.0.request.name = v.into();
2939 self
2940 }
2941 }
2942
2943 #[doc(hidden)]
2944 impl gax::options::internal::RequestBuilder for DeleteOperation {
2945 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2946 &mut self.0.options
2947 }
2948 }
2949
2950 #[derive(Clone, Debug)]
2968 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2969
2970 impl CancelOperation {
2971 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2972 Self(RequestBuilder::new(stub))
2973 }
2974
2975 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2977 mut self,
2978 v: V,
2979 ) -> Self {
2980 self.0.request = v.into();
2981 self
2982 }
2983
2984 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2986 self.0.options = v.into();
2987 self
2988 }
2989
2990 pub async fn send(self) -> Result<()> {
2992 (*self.0.stub)
2993 .cancel_operation(self.0.request, self.0.options)
2994 .await
2995 .map(gax::response::Response::into_body)
2996 }
2997
2998 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3000 self.0.request.name = v.into();
3001 self
3002 }
3003 }
3004
3005 #[doc(hidden)]
3006 impl gax::options::internal::RequestBuilder for CancelOperation {
3007 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3008 &mut self.0.options
3009 }
3010 }
3011}
3012
3013pub mod deployment {
3014 use crate::Result;
3015
3016 pub type ClientBuilder =
3030 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3031
3032 pub(crate) mod client {
3033 use super::super::super::client::Deployment;
3034 pub struct Factory;
3035 impl gax::client_builder::internal::ClientFactory for Factory {
3036 type Client = Deployment;
3037 type Credentials = gaxi::options::Credentials;
3038 async fn build(
3039 self,
3040 config: gaxi::options::ClientConfig,
3041 ) -> gax::client_builder::Result<Self::Client> {
3042 Self::Client::new(config).await
3043 }
3044 }
3045 }
3046
3047 #[derive(Clone, Debug)]
3049 pub(crate) struct RequestBuilder<R: std::default::Default> {
3050 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3051 request: R,
3052 options: gax::options::RequestOptions,
3053 }
3054
3055 impl<R> RequestBuilder<R>
3056 where
3057 R: std::default::Default,
3058 {
3059 pub(crate) fn new(
3060 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3061 ) -> Self {
3062 Self {
3063 stub,
3064 request: R::default(),
3065 options: gax::options::RequestOptions::default(),
3066 }
3067 }
3068 }
3069
3070 #[derive(Clone, Debug)]
3089 pub struct CreateFrameworkDeployment(
3090 RequestBuilder<crate::model::CreateFrameworkDeploymentRequest>,
3091 );
3092
3093 impl CreateFrameworkDeployment {
3094 pub(crate) fn new(
3095 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3096 ) -> Self {
3097 Self(RequestBuilder::new(stub))
3098 }
3099
3100 pub fn with_request<V: Into<crate::model::CreateFrameworkDeploymentRequest>>(
3102 mut self,
3103 v: V,
3104 ) -> Self {
3105 self.0.request = v.into();
3106 self
3107 }
3108
3109 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3111 self.0.options = v.into();
3112 self
3113 }
3114
3115 pub async fn send(self) -> Result<longrunning::model::Operation> {
3122 (*self.0.stub)
3123 .create_framework_deployment(self.0.request, self.0.options)
3124 .await
3125 .map(gax::response::Response::into_body)
3126 }
3127
3128 pub fn poller(
3130 self,
3131 ) -> impl lro::Poller<crate::model::FrameworkDeployment, crate::model::OperationMetadata>
3132 {
3133 type Operation = lro::internal::Operation<
3134 crate::model::FrameworkDeployment,
3135 crate::model::OperationMetadata,
3136 >;
3137 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3138 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3139
3140 let stub = self.0.stub.clone();
3141 let mut options = self.0.options.clone();
3142 options.set_retry_policy(gax::retry_policy::NeverRetry);
3143 let query = move |name| {
3144 let stub = stub.clone();
3145 let options = options.clone();
3146 async {
3147 let op = GetOperation::new(stub)
3148 .set_name(name)
3149 .with_options(options)
3150 .send()
3151 .await?;
3152 Ok(Operation::new(op))
3153 }
3154 };
3155
3156 let start = move || async {
3157 let op = self.send().await?;
3158 Ok(Operation::new(op))
3159 };
3160
3161 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3162 }
3163
3164 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3168 self.0.request.parent = v.into();
3169 self
3170 }
3171
3172 pub fn set_framework_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3174 self.0.request.framework_deployment_id = v.into();
3175 self
3176 }
3177
3178 pub fn set_framework_deployment<T>(mut self, v: T) -> Self
3182 where
3183 T: std::convert::Into<crate::model::FrameworkDeployment>,
3184 {
3185 self.0.request.framework_deployment = std::option::Option::Some(v.into());
3186 self
3187 }
3188
3189 pub fn set_or_clear_framework_deployment<T>(mut self, v: std::option::Option<T>) -> Self
3193 where
3194 T: std::convert::Into<crate::model::FrameworkDeployment>,
3195 {
3196 self.0.request.framework_deployment = v.map(|x| x.into());
3197 self
3198 }
3199 }
3200
3201 #[doc(hidden)]
3202 impl gax::options::internal::RequestBuilder for CreateFrameworkDeployment {
3203 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3204 &mut self.0.options
3205 }
3206 }
3207
3208 #[derive(Clone, Debug)]
3227 pub struct DeleteFrameworkDeployment(
3228 RequestBuilder<crate::model::DeleteFrameworkDeploymentRequest>,
3229 );
3230
3231 impl DeleteFrameworkDeployment {
3232 pub(crate) fn new(
3233 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3234 ) -> Self {
3235 Self(RequestBuilder::new(stub))
3236 }
3237
3238 pub fn with_request<V: Into<crate::model::DeleteFrameworkDeploymentRequest>>(
3240 mut self,
3241 v: V,
3242 ) -> Self {
3243 self.0.request = v.into();
3244 self
3245 }
3246
3247 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3249 self.0.options = v.into();
3250 self
3251 }
3252
3253 pub async fn send(self) -> Result<longrunning::model::Operation> {
3260 (*self.0.stub)
3261 .delete_framework_deployment(self.0.request, self.0.options)
3262 .await
3263 .map(gax::response::Response::into_body)
3264 }
3265
3266 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3268 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3269 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3270 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3271
3272 let stub = self.0.stub.clone();
3273 let mut options = self.0.options.clone();
3274 options.set_retry_policy(gax::retry_policy::NeverRetry);
3275 let query = move |name| {
3276 let stub = stub.clone();
3277 let options = options.clone();
3278 async {
3279 let op = GetOperation::new(stub)
3280 .set_name(name)
3281 .with_options(options)
3282 .send()
3283 .await?;
3284 Ok(Operation::new(op))
3285 }
3286 };
3287
3288 let start = move || async {
3289 let op = self.send().await?;
3290 Ok(Operation::new(op))
3291 };
3292
3293 lro::internal::new_unit_response_poller(
3294 polling_error_policy,
3295 polling_backoff_policy,
3296 start,
3297 query,
3298 )
3299 }
3300
3301 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3305 self.0.request.name = v.into();
3306 self
3307 }
3308
3309 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3311 self.0.request.etag = v.into();
3312 self
3313 }
3314 }
3315
3316 #[doc(hidden)]
3317 impl gax::options::internal::RequestBuilder for DeleteFrameworkDeployment {
3318 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3319 &mut self.0.options
3320 }
3321 }
3322
3323 #[derive(Clone, Debug)]
3341 pub struct GetFrameworkDeployment(RequestBuilder<crate::model::GetFrameworkDeploymentRequest>);
3342
3343 impl GetFrameworkDeployment {
3344 pub(crate) fn new(
3345 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3346 ) -> Self {
3347 Self(RequestBuilder::new(stub))
3348 }
3349
3350 pub fn with_request<V: Into<crate::model::GetFrameworkDeploymentRequest>>(
3352 mut self,
3353 v: V,
3354 ) -> Self {
3355 self.0.request = v.into();
3356 self
3357 }
3358
3359 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3361 self.0.options = v.into();
3362 self
3363 }
3364
3365 pub async fn send(self) -> Result<crate::model::FrameworkDeployment> {
3367 (*self.0.stub)
3368 .get_framework_deployment(self.0.request, self.0.options)
3369 .await
3370 .map(gax::response::Response::into_body)
3371 }
3372
3373 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3377 self.0.request.name = v.into();
3378 self
3379 }
3380 }
3381
3382 #[doc(hidden)]
3383 impl gax::options::internal::RequestBuilder for GetFrameworkDeployment {
3384 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3385 &mut self.0.options
3386 }
3387 }
3388
3389 #[derive(Clone, Debug)]
3411 pub struct ListFrameworkDeployments(
3412 RequestBuilder<crate::model::ListFrameworkDeploymentsRequest>,
3413 );
3414
3415 impl ListFrameworkDeployments {
3416 pub(crate) fn new(
3417 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3418 ) -> Self {
3419 Self(RequestBuilder::new(stub))
3420 }
3421
3422 pub fn with_request<V: Into<crate::model::ListFrameworkDeploymentsRequest>>(
3424 mut self,
3425 v: V,
3426 ) -> Self {
3427 self.0.request = v.into();
3428 self
3429 }
3430
3431 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3433 self.0.options = v.into();
3434 self
3435 }
3436
3437 pub async fn send(self) -> Result<crate::model::ListFrameworkDeploymentsResponse> {
3439 (*self.0.stub)
3440 .list_framework_deployments(self.0.request, self.0.options)
3441 .await
3442 .map(gax::response::Response::into_body)
3443 }
3444
3445 pub fn by_page(
3447 self,
3448 ) -> impl gax::paginator::Paginator<
3449 crate::model::ListFrameworkDeploymentsResponse,
3450 gax::error::Error,
3451 > {
3452 use std::clone::Clone;
3453 let token = self.0.request.page_token.clone();
3454 let execute = move |token: String| {
3455 let mut builder = self.clone();
3456 builder.0.request = builder.0.request.set_page_token(token);
3457 builder.send()
3458 };
3459 gax::paginator::internal::new_paginator(token, execute)
3460 }
3461
3462 pub fn by_item(
3464 self,
3465 ) -> impl gax::paginator::ItemPaginator<
3466 crate::model::ListFrameworkDeploymentsResponse,
3467 gax::error::Error,
3468 > {
3469 use gax::paginator::Paginator;
3470 self.by_page().items()
3471 }
3472
3473 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3477 self.0.request.parent = v.into();
3478 self
3479 }
3480
3481 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3483 self.0.request.page_size = v.into();
3484 self
3485 }
3486
3487 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3489 self.0.request.page_token = v.into();
3490 self
3491 }
3492
3493 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3495 self.0.request.filter = v.into();
3496 self
3497 }
3498
3499 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3501 self.0.request.order_by = v.into();
3502 self
3503 }
3504 }
3505
3506 #[doc(hidden)]
3507 impl gax::options::internal::RequestBuilder for ListFrameworkDeployments {
3508 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3509 &mut self.0.options
3510 }
3511 }
3512
3513 #[derive(Clone, Debug)]
3531 pub struct GetCloudControlDeployment(
3532 RequestBuilder<crate::model::GetCloudControlDeploymentRequest>,
3533 );
3534
3535 impl GetCloudControlDeployment {
3536 pub(crate) fn new(
3537 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3538 ) -> Self {
3539 Self(RequestBuilder::new(stub))
3540 }
3541
3542 pub fn with_request<V: Into<crate::model::GetCloudControlDeploymentRequest>>(
3544 mut self,
3545 v: V,
3546 ) -> Self {
3547 self.0.request = v.into();
3548 self
3549 }
3550
3551 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3553 self.0.options = v.into();
3554 self
3555 }
3556
3557 pub async fn send(self) -> Result<crate::model::CloudControlDeployment> {
3559 (*self.0.stub)
3560 .get_cloud_control_deployment(self.0.request, self.0.options)
3561 .await
3562 .map(gax::response::Response::into_body)
3563 }
3564
3565 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3569 self.0.request.name = v.into();
3570 self
3571 }
3572 }
3573
3574 #[doc(hidden)]
3575 impl gax::options::internal::RequestBuilder for GetCloudControlDeployment {
3576 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3577 &mut self.0.options
3578 }
3579 }
3580
3581 #[derive(Clone, Debug)]
3603 pub struct ListCloudControlDeployments(
3604 RequestBuilder<crate::model::ListCloudControlDeploymentsRequest>,
3605 );
3606
3607 impl ListCloudControlDeployments {
3608 pub(crate) fn new(
3609 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3610 ) -> Self {
3611 Self(RequestBuilder::new(stub))
3612 }
3613
3614 pub fn with_request<V: Into<crate::model::ListCloudControlDeploymentsRequest>>(
3616 mut self,
3617 v: V,
3618 ) -> Self {
3619 self.0.request = v.into();
3620 self
3621 }
3622
3623 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3625 self.0.options = v.into();
3626 self
3627 }
3628
3629 pub async fn send(self) -> Result<crate::model::ListCloudControlDeploymentsResponse> {
3631 (*self.0.stub)
3632 .list_cloud_control_deployments(self.0.request, self.0.options)
3633 .await
3634 .map(gax::response::Response::into_body)
3635 }
3636
3637 pub fn by_page(
3639 self,
3640 ) -> impl gax::paginator::Paginator<
3641 crate::model::ListCloudControlDeploymentsResponse,
3642 gax::error::Error,
3643 > {
3644 use std::clone::Clone;
3645 let token = self.0.request.page_token.clone();
3646 let execute = move |token: String| {
3647 let mut builder = self.clone();
3648 builder.0.request = builder.0.request.set_page_token(token);
3649 builder.send()
3650 };
3651 gax::paginator::internal::new_paginator(token, execute)
3652 }
3653
3654 pub fn by_item(
3656 self,
3657 ) -> impl gax::paginator::ItemPaginator<
3658 crate::model::ListCloudControlDeploymentsResponse,
3659 gax::error::Error,
3660 > {
3661 use gax::paginator::Paginator;
3662 self.by_page().items()
3663 }
3664
3665 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3669 self.0.request.parent = v.into();
3670 self
3671 }
3672
3673 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3675 self.0.request.page_size = v.into();
3676 self
3677 }
3678
3679 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3681 self.0.request.page_token = v.into();
3682 self
3683 }
3684
3685 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3687 self.0.request.filter = v.into();
3688 self
3689 }
3690
3691 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3693 self.0.request.order_by = v.into();
3694 self
3695 }
3696 }
3697
3698 #[doc(hidden)]
3699 impl gax::options::internal::RequestBuilder for ListCloudControlDeployments {
3700 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3701 &mut self.0.options
3702 }
3703 }
3704
3705 #[derive(Clone, Debug)]
3727 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
3728
3729 impl ListLocations {
3730 pub(crate) fn new(
3731 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3732 ) -> Self {
3733 Self(RequestBuilder::new(stub))
3734 }
3735
3736 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3738 mut self,
3739 v: V,
3740 ) -> Self {
3741 self.0.request = v.into();
3742 self
3743 }
3744
3745 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3747 self.0.options = v.into();
3748 self
3749 }
3750
3751 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3753 (*self.0.stub)
3754 .list_locations(self.0.request, self.0.options)
3755 .await
3756 .map(gax::response::Response::into_body)
3757 }
3758
3759 pub fn by_page(
3761 self,
3762 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3763 {
3764 use std::clone::Clone;
3765 let token = self.0.request.page_token.clone();
3766 let execute = move |token: String| {
3767 let mut builder = self.clone();
3768 builder.0.request = builder.0.request.set_page_token(token);
3769 builder.send()
3770 };
3771 gax::paginator::internal::new_paginator(token, execute)
3772 }
3773
3774 pub fn by_item(
3776 self,
3777 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3778 {
3779 use gax::paginator::Paginator;
3780 self.by_page().items()
3781 }
3782
3783 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3785 self.0.request.name = v.into();
3786 self
3787 }
3788
3789 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3791 self.0.request.filter = v.into();
3792 self
3793 }
3794
3795 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3797 self.0.request.page_size = v.into();
3798 self
3799 }
3800
3801 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3803 self.0.request.page_token = v.into();
3804 self
3805 }
3806 }
3807
3808 #[doc(hidden)]
3809 impl gax::options::internal::RequestBuilder for ListLocations {
3810 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3811 &mut self.0.options
3812 }
3813 }
3814
3815 #[derive(Clone, Debug)]
3833 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3834
3835 impl GetLocation {
3836 pub(crate) fn new(
3837 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3838 ) -> Self {
3839 Self(RequestBuilder::new(stub))
3840 }
3841
3842 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3844 self.0.request = v.into();
3845 self
3846 }
3847
3848 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3850 self.0.options = v.into();
3851 self
3852 }
3853
3854 pub async fn send(self) -> Result<location::model::Location> {
3856 (*self.0.stub)
3857 .get_location(self.0.request, self.0.options)
3858 .await
3859 .map(gax::response::Response::into_body)
3860 }
3861
3862 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3864 self.0.request.name = v.into();
3865 self
3866 }
3867 }
3868
3869 #[doc(hidden)]
3870 impl gax::options::internal::RequestBuilder for GetLocation {
3871 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3872 &mut self.0.options
3873 }
3874 }
3875
3876 #[derive(Clone, Debug)]
3898 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3899
3900 impl ListOperations {
3901 pub(crate) fn new(
3902 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
3903 ) -> Self {
3904 Self(RequestBuilder::new(stub))
3905 }
3906
3907 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3909 mut self,
3910 v: V,
3911 ) -> Self {
3912 self.0.request = v.into();
3913 self
3914 }
3915
3916 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3918 self.0.options = v.into();
3919 self
3920 }
3921
3922 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3924 (*self.0.stub)
3925 .list_operations(self.0.request, self.0.options)
3926 .await
3927 .map(gax::response::Response::into_body)
3928 }
3929
3930 pub fn by_page(
3932 self,
3933 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3934 {
3935 use std::clone::Clone;
3936 let token = self.0.request.page_token.clone();
3937 let execute = move |token: String| {
3938 let mut builder = self.clone();
3939 builder.0.request = builder.0.request.set_page_token(token);
3940 builder.send()
3941 };
3942 gax::paginator::internal::new_paginator(token, execute)
3943 }
3944
3945 pub fn by_item(
3947 self,
3948 ) -> impl gax::paginator::ItemPaginator<
3949 longrunning::model::ListOperationsResponse,
3950 gax::error::Error,
3951 > {
3952 use gax::paginator::Paginator;
3953 self.by_page().items()
3954 }
3955
3956 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3958 self.0.request.name = v.into();
3959 self
3960 }
3961
3962 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3964 self.0.request.filter = v.into();
3965 self
3966 }
3967
3968 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3970 self.0.request.page_size = v.into();
3971 self
3972 }
3973
3974 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3976 self.0.request.page_token = v.into();
3977 self
3978 }
3979
3980 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3982 self.0.request.return_partial_success = v.into();
3983 self
3984 }
3985 }
3986
3987 #[doc(hidden)]
3988 impl gax::options::internal::RequestBuilder for ListOperations {
3989 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3990 &mut self.0.options
3991 }
3992 }
3993
3994 #[derive(Clone, Debug)]
4012 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4013
4014 impl GetOperation {
4015 pub(crate) fn new(
4016 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
4017 ) -> Self {
4018 Self(RequestBuilder::new(stub))
4019 }
4020
4021 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4023 mut self,
4024 v: V,
4025 ) -> Self {
4026 self.0.request = v.into();
4027 self
4028 }
4029
4030 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4032 self.0.options = v.into();
4033 self
4034 }
4035
4036 pub async fn send(self) -> Result<longrunning::model::Operation> {
4038 (*self.0.stub)
4039 .get_operation(self.0.request, self.0.options)
4040 .await
4041 .map(gax::response::Response::into_body)
4042 }
4043
4044 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4046 self.0.request.name = v.into();
4047 self
4048 }
4049 }
4050
4051 #[doc(hidden)]
4052 impl gax::options::internal::RequestBuilder for GetOperation {
4053 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4054 &mut self.0.options
4055 }
4056 }
4057
4058 #[derive(Clone, Debug)]
4076 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4077
4078 impl DeleteOperation {
4079 pub(crate) fn new(
4080 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
4081 ) -> Self {
4082 Self(RequestBuilder::new(stub))
4083 }
4084
4085 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4087 mut self,
4088 v: V,
4089 ) -> Self {
4090 self.0.request = v.into();
4091 self
4092 }
4093
4094 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4096 self.0.options = v.into();
4097 self
4098 }
4099
4100 pub async fn send(self) -> Result<()> {
4102 (*self.0.stub)
4103 .delete_operation(self.0.request, self.0.options)
4104 .await
4105 .map(gax::response::Response::into_body)
4106 }
4107
4108 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4110 self.0.request.name = v.into();
4111 self
4112 }
4113 }
4114
4115 #[doc(hidden)]
4116 impl gax::options::internal::RequestBuilder for DeleteOperation {
4117 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4118 &mut self.0.options
4119 }
4120 }
4121
4122 #[derive(Clone, Debug)]
4140 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4141
4142 impl CancelOperation {
4143 pub(crate) fn new(
4144 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployment>,
4145 ) -> Self {
4146 Self(RequestBuilder::new(stub))
4147 }
4148
4149 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4151 mut self,
4152 v: V,
4153 ) -> Self {
4154 self.0.request = v.into();
4155 self
4156 }
4157
4158 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4160 self.0.options = v.into();
4161 self
4162 }
4163
4164 pub async fn send(self) -> Result<()> {
4166 (*self.0.stub)
4167 .cancel_operation(self.0.request, self.0.options)
4168 .await
4169 .map(gax::response::Response::into_body)
4170 }
4171
4172 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4174 self.0.request.name = v.into();
4175 self
4176 }
4177 }
4178
4179 #[doc(hidden)]
4180 impl gax::options::internal::RequestBuilder for CancelOperation {
4181 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4182 &mut self.0.options
4183 }
4184 }
4185}
4186
4187pub mod monitoring {
4188 use crate::Result;
4189
4190 pub type ClientBuilder =
4204 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4205
4206 pub(crate) mod client {
4207 use super::super::super::client::Monitoring;
4208 pub struct Factory;
4209 impl gax::client_builder::internal::ClientFactory for Factory {
4210 type Client = Monitoring;
4211 type Credentials = gaxi::options::Credentials;
4212 async fn build(
4213 self,
4214 config: gaxi::options::ClientConfig,
4215 ) -> gax::client_builder::Result<Self::Client> {
4216 Self::Client::new(config).await
4217 }
4218 }
4219 }
4220
4221 #[derive(Clone, Debug)]
4223 pub(crate) struct RequestBuilder<R: std::default::Default> {
4224 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4225 request: R,
4226 options: gax::options::RequestOptions,
4227 }
4228
4229 impl<R> RequestBuilder<R>
4230 where
4231 R: std::default::Default,
4232 {
4233 pub(crate) fn new(
4234 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4235 ) -> Self {
4236 Self {
4237 stub,
4238 request: R::default(),
4239 options: gax::options::RequestOptions::default(),
4240 }
4241 }
4242 }
4243
4244 #[derive(Clone, Debug)]
4266 pub struct ListFrameworkComplianceSummaries(
4267 RequestBuilder<crate::model::ListFrameworkComplianceSummariesRequest>,
4268 );
4269
4270 impl ListFrameworkComplianceSummaries {
4271 pub(crate) fn new(
4272 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4273 ) -> Self {
4274 Self(RequestBuilder::new(stub))
4275 }
4276
4277 pub fn with_request<V: Into<crate::model::ListFrameworkComplianceSummariesRequest>>(
4279 mut self,
4280 v: V,
4281 ) -> Self {
4282 self.0.request = v.into();
4283 self
4284 }
4285
4286 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4288 self.0.options = v.into();
4289 self
4290 }
4291
4292 pub async fn send(self) -> Result<crate::model::ListFrameworkComplianceSummariesResponse> {
4294 (*self.0.stub)
4295 .list_framework_compliance_summaries(self.0.request, self.0.options)
4296 .await
4297 .map(gax::response::Response::into_body)
4298 }
4299
4300 pub fn by_page(
4302 self,
4303 ) -> impl gax::paginator::Paginator<
4304 crate::model::ListFrameworkComplianceSummariesResponse,
4305 gax::error::Error,
4306 > {
4307 use std::clone::Clone;
4308 let token = self.0.request.page_token.clone();
4309 let execute = move |token: String| {
4310 let mut builder = self.clone();
4311 builder.0.request = builder.0.request.set_page_token(token);
4312 builder.send()
4313 };
4314 gax::paginator::internal::new_paginator(token, execute)
4315 }
4316
4317 pub fn by_item(
4319 self,
4320 ) -> impl gax::paginator::ItemPaginator<
4321 crate::model::ListFrameworkComplianceSummariesResponse,
4322 gax::error::Error,
4323 > {
4324 use gax::paginator::Paginator;
4325 self.by_page().items()
4326 }
4327
4328 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4332 self.0.request.parent = v.into();
4333 self
4334 }
4335
4336 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4338 self.0.request.page_size = v.into();
4339 self
4340 }
4341
4342 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4344 self.0.request.page_token = v.into();
4345 self
4346 }
4347
4348 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4350 self.0.request.filter = v.into();
4351 self
4352 }
4353 }
4354
4355 #[doc(hidden)]
4356 impl gax::options::internal::RequestBuilder for ListFrameworkComplianceSummaries {
4357 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4358 &mut self.0.options
4359 }
4360 }
4361
4362 #[derive(Clone, Debug)]
4384 pub struct ListFindingSummaries(RequestBuilder<crate::model::ListFindingSummariesRequest>);
4385
4386 impl ListFindingSummaries {
4387 pub(crate) fn new(
4388 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4389 ) -> Self {
4390 Self(RequestBuilder::new(stub))
4391 }
4392
4393 pub fn with_request<V: Into<crate::model::ListFindingSummariesRequest>>(
4395 mut self,
4396 v: V,
4397 ) -> Self {
4398 self.0.request = v.into();
4399 self
4400 }
4401
4402 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4404 self.0.options = v.into();
4405 self
4406 }
4407
4408 pub async fn send(self) -> Result<crate::model::ListFindingSummariesResponse> {
4410 (*self.0.stub)
4411 .list_finding_summaries(self.0.request, self.0.options)
4412 .await
4413 .map(gax::response::Response::into_body)
4414 }
4415
4416 pub fn by_page(
4418 self,
4419 ) -> impl gax::paginator::Paginator<crate::model::ListFindingSummariesResponse, gax::error::Error>
4420 {
4421 use std::clone::Clone;
4422 let token = self.0.request.page_token.clone();
4423 let execute = move |token: String| {
4424 let mut builder = self.clone();
4425 builder.0.request = builder.0.request.set_page_token(token);
4426 builder.send()
4427 };
4428 gax::paginator::internal::new_paginator(token, execute)
4429 }
4430
4431 pub fn by_item(
4433 self,
4434 ) -> impl gax::paginator::ItemPaginator<
4435 crate::model::ListFindingSummariesResponse,
4436 gax::error::Error,
4437 > {
4438 use gax::paginator::Paginator;
4439 self.by_page().items()
4440 }
4441
4442 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4446 self.0.request.parent = v.into();
4447 self
4448 }
4449
4450 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4452 self.0.request.page_size = v.into();
4453 self
4454 }
4455
4456 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4458 self.0.request.page_token = v.into();
4459 self
4460 }
4461
4462 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4464 self.0.request.filter = v.into();
4465 self
4466 }
4467
4468 #[deprecated]
4470 pub fn set_end_time<T>(mut self, v: T) -> Self
4471 where
4472 T: std::convert::Into<wkt::Timestamp>,
4473 {
4474 self.0.request.end_time = std::option::Option::Some(v.into());
4475 self
4476 }
4477
4478 #[deprecated]
4480 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4481 where
4482 T: std::convert::Into<wkt::Timestamp>,
4483 {
4484 self.0.request.end_time = v.map(|x| x.into());
4485 self
4486 }
4487 }
4488
4489 #[doc(hidden)]
4490 impl gax::options::internal::RequestBuilder for ListFindingSummaries {
4491 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4492 &mut self.0.options
4493 }
4494 }
4495
4496 #[derive(Clone, Debug)]
4514 pub struct FetchFrameworkComplianceReport(
4515 RequestBuilder<crate::model::FetchFrameworkComplianceReportRequest>,
4516 );
4517
4518 impl FetchFrameworkComplianceReport {
4519 pub(crate) fn new(
4520 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4521 ) -> Self {
4522 Self(RequestBuilder::new(stub))
4523 }
4524
4525 pub fn with_request<V: Into<crate::model::FetchFrameworkComplianceReportRequest>>(
4527 mut self,
4528 v: V,
4529 ) -> Self {
4530 self.0.request = v.into();
4531 self
4532 }
4533
4534 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4536 self.0.options = v.into();
4537 self
4538 }
4539
4540 pub async fn send(self) -> Result<crate::model::FrameworkComplianceReport> {
4542 (*self.0.stub)
4543 .fetch_framework_compliance_report(self.0.request, self.0.options)
4544 .await
4545 .map(gax::response::Response::into_body)
4546 }
4547
4548 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4552 self.0.request.name = v.into();
4553 self
4554 }
4555
4556 pub fn set_end_time<T>(mut self, v: T) -> Self
4558 where
4559 T: std::convert::Into<wkt::Timestamp>,
4560 {
4561 self.0.request.end_time = std::option::Option::Some(v.into());
4562 self
4563 }
4564
4565 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4567 where
4568 T: std::convert::Into<wkt::Timestamp>,
4569 {
4570 self.0.request.end_time = v.map(|x| x.into());
4571 self
4572 }
4573 }
4574
4575 #[doc(hidden)]
4576 impl gax::options::internal::RequestBuilder for FetchFrameworkComplianceReport {
4577 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4578 &mut self.0.options
4579 }
4580 }
4581
4582 #[derive(Clone, Debug)]
4604 pub struct ListControlComplianceSummaries(
4605 RequestBuilder<crate::model::ListControlComplianceSummariesRequest>,
4606 );
4607
4608 impl ListControlComplianceSummaries {
4609 pub(crate) fn new(
4610 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4611 ) -> Self {
4612 Self(RequestBuilder::new(stub))
4613 }
4614
4615 pub fn with_request<V: Into<crate::model::ListControlComplianceSummariesRequest>>(
4617 mut self,
4618 v: V,
4619 ) -> Self {
4620 self.0.request = v.into();
4621 self
4622 }
4623
4624 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4626 self.0.options = v.into();
4627 self
4628 }
4629
4630 pub async fn send(self) -> Result<crate::model::ListControlComplianceSummariesResponse> {
4632 (*self.0.stub)
4633 .list_control_compliance_summaries(self.0.request, self.0.options)
4634 .await
4635 .map(gax::response::Response::into_body)
4636 }
4637
4638 pub fn by_page(
4640 self,
4641 ) -> impl gax::paginator::Paginator<
4642 crate::model::ListControlComplianceSummariesResponse,
4643 gax::error::Error,
4644 > {
4645 use std::clone::Clone;
4646 let token = self.0.request.page_token.clone();
4647 let execute = move |token: String| {
4648 let mut builder = self.clone();
4649 builder.0.request = builder.0.request.set_page_token(token);
4650 builder.send()
4651 };
4652 gax::paginator::internal::new_paginator(token, execute)
4653 }
4654
4655 pub fn by_item(
4657 self,
4658 ) -> impl gax::paginator::ItemPaginator<
4659 crate::model::ListControlComplianceSummariesResponse,
4660 gax::error::Error,
4661 > {
4662 use gax::paginator::Paginator;
4663 self.by_page().items()
4664 }
4665
4666 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4670 self.0.request.parent = v.into();
4671 self
4672 }
4673
4674 #[deprecated]
4676 pub fn set_end_time<T>(mut self, v: T) -> Self
4677 where
4678 T: std::convert::Into<wkt::Timestamp>,
4679 {
4680 self.0.request.end_time = std::option::Option::Some(v.into());
4681 self
4682 }
4683
4684 #[deprecated]
4686 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4687 where
4688 T: std::convert::Into<wkt::Timestamp>,
4689 {
4690 self.0.request.end_time = v.map(|x| x.into());
4691 self
4692 }
4693
4694 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4696 self.0.request.page_size = v.into();
4697 self
4698 }
4699
4700 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4702 self.0.request.page_token = v.into();
4703 self
4704 }
4705
4706 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4708 self.0.request.filter = v.into();
4709 self
4710 }
4711 }
4712
4713 #[doc(hidden)]
4714 impl gax::options::internal::RequestBuilder for ListControlComplianceSummaries {
4715 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4716 &mut self.0.options
4717 }
4718 }
4719
4720 #[derive(Clone, Debug)]
4738 pub struct AggregateFrameworkComplianceReport(
4739 RequestBuilder<crate::model::AggregateFrameworkComplianceReportRequest>,
4740 );
4741
4742 impl AggregateFrameworkComplianceReport {
4743 pub(crate) fn new(
4744 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4745 ) -> Self {
4746 Self(RequestBuilder::new(stub))
4747 }
4748
4749 pub fn with_request<V: Into<crate::model::AggregateFrameworkComplianceReportRequest>>(
4751 mut self,
4752 v: V,
4753 ) -> Self {
4754 self.0.request = v.into();
4755 self
4756 }
4757
4758 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4760 self.0.options = v.into();
4761 self
4762 }
4763
4764 pub async fn send(
4766 self,
4767 ) -> Result<crate::model::AggregateFrameworkComplianceReportResponse> {
4768 (*self.0.stub)
4769 .aggregate_framework_compliance_report(self.0.request, self.0.options)
4770 .await
4771 .map(gax::response::Response::into_body)
4772 }
4773
4774 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4778 self.0.request.name = v.into();
4779 self
4780 }
4781
4782 pub fn set_interval<T>(mut self, v: T) -> Self
4784 where
4785 T: std::convert::Into<gtype::model::Interval>,
4786 {
4787 self.0.request.interval = std::option::Option::Some(v.into());
4788 self
4789 }
4790
4791 pub fn set_or_clear_interval<T>(mut self, v: std::option::Option<T>) -> Self
4793 where
4794 T: std::convert::Into<gtype::model::Interval>,
4795 {
4796 self.0.request.interval = v.map(|x| x.into());
4797 self
4798 }
4799
4800 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4802 self.0.request.filter = v.into();
4803 self
4804 }
4805 }
4806
4807 #[doc(hidden)]
4808 impl gax::options::internal::RequestBuilder for AggregateFrameworkComplianceReport {
4809 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4810 &mut self.0.options
4811 }
4812 }
4813
4814 #[derive(Clone, Debug)]
4836 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4837
4838 impl ListLocations {
4839 pub(crate) fn new(
4840 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4841 ) -> Self {
4842 Self(RequestBuilder::new(stub))
4843 }
4844
4845 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4847 mut self,
4848 v: V,
4849 ) -> Self {
4850 self.0.request = v.into();
4851 self
4852 }
4853
4854 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4856 self.0.options = v.into();
4857 self
4858 }
4859
4860 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4862 (*self.0.stub)
4863 .list_locations(self.0.request, self.0.options)
4864 .await
4865 .map(gax::response::Response::into_body)
4866 }
4867
4868 pub fn by_page(
4870 self,
4871 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4872 {
4873 use std::clone::Clone;
4874 let token = self.0.request.page_token.clone();
4875 let execute = move |token: String| {
4876 let mut builder = self.clone();
4877 builder.0.request = builder.0.request.set_page_token(token);
4878 builder.send()
4879 };
4880 gax::paginator::internal::new_paginator(token, execute)
4881 }
4882
4883 pub fn by_item(
4885 self,
4886 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4887 {
4888 use gax::paginator::Paginator;
4889 self.by_page().items()
4890 }
4891
4892 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4894 self.0.request.name = v.into();
4895 self
4896 }
4897
4898 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4900 self.0.request.filter = v.into();
4901 self
4902 }
4903
4904 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4906 self.0.request.page_size = v.into();
4907 self
4908 }
4909
4910 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4912 self.0.request.page_token = v.into();
4913 self
4914 }
4915 }
4916
4917 #[doc(hidden)]
4918 impl gax::options::internal::RequestBuilder for ListLocations {
4919 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4920 &mut self.0.options
4921 }
4922 }
4923
4924 #[derive(Clone, Debug)]
4942 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4943
4944 impl GetLocation {
4945 pub(crate) fn new(
4946 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
4947 ) -> Self {
4948 Self(RequestBuilder::new(stub))
4949 }
4950
4951 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4953 self.0.request = v.into();
4954 self
4955 }
4956
4957 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4959 self.0.options = v.into();
4960 self
4961 }
4962
4963 pub async fn send(self) -> Result<location::model::Location> {
4965 (*self.0.stub)
4966 .get_location(self.0.request, self.0.options)
4967 .await
4968 .map(gax::response::Response::into_body)
4969 }
4970
4971 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4973 self.0.request.name = v.into();
4974 self
4975 }
4976 }
4977
4978 #[doc(hidden)]
4979 impl gax::options::internal::RequestBuilder for GetLocation {
4980 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4981 &mut self.0.options
4982 }
4983 }
4984
4985 #[derive(Clone, Debug)]
5007 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5008
5009 impl ListOperations {
5010 pub(crate) fn new(
5011 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5012 ) -> Self {
5013 Self(RequestBuilder::new(stub))
5014 }
5015
5016 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5018 mut self,
5019 v: V,
5020 ) -> Self {
5021 self.0.request = v.into();
5022 self
5023 }
5024
5025 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5027 self.0.options = v.into();
5028 self
5029 }
5030
5031 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5033 (*self.0.stub)
5034 .list_operations(self.0.request, self.0.options)
5035 .await
5036 .map(gax::response::Response::into_body)
5037 }
5038
5039 pub fn by_page(
5041 self,
5042 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5043 {
5044 use std::clone::Clone;
5045 let token = self.0.request.page_token.clone();
5046 let execute = move |token: String| {
5047 let mut builder = self.clone();
5048 builder.0.request = builder.0.request.set_page_token(token);
5049 builder.send()
5050 };
5051 gax::paginator::internal::new_paginator(token, execute)
5052 }
5053
5054 pub fn by_item(
5056 self,
5057 ) -> impl gax::paginator::ItemPaginator<
5058 longrunning::model::ListOperationsResponse,
5059 gax::error::Error,
5060 > {
5061 use gax::paginator::Paginator;
5062 self.by_page().items()
5063 }
5064
5065 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5067 self.0.request.name = v.into();
5068 self
5069 }
5070
5071 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5073 self.0.request.filter = v.into();
5074 self
5075 }
5076
5077 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5079 self.0.request.page_size = v.into();
5080 self
5081 }
5082
5083 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5085 self.0.request.page_token = v.into();
5086 self
5087 }
5088
5089 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5091 self.0.request.return_partial_success = v.into();
5092 self
5093 }
5094 }
5095
5096 #[doc(hidden)]
5097 impl gax::options::internal::RequestBuilder for ListOperations {
5098 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5099 &mut self.0.options
5100 }
5101 }
5102
5103 #[derive(Clone, Debug)]
5121 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5122
5123 impl GetOperation {
5124 pub(crate) fn new(
5125 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5126 ) -> Self {
5127 Self(RequestBuilder::new(stub))
5128 }
5129
5130 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5132 mut self,
5133 v: V,
5134 ) -> Self {
5135 self.0.request = v.into();
5136 self
5137 }
5138
5139 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5141 self.0.options = v.into();
5142 self
5143 }
5144
5145 pub async fn send(self) -> Result<longrunning::model::Operation> {
5147 (*self.0.stub)
5148 .get_operation(self.0.request, self.0.options)
5149 .await
5150 .map(gax::response::Response::into_body)
5151 }
5152
5153 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5155 self.0.request.name = v.into();
5156 self
5157 }
5158 }
5159
5160 #[doc(hidden)]
5161 impl gax::options::internal::RequestBuilder for GetOperation {
5162 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5163 &mut self.0.options
5164 }
5165 }
5166
5167 #[derive(Clone, Debug)]
5185 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5186
5187 impl DeleteOperation {
5188 pub(crate) fn new(
5189 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5190 ) -> Self {
5191 Self(RequestBuilder::new(stub))
5192 }
5193
5194 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5196 mut self,
5197 v: V,
5198 ) -> Self {
5199 self.0.request = v.into();
5200 self
5201 }
5202
5203 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5205 self.0.options = v.into();
5206 self
5207 }
5208
5209 pub async fn send(self) -> Result<()> {
5211 (*self.0.stub)
5212 .delete_operation(self.0.request, self.0.options)
5213 .await
5214 .map(gax::response::Response::into_body)
5215 }
5216
5217 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5219 self.0.request.name = v.into();
5220 self
5221 }
5222 }
5223
5224 #[doc(hidden)]
5225 impl gax::options::internal::RequestBuilder for DeleteOperation {
5226 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5227 &mut self.0.options
5228 }
5229 }
5230
5231 #[derive(Clone, Debug)]
5249 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5250
5251 impl CancelOperation {
5252 pub(crate) fn new(
5253 stub: std::sync::Arc<dyn super::super::stub::dynamic::Monitoring>,
5254 ) -> Self {
5255 Self(RequestBuilder::new(stub))
5256 }
5257
5258 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5260 mut self,
5261 v: V,
5262 ) -> Self {
5263 self.0.request = v.into();
5264 self
5265 }
5266
5267 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5269 self.0.options = v.into();
5270 self
5271 }
5272
5273 pub async fn send(self) -> Result<()> {
5275 (*self.0.stub)
5276 .cancel_operation(self.0.request, self.0.options)
5277 .await
5278 .map(gax::response::Response::into_body)
5279 }
5280
5281 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5283 self.0.request.name = v.into();
5284 self
5285 }
5286 }
5287
5288 #[doc(hidden)]
5289 impl gax::options::internal::RequestBuilder for CancelOperation {
5290 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5291 &mut self.0.options
5292 }
5293 }
5294}