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