1pub mod config {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::Config;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = Config;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: gax::options::RequestOptions::default(),
68 }
69 }
70 }
71
72 #[derive(Clone, Debug)]
93 pub struct ListDeployments(RequestBuilder<crate::model::ListDeploymentsRequest>);
94
95 impl ListDeployments {
96 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::ListDeploymentsRequest>>(mut self, v: V) -> Self {
102 self.0.request = v.into();
103 self
104 }
105
106 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
108 self.0.options = v.into();
109 self
110 }
111
112 pub async fn send(self) -> Result<crate::model::ListDeploymentsResponse> {
114 (*self.0.stub)
115 .list_deployments(self.0.request, self.0.options)
116 .await
117 .map(gax::response::Response::into_body)
118 }
119
120 pub fn by_page(
122 self,
123 ) -> impl gax::paginator::Paginator<crate::model::ListDeploymentsResponse, gax::error::Error>
124 {
125 use std::clone::Clone;
126 let token = self.0.request.page_token.clone();
127 let execute = move |token: String| {
128 let mut builder = self.clone();
129 builder.0.request = builder.0.request.set_page_token(token);
130 builder.send()
131 };
132 gax::paginator::internal::new_paginator(token, execute)
133 }
134
135 pub fn by_item(
137 self,
138 ) -> impl gax::paginator::ItemPaginator<crate::model::ListDeploymentsResponse, gax::error::Error>
139 {
140 use gax::paginator::Paginator;
141 self.by_page().items()
142 }
143
144 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
148 self.0.request.parent = v.into();
149 self
150 }
151
152 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
154 self.0.request.page_size = v.into();
155 self
156 }
157
158 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
160 self.0.request.page_token = v.into();
161 self
162 }
163
164 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
166 self.0.request.filter = v.into();
167 self
168 }
169
170 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
172 self.0.request.order_by = v.into();
173 self
174 }
175 }
176
177 #[doc(hidden)]
178 impl gax::options::internal::RequestBuilder for ListDeployments {
179 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
180 &mut self.0.options
181 }
182 }
183
184 #[derive(Clone, Debug)]
201 pub struct GetDeployment(RequestBuilder<crate::model::GetDeploymentRequest>);
202
203 impl GetDeployment {
204 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
205 Self(RequestBuilder::new(stub))
206 }
207
208 pub fn with_request<V: Into<crate::model::GetDeploymentRequest>>(mut self, v: V) -> Self {
210 self.0.request = v.into();
211 self
212 }
213
214 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
216 self.0.options = v.into();
217 self
218 }
219
220 pub async fn send(self) -> Result<crate::model::Deployment> {
222 (*self.0.stub)
223 .get_deployment(self.0.request, self.0.options)
224 .await
225 .map(gax::response::Response::into_body)
226 }
227
228 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
232 self.0.request.name = v.into();
233 self
234 }
235 }
236
237 #[doc(hidden)]
238 impl gax::options::internal::RequestBuilder for GetDeployment {
239 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
240 &mut self.0.options
241 }
242 }
243
244 #[derive(Clone, Debug)]
262 pub struct CreateDeployment(RequestBuilder<crate::model::CreateDeploymentRequest>);
263
264 impl CreateDeployment {
265 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
266 Self(RequestBuilder::new(stub))
267 }
268
269 pub fn with_request<V: Into<crate::model::CreateDeploymentRequest>>(
271 mut self,
272 v: V,
273 ) -> Self {
274 self.0.request = v.into();
275 self
276 }
277
278 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
280 self.0.options = v.into();
281 self
282 }
283
284 pub async fn send(self) -> Result<longrunning::model::Operation> {
291 (*self.0.stub)
292 .create_deployment(self.0.request, self.0.options)
293 .await
294 .map(gax::response::Response::into_body)
295 }
296
297 pub fn poller(
299 self,
300 ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
301 type Operation =
302 lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
303 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
304 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
305
306 let stub = self.0.stub.clone();
307 let mut options = self.0.options.clone();
308 options.set_retry_policy(gax::retry_policy::NeverRetry);
309 let query = move |name| {
310 let stub = stub.clone();
311 let options = options.clone();
312 async {
313 let op = GetOperation::new(stub)
314 .set_name(name)
315 .with_options(options)
316 .send()
317 .await?;
318 Ok(Operation::new(op))
319 }
320 };
321
322 let start = move || async {
323 let op = self.send().await?;
324 Ok(Operation::new(op))
325 };
326
327 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
328 }
329
330 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
334 self.0.request.parent = v.into();
335 self
336 }
337
338 pub fn set_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
342 self.0.request.deployment_id = v.into();
343 self
344 }
345
346 pub fn set_deployment<T>(mut self, v: T) -> Self
350 where
351 T: std::convert::Into<crate::model::Deployment>,
352 {
353 self.0.request.deployment = std::option::Option::Some(v.into());
354 self
355 }
356
357 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
361 where
362 T: std::convert::Into<crate::model::Deployment>,
363 {
364 self.0.request.deployment = v.map(|x| x.into());
365 self
366 }
367
368 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
370 self.0.request.request_id = v.into();
371 self
372 }
373 }
374
375 #[doc(hidden)]
376 impl gax::options::internal::RequestBuilder for CreateDeployment {
377 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
378 &mut self.0.options
379 }
380 }
381
382 #[derive(Clone, Debug)]
400 pub struct UpdateDeployment(RequestBuilder<crate::model::UpdateDeploymentRequest>);
401
402 impl UpdateDeployment {
403 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
404 Self(RequestBuilder::new(stub))
405 }
406
407 pub fn with_request<V: Into<crate::model::UpdateDeploymentRequest>>(
409 mut self,
410 v: V,
411 ) -> Self {
412 self.0.request = v.into();
413 self
414 }
415
416 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
418 self.0.options = v.into();
419 self
420 }
421
422 pub async fn send(self) -> Result<longrunning::model::Operation> {
429 (*self.0.stub)
430 .update_deployment(self.0.request, self.0.options)
431 .await
432 .map(gax::response::Response::into_body)
433 }
434
435 pub fn poller(
437 self,
438 ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
439 type Operation =
440 lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
441 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
442 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
443
444 let stub = self.0.stub.clone();
445 let mut options = self.0.options.clone();
446 options.set_retry_policy(gax::retry_policy::NeverRetry);
447 let query = move |name| {
448 let stub = stub.clone();
449 let options = options.clone();
450 async {
451 let op = GetOperation::new(stub)
452 .set_name(name)
453 .with_options(options)
454 .send()
455 .await?;
456 Ok(Operation::new(op))
457 }
458 };
459
460 let start = move || async {
461 let op = self.send().await?;
462 Ok(Operation::new(op))
463 };
464
465 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
466 }
467
468 pub fn set_update_mask<T>(mut self, v: T) -> Self
470 where
471 T: std::convert::Into<wkt::FieldMask>,
472 {
473 self.0.request.update_mask = std::option::Option::Some(v.into());
474 self
475 }
476
477 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
479 where
480 T: std::convert::Into<wkt::FieldMask>,
481 {
482 self.0.request.update_mask = v.map(|x| x.into());
483 self
484 }
485
486 pub fn set_deployment<T>(mut self, v: T) -> Self
490 where
491 T: std::convert::Into<crate::model::Deployment>,
492 {
493 self.0.request.deployment = std::option::Option::Some(v.into());
494 self
495 }
496
497 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
501 where
502 T: std::convert::Into<crate::model::Deployment>,
503 {
504 self.0.request.deployment = v.map(|x| x.into());
505 self
506 }
507
508 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
510 self.0.request.request_id = v.into();
511 self
512 }
513 }
514
515 #[doc(hidden)]
516 impl gax::options::internal::RequestBuilder for UpdateDeployment {
517 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
518 &mut self.0.options
519 }
520 }
521
522 #[derive(Clone, Debug)]
540 pub struct DeleteDeployment(RequestBuilder<crate::model::DeleteDeploymentRequest>);
541
542 impl DeleteDeployment {
543 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
544 Self(RequestBuilder::new(stub))
545 }
546
547 pub fn with_request<V: Into<crate::model::DeleteDeploymentRequest>>(
549 mut self,
550 v: V,
551 ) -> Self {
552 self.0.request = v.into();
553 self
554 }
555
556 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
558 self.0.options = v.into();
559 self
560 }
561
562 pub async fn send(self) -> Result<longrunning::model::Operation> {
569 (*self.0.stub)
570 .delete_deployment(self.0.request, self.0.options)
571 .await
572 .map(gax::response::Response::into_body)
573 }
574
575 pub fn poller(
577 self,
578 ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
579 type Operation =
580 lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
581 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
582 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
583
584 let stub = self.0.stub.clone();
585 let mut options = self.0.options.clone();
586 options.set_retry_policy(gax::retry_policy::NeverRetry);
587 let query = move |name| {
588 let stub = stub.clone();
589 let options = options.clone();
590 async {
591 let op = GetOperation::new(stub)
592 .set_name(name)
593 .with_options(options)
594 .send()
595 .await?;
596 Ok(Operation::new(op))
597 }
598 };
599
600 let start = move || async {
601 let op = self.send().await?;
602 Ok(Operation::new(op))
603 };
604
605 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
606 }
607
608 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
612 self.0.request.name = v.into();
613 self
614 }
615
616 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
618 self.0.request.request_id = v.into();
619 self
620 }
621
622 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
624 self.0.request.force = v.into();
625 self
626 }
627
628 pub fn set_delete_policy<T: Into<crate::model::delete_deployment_request::DeletePolicy>>(
630 mut self,
631 v: T,
632 ) -> Self {
633 self.0.request.delete_policy = v.into();
634 self
635 }
636 }
637
638 #[doc(hidden)]
639 impl gax::options::internal::RequestBuilder for DeleteDeployment {
640 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
641 &mut self.0.options
642 }
643 }
644
645 #[derive(Clone, Debug)]
666 pub struct ListRevisions(RequestBuilder<crate::model::ListRevisionsRequest>);
667
668 impl ListRevisions {
669 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
670 Self(RequestBuilder::new(stub))
671 }
672
673 pub fn with_request<V: Into<crate::model::ListRevisionsRequest>>(mut self, v: V) -> Self {
675 self.0.request = v.into();
676 self
677 }
678
679 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
681 self.0.options = v.into();
682 self
683 }
684
685 pub async fn send(self) -> Result<crate::model::ListRevisionsResponse> {
687 (*self.0.stub)
688 .list_revisions(self.0.request, self.0.options)
689 .await
690 .map(gax::response::Response::into_body)
691 }
692
693 pub fn by_page(
695 self,
696 ) -> impl gax::paginator::Paginator<crate::model::ListRevisionsResponse, gax::error::Error>
697 {
698 use std::clone::Clone;
699 let token = self.0.request.page_token.clone();
700 let execute = move |token: String| {
701 let mut builder = self.clone();
702 builder.0.request = builder.0.request.set_page_token(token);
703 builder.send()
704 };
705 gax::paginator::internal::new_paginator(token, execute)
706 }
707
708 pub fn by_item(
710 self,
711 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRevisionsResponse, gax::error::Error>
712 {
713 use gax::paginator::Paginator;
714 self.by_page().items()
715 }
716
717 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
721 self.0.request.parent = v.into();
722 self
723 }
724
725 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
727 self.0.request.page_size = v.into();
728 self
729 }
730
731 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
733 self.0.request.page_token = v.into();
734 self
735 }
736
737 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
739 self.0.request.filter = v.into();
740 self
741 }
742
743 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
745 self.0.request.order_by = v.into();
746 self
747 }
748 }
749
750 #[doc(hidden)]
751 impl gax::options::internal::RequestBuilder for ListRevisions {
752 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
753 &mut self.0.options
754 }
755 }
756
757 #[derive(Clone, Debug)]
774 pub struct GetRevision(RequestBuilder<crate::model::GetRevisionRequest>);
775
776 impl GetRevision {
777 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
778 Self(RequestBuilder::new(stub))
779 }
780
781 pub fn with_request<V: Into<crate::model::GetRevisionRequest>>(mut self, v: V) -> Self {
783 self.0.request = v.into();
784 self
785 }
786
787 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
789 self.0.options = v.into();
790 self
791 }
792
793 pub async fn send(self) -> Result<crate::model::Revision> {
795 (*self.0.stub)
796 .get_revision(self.0.request, self.0.options)
797 .await
798 .map(gax::response::Response::into_body)
799 }
800
801 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
805 self.0.request.name = v.into();
806 self
807 }
808 }
809
810 #[doc(hidden)]
811 impl gax::options::internal::RequestBuilder for GetRevision {
812 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
813 &mut self.0.options
814 }
815 }
816
817 #[derive(Clone, Debug)]
834 pub struct GetResource(RequestBuilder<crate::model::GetResourceRequest>);
835
836 impl GetResource {
837 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
838 Self(RequestBuilder::new(stub))
839 }
840
841 pub fn with_request<V: Into<crate::model::GetResourceRequest>>(mut self, v: V) -> Self {
843 self.0.request = v.into();
844 self
845 }
846
847 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
849 self.0.options = v.into();
850 self
851 }
852
853 pub async fn send(self) -> Result<crate::model::Resource> {
855 (*self.0.stub)
856 .get_resource(self.0.request, self.0.options)
857 .await
858 .map(gax::response::Response::into_body)
859 }
860
861 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
865 self.0.request.name = v.into();
866 self
867 }
868 }
869
870 #[doc(hidden)]
871 impl gax::options::internal::RequestBuilder for GetResource {
872 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
873 &mut self.0.options
874 }
875 }
876
877 #[derive(Clone, Debug)]
898 pub struct ListResources(RequestBuilder<crate::model::ListResourcesRequest>);
899
900 impl ListResources {
901 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
902 Self(RequestBuilder::new(stub))
903 }
904
905 pub fn with_request<V: Into<crate::model::ListResourcesRequest>>(mut self, v: V) -> Self {
907 self.0.request = v.into();
908 self
909 }
910
911 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
913 self.0.options = v.into();
914 self
915 }
916
917 pub async fn send(self) -> Result<crate::model::ListResourcesResponse> {
919 (*self.0.stub)
920 .list_resources(self.0.request, self.0.options)
921 .await
922 .map(gax::response::Response::into_body)
923 }
924
925 pub fn by_page(
927 self,
928 ) -> impl gax::paginator::Paginator<crate::model::ListResourcesResponse, gax::error::Error>
929 {
930 use std::clone::Clone;
931 let token = self.0.request.page_token.clone();
932 let execute = move |token: String| {
933 let mut builder = self.clone();
934 builder.0.request = builder.0.request.set_page_token(token);
935 builder.send()
936 };
937 gax::paginator::internal::new_paginator(token, execute)
938 }
939
940 pub fn by_item(
942 self,
943 ) -> impl gax::paginator::ItemPaginator<crate::model::ListResourcesResponse, gax::error::Error>
944 {
945 use gax::paginator::Paginator;
946 self.by_page().items()
947 }
948
949 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
953 self.0.request.parent = v.into();
954 self
955 }
956
957 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
959 self.0.request.page_size = v.into();
960 self
961 }
962
963 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
965 self.0.request.page_token = v.into();
966 self
967 }
968
969 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
971 self.0.request.filter = v.into();
972 self
973 }
974
975 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
977 self.0.request.order_by = v.into();
978 self
979 }
980 }
981
982 #[doc(hidden)]
983 impl gax::options::internal::RequestBuilder for ListResources {
984 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
985 &mut self.0.options
986 }
987 }
988
989 #[derive(Clone, Debug)]
1006 pub struct ExportDeploymentStatefile(
1007 RequestBuilder<crate::model::ExportDeploymentStatefileRequest>,
1008 );
1009
1010 impl ExportDeploymentStatefile {
1011 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1012 Self(RequestBuilder::new(stub))
1013 }
1014
1015 pub fn with_request<V: Into<crate::model::ExportDeploymentStatefileRequest>>(
1017 mut self,
1018 v: V,
1019 ) -> Self {
1020 self.0.request = v.into();
1021 self
1022 }
1023
1024 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1026 self.0.options = v.into();
1027 self
1028 }
1029
1030 pub async fn send(self) -> Result<crate::model::Statefile> {
1032 (*self.0.stub)
1033 .export_deployment_statefile(self.0.request, self.0.options)
1034 .await
1035 .map(gax::response::Response::into_body)
1036 }
1037
1038 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1042 self.0.request.parent = v.into();
1043 self
1044 }
1045
1046 pub fn set_draft<T: Into<bool>>(mut self, v: T) -> Self {
1048 self.0.request.draft = v.into();
1049 self
1050 }
1051 }
1052
1053 #[doc(hidden)]
1054 impl gax::options::internal::RequestBuilder for ExportDeploymentStatefile {
1055 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1056 &mut self.0.options
1057 }
1058 }
1059
1060 #[derive(Clone, Debug)]
1077 pub struct ExportRevisionStatefile(
1078 RequestBuilder<crate::model::ExportRevisionStatefileRequest>,
1079 );
1080
1081 impl ExportRevisionStatefile {
1082 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1083 Self(RequestBuilder::new(stub))
1084 }
1085
1086 pub fn with_request<V: Into<crate::model::ExportRevisionStatefileRequest>>(
1088 mut self,
1089 v: V,
1090 ) -> Self {
1091 self.0.request = v.into();
1092 self
1093 }
1094
1095 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1097 self.0.options = v.into();
1098 self
1099 }
1100
1101 pub async fn send(self) -> Result<crate::model::Statefile> {
1103 (*self.0.stub)
1104 .export_revision_statefile(self.0.request, self.0.options)
1105 .await
1106 .map(gax::response::Response::into_body)
1107 }
1108
1109 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1113 self.0.request.parent = v.into();
1114 self
1115 }
1116 }
1117
1118 #[doc(hidden)]
1119 impl gax::options::internal::RequestBuilder for ExportRevisionStatefile {
1120 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1121 &mut self.0.options
1122 }
1123 }
1124
1125 #[derive(Clone, Debug)]
1142 pub struct ImportStatefile(RequestBuilder<crate::model::ImportStatefileRequest>);
1143
1144 impl ImportStatefile {
1145 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1146 Self(RequestBuilder::new(stub))
1147 }
1148
1149 pub fn with_request<V: Into<crate::model::ImportStatefileRequest>>(mut self, v: V) -> Self {
1151 self.0.request = v.into();
1152 self
1153 }
1154
1155 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1157 self.0.options = v.into();
1158 self
1159 }
1160
1161 pub async fn send(self) -> Result<crate::model::Statefile> {
1163 (*self.0.stub)
1164 .import_statefile(self.0.request, self.0.options)
1165 .await
1166 .map(gax::response::Response::into_body)
1167 }
1168
1169 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1173 self.0.request.parent = v.into();
1174 self
1175 }
1176
1177 pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1181 self.0.request.lock_id = v.into();
1182 self
1183 }
1184
1185 pub fn set_skip_draft<T: Into<bool>>(mut self, v: T) -> Self {
1187 self.0.request.skip_draft = v.into();
1188 self
1189 }
1190 }
1191
1192 #[doc(hidden)]
1193 impl gax::options::internal::RequestBuilder for ImportStatefile {
1194 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1195 &mut self.0.options
1196 }
1197 }
1198
1199 #[derive(Clone, Debug)]
1216 pub struct DeleteStatefile(RequestBuilder<crate::model::DeleteStatefileRequest>);
1217
1218 impl DeleteStatefile {
1219 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1220 Self(RequestBuilder::new(stub))
1221 }
1222
1223 pub fn with_request<V: Into<crate::model::DeleteStatefileRequest>>(mut self, v: V) -> Self {
1225 self.0.request = v.into();
1226 self
1227 }
1228
1229 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1231 self.0.options = v.into();
1232 self
1233 }
1234
1235 pub async fn send(self) -> Result<()> {
1237 (*self.0.stub)
1238 .delete_statefile(self.0.request, self.0.options)
1239 .await
1240 .map(gax::response::Response::into_body)
1241 }
1242
1243 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1247 self.0.request.name = v.into();
1248 self
1249 }
1250
1251 pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1255 self.0.request.lock_id = v.into();
1256 self
1257 }
1258 }
1259
1260 #[doc(hidden)]
1261 impl gax::options::internal::RequestBuilder for DeleteStatefile {
1262 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1263 &mut self.0.options
1264 }
1265 }
1266
1267 #[derive(Clone, Debug)]
1285 pub struct LockDeployment(RequestBuilder<crate::model::LockDeploymentRequest>);
1286
1287 impl LockDeployment {
1288 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1289 Self(RequestBuilder::new(stub))
1290 }
1291
1292 pub fn with_request<V: Into<crate::model::LockDeploymentRequest>>(mut self, v: V) -> Self {
1294 self.0.request = v.into();
1295 self
1296 }
1297
1298 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1300 self.0.options = v.into();
1301 self
1302 }
1303
1304 pub async fn send(self) -> Result<longrunning::model::Operation> {
1311 (*self.0.stub)
1312 .lock_deployment(self.0.request, self.0.options)
1313 .await
1314 .map(gax::response::Response::into_body)
1315 }
1316
1317 pub fn poller(
1319 self,
1320 ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
1321 type Operation =
1322 lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
1323 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1324 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1325
1326 let stub = self.0.stub.clone();
1327 let mut options = self.0.options.clone();
1328 options.set_retry_policy(gax::retry_policy::NeverRetry);
1329 let query = move |name| {
1330 let stub = stub.clone();
1331 let options = options.clone();
1332 async {
1333 let op = GetOperation::new(stub)
1334 .set_name(name)
1335 .with_options(options)
1336 .send()
1337 .await?;
1338 Ok(Operation::new(op))
1339 }
1340 };
1341
1342 let start = move || async {
1343 let op = self.send().await?;
1344 Ok(Operation::new(op))
1345 };
1346
1347 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1348 }
1349
1350 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1354 self.0.request.name = v.into();
1355 self
1356 }
1357 }
1358
1359 #[doc(hidden)]
1360 impl gax::options::internal::RequestBuilder for LockDeployment {
1361 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1362 &mut self.0.options
1363 }
1364 }
1365
1366 #[derive(Clone, Debug)]
1384 pub struct UnlockDeployment(RequestBuilder<crate::model::UnlockDeploymentRequest>);
1385
1386 impl UnlockDeployment {
1387 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1388 Self(RequestBuilder::new(stub))
1389 }
1390
1391 pub fn with_request<V: Into<crate::model::UnlockDeploymentRequest>>(
1393 mut self,
1394 v: V,
1395 ) -> Self {
1396 self.0.request = v.into();
1397 self
1398 }
1399
1400 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1402 self.0.options = v.into();
1403 self
1404 }
1405
1406 pub async fn send(self) -> Result<longrunning::model::Operation> {
1413 (*self.0.stub)
1414 .unlock_deployment(self.0.request, self.0.options)
1415 .await
1416 .map(gax::response::Response::into_body)
1417 }
1418
1419 pub fn poller(
1421 self,
1422 ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
1423 type Operation =
1424 lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
1425 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1426 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1427
1428 let stub = self.0.stub.clone();
1429 let mut options = self.0.options.clone();
1430 options.set_retry_policy(gax::retry_policy::NeverRetry);
1431 let query = move |name| {
1432 let stub = stub.clone();
1433 let options = options.clone();
1434 async {
1435 let op = GetOperation::new(stub)
1436 .set_name(name)
1437 .with_options(options)
1438 .send()
1439 .await?;
1440 Ok(Operation::new(op))
1441 }
1442 };
1443
1444 let start = move || async {
1445 let op = self.send().await?;
1446 Ok(Operation::new(op))
1447 };
1448
1449 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1450 }
1451
1452 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1456 self.0.request.name = v.into();
1457 self
1458 }
1459
1460 pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1464 self.0.request.lock_id = v.into();
1465 self
1466 }
1467 }
1468
1469 #[doc(hidden)]
1470 impl gax::options::internal::RequestBuilder for UnlockDeployment {
1471 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1472 &mut self.0.options
1473 }
1474 }
1475
1476 #[derive(Clone, Debug)]
1493 pub struct ExportLockInfo(RequestBuilder<crate::model::ExportLockInfoRequest>);
1494
1495 impl ExportLockInfo {
1496 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1497 Self(RequestBuilder::new(stub))
1498 }
1499
1500 pub fn with_request<V: Into<crate::model::ExportLockInfoRequest>>(mut self, v: V) -> Self {
1502 self.0.request = v.into();
1503 self
1504 }
1505
1506 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1508 self.0.options = v.into();
1509 self
1510 }
1511
1512 pub async fn send(self) -> Result<crate::model::LockInfo> {
1514 (*self.0.stub)
1515 .export_lock_info(self.0.request, self.0.options)
1516 .await
1517 .map(gax::response::Response::into_body)
1518 }
1519
1520 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1524 self.0.request.name = v.into();
1525 self
1526 }
1527 }
1528
1529 #[doc(hidden)]
1530 impl gax::options::internal::RequestBuilder for ExportLockInfo {
1531 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1532 &mut self.0.options
1533 }
1534 }
1535
1536 #[derive(Clone, Debug)]
1554 pub struct CreatePreview(RequestBuilder<crate::model::CreatePreviewRequest>);
1555
1556 impl CreatePreview {
1557 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1558 Self(RequestBuilder::new(stub))
1559 }
1560
1561 pub fn with_request<V: Into<crate::model::CreatePreviewRequest>>(mut self, v: V) -> Self {
1563 self.0.request = v.into();
1564 self
1565 }
1566
1567 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1569 self.0.options = v.into();
1570 self
1571 }
1572
1573 pub async fn send(self) -> Result<longrunning::model::Operation> {
1580 (*self.0.stub)
1581 .create_preview(self.0.request, self.0.options)
1582 .await
1583 .map(gax::response::Response::into_body)
1584 }
1585
1586 pub fn poller(
1588 self,
1589 ) -> impl lro::Poller<crate::model::Preview, crate::model::OperationMetadata> {
1590 type Operation =
1591 lro::internal::Operation<crate::model::Preview, crate::model::OperationMetadata>;
1592 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1593 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1594
1595 let stub = self.0.stub.clone();
1596 let mut options = self.0.options.clone();
1597 options.set_retry_policy(gax::retry_policy::NeverRetry);
1598 let query = move |name| {
1599 let stub = stub.clone();
1600 let options = options.clone();
1601 async {
1602 let op = GetOperation::new(stub)
1603 .set_name(name)
1604 .with_options(options)
1605 .send()
1606 .await?;
1607 Ok(Operation::new(op))
1608 }
1609 };
1610
1611 let start = move || async {
1612 let op = self.send().await?;
1613 Ok(Operation::new(op))
1614 };
1615
1616 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1617 }
1618
1619 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1623 self.0.request.parent = v.into();
1624 self
1625 }
1626
1627 pub fn set_preview_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1629 self.0.request.preview_id = v.into();
1630 self
1631 }
1632
1633 pub fn set_preview<T>(mut self, v: T) -> Self
1637 where
1638 T: std::convert::Into<crate::model::Preview>,
1639 {
1640 self.0.request.preview = std::option::Option::Some(v.into());
1641 self
1642 }
1643
1644 pub fn set_or_clear_preview<T>(mut self, v: std::option::Option<T>) -> Self
1648 where
1649 T: std::convert::Into<crate::model::Preview>,
1650 {
1651 self.0.request.preview = v.map(|x| x.into());
1652 self
1653 }
1654
1655 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1657 self.0.request.request_id = v.into();
1658 self
1659 }
1660 }
1661
1662 #[doc(hidden)]
1663 impl gax::options::internal::RequestBuilder for CreatePreview {
1664 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1665 &mut self.0.options
1666 }
1667 }
1668
1669 #[derive(Clone, Debug)]
1686 pub struct GetPreview(RequestBuilder<crate::model::GetPreviewRequest>);
1687
1688 impl GetPreview {
1689 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1690 Self(RequestBuilder::new(stub))
1691 }
1692
1693 pub fn with_request<V: Into<crate::model::GetPreviewRequest>>(mut self, v: V) -> Self {
1695 self.0.request = v.into();
1696 self
1697 }
1698
1699 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1701 self.0.options = v.into();
1702 self
1703 }
1704
1705 pub async fn send(self) -> Result<crate::model::Preview> {
1707 (*self.0.stub)
1708 .get_preview(self.0.request, self.0.options)
1709 .await
1710 .map(gax::response::Response::into_body)
1711 }
1712
1713 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1717 self.0.request.name = v.into();
1718 self
1719 }
1720 }
1721
1722 #[doc(hidden)]
1723 impl gax::options::internal::RequestBuilder for GetPreview {
1724 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1725 &mut self.0.options
1726 }
1727 }
1728
1729 #[derive(Clone, Debug)]
1750 pub struct ListPreviews(RequestBuilder<crate::model::ListPreviewsRequest>);
1751
1752 impl ListPreviews {
1753 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1754 Self(RequestBuilder::new(stub))
1755 }
1756
1757 pub fn with_request<V: Into<crate::model::ListPreviewsRequest>>(mut self, v: V) -> Self {
1759 self.0.request = v.into();
1760 self
1761 }
1762
1763 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1765 self.0.options = v.into();
1766 self
1767 }
1768
1769 pub async fn send(self) -> Result<crate::model::ListPreviewsResponse> {
1771 (*self.0.stub)
1772 .list_previews(self.0.request, self.0.options)
1773 .await
1774 .map(gax::response::Response::into_body)
1775 }
1776
1777 pub fn by_page(
1779 self,
1780 ) -> impl gax::paginator::Paginator<crate::model::ListPreviewsResponse, gax::error::Error>
1781 {
1782 use std::clone::Clone;
1783 let token = self.0.request.page_token.clone();
1784 let execute = move |token: String| {
1785 let mut builder = self.clone();
1786 builder.0.request = builder.0.request.set_page_token(token);
1787 builder.send()
1788 };
1789 gax::paginator::internal::new_paginator(token, execute)
1790 }
1791
1792 pub fn by_item(
1794 self,
1795 ) -> impl gax::paginator::ItemPaginator<crate::model::ListPreviewsResponse, gax::error::Error>
1796 {
1797 use gax::paginator::Paginator;
1798 self.by_page().items()
1799 }
1800
1801 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1805 self.0.request.parent = v.into();
1806 self
1807 }
1808
1809 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1811 self.0.request.page_size = v.into();
1812 self
1813 }
1814
1815 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1817 self.0.request.page_token = v.into();
1818 self
1819 }
1820
1821 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1823 self.0.request.filter = v.into();
1824 self
1825 }
1826
1827 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1829 self.0.request.order_by = v.into();
1830 self
1831 }
1832 }
1833
1834 #[doc(hidden)]
1835 impl gax::options::internal::RequestBuilder for ListPreviews {
1836 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1837 &mut self.0.options
1838 }
1839 }
1840
1841 #[derive(Clone, Debug)]
1859 pub struct DeletePreview(RequestBuilder<crate::model::DeletePreviewRequest>);
1860
1861 impl DeletePreview {
1862 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1863 Self(RequestBuilder::new(stub))
1864 }
1865
1866 pub fn with_request<V: Into<crate::model::DeletePreviewRequest>>(mut self, v: V) -> Self {
1868 self.0.request = v.into();
1869 self
1870 }
1871
1872 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1874 self.0.options = v.into();
1875 self
1876 }
1877
1878 pub async fn send(self) -> Result<longrunning::model::Operation> {
1885 (*self.0.stub)
1886 .delete_preview(self.0.request, self.0.options)
1887 .await
1888 .map(gax::response::Response::into_body)
1889 }
1890
1891 pub fn poller(
1893 self,
1894 ) -> impl lro::Poller<crate::model::Preview, crate::model::OperationMetadata> {
1895 type Operation =
1896 lro::internal::Operation<crate::model::Preview, crate::model::OperationMetadata>;
1897 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1898 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1899
1900 let stub = self.0.stub.clone();
1901 let mut options = self.0.options.clone();
1902 options.set_retry_policy(gax::retry_policy::NeverRetry);
1903 let query = move |name| {
1904 let stub = stub.clone();
1905 let options = options.clone();
1906 async {
1907 let op = GetOperation::new(stub)
1908 .set_name(name)
1909 .with_options(options)
1910 .send()
1911 .await?;
1912 Ok(Operation::new(op))
1913 }
1914 };
1915
1916 let start = move || async {
1917 let op = self.send().await?;
1918 Ok(Operation::new(op))
1919 };
1920
1921 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1922 }
1923
1924 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1928 self.0.request.name = v.into();
1929 self
1930 }
1931
1932 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1934 self.0.request.request_id = v.into();
1935 self
1936 }
1937 }
1938
1939 #[doc(hidden)]
1940 impl gax::options::internal::RequestBuilder for DeletePreview {
1941 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1942 &mut self.0.options
1943 }
1944 }
1945
1946 #[derive(Clone, Debug)]
1963 pub struct ExportPreviewResult(RequestBuilder<crate::model::ExportPreviewResultRequest>);
1964
1965 impl ExportPreviewResult {
1966 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1967 Self(RequestBuilder::new(stub))
1968 }
1969
1970 pub fn with_request<V: Into<crate::model::ExportPreviewResultRequest>>(
1972 mut self,
1973 v: V,
1974 ) -> Self {
1975 self.0.request = v.into();
1976 self
1977 }
1978
1979 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1981 self.0.options = v.into();
1982 self
1983 }
1984
1985 pub async fn send(self) -> Result<crate::model::ExportPreviewResultResponse> {
1987 (*self.0.stub)
1988 .export_preview_result(self.0.request, self.0.options)
1989 .await
1990 .map(gax::response::Response::into_body)
1991 }
1992
1993 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1997 self.0.request.parent = v.into();
1998 self
1999 }
2000 }
2001
2002 #[doc(hidden)]
2003 impl gax::options::internal::RequestBuilder for ExportPreviewResult {
2004 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2005 &mut self.0.options
2006 }
2007 }
2008
2009 #[derive(Clone, Debug)]
2030 pub struct ListTerraformVersions(RequestBuilder<crate::model::ListTerraformVersionsRequest>);
2031
2032 impl ListTerraformVersions {
2033 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2034 Self(RequestBuilder::new(stub))
2035 }
2036
2037 pub fn with_request<V: Into<crate::model::ListTerraformVersionsRequest>>(
2039 mut self,
2040 v: V,
2041 ) -> Self {
2042 self.0.request = v.into();
2043 self
2044 }
2045
2046 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2048 self.0.options = v.into();
2049 self
2050 }
2051
2052 pub async fn send(self) -> Result<crate::model::ListTerraformVersionsResponse> {
2054 (*self.0.stub)
2055 .list_terraform_versions(self.0.request, self.0.options)
2056 .await
2057 .map(gax::response::Response::into_body)
2058 }
2059
2060 pub fn by_page(
2062 self,
2063 ) -> impl gax::paginator::Paginator<crate::model::ListTerraformVersionsResponse, gax::error::Error>
2064 {
2065 use std::clone::Clone;
2066 let token = self.0.request.page_token.clone();
2067 let execute = move |token: String| {
2068 let mut builder = self.clone();
2069 builder.0.request = builder.0.request.set_page_token(token);
2070 builder.send()
2071 };
2072 gax::paginator::internal::new_paginator(token, execute)
2073 }
2074
2075 pub fn by_item(
2077 self,
2078 ) -> impl gax::paginator::ItemPaginator<
2079 crate::model::ListTerraformVersionsResponse,
2080 gax::error::Error,
2081 > {
2082 use gax::paginator::Paginator;
2083 self.by_page().items()
2084 }
2085
2086 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2090 self.0.request.parent = v.into();
2091 self
2092 }
2093
2094 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2096 self.0.request.page_size = v.into();
2097 self
2098 }
2099
2100 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2102 self.0.request.page_token = v.into();
2103 self
2104 }
2105
2106 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2108 self.0.request.filter = v.into();
2109 self
2110 }
2111
2112 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2114 self.0.request.order_by = v.into();
2115 self
2116 }
2117 }
2118
2119 #[doc(hidden)]
2120 impl gax::options::internal::RequestBuilder for ListTerraformVersions {
2121 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2122 &mut self.0.options
2123 }
2124 }
2125
2126 #[derive(Clone, Debug)]
2143 pub struct GetTerraformVersion(RequestBuilder<crate::model::GetTerraformVersionRequest>);
2144
2145 impl GetTerraformVersion {
2146 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2147 Self(RequestBuilder::new(stub))
2148 }
2149
2150 pub fn with_request<V: Into<crate::model::GetTerraformVersionRequest>>(
2152 mut self,
2153 v: V,
2154 ) -> Self {
2155 self.0.request = v.into();
2156 self
2157 }
2158
2159 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2161 self.0.options = v.into();
2162 self
2163 }
2164
2165 pub async fn send(self) -> Result<crate::model::TerraformVersion> {
2167 (*self.0.stub)
2168 .get_terraform_version(self.0.request, self.0.options)
2169 .await
2170 .map(gax::response::Response::into_body)
2171 }
2172
2173 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2177 self.0.request.name = v.into();
2178 self
2179 }
2180 }
2181
2182 #[doc(hidden)]
2183 impl gax::options::internal::RequestBuilder for GetTerraformVersion {
2184 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2185 &mut self.0.options
2186 }
2187 }
2188
2189 #[derive(Clone, Debug)]
2210 pub struct ListResourceChanges(RequestBuilder<crate::model::ListResourceChangesRequest>);
2211
2212 impl ListResourceChanges {
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::ListResourceChangesRequest>>(
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<gax::options::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::ListResourceChangesResponse> {
2234 (*self.0.stub)
2235 .list_resource_changes(self.0.request, self.0.options)
2236 .await
2237 .map(gax::response::Response::into_body)
2238 }
2239
2240 pub fn by_page(
2242 self,
2243 ) -> impl gax::paginator::Paginator<crate::model::ListResourceChangesResponse, gax::error::Error>
2244 {
2245 use std::clone::Clone;
2246 let token = self.0.request.page_token.clone();
2247 let execute = move |token: String| {
2248 let mut builder = self.clone();
2249 builder.0.request = builder.0.request.set_page_token(token);
2250 builder.send()
2251 };
2252 gax::paginator::internal::new_paginator(token, execute)
2253 }
2254
2255 pub fn by_item(
2257 self,
2258 ) -> impl gax::paginator::ItemPaginator<
2259 crate::model::ListResourceChangesResponse,
2260 gax::error::Error,
2261 > {
2262 use gax::paginator::Paginator;
2263 self.by_page().items()
2264 }
2265
2266 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2270 self.0.request.parent = v.into();
2271 self
2272 }
2273
2274 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2276 self.0.request.page_size = v.into();
2277 self
2278 }
2279
2280 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2282 self.0.request.page_token = v.into();
2283 self
2284 }
2285
2286 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2288 self.0.request.filter = v.into();
2289 self
2290 }
2291
2292 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2294 self.0.request.order_by = v.into();
2295 self
2296 }
2297 }
2298
2299 #[doc(hidden)]
2300 impl gax::options::internal::RequestBuilder for ListResourceChanges {
2301 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2302 &mut self.0.options
2303 }
2304 }
2305
2306 #[derive(Clone, Debug)]
2323 pub struct GetResourceChange(RequestBuilder<crate::model::GetResourceChangeRequest>);
2324
2325 impl GetResourceChange {
2326 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2327 Self(RequestBuilder::new(stub))
2328 }
2329
2330 pub fn with_request<V: Into<crate::model::GetResourceChangeRequest>>(
2332 mut self,
2333 v: V,
2334 ) -> Self {
2335 self.0.request = v.into();
2336 self
2337 }
2338
2339 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2341 self.0.options = v.into();
2342 self
2343 }
2344
2345 pub async fn send(self) -> Result<crate::model::ResourceChange> {
2347 (*self.0.stub)
2348 .get_resource_change(self.0.request, self.0.options)
2349 .await
2350 .map(gax::response::Response::into_body)
2351 }
2352
2353 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2357 self.0.request.name = v.into();
2358 self
2359 }
2360 }
2361
2362 #[doc(hidden)]
2363 impl gax::options::internal::RequestBuilder for GetResourceChange {
2364 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2365 &mut self.0.options
2366 }
2367 }
2368
2369 #[derive(Clone, Debug)]
2390 pub struct ListResourceDrifts(RequestBuilder<crate::model::ListResourceDriftsRequest>);
2391
2392 impl ListResourceDrifts {
2393 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2394 Self(RequestBuilder::new(stub))
2395 }
2396
2397 pub fn with_request<V: Into<crate::model::ListResourceDriftsRequest>>(
2399 mut self,
2400 v: V,
2401 ) -> Self {
2402 self.0.request = v.into();
2403 self
2404 }
2405
2406 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2408 self.0.options = v.into();
2409 self
2410 }
2411
2412 pub async fn send(self) -> Result<crate::model::ListResourceDriftsResponse> {
2414 (*self.0.stub)
2415 .list_resource_drifts(self.0.request, self.0.options)
2416 .await
2417 .map(gax::response::Response::into_body)
2418 }
2419
2420 pub fn by_page(
2422 self,
2423 ) -> impl gax::paginator::Paginator<crate::model::ListResourceDriftsResponse, gax::error::Error>
2424 {
2425 use std::clone::Clone;
2426 let token = self.0.request.page_token.clone();
2427 let execute = move |token: String| {
2428 let mut builder = self.clone();
2429 builder.0.request = builder.0.request.set_page_token(token);
2430 builder.send()
2431 };
2432 gax::paginator::internal::new_paginator(token, execute)
2433 }
2434
2435 pub fn by_item(
2437 self,
2438 ) -> impl gax::paginator::ItemPaginator<
2439 crate::model::ListResourceDriftsResponse,
2440 gax::error::Error,
2441 > {
2442 use gax::paginator::Paginator;
2443 self.by_page().items()
2444 }
2445
2446 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2450 self.0.request.parent = v.into();
2451 self
2452 }
2453
2454 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2456 self.0.request.page_size = v.into();
2457 self
2458 }
2459
2460 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2462 self.0.request.page_token = v.into();
2463 self
2464 }
2465
2466 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2468 self.0.request.filter = v.into();
2469 self
2470 }
2471
2472 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2474 self.0.request.order_by = v.into();
2475 self
2476 }
2477 }
2478
2479 #[doc(hidden)]
2480 impl gax::options::internal::RequestBuilder for ListResourceDrifts {
2481 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2482 &mut self.0.options
2483 }
2484 }
2485
2486 #[derive(Clone, Debug)]
2503 pub struct GetResourceDrift(RequestBuilder<crate::model::GetResourceDriftRequest>);
2504
2505 impl GetResourceDrift {
2506 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2507 Self(RequestBuilder::new(stub))
2508 }
2509
2510 pub fn with_request<V: Into<crate::model::GetResourceDriftRequest>>(
2512 mut self,
2513 v: V,
2514 ) -> Self {
2515 self.0.request = v.into();
2516 self
2517 }
2518
2519 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2521 self.0.options = v.into();
2522 self
2523 }
2524
2525 pub async fn send(self) -> Result<crate::model::ResourceDrift> {
2527 (*self.0.stub)
2528 .get_resource_drift(self.0.request, self.0.options)
2529 .await
2530 .map(gax::response::Response::into_body)
2531 }
2532
2533 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2537 self.0.request.name = v.into();
2538 self
2539 }
2540 }
2541
2542 #[doc(hidden)]
2543 impl gax::options::internal::RequestBuilder for GetResourceDrift {
2544 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2545 &mut self.0.options
2546 }
2547 }
2548
2549 #[derive(Clone, Debug)]
2566 pub struct GetAutoMigrationConfig(RequestBuilder<crate::model::GetAutoMigrationConfigRequest>);
2567
2568 impl GetAutoMigrationConfig {
2569 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2570 Self(RequestBuilder::new(stub))
2571 }
2572
2573 pub fn with_request<V: Into<crate::model::GetAutoMigrationConfigRequest>>(
2575 mut self,
2576 v: V,
2577 ) -> Self {
2578 self.0.request = v.into();
2579 self
2580 }
2581
2582 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2584 self.0.options = v.into();
2585 self
2586 }
2587
2588 pub async fn send(self) -> Result<crate::model::AutoMigrationConfig> {
2590 (*self.0.stub)
2591 .get_auto_migration_config(self.0.request, self.0.options)
2592 .await
2593 .map(gax::response::Response::into_body)
2594 }
2595
2596 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2600 self.0.request.name = v.into();
2601 self
2602 }
2603 }
2604
2605 #[doc(hidden)]
2606 impl gax::options::internal::RequestBuilder for GetAutoMigrationConfig {
2607 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2608 &mut self.0.options
2609 }
2610 }
2611
2612 #[derive(Clone, Debug)]
2630 pub struct UpdateAutoMigrationConfig(
2631 RequestBuilder<crate::model::UpdateAutoMigrationConfigRequest>,
2632 );
2633
2634 impl UpdateAutoMigrationConfig {
2635 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2636 Self(RequestBuilder::new(stub))
2637 }
2638
2639 pub fn with_request<V: Into<crate::model::UpdateAutoMigrationConfigRequest>>(
2641 mut self,
2642 v: V,
2643 ) -> Self {
2644 self.0.request = v.into();
2645 self
2646 }
2647
2648 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2650 self.0.options = v.into();
2651 self
2652 }
2653
2654 pub async fn send(self) -> Result<longrunning::model::Operation> {
2661 (*self.0.stub)
2662 .update_auto_migration_config(self.0.request, self.0.options)
2663 .await
2664 .map(gax::response::Response::into_body)
2665 }
2666
2667 pub fn poller(
2669 self,
2670 ) -> impl lro::Poller<crate::model::AutoMigrationConfig, crate::model::OperationMetadata>
2671 {
2672 type Operation = lro::internal::Operation<
2673 crate::model::AutoMigrationConfig,
2674 crate::model::OperationMetadata,
2675 >;
2676 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2677 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2678
2679 let stub = self.0.stub.clone();
2680 let mut options = self.0.options.clone();
2681 options.set_retry_policy(gax::retry_policy::NeverRetry);
2682 let query = move |name| {
2683 let stub = stub.clone();
2684 let options = options.clone();
2685 async {
2686 let op = GetOperation::new(stub)
2687 .set_name(name)
2688 .with_options(options)
2689 .send()
2690 .await?;
2691 Ok(Operation::new(op))
2692 }
2693 };
2694
2695 let start = move || async {
2696 let op = self.send().await?;
2697 Ok(Operation::new(op))
2698 };
2699
2700 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2701 }
2702
2703 pub fn set_update_mask<T>(mut self, v: T) -> Self
2705 where
2706 T: std::convert::Into<wkt::FieldMask>,
2707 {
2708 self.0.request.update_mask = std::option::Option::Some(v.into());
2709 self
2710 }
2711
2712 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2714 where
2715 T: std::convert::Into<wkt::FieldMask>,
2716 {
2717 self.0.request.update_mask = v.map(|x| x.into());
2718 self
2719 }
2720
2721 pub fn set_auto_migration_config<T>(mut self, v: T) -> Self
2725 where
2726 T: std::convert::Into<crate::model::AutoMigrationConfig>,
2727 {
2728 self.0.request.auto_migration_config = std::option::Option::Some(v.into());
2729 self
2730 }
2731
2732 pub fn set_or_clear_auto_migration_config<T>(mut self, v: std::option::Option<T>) -> Self
2736 where
2737 T: std::convert::Into<crate::model::AutoMigrationConfig>,
2738 {
2739 self.0.request.auto_migration_config = v.map(|x| x.into());
2740 self
2741 }
2742 }
2743
2744 #[doc(hidden)]
2745 impl gax::options::internal::RequestBuilder for UpdateAutoMigrationConfig {
2746 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2747 &mut self.0.options
2748 }
2749 }
2750
2751 #[derive(Clone, Debug)]
2772 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2773
2774 impl ListLocations {
2775 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2776 Self(RequestBuilder::new(stub))
2777 }
2778
2779 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2781 mut self,
2782 v: V,
2783 ) -> Self {
2784 self.0.request = v.into();
2785 self
2786 }
2787
2788 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2790 self.0.options = v.into();
2791 self
2792 }
2793
2794 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2796 (*self.0.stub)
2797 .list_locations(self.0.request, self.0.options)
2798 .await
2799 .map(gax::response::Response::into_body)
2800 }
2801
2802 pub fn by_page(
2804 self,
2805 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2806 {
2807 use std::clone::Clone;
2808 let token = self.0.request.page_token.clone();
2809 let execute = move |token: String| {
2810 let mut builder = self.clone();
2811 builder.0.request = builder.0.request.set_page_token(token);
2812 builder.send()
2813 };
2814 gax::paginator::internal::new_paginator(token, execute)
2815 }
2816
2817 pub fn by_item(
2819 self,
2820 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2821 {
2822 use gax::paginator::Paginator;
2823 self.by_page().items()
2824 }
2825
2826 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2828 self.0.request.name = v.into();
2829 self
2830 }
2831
2832 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2834 self.0.request.filter = v.into();
2835 self
2836 }
2837
2838 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2840 self.0.request.page_size = v.into();
2841 self
2842 }
2843
2844 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2846 self.0.request.page_token = v.into();
2847 self
2848 }
2849 }
2850
2851 #[doc(hidden)]
2852 impl gax::options::internal::RequestBuilder for ListLocations {
2853 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2854 &mut self.0.options
2855 }
2856 }
2857
2858 #[derive(Clone, Debug)]
2875 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2876
2877 impl GetLocation {
2878 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2879 Self(RequestBuilder::new(stub))
2880 }
2881
2882 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2884 self.0.request = v.into();
2885 self
2886 }
2887
2888 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2890 self.0.options = v.into();
2891 self
2892 }
2893
2894 pub async fn send(self) -> Result<location::model::Location> {
2896 (*self.0.stub)
2897 .get_location(self.0.request, self.0.options)
2898 .await
2899 .map(gax::response::Response::into_body)
2900 }
2901
2902 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2904 self.0.request.name = v.into();
2905 self
2906 }
2907 }
2908
2909 #[doc(hidden)]
2910 impl gax::options::internal::RequestBuilder for GetLocation {
2911 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2912 &mut self.0.options
2913 }
2914 }
2915
2916 #[derive(Clone, Debug)]
2933 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2934
2935 impl SetIamPolicy {
2936 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2937 Self(RequestBuilder::new(stub))
2938 }
2939
2940 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2942 self.0.request = v.into();
2943 self
2944 }
2945
2946 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2948 self.0.options = v.into();
2949 self
2950 }
2951
2952 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2954 (*self.0.stub)
2955 .set_iam_policy(self.0.request, self.0.options)
2956 .await
2957 .map(gax::response::Response::into_body)
2958 }
2959
2960 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2964 self.0.request.resource = v.into();
2965 self
2966 }
2967
2968 pub fn set_policy<T>(mut self, v: T) -> Self
2972 where
2973 T: std::convert::Into<iam_v1::model::Policy>,
2974 {
2975 self.0.request.policy = std::option::Option::Some(v.into());
2976 self
2977 }
2978
2979 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2983 where
2984 T: std::convert::Into<iam_v1::model::Policy>,
2985 {
2986 self.0.request.policy = v.map(|x| x.into());
2987 self
2988 }
2989
2990 pub fn set_update_mask<T>(mut self, v: T) -> Self
2992 where
2993 T: std::convert::Into<wkt::FieldMask>,
2994 {
2995 self.0.request.update_mask = std::option::Option::Some(v.into());
2996 self
2997 }
2998
2999 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3001 where
3002 T: std::convert::Into<wkt::FieldMask>,
3003 {
3004 self.0.request.update_mask = v.map(|x| x.into());
3005 self
3006 }
3007 }
3008
3009 #[doc(hidden)]
3010 impl gax::options::internal::RequestBuilder for SetIamPolicy {
3011 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3012 &mut self.0.options
3013 }
3014 }
3015
3016 #[derive(Clone, Debug)]
3033 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
3034
3035 impl GetIamPolicy {
3036 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3037 Self(RequestBuilder::new(stub))
3038 }
3039
3040 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
3042 self.0.request = v.into();
3043 self
3044 }
3045
3046 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3048 self.0.options = v.into();
3049 self
3050 }
3051
3052 pub async fn send(self) -> Result<iam_v1::model::Policy> {
3054 (*self.0.stub)
3055 .get_iam_policy(self.0.request, self.0.options)
3056 .await
3057 .map(gax::response::Response::into_body)
3058 }
3059
3060 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3064 self.0.request.resource = v.into();
3065 self
3066 }
3067
3068 pub fn set_options<T>(mut self, v: T) -> Self
3070 where
3071 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3072 {
3073 self.0.request.options = std::option::Option::Some(v.into());
3074 self
3075 }
3076
3077 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3079 where
3080 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3081 {
3082 self.0.request.options = v.map(|x| x.into());
3083 self
3084 }
3085 }
3086
3087 #[doc(hidden)]
3088 impl gax::options::internal::RequestBuilder for GetIamPolicy {
3089 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3090 &mut self.0.options
3091 }
3092 }
3093
3094 #[derive(Clone, Debug)]
3111 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
3112
3113 impl TestIamPermissions {
3114 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3115 Self(RequestBuilder::new(stub))
3116 }
3117
3118 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
3120 mut self,
3121 v: V,
3122 ) -> Self {
3123 self.0.request = v.into();
3124 self
3125 }
3126
3127 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3129 self.0.options = v.into();
3130 self
3131 }
3132
3133 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
3135 (*self.0.stub)
3136 .test_iam_permissions(self.0.request, self.0.options)
3137 .await
3138 .map(gax::response::Response::into_body)
3139 }
3140
3141 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3145 self.0.request.resource = v.into();
3146 self
3147 }
3148
3149 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3153 where
3154 T: std::iter::IntoIterator<Item = V>,
3155 V: std::convert::Into<std::string::String>,
3156 {
3157 use std::iter::Iterator;
3158 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3159 self
3160 }
3161 }
3162
3163 #[doc(hidden)]
3164 impl gax::options::internal::RequestBuilder for TestIamPermissions {
3165 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3166 &mut self.0.options
3167 }
3168 }
3169
3170 #[derive(Clone, Debug)]
3191 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3192
3193 impl ListOperations {
3194 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3195 Self(RequestBuilder::new(stub))
3196 }
3197
3198 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3200 mut self,
3201 v: V,
3202 ) -> Self {
3203 self.0.request = v.into();
3204 self
3205 }
3206
3207 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3209 self.0.options = v.into();
3210 self
3211 }
3212
3213 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3215 (*self.0.stub)
3216 .list_operations(self.0.request, self.0.options)
3217 .await
3218 .map(gax::response::Response::into_body)
3219 }
3220
3221 pub fn by_page(
3223 self,
3224 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3225 {
3226 use std::clone::Clone;
3227 let token = self.0.request.page_token.clone();
3228 let execute = move |token: String| {
3229 let mut builder = self.clone();
3230 builder.0.request = builder.0.request.set_page_token(token);
3231 builder.send()
3232 };
3233 gax::paginator::internal::new_paginator(token, execute)
3234 }
3235
3236 pub fn by_item(
3238 self,
3239 ) -> impl gax::paginator::ItemPaginator<
3240 longrunning::model::ListOperationsResponse,
3241 gax::error::Error,
3242 > {
3243 use gax::paginator::Paginator;
3244 self.by_page().items()
3245 }
3246
3247 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3249 self.0.request.name = v.into();
3250 self
3251 }
3252
3253 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3255 self.0.request.filter = v.into();
3256 self
3257 }
3258
3259 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3261 self.0.request.page_size = v.into();
3262 self
3263 }
3264
3265 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3267 self.0.request.page_token = v.into();
3268 self
3269 }
3270
3271 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3273 self.0.request.return_partial_success = v.into();
3274 self
3275 }
3276 }
3277
3278 #[doc(hidden)]
3279 impl gax::options::internal::RequestBuilder for ListOperations {
3280 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3281 &mut self.0.options
3282 }
3283 }
3284
3285 #[derive(Clone, Debug)]
3302 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3303
3304 impl GetOperation {
3305 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3306 Self(RequestBuilder::new(stub))
3307 }
3308
3309 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3311 mut self,
3312 v: V,
3313 ) -> Self {
3314 self.0.request = v.into();
3315 self
3316 }
3317
3318 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3320 self.0.options = v.into();
3321 self
3322 }
3323
3324 pub async fn send(self) -> Result<longrunning::model::Operation> {
3326 (*self.0.stub)
3327 .get_operation(self.0.request, self.0.options)
3328 .await
3329 .map(gax::response::Response::into_body)
3330 }
3331
3332 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3334 self.0.request.name = v.into();
3335 self
3336 }
3337 }
3338
3339 #[doc(hidden)]
3340 impl gax::options::internal::RequestBuilder for GetOperation {
3341 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3342 &mut self.0.options
3343 }
3344 }
3345
3346 #[derive(Clone, Debug)]
3363 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3364
3365 impl DeleteOperation {
3366 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3367 Self(RequestBuilder::new(stub))
3368 }
3369
3370 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3372 mut self,
3373 v: V,
3374 ) -> Self {
3375 self.0.request = v.into();
3376 self
3377 }
3378
3379 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3381 self.0.options = v.into();
3382 self
3383 }
3384
3385 pub async fn send(self) -> Result<()> {
3387 (*self.0.stub)
3388 .delete_operation(self.0.request, self.0.options)
3389 .await
3390 .map(gax::response::Response::into_body)
3391 }
3392
3393 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3395 self.0.request.name = v.into();
3396 self
3397 }
3398 }
3399
3400 #[doc(hidden)]
3401 impl gax::options::internal::RequestBuilder for DeleteOperation {
3402 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3403 &mut self.0.options
3404 }
3405 }
3406
3407 #[derive(Clone, Debug)]
3424 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3425
3426 impl CancelOperation {
3427 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3428 Self(RequestBuilder::new(stub))
3429 }
3430
3431 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3433 mut self,
3434 v: V,
3435 ) -> Self {
3436 self.0.request = v.into();
3437 self
3438 }
3439
3440 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3442 self.0.options = v.into();
3443 self
3444 }
3445
3446 pub async fn send(self) -> Result<()> {
3448 (*self.0.stub)
3449 .cancel_operation(self.0.request, self.0.options)
3450 .await
3451 .map(gax::response::Response::into_body)
3452 }
3453
3454 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3456 self.0.request.name = v.into();
3457 self
3458 }
3459 }
3460
3461 #[doc(hidden)]
3462 impl gax::options::internal::RequestBuilder for CancelOperation {
3463 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3464 &mut self.0.options
3465 }
3466 }
3467}