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)]
2850 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2851
2852 impl ListLocations {
2853 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2854 Self(RequestBuilder::new(stub))
2855 }
2856
2857 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2859 mut self,
2860 v: V,
2861 ) -> Self {
2862 self.0.request = v.into();
2863 self
2864 }
2865
2866 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2868 self.0.options = v.into();
2869 self
2870 }
2871
2872 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2874 (*self.0.stub)
2875 .list_locations(self.0.request, self.0.options)
2876 .await
2877 .map(crate::Response::into_body)
2878 }
2879
2880 pub fn by_page(
2882 self,
2883 ) -> impl google_cloud_gax::paginator::Paginator<
2884 google_cloud_location::model::ListLocationsResponse,
2885 crate::Error,
2886 > {
2887 use std::clone::Clone;
2888 let token = self.0.request.page_token.clone();
2889 let execute = move |token: String| {
2890 let mut builder = self.clone();
2891 builder.0.request = builder.0.request.set_page_token(token);
2892 builder.send()
2893 };
2894 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2895 }
2896
2897 pub fn by_item(
2899 self,
2900 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2901 google_cloud_location::model::ListLocationsResponse,
2902 crate::Error,
2903 > {
2904 use google_cloud_gax::paginator::Paginator;
2905 self.by_page().items()
2906 }
2907
2908 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2910 self.0.request.name = v.into();
2911 self
2912 }
2913
2914 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2916 self.0.request.filter = v.into();
2917 self
2918 }
2919
2920 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2922 self.0.request.page_size = v.into();
2923 self
2924 }
2925
2926 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2928 self.0.request.page_token = v.into();
2929 self
2930 }
2931 }
2932
2933 #[doc(hidden)]
2934 impl crate::RequestBuilder for ListLocations {
2935 fn request_options(&mut self) -> &mut crate::RequestOptions {
2936 &mut self.0.options
2937 }
2938 }
2939
2940 #[derive(Clone, Debug)]
2957 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2958
2959 impl GetLocation {
2960 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2961 Self(RequestBuilder::new(stub))
2962 }
2963
2964 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2966 mut self,
2967 v: V,
2968 ) -> Self {
2969 self.0.request = v.into();
2970 self
2971 }
2972
2973 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2975 self.0.options = v.into();
2976 self
2977 }
2978
2979 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2981 (*self.0.stub)
2982 .get_location(self.0.request, self.0.options)
2983 .await
2984 .map(crate::Response::into_body)
2985 }
2986
2987 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2989 self.0.request.name = v.into();
2990 self
2991 }
2992 }
2993
2994 #[doc(hidden)]
2995 impl crate::RequestBuilder for GetLocation {
2996 fn request_options(&mut self) -> &mut crate::RequestOptions {
2997 &mut self.0.options
2998 }
2999 }
3000
3001 #[derive(Clone, Debug)]
3018 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3019
3020 impl SetIamPolicy {
3021 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3022 Self(RequestBuilder::new(stub))
3023 }
3024
3025 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3027 mut self,
3028 v: V,
3029 ) -> Self {
3030 self.0.request = v.into();
3031 self
3032 }
3033
3034 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3036 self.0.options = v.into();
3037 self
3038 }
3039
3040 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3042 (*self.0.stub)
3043 .set_iam_policy(self.0.request, self.0.options)
3044 .await
3045 .map(crate::Response::into_body)
3046 }
3047
3048 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3052 self.0.request.resource = v.into();
3053 self
3054 }
3055
3056 pub fn set_policy<T>(mut self, v: T) -> Self
3060 where
3061 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3062 {
3063 self.0.request.policy = std::option::Option::Some(v.into());
3064 self
3065 }
3066
3067 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3071 where
3072 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3073 {
3074 self.0.request.policy = v.map(|x| x.into());
3075 self
3076 }
3077
3078 pub fn set_update_mask<T>(mut self, v: T) -> Self
3080 where
3081 T: std::convert::Into<wkt::FieldMask>,
3082 {
3083 self.0.request.update_mask = std::option::Option::Some(v.into());
3084 self
3085 }
3086
3087 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3089 where
3090 T: std::convert::Into<wkt::FieldMask>,
3091 {
3092 self.0.request.update_mask = v.map(|x| x.into());
3093 self
3094 }
3095 }
3096
3097 #[doc(hidden)]
3098 impl crate::RequestBuilder for SetIamPolicy {
3099 fn request_options(&mut self) -> &mut crate::RequestOptions {
3100 &mut self.0.options
3101 }
3102 }
3103
3104 #[derive(Clone, Debug)]
3121 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3122
3123 impl GetIamPolicy {
3124 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3125 Self(RequestBuilder::new(stub))
3126 }
3127
3128 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3130 mut self,
3131 v: V,
3132 ) -> Self {
3133 self.0.request = v.into();
3134 self
3135 }
3136
3137 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3139 self.0.options = v.into();
3140 self
3141 }
3142
3143 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3145 (*self.0.stub)
3146 .get_iam_policy(self.0.request, self.0.options)
3147 .await
3148 .map(crate::Response::into_body)
3149 }
3150
3151 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3155 self.0.request.resource = v.into();
3156 self
3157 }
3158
3159 pub fn set_options<T>(mut self, v: T) -> Self
3161 where
3162 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3163 {
3164 self.0.request.options = std::option::Option::Some(v.into());
3165 self
3166 }
3167
3168 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3170 where
3171 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3172 {
3173 self.0.request.options = v.map(|x| x.into());
3174 self
3175 }
3176 }
3177
3178 #[doc(hidden)]
3179 impl crate::RequestBuilder for GetIamPolicy {
3180 fn request_options(&mut self) -> &mut crate::RequestOptions {
3181 &mut self.0.options
3182 }
3183 }
3184
3185 #[derive(Clone, Debug)]
3202 pub struct TestIamPermissions(
3203 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3204 );
3205
3206 impl TestIamPermissions {
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<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
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_iam_v1::model::TestIamPermissionsResponse> {
3228 (*self.0.stub)
3229 .test_iam_permissions(self.0.request, self.0.options)
3230 .await
3231 .map(crate::Response::into_body)
3232 }
3233
3234 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3238 self.0.request.resource = v.into();
3239 self
3240 }
3241
3242 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3246 where
3247 T: std::iter::IntoIterator<Item = V>,
3248 V: std::convert::Into<std::string::String>,
3249 {
3250 use std::iter::Iterator;
3251 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3252 self
3253 }
3254 }
3255
3256 #[doc(hidden)]
3257 impl crate::RequestBuilder for TestIamPermissions {
3258 fn request_options(&mut self) -> &mut crate::RequestOptions {
3259 &mut self.0.options
3260 }
3261 }
3262
3263 #[derive(Clone, Debug)]
3284 pub struct ListOperations(
3285 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3286 );
3287
3288 impl ListOperations {
3289 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3290 Self(RequestBuilder::new(stub))
3291 }
3292
3293 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3295 mut self,
3296 v: V,
3297 ) -> Self {
3298 self.0.request = v.into();
3299 self
3300 }
3301
3302 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3304 self.0.options = v.into();
3305 self
3306 }
3307
3308 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3310 (*self.0.stub)
3311 .list_operations(self.0.request, self.0.options)
3312 .await
3313 .map(crate::Response::into_body)
3314 }
3315
3316 pub fn by_page(
3318 self,
3319 ) -> impl google_cloud_gax::paginator::Paginator<
3320 google_cloud_longrunning::model::ListOperationsResponse,
3321 crate::Error,
3322 > {
3323 use std::clone::Clone;
3324 let token = self.0.request.page_token.clone();
3325 let execute = move |token: String| {
3326 let mut builder = self.clone();
3327 builder.0.request = builder.0.request.set_page_token(token);
3328 builder.send()
3329 };
3330 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3331 }
3332
3333 pub fn by_item(
3335 self,
3336 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3337 google_cloud_longrunning::model::ListOperationsResponse,
3338 crate::Error,
3339 > {
3340 use google_cloud_gax::paginator::Paginator;
3341 self.by_page().items()
3342 }
3343
3344 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3346 self.0.request.name = v.into();
3347 self
3348 }
3349
3350 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3352 self.0.request.filter = v.into();
3353 self
3354 }
3355
3356 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3358 self.0.request.page_size = v.into();
3359 self
3360 }
3361
3362 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3364 self.0.request.page_token = v.into();
3365 self
3366 }
3367
3368 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3370 self.0.request.return_partial_success = v.into();
3371 self
3372 }
3373 }
3374
3375 #[doc(hidden)]
3376 impl crate::RequestBuilder for ListOperations {
3377 fn request_options(&mut self) -> &mut crate::RequestOptions {
3378 &mut self.0.options
3379 }
3380 }
3381
3382 #[derive(Clone, Debug)]
3399 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3400
3401 impl GetOperation {
3402 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3403 Self(RequestBuilder::new(stub))
3404 }
3405
3406 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3408 mut self,
3409 v: V,
3410 ) -> Self {
3411 self.0.request = v.into();
3412 self
3413 }
3414
3415 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3417 self.0.options = v.into();
3418 self
3419 }
3420
3421 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3423 (*self.0.stub)
3424 .get_operation(self.0.request, self.0.options)
3425 .await
3426 .map(crate::Response::into_body)
3427 }
3428
3429 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3431 self.0.request.name = v.into();
3432 self
3433 }
3434 }
3435
3436 #[doc(hidden)]
3437 impl crate::RequestBuilder for GetOperation {
3438 fn request_options(&mut self) -> &mut crate::RequestOptions {
3439 &mut self.0.options
3440 }
3441 }
3442
3443 #[derive(Clone, Debug)]
3460 pub struct DeleteOperation(
3461 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3462 );
3463
3464 impl DeleteOperation {
3465 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3466 Self(RequestBuilder::new(stub))
3467 }
3468
3469 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3471 mut self,
3472 v: V,
3473 ) -> Self {
3474 self.0.request = v.into();
3475 self
3476 }
3477
3478 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3480 self.0.options = v.into();
3481 self
3482 }
3483
3484 pub async fn send(self) -> Result<()> {
3486 (*self.0.stub)
3487 .delete_operation(self.0.request, self.0.options)
3488 .await
3489 .map(crate::Response::into_body)
3490 }
3491
3492 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3494 self.0.request.name = v.into();
3495 self
3496 }
3497 }
3498
3499 #[doc(hidden)]
3500 impl crate::RequestBuilder for DeleteOperation {
3501 fn request_options(&mut self) -> &mut crate::RequestOptions {
3502 &mut self.0.options
3503 }
3504 }
3505
3506 #[derive(Clone, Debug)]
3523 pub struct CancelOperation(
3524 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3525 );
3526
3527 impl CancelOperation {
3528 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3529 Self(RequestBuilder::new(stub))
3530 }
3531
3532 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3534 mut self,
3535 v: V,
3536 ) -> Self {
3537 self.0.request = v.into();
3538 self
3539 }
3540
3541 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3543 self.0.options = v.into();
3544 self
3545 }
3546
3547 pub async fn send(self) -> Result<()> {
3549 (*self.0.stub)
3550 .cancel_operation(self.0.request, self.0.options)
3551 .await
3552 .map(crate::Response::into_body)
3553 }
3554
3555 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3557 self.0.request.name = v.into();
3558 self
3559 }
3560 }
3561
3562 #[doc(hidden)]
3563 impl crate::RequestBuilder for CancelOperation {
3564 fn request_options(&mut self) -> &mut crate::RequestOptions {
3565 &mut self.0.options
3566 }
3567 }
3568}