1pub mod config {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::Config;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = Config;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: crate::RequestOptions::default(),
68 }
69 }
70 }
71
72 #[derive(Clone, Debug)]
93 pub struct ListDeployments(RequestBuilder<crate::model::ListDeploymentsRequest>);
94
95 impl ListDeployments {
96 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::ListDeploymentsRequest>>(mut self, v: V) -> Self {
102 self.0.request = v.into();
103 self
104 }
105
106 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
108 self.0.options = v.into();
109 self
110 }
111
112 pub async fn send(self) -> Result<crate::model::ListDeploymentsResponse> {
114 (*self.0.stub)
115 .list_deployments(self.0.request, self.0.options)
116 .await
117 .map(crate::Response::into_body)
118 }
119
120 pub fn by_page(
122 self,
123 ) -> impl google_cloud_gax::paginator::Paginator<
124 crate::model::ListDeploymentsResponse,
125 crate::Error,
126 > {
127 use std::clone::Clone;
128 let token = self.0.request.page_token.clone();
129 let execute = move |token: String| {
130 let mut builder = self.clone();
131 builder.0.request = builder.0.request.set_page_token(token);
132 builder.send()
133 };
134 google_cloud_gax::paginator::internal::new_paginator(token, execute)
135 }
136
137 pub fn by_item(
139 self,
140 ) -> impl google_cloud_gax::paginator::ItemPaginator<
141 crate::model::ListDeploymentsResponse,
142 crate::Error,
143 > {
144 use google_cloud_gax::paginator::Paginator;
145 self.by_page().items()
146 }
147
148 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
152 self.0.request.parent = v.into();
153 self
154 }
155
156 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
158 self.0.request.page_size = v.into();
159 self
160 }
161
162 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
164 self.0.request.page_token = v.into();
165 self
166 }
167
168 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.filter = v.into();
171 self
172 }
173
174 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
176 self.0.request.order_by = v.into();
177 self
178 }
179 }
180
181 #[doc(hidden)]
182 impl crate::RequestBuilder for ListDeployments {
183 fn request_options(&mut self) -> &mut crate::RequestOptions {
184 &mut self.0.options
185 }
186 }
187
188 #[derive(Clone, Debug)]
205 pub struct GetDeployment(RequestBuilder<crate::model::GetDeploymentRequest>);
206
207 impl GetDeployment {
208 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
209 Self(RequestBuilder::new(stub))
210 }
211
212 pub fn with_request<V: Into<crate::model::GetDeploymentRequest>>(mut self, v: V) -> Self {
214 self.0.request = v.into();
215 self
216 }
217
218 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
220 self.0.options = v.into();
221 self
222 }
223
224 pub async fn send(self) -> Result<crate::model::Deployment> {
226 (*self.0.stub)
227 .get_deployment(self.0.request, self.0.options)
228 .await
229 .map(crate::Response::into_body)
230 }
231
232 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
236 self.0.request.name = v.into();
237 self
238 }
239 }
240
241 #[doc(hidden)]
242 impl crate::RequestBuilder for GetDeployment {
243 fn request_options(&mut self) -> &mut crate::RequestOptions {
244 &mut self.0.options
245 }
246 }
247
248 #[derive(Clone, Debug)]
266 pub struct CreateDeployment(RequestBuilder<crate::model::CreateDeploymentRequest>);
267
268 impl CreateDeployment {
269 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
270 Self(RequestBuilder::new(stub))
271 }
272
273 pub fn with_request<V: Into<crate::model::CreateDeploymentRequest>>(
275 mut self,
276 v: V,
277 ) -> Self {
278 self.0.request = v.into();
279 self
280 }
281
282 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
284 self.0.options = v.into();
285 self
286 }
287
288 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
295 (*self.0.stub)
296 .create_deployment(self.0.request, self.0.options)
297 .await
298 .map(crate::Response::into_body)
299 }
300
301 pub fn poller(
303 self,
304 ) -> impl google_cloud_lro::Poller<crate::model::Deployment, crate::model::OperationMetadata>
305 {
306 type Operation = google_cloud_lro::internal::Operation<
307 crate::model::Deployment,
308 crate::model::OperationMetadata,
309 >;
310 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
311 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
312 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
313 if let Some(ref mut details) = poller_options.tracing {
314 details.method_name =
315 "google_cloud_config_v1::client::Config::create_deployment::until_done";
316 }
317
318 let stub = self.0.stub.clone();
319 let mut options = self.0.options.clone();
320 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
321 let query = move |name| {
322 let stub = stub.clone();
323 let options = options.clone();
324 async {
325 let op = GetOperation::new(stub)
326 .set_name(name)
327 .with_options(options)
328 .send()
329 .await?;
330 Ok(Operation::new(op))
331 }
332 };
333
334 let start = move || async {
335 let op = self.send().await?;
336 Ok(Operation::new(op))
337 };
338
339 use google_cloud_lro::internal::PollerExt;
340 {
341 google_cloud_lro::internal::new_poller(
342 polling_error_policy,
343 polling_backoff_policy,
344 start,
345 query,
346 )
347 }
348 .with_options(poller_options)
349 }
350
351 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
355 self.0.request.parent = v.into();
356 self
357 }
358
359 pub fn set_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
363 self.0.request.deployment_id = v.into();
364 self
365 }
366
367 pub fn set_deployment<T>(mut self, v: T) -> Self
371 where
372 T: std::convert::Into<crate::model::Deployment>,
373 {
374 self.0.request.deployment = std::option::Option::Some(v.into());
375 self
376 }
377
378 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
382 where
383 T: std::convert::Into<crate::model::Deployment>,
384 {
385 self.0.request.deployment = v.map(|x| x.into());
386 self
387 }
388
389 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
391 self.0.request.request_id = v.into();
392 self
393 }
394 }
395
396 #[doc(hidden)]
397 impl crate::RequestBuilder for CreateDeployment {
398 fn request_options(&mut self) -> &mut crate::RequestOptions {
399 &mut self.0.options
400 }
401 }
402
403 #[derive(Clone, Debug)]
421 pub struct UpdateDeployment(RequestBuilder<crate::model::UpdateDeploymentRequest>);
422
423 impl UpdateDeployment {
424 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
425 Self(RequestBuilder::new(stub))
426 }
427
428 pub fn with_request<V: Into<crate::model::UpdateDeploymentRequest>>(
430 mut self,
431 v: V,
432 ) -> Self {
433 self.0.request = v.into();
434 self
435 }
436
437 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
439 self.0.options = v.into();
440 self
441 }
442
443 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
450 (*self.0.stub)
451 .update_deployment(self.0.request, self.0.options)
452 .await
453 .map(crate::Response::into_body)
454 }
455
456 pub fn poller(
458 self,
459 ) -> impl google_cloud_lro::Poller<crate::model::Deployment, crate::model::OperationMetadata>
460 {
461 type Operation = google_cloud_lro::internal::Operation<
462 crate::model::Deployment,
463 crate::model::OperationMetadata,
464 >;
465 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
466 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
467 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
468 if let Some(ref mut details) = poller_options.tracing {
469 details.method_name =
470 "google_cloud_config_v1::client::Config::update_deployment::until_done";
471 }
472
473 let stub = self.0.stub.clone();
474 let mut options = self.0.options.clone();
475 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
476 let query = move |name| {
477 let stub = stub.clone();
478 let options = options.clone();
479 async {
480 let op = GetOperation::new(stub)
481 .set_name(name)
482 .with_options(options)
483 .send()
484 .await?;
485 Ok(Operation::new(op))
486 }
487 };
488
489 let start = move || async {
490 let op = self.send().await?;
491 Ok(Operation::new(op))
492 };
493
494 use google_cloud_lro::internal::PollerExt;
495 {
496 google_cloud_lro::internal::new_poller(
497 polling_error_policy,
498 polling_backoff_policy,
499 start,
500 query,
501 )
502 }
503 .with_options(poller_options)
504 }
505
506 pub fn set_update_mask<T>(mut self, v: T) -> Self
508 where
509 T: std::convert::Into<wkt::FieldMask>,
510 {
511 self.0.request.update_mask = std::option::Option::Some(v.into());
512 self
513 }
514
515 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
517 where
518 T: std::convert::Into<wkt::FieldMask>,
519 {
520 self.0.request.update_mask = v.map(|x| x.into());
521 self
522 }
523
524 pub fn set_deployment<T>(mut self, v: T) -> Self
528 where
529 T: std::convert::Into<crate::model::Deployment>,
530 {
531 self.0.request.deployment = std::option::Option::Some(v.into());
532 self
533 }
534
535 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
539 where
540 T: std::convert::Into<crate::model::Deployment>,
541 {
542 self.0.request.deployment = v.map(|x| x.into());
543 self
544 }
545
546 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
548 self.0.request.request_id = v.into();
549 self
550 }
551 }
552
553 #[doc(hidden)]
554 impl crate::RequestBuilder for UpdateDeployment {
555 fn request_options(&mut self) -> &mut crate::RequestOptions {
556 &mut self.0.options
557 }
558 }
559
560 #[derive(Clone, Debug)]
578 pub struct DeleteDeployment(RequestBuilder<crate::model::DeleteDeploymentRequest>);
579
580 impl DeleteDeployment {
581 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
582 Self(RequestBuilder::new(stub))
583 }
584
585 pub fn with_request<V: Into<crate::model::DeleteDeploymentRequest>>(
587 mut self,
588 v: V,
589 ) -> Self {
590 self.0.request = v.into();
591 self
592 }
593
594 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
596 self.0.options = v.into();
597 self
598 }
599
600 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
607 (*self.0.stub)
608 .delete_deployment(self.0.request, self.0.options)
609 .await
610 .map(crate::Response::into_body)
611 }
612
613 pub fn poller(
615 self,
616 ) -> impl google_cloud_lro::Poller<crate::model::Deployment, crate::model::OperationMetadata>
617 {
618 type Operation = google_cloud_lro::internal::Operation<
619 crate::model::Deployment,
620 crate::model::OperationMetadata,
621 >;
622 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
623 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
624 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
625 if let Some(ref mut details) = poller_options.tracing {
626 details.method_name =
627 "google_cloud_config_v1::client::Config::delete_deployment::until_done";
628 }
629
630 let stub = self.0.stub.clone();
631 let mut options = self.0.options.clone();
632 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
633 let query = move |name| {
634 let stub = stub.clone();
635 let options = options.clone();
636 async {
637 let op = GetOperation::new(stub)
638 .set_name(name)
639 .with_options(options)
640 .send()
641 .await?;
642 Ok(Operation::new(op))
643 }
644 };
645
646 let start = move || async {
647 let op = self.send().await?;
648 Ok(Operation::new(op))
649 };
650
651 use google_cloud_lro::internal::PollerExt;
652 {
653 google_cloud_lro::internal::new_poller(
654 polling_error_policy,
655 polling_backoff_policy,
656 start,
657 query,
658 )
659 }
660 .with_options(poller_options)
661 }
662
663 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
667 self.0.request.name = v.into();
668 self
669 }
670
671 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
673 self.0.request.request_id = v.into();
674 self
675 }
676
677 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
679 self.0.request.force = v.into();
680 self
681 }
682
683 pub fn set_delete_policy<T: Into<crate::model::delete_deployment_request::DeletePolicy>>(
685 mut self,
686 v: T,
687 ) -> Self {
688 self.0.request.delete_policy = v.into();
689 self
690 }
691 }
692
693 #[doc(hidden)]
694 impl crate::RequestBuilder for DeleteDeployment {
695 fn request_options(&mut self) -> &mut crate::RequestOptions {
696 &mut self.0.options
697 }
698 }
699
700 #[derive(Clone, Debug)]
721 pub struct ListRevisions(RequestBuilder<crate::model::ListRevisionsRequest>);
722
723 impl ListRevisions {
724 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
725 Self(RequestBuilder::new(stub))
726 }
727
728 pub fn with_request<V: Into<crate::model::ListRevisionsRequest>>(mut self, v: V) -> Self {
730 self.0.request = v.into();
731 self
732 }
733
734 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
736 self.0.options = v.into();
737 self
738 }
739
740 pub async fn send(self) -> Result<crate::model::ListRevisionsResponse> {
742 (*self.0.stub)
743 .list_revisions(self.0.request, self.0.options)
744 .await
745 .map(crate::Response::into_body)
746 }
747
748 pub fn by_page(
750 self,
751 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListRevisionsResponse, crate::Error>
752 {
753 use std::clone::Clone;
754 let token = self.0.request.page_token.clone();
755 let execute = move |token: String| {
756 let mut builder = self.clone();
757 builder.0.request = builder.0.request.set_page_token(token);
758 builder.send()
759 };
760 google_cloud_gax::paginator::internal::new_paginator(token, execute)
761 }
762
763 pub fn by_item(
765 self,
766 ) -> impl google_cloud_gax::paginator::ItemPaginator<
767 crate::model::ListRevisionsResponse,
768 crate::Error,
769 > {
770 use google_cloud_gax::paginator::Paginator;
771 self.by_page().items()
772 }
773
774 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
778 self.0.request.parent = v.into();
779 self
780 }
781
782 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
784 self.0.request.page_size = v.into();
785 self
786 }
787
788 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
790 self.0.request.page_token = v.into();
791 self
792 }
793
794 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
796 self.0.request.filter = v.into();
797 self
798 }
799
800 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
802 self.0.request.order_by = v.into();
803 self
804 }
805 }
806
807 #[doc(hidden)]
808 impl crate::RequestBuilder for ListRevisions {
809 fn request_options(&mut self) -> &mut crate::RequestOptions {
810 &mut self.0.options
811 }
812 }
813
814 #[derive(Clone, Debug)]
831 pub struct GetRevision(RequestBuilder<crate::model::GetRevisionRequest>);
832
833 impl GetRevision {
834 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
835 Self(RequestBuilder::new(stub))
836 }
837
838 pub fn with_request<V: Into<crate::model::GetRevisionRequest>>(mut self, v: V) -> Self {
840 self.0.request = v.into();
841 self
842 }
843
844 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
846 self.0.options = v.into();
847 self
848 }
849
850 pub async fn send(self) -> Result<crate::model::Revision> {
852 (*self.0.stub)
853 .get_revision(self.0.request, self.0.options)
854 .await
855 .map(crate::Response::into_body)
856 }
857
858 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
862 self.0.request.name = v.into();
863 self
864 }
865 }
866
867 #[doc(hidden)]
868 impl crate::RequestBuilder for GetRevision {
869 fn request_options(&mut self) -> &mut crate::RequestOptions {
870 &mut self.0.options
871 }
872 }
873
874 #[derive(Clone, Debug)]
891 pub struct GetResource(RequestBuilder<crate::model::GetResourceRequest>);
892
893 impl GetResource {
894 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
895 Self(RequestBuilder::new(stub))
896 }
897
898 pub fn with_request<V: Into<crate::model::GetResourceRequest>>(mut self, v: V) -> Self {
900 self.0.request = v.into();
901 self
902 }
903
904 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
906 self.0.options = v.into();
907 self
908 }
909
910 pub async fn send(self) -> Result<crate::model::Resource> {
912 (*self.0.stub)
913 .get_resource(self.0.request, self.0.options)
914 .await
915 .map(crate::Response::into_body)
916 }
917
918 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
922 self.0.request.name = v.into();
923 self
924 }
925 }
926
927 #[doc(hidden)]
928 impl crate::RequestBuilder for GetResource {
929 fn request_options(&mut self) -> &mut crate::RequestOptions {
930 &mut self.0.options
931 }
932 }
933
934 #[derive(Clone, Debug)]
955 pub struct ListResources(RequestBuilder<crate::model::ListResourcesRequest>);
956
957 impl ListResources {
958 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
959 Self(RequestBuilder::new(stub))
960 }
961
962 pub fn with_request<V: Into<crate::model::ListResourcesRequest>>(mut self, v: V) -> Self {
964 self.0.request = v.into();
965 self
966 }
967
968 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
970 self.0.options = v.into();
971 self
972 }
973
974 pub async fn send(self) -> Result<crate::model::ListResourcesResponse> {
976 (*self.0.stub)
977 .list_resources(self.0.request, self.0.options)
978 .await
979 .map(crate::Response::into_body)
980 }
981
982 pub fn by_page(
984 self,
985 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListResourcesResponse, crate::Error>
986 {
987 use std::clone::Clone;
988 let token = self.0.request.page_token.clone();
989 let execute = move |token: String| {
990 let mut builder = self.clone();
991 builder.0.request = builder.0.request.set_page_token(token);
992 builder.send()
993 };
994 google_cloud_gax::paginator::internal::new_paginator(token, execute)
995 }
996
997 pub fn by_item(
999 self,
1000 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1001 crate::model::ListResourcesResponse,
1002 crate::Error,
1003 > {
1004 use google_cloud_gax::paginator::Paginator;
1005 self.by_page().items()
1006 }
1007
1008 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1012 self.0.request.parent = v.into();
1013 self
1014 }
1015
1016 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1018 self.0.request.page_size = v.into();
1019 self
1020 }
1021
1022 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1024 self.0.request.page_token = v.into();
1025 self
1026 }
1027
1028 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1030 self.0.request.filter = v.into();
1031 self
1032 }
1033
1034 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1036 self.0.request.order_by = v.into();
1037 self
1038 }
1039 }
1040
1041 #[doc(hidden)]
1042 impl crate::RequestBuilder for ListResources {
1043 fn request_options(&mut self) -> &mut crate::RequestOptions {
1044 &mut self.0.options
1045 }
1046 }
1047
1048 #[derive(Clone, Debug)]
1065 pub struct ExportDeploymentStatefile(
1066 RequestBuilder<crate::model::ExportDeploymentStatefileRequest>,
1067 );
1068
1069 impl ExportDeploymentStatefile {
1070 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1071 Self(RequestBuilder::new(stub))
1072 }
1073
1074 pub fn with_request<V: Into<crate::model::ExportDeploymentStatefileRequest>>(
1076 mut self,
1077 v: V,
1078 ) -> Self {
1079 self.0.request = v.into();
1080 self
1081 }
1082
1083 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1085 self.0.options = v.into();
1086 self
1087 }
1088
1089 pub async fn send(self) -> Result<crate::model::Statefile> {
1091 (*self.0.stub)
1092 .export_deployment_statefile(self.0.request, self.0.options)
1093 .await
1094 .map(crate::Response::into_body)
1095 }
1096
1097 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1101 self.0.request.parent = v.into();
1102 self
1103 }
1104
1105 pub fn set_draft<T: Into<bool>>(mut self, v: T) -> Self {
1107 self.0.request.draft = v.into();
1108 self
1109 }
1110 }
1111
1112 #[doc(hidden)]
1113 impl crate::RequestBuilder for ExportDeploymentStatefile {
1114 fn request_options(&mut self) -> &mut crate::RequestOptions {
1115 &mut self.0.options
1116 }
1117 }
1118
1119 #[derive(Clone, Debug)]
1136 pub struct ExportRevisionStatefile(
1137 RequestBuilder<crate::model::ExportRevisionStatefileRequest>,
1138 );
1139
1140 impl ExportRevisionStatefile {
1141 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1142 Self(RequestBuilder::new(stub))
1143 }
1144
1145 pub fn with_request<V: Into<crate::model::ExportRevisionStatefileRequest>>(
1147 mut self,
1148 v: V,
1149 ) -> Self {
1150 self.0.request = v.into();
1151 self
1152 }
1153
1154 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1156 self.0.options = v.into();
1157 self
1158 }
1159
1160 pub async fn send(self) -> Result<crate::model::Statefile> {
1162 (*self.0.stub)
1163 .export_revision_statefile(self.0.request, self.0.options)
1164 .await
1165 .map(crate::Response::into_body)
1166 }
1167
1168 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1172 self.0.request.parent = v.into();
1173 self
1174 }
1175 }
1176
1177 #[doc(hidden)]
1178 impl crate::RequestBuilder for ExportRevisionStatefile {
1179 fn request_options(&mut self) -> &mut crate::RequestOptions {
1180 &mut self.0.options
1181 }
1182 }
1183
1184 #[derive(Clone, Debug)]
1201 pub struct ImportStatefile(RequestBuilder<crate::model::ImportStatefileRequest>);
1202
1203 impl ImportStatefile {
1204 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1205 Self(RequestBuilder::new(stub))
1206 }
1207
1208 pub fn with_request<V: Into<crate::model::ImportStatefileRequest>>(mut self, v: V) -> Self {
1210 self.0.request = v.into();
1211 self
1212 }
1213
1214 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1216 self.0.options = v.into();
1217 self
1218 }
1219
1220 pub async fn send(self) -> Result<crate::model::Statefile> {
1222 (*self.0.stub)
1223 .import_statefile(self.0.request, self.0.options)
1224 .await
1225 .map(crate::Response::into_body)
1226 }
1227
1228 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1232 self.0.request.parent = v.into();
1233 self
1234 }
1235
1236 pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1240 self.0.request.lock_id = v.into();
1241 self
1242 }
1243
1244 pub fn set_skip_draft<T: Into<bool>>(mut self, v: T) -> Self {
1246 self.0.request.skip_draft = v.into();
1247 self
1248 }
1249 }
1250
1251 #[doc(hidden)]
1252 impl crate::RequestBuilder for ImportStatefile {
1253 fn request_options(&mut self) -> &mut crate::RequestOptions {
1254 &mut self.0.options
1255 }
1256 }
1257
1258 #[derive(Clone, Debug)]
1275 pub struct DeleteStatefile(RequestBuilder<crate::model::DeleteStatefileRequest>);
1276
1277 impl DeleteStatefile {
1278 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1279 Self(RequestBuilder::new(stub))
1280 }
1281
1282 pub fn with_request<V: Into<crate::model::DeleteStatefileRequest>>(mut self, v: V) -> Self {
1284 self.0.request = v.into();
1285 self
1286 }
1287
1288 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1290 self.0.options = v.into();
1291 self
1292 }
1293
1294 pub async fn send(self) -> Result<()> {
1296 (*self.0.stub)
1297 .delete_statefile(self.0.request, self.0.options)
1298 .await
1299 .map(crate::Response::into_body)
1300 }
1301
1302 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1306 self.0.request.name = v.into();
1307 self
1308 }
1309
1310 pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1314 self.0.request.lock_id = v.into();
1315 self
1316 }
1317 }
1318
1319 #[doc(hidden)]
1320 impl crate::RequestBuilder for DeleteStatefile {
1321 fn request_options(&mut self) -> &mut crate::RequestOptions {
1322 &mut self.0.options
1323 }
1324 }
1325
1326 #[derive(Clone, Debug)]
1344 pub struct LockDeployment(RequestBuilder<crate::model::LockDeploymentRequest>);
1345
1346 impl LockDeployment {
1347 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1348 Self(RequestBuilder::new(stub))
1349 }
1350
1351 pub fn with_request<V: Into<crate::model::LockDeploymentRequest>>(mut self, v: V) -> Self {
1353 self.0.request = v.into();
1354 self
1355 }
1356
1357 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1359 self.0.options = v.into();
1360 self
1361 }
1362
1363 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1370 (*self.0.stub)
1371 .lock_deployment(self.0.request, self.0.options)
1372 .await
1373 .map(crate::Response::into_body)
1374 }
1375
1376 pub fn poller(
1378 self,
1379 ) -> impl google_cloud_lro::Poller<crate::model::Deployment, crate::model::OperationMetadata>
1380 {
1381 type Operation = google_cloud_lro::internal::Operation<
1382 crate::model::Deployment,
1383 crate::model::OperationMetadata,
1384 >;
1385 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1386 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1387 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1388 if let Some(ref mut details) = poller_options.tracing {
1389 details.method_name =
1390 "google_cloud_config_v1::client::Config::lock_deployment::until_done";
1391 }
1392
1393 let stub = self.0.stub.clone();
1394 let mut options = self.0.options.clone();
1395 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1396 let query = move |name| {
1397 let stub = stub.clone();
1398 let options = options.clone();
1399 async {
1400 let op = GetOperation::new(stub)
1401 .set_name(name)
1402 .with_options(options)
1403 .send()
1404 .await?;
1405 Ok(Operation::new(op))
1406 }
1407 };
1408
1409 let start = move || async {
1410 let op = self.send().await?;
1411 Ok(Operation::new(op))
1412 };
1413
1414 use google_cloud_lro::internal::PollerExt;
1415 {
1416 google_cloud_lro::internal::new_poller(
1417 polling_error_policy,
1418 polling_backoff_policy,
1419 start,
1420 query,
1421 )
1422 }
1423 .with_options(poller_options)
1424 }
1425
1426 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1430 self.0.request.name = v.into();
1431 self
1432 }
1433 }
1434
1435 #[doc(hidden)]
1436 impl crate::RequestBuilder for LockDeployment {
1437 fn request_options(&mut self) -> &mut crate::RequestOptions {
1438 &mut self.0.options
1439 }
1440 }
1441
1442 #[derive(Clone, Debug)]
1460 pub struct UnlockDeployment(RequestBuilder<crate::model::UnlockDeploymentRequest>);
1461
1462 impl UnlockDeployment {
1463 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1464 Self(RequestBuilder::new(stub))
1465 }
1466
1467 pub fn with_request<V: Into<crate::model::UnlockDeploymentRequest>>(
1469 mut self,
1470 v: V,
1471 ) -> Self {
1472 self.0.request = v.into();
1473 self
1474 }
1475
1476 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1478 self.0.options = v.into();
1479 self
1480 }
1481
1482 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1489 (*self.0.stub)
1490 .unlock_deployment(self.0.request, self.0.options)
1491 .await
1492 .map(crate::Response::into_body)
1493 }
1494
1495 pub fn poller(
1497 self,
1498 ) -> impl google_cloud_lro::Poller<crate::model::Deployment, crate::model::OperationMetadata>
1499 {
1500 type Operation = google_cloud_lro::internal::Operation<
1501 crate::model::Deployment,
1502 crate::model::OperationMetadata,
1503 >;
1504 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1505 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1506 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1507 if let Some(ref mut details) = poller_options.tracing {
1508 details.method_name =
1509 "google_cloud_config_v1::client::Config::unlock_deployment::until_done";
1510 }
1511
1512 let stub = self.0.stub.clone();
1513 let mut options = self.0.options.clone();
1514 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1515 let query = move |name| {
1516 let stub = stub.clone();
1517 let options = options.clone();
1518 async {
1519 let op = GetOperation::new(stub)
1520 .set_name(name)
1521 .with_options(options)
1522 .send()
1523 .await?;
1524 Ok(Operation::new(op))
1525 }
1526 };
1527
1528 let start = move || async {
1529 let op = self.send().await?;
1530 Ok(Operation::new(op))
1531 };
1532
1533 use google_cloud_lro::internal::PollerExt;
1534 {
1535 google_cloud_lro::internal::new_poller(
1536 polling_error_policy,
1537 polling_backoff_policy,
1538 start,
1539 query,
1540 )
1541 }
1542 .with_options(poller_options)
1543 }
1544
1545 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1549 self.0.request.name = v.into();
1550 self
1551 }
1552
1553 pub fn set_lock_id<T: Into<i64>>(mut self, v: T) -> Self {
1557 self.0.request.lock_id = v.into();
1558 self
1559 }
1560 }
1561
1562 #[doc(hidden)]
1563 impl crate::RequestBuilder for UnlockDeployment {
1564 fn request_options(&mut self) -> &mut crate::RequestOptions {
1565 &mut self.0.options
1566 }
1567 }
1568
1569 #[derive(Clone, Debug)]
1586 pub struct ExportLockInfo(RequestBuilder<crate::model::ExportLockInfoRequest>);
1587
1588 impl ExportLockInfo {
1589 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1590 Self(RequestBuilder::new(stub))
1591 }
1592
1593 pub fn with_request<V: Into<crate::model::ExportLockInfoRequest>>(mut self, v: V) -> Self {
1595 self.0.request = v.into();
1596 self
1597 }
1598
1599 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1601 self.0.options = v.into();
1602 self
1603 }
1604
1605 pub async fn send(self) -> Result<crate::model::LockInfo> {
1607 (*self.0.stub)
1608 .export_lock_info(self.0.request, self.0.options)
1609 .await
1610 .map(crate::Response::into_body)
1611 }
1612
1613 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1617 self.0.request.name = v.into();
1618 self
1619 }
1620 }
1621
1622 #[doc(hidden)]
1623 impl crate::RequestBuilder for ExportLockInfo {
1624 fn request_options(&mut self) -> &mut crate::RequestOptions {
1625 &mut self.0.options
1626 }
1627 }
1628
1629 #[derive(Clone, Debug)]
1647 pub struct CreatePreview(RequestBuilder<crate::model::CreatePreviewRequest>);
1648
1649 impl CreatePreview {
1650 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1651 Self(RequestBuilder::new(stub))
1652 }
1653
1654 pub fn with_request<V: Into<crate::model::CreatePreviewRequest>>(mut self, v: V) -> Self {
1656 self.0.request = v.into();
1657 self
1658 }
1659
1660 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1662 self.0.options = v.into();
1663 self
1664 }
1665
1666 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1673 (*self.0.stub)
1674 .create_preview(self.0.request, self.0.options)
1675 .await
1676 .map(crate::Response::into_body)
1677 }
1678
1679 pub fn poller(
1681 self,
1682 ) -> impl google_cloud_lro::Poller<crate::model::Preview, crate::model::OperationMetadata>
1683 {
1684 type Operation = google_cloud_lro::internal::Operation<
1685 crate::model::Preview,
1686 crate::model::OperationMetadata,
1687 >;
1688 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1689 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1690 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1691 if let Some(ref mut details) = poller_options.tracing {
1692 details.method_name =
1693 "google_cloud_config_v1::client::Config::create_preview::until_done";
1694 }
1695
1696 let stub = self.0.stub.clone();
1697 let mut options = self.0.options.clone();
1698 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1699 let query = move |name| {
1700 let stub = stub.clone();
1701 let options = options.clone();
1702 async {
1703 let op = GetOperation::new(stub)
1704 .set_name(name)
1705 .with_options(options)
1706 .send()
1707 .await?;
1708 Ok(Operation::new(op))
1709 }
1710 };
1711
1712 let start = move || async {
1713 let op = self.send().await?;
1714 Ok(Operation::new(op))
1715 };
1716
1717 use google_cloud_lro::internal::PollerExt;
1718 {
1719 google_cloud_lro::internal::new_poller(
1720 polling_error_policy,
1721 polling_backoff_policy,
1722 start,
1723 query,
1724 )
1725 }
1726 .with_options(poller_options)
1727 }
1728
1729 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1733 self.0.request.parent = v.into();
1734 self
1735 }
1736
1737 pub fn set_preview_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1739 self.0.request.preview_id = v.into();
1740 self
1741 }
1742
1743 pub fn set_preview<T>(mut self, v: T) -> Self
1747 where
1748 T: std::convert::Into<crate::model::Preview>,
1749 {
1750 self.0.request.preview = std::option::Option::Some(v.into());
1751 self
1752 }
1753
1754 pub fn set_or_clear_preview<T>(mut self, v: std::option::Option<T>) -> Self
1758 where
1759 T: std::convert::Into<crate::model::Preview>,
1760 {
1761 self.0.request.preview = v.map(|x| x.into());
1762 self
1763 }
1764
1765 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1767 self.0.request.request_id = v.into();
1768 self
1769 }
1770 }
1771
1772 #[doc(hidden)]
1773 impl crate::RequestBuilder for CreatePreview {
1774 fn request_options(&mut self) -> &mut crate::RequestOptions {
1775 &mut self.0.options
1776 }
1777 }
1778
1779 #[derive(Clone, Debug)]
1796 pub struct GetPreview(RequestBuilder<crate::model::GetPreviewRequest>);
1797
1798 impl GetPreview {
1799 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1800 Self(RequestBuilder::new(stub))
1801 }
1802
1803 pub fn with_request<V: Into<crate::model::GetPreviewRequest>>(mut self, v: V) -> Self {
1805 self.0.request = v.into();
1806 self
1807 }
1808
1809 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1811 self.0.options = v.into();
1812 self
1813 }
1814
1815 pub async fn send(self) -> Result<crate::model::Preview> {
1817 (*self.0.stub)
1818 .get_preview(self.0.request, self.0.options)
1819 .await
1820 .map(crate::Response::into_body)
1821 }
1822
1823 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1827 self.0.request.name = v.into();
1828 self
1829 }
1830 }
1831
1832 #[doc(hidden)]
1833 impl crate::RequestBuilder for GetPreview {
1834 fn request_options(&mut self) -> &mut crate::RequestOptions {
1835 &mut self.0.options
1836 }
1837 }
1838
1839 #[derive(Clone, Debug)]
1860 pub struct ListPreviews(RequestBuilder<crate::model::ListPreviewsRequest>);
1861
1862 impl ListPreviews {
1863 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1864 Self(RequestBuilder::new(stub))
1865 }
1866
1867 pub fn with_request<V: Into<crate::model::ListPreviewsRequest>>(mut self, v: V) -> Self {
1869 self.0.request = v.into();
1870 self
1871 }
1872
1873 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1875 self.0.options = v.into();
1876 self
1877 }
1878
1879 pub async fn send(self) -> Result<crate::model::ListPreviewsResponse> {
1881 (*self.0.stub)
1882 .list_previews(self.0.request, self.0.options)
1883 .await
1884 .map(crate::Response::into_body)
1885 }
1886
1887 pub fn by_page(
1889 self,
1890 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListPreviewsResponse, crate::Error>
1891 {
1892 use std::clone::Clone;
1893 let token = self.0.request.page_token.clone();
1894 let execute = move |token: String| {
1895 let mut builder = self.clone();
1896 builder.0.request = builder.0.request.set_page_token(token);
1897 builder.send()
1898 };
1899 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1900 }
1901
1902 pub fn by_item(
1904 self,
1905 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1906 crate::model::ListPreviewsResponse,
1907 crate::Error,
1908 > {
1909 use google_cloud_gax::paginator::Paginator;
1910 self.by_page().items()
1911 }
1912
1913 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1917 self.0.request.parent = v.into();
1918 self
1919 }
1920
1921 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1923 self.0.request.page_size = v.into();
1924 self
1925 }
1926
1927 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1929 self.0.request.page_token = v.into();
1930 self
1931 }
1932
1933 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1935 self.0.request.filter = v.into();
1936 self
1937 }
1938
1939 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1941 self.0.request.order_by = v.into();
1942 self
1943 }
1944 }
1945
1946 #[doc(hidden)]
1947 impl crate::RequestBuilder for ListPreviews {
1948 fn request_options(&mut self) -> &mut crate::RequestOptions {
1949 &mut self.0.options
1950 }
1951 }
1952
1953 #[derive(Clone, Debug)]
1971 pub struct DeletePreview(RequestBuilder<crate::model::DeletePreviewRequest>);
1972
1973 impl DeletePreview {
1974 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
1975 Self(RequestBuilder::new(stub))
1976 }
1977
1978 pub fn with_request<V: Into<crate::model::DeletePreviewRequest>>(mut self, v: V) -> Self {
1980 self.0.request = v.into();
1981 self
1982 }
1983
1984 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1986 self.0.options = v.into();
1987 self
1988 }
1989
1990 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1997 (*self.0.stub)
1998 .delete_preview(self.0.request, self.0.options)
1999 .await
2000 .map(crate::Response::into_body)
2001 }
2002
2003 pub fn poller(
2005 self,
2006 ) -> impl google_cloud_lro::Poller<crate::model::Preview, crate::model::OperationMetadata>
2007 {
2008 type Operation = google_cloud_lro::internal::Operation<
2009 crate::model::Preview,
2010 crate::model::OperationMetadata,
2011 >;
2012 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2013 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2014 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2015 if let Some(ref mut details) = poller_options.tracing {
2016 details.method_name =
2017 "google_cloud_config_v1::client::Config::delete_preview::until_done";
2018 }
2019
2020 let stub = self.0.stub.clone();
2021 let mut options = self.0.options.clone();
2022 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2023 let query = move |name| {
2024 let stub = stub.clone();
2025 let options = options.clone();
2026 async {
2027 let op = GetOperation::new(stub)
2028 .set_name(name)
2029 .with_options(options)
2030 .send()
2031 .await?;
2032 Ok(Operation::new(op))
2033 }
2034 };
2035
2036 let start = move || async {
2037 let op = self.send().await?;
2038 Ok(Operation::new(op))
2039 };
2040
2041 use google_cloud_lro::internal::PollerExt;
2042 {
2043 google_cloud_lro::internal::new_poller(
2044 polling_error_policy,
2045 polling_backoff_policy,
2046 start,
2047 query,
2048 )
2049 }
2050 .with_options(poller_options)
2051 }
2052
2053 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2057 self.0.request.name = v.into();
2058 self
2059 }
2060
2061 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2063 self.0.request.request_id = v.into();
2064 self
2065 }
2066 }
2067
2068 #[doc(hidden)]
2069 impl crate::RequestBuilder for DeletePreview {
2070 fn request_options(&mut self) -> &mut crate::RequestOptions {
2071 &mut self.0.options
2072 }
2073 }
2074
2075 #[derive(Clone, Debug)]
2092 pub struct ExportPreviewResult(RequestBuilder<crate::model::ExportPreviewResultRequest>);
2093
2094 impl ExportPreviewResult {
2095 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2096 Self(RequestBuilder::new(stub))
2097 }
2098
2099 pub fn with_request<V: Into<crate::model::ExportPreviewResultRequest>>(
2101 mut self,
2102 v: V,
2103 ) -> Self {
2104 self.0.request = v.into();
2105 self
2106 }
2107
2108 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2110 self.0.options = v.into();
2111 self
2112 }
2113
2114 pub async fn send(self) -> Result<crate::model::ExportPreviewResultResponse> {
2116 (*self.0.stub)
2117 .export_preview_result(self.0.request, self.0.options)
2118 .await
2119 .map(crate::Response::into_body)
2120 }
2121
2122 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2126 self.0.request.parent = v.into();
2127 self
2128 }
2129 }
2130
2131 #[doc(hidden)]
2132 impl crate::RequestBuilder for ExportPreviewResult {
2133 fn request_options(&mut self) -> &mut crate::RequestOptions {
2134 &mut self.0.options
2135 }
2136 }
2137
2138 #[derive(Clone, Debug)]
2159 pub struct ListTerraformVersions(RequestBuilder<crate::model::ListTerraformVersionsRequest>);
2160
2161 impl ListTerraformVersions {
2162 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2163 Self(RequestBuilder::new(stub))
2164 }
2165
2166 pub fn with_request<V: Into<crate::model::ListTerraformVersionsRequest>>(
2168 mut self,
2169 v: V,
2170 ) -> Self {
2171 self.0.request = v.into();
2172 self
2173 }
2174
2175 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2177 self.0.options = v.into();
2178 self
2179 }
2180
2181 pub async fn send(self) -> Result<crate::model::ListTerraformVersionsResponse> {
2183 (*self.0.stub)
2184 .list_terraform_versions(self.0.request, self.0.options)
2185 .await
2186 .map(crate::Response::into_body)
2187 }
2188
2189 pub fn by_page(
2191 self,
2192 ) -> impl google_cloud_gax::paginator::Paginator<
2193 crate::model::ListTerraformVersionsResponse,
2194 crate::Error,
2195 > {
2196 use std::clone::Clone;
2197 let token = self.0.request.page_token.clone();
2198 let execute = move |token: String| {
2199 let mut builder = self.clone();
2200 builder.0.request = builder.0.request.set_page_token(token);
2201 builder.send()
2202 };
2203 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2204 }
2205
2206 pub fn by_item(
2208 self,
2209 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2210 crate::model::ListTerraformVersionsResponse,
2211 crate::Error,
2212 > {
2213 use google_cloud_gax::paginator::Paginator;
2214 self.by_page().items()
2215 }
2216
2217 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2221 self.0.request.parent = v.into();
2222 self
2223 }
2224
2225 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2227 self.0.request.page_size = v.into();
2228 self
2229 }
2230
2231 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2233 self.0.request.page_token = v.into();
2234 self
2235 }
2236
2237 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2239 self.0.request.filter = v.into();
2240 self
2241 }
2242
2243 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2245 self.0.request.order_by = v.into();
2246 self
2247 }
2248 }
2249
2250 #[doc(hidden)]
2251 impl crate::RequestBuilder for ListTerraformVersions {
2252 fn request_options(&mut self) -> &mut crate::RequestOptions {
2253 &mut self.0.options
2254 }
2255 }
2256
2257 #[derive(Clone, Debug)]
2274 pub struct GetTerraformVersion(RequestBuilder<crate::model::GetTerraformVersionRequest>);
2275
2276 impl GetTerraformVersion {
2277 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2278 Self(RequestBuilder::new(stub))
2279 }
2280
2281 pub fn with_request<V: Into<crate::model::GetTerraformVersionRequest>>(
2283 mut self,
2284 v: V,
2285 ) -> Self {
2286 self.0.request = v.into();
2287 self
2288 }
2289
2290 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2292 self.0.options = v.into();
2293 self
2294 }
2295
2296 pub async fn send(self) -> Result<crate::model::TerraformVersion> {
2298 (*self.0.stub)
2299 .get_terraform_version(self.0.request, self.0.options)
2300 .await
2301 .map(crate::Response::into_body)
2302 }
2303
2304 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2308 self.0.request.name = v.into();
2309 self
2310 }
2311 }
2312
2313 #[doc(hidden)]
2314 impl crate::RequestBuilder for GetTerraformVersion {
2315 fn request_options(&mut self) -> &mut crate::RequestOptions {
2316 &mut self.0.options
2317 }
2318 }
2319
2320 #[derive(Clone, Debug)]
2341 pub struct ListResourceChanges(RequestBuilder<crate::model::ListResourceChangesRequest>);
2342
2343 impl ListResourceChanges {
2344 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2345 Self(RequestBuilder::new(stub))
2346 }
2347
2348 pub fn with_request<V: Into<crate::model::ListResourceChangesRequest>>(
2350 mut self,
2351 v: V,
2352 ) -> Self {
2353 self.0.request = v.into();
2354 self
2355 }
2356
2357 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2359 self.0.options = v.into();
2360 self
2361 }
2362
2363 pub async fn send(self) -> Result<crate::model::ListResourceChangesResponse> {
2365 (*self.0.stub)
2366 .list_resource_changes(self.0.request, self.0.options)
2367 .await
2368 .map(crate::Response::into_body)
2369 }
2370
2371 pub fn by_page(
2373 self,
2374 ) -> impl google_cloud_gax::paginator::Paginator<
2375 crate::model::ListResourceChangesResponse,
2376 crate::Error,
2377 > {
2378 use std::clone::Clone;
2379 let token = self.0.request.page_token.clone();
2380 let execute = move |token: String| {
2381 let mut builder = self.clone();
2382 builder.0.request = builder.0.request.set_page_token(token);
2383 builder.send()
2384 };
2385 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2386 }
2387
2388 pub fn by_item(
2390 self,
2391 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2392 crate::model::ListResourceChangesResponse,
2393 crate::Error,
2394 > {
2395 use google_cloud_gax::paginator::Paginator;
2396 self.by_page().items()
2397 }
2398
2399 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2403 self.0.request.parent = v.into();
2404 self
2405 }
2406
2407 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2409 self.0.request.page_size = v.into();
2410 self
2411 }
2412
2413 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2415 self.0.request.page_token = v.into();
2416 self
2417 }
2418
2419 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2421 self.0.request.filter = v.into();
2422 self
2423 }
2424
2425 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2427 self.0.request.order_by = v.into();
2428 self
2429 }
2430 }
2431
2432 #[doc(hidden)]
2433 impl crate::RequestBuilder for ListResourceChanges {
2434 fn request_options(&mut self) -> &mut crate::RequestOptions {
2435 &mut self.0.options
2436 }
2437 }
2438
2439 #[derive(Clone, Debug)]
2456 pub struct GetResourceChange(RequestBuilder<crate::model::GetResourceChangeRequest>);
2457
2458 impl GetResourceChange {
2459 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2460 Self(RequestBuilder::new(stub))
2461 }
2462
2463 pub fn with_request<V: Into<crate::model::GetResourceChangeRequest>>(
2465 mut self,
2466 v: V,
2467 ) -> Self {
2468 self.0.request = v.into();
2469 self
2470 }
2471
2472 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2474 self.0.options = v.into();
2475 self
2476 }
2477
2478 pub async fn send(self) -> Result<crate::model::ResourceChange> {
2480 (*self.0.stub)
2481 .get_resource_change(self.0.request, self.0.options)
2482 .await
2483 .map(crate::Response::into_body)
2484 }
2485
2486 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2490 self.0.request.name = v.into();
2491 self
2492 }
2493 }
2494
2495 #[doc(hidden)]
2496 impl crate::RequestBuilder for GetResourceChange {
2497 fn request_options(&mut self) -> &mut crate::RequestOptions {
2498 &mut self.0.options
2499 }
2500 }
2501
2502 #[derive(Clone, Debug)]
2523 pub struct ListResourceDrifts(RequestBuilder<crate::model::ListResourceDriftsRequest>);
2524
2525 impl ListResourceDrifts {
2526 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2527 Self(RequestBuilder::new(stub))
2528 }
2529
2530 pub fn with_request<V: Into<crate::model::ListResourceDriftsRequest>>(
2532 mut self,
2533 v: V,
2534 ) -> Self {
2535 self.0.request = v.into();
2536 self
2537 }
2538
2539 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2541 self.0.options = v.into();
2542 self
2543 }
2544
2545 pub async fn send(self) -> Result<crate::model::ListResourceDriftsResponse> {
2547 (*self.0.stub)
2548 .list_resource_drifts(self.0.request, self.0.options)
2549 .await
2550 .map(crate::Response::into_body)
2551 }
2552
2553 pub fn by_page(
2555 self,
2556 ) -> impl google_cloud_gax::paginator::Paginator<
2557 crate::model::ListResourceDriftsResponse,
2558 crate::Error,
2559 > {
2560 use std::clone::Clone;
2561 let token = self.0.request.page_token.clone();
2562 let execute = move |token: String| {
2563 let mut builder = self.clone();
2564 builder.0.request = builder.0.request.set_page_token(token);
2565 builder.send()
2566 };
2567 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2568 }
2569
2570 pub fn by_item(
2572 self,
2573 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2574 crate::model::ListResourceDriftsResponse,
2575 crate::Error,
2576 > {
2577 use google_cloud_gax::paginator::Paginator;
2578 self.by_page().items()
2579 }
2580
2581 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2585 self.0.request.parent = v.into();
2586 self
2587 }
2588
2589 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2591 self.0.request.page_size = v.into();
2592 self
2593 }
2594
2595 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2597 self.0.request.page_token = v.into();
2598 self
2599 }
2600
2601 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2603 self.0.request.filter = v.into();
2604 self
2605 }
2606
2607 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2609 self.0.request.order_by = v.into();
2610 self
2611 }
2612 }
2613
2614 #[doc(hidden)]
2615 impl crate::RequestBuilder for ListResourceDrifts {
2616 fn request_options(&mut self) -> &mut crate::RequestOptions {
2617 &mut self.0.options
2618 }
2619 }
2620
2621 #[derive(Clone, Debug)]
2638 pub struct GetResourceDrift(RequestBuilder<crate::model::GetResourceDriftRequest>);
2639
2640 impl GetResourceDrift {
2641 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2642 Self(RequestBuilder::new(stub))
2643 }
2644
2645 pub fn with_request<V: Into<crate::model::GetResourceDriftRequest>>(
2647 mut self,
2648 v: V,
2649 ) -> Self {
2650 self.0.request = v.into();
2651 self
2652 }
2653
2654 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2656 self.0.options = v.into();
2657 self
2658 }
2659
2660 pub async fn send(self) -> Result<crate::model::ResourceDrift> {
2662 (*self.0.stub)
2663 .get_resource_drift(self.0.request, self.0.options)
2664 .await
2665 .map(crate::Response::into_body)
2666 }
2667
2668 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2672 self.0.request.name = v.into();
2673 self
2674 }
2675 }
2676
2677 #[doc(hidden)]
2678 impl crate::RequestBuilder for GetResourceDrift {
2679 fn request_options(&mut self) -> &mut crate::RequestOptions {
2680 &mut self.0.options
2681 }
2682 }
2683
2684 #[derive(Clone, Debug)]
2701 pub struct GetAutoMigrationConfig(RequestBuilder<crate::model::GetAutoMigrationConfigRequest>);
2702
2703 impl GetAutoMigrationConfig {
2704 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2705 Self(RequestBuilder::new(stub))
2706 }
2707
2708 pub fn with_request<V: Into<crate::model::GetAutoMigrationConfigRequest>>(
2710 mut self,
2711 v: V,
2712 ) -> Self {
2713 self.0.request = v.into();
2714 self
2715 }
2716
2717 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2719 self.0.options = v.into();
2720 self
2721 }
2722
2723 pub async fn send(self) -> Result<crate::model::AutoMigrationConfig> {
2725 (*self.0.stub)
2726 .get_auto_migration_config(self.0.request, self.0.options)
2727 .await
2728 .map(crate::Response::into_body)
2729 }
2730
2731 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2735 self.0.request.name = v.into();
2736 self
2737 }
2738 }
2739
2740 #[doc(hidden)]
2741 impl crate::RequestBuilder for GetAutoMigrationConfig {
2742 fn request_options(&mut self) -> &mut crate::RequestOptions {
2743 &mut self.0.options
2744 }
2745 }
2746
2747 #[derive(Clone, Debug)]
2765 pub struct UpdateAutoMigrationConfig(
2766 RequestBuilder<crate::model::UpdateAutoMigrationConfigRequest>,
2767 );
2768
2769 impl UpdateAutoMigrationConfig {
2770 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2771 Self(RequestBuilder::new(stub))
2772 }
2773
2774 pub fn with_request<V: Into<crate::model::UpdateAutoMigrationConfigRequest>>(
2776 mut self,
2777 v: V,
2778 ) -> Self {
2779 self.0.request = v.into();
2780 self
2781 }
2782
2783 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2785 self.0.options = v.into();
2786 self
2787 }
2788
2789 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2796 (*self.0.stub)
2797 .update_auto_migration_config(self.0.request, self.0.options)
2798 .await
2799 .map(crate::Response::into_body)
2800 }
2801
2802 pub fn poller(
2804 self,
2805 ) -> impl google_cloud_lro::Poller<
2806 crate::model::AutoMigrationConfig,
2807 crate::model::OperationMetadata,
2808 > {
2809 type Operation = google_cloud_lro::internal::Operation<
2810 crate::model::AutoMigrationConfig,
2811 crate::model::OperationMetadata,
2812 >;
2813 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2814 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2815 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2816 if let Some(ref mut details) = poller_options.tracing {
2817 details.method_name = "google_cloud_config_v1::client::Config::update_auto_migration_config::until_done";
2818 }
2819
2820 let stub = self.0.stub.clone();
2821 let mut options = self.0.options.clone();
2822 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2823 let query = move |name| {
2824 let stub = stub.clone();
2825 let options = options.clone();
2826 async {
2827 let op = GetOperation::new(stub)
2828 .set_name(name)
2829 .with_options(options)
2830 .send()
2831 .await?;
2832 Ok(Operation::new(op))
2833 }
2834 };
2835
2836 let start = move || async {
2837 let op = self.send().await?;
2838 Ok(Operation::new(op))
2839 };
2840
2841 use google_cloud_lro::internal::PollerExt;
2842 {
2843 google_cloud_lro::internal::new_poller(
2844 polling_error_policy,
2845 polling_backoff_policy,
2846 start,
2847 query,
2848 )
2849 }
2850 .with_options(poller_options)
2851 }
2852
2853 pub fn set_update_mask<T>(mut self, v: T) -> Self
2855 where
2856 T: std::convert::Into<wkt::FieldMask>,
2857 {
2858 self.0.request.update_mask = std::option::Option::Some(v.into());
2859 self
2860 }
2861
2862 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2864 where
2865 T: std::convert::Into<wkt::FieldMask>,
2866 {
2867 self.0.request.update_mask = v.map(|x| x.into());
2868 self
2869 }
2870
2871 pub fn set_auto_migration_config<T>(mut self, v: T) -> Self
2875 where
2876 T: std::convert::Into<crate::model::AutoMigrationConfig>,
2877 {
2878 self.0.request.auto_migration_config = std::option::Option::Some(v.into());
2879 self
2880 }
2881
2882 pub fn set_or_clear_auto_migration_config<T>(mut self, v: std::option::Option<T>) -> Self
2886 where
2887 T: std::convert::Into<crate::model::AutoMigrationConfig>,
2888 {
2889 self.0.request.auto_migration_config = v.map(|x| x.into());
2890 self
2891 }
2892 }
2893
2894 #[doc(hidden)]
2895 impl crate::RequestBuilder for UpdateAutoMigrationConfig {
2896 fn request_options(&mut self) -> &mut crate::RequestOptions {
2897 &mut self.0.options
2898 }
2899 }
2900
2901 #[derive(Clone, Debug)]
2918 pub struct GetDeploymentGroup(RequestBuilder<crate::model::GetDeploymentGroupRequest>);
2919
2920 impl GetDeploymentGroup {
2921 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2922 Self(RequestBuilder::new(stub))
2923 }
2924
2925 pub fn with_request<V: Into<crate::model::GetDeploymentGroupRequest>>(
2927 mut self,
2928 v: V,
2929 ) -> Self {
2930 self.0.request = v.into();
2931 self
2932 }
2933
2934 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2936 self.0.options = v.into();
2937 self
2938 }
2939
2940 pub async fn send(self) -> Result<crate::model::DeploymentGroup> {
2942 (*self.0.stub)
2943 .get_deployment_group(self.0.request, self.0.options)
2944 .await
2945 .map(crate::Response::into_body)
2946 }
2947
2948 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2952 self.0.request.name = v.into();
2953 self
2954 }
2955 }
2956
2957 #[doc(hidden)]
2958 impl crate::RequestBuilder for GetDeploymentGroup {
2959 fn request_options(&mut self) -> &mut crate::RequestOptions {
2960 &mut self.0.options
2961 }
2962 }
2963
2964 #[derive(Clone, Debug)]
2982 pub struct CreateDeploymentGroup(RequestBuilder<crate::model::CreateDeploymentGroupRequest>);
2983
2984 impl CreateDeploymentGroup {
2985 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
2986 Self(RequestBuilder::new(stub))
2987 }
2988
2989 pub fn with_request<V: Into<crate::model::CreateDeploymentGroupRequest>>(
2991 mut self,
2992 v: V,
2993 ) -> Self {
2994 self.0.request = v.into();
2995 self
2996 }
2997
2998 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3000 self.0.options = v.into();
3001 self
3002 }
3003
3004 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3011 (*self.0.stub)
3012 .create_deployment_group(self.0.request, self.0.options)
3013 .await
3014 .map(crate::Response::into_body)
3015 }
3016
3017 pub fn poller(
3019 self,
3020 ) -> impl google_cloud_lro::Poller<crate::model::DeploymentGroup, crate::model::OperationMetadata>
3021 {
3022 type Operation = google_cloud_lro::internal::Operation<
3023 crate::model::DeploymentGroup,
3024 crate::model::OperationMetadata,
3025 >;
3026 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3027 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3028 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3029 if let Some(ref mut details) = poller_options.tracing {
3030 details.method_name =
3031 "google_cloud_config_v1::client::Config::create_deployment_group::until_done";
3032 }
3033
3034 let stub = self.0.stub.clone();
3035 let mut options = self.0.options.clone();
3036 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3037 let query = move |name| {
3038 let stub = stub.clone();
3039 let options = options.clone();
3040 async {
3041 let op = GetOperation::new(stub)
3042 .set_name(name)
3043 .with_options(options)
3044 .send()
3045 .await?;
3046 Ok(Operation::new(op))
3047 }
3048 };
3049
3050 let start = move || async {
3051 let op = self.send().await?;
3052 Ok(Operation::new(op))
3053 };
3054
3055 use google_cloud_lro::internal::PollerExt;
3056 {
3057 google_cloud_lro::internal::new_poller(
3058 polling_error_policy,
3059 polling_backoff_policy,
3060 start,
3061 query,
3062 )
3063 }
3064 .with_options(poller_options)
3065 }
3066
3067 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3071 self.0.request.parent = v.into();
3072 self
3073 }
3074
3075 pub fn set_deployment_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3079 self.0.request.deployment_group_id = v.into();
3080 self
3081 }
3082
3083 pub fn set_deployment_group<T>(mut self, v: T) -> Self
3087 where
3088 T: std::convert::Into<crate::model::DeploymentGroup>,
3089 {
3090 self.0.request.deployment_group = std::option::Option::Some(v.into());
3091 self
3092 }
3093
3094 pub fn set_or_clear_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
3098 where
3099 T: std::convert::Into<crate::model::DeploymentGroup>,
3100 {
3101 self.0.request.deployment_group = v.map(|x| x.into());
3102 self
3103 }
3104
3105 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3107 self.0.request.request_id = v.into();
3108 self
3109 }
3110 }
3111
3112 #[doc(hidden)]
3113 impl crate::RequestBuilder for CreateDeploymentGroup {
3114 fn request_options(&mut self) -> &mut crate::RequestOptions {
3115 &mut self.0.options
3116 }
3117 }
3118
3119 #[derive(Clone, Debug)]
3137 pub struct UpdateDeploymentGroup(RequestBuilder<crate::model::UpdateDeploymentGroupRequest>);
3138
3139 impl UpdateDeploymentGroup {
3140 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3141 Self(RequestBuilder::new(stub))
3142 }
3143
3144 pub fn with_request<V: Into<crate::model::UpdateDeploymentGroupRequest>>(
3146 mut self,
3147 v: V,
3148 ) -> Self {
3149 self.0.request = v.into();
3150 self
3151 }
3152
3153 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3155 self.0.options = v.into();
3156 self
3157 }
3158
3159 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3166 (*self.0.stub)
3167 .update_deployment_group(self.0.request, self.0.options)
3168 .await
3169 .map(crate::Response::into_body)
3170 }
3171
3172 pub fn poller(
3174 self,
3175 ) -> impl google_cloud_lro::Poller<crate::model::DeploymentGroup, crate::model::OperationMetadata>
3176 {
3177 type Operation = google_cloud_lro::internal::Operation<
3178 crate::model::DeploymentGroup,
3179 crate::model::OperationMetadata,
3180 >;
3181 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3182 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3183 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3184 if let Some(ref mut details) = poller_options.tracing {
3185 details.method_name =
3186 "google_cloud_config_v1::client::Config::update_deployment_group::until_done";
3187 }
3188
3189 let stub = self.0.stub.clone();
3190 let mut options = self.0.options.clone();
3191 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3192 let query = move |name| {
3193 let stub = stub.clone();
3194 let options = options.clone();
3195 async {
3196 let op = GetOperation::new(stub)
3197 .set_name(name)
3198 .with_options(options)
3199 .send()
3200 .await?;
3201 Ok(Operation::new(op))
3202 }
3203 };
3204
3205 let start = move || async {
3206 let op = self.send().await?;
3207 Ok(Operation::new(op))
3208 };
3209
3210 use google_cloud_lro::internal::PollerExt;
3211 {
3212 google_cloud_lro::internal::new_poller(
3213 polling_error_policy,
3214 polling_backoff_policy,
3215 start,
3216 query,
3217 )
3218 }
3219 .with_options(poller_options)
3220 }
3221
3222 pub fn set_update_mask<T>(mut self, v: T) -> Self
3224 where
3225 T: std::convert::Into<wkt::FieldMask>,
3226 {
3227 self.0.request.update_mask = std::option::Option::Some(v.into());
3228 self
3229 }
3230
3231 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3233 where
3234 T: std::convert::Into<wkt::FieldMask>,
3235 {
3236 self.0.request.update_mask = v.map(|x| x.into());
3237 self
3238 }
3239
3240 pub fn set_deployment_group<T>(mut self, v: T) -> Self
3244 where
3245 T: std::convert::Into<crate::model::DeploymentGroup>,
3246 {
3247 self.0.request.deployment_group = std::option::Option::Some(v.into());
3248 self
3249 }
3250
3251 pub fn set_or_clear_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
3255 where
3256 T: std::convert::Into<crate::model::DeploymentGroup>,
3257 {
3258 self.0.request.deployment_group = v.map(|x| x.into());
3259 self
3260 }
3261
3262 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3264 self.0.request.request_id = v.into();
3265 self
3266 }
3267 }
3268
3269 #[doc(hidden)]
3270 impl crate::RequestBuilder for UpdateDeploymentGroup {
3271 fn request_options(&mut self) -> &mut crate::RequestOptions {
3272 &mut self.0.options
3273 }
3274 }
3275
3276 #[derive(Clone, Debug)]
3294 pub struct DeleteDeploymentGroup(RequestBuilder<crate::model::DeleteDeploymentGroupRequest>);
3295
3296 impl DeleteDeploymentGroup {
3297 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3298 Self(RequestBuilder::new(stub))
3299 }
3300
3301 pub fn with_request<V: Into<crate::model::DeleteDeploymentGroupRequest>>(
3303 mut self,
3304 v: V,
3305 ) -> Self {
3306 self.0.request = v.into();
3307 self
3308 }
3309
3310 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3312 self.0.options = v.into();
3313 self
3314 }
3315
3316 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3323 (*self.0.stub)
3324 .delete_deployment_group(self.0.request, self.0.options)
3325 .await
3326 .map(crate::Response::into_body)
3327 }
3328
3329 pub fn poller(
3331 self,
3332 ) -> impl google_cloud_lro::Poller<crate::model::DeploymentGroup, crate::model::OperationMetadata>
3333 {
3334 type Operation = google_cloud_lro::internal::Operation<
3335 crate::model::DeploymentGroup,
3336 crate::model::OperationMetadata,
3337 >;
3338 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3339 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3340 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3341 if let Some(ref mut details) = poller_options.tracing {
3342 details.method_name =
3343 "google_cloud_config_v1::client::Config::delete_deployment_group::until_done";
3344 }
3345
3346 let stub = self.0.stub.clone();
3347 let mut options = self.0.options.clone();
3348 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3349 let query = move |name| {
3350 let stub = stub.clone();
3351 let options = options.clone();
3352 async {
3353 let op = GetOperation::new(stub)
3354 .set_name(name)
3355 .with_options(options)
3356 .send()
3357 .await?;
3358 Ok(Operation::new(op))
3359 }
3360 };
3361
3362 let start = move || async {
3363 let op = self.send().await?;
3364 Ok(Operation::new(op))
3365 };
3366
3367 use google_cloud_lro::internal::PollerExt;
3368 {
3369 google_cloud_lro::internal::new_poller(
3370 polling_error_policy,
3371 polling_backoff_policy,
3372 start,
3373 query,
3374 )
3375 }
3376 .with_options(poller_options)
3377 }
3378
3379 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3383 self.0.request.name = v.into();
3384 self
3385 }
3386
3387 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3389 self.0.request.request_id = v.into();
3390 self
3391 }
3392
3393 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3395 self.0.request.force = v.into();
3396 self
3397 }
3398
3399 pub fn set_deployment_reference_policy<
3401 T: Into<crate::model::delete_deployment_group_request::DeploymentReferencePolicy>,
3402 >(
3403 mut self,
3404 v: T,
3405 ) -> Self {
3406 self.0.request.deployment_reference_policy = v.into();
3407 self
3408 }
3409 }
3410
3411 #[doc(hidden)]
3412 impl crate::RequestBuilder for DeleteDeploymentGroup {
3413 fn request_options(&mut self) -> &mut crate::RequestOptions {
3414 &mut self.0.options
3415 }
3416 }
3417
3418 #[derive(Clone, Debug)]
3439 pub struct ListDeploymentGroups(RequestBuilder<crate::model::ListDeploymentGroupsRequest>);
3440
3441 impl ListDeploymentGroups {
3442 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3443 Self(RequestBuilder::new(stub))
3444 }
3445
3446 pub fn with_request<V: Into<crate::model::ListDeploymentGroupsRequest>>(
3448 mut self,
3449 v: V,
3450 ) -> Self {
3451 self.0.request = v.into();
3452 self
3453 }
3454
3455 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3457 self.0.options = v.into();
3458 self
3459 }
3460
3461 pub async fn send(self) -> Result<crate::model::ListDeploymentGroupsResponse> {
3463 (*self.0.stub)
3464 .list_deployment_groups(self.0.request, self.0.options)
3465 .await
3466 .map(crate::Response::into_body)
3467 }
3468
3469 pub fn by_page(
3471 self,
3472 ) -> impl google_cloud_gax::paginator::Paginator<
3473 crate::model::ListDeploymentGroupsResponse,
3474 crate::Error,
3475 > {
3476 use std::clone::Clone;
3477 let token = self.0.request.page_token.clone();
3478 let execute = move |token: String| {
3479 let mut builder = self.clone();
3480 builder.0.request = builder.0.request.set_page_token(token);
3481 builder.send()
3482 };
3483 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3484 }
3485
3486 pub fn by_item(
3488 self,
3489 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3490 crate::model::ListDeploymentGroupsResponse,
3491 crate::Error,
3492 > {
3493 use google_cloud_gax::paginator::Paginator;
3494 self.by_page().items()
3495 }
3496
3497 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3501 self.0.request.parent = v.into();
3502 self
3503 }
3504
3505 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3507 self.0.request.page_size = v.into();
3508 self
3509 }
3510
3511 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3513 self.0.request.page_token = v.into();
3514 self
3515 }
3516
3517 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3519 self.0.request.filter = v.into();
3520 self
3521 }
3522
3523 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3525 self.0.request.order_by = v.into();
3526 self
3527 }
3528 }
3529
3530 #[doc(hidden)]
3531 impl crate::RequestBuilder for ListDeploymentGroups {
3532 fn request_options(&mut self) -> &mut crate::RequestOptions {
3533 &mut self.0.options
3534 }
3535 }
3536
3537 #[derive(Clone, Debug)]
3555 pub struct ProvisionDeploymentGroup(
3556 RequestBuilder<crate::model::ProvisionDeploymentGroupRequest>,
3557 );
3558
3559 impl ProvisionDeploymentGroup {
3560 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3561 Self(RequestBuilder::new(stub))
3562 }
3563
3564 pub fn with_request<V: Into<crate::model::ProvisionDeploymentGroupRequest>>(
3566 mut self,
3567 v: V,
3568 ) -> Self {
3569 self.0.request = v.into();
3570 self
3571 }
3572
3573 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3575 self.0.options = v.into();
3576 self
3577 }
3578
3579 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3586 (*self.0.stub)
3587 .provision_deployment_group(self.0.request, self.0.options)
3588 .await
3589 .map(crate::Response::into_body)
3590 }
3591
3592 pub fn poller(
3594 self,
3595 ) -> impl google_cloud_lro::Poller<crate::model::DeploymentGroup, crate::model::OperationMetadata>
3596 {
3597 type Operation = google_cloud_lro::internal::Operation<
3598 crate::model::DeploymentGroup,
3599 crate::model::OperationMetadata,
3600 >;
3601 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3602 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3603 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3604 if let Some(ref mut details) = poller_options.tracing {
3605 details.method_name = "google_cloud_config_v1::client::Config::provision_deployment_group::until_done";
3606 }
3607
3608 let stub = self.0.stub.clone();
3609 let mut options = self.0.options.clone();
3610 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3611 let query = move |name| {
3612 let stub = stub.clone();
3613 let options = options.clone();
3614 async {
3615 let op = GetOperation::new(stub)
3616 .set_name(name)
3617 .with_options(options)
3618 .send()
3619 .await?;
3620 Ok(Operation::new(op))
3621 }
3622 };
3623
3624 let start = move || async {
3625 let op = self.send().await?;
3626 Ok(Operation::new(op))
3627 };
3628
3629 use google_cloud_lro::internal::PollerExt;
3630 {
3631 google_cloud_lro::internal::new_poller(
3632 polling_error_policy,
3633 polling_backoff_policy,
3634 start,
3635 query,
3636 )
3637 }
3638 .with_options(poller_options)
3639 }
3640
3641 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3645 self.0.request.name = v.into();
3646 self
3647 }
3648
3649 pub fn set_deployment_specs<T, K, V>(mut self, v: T) -> Self
3651 where
3652 T: std::iter::IntoIterator<Item = (K, V)>,
3653 K: std::convert::Into<std::string::String>,
3654 V: std::convert::Into<crate::model::DeploymentSpec>,
3655 {
3656 self.0.request.deployment_specs =
3657 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3658 self
3659 }
3660 }
3661
3662 #[doc(hidden)]
3663 impl crate::RequestBuilder for ProvisionDeploymentGroup {
3664 fn request_options(&mut self) -> &mut crate::RequestOptions {
3665 &mut self.0.options
3666 }
3667 }
3668
3669 #[derive(Clone, Debug)]
3687 pub struct DeprovisionDeploymentGroup(
3688 RequestBuilder<crate::model::DeprovisionDeploymentGroupRequest>,
3689 );
3690
3691 impl DeprovisionDeploymentGroup {
3692 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3693 Self(RequestBuilder::new(stub))
3694 }
3695
3696 pub fn with_request<V: Into<crate::model::DeprovisionDeploymentGroupRequest>>(
3698 mut self,
3699 v: V,
3700 ) -> Self {
3701 self.0.request = v.into();
3702 self
3703 }
3704
3705 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3707 self.0.options = v.into();
3708 self
3709 }
3710
3711 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3718 (*self.0.stub)
3719 .deprovision_deployment_group(self.0.request, self.0.options)
3720 .await
3721 .map(crate::Response::into_body)
3722 }
3723
3724 pub fn poller(
3726 self,
3727 ) -> impl google_cloud_lro::Poller<crate::model::DeploymentGroup, crate::model::OperationMetadata>
3728 {
3729 type Operation = google_cloud_lro::internal::Operation<
3730 crate::model::DeploymentGroup,
3731 crate::model::OperationMetadata,
3732 >;
3733 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3734 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3735 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3736 if let Some(ref mut details) = poller_options.tracing {
3737 details.method_name = "google_cloud_config_v1::client::Config::deprovision_deployment_group::until_done";
3738 }
3739
3740 let stub = self.0.stub.clone();
3741 let mut options = self.0.options.clone();
3742 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3743 let query = move |name| {
3744 let stub = stub.clone();
3745 let options = options.clone();
3746 async {
3747 let op = GetOperation::new(stub)
3748 .set_name(name)
3749 .with_options(options)
3750 .send()
3751 .await?;
3752 Ok(Operation::new(op))
3753 }
3754 };
3755
3756 let start = move || async {
3757 let op = self.send().await?;
3758 Ok(Operation::new(op))
3759 };
3760
3761 use google_cloud_lro::internal::PollerExt;
3762 {
3763 google_cloud_lro::internal::new_poller(
3764 polling_error_policy,
3765 polling_backoff_policy,
3766 start,
3767 query,
3768 )
3769 }
3770 .with_options(poller_options)
3771 }
3772
3773 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3777 self.0.request.name = v.into();
3778 self
3779 }
3780
3781 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3783 self.0.request.force = v.into();
3784 self
3785 }
3786
3787 pub fn set_delete_policy<T: Into<crate::model::delete_deployment_request::DeletePolicy>>(
3789 mut self,
3790 v: T,
3791 ) -> Self {
3792 self.0.request.delete_policy = v.into();
3793 self
3794 }
3795 }
3796
3797 #[doc(hidden)]
3798 impl crate::RequestBuilder for DeprovisionDeploymentGroup {
3799 fn request_options(&mut self) -> &mut crate::RequestOptions {
3800 &mut self.0.options
3801 }
3802 }
3803
3804 #[derive(Clone, Debug)]
3821 pub struct GetDeploymentGroupRevision(
3822 RequestBuilder<crate::model::GetDeploymentGroupRevisionRequest>,
3823 );
3824
3825 impl GetDeploymentGroupRevision {
3826 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3827 Self(RequestBuilder::new(stub))
3828 }
3829
3830 pub fn with_request<V: Into<crate::model::GetDeploymentGroupRevisionRequest>>(
3832 mut self,
3833 v: V,
3834 ) -> Self {
3835 self.0.request = v.into();
3836 self
3837 }
3838
3839 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3841 self.0.options = v.into();
3842 self
3843 }
3844
3845 pub async fn send(self) -> Result<crate::model::DeploymentGroupRevision> {
3847 (*self.0.stub)
3848 .get_deployment_group_revision(self.0.request, self.0.options)
3849 .await
3850 .map(crate::Response::into_body)
3851 }
3852
3853 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3857 self.0.request.name = v.into();
3858 self
3859 }
3860 }
3861
3862 #[doc(hidden)]
3863 impl crate::RequestBuilder for GetDeploymentGroupRevision {
3864 fn request_options(&mut self) -> &mut crate::RequestOptions {
3865 &mut self.0.options
3866 }
3867 }
3868
3869 #[derive(Clone, Debug)]
3890 pub struct ListDeploymentGroupRevisions(
3891 RequestBuilder<crate::model::ListDeploymentGroupRevisionsRequest>,
3892 );
3893
3894 impl ListDeploymentGroupRevisions {
3895 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
3896 Self(RequestBuilder::new(stub))
3897 }
3898
3899 pub fn with_request<V: Into<crate::model::ListDeploymentGroupRevisionsRequest>>(
3901 mut self,
3902 v: V,
3903 ) -> Self {
3904 self.0.request = v.into();
3905 self
3906 }
3907
3908 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3910 self.0.options = v.into();
3911 self
3912 }
3913
3914 pub async fn send(self) -> Result<crate::model::ListDeploymentGroupRevisionsResponse> {
3916 (*self.0.stub)
3917 .list_deployment_group_revisions(self.0.request, self.0.options)
3918 .await
3919 .map(crate::Response::into_body)
3920 }
3921
3922 pub fn by_page(
3924 self,
3925 ) -> impl google_cloud_gax::paginator::Paginator<
3926 crate::model::ListDeploymentGroupRevisionsResponse,
3927 crate::Error,
3928 > {
3929 use std::clone::Clone;
3930 let token = self.0.request.page_token.clone();
3931 let execute = move |token: String| {
3932 let mut builder = self.clone();
3933 builder.0.request = builder.0.request.set_page_token(token);
3934 builder.send()
3935 };
3936 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3937 }
3938
3939 pub fn by_item(
3941 self,
3942 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3943 crate::model::ListDeploymentGroupRevisionsResponse,
3944 crate::Error,
3945 > {
3946 use google_cloud_gax::paginator::Paginator;
3947 self.by_page().items()
3948 }
3949
3950 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3954 self.0.request.parent = v.into();
3955 self
3956 }
3957
3958 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3960 self.0.request.page_size = v.into();
3961 self
3962 }
3963
3964 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3966 self.0.request.page_token = v.into();
3967 self
3968 }
3969 }
3970
3971 #[doc(hidden)]
3972 impl crate::RequestBuilder for ListDeploymentGroupRevisions {
3973 fn request_options(&mut self) -> &mut crate::RequestOptions {
3974 &mut self.0.options
3975 }
3976 }
3977
3978 #[derive(Clone, Debug)]
3999 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4000
4001 impl ListLocations {
4002 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4003 Self(RequestBuilder::new(stub))
4004 }
4005
4006 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4008 mut self,
4009 v: V,
4010 ) -> Self {
4011 self.0.request = v.into();
4012 self
4013 }
4014
4015 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4017 self.0.options = v.into();
4018 self
4019 }
4020
4021 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4023 (*self.0.stub)
4024 .list_locations(self.0.request, self.0.options)
4025 .await
4026 .map(crate::Response::into_body)
4027 }
4028
4029 pub fn by_page(
4031 self,
4032 ) -> impl google_cloud_gax::paginator::Paginator<
4033 google_cloud_location::model::ListLocationsResponse,
4034 crate::Error,
4035 > {
4036 use std::clone::Clone;
4037 let token = self.0.request.page_token.clone();
4038 let execute = move |token: String| {
4039 let mut builder = self.clone();
4040 builder.0.request = builder.0.request.set_page_token(token);
4041 builder.send()
4042 };
4043 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4044 }
4045
4046 pub fn by_item(
4048 self,
4049 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4050 google_cloud_location::model::ListLocationsResponse,
4051 crate::Error,
4052 > {
4053 use google_cloud_gax::paginator::Paginator;
4054 self.by_page().items()
4055 }
4056
4057 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4059 self.0.request.name = v.into();
4060 self
4061 }
4062
4063 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4065 self.0.request.filter = v.into();
4066 self
4067 }
4068
4069 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4071 self.0.request.page_size = v.into();
4072 self
4073 }
4074
4075 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4077 self.0.request.page_token = v.into();
4078 self
4079 }
4080 }
4081
4082 #[doc(hidden)]
4083 impl crate::RequestBuilder for ListLocations {
4084 fn request_options(&mut self) -> &mut crate::RequestOptions {
4085 &mut self.0.options
4086 }
4087 }
4088
4089 #[derive(Clone, Debug)]
4106 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4107
4108 impl GetLocation {
4109 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4110 Self(RequestBuilder::new(stub))
4111 }
4112
4113 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4115 mut self,
4116 v: V,
4117 ) -> Self {
4118 self.0.request = v.into();
4119 self
4120 }
4121
4122 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4124 self.0.options = v.into();
4125 self
4126 }
4127
4128 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4130 (*self.0.stub)
4131 .get_location(self.0.request, self.0.options)
4132 .await
4133 .map(crate::Response::into_body)
4134 }
4135
4136 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4138 self.0.request.name = v.into();
4139 self
4140 }
4141 }
4142
4143 #[doc(hidden)]
4144 impl crate::RequestBuilder for GetLocation {
4145 fn request_options(&mut self) -> &mut crate::RequestOptions {
4146 &mut self.0.options
4147 }
4148 }
4149
4150 #[derive(Clone, Debug)]
4167 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4168
4169 impl SetIamPolicy {
4170 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4171 Self(RequestBuilder::new(stub))
4172 }
4173
4174 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4176 mut self,
4177 v: V,
4178 ) -> Self {
4179 self.0.request = v.into();
4180 self
4181 }
4182
4183 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4185 self.0.options = v.into();
4186 self
4187 }
4188
4189 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4191 (*self.0.stub)
4192 .set_iam_policy(self.0.request, self.0.options)
4193 .await
4194 .map(crate::Response::into_body)
4195 }
4196
4197 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4201 self.0.request.resource = v.into();
4202 self
4203 }
4204
4205 pub fn set_policy<T>(mut self, v: T) -> Self
4209 where
4210 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4211 {
4212 self.0.request.policy = std::option::Option::Some(v.into());
4213 self
4214 }
4215
4216 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4220 where
4221 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4222 {
4223 self.0.request.policy = v.map(|x| x.into());
4224 self
4225 }
4226
4227 pub fn set_update_mask<T>(mut self, v: T) -> Self
4229 where
4230 T: std::convert::Into<wkt::FieldMask>,
4231 {
4232 self.0.request.update_mask = std::option::Option::Some(v.into());
4233 self
4234 }
4235
4236 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4238 where
4239 T: std::convert::Into<wkt::FieldMask>,
4240 {
4241 self.0.request.update_mask = v.map(|x| x.into());
4242 self
4243 }
4244 }
4245
4246 #[doc(hidden)]
4247 impl crate::RequestBuilder for SetIamPolicy {
4248 fn request_options(&mut self) -> &mut crate::RequestOptions {
4249 &mut self.0.options
4250 }
4251 }
4252
4253 #[derive(Clone, Debug)]
4270 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4271
4272 impl GetIamPolicy {
4273 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4274 Self(RequestBuilder::new(stub))
4275 }
4276
4277 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4279 mut self,
4280 v: V,
4281 ) -> Self {
4282 self.0.request = v.into();
4283 self
4284 }
4285
4286 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4288 self.0.options = v.into();
4289 self
4290 }
4291
4292 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4294 (*self.0.stub)
4295 .get_iam_policy(self.0.request, self.0.options)
4296 .await
4297 .map(crate::Response::into_body)
4298 }
4299
4300 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4304 self.0.request.resource = v.into();
4305 self
4306 }
4307
4308 pub fn set_options<T>(mut self, v: T) -> Self
4310 where
4311 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4312 {
4313 self.0.request.options = std::option::Option::Some(v.into());
4314 self
4315 }
4316
4317 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4319 where
4320 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4321 {
4322 self.0.request.options = v.map(|x| x.into());
4323 self
4324 }
4325 }
4326
4327 #[doc(hidden)]
4328 impl crate::RequestBuilder for GetIamPolicy {
4329 fn request_options(&mut self) -> &mut crate::RequestOptions {
4330 &mut self.0.options
4331 }
4332 }
4333
4334 #[derive(Clone, Debug)]
4351 pub struct TestIamPermissions(
4352 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4353 );
4354
4355 impl TestIamPermissions {
4356 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4357 Self(RequestBuilder::new(stub))
4358 }
4359
4360 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4362 mut self,
4363 v: V,
4364 ) -> Self {
4365 self.0.request = v.into();
4366 self
4367 }
4368
4369 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4371 self.0.options = v.into();
4372 self
4373 }
4374
4375 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4377 (*self.0.stub)
4378 .test_iam_permissions(self.0.request, self.0.options)
4379 .await
4380 .map(crate::Response::into_body)
4381 }
4382
4383 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4387 self.0.request.resource = v.into();
4388 self
4389 }
4390
4391 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4395 where
4396 T: std::iter::IntoIterator<Item = V>,
4397 V: std::convert::Into<std::string::String>,
4398 {
4399 use std::iter::Iterator;
4400 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4401 self
4402 }
4403 }
4404
4405 #[doc(hidden)]
4406 impl crate::RequestBuilder for TestIamPermissions {
4407 fn request_options(&mut self) -> &mut crate::RequestOptions {
4408 &mut self.0.options
4409 }
4410 }
4411
4412 #[derive(Clone, Debug)]
4433 pub struct ListOperations(
4434 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4435 );
4436
4437 impl ListOperations {
4438 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4439 Self(RequestBuilder::new(stub))
4440 }
4441
4442 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4444 mut self,
4445 v: V,
4446 ) -> Self {
4447 self.0.request = v.into();
4448 self
4449 }
4450
4451 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4453 self.0.options = v.into();
4454 self
4455 }
4456
4457 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4459 (*self.0.stub)
4460 .list_operations(self.0.request, self.0.options)
4461 .await
4462 .map(crate::Response::into_body)
4463 }
4464
4465 pub fn by_page(
4467 self,
4468 ) -> impl google_cloud_gax::paginator::Paginator<
4469 google_cloud_longrunning::model::ListOperationsResponse,
4470 crate::Error,
4471 > {
4472 use std::clone::Clone;
4473 let token = self.0.request.page_token.clone();
4474 let execute = move |token: String| {
4475 let mut builder = self.clone();
4476 builder.0.request = builder.0.request.set_page_token(token);
4477 builder.send()
4478 };
4479 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4480 }
4481
4482 pub fn by_item(
4484 self,
4485 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4486 google_cloud_longrunning::model::ListOperationsResponse,
4487 crate::Error,
4488 > {
4489 use google_cloud_gax::paginator::Paginator;
4490 self.by_page().items()
4491 }
4492
4493 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4495 self.0.request.name = v.into();
4496 self
4497 }
4498
4499 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4501 self.0.request.filter = v.into();
4502 self
4503 }
4504
4505 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4507 self.0.request.page_size = v.into();
4508 self
4509 }
4510
4511 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4513 self.0.request.page_token = v.into();
4514 self
4515 }
4516
4517 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4519 self.0.request.return_partial_success = v.into();
4520 self
4521 }
4522 }
4523
4524 #[doc(hidden)]
4525 impl crate::RequestBuilder for ListOperations {
4526 fn request_options(&mut self) -> &mut crate::RequestOptions {
4527 &mut self.0.options
4528 }
4529 }
4530
4531 #[derive(Clone, Debug)]
4548 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4549
4550 impl GetOperation {
4551 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4552 Self(RequestBuilder::new(stub))
4553 }
4554
4555 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4557 mut self,
4558 v: V,
4559 ) -> Self {
4560 self.0.request = v.into();
4561 self
4562 }
4563
4564 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4566 self.0.options = v.into();
4567 self
4568 }
4569
4570 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4572 (*self.0.stub)
4573 .get_operation(self.0.request, self.0.options)
4574 .await
4575 .map(crate::Response::into_body)
4576 }
4577
4578 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4580 self.0.request.name = v.into();
4581 self
4582 }
4583 }
4584
4585 #[doc(hidden)]
4586 impl crate::RequestBuilder for GetOperation {
4587 fn request_options(&mut self) -> &mut crate::RequestOptions {
4588 &mut self.0.options
4589 }
4590 }
4591
4592 #[derive(Clone, Debug)]
4609 pub struct DeleteOperation(
4610 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4611 );
4612
4613 impl DeleteOperation {
4614 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4615 Self(RequestBuilder::new(stub))
4616 }
4617
4618 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4620 mut self,
4621 v: V,
4622 ) -> Self {
4623 self.0.request = v.into();
4624 self
4625 }
4626
4627 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4629 self.0.options = v.into();
4630 self
4631 }
4632
4633 pub async fn send(self) -> Result<()> {
4635 (*self.0.stub)
4636 .delete_operation(self.0.request, self.0.options)
4637 .await
4638 .map(crate::Response::into_body)
4639 }
4640
4641 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4643 self.0.request.name = v.into();
4644 self
4645 }
4646 }
4647
4648 #[doc(hidden)]
4649 impl crate::RequestBuilder for DeleteOperation {
4650 fn request_options(&mut self) -> &mut crate::RequestOptions {
4651 &mut self.0.options
4652 }
4653 }
4654
4655 #[derive(Clone, Debug)]
4672 pub struct CancelOperation(
4673 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4674 );
4675
4676 impl CancelOperation {
4677 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Config>) -> Self {
4678 Self(RequestBuilder::new(stub))
4679 }
4680
4681 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4683 mut self,
4684 v: V,
4685 ) -> Self {
4686 self.0.request = v.into();
4687 self
4688 }
4689
4690 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4692 self.0.options = v.into();
4693 self
4694 }
4695
4696 pub async fn send(self) -> Result<()> {
4698 (*self.0.stub)
4699 .cancel_operation(self.0.request, self.0.options)
4700 .await
4701 .map(crate::Response::into_body)
4702 }
4703
4704 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4706 self.0.request.name = v.into();
4707 self
4708 }
4709 }
4710
4711 #[doc(hidden)]
4712 impl crate::RequestBuilder for CancelOperation {
4713 fn request_options(&mut self) -> &mut crate::RequestOptions {
4714 &mut self.0.options
4715 }
4716 }
4717}