1pub mod config {
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::Config;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = Config;
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::Config>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: crate::RequestOptions::default(),
68 }
69 }
70 }
71
72 #[derive(Clone, Debug)]
93 pub struct ListDeployments(RequestBuilder<crate::model::ListDeploymentsRequest>);
94
95 impl ListDeployments {
96 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::ListDeploymentsRequest>>(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::ListDeploymentsResponse> {
114 (*self.0.stub)
115 .list_deployments(self.0.request, self.0.options)
116 .await
117 .map(crate::Response::into_body)
118 }
119
120 pub fn by_page(
122 self,
123 ) -> impl google_cloud_gax::paginator::Paginator<
124 crate::model::ListDeploymentsResponse,
125 crate::Error,
126 > {
127 use std::clone::Clone;
128 let token = self.0.request.page_token.clone();
129 let execute = move |token: String| {
130 let mut builder = self.clone();
131 builder.0.request = builder.0.request.set_page_token(token);
132 builder.send()
133 };
134 google_cloud_gax::paginator::internal::new_paginator(token, execute)
135 }
136
137 pub fn by_item(
139 self,
140 ) -> impl google_cloud_gax::paginator::ItemPaginator<
141 crate::model::ListDeploymentsResponse,
142 crate::Error,
143 > {
144 use google_cloud_gax::paginator::Paginator;
145 self.by_page().items()
146 }
147
148 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
152 self.0.request.parent = v.into();
153 self
154 }
155
156 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
158 self.0.request.page_size = v.into();
159 self
160 }
161
162 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
164 self.0.request.page_token = v.into();
165 self
166 }
167
168 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.filter = v.into();
171 self
172 }
173
174 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
176 self.0.request.order_by = v.into();
177 self
178 }
179 }
180
181 #[doc(hidden)]
182 impl crate::RequestBuilder for ListDeployments {
183 fn request_options(&mut self) -> &mut crate::RequestOptions {
184 &mut self.0.options
185 }
186 }
187
188 #[derive(Clone, Debug)]
205 pub struct GetDeployment(RequestBuilder<crate::model::GetDeploymentRequest>);
206
207 impl GetDeployment {
208 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
209 Self(RequestBuilder::new(stub))
210 }
211
212 pub fn with_request<V: Into<crate::model::GetDeploymentRequest>>(mut self, v: V) -> Self {
214 self.0.request = v.into();
215 self
216 }
217
218 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
220 self.0.options = v.into();
221 self
222 }
223
224 pub async fn send(self) -> Result<crate::model::Deployment> {
226 (*self.0.stub)
227 .get_deployment(self.0.request, self.0.options)
228 .await
229 .map(crate::Response::into_body)
230 }
231
232 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
236 self.0.request.name = v.into();
237 self
238 }
239 }
240
241 #[doc(hidden)]
242 impl crate::RequestBuilder for GetDeployment {
243 fn request_options(&mut self) -> &mut crate::RequestOptions {
244 &mut self.0.options
245 }
246 }
247
248 #[derive(Clone, Debug)]
266 pub struct CreateDeployment(RequestBuilder<crate::model::CreateDeploymentRequest>);
267
268 impl CreateDeployment {
269 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
270 Self(RequestBuilder::new(stub))
271 }
272
273 pub fn with_request<V: Into<crate::model::CreateDeploymentRequest>>(
275 mut self,
276 v: V,
277 ) -> Self {
278 self.0.request = v.into();
279 self
280 }
281
282 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
284 self.0.options = v.into();
285 self
286 }
287
288 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
295 (*self.0.stub)
296 .create_deployment(self.0.request, self.0.options)
297 .await
298 .map(crate::Response::into_body)
299 }
300
301 pub fn poller(
303 self,
304 ) -> impl google_cloud_lro::Poller<crate::model::Deployment, crate::model::OperationMetadata>
305 {
306 type Operation = google_cloud_lro::internal::Operation<
307 crate::model::Deployment,
308 crate::model::OperationMetadata,
309 >;
310 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
311 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
312
313 let stub = self.0.stub.clone();
314 let mut options = self.0.options.clone();
315 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
316 let query = move |name| {
317 let stub = stub.clone();
318 let options = options.clone();
319 async {
320 let op = GetOperation::new(stub)
321 .set_name(name)
322 .with_options(options)
323 .send()
324 .await?;
325 Ok(Operation::new(op))
326 }
327 };
328
329 let start = move || async {
330 let op = self.send().await?;
331 Ok(Operation::new(op))
332 };
333
334 google_cloud_lro::internal::new_poller(
335 polling_error_policy,
336 polling_backoff_policy,
337 start,
338 query,
339 )
340 }
341
342 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
346 self.0.request.parent = v.into();
347 self
348 }
349
350 pub fn set_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
354 self.0.request.deployment_id = v.into();
355 self
356 }
357
358 pub fn set_deployment<T>(mut self, v: T) -> Self
362 where
363 T: std::convert::Into<crate::model::Deployment>,
364 {
365 self.0.request.deployment = std::option::Option::Some(v.into());
366 self
367 }
368
369 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
373 where
374 T: std::convert::Into<crate::model::Deployment>,
375 {
376 self.0.request.deployment = v.map(|x| x.into());
377 self
378 }
379
380 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
382 self.0.request.request_id = v.into();
383 self
384 }
385 }
386
387 #[doc(hidden)]
388 impl crate::RequestBuilder for CreateDeployment {
389 fn request_options(&mut self) -> &mut crate::RequestOptions {
390 &mut self.0.options
391 }
392 }
393
394 #[derive(Clone, Debug)]
412 pub struct UpdateDeployment(RequestBuilder<crate::model::UpdateDeploymentRequest>);
413
414 impl UpdateDeployment {
415 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
416 Self(RequestBuilder::new(stub))
417 }
418
419 pub fn with_request<V: Into<crate::model::UpdateDeploymentRequest>>(
421 mut self,
422 v: V,
423 ) -> Self {
424 self.0.request = v.into();
425 self
426 }
427
428 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
430 self.0.options = v.into();
431 self
432 }
433
434 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
441 (*self.0.stub)
442 .update_deployment(self.0.request, self.0.options)
443 .await
444 .map(crate::Response::into_body)
445 }
446
447 pub fn poller(
449 self,
450 ) -> impl google_cloud_lro::Poller<crate::model::Deployment, crate::model::OperationMetadata>
451 {
452 type Operation = google_cloud_lro::internal::Operation<
453 crate::model::Deployment,
454 crate::model::OperationMetadata,
455 >;
456 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
457 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
458
459 let stub = self.0.stub.clone();
460 let mut options = self.0.options.clone();
461 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
462 let query = move |name| {
463 let stub = stub.clone();
464 let options = options.clone();
465 async {
466 let op = GetOperation::new(stub)
467 .set_name(name)
468 .with_options(options)
469 .send()
470 .await?;
471 Ok(Operation::new(op))
472 }
473 };
474
475 let start = move || async {
476 let op = self.send().await?;
477 Ok(Operation::new(op))
478 };
479
480 google_cloud_lro::internal::new_poller(
481 polling_error_policy,
482 polling_backoff_policy,
483 start,
484 query,
485 )
486 }
487
488 pub fn set_update_mask<T>(mut self, v: T) -> Self
490 where
491 T: std::convert::Into<wkt::FieldMask>,
492 {
493 self.0.request.update_mask = std::option::Option::Some(v.into());
494 self
495 }
496
497 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
499 where
500 T: std::convert::Into<wkt::FieldMask>,
501 {
502 self.0.request.update_mask = v.map(|x| x.into());
503 self
504 }
505
506 pub fn set_deployment<T>(mut self, v: T) -> Self
510 where
511 T: std::convert::Into<crate::model::Deployment>,
512 {
513 self.0.request.deployment = std::option::Option::Some(v.into());
514 self
515 }
516
517 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
521 where
522 T: std::convert::Into<crate::model::Deployment>,
523 {
524 self.0.request.deployment = v.map(|x| x.into());
525 self
526 }
527
528 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
530 self.0.request.request_id = v.into();
531 self
532 }
533 }
534
535 #[doc(hidden)]
536 impl crate::RequestBuilder for UpdateDeployment {
537 fn request_options(&mut self) -> &mut crate::RequestOptions {
538 &mut self.0.options
539 }
540 }
541
542 #[derive(Clone, Debug)]
560 pub struct DeleteDeployment(RequestBuilder<crate::model::DeleteDeploymentRequest>);
561
562 impl DeleteDeployment {
563 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
564 Self(RequestBuilder::new(stub))
565 }
566
567 pub fn with_request<V: Into<crate::model::DeleteDeploymentRequest>>(
569 mut self,
570 v: V,
571 ) -> Self {
572 self.0.request = v.into();
573 self
574 }
575
576 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
578 self.0.options = v.into();
579 self
580 }
581
582 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
589 (*self.0.stub)
590 .delete_deployment(self.0.request, self.0.options)
591 .await
592 .map(crate::Response::into_body)
593 }
594
595 pub fn poller(
597 self,
598 ) -> impl google_cloud_lro::Poller<crate::model::Deployment, crate::model::OperationMetadata>
599 {
600 type Operation = google_cloud_lro::internal::Operation<
601 crate::model::Deployment,
602 crate::model::OperationMetadata,
603 >;
604 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
605 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
606
607 let stub = self.0.stub.clone();
608 let mut options = self.0.options.clone();
609 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
610 let query = move |name| {
611 let stub = stub.clone();
612 let options = options.clone();
613 async {
614 let op = GetOperation::new(stub)
615 .set_name(name)
616 .with_options(options)
617 .send()
618 .await?;
619 Ok(Operation::new(op))
620 }
621 };
622
623 let start = move || async {
624 let op = self.send().await?;
625 Ok(Operation::new(op))
626 };
627
628 google_cloud_lro::internal::new_poller(
629 polling_error_policy,
630 polling_backoff_policy,
631 start,
632 query,
633 )
634 }
635
636 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
640 self.0.request.name = v.into();
641 self
642 }
643
644 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
646 self.0.request.request_id = v.into();
647 self
648 }
649
650 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
652 self.0.request.force = v.into();
653 self
654 }
655
656 pub fn set_delete_policy<T: Into<crate::model::delete_deployment_request::DeletePolicy>>(
658 mut self,
659 v: T,
660 ) -> Self {
661 self.0.request.delete_policy = v.into();
662 self
663 }
664 }
665
666 #[doc(hidden)]
667 impl crate::RequestBuilder for DeleteDeployment {
668 fn request_options(&mut self) -> &mut crate::RequestOptions {
669 &mut self.0.options
670 }
671 }
672
673 #[derive(Clone, Debug)]
694 pub struct ListRevisions(RequestBuilder<crate::model::ListRevisionsRequest>);
695
696 impl ListRevisions {
697 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
698 Self(RequestBuilder::new(stub))
699 }
700
701 pub fn with_request<V: Into<crate::model::ListRevisionsRequest>>(mut self, v: V) -> Self {
703 self.0.request = v.into();
704 self
705 }
706
707 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
709 self.0.options = v.into();
710 self
711 }
712
713 pub async fn send(self) -> Result<crate::model::ListRevisionsResponse> {
715 (*self.0.stub)
716 .list_revisions(self.0.request, self.0.options)
717 .await
718 .map(crate::Response::into_body)
719 }
720
721 pub fn by_page(
723 self,
724 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListRevisionsResponse, crate::Error>
725 {
726 use std::clone::Clone;
727 let token = self.0.request.page_token.clone();
728 let execute = move |token: String| {
729 let mut builder = self.clone();
730 builder.0.request = builder.0.request.set_page_token(token);
731 builder.send()
732 };
733 google_cloud_gax::paginator::internal::new_paginator(token, execute)
734 }
735
736 pub fn by_item(
738 self,
739 ) -> impl google_cloud_gax::paginator::ItemPaginator<
740 crate::model::ListRevisionsResponse,
741 crate::Error,
742 > {
743 use google_cloud_gax::paginator::Paginator;
744 self.by_page().items()
745 }
746
747 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
751 self.0.request.parent = v.into();
752 self
753 }
754
755 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
757 self.0.request.page_size = v.into();
758 self
759 }
760
761 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
763 self.0.request.page_token = v.into();
764 self
765 }
766
767 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
769 self.0.request.filter = v.into();
770 self
771 }
772
773 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
775 self.0.request.order_by = v.into();
776 self
777 }
778 }
779
780 #[doc(hidden)]
781 impl crate::RequestBuilder for ListRevisions {
782 fn request_options(&mut self) -> &mut crate::RequestOptions {
783 &mut self.0.options
784 }
785 }
786
787 #[derive(Clone, Debug)]
804 pub struct GetRevision(RequestBuilder<crate::model::GetRevisionRequest>);
805
806 impl GetRevision {
807 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
808 Self(RequestBuilder::new(stub))
809 }
810
811 pub fn with_request<V: Into<crate::model::GetRevisionRequest>>(mut self, v: V) -> Self {
813 self.0.request = v.into();
814 self
815 }
816
817 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
819 self.0.options = v.into();
820 self
821 }
822
823 pub async fn send(self) -> Result<crate::model::Revision> {
825 (*self.0.stub)
826 .get_revision(self.0.request, self.0.options)
827 .await
828 .map(crate::Response::into_body)
829 }
830
831 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
835 self.0.request.name = v.into();
836 self
837 }
838 }
839
840 #[doc(hidden)]
841 impl crate::RequestBuilder for GetRevision {
842 fn request_options(&mut self) -> &mut crate::RequestOptions {
843 &mut self.0.options
844 }
845 }
846
847 #[derive(Clone, Debug)]
864 pub struct GetResource(RequestBuilder<crate::model::GetResourceRequest>);
865
866 impl GetResource {
867 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
868 Self(RequestBuilder::new(stub))
869 }
870
871 pub fn with_request<V: Into<crate::model::GetResourceRequest>>(mut self, v: V) -> Self {
873 self.0.request = v.into();
874 self
875 }
876
877 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
879 self.0.options = v.into();
880 self
881 }
882
883 pub async fn send(self) -> Result<crate::model::Resource> {
885 (*self.0.stub)
886 .get_resource(self.0.request, self.0.options)
887 .await
888 .map(crate::Response::into_body)
889 }
890
891 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
895 self.0.request.name = v.into();
896 self
897 }
898 }
899
900 #[doc(hidden)]
901 impl crate::RequestBuilder for GetResource {
902 fn request_options(&mut self) -> &mut crate::RequestOptions {
903 &mut self.0.options
904 }
905 }
906
907 #[derive(Clone, Debug)]
928 pub struct ListResources(RequestBuilder<crate::model::ListResourcesRequest>);
929
930 impl ListResources {
931 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
932 Self(RequestBuilder::new(stub))
933 }
934
935 pub fn with_request<V: Into<crate::model::ListResourcesRequest>>(mut self, v: V) -> Self {
937 self.0.request = v.into();
938 self
939 }
940
941 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
943 self.0.options = v.into();
944 self
945 }
946
947 pub async fn send(self) -> Result<crate::model::ListResourcesResponse> {
949 (*self.0.stub)
950 .list_resources(self.0.request, self.0.options)
951 .await
952 .map(crate::Response::into_body)
953 }
954
955 pub fn by_page(
957 self,
958 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListResourcesResponse, crate::Error>
959 {
960 use std::clone::Clone;
961 let token = self.0.request.page_token.clone();
962 let execute = move |token: String| {
963 let mut builder = self.clone();
964 builder.0.request = builder.0.request.set_page_token(token);
965 builder.send()
966 };
967 google_cloud_gax::paginator::internal::new_paginator(token, execute)
968 }
969
970 pub fn by_item(
972 self,
973 ) -> impl google_cloud_gax::paginator::ItemPaginator<
974 crate::model::ListResourcesResponse,
975 crate::Error,
976 > {
977 use google_cloud_gax::paginator::Paginator;
978 self.by_page().items()
979 }
980
981 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
985 self.0.request.parent = v.into();
986 self
987 }
988
989 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
991 self.0.request.page_size = v.into();
992 self
993 }
994
995 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
997 self.0.request.page_token = v.into();
998 self
999 }
1000
1001 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1003 self.0.request.filter = v.into();
1004 self
1005 }
1006
1007 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1009 self.0.request.order_by = v.into();
1010 self
1011 }
1012 }
1013
1014 #[doc(hidden)]
1015 impl crate::RequestBuilder for ListResources {
1016 fn request_options(&mut self) -> &mut crate::RequestOptions {
1017 &mut self.0.options
1018 }
1019 }
1020
1021 #[derive(Clone, Debug)]
1038 pub struct ExportDeploymentStatefile(
1039 RequestBuilder<crate::model::ExportDeploymentStatefileRequest>,
1040 );
1041
1042 impl ExportDeploymentStatefile {
1043 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1044 Self(RequestBuilder::new(stub))
1045 }
1046
1047 pub fn with_request<V: Into<crate::model::ExportDeploymentStatefileRequest>>(
1049 mut self,
1050 v: V,
1051 ) -> Self {
1052 self.0.request = v.into();
1053 self
1054 }
1055
1056 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1058 self.0.options = v.into();
1059 self
1060 }
1061
1062 pub async fn send(self) -> Result<crate::model::Statefile> {
1064 (*self.0.stub)
1065 .export_deployment_statefile(self.0.request, self.0.options)
1066 .await
1067 .map(crate::Response::into_body)
1068 }
1069
1070 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1074 self.0.request.parent = v.into();
1075 self
1076 }
1077
1078 pub fn set_draft<T: Into<bool>>(mut self, v: T) -> Self {
1080 self.0.request.draft = v.into();
1081 self
1082 }
1083 }
1084
1085 #[doc(hidden)]
1086 impl crate::RequestBuilder for ExportDeploymentStatefile {
1087 fn request_options(&mut self) -> &mut crate::RequestOptions {
1088 &mut self.0.options
1089 }
1090 }
1091
1092 #[derive(Clone, Debug)]
1109 pub struct ExportRevisionStatefile(
1110 RequestBuilder<crate::model::ExportRevisionStatefileRequest>,
1111 );
1112
1113 impl ExportRevisionStatefile {
1114 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1115 Self(RequestBuilder::new(stub))
1116 }
1117
1118 pub fn with_request<V: Into<crate::model::ExportRevisionStatefileRequest>>(
1120 mut self,
1121 v: V,
1122 ) -> Self {
1123 self.0.request = v.into();
1124 self
1125 }
1126
1127 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1129 self.0.options = v.into();
1130 self
1131 }
1132
1133 pub async fn send(self) -> Result<crate::model::Statefile> {
1135 (*self.0.stub)
1136 .export_revision_statefile(self.0.request, self.0.options)
1137 .await
1138 .map(crate::Response::into_body)
1139 }
1140
1141 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1145 self.0.request.parent = v.into();
1146 self
1147 }
1148 }
1149
1150 #[doc(hidden)]
1151 impl crate::RequestBuilder for ExportRevisionStatefile {
1152 fn request_options(&mut self) -> &mut crate::RequestOptions {
1153 &mut self.0.options
1154 }
1155 }
1156
1157 #[derive(Clone, Debug)]
1174 pub struct ImportStatefile(RequestBuilder<crate::model::ImportStatefileRequest>);
1175
1176 impl ImportStatefile {
1177 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1178 Self(RequestBuilder::new(stub))
1179 }
1180
1181 pub fn with_request<V: Into<crate::model::ImportStatefileRequest>>(mut self, v: V) -> Self {
1183 self.0.request = v.into();
1184 self
1185 }
1186
1187 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1189 self.0.options = v.into();
1190 self
1191 }
1192
1193 pub async fn send(self) -> Result<crate::model::Statefile> {
1195 (*self.0.stub)
1196 .import_statefile(self.0.request, self.0.options)
1197 .await
1198 .map(crate::Response::into_body)
1199 }
1200
1201 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1205 self.0.request.parent = v.into();
1206 self
1207 }
1208
1209 pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1213 self.0.request.lock_id = v.into();
1214 self
1215 }
1216
1217 pub fn set_skip_draft<T: Into<bool>>(mut self, v: T) -> Self {
1219 self.0.request.skip_draft = v.into();
1220 self
1221 }
1222 }
1223
1224 #[doc(hidden)]
1225 impl crate::RequestBuilder for ImportStatefile {
1226 fn request_options(&mut self) -> &mut crate::RequestOptions {
1227 &mut self.0.options
1228 }
1229 }
1230
1231 #[derive(Clone, Debug)]
1248 pub struct DeleteStatefile(RequestBuilder<crate::model::DeleteStatefileRequest>);
1249
1250 impl DeleteStatefile {
1251 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1252 Self(RequestBuilder::new(stub))
1253 }
1254
1255 pub fn with_request<V: Into<crate::model::DeleteStatefileRequest>>(mut self, v: V) -> Self {
1257 self.0.request = v.into();
1258 self
1259 }
1260
1261 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1263 self.0.options = v.into();
1264 self
1265 }
1266
1267 pub async fn send(self) -> Result<()> {
1269 (*self.0.stub)
1270 .delete_statefile(self.0.request, self.0.options)
1271 .await
1272 .map(crate::Response::into_body)
1273 }
1274
1275 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1279 self.0.request.name = v.into();
1280 self
1281 }
1282
1283 pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1287 self.0.request.lock_id = v.into();
1288 self
1289 }
1290 }
1291
1292 #[doc(hidden)]
1293 impl crate::RequestBuilder for DeleteStatefile {
1294 fn request_options(&mut self) -> &mut crate::RequestOptions {
1295 &mut self.0.options
1296 }
1297 }
1298
1299 #[derive(Clone, Debug)]
1317 pub struct LockDeployment(RequestBuilder<crate::model::LockDeploymentRequest>);
1318
1319 impl LockDeployment {
1320 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1321 Self(RequestBuilder::new(stub))
1322 }
1323
1324 pub fn with_request<V: Into<crate::model::LockDeploymentRequest>>(mut self, v: V) -> Self {
1326 self.0.request = v.into();
1327 self
1328 }
1329
1330 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1332 self.0.options = v.into();
1333 self
1334 }
1335
1336 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1343 (*self.0.stub)
1344 .lock_deployment(self.0.request, self.0.options)
1345 .await
1346 .map(crate::Response::into_body)
1347 }
1348
1349 pub fn poller(
1351 self,
1352 ) -> impl google_cloud_lro::Poller<crate::model::Deployment, crate::model::OperationMetadata>
1353 {
1354 type Operation = google_cloud_lro::internal::Operation<
1355 crate::model::Deployment,
1356 crate::model::OperationMetadata,
1357 >;
1358 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1359 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1360
1361 let stub = self.0.stub.clone();
1362 let mut options = self.0.options.clone();
1363 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1364 let query = move |name| {
1365 let stub = stub.clone();
1366 let options = options.clone();
1367 async {
1368 let op = GetOperation::new(stub)
1369 .set_name(name)
1370 .with_options(options)
1371 .send()
1372 .await?;
1373 Ok(Operation::new(op))
1374 }
1375 };
1376
1377 let start = move || async {
1378 let op = self.send().await?;
1379 Ok(Operation::new(op))
1380 };
1381
1382 google_cloud_lro::internal::new_poller(
1383 polling_error_policy,
1384 polling_backoff_policy,
1385 start,
1386 query,
1387 )
1388 }
1389
1390 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1394 self.0.request.name = v.into();
1395 self
1396 }
1397 }
1398
1399 #[doc(hidden)]
1400 impl crate::RequestBuilder for LockDeployment {
1401 fn request_options(&mut self) -> &mut crate::RequestOptions {
1402 &mut self.0.options
1403 }
1404 }
1405
1406 #[derive(Clone, Debug)]
1424 pub struct UnlockDeployment(RequestBuilder<crate::model::UnlockDeploymentRequest>);
1425
1426 impl UnlockDeployment {
1427 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1428 Self(RequestBuilder::new(stub))
1429 }
1430
1431 pub fn with_request<V: Into<crate::model::UnlockDeploymentRequest>>(
1433 mut self,
1434 v: V,
1435 ) -> Self {
1436 self.0.request = v.into();
1437 self
1438 }
1439
1440 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1442 self.0.options = v.into();
1443 self
1444 }
1445
1446 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1453 (*self.0.stub)
1454 .unlock_deployment(self.0.request, self.0.options)
1455 .await
1456 .map(crate::Response::into_body)
1457 }
1458
1459 pub fn poller(
1461 self,
1462 ) -> impl google_cloud_lro::Poller<crate::model::Deployment, crate::model::OperationMetadata>
1463 {
1464 type Operation = google_cloud_lro::internal::Operation<
1465 crate::model::Deployment,
1466 crate::model::OperationMetadata,
1467 >;
1468 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1469 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1470
1471 let stub = self.0.stub.clone();
1472 let mut options = self.0.options.clone();
1473 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1474 let query = move |name| {
1475 let stub = stub.clone();
1476 let options = options.clone();
1477 async {
1478 let op = GetOperation::new(stub)
1479 .set_name(name)
1480 .with_options(options)
1481 .send()
1482 .await?;
1483 Ok(Operation::new(op))
1484 }
1485 };
1486
1487 let start = move || async {
1488 let op = self.send().await?;
1489 Ok(Operation::new(op))
1490 };
1491
1492 google_cloud_lro::internal::new_poller(
1493 polling_error_policy,
1494 polling_backoff_policy,
1495 start,
1496 query,
1497 )
1498 }
1499
1500 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1504 self.0.request.name = v.into();
1505 self
1506 }
1507
1508 pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1512 self.0.request.lock_id = v.into();
1513 self
1514 }
1515 }
1516
1517 #[doc(hidden)]
1518 impl crate::RequestBuilder for UnlockDeployment {
1519 fn request_options(&mut self) -> &mut crate::RequestOptions {
1520 &mut self.0.options
1521 }
1522 }
1523
1524 #[derive(Clone, Debug)]
1541 pub struct ExportLockInfo(RequestBuilder<crate::model::ExportLockInfoRequest>);
1542
1543 impl ExportLockInfo {
1544 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1545 Self(RequestBuilder::new(stub))
1546 }
1547
1548 pub fn with_request<V: Into<crate::model::ExportLockInfoRequest>>(mut self, v: V) -> Self {
1550 self.0.request = v.into();
1551 self
1552 }
1553
1554 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1556 self.0.options = v.into();
1557 self
1558 }
1559
1560 pub async fn send(self) -> Result<crate::model::LockInfo> {
1562 (*self.0.stub)
1563 .export_lock_info(self.0.request, self.0.options)
1564 .await
1565 .map(crate::Response::into_body)
1566 }
1567
1568 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1572 self.0.request.name = v.into();
1573 self
1574 }
1575 }
1576
1577 #[doc(hidden)]
1578 impl crate::RequestBuilder for ExportLockInfo {
1579 fn request_options(&mut self) -> &mut crate::RequestOptions {
1580 &mut self.0.options
1581 }
1582 }
1583
1584 #[derive(Clone, Debug)]
1602 pub struct CreatePreview(RequestBuilder<crate::model::CreatePreviewRequest>);
1603
1604 impl CreatePreview {
1605 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1606 Self(RequestBuilder::new(stub))
1607 }
1608
1609 pub fn with_request<V: Into<crate::model::CreatePreviewRequest>>(mut self, v: V) -> Self {
1611 self.0.request = v.into();
1612 self
1613 }
1614
1615 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1617 self.0.options = v.into();
1618 self
1619 }
1620
1621 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1628 (*self.0.stub)
1629 .create_preview(self.0.request, self.0.options)
1630 .await
1631 .map(crate::Response::into_body)
1632 }
1633
1634 pub fn poller(
1636 self,
1637 ) -> impl google_cloud_lro::Poller<crate::model::Preview, crate::model::OperationMetadata>
1638 {
1639 type Operation = google_cloud_lro::internal::Operation<
1640 crate::model::Preview,
1641 crate::model::OperationMetadata,
1642 >;
1643 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1644 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1645
1646 let stub = self.0.stub.clone();
1647 let mut options = self.0.options.clone();
1648 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1649 let query = move |name| {
1650 let stub = stub.clone();
1651 let options = options.clone();
1652 async {
1653 let op = GetOperation::new(stub)
1654 .set_name(name)
1655 .with_options(options)
1656 .send()
1657 .await?;
1658 Ok(Operation::new(op))
1659 }
1660 };
1661
1662 let start = move || async {
1663 let op = self.send().await?;
1664 Ok(Operation::new(op))
1665 };
1666
1667 google_cloud_lro::internal::new_poller(
1668 polling_error_policy,
1669 polling_backoff_policy,
1670 start,
1671 query,
1672 )
1673 }
1674
1675 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1679 self.0.request.parent = v.into();
1680 self
1681 }
1682
1683 pub fn set_preview_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1685 self.0.request.preview_id = v.into();
1686 self
1687 }
1688
1689 pub fn set_preview<T>(mut self, v: T) -> Self
1693 where
1694 T: std::convert::Into<crate::model::Preview>,
1695 {
1696 self.0.request.preview = std::option::Option::Some(v.into());
1697 self
1698 }
1699
1700 pub fn set_or_clear_preview<T>(mut self, v: std::option::Option<T>) -> Self
1704 where
1705 T: std::convert::Into<crate::model::Preview>,
1706 {
1707 self.0.request.preview = v.map(|x| x.into());
1708 self
1709 }
1710
1711 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1713 self.0.request.request_id = v.into();
1714 self
1715 }
1716 }
1717
1718 #[doc(hidden)]
1719 impl crate::RequestBuilder for CreatePreview {
1720 fn request_options(&mut self) -> &mut crate::RequestOptions {
1721 &mut self.0.options
1722 }
1723 }
1724
1725 #[derive(Clone, Debug)]
1742 pub struct GetPreview(RequestBuilder<crate::model::GetPreviewRequest>);
1743
1744 impl GetPreview {
1745 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1746 Self(RequestBuilder::new(stub))
1747 }
1748
1749 pub fn with_request<V: Into<crate::model::GetPreviewRequest>>(mut self, v: V) -> Self {
1751 self.0.request = v.into();
1752 self
1753 }
1754
1755 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1757 self.0.options = v.into();
1758 self
1759 }
1760
1761 pub async fn send(self) -> Result<crate::model::Preview> {
1763 (*self.0.stub)
1764 .get_preview(self.0.request, self.0.options)
1765 .await
1766 .map(crate::Response::into_body)
1767 }
1768
1769 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1773 self.0.request.name = v.into();
1774 self
1775 }
1776 }
1777
1778 #[doc(hidden)]
1779 impl crate::RequestBuilder for GetPreview {
1780 fn request_options(&mut self) -> &mut crate::RequestOptions {
1781 &mut self.0.options
1782 }
1783 }
1784
1785 #[derive(Clone, Debug)]
1806 pub struct ListPreviews(RequestBuilder<crate::model::ListPreviewsRequest>);
1807
1808 impl ListPreviews {
1809 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1810 Self(RequestBuilder::new(stub))
1811 }
1812
1813 pub fn with_request<V: Into<crate::model::ListPreviewsRequest>>(mut self, v: V) -> Self {
1815 self.0.request = v.into();
1816 self
1817 }
1818
1819 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1821 self.0.options = v.into();
1822 self
1823 }
1824
1825 pub async fn send(self) -> Result<crate::model::ListPreviewsResponse> {
1827 (*self.0.stub)
1828 .list_previews(self.0.request, self.0.options)
1829 .await
1830 .map(crate::Response::into_body)
1831 }
1832
1833 pub fn by_page(
1835 self,
1836 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListPreviewsResponse, crate::Error>
1837 {
1838 use std::clone::Clone;
1839 let token = self.0.request.page_token.clone();
1840 let execute = move |token: String| {
1841 let mut builder = self.clone();
1842 builder.0.request = builder.0.request.set_page_token(token);
1843 builder.send()
1844 };
1845 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1846 }
1847
1848 pub fn by_item(
1850 self,
1851 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1852 crate::model::ListPreviewsResponse,
1853 crate::Error,
1854 > {
1855 use google_cloud_gax::paginator::Paginator;
1856 self.by_page().items()
1857 }
1858
1859 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1863 self.0.request.parent = v.into();
1864 self
1865 }
1866
1867 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1869 self.0.request.page_size = v.into();
1870 self
1871 }
1872
1873 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1875 self.0.request.page_token = v.into();
1876 self
1877 }
1878
1879 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1881 self.0.request.filter = v.into();
1882 self
1883 }
1884
1885 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1887 self.0.request.order_by = v.into();
1888 self
1889 }
1890 }
1891
1892 #[doc(hidden)]
1893 impl crate::RequestBuilder for ListPreviews {
1894 fn request_options(&mut self) -> &mut crate::RequestOptions {
1895 &mut self.0.options
1896 }
1897 }
1898
1899 #[derive(Clone, Debug)]
1917 pub struct DeletePreview(RequestBuilder<crate::model::DeletePreviewRequest>);
1918
1919 impl DeletePreview {
1920 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1921 Self(RequestBuilder::new(stub))
1922 }
1923
1924 pub fn with_request<V: Into<crate::model::DeletePreviewRequest>>(mut self, v: V) -> Self {
1926 self.0.request = v.into();
1927 self
1928 }
1929
1930 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1932 self.0.options = v.into();
1933 self
1934 }
1935
1936 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1943 (*self.0.stub)
1944 .delete_preview(self.0.request, self.0.options)
1945 .await
1946 .map(crate::Response::into_body)
1947 }
1948
1949 pub fn poller(
1951 self,
1952 ) -> impl google_cloud_lro::Poller<crate::model::Preview, crate::model::OperationMetadata>
1953 {
1954 type Operation = google_cloud_lro::internal::Operation<
1955 crate::model::Preview,
1956 crate::model::OperationMetadata,
1957 >;
1958 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1959 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1960
1961 let stub = self.0.stub.clone();
1962 let mut options = self.0.options.clone();
1963 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1964 let query = move |name| {
1965 let stub = stub.clone();
1966 let options = options.clone();
1967 async {
1968 let op = GetOperation::new(stub)
1969 .set_name(name)
1970 .with_options(options)
1971 .send()
1972 .await?;
1973 Ok(Operation::new(op))
1974 }
1975 };
1976
1977 let start = move || async {
1978 let op = self.send().await?;
1979 Ok(Operation::new(op))
1980 };
1981
1982 google_cloud_lro::internal::new_poller(
1983 polling_error_policy,
1984 polling_backoff_policy,
1985 start,
1986 query,
1987 )
1988 }
1989
1990 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1994 self.0.request.name = v.into();
1995 self
1996 }
1997
1998 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2000 self.0.request.request_id = v.into();
2001 self
2002 }
2003 }
2004
2005 #[doc(hidden)]
2006 impl crate::RequestBuilder for DeletePreview {
2007 fn request_options(&mut self) -> &mut crate::RequestOptions {
2008 &mut self.0.options
2009 }
2010 }
2011
2012 #[derive(Clone, Debug)]
2029 pub struct ExportPreviewResult(RequestBuilder<crate::model::ExportPreviewResultRequest>);
2030
2031 impl ExportPreviewResult {
2032 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2033 Self(RequestBuilder::new(stub))
2034 }
2035
2036 pub fn with_request<V: Into<crate::model::ExportPreviewResultRequest>>(
2038 mut self,
2039 v: V,
2040 ) -> Self {
2041 self.0.request = v.into();
2042 self
2043 }
2044
2045 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2047 self.0.options = v.into();
2048 self
2049 }
2050
2051 pub async fn send(self) -> Result<crate::model::ExportPreviewResultResponse> {
2053 (*self.0.stub)
2054 .export_preview_result(self.0.request, self.0.options)
2055 .await
2056 .map(crate::Response::into_body)
2057 }
2058
2059 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2063 self.0.request.parent = v.into();
2064 self
2065 }
2066 }
2067
2068 #[doc(hidden)]
2069 impl crate::RequestBuilder for ExportPreviewResult {
2070 fn request_options(&mut self) -> &mut crate::RequestOptions {
2071 &mut self.0.options
2072 }
2073 }
2074
2075 #[derive(Clone, Debug)]
2096 pub struct ListTerraformVersions(RequestBuilder<crate::model::ListTerraformVersionsRequest>);
2097
2098 impl ListTerraformVersions {
2099 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2100 Self(RequestBuilder::new(stub))
2101 }
2102
2103 pub fn with_request<V: Into<crate::model::ListTerraformVersionsRequest>>(
2105 mut self,
2106 v: V,
2107 ) -> Self {
2108 self.0.request = v.into();
2109 self
2110 }
2111
2112 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2114 self.0.options = v.into();
2115 self
2116 }
2117
2118 pub async fn send(self) -> Result<crate::model::ListTerraformVersionsResponse> {
2120 (*self.0.stub)
2121 .list_terraform_versions(self.0.request, self.0.options)
2122 .await
2123 .map(crate::Response::into_body)
2124 }
2125
2126 pub fn by_page(
2128 self,
2129 ) -> impl google_cloud_gax::paginator::Paginator<
2130 crate::model::ListTerraformVersionsResponse,
2131 crate::Error,
2132 > {
2133 use std::clone::Clone;
2134 let token = self.0.request.page_token.clone();
2135 let execute = move |token: String| {
2136 let mut builder = self.clone();
2137 builder.0.request = builder.0.request.set_page_token(token);
2138 builder.send()
2139 };
2140 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2141 }
2142
2143 pub fn by_item(
2145 self,
2146 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2147 crate::model::ListTerraformVersionsResponse,
2148 crate::Error,
2149 > {
2150 use google_cloud_gax::paginator::Paginator;
2151 self.by_page().items()
2152 }
2153
2154 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2158 self.0.request.parent = v.into();
2159 self
2160 }
2161
2162 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2164 self.0.request.page_size = v.into();
2165 self
2166 }
2167
2168 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2170 self.0.request.page_token = v.into();
2171 self
2172 }
2173
2174 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2176 self.0.request.filter = v.into();
2177 self
2178 }
2179
2180 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2182 self.0.request.order_by = v.into();
2183 self
2184 }
2185 }
2186
2187 #[doc(hidden)]
2188 impl crate::RequestBuilder for ListTerraformVersions {
2189 fn request_options(&mut self) -> &mut crate::RequestOptions {
2190 &mut self.0.options
2191 }
2192 }
2193
2194 #[derive(Clone, Debug)]
2211 pub struct GetTerraformVersion(RequestBuilder<crate::model::GetTerraformVersionRequest>);
2212
2213 impl GetTerraformVersion {
2214 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2215 Self(RequestBuilder::new(stub))
2216 }
2217
2218 pub fn with_request<V: Into<crate::model::GetTerraformVersionRequest>>(
2220 mut self,
2221 v: V,
2222 ) -> Self {
2223 self.0.request = v.into();
2224 self
2225 }
2226
2227 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2229 self.0.options = v.into();
2230 self
2231 }
2232
2233 pub async fn send(self) -> Result<crate::model::TerraformVersion> {
2235 (*self.0.stub)
2236 .get_terraform_version(self.0.request, self.0.options)
2237 .await
2238 .map(crate::Response::into_body)
2239 }
2240
2241 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2245 self.0.request.name = v.into();
2246 self
2247 }
2248 }
2249
2250 #[doc(hidden)]
2251 impl crate::RequestBuilder for GetTerraformVersion {
2252 fn request_options(&mut self) -> &mut crate::RequestOptions {
2253 &mut self.0.options
2254 }
2255 }
2256
2257 #[derive(Clone, Debug)]
2278 pub struct ListResourceChanges(RequestBuilder<crate::model::ListResourceChangesRequest>);
2279
2280 impl ListResourceChanges {
2281 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2282 Self(RequestBuilder::new(stub))
2283 }
2284
2285 pub fn with_request<V: Into<crate::model::ListResourceChangesRequest>>(
2287 mut self,
2288 v: V,
2289 ) -> Self {
2290 self.0.request = v.into();
2291 self
2292 }
2293
2294 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2296 self.0.options = v.into();
2297 self
2298 }
2299
2300 pub async fn send(self) -> Result<crate::model::ListResourceChangesResponse> {
2302 (*self.0.stub)
2303 .list_resource_changes(self.0.request, self.0.options)
2304 .await
2305 .map(crate::Response::into_body)
2306 }
2307
2308 pub fn by_page(
2310 self,
2311 ) -> impl google_cloud_gax::paginator::Paginator<
2312 crate::model::ListResourceChangesResponse,
2313 crate::Error,
2314 > {
2315 use std::clone::Clone;
2316 let token = self.0.request.page_token.clone();
2317 let execute = move |token: String| {
2318 let mut builder = self.clone();
2319 builder.0.request = builder.0.request.set_page_token(token);
2320 builder.send()
2321 };
2322 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2323 }
2324
2325 pub fn by_item(
2327 self,
2328 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2329 crate::model::ListResourceChangesResponse,
2330 crate::Error,
2331 > {
2332 use google_cloud_gax::paginator::Paginator;
2333 self.by_page().items()
2334 }
2335
2336 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2340 self.0.request.parent = v.into();
2341 self
2342 }
2343
2344 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2346 self.0.request.page_size = v.into();
2347 self
2348 }
2349
2350 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2352 self.0.request.page_token = v.into();
2353 self
2354 }
2355
2356 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2358 self.0.request.filter = v.into();
2359 self
2360 }
2361
2362 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2364 self.0.request.order_by = v.into();
2365 self
2366 }
2367 }
2368
2369 #[doc(hidden)]
2370 impl crate::RequestBuilder for ListResourceChanges {
2371 fn request_options(&mut self) -> &mut crate::RequestOptions {
2372 &mut self.0.options
2373 }
2374 }
2375
2376 #[derive(Clone, Debug)]
2393 pub struct GetResourceChange(RequestBuilder<crate::model::GetResourceChangeRequest>);
2394
2395 impl GetResourceChange {
2396 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2397 Self(RequestBuilder::new(stub))
2398 }
2399
2400 pub fn with_request<V: Into<crate::model::GetResourceChangeRequest>>(
2402 mut self,
2403 v: V,
2404 ) -> Self {
2405 self.0.request = v.into();
2406 self
2407 }
2408
2409 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2411 self.0.options = v.into();
2412 self
2413 }
2414
2415 pub async fn send(self) -> Result<crate::model::ResourceChange> {
2417 (*self.0.stub)
2418 .get_resource_change(self.0.request, self.0.options)
2419 .await
2420 .map(crate::Response::into_body)
2421 }
2422
2423 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2427 self.0.request.name = v.into();
2428 self
2429 }
2430 }
2431
2432 #[doc(hidden)]
2433 impl crate::RequestBuilder for GetResourceChange {
2434 fn request_options(&mut self) -> &mut crate::RequestOptions {
2435 &mut self.0.options
2436 }
2437 }
2438
2439 #[derive(Clone, Debug)]
2460 pub struct ListResourceDrifts(RequestBuilder<crate::model::ListResourceDriftsRequest>);
2461
2462 impl ListResourceDrifts {
2463 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2464 Self(RequestBuilder::new(stub))
2465 }
2466
2467 pub fn with_request<V: Into<crate::model::ListResourceDriftsRequest>>(
2469 mut self,
2470 v: V,
2471 ) -> Self {
2472 self.0.request = v.into();
2473 self
2474 }
2475
2476 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2478 self.0.options = v.into();
2479 self
2480 }
2481
2482 pub async fn send(self) -> Result<crate::model::ListResourceDriftsResponse> {
2484 (*self.0.stub)
2485 .list_resource_drifts(self.0.request, self.0.options)
2486 .await
2487 .map(crate::Response::into_body)
2488 }
2489
2490 pub fn by_page(
2492 self,
2493 ) -> impl google_cloud_gax::paginator::Paginator<
2494 crate::model::ListResourceDriftsResponse,
2495 crate::Error,
2496 > {
2497 use std::clone::Clone;
2498 let token = self.0.request.page_token.clone();
2499 let execute = move |token: String| {
2500 let mut builder = self.clone();
2501 builder.0.request = builder.0.request.set_page_token(token);
2502 builder.send()
2503 };
2504 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2505 }
2506
2507 pub fn by_item(
2509 self,
2510 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2511 crate::model::ListResourceDriftsResponse,
2512 crate::Error,
2513 > {
2514 use google_cloud_gax::paginator::Paginator;
2515 self.by_page().items()
2516 }
2517
2518 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2522 self.0.request.parent = v.into();
2523 self
2524 }
2525
2526 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2528 self.0.request.page_size = v.into();
2529 self
2530 }
2531
2532 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2534 self.0.request.page_token = v.into();
2535 self
2536 }
2537
2538 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2540 self.0.request.filter = v.into();
2541 self
2542 }
2543
2544 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2546 self.0.request.order_by = v.into();
2547 self
2548 }
2549 }
2550
2551 #[doc(hidden)]
2552 impl crate::RequestBuilder for ListResourceDrifts {
2553 fn request_options(&mut self) -> &mut crate::RequestOptions {
2554 &mut self.0.options
2555 }
2556 }
2557
2558 #[derive(Clone, Debug)]
2575 pub struct GetResourceDrift(RequestBuilder<crate::model::GetResourceDriftRequest>);
2576
2577 impl GetResourceDrift {
2578 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2579 Self(RequestBuilder::new(stub))
2580 }
2581
2582 pub fn with_request<V: Into<crate::model::GetResourceDriftRequest>>(
2584 mut self,
2585 v: V,
2586 ) -> Self {
2587 self.0.request = v.into();
2588 self
2589 }
2590
2591 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2593 self.0.options = v.into();
2594 self
2595 }
2596
2597 pub async fn send(self) -> Result<crate::model::ResourceDrift> {
2599 (*self.0.stub)
2600 .get_resource_drift(self.0.request, self.0.options)
2601 .await
2602 .map(crate::Response::into_body)
2603 }
2604
2605 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2609 self.0.request.name = v.into();
2610 self
2611 }
2612 }
2613
2614 #[doc(hidden)]
2615 impl crate::RequestBuilder for GetResourceDrift {
2616 fn request_options(&mut self) -> &mut crate::RequestOptions {
2617 &mut self.0.options
2618 }
2619 }
2620
2621 #[derive(Clone, Debug)]
2638 pub struct GetAutoMigrationConfig(RequestBuilder<crate::model::GetAutoMigrationConfigRequest>);
2639
2640 impl GetAutoMigrationConfig {
2641 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2642 Self(RequestBuilder::new(stub))
2643 }
2644
2645 pub fn with_request<V: Into<crate::model::GetAutoMigrationConfigRequest>>(
2647 mut self,
2648 v: V,
2649 ) -> Self {
2650 self.0.request = v.into();
2651 self
2652 }
2653
2654 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2656 self.0.options = v.into();
2657 self
2658 }
2659
2660 pub async fn send(self) -> Result<crate::model::AutoMigrationConfig> {
2662 (*self.0.stub)
2663 .get_auto_migration_config(self.0.request, self.0.options)
2664 .await
2665 .map(crate::Response::into_body)
2666 }
2667
2668 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2672 self.0.request.name = v.into();
2673 self
2674 }
2675 }
2676
2677 #[doc(hidden)]
2678 impl crate::RequestBuilder for GetAutoMigrationConfig {
2679 fn request_options(&mut self) -> &mut crate::RequestOptions {
2680 &mut self.0.options
2681 }
2682 }
2683
2684 #[derive(Clone, Debug)]
2702 pub struct UpdateAutoMigrationConfig(
2703 RequestBuilder<crate::model::UpdateAutoMigrationConfigRequest>,
2704 );
2705
2706 impl UpdateAutoMigrationConfig {
2707 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2708 Self(RequestBuilder::new(stub))
2709 }
2710
2711 pub fn with_request<V: Into<crate::model::UpdateAutoMigrationConfigRequest>>(
2713 mut self,
2714 v: V,
2715 ) -> Self {
2716 self.0.request = v.into();
2717 self
2718 }
2719
2720 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2722 self.0.options = v.into();
2723 self
2724 }
2725
2726 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2733 (*self.0.stub)
2734 .update_auto_migration_config(self.0.request, self.0.options)
2735 .await
2736 .map(crate::Response::into_body)
2737 }
2738
2739 pub fn poller(
2741 self,
2742 ) -> impl google_cloud_lro::Poller<
2743 crate::model::AutoMigrationConfig,
2744 crate::model::OperationMetadata,
2745 > {
2746 type Operation = google_cloud_lro::internal::Operation<
2747 crate::model::AutoMigrationConfig,
2748 crate::model::OperationMetadata,
2749 >;
2750 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2751 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2752
2753 let stub = self.0.stub.clone();
2754 let mut options = self.0.options.clone();
2755 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2756 let query = move |name| {
2757 let stub = stub.clone();
2758 let options = options.clone();
2759 async {
2760 let op = GetOperation::new(stub)
2761 .set_name(name)
2762 .with_options(options)
2763 .send()
2764 .await?;
2765 Ok(Operation::new(op))
2766 }
2767 };
2768
2769 let start = move || async {
2770 let op = self.send().await?;
2771 Ok(Operation::new(op))
2772 };
2773
2774 google_cloud_lro::internal::new_poller(
2775 polling_error_policy,
2776 polling_backoff_policy,
2777 start,
2778 query,
2779 )
2780 }
2781
2782 pub fn set_update_mask<T>(mut self, v: T) -> Self
2784 where
2785 T: std::convert::Into<wkt::FieldMask>,
2786 {
2787 self.0.request.update_mask = std::option::Option::Some(v.into());
2788 self
2789 }
2790
2791 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2793 where
2794 T: std::convert::Into<wkt::FieldMask>,
2795 {
2796 self.0.request.update_mask = v.map(|x| x.into());
2797 self
2798 }
2799
2800 pub fn set_auto_migration_config<T>(mut self, v: T) -> Self
2804 where
2805 T: std::convert::Into<crate::model::AutoMigrationConfig>,
2806 {
2807 self.0.request.auto_migration_config = std::option::Option::Some(v.into());
2808 self
2809 }
2810
2811 pub fn set_or_clear_auto_migration_config<T>(mut self, v: std::option::Option<T>) -> Self
2815 where
2816 T: std::convert::Into<crate::model::AutoMigrationConfig>,
2817 {
2818 self.0.request.auto_migration_config = v.map(|x| x.into());
2819 self
2820 }
2821 }
2822
2823 #[doc(hidden)]
2824 impl crate::RequestBuilder for UpdateAutoMigrationConfig {
2825 fn request_options(&mut self) -> &mut crate::RequestOptions {
2826 &mut self.0.options
2827 }
2828 }
2829
2830 #[derive(Clone, Debug)]
2847 pub struct GetDeploymentGroup(RequestBuilder<crate::model::GetDeploymentGroupRequest>);
2848
2849 impl GetDeploymentGroup {
2850 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2851 Self(RequestBuilder::new(stub))
2852 }
2853
2854 pub fn with_request<V: Into<crate::model::GetDeploymentGroupRequest>>(
2856 mut self,
2857 v: V,
2858 ) -> Self {
2859 self.0.request = v.into();
2860 self
2861 }
2862
2863 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2865 self.0.options = v.into();
2866 self
2867 }
2868
2869 pub async fn send(self) -> Result<crate::model::DeploymentGroup> {
2871 (*self.0.stub)
2872 .get_deployment_group(self.0.request, self.0.options)
2873 .await
2874 .map(crate::Response::into_body)
2875 }
2876
2877 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2881 self.0.request.name = v.into();
2882 self
2883 }
2884 }
2885
2886 #[doc(hidden)]
2887 impl crate::RequestBuilder for GetDeploymentGroup {
2888 fn request_options(&mut self) -> &mut crate::RequestOptions {
2889 &mut self.0.options
2890 }
2891 }
2892
2893 #[derive(Clone, Debug)]
2911 pub struct CreateDeploymentGroup(RequestBuilder<crate::model::CreateDeploymentGroupRequest>);
2912
2913 impl CreateDeploymentGroup {
2914 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2915 Self(RequestBuilder::new(stub))
2916 }
2917
2918 pub fn with_request<V: Into<crate::model::CreateDeploymentGroupRequest>>(
2920 mut self,
2921 v: V,
2922 ) -> Self {
2923 self.0.request = v.into();
2924 self
2925 }
2926
2927 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2929 self.0.options = v.into();
2930 self
2931 }
2932
2933 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2940 (*self.0.stub)
2941 .create_deployment_group(self.0.request, self.0.options)
2942 .await
2943 .map(crate::Response::into_body)
2944 }
2945
2946 pub fn poller(
2948 self,
2949 ) -> impl google_cloud_lro::Poller<crate::model::DeploymentGroup, crate::model::OperationMetadata>
2950 {
2951 type Operation = google_cloud_lro::internal::Operation<
2952 crate::model::DeploymentGroup,
2953 crate::model::OperationMetadata,
2954 >;
2955 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2956 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2957
2958 let stub = self.0.stub.clone();
2959 let mut options = self.0.options.clone();
2960 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2961 let query = move |name| {
2962 let stub = stub.clone();
2963 let options = options.clone();
2964 async {
2965 let op = GetOperation::new(stub)
2966 .set_name(name)
2967 .with_options(options)
2968 .send()
2969 .await?;
2970 Ok(Operation::new(op))
2971 }
2972 };
2973
2974 let start = move || async {
2975 let op = self.send().await?;
2976 Ok(Operation::new(op))
2977 };
2978
2979 google_cloud_lro::internal::new_poller(
2980 polling_error_policy,
2981 polling_backoff_policy,
2982 start,
2983 query,
2984 )
2985 }
2986
2987 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2991 self.0.request.parent = v.into();
2992 self
2993 }
2994
2995 pub fn set_deployment_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2999 self.0.request.deployment_group_id = v.into();
3000 self
3001 }
3002
3003 pub fn set_deployment_group<T>(mut self, v: T) -> Self
3007 where
3008 T: std::convert::Into<crate::model::DeploymentGroup>,
3009 {
3010 self.0.request.deployment_group = std::option::Option::Some(v.into());
3011 self
3012 }
3013
3014 pub fn set_or_clear_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
3018 where
3019 T: std::convert::Into<crate::model::DeploymentGroup>,
3020 {
3021 self.0.request.deployment_group = v.map(|x| x.into());
3022 self
3023 }
3024
3025 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3027 self.0.request.request_id = v.into();
3028 self
3029 }
3030 }
3031
3032 #[doc(hidden)]
3033 impl crate::RequestBuilder for CreateDeploymentGroup {
3034 fn request_options(&mut self) -> &mut crate::RequestOptions {
3035 &mut self.0.options
3036 }
3037 }
3038
3039 #[derive(Clone, Debug)]
3057 pub struct UpdateDeploymentGroup(RequestBuilder<crate::model::UpdateDeploymentGroupRequest>);
3058
3059 impl UpdateDeploymentGroup {
3060 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3061 Self(RequestBuilder::new(stub))
3062 }
3063
3064 pub fn with_request<V: Into<crate::model::UpdateDeploymentGroupRequest>>(
3066 mut self,
3067 v: V,
3068 ) -> Self {
3069 self.0.request = v.into();
3070 self
3071 }
3072
3073 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3075 self.0.options = v.into();
3076 self
3077 }
3078
3079 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3086 (*self.0.stub)
3087 .update_deployment_group(self.0.request, self.0.options)
3088 .await
3089 .map(crate::Response::into_body)
3090 }
3091
3092 pub fn poller(
3094 self,
3095 ) -> impl google_cloud_lro::Poller<crate::model::DeploymentGroup, crate::model::OperationMetadata>
3096 {
3097 type Operation = google_cloud_lro::internal::Operation<
3098 crate::model::DeploymentGroup,
3099 crate::model::OperationMetadata,
3100 >;
3101 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3102 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3103
3104 let stub = self.0.stub.clone();
3105 let mut options = self.0.options.clone();
3106 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3107 let query = move |name| {
3108 let stub = stub.clone();
3109 let options = options.clone();
3110 async {
3111 let op = GetOperation::new(stub)
3112 .set_name(name)
3113 .with_options(options)
3114 .send()
3115 .await?;
3116 Ok(Operation::new(op))
3117 }
3118 };
3119
3120 let start = move || async {
3121 let op = self.send().await?;
3122 Ok(Operation::new(op))
3123 };
3124
3125 google_cloud_lro::internal::new_poller(
3126 polling_error_policy,
3127 polling_backoff_policy,
3128 start,
3129 query,
3130 )
3131 }
3132
3133 pub fn set_update_mask<T>(mut self, v: T) -> Self
3135 where
3136 T: std::convert::Into<wkt::FieldMask>,
3137 {
3138 self.0.request.update_mask = std::option::Option::Some(v.into());
3139 self
3140 }
3141
3142 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3144 where
3145 T: std::convert::Into<wkt::FieldMask>,
3146 {
3147 self.0.request.update_mask = v.map(|x| x.into());
3148 self
3149 }
3150
3151 pub fn set_deployment_group<T>(mut self, v: T) -> Self
3155 where
3156 T: std::convert::Into<crate::model::DeploymentGroup>,
3157 {
3158 self.0.request.deployment_group = std::option::Option::Some(v.into());
3159 self
3160 }
3161
3162 pub fn set_or_clear_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
3166 where
3167 T: std::convert::Into<crate::model::DeploymentGroup>,
3168 {
3169 self.0.request.deployment_group = v.map(|x| x.into());
3170 self
3171 }
3172
3173 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3175 self.0.request.request_id = v.into();
3176 self
3177 }
3178 }
3179
3180 #[doc(hidden)]
3181 impl crate::RequestBuilder for UpdateDeploymentGroup {
3182 fn request_options(&mut self) -> &mut crate::RequestOptions {
3183 &mut self.0.options
3184 }
3185 }
3186
3187 #[derive(Clone, Debug)]
3205 pub struct DeleteDeploymentGroup(RequestBuilder<crate::model::DeleteDeploymentGroupRequest>);
3206
3207 impl DeleteDeploymentGroup {
3208 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3209 Self(RequestBuilder::new(stub))
3210 }
3211
3212 pub fn with_request<V: Into<crate::model::DeleteDeploymentGroupRequest>>(
3214 mut self,
3215 v: V,
3216 ) -> Self {
3217 self.0.request = v.into();
3218 self
3219 }
3220
3221 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3223 self.0.options = v.into();
3224 self
3225 }
3226
3227 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3234 (*self.0.stub)
3235 .delete_deployment_group(self.0.request, self.0.options)
3236 .await
3237 .map(crate::Response::into_body)
3238 }
3239
3240 pub fn poller(
3242 self,
3243 ) -> impl google_cloud_lro::Poller<crate::model::DeploymentGroup, crate::model::OperationMetadata>
3244 {
3245 type Operation = google_cloud_lro::internal::Operation<
3246 crate::model::DeploymentGroup,
3247 crate::model::OperationMetadata,
3248 >;
3249 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3250 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3251
3252 let stub = self.0.stub.clone();
3253 let mut options = self.0.options.clone();
3254 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3255 let query = move |name| {
3256 let stub = stub.clone();
3257 let options = options.clone();
3258 async {
3259 let op = GetOperation::new(stub)
3260 .set_name(name)
3261 .with_options(options)
3262 .send()
3263 .await?;
3264 Ok(Operation::new(op))
3265 }
3266 };
3267
3268 let start = move || async {
3269 let op = self.send().await?;
3270 Ok(Operation::new(op))
3271 };
3272
3273 google_cloud_lro::internal::new_poller(
3274 polling_error_policy,
3275 polling_backoff_policy,
3276 start,
3277 query,
3278 )
3279 }
3280
3281 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3285 self.0.request.name = v.into();
3286 self
3287 }
3288
3289 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3291 self.0.request.request_id = v.into();
3292 self
3293 }
3294
3295 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3297 self.0.request.force = v.into();
3298 self
3299 }
3300
3301 pub fn set_deployment_reference_policy<
3303 T: Into<crate::model::delete_deployment_group_request::DeploymentReferencePolicy>,
3304 >(
3305 mut self,
3306 v: T,
3307 ) -> Self {
3308 self.0.request.deployment_reference_policy = v.into();
3309 self
3310 }
3311 }
3312
3313 #[doc(hidden)]
3314 impl crate::RequestBuilder for DeleteDeploymentGroup {
3315 fn request_options(&mut self) -> &mut crate::RequestOptions {
3316 &mut self.0.options
3317 }
3318 }
3319
3320 #[derive(Clone, Debug)]
3341 pub struct ListDeploymentGroups(RequestBuilder<crate::model::ListDeploymentGroupsRequest>);
3342
3343 impl ListDeploymentGroups {
3344 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3345 Self(RequestBuilder::new(stub))
3346 }
3347
3348 pub fn with_request<V: Into<crate::model::ListDeploymentGroupsRequest>>(
3350 mut self,
3351 v: V,
3352 ) -> Self {
3353 self.0.request = v.into();
3354 self
3355 }
3356
3357 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3359 self.0.options = v.into();
3360 self
3361 }
3362
3363 pub async fn send(self) -> Result<crate::model::ListDeploymentGroupsResponse> {
3365 (*self.0.stub)
3366 .list_deployment_groups(self.0.request, self.0.options)
3367 .await
3368 .map(crate::Response::into_body)
3369 }
3370
3371 pub fn by_page(
3373 self,
3374 ) -> impl google_cloud_gax::paginator::Paginator<
3375 crate::model::ListDeploymentGroupsResponse,
3376 crate::Error,
3377 > {
3378 use std::clone::Clone;
3379 let token = self.0.request.page_token.clone();
3380 let execute = move |token: String| {
3381 let mut builder = self.clone();
3382 builder.0.request = builder.0.request.set_page_token(token);
3383 builder.send()
3384 };
3385 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3386 }
3387
3388 pub fn by_item(
3390 self,
3391 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3392 crate::model::ListDeploymentGroupsResponse,
3393 crate::Error,
3394 > {
3395 use google_cloud_gax::paginator::Paginator;
3396 self.by_page().items()
3397 }
3398
3399 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3403 self.0.request.parent = v.into();
3404 self
3405 }
3406
3407 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3409 self.0.request.page_size = v.into();
3410 self
3411 }
3412
3413 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3415 self.0.request.page_token = v.into();
3416 self
3417 }
3418
3419 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3421 self.0.request.filter = v.into();
3422 self
3423 }
3424
3425 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3427 self.0.request.order_by = v.into();
3428 self
3429 }
3430 }
3431
3432 #[doc(hidden)]
3433 impl crate::RequestBuilder for ListDeploymentGroups {
3434 fn request_options(&mut self) -> &mut crate::RequestOptions {
3435 &mut self.0.options
3436 }
3437 }
3438
3439 #[derive(Clone, Debug)]
3457 pub struct ProvisionDeploymentGroup(
3458 RequestBuilder<crate::model::ProvisionDeploymentGroupRequest>,
3459 );
3460
3461 impl ProvisionDeploymentGroup {
3462 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3463 Self(RequestBuilder::new(stub))
3464 }
3465
3466 pub fn with_request<V: Into<crate::model::ProvisionDeploymentGroupRequest>>(
3468 mut self,
3469 v: V,
3470 ) -> Self {
3471 self.0.request = v.into();
3472 self
3473 }
3474
3475 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3477 self.0.options = v.into();
3478 self
3479 }
3480
3481 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3488 (*self.0.stub)
3489 .provision_deployment_group(self.0.request, self.0.options)
3490 .await
3491 .map(crate::Response::into_body)
3492 }
3493
3494 pub fn poller(
3496 self,
3497 ) -> impl google_cloud_lro::Poller<crate::model::DeploymentGroup, crate::model::OperationMetadata>
3498 {
3499 type Operation = google_cloud_lro::internal::Operation<
3500 crate::model::DeploymentGroup,
3501 crate::model::OperationMetadata,
3502 >;
3503 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3504 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3505
3506 let stub = self.0.stub.clone();
3507 let mut options = self.0.options.clone();
3508 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3509 let query = move |name| {
3510 let stub = stub.clone();
3511 let options = options.clone();
3512 async {
3513 let op = GetOperation::new(stub)
3514 .set_name(name)
3515 .with_options(options)
3516 .send()
3517 .await?;
3518 Ok(Operation::new(op))
3519 }
3520 };
3521
3522 let start = move || async {
3523 let op = self.send().await?;
3524 Ok(Operation::new(op))
3525 };
3526
3527 google_cloud_lro::internal::new_poller(
3528 polling_error_policy,
3529 polling_backoff_policy,
3530 start,
3531 query,
3532 )
3533 }
3534
3535 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3539 self.0.request.name = v.into();
3540 self
3541 }
3542
3543 pub fn set_deployment_specs<T, K, V>(mut self, v: T) -> Self
3545 where
3546 T: std::iter::IntoIterator<Item = (K, V)>,
3547 K: std::convert::Into<std::string::String>,
3548 V: std::convert::Into<crate::model::DeploymentSpec>,
3549 {
3550 self.0.request.deployment_specs =
3551 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3552 self
3553 }
3554 }
3555
3556 #[doc(hidden)]
3557 impl crate::RequestBuilder for ProvisionDeploymentGroup {
3558 fn request_options(&mut self) -> &mut crate::RequestOptions {
3559 &mut self.0.options
3560 }
3561 }
3562
3563 #[derive(Clone, Debug)]
3581 pub struct DeprovisionDeploymentGroup(
3582 RequestBuilder<crate::model::DeprovisionDeploymentGroupRequest>,
3583 );
3584
3585 impl DeprovisionDeploymentGroup {
3586 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3587 Self(RequestBuilder::new(stub))
3588 }
3589
3590 pub fn with_request<V: Into<crate::model::DeprovisionDeploymentGroupRequest>>(
3592 mut self,
3593 v: V,
3594 ) -> Self {
3595 self.0.request = v.into();
3596 self
3597 }
3598
3599 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3601 self.0.options = v.into();
3602 self
3603 }
3604
3605 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3612 (*self.0.stub)
3613 .deprovision_deployment_group(self.0.request, self.0.options)
3614 .await
3615 .map(crate::Response::into_body)
3616 }
3617
3618 pub fn poller(
3620 self,
3621 ) -> impl google_cloud_lro::Poller<crate::model::DeploymentGroup, crate::model::OperationMetadata>
3622 {
3623 type Operation = google_cloud_lro::internal::Operation<
3624 crate::model::DeploymentGroup,
3625 crate::model::OperationMetadata,
3626 >;
3627 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3628 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3629
3630 let stub = self.0.stub.clone();
3631 let mut options = self.0.options.clone();
3632 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3633 let query = move |name| {
3634 let stub = stub.clone();
3635 let options = options.clone();
3636 async {
3637 let op = GetOperation::new(stub)
3638 .set_name(name)
3639 .with_options(options)
3640 .send()
3641 .await?;
3642 Ok(Operation::new(op))
3643 }
3644 };
3645
3646 let start = move || async {
3647 let op = self.send().await?;
3648 Ok(Operation::new(op))
3649 };
3650
3651 google_cloud_lro::internal::new_poller(
3652 polling_error_policy,
3653 polling_backoff_policy,
3654 start,
3655 query,
3656 )
3657 }
3658
3659 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3663 self.0.request.name = v.into();
3664 self
3665 }
3666
3667 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3669 self.0.request.force = v.into();
3670 self
3671 }
3672
3673 pub fn set_delete_policy<T: Into<crate::model::delete_deployment_request::DeletePolicy>>(
3675 mut self,
3676 v: T,
3677 ) -> Self {
3678 self.0.request.delete_policy = v.into();
3679 self
3680 }
3681 }
3682
3683 #[doc(hidden)]
3684 impl crate::RequestBuilder for DeprovisionDeploymentGroup {
3685 fn request_options(&mut self) -> &mut crate::RequestOptions {
3686 &mut self.0.options
3687 }
3688 }
3689
3690 #[derive(Clone, Debug)]
3707 pub struct GetDeploymentGroupRevision(
3708 RequestBuilder<crate::model::GetDeploymentGroupRevisionRequest>,
3709 );
3710
3711 impl GetDeploymentGroupRevision {
3712 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3713 Self(RequestBuilder::new(stub))
3714 }
3715
3716 pub fn with_request<V: Into<crate::model::GetDeploymentGroupRevisionRequest>>(
3718 mut self,
3719 v: V,
3720 ) -> Self {
3721 self.0.request = v.into();
3722 self
3723 }
3724
3725 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3727 self.0.options = v.into();
3728 self
3729 }
3730
3731 pub async fn send(self) -> Result<crate::model::DeploymentGroupRevision> {
3733 (*self.0.stub)
3734 .get_deployment_group_revision(self.0.request, self.0.options)
3735 .await
3736 .map(crate::Response::into_body)
3737 }
3738
3739 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3743 self.0.request.name = v.into();
3744 self
3745 }
3746 }
3747
3748 #[doc(hidden)]
3749 impl crate::RequestBuilder for GetDeploymentGroupRevision {
3750 fn request_options(&mut self) -> &mut crate::RequestOptions {
3751 &mut self.0.options
3752 }
3753 }
3754
3755 #[derive(Clone, Debug)]
3776 pub struct ListDeploymentGroupRevisions(
3777 RequestBuilder<crate::model::ListDeploymentGroupRevisionsRequest>,
3778 );
3779
3780 impl ListDeploymentGroupRevisions {
3781 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3782 Self(RequestBuilder::new(stub))
3783 }
3784
3785 pub fn with_request<V: Into<crate::model::ListDeploymentGroupRevisionsRequest>>(
3787 mut self,
3788 v: V,
3789 ) -> Self {
3790 self.0.request = v.into();
3791 self
3792 }
3793
3794 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3796 self.0.options = v.into();
3797 self
3798 }
3799
3800 pub async fn send(self) -> Result<crate::model::ListDeploymentGroupRevisionsResponse> {
3802 (*self.0.stub)
3803 .list_deployment_group_revisions(self.0.request, self.0.options)
3804 .await
3805 .map(crate::Response::into_body)
3806 }
3807
3808 pub fn by_page(
3810 self,
3811 ) -> impl google_cloud_gax::paginator::Paginator<
3812 crate::model::ListDeploymentGroupRevisionsResponse,
3813 crate::Error,
3814 > {
3815 use std::clone::Clone;
3816 let token = self.0.request.page_token.clone();
3817 let execute = move |token: String| {
3818 let mut builder = self.clone();
3819 builder.0.request = builder.0.request.set_page_token(token);
3820 builder.send()
3821 };
3822 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3823 }
3824
3825 pub fn by_item(
3827 self,
3828 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3829 crate::model::ListDeploymentGroupRevisionsResponse,
3830 crate::Error,
3831 > {
3832 use google_cloud_gax::paginator::Paginator;
3833 self.by_page().items()
3834 }
3835
3836 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3840 self.0.request.parent = v.into();
3841 self
3842 }
3843
3844 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3846 self.0.request.page_size = v.into();
3847 self
3848 }
3849
3850 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3852 self.0.request.page_token = v.into();
3853 self
3854 }
3855 }
3856
3857 #[doc(hidden)]
3858 impl crate::RequestBuilder for ListDeploymentGroupRevisions {
3859 fn request_options(&mut self) -> &mut crate::RequestOptions {
3860 &mut self.0.options
3861 }
3862 }
3863
3864 #[derive(Clone, Debug)]
3885 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3886
3887 impl ListLocations {
3888 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3889 Self(RequestBuilder::new(stub))
3890 }
3891
3892 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3894 mut self,
3895 v: V,
3896 ) -> Self {
3897 self.0.request = v.into();
3898 self
3899 }
3900
3901 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3903 self.0.options = v.into();
3904 self
3905 }
3906
3907 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3909 (*self.0.stub)
3910 .list_locations(self.0.request, self.0.options)
3911 .await
3912 .map(crate::Response::into_body)
3913 }
3914
3915 pub fn by_page(
3917 self,
3918 ) -> impl google_cloud_gax::paginator::Paginator<
3919 google_cloud_location::model::ListLocationsResponse,
3920 crate::Error,
3921 > {
3922 use std::clone::Clone;
3923 let token = self.0.request.page_token.clone();
3924 let execute = move |token: String| {
3925 let mut builder = self.clone();
3926 builder.0.request = builder.0.request.set_page_token(token);
3927 builder.send()
3928 };
3929 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3930 }
3931
3932 pub fn by_item(
3934 self,
3935 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3936 google_cloud_location::model::ListLocationsResponse,
3937 crate::Error,
3938 > {
3939 use google_cloud_gax::paginator::Paginator;
3940 self.by_page().items()
3941 }
3942
3943 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3945 self.0.request.name = v.into();
3946 self
3947 }
3948
3949 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3951 self.0.request.filter = v.into();
3952 self
3953 }
3954
3955 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3957 self.0.request.page_size = v.into();
3958 self
3959 }
3960
3961 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3963 self.0.request.page_token = v.into();
3964 self
3965 }
3966 }
3967
3968 #[doc(hidden)]
3969 impl crate::RequestBuilder for ListLocations {
3970 fn request_options(&mut self) -> &mut crate::RequestOptions {
3971 &mut self.0.options
3972 }
3973 }
3974
3975 #[derive(Clone, Debug)]
3992 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3993
3994 impl GetLocation {
3995 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3996 Self(RequestBuilder::new(stub))
3997 }
3998
3999 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4001 mut self,
4002 v: V,
4003 ) -> Self {
4004 self.0.request = v.into();
4005 self
4006 }
4007
4008 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4010 self.0.options = v.into();
4011 self
4012 }
4013
4014 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4016 (*self.0.stub)
4017 .get_location(self.0.request, self.0.options)
4018 .await
4019 .map(crate::Response::into_body)
4020 }
4021
4022 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4024 self.0.request.name = v.into();
4025 self
4026 }
4027 }
4028
4029 #[doc(hidden)]
4030 impl crate::RequestBuilder for GetLocation {
4031 fn request_options(&mut self) -> &mut crate::RequestOptions {
4032 &mut self.0.options
4033 }
4034 }
4035
4036 #[derive(Clone, Debug)]
4053 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4054
4055 impl SetIamPolicy {
4056 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4057 Self(RequestBuilder::new(stub))
4058 }
4059
4060 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4062 mut self,
4063 v: V,
4064 ) -> Self {
4065 self.0.request = v.into();
4066 self
4067 }
4068
4069 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4071 self.0.options = v.into();
4072 self
4073 }
4074
4075 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4077 (*self.0.stub)
4078 .set_iam_policy(self.0.request, self.0.options)
4079 .await
4080 .map(crate::Response::into_body)
4081 }
4082
4083 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4087 self.0.request.resource = v.into();
4088 self
4089 }
4090
4091 pub fn set_policy<T>(mut self, v: T) -> Self
4095 where
4096 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4097 {
4098 self.0.request.policy = std::option::Option::Some(v.into());
4099 self
4100 }
4101
4102 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4106 where
4107 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4108 {
4109 self.0.request.policy = v.map(|x| x.into());
4110 self
4111 }
4112
4113 pub fn set_update_mask<T>(mut self, v: T) -> Self
4115 where
4116 T: std::convert::Into<wkt::FieldMask>,
4117 {
4118 self.0.request.update_mask = std::option::Option::Some(v.into());
4119 self
4120 }
4121
4122 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4124 where
4125 T: std::convert::Into<wkt::FieldMask>,
4126 {
4127 self.0.request.update_mask = v.map(|x| x.into());
4128 self
4129 }
4130 }
4131
4132 #[doc(hidden)]
4133 impl crate::RequestBuilder for SetIamPolicy {
4134 fn request_options(&mut self) -> &mut crate::RequestOptions {
4135 &mut self.0.options
4136 }
4137 }
4138
4139 #[derive(Clone, Debug)]
4156 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4157
4158 impl GetIamPolicy {
4159 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4160 Self(RequestBuilder::new(stub))
4161 }
4162
4163 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4165 mut self,
4166 v: V,
4167 ) -> Self {
4168 self.0.request = v.into();
4169 self
4170 }
4171
4172 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4174 self.0.options = v.into();
4175 self
4176 }
4177
4178 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4180 (*self.0.stub)
4181 .get_iam_policy(self.0.request, self.0.options)
4182 .await
4183 .map(crate::Response::into_body)
4184 }
4185
4186 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4190 self.0.request.resource = v.into();
4191 self
4192 }
4193
4194 pub fn set_options<T>(mut self, v: T) -> Self
4196 where
4197 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4198 {
4199 self.0.request.options = std::option::Option::Some(v.into());
4200 self
4201 }
4202
4203 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4205 where
4206 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4207 {
4208 self.0.request.options = v.map(|x| x.into());
4209 self
4210 }
4211 }
4212
4213 #[doc(hidden)]
4214 impl crate::RequestBuilder for GetIamPolicy {
4215 fn request_options(&mut self) -> &mut crate::RequestOptions {
4216 &mut self.0.options
4217 }
4218 }
4219
4220 #[derive(Clone, Debug)]
4237 pub struct TestIamPermissions(
4238 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4239 );
4240
4241 impl TestIamPermissions {
4242 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4243 Self(RequestBuilder::new(stub))
4244 }
4245
4246 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4248 mut self,
4249 v: V,
4250 ) -> Self {
4251 self.0.request = v.into();
4252 self
4253 }
4254
4255 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4257 self.0.options = v.into();
4258 self
4259 }
4260
4261 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4263 (*self.0.stub)
4264 .test_iam_permissions(self.0.request, self.0.options)
4265 .await
4266 .map(crate::Response::into_body)
4267 }
4268
4269 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4273 self.0.request.resource = v.into();
4274 self
4275 }
4276
4277 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4281 where
4282 T: std::iter::IntoIterator<Item = V>,
4283 V: std::convert::Into<std::string::String>,
4284 {
4285 use std::iter::Iterator;
4286 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4287 self
4288 }
4289 }
4290
4291 #[doc(hidden)]
4292 impl crate::RequestBuilder for TestIamPermissions {
4293 fn request_options(&mut self) -> &mut crate::RequestOptions {
4294 &mut self.0.options
4295 }
4296 }
4297
4298 #[derive(Clone, Debug)]
4319 pub struct ListOperations(
4320 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4321 );
4322
4323 impl ListOperations {
4324 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4325 Self(RequestBuilder::new(stub))
4326 }
4327
4328 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4330 mut self,
4331 v: V,
4332 ) -> Self {
4333 self.0.request = v.into();
4334 self
4335 }
4336
4337 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4339 self.0.options = v.into();
4340 self
4341 }
4342
4343 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4345 (*self.0.stub)
4346 .list_operations(self.0.request, self.0.options)
4347 .await
4348 .map(crate::Response::into_body)
4349 }
4350
4351 pub fn by_page(
4353 self,
4354 ) -> impl google_cloud_gax::paginator::Paginator<
4355 google_cloud_longrunning::model::ListOperationsResponse,
4356 crate::Error,
4357 > {
4358 use std::clone::Clone;
4359 let token = self.0.request.page_token.clone();
4360 let execute = move |token: String| {
4361 let mut builder = self.clone();
4362 builder.0.request = builder.0.request.set_page_token(token);
4363 builder.send()
4364 };
4365 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4366 }
4367
4368 pub fn by_item(
4370 self,
4371 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4372 google_cloud_longrunning::model::ListOperationsResponse,
4373 crate::Error,
4374 > {
4375 use google_cloud_gax::paginator::Paginator;
4376 self.by_page().items()
4377 }
4378
4379 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4381 self.0.request.name = v.into();
4382 self
4383 }
4384
4385 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4387 self.0.request.filter = v.into();
4388 self
4389 }
4390
4391 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4393 self.0.request.page_size = v.into();
4394 self
4395 }
4396
4397 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4399 self.0.request.page_token = v.into();
4400 self
4401 }
4402
4403 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4405 self.0.request.return_partial_success = v.into();
4406 self
4407 }
4408 }
4409
4410 #[doc(hidden)]
4411 impl crate::RequestBuilder for ListOperations {
4412 fn request_options(&mut self) -> &mut crate::RequestOptions {
4413 &mut self.0.options
4414 }
4415 }
4416
4417 #[derive(Clone, Debug)]
4434 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4435
4436 impl GetOperation {
4437 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4438 Self(RequestBuilder::new(stub))
4439 }
4440
4441 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4443 mut self,
4444 v: V,
4445 ) -> Self {
4446 self.0.request = v.into();
4447 self
4448 }
4449
4450 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4452 self.0.options = v.into();
4453 self
4454 }
4455
4456 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4458 (*self.0.stub)
4459 .get_operation(self.0.request, self.0.options)
4460 .await
4461 .map(crate::Response::into_body)
4462 }
4463
4464 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4466 self.0.request.name = v.into();
4467 self
4468 }
4469 }
4470
4471 #[doc(hidden)]
4472 impl crate::RequestBuilder for GetOperation {
4473 fn request_options(&mut self) -> &mut crate::RequestOptions {
4474 &mut self.0.options
4475 }
4476 }
4477
4478 #[derive(Clone, Debug)]
4495 pub struct DeleteOperation(
4496 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4497 );
4498
4499 impl DeleteOperation {
4500 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4501 Self(RequestBuilder::new(stub))
4502 }
4503
4504 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4506 mut self,
4507 v: V,
4508 ) -> Self {
4509 self.0.request = v.into();
4510 self
4511 }
4512
4513 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4515 self.0.options = v.into();
4516 self
4517 }
4518
4519 pub async fn send(self) -> Result<()> {
4521 (*self.0.stub)
4522 .delete_operation(self.0.request, self.0.options)
4523 .await
4524 .map(crate::Response::into_body)
4525 }
4526
4527 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4529 self.0.request.name = v.into();
4530 self
4531 }
4532 }
4533
4534 #[doc(hidden)]
4535 impl crate::RequestBuilder for DeleteOperation {
4536 fn request_options(&mut self) -> &mut crate::RequestOptions {
4537 &mut self.0.options
4538 }
4539 }
4540
4541 #[derive(Clone, Debug)]
4558 pub struct CancelOperation(
4559 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4560 );
4561
4562 impl CancelOperation {
4563 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4564 Self(RequestBuilder::new(stub))
4565 }
4566
4567 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4569 mut self,
4570 v: V,
4571 ) -> Self {
4572 self.0.request = v.into();
4573 self
4574 }
4575
4576 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4578 self.0.options = v.into();
4579 self
4580 }
4581
4582 pub async fn send(self) -> Result<()> {
4584 (*self.0.stub)
4585 .cancel_operation(self.0.request, self.0.options)
4586 .await
4587 .map(crate::Response::into_body)
4588 }
4589
4590 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4592 self.0.request.name = v.into();
4593 self
4594 }
4595 }
4596
4597 #[doc(hidden)]
4598 impl crate::RequestBuilder for CancelOperation {
4599 fn request_options(&mut self) -> &mut crate::RequestOptions {
4600 &mut self.0.options
4601 }
4602 }
4603}