1pub mod os_config_service {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::OsConfigService;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = OsConfigService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
91 pub struct ExecutePatchJob(RequestBuilder<crate::model::ExecutePatchJobRequest>);
92
93 impl ExecutePatchJob {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::ExecutePatchJobRequest>>(mut self, v: V) -> Self {
102 self.0.request = v.into();
103 self
104 }
105
106 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
108 self.0.options = v.into();
109 self
110 }
111
112 pub async fn send(self) -> Result<crate::model::PatchJob> {
114 (*self.0.stub)
115 .execute_patch_job(self.0.request, self.0.options)
116 .await
117 .map(crate::Response::into_body)
118 }
119
120 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
124 self.0.request.parent = v.into();
125 self
126 }
127
128 pub fn set_description<T: Into<std::string::String>>(mut self, v: T) -> Self {
130 self.0.request.description = v.into();
131 self
132 }
133
134 pub fn set_instance_filter<T>(mut self, v: T) -> Self
138 where
139 T: std::convert::Into<crate::model::PatchInstanceFilter>,
140 {
141 self.0.request.instance_filter = std::option::Option::Some(v.into());
142 self
143 }
144
145 pub fn set_or_clear_instance_filter<T>(mut self, v: std::option::Option<T>) -> Self
149 where
150 T: std::convert::Into<crate::model::PatchInstanceFilter>,
151 {
152 self.0.request.instance_filter = v.map(|x| x.into());
153 self
154 }
155
156 pub fn set_patch_config<T>(mut self, v: T) -> Self
158 where
159 T: std::convert::Into<crate::model::PatchConfig>,
160 {
161 self.0.request.patch_config = std::option::Option::Some(v.into());
162 self
163 }
164
165 pub fn set_or_clear_patch_config<T>(mut self, v: std::option::Option<T>) -> Self
167 where
168 T: std::convert::Into<crate::model::PatchConfig>,
169 {
170 self.0.request.patch_config = v.map(|x| x.into());
171 self
172 }
173
174 pub fn set_duration<T>(mut self, v: T) -> Self
176 where
177 T: std::convert::Into<wkt::Duration>,
178 {
179 self.0.request.duration = std::option::Option::Some(v.into());
180 self
181 }
182
183 pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
185 where
186 T: std::convert::Into<wkt::Duration>,
187 {
188 self.0.request.duration = v.map(|x| x.into());
189 self
190 }
191
192 pub fn set_dry_run<T: Into<bool>>(mut self, v: T) -> Self {
194 self.0.request.dry_run = v.into();
195 self
196 }
197
198 pub fn set_display_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
200 self.0.request.display_name = v.into();
201 self
202 }
203
204 pub fn set_rollout<T>(mut self, v: T) -> Self
206 where
207 T: std::convert::Into<crate::model::PatchRollout>,
208 {
209 self.0.request.rollout = std::option::Option::Some(v.into());
210 self
211 }
212
213 pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
215 where
216 T: std::convert::Into<crate::model::PatchRollout>,
217 {
218 self.0.request.rollout = v.map(|x| x.into());
219 self
220 }
221 }
222
223 #[doc(hidden)]
224 impl crate::RequestBuilder for ExecutePatchJob {
225 fn request_options(&mut self) -> &mut crate::RequestOptions {
226 &mut self.0.options
227 }
228 }
229
230 #[derive(Clone, Debug)]
247 pub struct GetPatchJob(RequestBuilder<crate::model::GetPatchJobRequest>);
248
249 impl GetPatchJob {
250 pub(crate) fn new(
251 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
252 ) -> Self {
253 Self(RequestBuilder::new(stub))
254 }
255
256 pub fn with_request<V: Into<crate::model::GetPatchJobRequest>>(mut self, v: V) -> Self {
258 self.0.request = v.into();
259 self
260 }
261
262 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
264 self.0.options = v.into();
265 self
266 }
267
268 pub async fn send(self) -> Result<crate::model::PatchJob> {
270 (*self.0.stub)
271 .get_patch_job(self.0.request, self.0.options)
272 .await
273 .map(crate::Response::into_body)
274 }
275
276 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
280 self.0.request.name = v.into();
281 self
282 }
283 }
284
285 #[doc(hidden)]
286 impl crate::RequestBuilder for GetPatchJob {
287 fn request_options(&mut self) -> &mut crate::RequestOptions {
288 &mut self.0.options
289 }
290 }
291
292 #[derive(Clone, Debug)]
309 pub struct CancelPatchJob(RequestBuilder<crate::model::CancelPatchJobRequest>);
310
311 impl CancelPatchJob {
312 pub(crate) fn new(
313 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
314 ) -> Self {
315 Self(RequestBuilder::new(stub))
316 }
317
318 pub fn with_request<V: Into<crate::model::CancelPatchJobRequest>>(mut self, v: V) -> Self {
320 self.0.request = v.into();
321 self
322 }
323
324 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
326 self.0.options = v.into();
327 self
328 }
329
330 pub async fn send(self) -> Result<crate::model::PatchJob> {
332 (*self.0.stub)
333 .cancel_patch_job(self.0.request, self.0.options)
334 .await
335 .map(crate::Response::into_body)
336 }
337
338 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
342 self.0.request.name = v.into();
343 self
344 }
345 }
346
347 #[doc(hidden)]
348 impl crate::RequestBuilder for CancelPatchJob {
349 fn request_options(&mut self) -> &mut crate::RequestOptions {
350 &mut self.0.options
351 }
352 }
353
354 #[derive(Clone, Debug)]
375 pub struct ListPatchJobs(RequestBuilder<crate::model::ListPatchJobsRequest>);
376
377 impl ListPatchJobs {
378 pub(crate) fn new(
379 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
380 ) -> Self {
381 Self(RequestBuilder::new(stub))
382 }
383
384 pub fn with_request<V: Into<crate::model::ListPatchJobsRequest>>(mut self, v: V) -> Self {
386 self.0.request = v.into();
387 self
388 }
389
390 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
392 self.0.options = v.into();
393 self
394 }
395
396 pub async fn send(self) -> Result<crate::model::ListPatchJobsResponse> {
398 (*self.0.stub)
399 .list_patch_jobs(self.0.request, self.0.options)
400 .await
401 .map(crate::Response::into_body)
402 }
403
404 pub fn by_page(
406 self,
407 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListPatchJobsResponse, crate::Error>
408 {
409 use std::clone::Clone;
410 let token = self.0.request.page_token.clone();
411 let execute = move |token: String| {
412 let mut builder = self.clone();
413 builder.0.request = builder.0.request.set_page_token(token);
414 builder.send()
415 };
416 google_cloud_gax::paginator::internal::new_paginator(token, execute)
417 }
418
419 pub fn by_item(
421 self,
422 ) -> impl google_cloud_gax::paginator::ItemPaginator<
423 crate::model::ListPatchJobsResponse,
424 crate::Error,
425 > {
426 use google_cloud_gax::paginator::Paginator;
427 self.by_page().items()
428 }
429
430 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
434 self.0.request.parent = v.into();
435 self
436 }
437
438 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
440 self.0.request.page_size = v.into();
441 self
442 }
443
444 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
446 self.0.request.page_token = v.into();
447 self
448 }
449
450 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
452 self.0.request.filter = v.into();
453 self
454 }
455 }
456
457 #[doc(hidden)]
458 impl crate::RequestBuilder for ListPatchJobs {
459 fn request_options(&mut self) -> &mut crate::RequestOptions {
460 &mut self.0.options
461 }
462 }
463
464 #[derive(Clone, Debug)]
485 pub struct ListPatchJobInstanceDetails(
486 RequestBuilder<crate::model::ListPatchJobInstanceDetailsRequest>,
487 );
488
489 impl ListPatchJobInstanceDetails {
490 pub(crate) fn new(
491 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
492 ) -> Self {
493 Self(RequestBuilder::new(stub))
494 }
495
496 pub fn with_request<V: Into<crate::model::ListPatchJobInstanceDetailsRequest>>(
498 mut self,
499 v: V,
500 ) -> Self {
501 self.0.request = v.into();
502 self
503 }
504
505 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
507 self.0.options = v.into();
508 self
509 }
510
511 pub async fn send(self) -> Result<crate::model::ListPatchJobInstanceDetailsResponse> {
513 (*self.0.stub)
514 .list_patch_job_instance_details(self.0.request, self.0.options)
515 .await
516 .map(crate::Response::into_body)
517 }
518
519 pub fn by_page(
521 self,
522 ) -> impl google_cloud_gax::paginator::Paginator<
523 crate::model::ListPatchJobInstanceDetailsResponse,
524 crate::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 google_cloud_gax::paginator::internal::new_paginator(token, execute)
534 }
535
536 pub fn by_item(
538 self,
539 ) -> impl google_cloud_gax::paginator::ItemPaginator<
540 crate::model::ListPatchJobInstanceDetailsResponse,
541 crate::Error,
542 > {
543 use google_cloud_gax::paginator::Paginator;
544 self.by_page().items()
545 }
546
547 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
551 self.0.request.parent = v.into();
552 self
553 }
554
555 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
557 self.0.request.page_size = v.into();
558 self
559 }
560
561 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
563 self.0.request.page_token = v.into();
564 self
565 }
566
567 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
569 self.0.request.filter = v.into();
570 self
571 }
572 }
573
574 #[doc(hidden)]
575 impl crate::RequestBuilder for ListPatchJobInstanceDetails {
576 fn request_options(&mut self) -> &mut crate::RequestOptions {
577 &mut self.0.options
578 }
579 }
580
581 #[derive(Clone, Debug)]
598 pub struct CreatePatchDeployment(RequestBuilder<crate::model::CreatePatchDeploymentRequest>);
599
600 impl CreatePatchDeployment {
601 pub(crate) fn new(
602 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
603 ) -> Self {
604 Self(RequestBuilder::new(stub))
605 }
606
607 pub fn with_request<V: Into<crate::model::CreatePatchDeploymentRequest>>(
609 mut self,
610 v: V,
611 ) -> Self {
612 self.0.request = v.into();
613 self
614 }
615
616 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
618 self.0.options = v.into();
619 self
620 }
621
622 pub async fn send(self) -> Result<crate::model::PatchDeployment> {
624 (*self.0.stub)
625 .create_patch_deployment(self.0.request, self.0.options)
626 .await
627 .map(crate::Response::into_body)
628 }
629
630 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
634 self.0.request.parent = v.into();
635 self
636 }
637
638 pub fn set_patch_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
642 self.0.request.patch_deployment_id = v.into();
643 self
644 }
645
646 pub fn set_patch_deployment<T>(mut self, v: T) -> Self
650 where
651 T: std::convert::Into<crate::model::PatchDeployment>,
652 {
653 self.0.request.patch_deployment = std::option::Option::Some(v.into());
654 self
655 }
656
657 pub fn set_or_clear_patch_deployment<T>(mut self, v: std::option::Option<T>) -> Self
661 where
662 T: std::convert::Into<crate::model::PatchDeployment>,
663 {
664 self.0.request.patch_deployment = v.map(|x| x.into());
665 self
666 }
667 }
668
669 #[doc(hidden)]
670 impl crate::RequestBuilder for CreatePatchDeployment {
671 fn request_options(&mut self) -> &mut crate::RequestOptions {
672 &mut self.0.options
673 }
674 }
675
676 #[derive(Clone, Debug)]
693 pub struct GetPatchDeployment(RequestBuilder<crate::model::GetPatchDeploymentRequest>);
694
695 impl GetPatchDeployment {
696 pub(crate) fn new(
697 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
698 ) -> Self {
699 Self(RequestBuilder::new(stub))
700 }
701
702 pub fn with_request<V: Into<crate::model::GetPatchDeploymentRequest>>(
704 mut self,
705 v: V,
706 ) -> Self {
707 self.0.request = v.into();
708 self
709 }
710
711 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
713 self.0.options = v.into();
714 self
715 }
716
717 pub async fn send(self) -> Result<crate::model::PatchDeployment> {
719 (*self.0.stub)
720 .get_patch_deployment(self.0.request, self.0.options)
721 .await
722 .map(crate::Response::into_body)
723 }
724
725 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
729 self.0.request.name = v.into();
730 self
731 }
732 }
733
734 #[doc(hidden)]
735 impl crate::RequestBuilder for GetPatchDeployment {
736 fn request_options(&mut self) -> &mut crate::RequestOptions {
737 &mut self.0.options
738 }
739 }
740
741 #[derive(Clone, Debug)]
762 pub struct ListPatchDeployments(RequestBuilder<crate::model::ListPatchDeploymentsRequest>);
763
764 impl ListPatchDeployments {
765 pub(crate) fn new(
766 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
767 ) -> Self {
768 Self(RequestBuilder::new(stub))
769 }
770
771 pub fn with_request<V: Into<crate::model::ListPatchDeploymentsRequest>>(
773 mut self,
774 v: V,
775 ) -> Self {
776 self.0.request = v.into();
777 self
778 }
779
780 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
782 self.0.options = v.into();
783 self
784 }
785
786 pub async fn send(self) -> Result<crate::model::ListPatchDeploymentsResponse> {
788 (*self.0.stub)
789 .list_patch_deployments(self.0.request, self.0.options)
790 .await
791 .map(crate::Response::into_body)
792 }
793
794 pub fn by_page(
796 self,
797 ) -> impl google_cloud_gax::paginator::Paginator<
798 crate::model::ListPatchDeploymentsResponse,
799 crate::Error,
800 > {
801 use std::clone::Clone;
802 let token = self.0.request.page_token.clone();
803 let execute = move |token: String| {
804 let mut builder = self.clone();
805 builder.0.request = builder.0.request.set_page_token(token);
806 builder.send()
807 };
808 google_cloud_gax::paginator::internal::new_paginator(token, execute)
809 }
810
811 pub fn by_item(
813 self,
814 ) -> impl google_cloud_gax::paginator::ItemPaginator<
815 crate::model::ListPatchDeploymentsResponse,
816 crate::Error,
817 > {
818 use google_cloud_gax::paginator::Paginator;
819 self.by_page().items()
820 }
821
822 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
826 self.0.request.parent = v.into();
827 self
828 }
829
830 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
832 self.0.request.page_size = v.into();
833 self
834 }
835
836 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
838 self.0.request.page_token = v.into();
839 self
840 }
841 }
842
843 #[doc(hidden)]
844 impl crate::RequestBuilder for ListPatchDeployments {
845 fn request_options(&mut self) -> &mut crate::RequestOptions {
846 &mut self.0.options
847 }
848 }
849
850 #[derive(Clone, Debug)]
867 pub struct DeletePatchDeployment(RequestBuilder<crate::model::DeletePatchDeploymentRequest>);
868
869 impl DeletePatchDeployment {
870 pub(crate) fn new(
871 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
872 ) -> Self {
873 Self(RequestBuilder::new(stub))
874 }
875
876 pub fn with_request<V: Into<crate::model::DeletePatchDeploymentRequest>>(
878 mut self,
879 v: V,
880 ) -> Self {
881 self.0.request = v.into();
882 self
883 }
884
885 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
887 self.0.options = v.into();
888 self
889 }
890
891 pub async fn send(self) -> Result<()> {
893 (*self.0.stub)
894 .delete_patch_deployment(self.0.request, self.0.options)
895 .await
896 .map(crate::Response::into_body)
897 }
898
899 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
903 self.0.request.name = v.into();
904 self
905 }
906 }
907
908 #[doc(hidden)]
909 impl crate::RequestBuilder for DeletePatchDeployment {
910 fn request_options(&mut self) -> &mut crate::RequestOptions {
911 &mut self.0.options
912 }
913 }
914
915 #[derive(Clone, Debug)]
932 pub struct UpdatePatchDeployment(RequestBuilder<crate::model::UpdatePatchDeploymentRequest>);
933
934 impl UpdatePatchDeployment {
935 pub(crate) fn new(
936 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
937 ) -> Self {
938 Self(RequestBuilder::new(stub))
939 }
940
941 pub fn with_request<V: Into<crate::model::UpdatePatchDeploymentRequest>>(
943 mut self,
944 v: V,
945 ) -> Self {
946 self.0.request = v.into();
947 self
948 }
949
950 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
952 self.0.options = v.into();
953 self
954 }
955
956 pub async fn send(self) -> Result<crate::model::PatchDeployment> {
958 (*self.0.stub)
959 .update_patch_deployment(self.0.request, self.0.options)
960 .await
961 .map(crate::Response::into_body)
962 }
963
964 pub fn set_patch_deployment<T>(mut self, v: T) -> Self
968 where
969 T: std::convert::Into<crate::model::PatchDeployment>,
970 {
971 self.0.request.patch_deployment = std::option::Option::Some(v.into());
972 self
973 }
974
975 pub fn set_or_clear_patch_deployment<T>(mut self, v: std::option::Option<T>) -> Self
979 where
980 T: std::convert::Into<crate::model::PatchDeployment>,
981 {
982 self.0.request.patch_deployment = v.map(|x| x.into());
983 self
984 }
985
986 pub fn set_update_mask<T>(mut self, v: T) -> Self
988 where
989 T: std::convert::Into<wkt::FieldMask>,
990 {
991 self.0.request.update_mask = std::option::Option::Some(v.into());
992 self
993 }
994
995 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
997 where
998 T: std::convert::Into<wkt::FieldMask>,
999 {
1000 self.0.request.update_mask = v.map(|x| x.into());
1001 self
1002 }
1003 }
1004
1005 #[doc(hidden)]
1006 impl crate::RequestBuilder for UpdatePatchDeployment {
1007 fn request_options(&mut self) -> &mut crate::RequestOptions {
1008 &mut self.0.options
1009 }
1010 }
1011
1012 #[derive(Clone, Debug)]
1029 pub struct PausePatchDeployment(RequestBuilder<crate::model::PausePatchDeploymentRequest>);
1030
1031 impl PausePatchDeployment {
1032 pub(crate) fn new(
1033 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
1034 ) -> Self {
1035 Self(RequestBuilder::new(stub))
1036 }
1037
1038 pub fn with_request<V: Into<crate::model::PausePatchDeploymentRequest>>(
1040 mut self,
1041 v: V,
1042 ) -> Self {
1043 self.0.request = v.into();
1044 self
1045 }
1046
1047 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1049 self.0.options = v.into();
1050 self
1051 }
1052
1053 pub async fn send(self) -> Result<crate::model::PatchDeployment> {
1055 (*self.0.stub)
1056 .pause_patch_deployment(self.0.request, self.0.options)
1057 .await
1058 .map(crate::Response::into_body)
1059 }
1060
1061 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1065 self.0.request.name = v.into();
1066 self
1067 }
1068 }
1069
1070 #[doc(hidden)]
1071 impl crate::RequestBuilder for PausePatchDeployment {
1072 fn request_options(&mut self) -> &mut crate::RequestOptions {
1073 &mut self.0.options
1074 }
1075 }
1076
1077 #[derive(Clone, Debug)]
1094 pub struct ResumePatchDeployment(RequestBuilder<crate::model::ResumePatchDeploymentRequest>);
1095
1096 impl ResumePatchDeployment {
1097 pub(crate) fn new(
1098 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
1099 ) -> Self {
1100 Self(RequestBuilder::new(stub))
1101 }
1102
1103 pub fn with_request<V: Into<crate::model::ResumePatchDeploymentRequest>>(
1105 mut self,
1106 v: V,
1107 ) -> Self {
1108 self.0.request = v.into();
1109 self
1110 }
1111
1112 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1114 self.0.options = v.into();
1115 self
1116 }
1117
1118 pub async fn send(self) -> Result<crate::model::PatchDeployment> {
1120 (*self.0.stub)
1121 .resume_patch_deployment(self.0.request, self.0.options)
1122 .await
1123 .map(crate::Response::into_body)
1124 }
1125
1126 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1130 self.0.request.name = v.into();
1131 self
1132 }
1133 }
1134
1135 #[doc(hidden)]
1136 impl crate::RequestBuilder for ResumePatchDeployment {
1137 fn request_options(&mut self) -> &mut crate::RequestOptions {
1138 &mut self.0.options
1139 }
1140 }
1141
1142 #[derive(Clone, Debug)]
1159 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1160
1161 impl GetOperation {
1162 pub(crate) fn new(
1163 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
1164 ) -> Self {
1165 Self(RequestBuilder::new(stub))
1166 }
1167
1168 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1170 mut self,
1171 v: V,
1172 ) -> Self {
1173 self.0.request = v.into();
1174 self
1175 }
1176
1177 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1179 self.0.options = v.into();
1180 self
1181 }
1182
1183 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1185 (*self.0.stub)
1186 .get_operation(self.0.request, self.0.options)
1187 .await
1188 .map(crate::Response::into_body)
1189 }
1190
1191 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1193 self.0.request.name = v.into();
1194 self
1195 }
1196 }
1197
1198 #[doc(hidden)]
1199 impl crate::RequestBuilder for GetOperation {
1200 fn request_options(&mut self) -> &mut crate::RequestOptions {
1201 &mut self.0.options
1202 }
1203 }
1204
1205 #[derive(Clone, Debug)]
1222 pub struct CancelOperation(
1223 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1224 );
1225
1226 impl CancelOperation {
1227 pub(crate) fn new(
1228 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
1229 ) -> Self {
1230 Self(RequestBuilder::new(stub))
1231 }
1232
1233 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1235 mut self,
1236 v: V,
1237 ) -> Self {
1238 self.0.request = v.into();
1239 self
1240 }
1241
1242 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1244 self.0.options = v.into();
1245 self
1246 }
1247
1248 pub async fn send(self) -> Result<()> {
1250 (*self.0.stub)
1251 .cancel_operation(self.0.request, self.0.options)
1252 .await
1253 .map(crate::Response::into_body)
1254 }
1255
1256 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1258 self.0.request.name = v.into();
1259 self
1260 }
1261 }
1262
1263 #[doc(hidden)]
1264 impl crate::RequestBuilder for CancelOperation {
1265 fn request_options(&mut self) -> &mut crate::RequestOptions {
1266 &mut self.0.options
1267 }
1268 }
1269}
1270
1271pub mod os_config_zonal_service {
1273 use crate::Result;
1274
1275 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1289
1290 pub(crate) mod client {
1291 use super::super::super::client::OsConfigZonalService;
1292 pub struct Factory;
1293 impl crate::ClientFactory for Factory {
1294 type Client = OsConfigZonalService;
1295 type Credentials = gaxi::options::Credentials;
1296 async fn build(
1297 self,
1298 config: gaxi::options::ClientConfig,
1299 ) -> crate::ClientBuilderResult<Self::Client> {
1300 Self::Client::new(config).await
1301 }
1302 }
1303 }
1304
1305 #[derive(Clone, Debug)]
1307 pub(crate) struct RequestBuilder<R: std::default::Default> {
1308 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1309 request: R,
1310 options: crate::RequestOptions,
1311 }
1312
1313 impl<R> RequestBuilder<R>
1314 where
1315 R: std::default::Default,
1316 {
1317 pub(crate) fn new(
1318 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1319 ) -> Self {
1320 Self {
1321 stub,
1322 request: R::default(),
1323 options: crate::RequestOptions::default(),
1324 }
1325 }
1326 }
1327
1328 #[derive(Clone, Debug)]
1346 pub struct CreateOSPolicyAssignment(
1347 RequestBuilder<crate::model::CreateOSPolicyAssignmentRequest>,
1348 );
1349
1350 impl CreateOSPolicyAssignment {
1351 pub(crate) fn new(
1352 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1353 ) -> Self {
1354 Self(RequestBuilder::new(stub))
1355 }
1356
1357 pub fn with_request<V: Into<crate::model::CreateOSPolicyAssignmentRequest>>(
1359 mut self,
1360 v: V,
1361 ) -> Self {
1362 self.0.request = v.into();
1363 self
1364 }
1365
1366 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1368 self.0.options = v.into();
1369 self
1370 }
1371
1372 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1379 (*self.0.stub)
1380 .create_os_policy_assignment(self.0.request, self.0.options)
1381 .await
1382 .map(crate::Response::into_body)
1383 }
1384
1385 pub fn poller(
1387 self,
1388 ) -> impl google_cloud_lro::Poller<
1389 crate::model::OSPolicyAssignment,
1390 crate::model::OSPolicyAssignmentOperationMetadata,
1391 > {
1392 type Operation = google_cloud_lro::internal::Operation<
1393 crate::model::OSPolicyAssignment,
1394 crate::model::OSPolicyAssignmentOperationMetadata,
1395 >;
1396 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1397 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1398 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1399 if let Some(ref mut details) = poller_options.tracing {
1400 details.method_name = "google_cloud_osconfig_v1::client::OsConfigZonalService::create_os_policy_assignment::until_done";
1401 }
1402
1403 let stub = self.0.stub.clone();
1404 let mut options = self.0.options.clone();
1405 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1406 let query = move |name| {
1407 let stub = stub.clone();
1408 let options = options.clone();
1409 async {
1410 let op = GetOperation::new(stub)
1411 .set_name(name)
1412 .with_options(options)
1413 .send()
1414 .await?;
1415 Ok(Operation::new(op))
1416 }
1417 };
1418
1419 let start = move || async {
1420 let op = self.send().await?;
1421 Ok(Operation::new(op))
1422 };
1423
1424 use google_cloud_lro::internal::PollerExt;
1425 {
1426 google_cloud_lro::internal::new_poller(
1427 polling_error_policy,
1428 polling_backoff_policy,
1429 start,
1430 query,
1431 )
1432 }
1433 .with_options(poller_options)
1434 }
1435
1436 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1440 self.0.request.parent = v.into();
1441 self
1442 }
1443
1444 pub fn set_os_policy_assignment<T>(mut self, v: T) -> Self
1448 where
1449 T: std::convert::Into<crate::model::OSPolicyAssignment>,
1450 {
1451 self.0.request.os_policy_assignment = std::option::Option::Some(v.into());
1452 self
1453 }
1454
1455 pub fn set_or_clear_os_policy_assignment<T>(mut self, v: std::option::Option<T>) -> Self
1459 where
1460 T: std::convert::Into<crate::model::OSPolicyAssignment>,
1461 {
1462 self.0.request.os_policy_assignment = v.map(|x| x.into());
1463 self
1464 }
1465
1466 pub fn set_os_policy_assignment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1470 self.0.request.os_policy_assignment_id = v.into();
1471 self
1472 }
1473 }
1474
1475 #[doc(hidden)]
1476 impl crate::RequestBuilder for CreateOSPolicyAssignment {
1477 fn request_options(&mut self) -> &mut crate::RequestOptions {
1478 &mut self.0.options
1479 }
1480 }
1481
1482 #[derive(Clone, Debug)]
1500 pub struct UpdateOSPolicyAssignment(
1501 RequestBuilder<crate::model::UpdateOSPolicyAssignmentRequest>,
1502 );
1503
1504 impl UpdateOSPolicyAssignment {
1505 pub(crate) fn new(
1506 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1507 ) -> Self {
1508 Self(RequestBuilder::new(stub))
1509 }
1510
1511 pub fn with_request<V: Into<crate::model::UpdateOSPolicyAssignmentRequest>>(
1513 mut self,
1514 v: V,
1515 ) -> Self {
1516 self.0.request = v.into();
1517 self
1518 }
1519
1520 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1522 self.0.options = v.into();
1523 self
1524 }
1525
1526 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1533 (*self.0.stub)
1534 .update_os_policy_assignment(self.0.request, self.0.options)
1535 .await
1536 .map(crate::Response::into_body)
1537 }
1538
1539 pub fn poller(
1541 self,
1542 ) -> impl google_cloud_lro::Poller<
1543 crate::model::OSPolicyAssignment,
1544 crate::model::OSPolicyAssignmentOperationMetadata,
1545 > {
1546 type Operation = google_cloud_lro::internal::Operation<
1547 crate::model::OSPolicyAssignment,
1548 crate::model::OSPolicyAssignmentOperationMetadata,
1549 >;
1550 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1551 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1552 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1553 if let Some(ref mut details) = poller_options.tracing {
1554 details.method_name = "google_cloud_osconfig_v1::client::OsConfigZonalService::update_os_policy_assignment::until_done";
1555 }
1556
1557 let stub = self.0.stub.clone();
1558 let mut options = self.0.options.clone();
1559 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1560 let query = move |name| {
1561 let stub = stub.clone();
1562 let options = options.clone();
1563 async {
1564 let op = GetOperation::new(stub)
1565 .set_name(name)
1566 .with_options(options)
1567 .send()
1568 .await?;
1569 Ok(Operation::new(op))
1570 }
1571 };
1572
1573 let start = move || async {
1574 let op = self.send().await?;
1575 Ok(Operation::new(op))
1576 };
1577
1578 use google_cloud_lro::internal::PollerExt;
1579 {
1580 google_cloud_lro::internal::new_poller(
1581 polling_error_policy,
1582 polling_backoff_policy,
1583 start,
1584 query,
1585 )
1586 }
1587 .with_options(poller_options)
1588 }
1589
1590 pub fn set_os_policy_assignment<T>(mut self, v: T) -> Self
1594 where
1595 T: std::convert::Into<crate::model::OSPolicyAssignment>,
1596 {
1597 self.0.request.os_policy_assignment = std::option::Option::Some(v.into());
1598 self
1599 }
1600
1601 pub fn set_or_clear_os_policy_assignment<T>(mut self, v: std::option::Option<T>) -> Self
1605 where
1606 T: std::convert::Into<crate::model::OSPolicyAssignment>,
1607 {
1608 self.0.request.os_policy_assignment = v.map(|x| x.into());
1609 self
1610 }
1611
1612 pub fn set_update_mask<T>(mut self, v: T) -> Self
1614 where
1615 T: std::convert::Into<wkt::FieldMask>,
1616 {
1617 self.0.request.update_mask = std::option::Option::Some(v.into());
1618 self
1619 }
1620
1621 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1623 where
1624 T: std::convert::Into<wkt::FieldMask>,
1625 {
1626 self.0.request.update_mask = v.map(|x| x.into());
1627 self
1628 }
1629 }
1630
1631 #[doc(hidden)]
1632 impl crate::RequestBuilder for UpdateOSPolicyAssignment {
1633 fn request_options(&mut self) -> &mut crate::RequestOptions {
1634 &mut self.0.options
1635 }
1636 }
1637
1638 #[derive(Clone, Debug)]
1655 pub struct GetOSPolicyAssignment(RequestBuilder<crate::model::GetOSPolicyAssignmentRequest>);
1656
1657 impl GetOSPolicyAssignment {
1658 pub(crate) fn new(
1659 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1660 ) -> Self {
1661 Self(RequestBuilder::new(stub))
1662 }
1663
1664 pub fn with_request<V: Into<crate::model::GetOSPolicyAssignmentRequest>>(
1666 mut self,
1667 v: V,
1668 ) -> Self {
1669 self.0.request = v.into();
1670 self
1671 }
1672
1673 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1675 self.0.options = v.into();
1676 self
1677 }
1678
1679 pub async fn send(self) -> Result<crate::model::OSPolicyAssignment> {
1681 (*self.0.stub)
1682 .get_os_policy_assignment(self.0.request, self.0.options)
1683 .await
1684 .map(crate::Response::into_body)
1685 }
1686
1687 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1691 self.0.request.name = v.into();
1692 self
1693 }
1694 }
1695
1696 #[doc(hidden)]
1697 impl crate::RequestBuilder for GetOSPolicyAssignment {
1698 fn request_options(&mut self) -> &mut crate::RequestOptions {
1699 &mut self.0.options
1700 }
1701 }
1702
1703 #[derive(Clone, Debug)]
1724 pub struct ListOSPolicyAssignments(
1725 RequestBuilder<crate::model::ListOSPolicyAssignmentsRequest>,
1726 );
1727
1728 impl ListOSPolicyAssignments {
1729 pub(crate) fn new(
1730 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1731 ) -> Self {
1732 Self(RequestBuilder::new(stub))
1733 }
1734
1735 pub fn with_request<V: Into<crate::model::ListOSPolicyAssignmentsRequest>>(
1737 mut self,
1738 v: V,
1739 ) -> Self {
1740 self.0.request = v.into();
1741 self
1742 }
1743
1744 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1746 self.0.options = v.into();
1747 self
1748 }
1749
1750 pub async fn send(self) -> Result<crate::model::ListOSPolicyAssignmentsResponse> {
1752 (*self.0.stub)
1753 .list_os_policy_assignments(self.0.request, self.0.options)
1754 .await
1755 .map(crate::Response::into_body)
1756 }
1757
1758 pub fn by_page(
1760 self,
1761 ) -> impl google_cloud_gax::paginator::Paginator<
1762 crate::model::ListOSPolicyAssignmentsResponse,
1763 crate::Error,
1764 > {
1765 use std::clone::Clone;
1766 let token = self.0.request.page_token.clone();
1767 let execute = move |token: String| {
1768 let mut builder = self.clone();
1769 builder.0.request = builder.0.request.set_page_token(token);
1770 builder.send()
1771 };
1772 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1773 }
1774
1775 pub fn by_item(
1777 self,
1778 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1779 crate::model::ListOSPolicyAssignmentsResponse,
1780 crate::Error,
1781 > {
1782 use google_cloud_gax::paginator::Paginator;
1783 self.by_page().items()
1784 }
1785
1786 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1790 self.0.request.parent = v.into();
1791 self
1792 }
1793
1794 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1796 self.0.request.page_size = v.into();
1797 self
1798 }
1799
1800 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1802 self.0.request.page_token = v.into();
1803 self
1804 }
1805 }
1806
1807 #[doc(hidden)]
1808 impl crate::RequestBuilder for ListOSPolicyAssignments {
1809 fn request_options(&mut self) -> &mut crate::RequestOptions {
1810 &mut self.0.options
1811 }
1812 }
1813
1814 #[derive(Clone, Debug)]
1835 pub struct ListOSPolicyAssignmentRevisions(
1836 RequestBuilder<crate::model::ListOSPolicyAssignmentRevisionsRequest>,
1837 );
1838
1839 impl ListOSPolicyAssignmentRevisions {
1840 pub(crate) fn new(
1841 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1842 ) -> Self {
1843 Self(RequestBuilder::new(stub))
1844 }
1845
1846 pub fn with_request<V: Into<crate::model::ListOSPolicyAssignmentRevisionsRequest>>(
1848 mut self,
1849 v: V,
1850 ) -> Self {
1851 self.0.request = v.into();
1852 self
1853 }
1854
1855 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1857 self.0.options = v.into();
1858 self
1859 }
1860
1861 pub async fn send(self) -> Result<crate::model::ListOSPolicyAssignmentRevisionsResponse> {
1863 (*self.0.stub)
1864 .list_os_policy_assignment_revisions(self.0.request, self.0.options)
1865 .await
1866 .map(crate::Response::into_body)
1867 }
1868
1869 pub fn by_page(
1871 self,
1872 ) -> impl google_cloud_gax::paginator::Paginator<
1873 crate::model::ListOSPolicyAssignmentRevisionsResponse,
1874 crate::Error,
1875 > {
1876 use std::clone::Clone;
1877 let token = self.0.request.page_token.clone();
1878 let execute = move |token: String| {
1879 let mut builder = self.clone();
1880 builder.0.request = builder.0.request.set_page_token(token);
1881 builder.send()
1882 };
1883 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1884 }
1885
1886 pub fn by_item(
1888 self,
1889 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1890 crate::model::ListOSPolicyAssignmentRevisionsResponse,
1891 crate::Error,
1892 > {
1893 use google_cloud_gax::paginator::Paginator;
1894 self.by_page().items()
1895 }
1896
1897 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1901 self.0.request.name = v.into();
1902 self
1903 }
1904
1905 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1907 self.0.request.page_size = v.into();
1908 self
1909 }
1910
1911 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1913 self.0.request.page_token = v.into();
1914 self
1915 }
1916 }
1917
1918 #[doc(hidden)]
1919 impl crate::RequestBuilder for ListOSPolicyAssignmentRevisions {
1920 fn request_options(&mut self) -> &mut crate::RequestOptions {
1921 &mut self.0.options
1922 }
1923 }
1924
1925 #[derive(Clone, Debug)]
1943 pub struct DeleteOSPolicyAssignment(
1944 RequestBuilder<crate::model::DeleteOSPolicyAssignmentRequest>,
1945 );
1946
1947 impl DeleteOSPolicyAssignment {
1948 pub(crate) fn new(
1949 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1950 ) -> Self {
1951 Self(RequestBuilder::new(stub))
1952 }
1953
1954 pub fn with_request<V: Into<crate::model::DeleteOSPolicyAssignmentRequest>>(
1956 mut self,
1957 v: V,
1958 ) -> Self {
1959 self.0.request = v.into();
1960 self
1961 }
1962
1963 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1965 self.0.options = v.into();
1966 self
1967 }
1968
1969 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1976 (*self.0.stub)
1977 .delete_os_policy_assignment(self.0.request, self.0.options)
1978 .await
1979 .map(crate::Response::into_body)
1980 }
1981
1982 pub fn poller(
1984 self,
1985 ) -> impl google_cloud_lro::Poller<(), crate::model::OSPolicyAssignmentOperationMetadata>
1986 {
1987 type Operation = google_cloud_lro::internal::Operation<
1988 wkt::Empty,
1989 crate::model::OSPolicyAssignmentOperationMetadata,
1990 >;
1991 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1992 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1993 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1994 if let Some(ref mut details) = poller_options.tracing {
1995 details.method_name = "google_cloud_osconfig_v1::client::OsConfigZonalService::delete_os_policy_assignment::until_done";
1996 }
1997
1998 let stub = self.0.stub.clone();
1999 let mut options = self.0.options.clone();
2000 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2001 let query = move |name| {
2002 let stub = stub.clone();
2003 let options = options.clone();
2004 async {
2005 let op = GetOperation::new(stub)
2006 .set_name(name)
2007 .with_options(options)
2008 .send()
2009 .await?;
2010 Ok(Operation::new(op))
2011 }
2012 };
2013
2014 let start = move || async {
2015 let op = self.send().await?;
2016 Ok(Operation::new(op))
2017 };
2018
2019 use google_cloud_lro::internal::PollerExt;
2020 {
2021 google_cloud_lro::internal::new_unit_response_poller(
2022 polling_error_policy,
2023 polling_backoff_policy,
2024 start,
2025 query,
2026 )
2027 }
2028 .with_options(poller_options)
2029 }
2030
2031 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2035 self.0.request.name = v.into();
2036 self
2037 }
2038 }
2039
2040 #[doc(hidden)]
2041 impl crate::RequestBuilder for DeleteOSPolicyAssignment {
2042 fn request_options(&mut self) -> &mut crate::RequestOptions {
2043 &mut self.0.options
2044 }
2045 }
2046
2047 #[derive(Clone, Debug)]
2064 pub struct GetOSPolicyAssignmentReport(
2065 RequestBuilder<crate::model::GetOSPolicyAssignmentReportRequest>,
2066 );
2067
2068 impl GetOSPolicyAssignmentReport {
2069 pub(crate) fn new(
2070 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2071 ) -> Self {
2072 Self(RequestBuilder::new(stub))
2073 }
2074
2075 pub fn with_request<V: Into<crate::model::GetOSPolicyAssignmentReportRequest>>(
2077 mut self,
2078 v: V,
2079 ) -> Self {
2080 self.0.request = v.into();
2081 self
2082 }
2083
2084 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2086 self.0.options = v.into();
2087 self
2088 }
2089
2090 pub async fn send(self) -> Result<crate::model::OSPolicyAssignmentReport> {
2092 (*self.0.stub)
2093 .get_os_policy_assignment_report(self.0.request, self.0.options)
2094 .await
2095 .map(crate::Response::into_body)
2096 }
2097
2098 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2102 self.0.request.name = v.into();
2103 self
2104 }
2105 }
2106
2107 #[doc(hidden)]
2108 impl crate::RequestBuilder for GetOSPolicyAssignmentReport {
2109 fn request_options(&mut self) -> &mut crate::RequestOptions {
2110 &mut self.0.options
2111 }
2112 }
2113
2114 #[derive(Clone, Debug)]
2135 pub struct ListOSPolicyAssignmentReports(
2136 RequestBuilder<crate::model::ListOSPolicyAssignmentReportsRequest>,
2137 );
2138
2139 impl ListOSPolicyAssignmentReports {
2140 pub(crate) fn new(
2141 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2142 ) -> Self {
2143 Self(RequestBuilder::new(stub))
2144 }
2145
2146 pub fn with_request<V: Into<crate::model::ListOSPolicyAssignmentReportsRequest>>(
2148 mut self,
2149 v: V,
2150 ) -> Self {
2151 self.0.request = v.into();
2152 self
2153 }
2154
2155 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2157 self.0.options = v.into();
2158 self
2159 }
2160
2161 pub async fn send(self) -> Result<crate::model::ListOSPolicyAssignmentReportsResponse> {
2163 (*self.0.stub)
2164 .list_os_policy_assignment_reports(self.0.request, self.0.options)
2165 .await
2166 .map(crate::Response::into_body)
2167 }
2168
2169 pub fn by_page(
2171 self,
2172 ) -> impl google_cloud_gax::paginator::Paginator<
2173 crate::model::ListOSPolicyAssignmentReportsResponse,
2174 crate::Error,
2175 > {
2176 use std::clone::Clone;
2177 let token = self.0.request.page_token.clone();
2178 let execute = move |token: String| {
2179 let mut builder = self.clone();
2180 builder.0.request = builder.0.request.set_page_token(token);
2181 builder.send()
2182 };
2183 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2184 }
2185
2186 pub fn by_item(
2188 self,
2189 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2190 crate::model::ListOSPolicyAssignmentReportsResponse,
2191 crate::Error,
2192 > {
2193 use google_cloud_gax::paginator::Paginator;
2194 self.by_page().items()
2195 }
2196
2197 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2201 self.0.request.parent = v.into();
2202 self
2203 }
2204
2205 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2207 self.0.request.page_size = v.into();
2208 self
2209 }
2210
2211 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2213 self.0.request.filter = v.into();
2214 self
2215 }
2216
2217 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2219 self.0.request.page_token = v.into();
2220 self
2221 }
2222 }
2223
2224 #[doc(hidden)]
2225 impl crate::RequestBuilder for ListOSPolicyAssignmentReports {
2226 fn request_options(&mut self) -> &mut crate::RequestOptions {
2227 &mut self.0.options
2228 }
2229 }
2230
2231 #[derive(Clone, Debug)]
2248 pub struct GetInventory(RequestBuilder<crate::model::GetInventoryRequest>);
2249
2250 impl GetInventory {
2251 pub(crate) fn new(
2252 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2253 ) -> Self {
2254 Self(RequestBuilder::new(stub))
2255 }
2256
2257 pub fn with_request<V: Into<crate::model::GetInventoryRequest>>(mut self, v: V) -> Self {
2259 self.0.request = v.into();
2260 self
2261 }
2262
2263 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2265 self.0.options = v.into();
2266 self
2267 }
2268
2269 pub async fn send(self) -> Result<crate::model::Inventory> {
2271 (*self.0.stub)
2272 .get_inventory(self.0.request, self.0.options)
2273 .await
2274 .map(crate::Response::into_body)
2275 }
2276
2277 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2281 self.0.request.name = v.into();
2282 self
2283 }
2284
2285 pub fn set_view<T: Into<crate::model::InventoryView>>(mut self, v: T) -> Self {
2287 self.0.request.view = v.into();
2288 self
2289 }
2290 }
2291
2292 #[doc(hidden)]
2293 impl crate::RequestBuilder for GetInventory {
2294 fn request_options(&mut self) -> &mut crate::RequestOptions {
2295 &mut self.0.options
2296 }
2297 }
2298
2299 #[derive(Clone, Debug)]
2320 pub struct ListInventories(RequestBuilder<crate::model::ListInventoriesRequest>);
2321
2322 impl ListInventories {
2323 pub(crate) fn new(
2324 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2325 ) -> Self {
2326 Self(RequestBuilder::new(stub))
2327 }
2328
2329 pub fn with_request<V: Into<crate::model::ListInventoriesRequest>>(mut self, v: V) -> Self {
2331 self.0.request = v.into();
2332 self
2333 }
2334
2335 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2337 self.0.options = v.into();
2338 self
2339 }
2340
2341 pub async fn send(self) -> Result<crate::model::ListInventoriesResponse> {
2343 (*self.0.stub)
2344 .list_inventories(self.0.request, self.0.options)
2345 .await
2346 .map(crate::Response::into_body)
2347 }
2348
2349 pub fn by_page(
2351 self,
2352 ) -> impl google_cloud_gax::paginator::Paginator<
2353 crate::model::ListInventoriesResponse,
2354 crate::Error,
2355 > {
2356 use std::clone::Clone;
2357 let token = self.0.request.page_token.clone();
2358 let execute = move |token: String| {
2359 let mut builder = self.clone();
2360 builder.0.request = builder.0.request.set_page_token(token);
2361 builder.send()
2362 };
2363 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2364 }
2365
2366 pub fn by_item(
2368 self,
2369 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2370 crate::model::ListInventoriesResponse,
2371 crate::Error,
2372 > {
2373 use google_cloud_gax::paginator::Paginator;
2374 self.by_page().items()
2375 }
2376
2377 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2381 self.0.request.parent = v.into();
2382 self
2383 }
2384
2385 pub fn set_view<T: Into<crate::model::InventoryView>>(mut self, v: T) -> Self {
2387 self.0.request.view = v.into();
2388 self
2389 }
2390
2391 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2393 self.0.request.page_size = v.into();
2394 self
2395 }
2396
2397 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2399 self.0.request.page_token = v.into();
2400 self
2401 }
2402
2403 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2405 self.0.request.filter = v.into();
2406 self
2407 }
2408 }
2409
2410 #[doc(hidden)]
2411 impl crate::RequestBuilder for ListInventories {
2412 fn request_options(&mut self) -> &mut crate::RequestOptions {
2413 &mut self.0.options
2414 }
2415 }
2416
2417 #[derive(Clone, Debug)]
2434 pub struct GetVulnerabilityReport(RequestBuilder<crate::model::GetVulnerabilityReportRequest>);
2435
2436 impl GetVulnerabilityReport {
2437 pub(crate) fn new(
2438 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2439 ) -> Self {
2440 Self(RequestBuilder::new(stub))
2441 }
2442
2443 pub fn with_request<V: Into<crate::model::GetVulnerabilityReportRequest>>(
2445 mut self,
2446 v: V,
2447 ) -> Self {
2448 self.0.request = v.into();
2449 self
2450 }
2451
2452 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2454 self.0.options = v.into();
2455 self
2456 }
2457
2458 pub async fn send(self) -> Result<crate::model::VulnerabilityReport> {
2460 (*self.0.stub)
2461 .get_vulnerability_report(self.0.request, self.0.options)
2462 .await
2463 .map(crate::Response::into_body)
2464 }
2465
2466 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2470 self.0.request.name = v.into();
2471 self
2472 }
2473 }
2474
2475 #[doc(hidden)]
2476 impl crate::RequestBuilder for GetVulnerabilityReport {
2477 fn request_options(&mut self) -> &mut crate::RequestOptions {
2478 &mut self.0.options
2479 }
2480 }
2481
2482 #[derive(Clone, Debug)]
2503 pub struct ListVulnerabilityReports(
2504 RequestBuilder<crate::model::ListVulnerabilityReportsRequest>,
2505 );
2506
2507 impl ListVulnerabilityReports {
2508 pub(crate) fn new(
2509 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2510 ) -> Self {
2511 Self(RequestBuilder::new(stub))
2512 }
2513
2514 pub fn with_request<V: Into<crate::model::ListVulnerabilityReportsRequest>>(
2516 mut self,
2517 v: V,
2518 ) -> Self {
2519 self.0.request = v.into();
2520 self
2521 }
2522
2523 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2525 self.0.options = v.into();
2526 self
2527 }
2528
2529 pub async fn send(self) -> Result<crate::model::ListVulnerabilityReportsResponse> {
2531 (*self.0.stub)
2532 .list_vulnerability_reports(self.0.request, self.0.options)
2533 .await
2534 .map(crate::Response::into_body)
2535 }
2536
2537 pub fn by_page(
2539 self,
2540 ) -> impl google_cloud_gax::paginator::Paginator<
2541 crate::model::ListVulnerabilityReportsResponse,
2542 crate::Error,
2543 > {
2544 use std::clone::Clone;
2545 let token = self.0.request.page_token.clone();
2546 let execute = move |token: String| {
2547 let mut builder = self.clone();
2548 builder.0.request = builder.0.request.set_page_token(token);
2549 builder.send()
2550 };
2551 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2552 }
2553
2554 pub fn by_item(
2556 self,
2557 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2558 crate::model::ListVulnerabilityReportsResponse,
2559 crate::Error,
2560 > {
2561 use google_cloud_gax::paginator::Paginator;
2562 self.by_page().items()
2563 }
2564
2565 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2569 self.0.request.parent = v.into();
2570 self
2571 }
2572
2573 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2575 self.0.request.page_size = v.into();
2576 self
2577 }
2578
2579 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2581 self.0.request.page_token = v.into();
2582 self
2583 }
2584
2585 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2587 self.0.request.filter = v.into();
2588 self
2589 }
2590 }
2591
2592 #[doc(hidden)]
2593 impl crate::RequestBuilder for ListVulnerabilityReports {
2594 fn request_options(&mut self) -> &mut crate::RequestOptions {
2595 &mut self.0.options
2596 }
2597 }
2598
2599 #[derive(Clone, Debug)]
2616 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2617
2618 impl GetOperation {
2619 pub(crate) fn new(
2620 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2621 ) -> Self {
2622 Self(RequestBuilder::new(stub))
2623 }
2624
2625 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2627 mut self,
2628 v: V,
2629 ) -> Self {
2630 self.0.request = v.into();
2631 self
2632 }
2633
2634 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2636 self.0.options = v.into();
2637 self
2638 }
2639
2640 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2642 (*self.0.stub)
2643 .get_operation(self.0.request, self.0.options)
2644 .await
2645 .map(crate::Response::into_body)
2646 }
2647
2648 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2650 self.0.request.name = v.into();
2651 self
2652 }
2653 }
2654
2655 #[doc(hidden)]
2656 impl crate::RequestBuilder for GetOperation {
2657 fn request_options(&mut self) -> &mut crate::RequestOptions {
2658 &mut self.0.options
2659 }
2660 }
2661
2662 #[derive(Clone, Debug)]
2679 pub struct CancelOperation(
2680 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2681 );
2682
2683 impl CancelOperation {
2684 pub(crate) fn new(
2685 stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2686 ) -> Self {
2687 Self(RequestBuilder::new(stub))
2688 }
2689
2690 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2692 mut self,
2693 v: V,
2694 ) -> Self {
2695 self.0.request = v.into();
2696 self
2697 }
2698
2699 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2701 self.0.options = v.into();
2702 self
2703 }
2704
2705 pub async fn send(self) -> Result<()> {
2707 (*self.0.stub)
2708 .cancel_operation(self.0.request, self.0.options)
2709 .await
2710 .map(crate::Response::into_body)
2711 }
2712
2713 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2715 self.0.request.name = v.into();
2716 self
2717 }
2718 }
2719
2720 #[doc(hidden)]
2721 impl crate::RequestBuilder for CancelOperation {
2722 fn request_options(&mut self) -> &mut crate::RequestOptions {
2723 &mut self.0.options
2724 }
2725 }
2726}