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)]
94 pub struct ListDeployments(RequestBuilder<crate::model::ListDeploymentsRequest>);
95
96 impl ListDeployments {
97 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 pub fn with_request<V: Into<crate::model::ListDeploymentsRequest>>(mut self, v: V) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 pub async fn send(self) -> Result<crate::model::ListDeploymentsResponse> {
115 (*self.0.stub)
116 .list_deployments(self.0.request, self.0.options)
117 .await
118 .map(gax::response::Response::into_body)
119 }
120
121 pub fn by_page(
123 self,
124 ) -> impl gax::paginator::Paginator<crate::model::ListDeploymentsResponse, gax::error::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 gax::paginator::internal::new_paginator(token, execute)
134 }
135
136 pub fn by_item(
138 self,
139 ) -> impl gax::paginator::ItemPaginator<crate::model::ListDeploymentsResponse, gax::error::Error>
140 {
141 use gax::paginator::Paginator;
142 self.by_page().items()
143 }
144
145 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
149 self.0.request.parent = v.into();
150 self
151 }
152
153 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
155 self.0.request.page_size = v.into();
156 self
157 }
158
159 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
161 self.0.request.page_token = v.into();
162 self
163 }
164
165 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
167 self.0.request.filter = v.into();
168 self
169 }
170
171 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
173 self.0.request.order_by = v.into();
174 self
175 }
176 }
177
178 #[doc(hidden)]
179 impl gax::options::internal::RequestBuilder for ListDeployments {
180 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
181 &mut self.0.options
182 }
183 }
184
185 #[derive(Clone, Debug)]
203 pub struct GetDeployment(RequestBuilder<crate::model::GetDeploymentRequest>);
204
205 impl GetDeployment {
206 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
207 Self(RequestBuilder::new(stub))
208 }
209
210 pub fn with_request<V: Into<crate::model::GetDeploymentRequest>>(mut self, v: V) -> Self {
212 self.0.request = v.into();
213 self
214 }
215
216 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
218 self.0.options = v.into();
219 self
220 }
221
222 pub async fn send(self) -> Result<crate::model::Deployment> {
224 (*self.0.stub)
225 .get_deployment(self.0.request, self.0.options)
226 .await
227 .map(gax::response::Response::into_body)
228 }
229
230 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
234 self.0.request.name = v.into();
235 self
236 }
237 }
238
239 #[doc(hidden)]
240 impl gax::options::internal::RequestBuilder for GetDeployment {
241 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
242 &mut self.0.options
243 }
244 }
245
246 #[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<gax::options::RequestOptions>>(mut self, v: V) -> Self {
283 self.0.options = v.into();
284 self
285 }
286
287 pub async fn send(self) -> Result<longrunning::model::Operation> {
294 (*self.0.stub)
295 .create_deployment(self.0.request, self.0.options)
296 .await
297 .map(gax::response::Response::into_body)
298 }
299
300 pub fn poller(
302 self,
303 ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
304 type Operation =
305 lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
306 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
307 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
308
309 let stub = self.0.stub.clone();
310 let mut options = self.0.options.clone();
311 options.set_retry_policy(gax::retry_policy::NeverRetry);
312 let query = move |name| {
313 let stub = stub.clone();
314 let options = options.clone();
315 async {
316 let op = GetOperation::new(stub)
317 .set_name(name)
318 .with_options(options)
319 .send()
320 .await?;
321 Ok(Operation::new(op))
322 }
323 };
324
325 let start = move || async {
326 let op = self.send().await?;
327 Ok(Operation::new(op))
328 };
329
330 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
331 }
332
333 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
337 self.0.request.parent = v.into();
338 self
339 }
340
341 pub fn set_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
345 self.0.request.deployment_id = v.into();
346 self
347 }
348
349 pub fn set_deployment<T>(mut self, v: T) -> Self
353 where
354 T: std::convert::Into<crate::model::Deployment>,
355 {
356 self.0.request.deployment = std::option::Option::Some(v.into());
357 self
358 }
359
360 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
364 where
365 T: std::convert::Into<crate::model::Deployment>,
366 {
367 self.0.request.deployment = v.map(|x| x.into());
368 self
369 }
370
371 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
373 self.0.request.request_id = v.into();
374 self
375 }
376 }
377
378 #[doc(hidden)]
379 impl gax::options::internal::RequestBuilder for CreateDeployment {
380 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
381 &mut self.0.options
382 }
383 }
384
385 #[derive(Clone, Debug)]
404 pub struct UpdateDeployment(RequestBuilder<crate::model::UpdateDeploymentRequest>);
405
406 impl UpdateDeployment {
407 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
408 Self(RequestBuilder::new(stub))
409 }
410
411 pub fn with_request<V: Into<crate::model::UpdateDeploymentRequest>>(
413 mut self,
414 v: V,
415 ) -> Self {
416 self.0.request = v.into();
417 self
418 }
419
420 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
422 self.0.options = v.into();
423 self
424 }
425
426 pub async fn send(self) -> Result<longrunning::model::Operation> {
433 (*self.0.stub)
434 .update_deployment(self.0.request, self.0.options)
435 .await
436 .map(gax::response::Response::into_body)
437 }
438
439 pub fn poller(
441 self,
442 ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
443 type Operation =
444 lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
445 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
446 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
447
448 let stub = self.0.stub.clone();
449 let mut options = self.0.options.clone();
450 options.set_retry_policy(gax::retry_policy::NeverRetry);
451 let query = move |name| {
452 let stub = stub.clone();
453 let options = options.clone();
454 async {
455 let op = GetOperation::new(stub)
456 .set_name(name)
457 .with_options(options)
458 .send()
459 .await?;
460 Ok(Operation::new(op))
461 }
462 };
463
464 let start = move || async {
465 let op = self.send().await?;
466 Ok(Operation::new(op))
467 };
468
469 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
470 }
471
472 pub fn set_update_mask<T>(mut self, v: T) -> Self
474 where
475 T: std::convert::Into<wkt::FieldMask>,
476 {
477 self.0.request.update_mask = std::option::Option::Some(v.into());
478 self
479 }
480
481 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
483 where
484 T: std::convert::Into<wkt::FieldMask>,
485 {
486 self.0.request.update_mask = v.map(|x| x.into());
487 self
488 }
489
490 pub fn set_deployment<T>(mut self, v: T) -> Self
494 where
495 T: std::convert::Into<crate::model::Deployment>,
496 {
497 self.0.request.deployment = std::option::Option::Some(v.into());
498 self
499 }
500
501 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
505 where
506 T: std::convert::Into<crate::model::Deployment>,
507 {
508 self.0.request.deployment = v.map(|x| x.into());
509 self
510 }
511
512 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
514 self.0.request.request_id = v.into();
515 self
516 }
517 }
518
519 #[doc(hidden)]
520 impl gax::options::internal::RequestBuilder for UpdateDeployment {
521 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
522 &mut self.0.options
523 }
524 }
525
526 #[derive(Clone, Debug)]
545 pub struct DeleteDeployment(RequestBuilder<crate::model::DeleteDeploymentRequest>);
546
547 impl DeleteDeployment {
548 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
549 Self(RequestBuilder::new(stub))
550 }
551
552 pub fn with_request<V: Into<crate::model::DeleteDeploymentRequest>>(
554 mut self,
555 v: V,
556 ) -> Self {
557 self.0.request = v.into();
558 self
559 }
560
561 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
563 self.0.options = v.into();
564 self
565 }
566
567 pub async fn send(self) -> Result<longrunning::model::Operation> {
574 (*self.0.stub)
575 .delete_deployment(self.0.request, self.0.options)
576 .await
577 .map(gax::response::Response::into_body)
578 }
579
580 pub fn poller(
582 self,
583 ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
584 type Operation =
585 lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
586 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
587 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
588
589 let stub = self.0.stub.clone();
590 let mut options = self.0.options.clone();
591 options.set_retry_policy(gax::retry_policy::NeverRetry);
592 let query = move |name| {
593 let stub = stub.clone();
594 let options = options.clone();
595 async {
596 let op = GetOperation::new(stub)
597 .set_name(name)
598 .with_options(options)
599 .send()
600 .await?;
601 Ok(Operation::new(op))
602 }
603 };
604
605 let start = move || async {
606 let op = self.send().await?;
607 Ok(Operation::new(op))
608 };
609
610 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
611 }
612
613 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
617 self.0.request.name = v.into();
618 self
619 }
620
621 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
623 self.0.request.request_id = v.into();
624 self
625 }
626
627 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
629 self.0.request.force = v.into();
630 self
631 }
632
633 pub fn set_delete_policy<T: Into<crate::model::delete_deployment_request::DeletePolicy>>(
635 mut self,
636 v: T,
637 ) -> Self {
638 self.0.request.delete_policy = v.into();
639 self
640 }
641 }
642
643 #[doc(hidden)]
644 impl gax::options::internal::RequestBuilder for DeleteDeployment {
645 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
646 &mut self.0.options
647 }
648 }
649
650 #[derive(Clone, Debug)]
672 pub struct ListRevisions(RequestBuilder<crate::model::ListRevisionsRequest>);
673
674 impl ListRevisions {
675 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
676 Self(RequestBuilder::new(stub))
677 }
678
679 pub fn with_request<V: Into<crate::model::ListRevisionsRequest>>(mut self, v: V) -> Self {
681 self.0.request = v.into();
682 self
683 }
684
685 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
687 self.0.options = v.into();
688 self
689 }
690
691 pub async fn send(self) -> Result<crate::model::ListRevisionsResponse> {
693 (*self.0.stub)
694 .list_revisions(self.0.request, self.0.options)
695 .await
696 .map(gax::response::Response::into_body)
697 }
698
699 pub fn by_page(
701 self,
702 ) -> impl gax::paginator::Paginator<crate::model::ListRevisionsResponse, gax::error::Error>
703 {
704 use std::clone::Clone;
705 let token = self.0.request.page_token.clone();
706 let execute = move |token: String| {
707 let mut builder = self.clone();
708 builder.0.request = builder.0.request.set_page_token(token);
709 builder.send()
710 };
711 gax::paginator::internal::new_paginator(token, execute)
712 }
713
714 pub fn by_item(
716 self,
717 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRevisionsResponse, gax::error::Error>
718 {
719 use gax::paginator::Paginator;
720 self.by_page().items()
721 }
722
723 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
727 self.0.request.parent = v.into();
728 self
729 }
730
731 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
733 self.0.request.page_size = v.into();
734 self
735 }
736
737 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
739 self.0.request.page_token = v.into();
740 self
741 }
742
743 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
745 self.0.request.filter = v.into();
746 self
747 }
748
749 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
751 self.0.request.order_by = v.into();
752 self
753 }
754 }
755
756 #[doc(hidden)]
757 impl gax::options::internal::RequestBuilder for ListRevisions {
758 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
759 &mut self.0.options
760 }
761 }
762
763 #[derive(Clone, Debug)]
781 pub struct GetRevision(RequestBuilder<crate::model::GetRevisionRequest>);
782
783 impl GetRevision {
784 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
785 Self(RequestBuilder::new(stub))
786 }
787
788 pub fn with_request<V: Into<crate::model::GetRevisionRequest>>(mut self, v: V) -> Self {
790 self.0.request = v.into();
791 self
792 }
793
794 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
796 self.0.options = v.into();
797 self
798 }
799
800 pub async fn send(self) -> Result<crate::model::Revision> {
802 (*self.0.stub)
803 .get_revision(self.0.request, self.0.options)
804 .await
805 .map(gax::response::Response::into_body)
806 }
807
808 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
812 self.0.request.name = v.into();
813 self
814 }
815 }
816
817 #[doc(hidden)]
818 impl gax::options::internal::RequestBuilder for GetRevision {
819 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
820 &mut self.0.options
821 }
822 }
823
824 #[derive(Clone, Debug)]
842 pub struct GetResource(RequestBuilder<crate::model::GetResourceRequest>);
843
844 impl GetResource {
845 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
846 Self(RequestBuilder::new(stub))
847 }
848
849 pub fn with_request<V: Into<crate::model::GetResourceRequest>>(mut self, v: V) -> Self {
851 self.0.request = v.into();
852 self
853 }
854
855 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
857 self.0.options = v.into();
858 self
859 }
860
861 pub async fn send(self) -> Result<crate::model::Resource> {
863 (*self.0.stub)
864 .get_resource(self.0.request, self.0.options)
865 .await
866 .map(gax::response::Response::into_body)
867 }
868
869 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
873 self.0.request.name = v.into();
874 self
875 }
876 }
877
878 #[doc(hidden)]
879 impl gax::options::internal::RequestBuilder for GetResource {
880 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
881 &mut self.0.options
882 }
883 }
884
885 #[derive(Clone, Debug)]
907 pub struct ListResources(RequestBuilder<crate::model::ListResourcesRequest>);
908
909 impl ListResources {
910 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
911 Self(RequestBuilder::new(stub))
912 }
913
914 pub fn with_request<V: Into<crate::model::ListResourcesRequest>>(mut self, v: V) -> Self {
916 self.0.request = v.into();
917 self
918 }
919
920 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
922 self.0.options = v.into();
923 self
924 }
925
926 pub async fn send(self) -> Result<crate::model::ListResourcesResponse> {
928 (*self.0.stub)
929 .list_resources(self.0.request, self.0.options)
930 .await
931 .map(gax::response::Response::into_body)
932 }
933
934 pub fn by_page(
936 self,
937 ) -> impl gax::paginator::Paginator<crate::model::ListResourcesResponse, gax::error::Error>
938 {
939 use std::clone::Clone;
940 let token = self.0.request.page_token.clone();
941 let execute = move |token: String| {
942 let mut builder = self.clone();
943 builder.0.request = builder.0.request.set_page_token(token);
944 builder.send()
945 };
946 gax::paginator::internal::new_paginator(token, execute)
947 }
948
949 pub fn by_item(
951 self,
952 ) -> impl gax::paginator::ItemPaginator<crate::model::ListResourcesResponse, gax::error::Error>
953 {
954 use gax::paginator::Paginator;
955 self.by_page().items()
956 }
957
958 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
962 self.0.request.parent = v.into();
963 self
964 }
965
966 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
968 self.0.request.page_size = v.into();
969 self
970 }
971
972 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
974 self.0.request.page_token = v.into();
975 self
976 }
977
978 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
980 self.0.request.filter = v.into();
981 self
982 }
983
984 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
986 self.0.request.order_by = v.into();
987 self
988 }
989 }
990
991 #[doc(hidden)]
992 impl gax::options::internal::RequestBuilder for ListResources {
993 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
994 &mut self.0.options
995 }
996 }
997
998 #[derive(Clone, Debug)]
1016 pub struct ExportDeploymentStatefile(
1017 RequestBuilder<crate::model::ExportDeploymentStatefileRequest>,
1018 );
1019
1020 impl ExportDeploymentStatefile {
1021 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1022 Self(RequestBuilder::new(stub))
1023 }
1024
1025 pub fn with_request<V: Into<crate::model::ExportDeploymentStatefileRequest>>(
1027 mut self,
1028 v: V,
1029 ) -> Self {
1030 self.0.request = v.into();
1031 self
1032 }
1033
1034 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1036 self.0.options = v.into();
1037 self
1038 }
1039
1040 pub async fn send(self) -> Result<crate::model::Statefile> {
1042 (*self.0.stub)
1043 .export_deployment_statefile(self.0.request, self.0.options)
1044 .await
1045 .map(gax::response::Response::into_body)
1046 }
1047
1048 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1052 self.0.request.parent = v.into();
1053 self
1054 }
1055
1056 pub fn set_draft<T: Into<bool>>(mut self, v: T) -> Self {
1058 self.0.request.draft = v.into();
1059 self
1060 }
1061 }
1062
1063 #[doc(hidden)]
1064 impl gax::options::internal::RequestBuilder for ExportDeploymentStatefile {
1065 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1066 &mut self.0.options
1067 }
1068 }
1069
1070 #[derive(Clone, Debug)]
1088 pub struct ExportRevisionStatefile(
1089 RequestBuilder<crate::model::ExportRevisionStatefileRequest>,
1090 );
1091
1092 impl ExportRevisionStatefile {
1093 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1094 Self(RequestBuilder::new(stub))
1095 }
1096
1097 pub fn with_request<V: Into<crate::model::ExportRevisionStatefileRequest>>(
1099 mut self,
1100 v: V,
1101 ) -> Self {
1102 self.0.request = v.into();
1103 self
1104 }
1105
1106 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1108 self.0.options = v.into();
1109 self
1110 }
1111
1112 pub async fn send(self) -> Result<crate::model::Statefile> {
1114 (*self.0.stub)
1115 .export_revision_statefile(self.0.request, self.0.options)
1116 .await
1117 .map(gax::response::Response::into_body)
1118 }
1119
1120 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1124 self.0.request.parent = v.into();
1125 self
1126 }
1127 }
1128
1129 #[doc(hidden)]
1130 impl gax::options::internal::RequestBuilder for ExportRevisionStatefile {
1131 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1132 &mut self.0.options
1133 }
1134 }
1135
1136 #[derive(Clone, Debug)]
1154 pub struct ImportStatefile(RequestBuilder<crate::model::ImportStatefileRequest>);
1155
1156 impl ImportStatefile {
1157 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1158 Self(RequestBuilder::new(stub))
1159 }
1160
1161 pub fn with_request<V: Into<crate::model::ImportStatefileRequest>>(mut self, v: V) -> Self {
1163 self.0.request = v.into();
1164 self
1165 }
1166
1167 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1169 self.0.options = v.into();
1170 self
1171 }
1172
1173 pub async fn send(self) -> Result<crate::model::Statefile> {
1175 (*self.0.stub)
1176 .import_statefile(self.0.request, self.0.options)
1177 .await
1178 .map(gax::response::Response::into_body)
1179 }
1180
1181 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1185 self.0.request.parent = v.into();
1186 self
1187 }
1188
1189 pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1193 self.0.request.lock_id = v.into();
1194 self
1195 }
1196
1197 pub fn set_skip_draft<T: Into<bool>>(mut self, v: T) -> Self {
1199 self.0.request.skip_draft = v.into();
1200 self
1201 }
1202 }
1203
1204 #[doc(hidden)]
1205 impl gax::options::internal::RequestBuilder for ImportStatefile {
1206 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1207 &mut self.0.options
1208 }
1209 }
1210
1211 #[derive(Clone, Debug)]
1229 pub struct DeleteStatefile(RequestBuilder<crate::model::DeleteStatefileRequest>);
1230
1231 impl DeleteStatefile {
1232 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1233 Self(RequestBuilder::new(stub))
1234 }
1235
1236 pub fn with_request<V: Into<crate::model::DeleteStatefileRequest>>(mut self, v: V) -> Self {
1238 self.0.request = v.into();
1239 self
1240 }
1241
1242 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1244 self.0.options = v.into();
1245 self
1246 }
1247
1248 pub async fn send(self) -> Result<()> {
1250 (*self.0.stub)
1251 .delete_statefile(self.0.request, self.0.options)
1252 .await
1253 .map(gax::response::Response::into_body)
1254 }
1255
1256 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1260 self.0.request.name = v.into();
1261 self
1262 }
1263
1264 pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1268 self.0.request.lock_id = v.into();
1269 self
1270 }
1271 }
1272
1273 #[doc(hidden)]
1274 impl gax::options::internal::RequestBuilder for DeleteStatefile {
1275 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1276 &mut self.0.options
1277 }
1278 }
1279
1280 #[derive(Clone, Debug)]
1299 pub struct LockDeployment(RequestBuilder<crate::model::LockDeploymentRequest>);
1300
1301 impl LockDeployment {
1302 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1303 Self(RequestBuilder::new(stub))
1304 }
1305
1306 pub fn with_request<V: Into<crate::model::LockDeploymentRequest>>(mut self, v: V) -> Self {
1308 self.0.request = v.into();
1309 self
1310 }
1311
1312 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1314 self.0.options = v.into();
1315 self
1316 }
1317
1318 pub async fn send(self) -> Result<longrunning::model::Operation> {
1325 (*self.0.stub)
1326 .lock_deployment(self.0.request, self.0.options)
1327 .await
1328 .map(gax::response::Response::into_body)
1329 }
1330
1331 pub fn poller(
1333 self,
1334 ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
1335 type Operation =
1336 lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
1337 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1338 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1339
1340 let stub = self.0.stub.clone();
1341 let mut options = self.0.options.clone();
1342 options.set_retry_policy(gax::retry_policy::NeverRetry);
1343 let query = move |name| {
1344 let stub = stub.clone();
1345 let options = options.clone();
1346 async {
1347 let op = GetOperation::new(stub)
1348 .set_name(name)
1349 .with_options(options)
1350 .send()
1351 .await?;
1352 Ok(Operation::new(op))
1353 }
1354 };
1355
1356 let start = move || async {
1357 let op = self.send().await?;
1358 Ok(Operation::new(op))
1359 };
1360
1361 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1362 }
1363
1364 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1368 self.0.request.name = v.into();
1369 self
1370 }
1371 }
1372
1373 #[doc(hidden)]
1374 impl gax::options::internal::RequestBuilder for LockDeployment {
1375 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1376 &mut self.0.options
1377 }
1378 }
1379
1380 #[derive(Clone, Debug)]
1399 pub struct UnlockDeployment(RequestBuilder<crate::model::UnlockDeploymentRequest>);
1400
1401 impl UnlockDeployment {
1402 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1403 Self(RequestBuilder::new(stub))
1404 }
1405
1406 pub fn with_request<V: Into<crate::model::UnlockDeploymentRequest>>(
1408 mut self,
1409 v: V,
1410 ) -> Self {
1411 self.0.request = v.into();
1412 self
1413 }
1414
1415 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1417 self.0.options = v.into();
1418 self
1419 }
1420
1421 pub async fn send(self) -> Result<longrunning::model::Operation> {
1428 (*self.0.stub)
1429 .unlock_deployment(self.0.request, self.0.options)
1430 .await
1431 .map(gax::response::Response::into_body)
1432 }
1433
1434 pub fn poller(
1436 self,
1437 ) -> impl lro::Poller<crate::model::Deployment, crate::model::OperationMetadata> {
1438 type Operation =
1439 lro::internal::Operation<crate::model::Deployment, crate::model::OperationMetadata>;
1440 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1441 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1442
1443 let stub = self.0.stub.clone();
1444 let mut options = self.0.options.clone();
1445 options.set_retry_policy(gax::retry_policy::NeverRetry);
1446 let query = move |name| {
1447 let stub = stub.clone();
1448 let options = options.clone();
1449 async {
1450 let op = GetOperation::new(stub)
1451 .set_name(name)
1452 .with_options(options)
1453 .send()
1454 .await?;
1455 Ok(Operation::new(op))
1456 }
1457 };
1458
1459 let start = move || async {
1460 let op = self.send().await?;
1461 Ok(Operation::new(op))
1462 };
1463
1464 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1465 }
1466
1467 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1471 self.0.request.name = v.into();
1472 self
1473 }
1474
1475 pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1479 self.0.request.lock_id = v.into();
1480 self
1481 }
1482 }
1483
1484 #[doc(hidden)]
1485 impl gax::options::internal::RequestBuilder for UnlockDeployment {
1486 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1487 &mut self.0.options
1488 }
1489 }
1490
1491 #[derive(Clone, Debug)]
1509 pub struct ExportLockInfo(RequestBuilder<crate::model::ExportLockInfoRequest>);
1510
1511 impl ExportLockInfo {
1512 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1513 Self(RequestBuilder::new(stub))
1514 }
1515
1516 pub fn with_request<V: Into<crate::model::ExportLockInfoRequest>>(mut self, v: V) -> Self {
1518 self.0.request = v.into();
1519 self
1520 }
1521
1522 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1524 self.0.options = v.into();
1525 self
1526 }
1527
1528 pub async fn send(self) -> Result<crate::model::LockInfo> {
1530 (*self.0.stub)
1531 .export_lock_info(self.0.request, self.0.options)
1532 .await
1533 .map(gax::response::Response::into_body)
1534 }
1535
1536 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1540 self.0.request.name = v.into();
1541 self
1542 }
1543 }
1544
1545 #[doc(hidden)]
1546 impl gax::options::internal::RequestBuilder for ExportLockInfo {
1547 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1548 &mut self.0.options
1549 }
1550 }
1551
1552 #[derive(Clone, Debug)]
1571 pub struct CreatePreview(RequestBuilder<crate::model::CreatePreviewRequest>);
1572
1573 impl CreatePreview {
1574 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1575 Self(RequestBuilder::new(stub))
1576 }
1577
1578 pub fn with_request<V: Into<crate::model::CreatePreviewRequest>>(mut self, v: V) -> Self {
1580 self.0.request = v.into();
1581 self
1582 }
1583
1584 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1586 self.0.options = v.into();
1587 self
1588 }
1589
1590 pub async fn send(self) -> Result<longrunning::model::Operation> {
1597 (*self.0.stub)
1598 .create_preview(self.0.request, self.0.options)
1599 .await
1600 .map(gax::response::Response::into_body)
1601 }
1602
1603 pub fn poller(
1605 self,
1606 ) -> impl lro::Poller<crate::model::Preview, crate::model::OperationMetadata> {
1607 type Operation =
1608 lro::internal::Operation<crate::model::Preview, crate::model::OperationMetadata>;
1609 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1610 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1611
1612 let stub = self.0.stub.clone();
1613 let mut options = self.0.options.clone();
1614 options.set_retry_policy(gax::retry_policy::NeverRetry);
1615 let query = move |name| {
1616 let stub = stub.clone();
1617 let options = options.clone();
1618 async {
1619 let op = GetOperation::new(stub)
1620 .set_name(name)
1621 .with_options(options)
1622 .send()
1623 .await?;
1624 Ok(Operation::new(op))
1625 }
1626 };
1627
1628 let start = move || async {
1629 let op = self.send().await?;
1630 Ok(Operation::new(op))
1631 };
1632
1633 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1634 }
1635
1636 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1640 self.0.request.parent = v.into();
1641 self
1642 }
1643
1644 pub fn set_preview_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1646 self.0.request.preview_id = v.into();
1647 self
1648 }
1649
1650 pub fn set_preview<T>(mut self, v: T) -> Self
1654 where
1655 T: std::convert::Into<crate::model::Preview>,
1656 {
1657 self.0.request.preview = std::option::Option::Some(v.into());
1658 self
1659 }
1660
1661 pub fn set_or_clear_preview<T>(mut self, v: std::option::Option<T>) -> Self
1665 where
1666 T: std::convert::Into<crate::model::Preview>,
1667 {
1668 self.0.request.preview = v.map(|x| x.into());
1669 self
1670 }
1671
1672 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1674 self.0.request.request_id = v.into();
1675 self
1676 }
1677 }
1678
1679 #[doc(hidden)]
1680 impl gax::options::internal::RequestBuilder for CreatePreview {
1681 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1682 &mut self.0.options
1683 }
1684 }
1685
1686 #[derive(Clone, Debug)]
1704 pub struct GetPreview(RequestBuilder<crate::model::GetPreviewRequest>);
1705
1706 impl GetPreview {
1707 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1708 Self(RequestBuilder::new(stub))
1709 }
1710
1711 pub fn with_request<V: Into<crate::model::GetPreviewRequest>>(mut self, v: V) -> Self {
1713 self.0.request = v.into();
1714 self
1715 }
1716
1717 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1719 self.0.options = v.into();
1720 self
1721 }
1722
1723 pub async fn send(self) -> Result<crate::model::Preview> {
1725 (*self.0.stub)
1726 .get_preview(self.0.request, self.0.options)
1727 .await
1728 .map(gax::response::Response::into_body)
1729 }
1730
1731 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1735 self.0.request.name = v.into();
1736 self
1737 }
1738 }
1739
1740 #[doc(hidden)]
1741 impl gax::options::internal::RequestBuilder for GetPreview {
1742 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1743 &mut self.0.options
1744 }
1745 }
1746
1747 #[derive(Clone, Debug)]
1769 pub struct ListPreviews(RequestBuilder<crate::model::ListPreviewsRequest>);
1770
1771 impl ListPreviews {
1772 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1773 Self(RequestBuilder::new(stub))
1774 }
1775
1776 pub fn with_request<V: Into<crate::model::ListPreviewsRequest>>(mut self, v: V) -> Self {
1778 self.0.request = v.into();
1779 self
1780 }
1781
1782 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1784 self.0.options = v.into();
1785 self
1786 }
1787
1788 pub async fn send(self) -> Result<crate::model::ListPreviewsResponse> {
1790 (*self.0.stub)
1791 .list_previews(self.0.request, self.0.options)
1792 .await
1793 .map(gax::response::Response::into_body)
1794 }
1795
1796 pub fn by_page(
1798 self,
1799 ) -> impl gax::paginator::Paginator<crate::model::ListPreviewsResponse, gax::error::Error>
1800 {
1801 use std::clone::Clone;
1802 let token = self.0.request.page_token.clone();
1803 let execute = move |token: String| {
1804 let mut builder = self.clone();
1805 builder.0.request = builder.0.request.set_page_token(token);
1806 builder.send()
1807 };
1808 gax::paginator::internal::new_paginator(token, execute)
1809 }
1810
1811 pub fn by_item(
1813 self,
1814 ) -> impl gax::paginator::ItemPaginator<crate::model::ListPreviewsResponse, gax::error::Error>
1815 {
1816 use gax::paginator::Paginator;
1817 self.by_page().items()
1818 }
1819
1820 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1824 self.0.request.parent = v.into();
1825 self
1826 }
1827
1828 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1830 self.0.request.page_size = v.into();
1831 self
1832 }
1833
1834 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1836 self.0.request.page_token = v.into();
1837 self
1838 }
1839
1840 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1842 self.0.request.filter = v.into();
1843 self
1844 }
1845
1846 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1848 self.0.request.order_by = v.into();
1849 self
1850 }
1851 }
1852
1853 #[doc(hidden)]
1854 impl gax::options::internal::RequestBuilder for ListPreviews {
1855 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1856 &mut self.0.options
1857 }
1858 }
1859
1860 #[derive(Clone, Debug)]
1879 pub struct DeletePreview(RequestBuilder<crate::model::DeletePreviewRequest>);
1880
1881 impl DeletePreview {
1882 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1883 Self(RequestBuilder::new(stub))
1884 }
1885
1886 pub fn with_request<V: Into<crate::model::DeletePreviewRequest>>(mut self, v: V) -> Self {
1888 self.0.request = v.into();
1889 self
1890 }
1891
1892 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1894 self.0.options = v.into();
1895 self
1896 }
1897
1898 pub async fn send(self) -> Result<longrunning::model::Operation> {
1905 (*self.0.stub)
1906 .delete_preview(self.0.request, self.0.options)
1907 .await
1908 .map(gax::response::Response::into_body)
1909 }
1910
1911 pub fn poller(
1913 self,
1914 ) -> impl lro::Poller<crate::model::Preview, crate::model::OperationMetadata> {
1915 type Operation =
1916 lro::internal::Operation<crate::model::Preview, crate::model::OperationMetadata>;
1917 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1918 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1919
1920 let stub = self.0.stub.clone();
1921 let mut options = self.0.options.clone();
1922 options.set_retry_policy(gax::retry_policy::NeverRetry);
1923 let query = move |name| {
1924 let stub = stub.clone();
1925 let options = options.clone();
1926 async {
1927 let op = GetOperation::new(stub)
1928 .set_name(name)
1929 .with_options(options)
1930 .send()
1931 .await?;
1932 Ok(Operation::new(op))
1933 }
1934 };
1935
1936 let start = move || async {
1937 let op = self.send().await?;
1938 Ok(Operation::new(op))
1939 };
1940
1941 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1942 }
1943
1944 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1948 self.0.request.name = v.into();
1949 self
1950 }
1951
1952 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1954 self.0.request.request_id = v.into();
1955 self
1956 }
1957 }
1958
1959 #[doc(hidden)]
1960 impl gax::options::internal::RequestBuilder for DeletePreview {
1961 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1962 &mut self.0.options
1963 }
1964 }
1965
1966 #[derive(Clone, Debug)]
1984 pub struct ExportPreviewResult(RequestBuilder<crate::model::ExportPreviewResultRequest>);
1985
1986 impl ExportPreviewResult {
1987 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1988 Self(RequestBuilder::new(stub))
1989 }
1990
1991 pub fn with_request<V: Into<crate::model::ExportPreviewResultRequest>>(
1993 mut self,
1994 v: V,
1995 ) -> Self {
1996 self.0.request = v.into();
1997 self
1998 }
1999
2000 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2002 self.0.options = v.into();
2003 self
2004 }
2005
2006 pub async fn send(self) -> Result<crate::model::ExportPreviewResultResponse> {
2008 (*self.0.stub)
2009 .export_preview_result(self.0.request, self.0.options)
2010 .await
2011 .map(gax::response::Response::into_body)
2012 }
2013
2014 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2018 self.0.request.parent = v.into();
2019 self
2020 }
2021 }
2022
2023 #[doc(hidden)]
2024 impl gax::options::internal::RequestBuilder for ExportPreviewResult {
2025 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2026 &mut self.0.options
2027 }
2028 }
2029
2030 #[derive(Clone, Debug)]
2052 pub struct ListTerraformVersions(RequestBuilder<crate::model::ListTerraformVersionsRequest>);
2053
2054 impl ListTerraformVersions {
2055 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2056 Self(RequestBuilder::new(stub))
2057 }
2058
2059 pub fn with_request<V: Into<crate::model::ListTerraformVersionsRequest>>(
2061 mut self,
2062 v: V,
2063 ) -> Self {
2064 self.0.request = v.into();
2065 self
2066 }
2067
2068 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2070 self.0.options = v.into();
2071 self
2072 }
2073
2074 pub async fn send(self) -> Result<crate::model::ListTerraformVersionsResponse> {
2076 (*self.0.stub)
2077 .list_terraform_versions(self.0.request, self.0.options)
2078 .await
2079 .map(gax::response::Response::into_body)
2080 }
2081
2082 pub fn by_page(
2084 self,
2085 ) -> impl gax::paginator::Paginator<crate::model::ListTerraformVersionsResponse, gax::error::Error>
2086 {
2087 use std::clone::Clone;
2088 let token = self.0.request.page_token.clone();
2089 let execute = move |token: String| {
2090 let mut builder = self.clone();
2091 builder.0.request = builder.0.request.set_page_token(token);
2092 builder.send()
2093 };
2094 gax::paginator::internal::new_paginator(token, execute)
2095 }
2096
2097 pub fn by_item(
2099 self,
2100 ) -> impl gax::paginator::ItemPaginator<
2101 crate::model::ListTerraformVersionsResponse,
2102 gax::error::Error,
2103 > {
2104 use gax::paginator::Paginator;
2105 self.by_page().items()
2106 }
2107
2108 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2112 self.0.request.parent = v.into();
2113 self
2114 }
2115
2116 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2118 self.0.request.page_size = v.into();
2119 self
2120 }
2121
2122 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2124 self.0.request.page_token = v.into();
2125 self
2126 }
2127
2128 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2130 self.0.request.filter = v.into();
2131 self
2132 }
2133
2134 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2136 self.0.request.order_by = v.into();
2137 self
2138 }
2139 }
2140
2141 #[doc(hidden)]
2142 impl gax::options::internal::RequestBuilder for ListTerraformVersions {
2143 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2144 &mut self.0.options
2145 }
2146 }
2147
2148 #[derive(Clone, Debug)]
2166 pub struct GetTerraformVersion(RequestBuilder<crate::model::GetTerraformVersionRequest>);
2167
2168 impl GetTerraformVersion {
2169 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2170 Self(RequestBuilder::new(stub))
2171 }
2172
2173 pub fn with_request<V: Into<crate::model::GetTerraformVersionRequest>>(
2175 mut self,
2176 v: V,
2177 ) -> Self {
2178 self.0.request = v.into();
2179 self
2180 }
2181
2182 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2184 self.0.options = v.into();
2185 self
2186 }
2187
2188 pub async fn send(self) -> Result<crate::model::TerraformVersion> {
2190 (*self.0.stub)
2191 .get_terraform_version(self.0.request, self.0.options)
2192 .await
2193 .map(gax::response::Response::into_body)
2194 }
2195
2196 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2200 self.0.request.name = v.into();
2201 self
2202 }
2203 }
2204
2205 #[doc(hidden)]
2206 impl gax::options::internal::RequestBuilder for GetTerraformVersion {
2207 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2208 &mut self.0.options
2209 }
2210 }
2211
2212 #[derive(Clone, Debug)]
2234 pub struct ListResourceChanges(RequestBuilder<crate::model::ListResourceChangesRequest>);
2235
2236 impl ListResourceChanges {
2237 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2238 Self(RequestBuilder::new(stub))
2239 }
2240
2241 pub fn with_request<V: Into<crate::model::ListResourceChangesRequest>>(
2243 mut self,
2244 v: V,
2245 ) -> Self {
2246 self.0.request = v.into();
2247 self
2248 }
2249
2250 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2252 self.0.options = v.into();
2253 self
2254 }
2255
2256 pub async fn send(self) -> Result<crate::model::ListResourceChangesResponse> {
2258 (*self.0.stub)
2259 .list_resource_changes(self.0.request, self.0.options)
2260 .await
2261 .map(gax::response::Response::into_body)
2262 }
2263
2264 pub fn by_page(
2266 self,
2267 ) -> impl gax::paginator::Paginator<crate::model::ListResourceChangesResponse, gax::error::Error>
2268 {
2269 use std::clone::Clone;
2270 let token = self.0.request.page_token.clone();
2271 let execute = move |token: String| {
2272 let mut builder = self.clone();
2273 builder.0.request = builder.0.request.set_page_token(token);
2274 builder.send()
2275 };
2276 gax::paginator::internal::new_paginator(token, execute)
2277 }
2278
2279 pub fn by_item(
2281 self,
2282 ) -> impl gax::paginator::ItemPaginator<
2283 crate::model::ListResourceChangesResponse,
2284 gax::error::Error,
2285 > {
2286 use gax::paginator::Paginator;
2287 self.by_page().items()
2288 }
2289
2290 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2294 self.0.request.parent = v.into();
2295 self
2296 }
2297
2298 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2300 self.0.request.page_size = v.into();
2301 self
2302 }
2303
2304 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2306 self.0.request.page_token = v.into();
2307 self
2308 }
2309
2310 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2312 self.0.request.filter = v.into();
2313 self
2314 }
2315
2316 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2318 self.0.request.order_by = v.into();
2319 self
2320 }
2321 }
2322
2323 #[doc(hidden)]
2324 impl gax::options::internal::RequestBuilder for ListResourceChanges {
2325 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2326 &mut self.0.options
2327 }
2328 }
2329
2330 #[derive(Clone, Debug)]
2348 pub struct GetResourceChange(RequestBuilder<crate::model::GetResourceChangeRequest>);
2349
2350 impl GetResourceChange {
2351 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2352 Self(RequestBuilder::new(stub))
2353 }
2354
2355 pub fn with_request<V: Into<crate::model::GetResourceChangeRequest>>(
2357 mut self,
2358 v: V,
2359 ) -> Self {
2360 self.0.request = v.into();
2361 self
2362 }
2363
2364 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2366 self.0.options = v.into();
2367 self
2368 }
2369
2370 pub async fn send(self) -> Result<crate::model::ResourceChange> {
2372 (*self.0.stub)
2373 .get_resource_change(self.0.request, self.0.options)
2374 .await
2375 .map(gax::response::Response::into_body)
2376 }
2377
2378 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2382 self.0.request.name = v.into();
2383 self
2384 }
2385 }
2386
2387 #[doc(hidden)]
2388 impl gax::options::internal::RequestBuilder for GetResourceChange {
2389 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2390 &mut self.0.options
2391 }
2392 }
2393
2394 #[derive(Clone, Debug)]
2416 pub struct ListResourceDrifts(RequestBuilder<crate::model::ListResourceDriftsRequest>);
2417
2418 impl ListResourceDrifts {
2419 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2420 Self(RequestBuilder::new(stub))
2421 }
2422
2423 pub fn with_request<V: Into<crate::model::ListResourceDriftsRequest>>(
2425 mut self,
2426 v: V,
2427 ) -> Self {
2428 self.0.request = v.into();
2429 self
2430 }
2431
2432 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2434 self.0.options = v.into();
2435 self
2436 }
2437
2438 pub async fn send(self) -> Result<crate::model::ListResourceDriftsResponse> {
2440 (*self.0.stub)
2441 .list_resource_drifts(self.0.request, self.0.options)
2442 .await
2443 .map(gax::response::Response::into_body)
2444 }
2445
2446 pub fn by_page(
2448 self,
2449 ) -> impl gax::paginator::Paginator<crate::model::ListResourceDriftsResponse, gax::error::Error>
2450 {
2451 use std::clone::Clone;
2452 let token = self.0.request.page_token.clone();
2453 let execute = move |token: String| {
2454 let mut builder = self.clone();
2455 builder.0.request = builder.0.request.set_page_token(token);
2456 builder.send()
2457 };
2458 gax::paginator::internal::new_paginator(token, execute)
2459 }
2460
2461 pub fn by_item(
2463 self,
2464 ) -> impl gax::paginator::ItemPaginator<
2465 crate::model::ListResourceDriftsResponse,
2466 gax::error::Error,
2467 > {
2468 use gax::paginator::Paginator;
2469 self.by_page().items()
2470 }
2471
2472 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2476 self.0.request.parent = v.into();
2477 self
2478 }
2479
2480 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2482 self.0.request.page_size = v.into();
2483 self
2484 }
2485
2486 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2488 self.0.request.page_token = v.into();
2489 self
2490 }
2491
2492 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2494 self.0.request.filter = v.into();
2495 self
2496 }
2497
2498 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2500 self.0.request.order_by = v.into();
2501 self
2502 }
2503 }
2504
2505 #[doc(hidden)]
2506 impl gax::options::internal::RequestBuilder for ListResourceDrifts {
2507 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2508 &mut self.0.options
2509 }
2510 }
2511
2512 #[derive(Clone, Debug)]
2530 pub struct GetResourceDrift(RequestBuilder<crate::model::GetResourceDriftRequest>);
2531
2532 impl GetResourceDrift {
2533 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2534 Self(RequestBuilder::new(stub))
2535 }
2536
2537 pub fn with_request<V: Into<crate::model::GetResourceDriftRequest>>(
2539 mut self,
2540 v: V,
2541 ) -> Self {
2542 self.0.request = v.into();
2543 self
2544 }
2545
2546 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2548 self.0.options = v.into();
2549 self
2550 }
2551
2552 pub async fn send(self) -> Result<crate::model::ResourceDrift> {
2554 (*self.0.stub)
2555 .get_resource_drift(self.0.request, self.0.options)
2556 .await
2557 .map(gax::response::Response::into_body)
2558 }
2559
2560 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2564 self.0.request.name = v.into();
2565 self
2566 }
2567 }
2568
2569 #[doc(hidden)]
2570 impl gax::options::internal::RequestBuilder for GetResourceDrift {
2571 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2572 &mut self.0.options
2573 }
2574 }
2575
2576 #[derive(Clone, Debug)]
2598 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2599
2600 impl ListLocations {
2601 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2602 Self(RequestBuilder::new(stub))
2603 }
2604
2605 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2607 mut self,
2608 v: V,
2609 ) -> Self {
2610 self.0.request = v.into();
2611 self
2612 }
2613
2614 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2616 self.0.options = v.into();
2617 self
2618 }
2619
2620 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2622 (*self.0.stub)
2623 .list_locations(self.0.request, self.0.options)
2624 .await
2625 .map(gax::response::Response::into_body)
2626 }
2627
2628 pub fn by_page(
2630 self,
2631 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2632 {
2633 use std::clone::Clone;
2634 let token = self.0.request.page_token.clone();
2635 let execute = move |token: String| {
2636 let mut builder = self.clone();
2637 builder.0.request = builder.0.request.set_page_token(token);
2638 builder.send()
2639 };
2640 gax::paginator::internal::new_paginator(token, execute)
2641 }
2642
2643 pub fn by_item(
2645 self,
2646 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2647 {
2648 use gax::paginator::Paginator;
2649 self.by_page().items()
2650 }
2651
2652 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2654 self.0.request.name = v.into();
2655 self
2656 }
2657
2658 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2660 self.0.request.filter = v.into();
2661 self
2662 }
2663
2664 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2666 self.0.request.page_size = v.into();
2667 self
2668 }
2669
2670 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2672 self.0.request.page_token = v.into();
2673 self
2674 }
2675 }
2676
2677 #[doc(hidden)]
2678 impl gax::options::internal::RequestBuilder for ListLocations {
2679 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2680 &mut self.0.options
2681 }
2682 }
2683
2684 #[derive(Clone, Debug)]
2702 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2703
2704 impl GetLocation {
2705 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2706 Self(RequestBuilder::new(stub))
2707 }
2708
2709 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2711 self.0.request = v.into();
2712 self
2713 }
2714
2715 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2717 self.0.options = v.into();
2718 self
2719 }
2720
2721 pub async fn send(self) -> Result<location::model::Location> {
2723 (*self.0.stub)
2724 .get_location(self.0.request, self.0.options)
2725 .await
2726 .map(gax::response::Response::into_body)
2727 }
2728
2729 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2731 self.0.request.name = v.into();
2732 self
2733 }
2734 }
2735
2736 #[doc(hidden)]
2737 impl gax::options::internal::RequestBuilder for GetLocation {
2738 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2739 &mut self.0.options
2740 }
2741 }
2742
2743 #[derive(Clone, Debug)]
2761 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2762
2763 impl SetIamPolicy {
2764 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2765 Self(RequestBuilder::new(stub))
2766 }
2767
2768 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2770 self.0.request = v.into();
2771 self
2772 }
2773
2774 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2776 self.0.options = v.into();
2777 self
2778 }
2779
2780 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2782 (*self.0.stub)
2783 .set_iam_policy(self.0.request, self.0.options)
2784 .await
2785 .map(gax::response::Response::into_body)
2786 }
2787
2788 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2792 self.0.request.resource = v.into();
2793 self
2794 }
2795
2796 pub fn set_policy<T>(mut self, v: T) -> Self
2800 where
2801 T: std::convert::Into<iam_v1::model::Policy>,
2802 {
2803 self.0.request.policy = std::option::Option::Some(v.into());
2804 self
2805 }
2806
2807 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2811 where
2812 T: std::convert::Into<iam_v1::model::Policy>,
2813 {
2814 self.0.request.policy = v.map(|x| x.into());
2815 self
2816 }
2817
2818 pub fn set_update_mask<T>(mut self, v: T) -> Self
2820 where
2821 T: std::convert::Into<wkt::FieldMask>,
2822 {
2823 self.0.request.update_mask = std::option::Option::Some(v.into());
2824 self
2825 }
2826
2827 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2829 where
2830 T: std::convert::Into<wkt::FieldMask>,
2831 {
2832 self.0.request.update_mask = v.map(|x| x.into());
2833 self
2834 }
2835 }
2836
2837 #[doc(hidden)]
2838 impl gax::options::internal::RequestBuilder for SetIamPolicy {
2839 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2840 &mut self.0.options
2841 }
2842 }
2843
2844 #[derive(Clone, Debug)]
2862 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2863
2864 impl GetIamPolicy {
2865 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2866 Self(RequestBuilder::new(stub))
2867 }
2868
2869 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2871 self.0.request = v.into();
2872 self
2873 }
2874
2875 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2877 self.0.options = v.into();
2878 self
2879 }
2880
2881 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2883 (*self.0.stub)
2884 .get_iam_policy(self.0.request, self.0.options)
2885 .await
2886 .map(gax::response::Response::into_body)
2887 }
2888
2889 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2893 self.0.request.resource = v.into();
2894 self
2895 }
2896
2897 pub fn set_options<T>(mut self, v: T) -> Self
2899 where
2900 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2901 {
2902 self.0.request.options = std::option::Option::Some(v.into());
2903 self
2904 }
2905
2906 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2908 where
2909 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2910 {
2911 self.0.request.options = v.map(|x| x.into());
2912 self
2913 }
2914 }
2915
2916 #[doc(hidden)]
2917 impl gax::options::internal::RequestBuilder for GetIamPolicy {
2918 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2919 &mut self.0.options
2920 }
2921 }
2922
2923 #[derive(Clone, Debug)]
2941 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2942
2943 impl TestIamPermissions {
2944 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2945 Self(RequestBuilder::new(stub))
2946 }
2947
2948 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2950 mut self,
2951 v: V,
2952 ) -> Self {
2953 self.0.request = v.into();
2954 self
2955 }
2956
2957 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2959 self.0.options = v.into();
2960 self
2961 }
2962
2963 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2965 (*self.0.stub)
2966 .test_iam_permissions(self.0.request, self.0.options)
2967 .await
2968 .map(gax::response::Response::into_body)
2969 }
2970
2971 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2975 self.0.request.resource = v.into();
2976 self
2977 }
2978
2979 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2983 where
2984 T: std::iter::IntoIterator<Item = V>,
2985 V: std::convert::Into<std::string::String>,
2986 {
2987 use std::iter::Iterator;
2988 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2989 self
2990 }
2991 }
2992
2993 #[doc(hidden)]
2994 impl gax::options::internal::RequestBuilder for TestIamPermissions {
2995 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2996 &mut self.0.options
2997 }
2998 }
2999
3000 #[derive(Clone, Debug)]
3022 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3023
3024 impl ListOperations {
3025 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3026 Self(RequestBuilder::new(stub))
3027 }
3028
3029 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3031 mut self,
3032 v: V,
3033 ) -> Self {
3034 self.0.request = v.into();
3035 self
3036 }
3037
3038 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3040 self.0.options = v.into();
3041 self
3042 }
3043
3044 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3046 (*self.0.stub)
3047 .list_operations(self.0.request, self.0.options)
3048 .await
3049 .map(gax::response::Response::into_body)
3050 }
3051
3052 pub fn by_page(
3054 self,
3055 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3056 {
3057 use std::clone::Clone;
3058 let token = self.0.request.page_token.clone();
3059 let execute = move |token: String| {
3060 let mut builder = self.clone();
3061 builder.0.request = builder.0.request.set_page_token(token);
3062 builder.send()
3063 };
3064 gax::paginator::internal::new_paginator(token, execute)
3065 }
3066
3067 pub fn by_item(
3069 self,
3070 ) -> impl gax::paginator::ItemPaginator<
3071 longrunning::model::ListOperationsResponse,
3072 gax::error::Error,
3073 > {
3074 use gax::paginator::Paginator;
3075 self.by_page().items()
3076 }
3077
3078 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3080 self.0.request.name = v.into();
3081 self
3082 }
3083
3084 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3086 self.0.request.filter = v.into();
3087 self
3088 }
3089
3090 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3092 self.0.request.page_size = v.into();
3093 self
3094 }
3095
3096 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3098 self.0.request.page_token = v.into();
3099 self
3100 }
3101
3102 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3104 self.0.request.return_partial_success = v.into();
3105 self
3106 }
3107 }
3108
3109 #[doc(hidden)]
3110 impl gax::options::internal::RequestBuilder for ListOperations {
3111 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3112 &mut self.0.options
3113 }
3114 }
3115
3116 #[derive(Clone, Debug)]
3134 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3135
3136 impl GetOperation {
3137 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3138 Self(RequestBuilder::new(stub))
3139 }
3140
3141 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3143 mut self,
3144 v: V,
3145 ) -> Self {
3146 self.0.request = v.into();
3147 self
3148 }
3149
3150 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3152 self.0.options = v.into();
3153 self
3154 }
3155
3156 pub async fn send(self) -> Result<longrunning::model::Operation> {
3158 (*self.0.stub)
3159 .get_operation(self.0.request, self.0.options)
3160 .await
3161 .map(gax::response::Response::into_body)
3162 }
3163
3164 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3166 self.0.request.name = v.into();
3167 self
3168 }
3169 }
3170
3171 #[doc(hidden)]
3172 impl gax::options::internal::RequestBuilder for GetOperation {
3173 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3174 &mut self.0.options
3175 }
3176 }
3177
3178 #[derive(Clone, Debug)]
3196 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3197
3198 impl DeleteOperation {
3199 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3200 Self(RequestBuilder::new(stub))
3201 }
3202
3203 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3205 mut self,
3206 v: V,
3207 ) -> Self {
3208 self.0.request = v.into();
3209 self
3210 }
3211
3212 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3214 self.0.options = v.into();
3215 self
3216 }
3217
3218 pub async fn send(self) -> Result<()> {
3220 (*self.0.stub)
3221 .delete_operation(self.0.request, self.0.options)
3222 .await
3223 .map(gax::response::Response::into_body)
3224 }
3225
3226 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3228 self.0.request.name = v.into();
3229 self
3230 }
3231 }
3232
3233 #[doc(hidden)]
3234 impl gax::options::internal::RequestBuilder for DeleteOperation {
3235 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3236 &mut self.0.options
3237 }
3238 }
3239
3240 #[derive(Clone, Debug)]
3258 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3259
3260 impl CancelOperation {
3261 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3262 Self(RequestBuilder::new(stub))
3263 }
3264
3265 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3267 mut self,
3268 v: V,
3269 ) -> Self {
3270 self.0.request = v.into();
3271 self
3272 }
3273
3274 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3276 self.0.options = v.into();
3277 self
3278 }
3279
3280 pub async fn send(self) -> Result<()> {
3282 (*self.0.stub)
3283 .cancel_operation(self.0.request, self.0.options)
3284 .await
3285 .map(gax::response::Response::into_body)
3286 }
3287
3288 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3290 self.0.request.name = v.into();
3291 self
3292 }
3293 }
3294
3295 #[doc(hidden)]
3296 impl gax::options::internal::RequestBuilder for CancelOperation {
3297 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3298 &mut self.0.options
3299 }
3300 }
3301}