1pub mod cloud_deploy {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::CloudDeploy;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = CloudDeploy;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
94 pub struct ListDeliveryPipelines(RequestBuilder<crate::model::ListDeliveryPipelinesRequest>);
95
96 impl ListDeliveryPipelines {
97 pub(crate) fn new(
98 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
99 ) -> Self {
100 Self(RequestBuilder::new(stub))
101 }
102
103 pub fn with_request<V: Into<crate::model::ListDeliveryPipelinesRequest>>(
105 mut self,
106 v: V,
107 ) -> Self {
108 self.0.request = v.into();
109 self
110 }
111
112 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
114 self.0.options = v.into();
115 self
116 }
117
118 pub async fn send(self) -> Result<crate::model::ListDeliveryPipelinesResponse> {
120 (*self.0.stub)
121 .list_delivery_pipelines(self.0.request, self.0.options)
122 .await
123 .map(crate::Response::into_body)
124 }
125
126 pub fn by_page(
128 self,
129 ) -> impl google_cloud_gax::paginator::Paginator<
130 crate::model::ListDeliveryPipelinesResponse,
131 crate::Error,
132 > {
133 use std::clone::Clone;
134 let token = self.0.request.page_token.clone();
135 let execute = move |token: String| {
136 let mut builder = self.clone();
137 builder.0.request = builder.0.request.set_page_token(token);
138 builder.send()
139 };
140 google_cloud_gax::paginator::internal::new_paginator(token, execute)
141 }
142
143 pub fn by_item(
145 self,
146 ) -> impl google_cloud_gax::paginator::ItemPaginator<
147 crate::model::ListDeliveryPipelinesResponse,
148 crate::Error,
149 > {
150 use google_cloud_gax::paginator::Paginator;
151 self.by_page().items()
152 }
153
154 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
158 self.0.request.parent = v.into();
159 self
160 }
161
162 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
164 self.0.request.page_size = v.into();
165 self
166 }
167
168 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.page_token = v.into();
171 self
172 }
173
174 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
176 self.0.request.filter = v.into();
177 self
178 }
179
180 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
182 self.0.request.order_by = v.into();
183 self
184 }
185 }
186
187 #[doc(hidden)]
188 impl crate::RequestBuilder for ListDeliveryPipelines {
189 fn request_options(&mut self) -> &mut crate::RequestOptions {
190 &mut self.0.options
191 }
192 }
193
194 #[derive(Clone, Debug)]
211 pub struct GetDeliveryPipeline(RequestBuilder<crate::model::GetDeliveryPipelineRequest>);
212
213 impl GetDeliveryPipeline {
214 pub(crate) fn new(
215 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
216 ) -> Self {
217 Self(RequestBuilder::new(stub))
218 }
219
220 pub fn with_request<V: Into<crate::model::GetDeliveryPipelineRequest>>(
222 mut self,
223 v: V,
224 ) -> Self {
225 self.0.request = v.into();
226 self
227 }
228
229 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
231 self.0.options = v.into();
232 self
233 }
234
235 pub async fn send(self) -> Result<crate::model::DeliveryPipeline> {
237 (*self.0.stub)
238 .get_delivery_pipeline(self.0.request, self.0.options)
239 .await
240 .map(crate::Response::into_body)
241 }
242
243 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
247 self.0.request.name = v.into();
248 self
249 }
250 }
251
252 #[doc(hidden)]
253 impl crate::RequestBuilder for GetDeliveryPipeline {
254 fn request_options(&mut self) -> &mut crate::RequestOptions {
255 &mut self.0.options
256 }
257 }
258
259 #[derive(Clone, Debug)]
277 pub struct CreateDeliveryPipeline(RequestBuilder<crate::model::CreateDeliveryPipelineRequest>);
278
279 impl CreateDeliveryPipeline {
280 pub(crate) fn new(
281 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
282 ) -> Self {
283 Self(RequestBuilder::new(stub))
284 }
285
286 pub fn with_request<V: Into<crate::model::CreateDeliveryPipelineRequest>>(
288 mut self,
289 v: V,
290 ) -> Self {
291 self.0.request = v.into();
292 self
293 }
294
295 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
297 self.0.options = v.into();
298 self
299 }
300
301 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
308 (*self.0.stub)
309 .create_delivery_pipeline(self.0.request, self.0.options)
310 .await
311 .map(crate::Response::into_body)
312 }
313
314 pub fn poller(
316 self,
317 ) -> impl google_cloud_lro::Poller<crate::model::DeliveryPipeline, crate::model::OperationMetadata>
318 {
319 type Operation = google_cloud_lro::internal::Operation<
320 crate::model::DeliveryPipeline,
321 crate::model::OperationMetadata,
322 >;
323 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
324 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
325
326 let stub = self.0.stub.clone();
327 let mut options = self.0.options.clone();
328 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
329 let query = move |name| {
330 let stub = stub.clone();
331 let options = options.clone();
332 async {
333 let op = GetOperation::new(stub)
334 .set_name(name)
335 .with_options(options)
336 .send()
337 .await?;
338 Ok(Operation::new(op))
339 }
340 };
341
342 let start = move || async {
343 let op = self.send().await?;
344 Ok(Operation::new(op))
345 };
346
347 google_cloud_lro::internal::new_poller(
348 polling_error_policy,
349 polling_backoff_policy,
350 start,
351 query,
352 )
353 }
354
355 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
359 self.0.request.parent = v.into();
360 self
361 }
362
363 pub fn set_delivery_pipeline_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
367 self.0.request.delivery_pipeline_id = v.into();
368 self
369 }
370
371 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
375 where
376 T: std::convert::Into<crate::model::DeliveryPipeline>,
377 {
378 self.0.request.delivery_pipeline = std::option::Option::Some(v.into());
379 self
380 }
381
382 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
386 where
387 T: std::convert::Into<crate::model::DeliveryPipeline>,
388 {
389 self.0.request.delivery_pipeline = v.map(|x| x.into());
390 self
391 }
392
393 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
395 self.0.request.request_id = v.into();
396 self
397 }
398
399 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
401 self.0.request.validate_only = v.into();
402 self
403 }
404 }
405
406 #[doc(hidden)]
407 impl crate::RequestBuilder for CreateDeliveryPipeline {
408 fn request_options(&mut self) -> &mut crate::RequestOptions {
409 &mut self.0.options
410 }
411 }
412
413 #[derive(Clone, Debug)]
431 pub struct UpdateDeliveryPipeline(RequestBuilder<crate::model::UpdateDeliveryPipelineRequest>);
432
433 impl UpdateDeliveryPipeline {
434 pub(crate) fn new(
435 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
436 ) -> Self {
437 Self(RequestBuilder::new(stub))
438 }
439
440 pub fn with_request<V: Into<crate::model::UpdateDeliveryPipelineRequest>>(
442 mut self,
443 v: V,
444 ) -> Self {
445 self.0.request = v.into();
446 self
447 }
448
449 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
451 self.0.options = v.into();
452 self
453 }
454
455 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
462 (*self.0.stub)
463 .update_delivery_pipeline(self.0.request, self.0.options)
464 .await
465 .map(crate::Response::into_body)
466 }
467
468 pub fn poller(
470 self,
471 ) -> impl google_cloud_lro::Poller<crate::model::DeliveryPipeline, crate::model::OperationMetadata>
472 {
473 type Operation = google_cloud_lro::internal::Operation<
474 crate::model::DeliveryPipeline,
475 crate::model::OperationMetadata,
476 >;
477 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
478 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
479
480 let stub = self.0.stub.clone();
481 let mut options = self.0.options.clone();
482 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
483 let query = move |name| {
484 let stub = stub.clone();
485 let options = options.clone();
486 async {
487 let op = GetOperation::new(stub)
488 .set_name(name)
489 .with_options(options)
490 .send()
491 .await?;
492 Ok(Operation::new(op))
493 }
494 };
495
496 let start = move || async {
497 let op = self.send().await?;
498 Ok(Operation::new(op))
499 };
500
501 google_cloud_lro::internal::new_poller(
502 polling_error_policy,
503 polling_backoff_policy,
504 start,
505 query,
506 )
507 }
508
509 pub fn set_update_mask<T>(mut self, v: T) -> Self
513 where
514 T: std::convert::Into<wkt::FieldMask>,
515 {
516 self.0.request.update_mask = std::option::Option::Some(v.into());
517 self
518 }
519
520 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
524 where
525 T: std::convert::Into<wkt::FieldMask>,
526 {
527 self.0.request.update_mask = v.map(|x| x.into());
528 self
529 }
530
531 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
535 where
536 T: std::convert::Into<crate::model::DeliveryPipeline>,
537 {
538 self.0.request.delivery_pipeline = std::option::Option::Some(v.into());
539 self
540 }
541
542 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
546 where
547 T: std::convert::Into<crate::model::DeliveryPipeline>,
548 {
549 self.0.request.delivery_pipeline = v.map(|x| x.into());
550 self
551 }
552
553 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
555 self.0.request.request_id = v.into();
556 self
557 }
558
559 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
561 self.0.request.allow_missing = v.into();
562 self
563 }
564
565 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
567 self.0.request.validate_only = v.into();
568 self
569 }
570 }
571
572 #[doc(hidden)]
573 impl crate::RequestBuilder for UpdateDeliveryPipeline {
574 fn request_options(&mut self) -> &mut crate::RequestOptions {
575 &mut self.0.options
576 }
577 }
578
579 #[derive(Clone, Debug)]
597 pub struct DeleteDeliveryPipeline(RequestBuilder<crate::model::DeleteDeliveryPipelineRequest>);
598
599 impl DeleteDeliveryPipeline {
600 pub(crate) fn new(
601 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
602 ) -> Self {
603 Self(RequestBuilder::new(stub))
604 }
605
606 pub fn with_request<V: Into<crate::model::DeleteDeliveryPipelineRequest>>(
608 mut self,
609 v: V,
610 ) -> Self {
611 self.0.request = v.into();
612 self
613 }
614
615 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
617 self.0.options = v.into();
618 self
619 }
620
621 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
628 (*self.0.stub)
629 .delete_delivery_pipeline(self.0.request, self.0.options)
630 .await
631 .map(crate::Response::into_body)
632 }
633
634 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
636 type Operation =
637 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
638 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
639 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
640
641 let stub = self.0.stub.clone();
642 let mut options = self.0.options.clone();
643 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
644 let query = move |name| {
645 let stub = stub.clone();
646 let options = options.clone();
647 async {
648 let op = GetOperation::new(stub)
649 .set_name(name)
650 .with_options(options)
651 .send()
652 .await?;
653 Ok(Operation::new(op))
654 }
655 };
656
657 let start = move || async {
658 let op = self.send().await?;
659 Ok(Operation::new(op))
660 };
661
662 google_cloud_lro::internal::new_unit_response_poller(
663 polling_error_policy,
664 polling_backoff_policy,
665 start,
666 query,
667 )
668 }
669
670 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
674 self.0.request.name = v.into();
675 self
676 }
677
678 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
680 self.0.request.request_id = v.into();
681 self
682 }
683
684 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
686 self.0.request.allow_missing = v.into();
687 self
688 }
689
690 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
692 self.0.request.validate_only = v.into();
693 self
694 }
695
696 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
698 self.0.request.force = v.into();
699 self
700 }
701
702 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
704 self.0.request.etag = v.into();
705 self
706 }
707 }
708
709 #[doc(hidden)]
710 impl crate::RequestBuilder for DeleteDeliveryPipeline {
711 fn request_options(&mut self) -> &mut crate::RequestOptions {
712 &mut self.0.options
713 }
714 }
715
716 #[derive(Clone, Debug)]
737 pub struct ListTargets(RequestBuilder<crate::model::ListTargetsRequest>);
738
739 impl ListTargets {
740 pub(crate) fn new(
741 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
742 ) -> Self {
743 Self(RequestBuilder::new(stub))
744 }
745
746 pub fn with_request<V: Into<crate::model::ListTargetsRequest>>(mut self, v: V) -> Self {
748 self.0.request = v.into();
749 self
750 }
751
752 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
754 self.0.options = v.into();
755 self
756 }
757
758 pub async fn send(self) -> Result<crate::model::ListTargetsResponse> {
760 (*self.0.stub)
761 .list_targets(self.0.request, self.0.options)
762 .await
763 .map(crate::Response::into_body)
764 }
765
766 pub fn by_page(
768 self,
769 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTargetsResponse, crate::Error>
770 {
771 use std::clone::Clone;
772 let token = self.0.request.page_token.clone();
773 let execute = move |token: String| {
774 let mut builder = self.clone();
775 builder.0.request = builder.0.request.set_page_token(token);
776 builder.send()
777 };
778 google_cloud_gax::paginator::internal::new_paginator(token, execute)
779 }
780
781 pub fn by_item(
783 self,
784 ) -> impl google_cloud_gax::paginator::ItemPaginator<
785 crate::model::ListTargetsResponse,
786 crate::Error,
787 > {
788 use google_cloud_gax::paginator::Paginator;
789 self.by_page().items()
790 }
791
792 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
796 self.0.request.parent = v.into();
797 self
798 }
799
800 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
802 self.0.request.page_size = v.into();
803 self
804 }
805
806 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
808 self.0.request.page_token = v.into();
809 self
810 }
811
812 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
814 self.0.request.filter = v.into();
815 self
816 }
817
818 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
820 self.0.request.order_by = v.into();
821 self
822 }
823 }
824
825 #[doc(hidden)]
826 impl crate::RequestBuilder for ListTargets {
827 fn request_options(&mut self) -> &mut crate::RequestOptions {
828 &mut self.0.options
829 }
830 }
831
832 #[derive(Clone, Debug)]
849 pub struct RollbackTarget(RequestBuilder<crate::model::RollbackTargetRequest>);
850
851 impl RollbackTarget {
852 pub(crate) fn new(
853 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
854 ) -> Self {
855 Self(RequestBuilder::new(stub))
856 }
857
858 pub fn with_request<V: Into<crate::model::RollbackTargetRequest>>(mut self, v: V) -> Self {
860 self.0.request = v.into();
861 self
862 }
863
864 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
866 self.0.options = v.into();
867 self
868 }
869
870 pub async fn send(self) -> Result<crate::model::RollbackTargetResponse> {
872 (*self.0.stub)
873 .rollback_target(self.0.request, self.0.options)
874 .await
875 .map(crate::Response::into_body)
876 }
877
878 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
882 self.0.request.name = v.into();
883 self
884 }
885
886 pub fn set_target_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
890 self.0.request.target_id = v.into();
891 self
892 }
893
894 pub fn set_rollout_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
898 self.0.request.rollout_id = v.into();
899 self
900 }
901
902 pub fn set_release_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
904 self.0.request.release_id = v.into();
905 self
906 }
907
908 pub fn set_rollout_to_roll_back<T: Into<std::string::String>>(mut self, v: T) -> Self {
910 self.0.request.rollout_to_roll_back = v.into();
911 self
912 }
913
914 pub fn set_rollback_config<T>(mut self, v: T) -> Self
916 where
917 T: std::convert::Into<crate::model::RollbackTargetConfig>,
918 {
919 self.0.request.rollback_config = std::option::Option::Some(v.into());
920 self
921 }
922
923 pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
925 where
926 T: std::convert::Into<crate::model::RollbackTargetConfig>,
927 {
928 self.0.request.rollback_config = v.map(|x| x.into());
929 self
930 }
931
932 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
934 self.0.request.validate_only = v.into();
935 self
936 }
937
938 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
940 where
941 T: std::iter::IntoIterator<Item = V>,
942 V: std::convert::Into<std::string::String>,
943 {
944 use std::iter::Iterator;
945 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
946 self
947 }
948 }
949
950 #[doc(hidden)]
951 impl crate::RequestBuilder for RollbackTarget {
952 fn request_options(&mut self) -> &mut crate::RequestOptions {
953 &mut self.0.options
954 }
955 }
956
957 #[derive(Clone, Debug)]
974 pub struct GetTarget(RequestBuilder<crate::model::GetTargetRequest>);
975
976 impl GetTarget {
977 pub(crate) fn new(
978 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
979 ) -> Self {
980 Self(RequestBuilder::new(stub))
981 }
982
983 pub fn with_request<V: Into<crate::model::GetTargetRequest>>(mut self, v: V) -> Self {
985 self.0.request = v.into();
986 self
987 }
988
989 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
991 self.0.options = v.into();
992 self
993 }
994
995 pub async fn send(self) -> Result<crate::model::Target> {
997 (*self.0.stub)
998 .get_target(self.0.request, self.0.options)
999 .await
1000 .map(crate::Response::into_body)
1001 }
1002
1003 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1007 self.0.request.name = v.into();
1008 self
1009 }
1010 }
1011
1012 #[doc(hidden)]
1013 impl crate::RequestBuilder for GetTarget {
1014 fn request_options(&mut self) -> &mut crate::RequestOptions {
1015 &mut self.0.options
1016 }
1017 }
1018
1019 #[derive(Clone, Debug)]
1037 pub struct CreateTarget(RequestBuilder<crate::model::CreateTargetRequest>);
1038
1039 impl CreateTarget {
1040 pub(crate) fn new(
1041 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1042 ) -> Self {
1043 Self(RequestBuilder::new(stub))
1044 }
1045
1046 pub fn with_request<V: Into<crate::model::CreateTargetRequest>>(mut self, v: V) -> Self {
1048 self.0.request = v.into();
1049 self
1050 }
1051
1052 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1054 self.0.options = v.into();
1055 self
1056 }
1057
1058 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1065 (*self.0.stub)
1066 .create_target(self.0.request, self.0.options)
1067 .await
1068 .map(crate::Response::into_body)
1069 }
1070
1071 pub fn poller(
1073 self,
1074 ) -> impl google_cloud_lro::Poller<crate::model::Target, crate::model::OperationMetadata>
1075 {
1076 type Operation = google_cloud_lro::internal::Operation<
1077 crate::model::Target,
1078 crate::model::OperationMetadata,
1079 >;
1080 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1081 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1082
1083 let stub = self.0.stub.clone();
1084 let mut options = self.0.options.clone();
1085 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1086 let query = move |name| {
1087 let stub = stub.clone();
1088 let options = options.clone();
1089 async {
1090 let op = GetOperation::new(stub)
1091 .set_name(name)
1092 .with_options(options)
1093 .send()
1094 .await?;
1095 Ok(Operation::new(op))
1096 }
1097 };
1098
1099 let start = move || async {
1100 let op = self.send().await?;
1101 Ok(Operation::new(op))
1102 };
1103
1104 google_cloud_lro::internal::new_poller(
1105 polling_error_policy,
1106 polling_backoff_policy,
1107 start,
1108 query,
1109 )
1110 }
1111
1112 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1116 self.0.request.parent = v.into();
1117 self
1118 }
1119
1120 pub fn set_target_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1124 self.0.request.target_id = v.into();
1125 self
1126 }
1127
1128 pub fn set_target<T>(mut self, v: T) -> Self
1132 where
1133 T: std::convert::Into<crate::model::Target>,
1134 {
1135 self.0.request.target = std::option::Option::Some(v.into());
1136 self
1137 }
1138
1139 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
1143 where
1144 T: std::convert::Into<crate::model::Target>,
1145 {
1146 self.0.request.target = v.map(|x| x.into());
1147 self
1148 }
1149
1150 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1152 self.0.request.request_id = v.into();
1153 self
1154 }
1155
1156 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1158 self.0.request.validate_only = v.into();
1159 self
1160 }
1161 }
1162
1163 #[doc(hidden)]
1164 impl crate::RequestBuilder for CreateTarget {
1165 fn request_options(&mut self) -> &mut crate::RequestOptions {
1166 &mut self.0.options
1167 }
1168 }
1169
1170 #[derive(Clone, Debug)]
1188 pub struct UpdateTarget(RequestBuilder<crate::model::UpdateTargetRequest>);
1189
1190 impl UpdateTarget {
1191 pub(crate) fn new(
1192 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1193 ) -> Self {
1194 Self(RequestBuilder::new(stub))
1195 }
1196
1197 pub fn with_request<V: Into<crate::model::UpdateTargetRequest>>(mut self, v: V) -> Self {
1199 self.0.request = v.into();
1200 self
1201 }
1202
1203 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1205 self.0.options = v.into();
1206 self
1207 }
1208
1209 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1216 (*self.0.stub)
1217 .update_target(self.0.request, self.0.options)
1218 .await
1219 .map(crate::Response::into_body)
1220 }
1221
1222 pub fn poller(
1224 self,
1225 ) -> impl google_cloud_lro::Poller<crate::model::Target, crate::model::OperationMetadata>
1226 {
1227 type Operation = google_cloud_lro::internal::Operation<
1228 crate::model::Target,
1229 crate::model::OperationMetadata,
1230 >;
1231 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1232 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1233
1234 let stub = self.0.stub.clone();
1235 let mut options = self.0.options.clone();
1236 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1237 let query = move |name| {
1238 let stub = stub.clone();
1239 let options = options.clone();
1240 async {
1241 let op = GetOperation::new(stub)
1242 .set_name(name)
1243 .with_options(options)
1244 .send()
1245 .await?;
1246 Ok(Operation::new(op))
1247 }
1248 };
1249
1250 let start = move || async {
1251 let op = self.send().await?;
1252 Ok(Operation::new(op))
1253 };
1254
1255 google_cloud_lro::internal::new_poller(
1256 polling_error_policy,
1257 polling_backoff_policy,
1258 start,
1259 query,
1260 )
1261 }
1262
1263 pub fn set_update_mask<T>(mut self, v: T) -> Self
1267 where
1268 T: std::convert::Into<wkt::FieldMask>,
1269 {
1270 self.0.request.update_mask = std::option::Option::Some(v.into());
1271 self
1272 }
1273
1274 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1278 where
1279 T: std::convert::Into<wkt::FieldMask>,
1280 {
1281 self.0.request.update_mask = v.map(|x| x.into());
1282 self
1283 }
1284
1285 pub fn set_target<T>(mut self, v: T) -> Self
1289 where
1290 T: std::convert::Into<crate::model::Target>,
1291 {
1292 self.0.request.target = std::option::Option::Some(v.into());
1293 self
1294 }
1295
1296 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
1300 where
1301 T: std::convert::Into<crate::model::Target>,
1302 {
1303 self.0.request.target = v.map(|x| x.into());
1304 self
1305 }
1306
1307 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1309 self.0.request.request_id = v.into();
1310 self
1311 }
1312
1313 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1315 self.0.request.allow_missing = v.into();
1316 self
1317 }
1318
1319 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1321 self.0.request.validate_only = v.into();
1322 self
1323 }
1324 }
1325
1326 #[doc(hidden)]
1327 impl crate::RequestBuilder for UpdateTarget {
1328 fn request_options(&mut self) -> &mut crate::RequestOptions {
1329 &mut self.0.options
1330 }
1331 }
1332
1333 #[derive(Clone, Debug)]
1351 pub struct DeleteTarget(RequestBuilder<crate::model::DeleteTargetRequest>);
1352
1353 impl DeleteTarget {
1354 pub(crate) fn new(
1355 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1356 ) -> Self {
1357 Self(RequestBuilder::new(stub))
1358 }
1359
1360 pub fn with_request<V: Into<crate::model::DeleteTargetRequest>>(mut self, v: V) -> Self {
1362 self.0.request = v.into();
1363 self
1364 }
1365
1366 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1368 self.0.options = v.into();
1369 self
1370 }
1371
1372 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1379 (*self.0.stub)
1380 .delete_target(self.0.request, self.0.options)
1381 .await
1382 .map(crate::Response::into_body)
1383 }
1384
1385 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1387 type Operation =
1388 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1389 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1390 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1391
1392 let stub = self.0.stub.clone();
1393 let mut options = self.0.options.clone();
1394 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1395 let query = move |name| {
1396 let stub = stub.clone();
1397 let options = options.clone();
1398 async {
1399 let op = GetOperation::new(stub)
1400 .set_name(name)
1401 .with_options(options)
1402 .send()
1403 .await?;
1404 Ok(Operation::new(op))
1405 }
1406 };
1407
1408 let start = move || async {
1409 let op = self.send().await?;
1410 Ok(Operation::new(op))
1411 };
1412
1413 google_cloud_lro::internal::new_unit_response_poller(
1414 polling_error_policy,
1415 polling_backoff_policy,
1416 start,
1417 query,
1418 )
1419 }
1420
1421 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1425 self.0.request.name = v.into();
1426 self
1427 }
1428
1429 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1431 self.0.request.request_id = v.into();
1432 self
1433 }
1434
1435 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1437 self.0.request.allow_missing = v.into();
1438 self
1439 }
1440
1441 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1443 self.0.request.validate_only = v.into();
1444 self
1445 }
1446
1447 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1449 self.0.request.etag = v.into();
1450 self
1451 }
1452 }
1453
1454 #[doc(hidden)]
1455 impl crate::RequestBuilder for DeleteTarget {
1456 fn request_options(&mut self) -> &mut crate::RequestOptions {
1457 &mut self.0.options
1458 }
1459 }
1460
1461 #[derive(Clone, Debug)]
1482 pub struct ListCustomTargetTypes(RequestBuilder<crate::model::ListCustomTargetTypesRequest>);
1483
1484 impl ListCustomTargetTypes {
1485 pub(crate) fn new(
1486 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1487 ) -> Self {
1488 Self(RequestBuilder::new(stub))
1489 }
1490
1491 pub fn with_request<V: Into<crate::model::ListCustomTargetTypesRequest>>(
1493 mut self,
1494 v: V,
1495 ) -> Self {
1496 self.0.request = v.into();
1497 self
1498 }
1499
1500 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1502 self.0.options = v.into();
1503 self
1504 }
1505
1506 pub async fn send(self) -> Result<crate::model::ListCustomTargetTypesResponse> {
1508 (*self.0.stub)
1509 .list_custom_target_types(self.0.request, self.0.options)
1510 .await
1511 .map(crate::Response::into_body)
1512 }
1513
1514 pub fn by_page(
1516 self,
1517 ) -> impl google_cloud_gax::paginator::Paginator<
1518 crate::model::ListCustomTargetTypesResponse,
1519 crate::Error,
1520 > {
1521 use std::clone::Clone;
1522 let token = self.0.request.page_token.clone();
1523 let execute = move |token: String| {
1524 let mut builder = self.clone();
1525 builder.0.request = builder.0.request.set_page_token(token);
1526 builder.send()
1527 };
1528 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1529 }
1530
1531 pub fn by_item(
1533 self,
1534 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1535 crate::model::ListCustomTargetTypesResponse,
1536 crate::Error,
1537 > {
1538 use google_cloud_gax::paginator::Paginator;
1539 self.by_page().items()
1540 }
1541
1542 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1546 self.0.request.parent = v.into();
1547 self
1548 }
1549
1550 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1552 self.0.request.page_size = v.into();
1553 self
1554 }
1555
1556 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1558 self.0.request.page_token = v.into();
1559 self
1560 }
1561
1562 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1564 self.0.request.filter = v.into();
1565 self
1566 }
1567
1568 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1570 self.0.request.order_by = v.into();
1571 self
1572 }
1573 }
1574
1575 #[doc(hidden)]
1576 impl crate::RequestBuilder for ListCustomTargetTypes {
1577 fn request_options(&mut self) -> &mut crate::RequestOptions {
1578 &mut self.0.options
1579 }
1580 }
1581
1582 #[derive(Clone, Debug)]
1599 pub struct GetCustomTargetType(RequestBuilder<crate::model::GetCustomTargetTypeRequest>);
1600
1601 impl GetCustomTargetType {
1602 pub(crate) fn new(
1603 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1604 ) -> Self {
1605 Self(RequestBuilder::new(stub))
1606 }
1607
1608 pub fn with_request<V: Into<crate::model::GetCustomTargetTypeRequest>>(
1610 mut self,
1611 v: V,
1612 ) -> Self {
1613 self.0.request = v.into();
1614 self
1615 }
1616
1617 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1619 self.0.options = v.into();
1620 self
1621 }
1622
1623 pub async fn send(self) -> Result<crate::model::CustomTargetType> {
1625 (*self.0.stub)
1626 .get_custom_target_type(self.0.request, self.0.options)
1627 .await
1628 .map(crate::Response::into_body)
1629 }
1630
1631 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1635 self.0.request.name = v.into();
1636 self
1637 }
1638 }
1639
1640 #[doc(hidden)]
1641 impl crate::RequestBuilder for GetCustomTargetType {
1642 fn request_options(&mut self) -> &mut crate::RequestOptions {
1643 &mut self.0.options
1644 }
1645 }
1646
1647 #[derive(Clone, Debug)]
1665 pub struct CreateCustomTargetType(RequestBuilder<crate::model::CreateCustomTargetTypeRequest>);
1666
1667 impl CreateCustomTargetType {
1668 pub(crate) fn new(
1669 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1670 ) -> Self {
1671 Self(RequestBuilder::new(stub))
1672 }
1673
1674 pub fn with_request<V: Into<crate::model::CreateCustomTargetTypeRequest>>(
1676 mut self,
1677 v: V,
1678 ) -> Self {
1679 self.0.request = v.into();
1680 self
1681 }
1682
1683 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1685 self.0.options = v.into();
1686 self
1687 }
1688
1689 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1696 (*self.0.stub)
1697 .create_custom_target_type(self.0.request, self.0.options)
1698 .await
1699 .map(crate::Response::into_body)
1700 }
1701
1702 pub fn poller(
1704 self,
1705 ) -> impl google_cloud_lro::Poller<crate::model::CustomTargetType, crate::model::OperationMetadata>
1706 {
1707 type Operation = google_cloud_lro::internal::Operation<
1708 crate::model::CustomTargetType,
1709 crate::model::OperationMetadata,
1710 >;
1711 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1712 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1713
1714 let stub = self.0.stub.clone();
1715 let mut options = self.0.options.clone();
1716 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1717 let query = move |name| {
1718 let stub = stub.clone();
1719 let options = options.clone();
1720 async {
1721 let op = GetOperation::new(stub)
1722 .set_name(name)
1723 .with_options(options)
1724 .send()
1725 .await?;
1726 Ok(Operation::new(op))
1727 }
1728 };
1729
1730 let start = move || async {
1731 let op = self.send().await?;
1732 Ok(Operation::new(op))
1733 };
1734
1735 google_cloud_lro::internal::new_poller(
1736 polling_error_policy,
1737 polling_backoff_policy,
1738 start,
1739 query,
1740 )
1741 }
1742
1743 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1747 self.0.request.parent = v.into();
1748 self
1749 }
1750
1751 pub fn set_custom_target_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1755 self.0.request.custom_target_type_id = v.into();
1756 self
1757 }
1758
1759 pub fn set_custom_target_type<T>(mut self, v: T) -> Self
1763 where
1764 T: std::convert::Into<crate::model::CustomTargetType>,
1765 {
1766 self.0.request.custom_target_type = std::option::Option::Some(v.into());
1767 self
1768 }
1769
1770 pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
1774 where
1775 T: std::convert::Into<crate::model::CustomTargetType>,
1776 {
1777 self.0.request.custom_target_type = v.map(|x| x.into());
1778 self
1779 }
1780
1781 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1783 self.0.request.request_id = v.into();
1784 self
1785 }
1786
1787 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1789 self.0.request.validate_only = v.into();
1790 self
1791 }
1792 }
1793
1794 #[doc(hidden)]
1795 impl crate::RequestBuilder for CreateCustomTargetType {
1796 fn request_options(&mut self) -> &mut crate::RequestOptions {
1797 &mut self.0.options
1798 }
1799 }
1800
1801 #[derive(Clone, Debug)]
1819 pub struct UpdateCustomTargetType(RequestBuilder<crate::model::UpdateCustomTargetTypeRequest>);
1820
1821 impl UpdateCustomTargetType {
1822 pub(crate) fn new(
1823 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1824 ) -> Self {
1825 Self(RequestBuilder::new(stub))
1826 }
1827
1828 pub fn with_request<V: Into<crate::model::UpdateCustomTargetTypeRequest>>(
1830 mut self,
1831 v: V,
1832 ) -> Self {
1833 self.0.request = v.into();
1834 self
1835 }
1836
1837 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1839 self.0.options = v.into();
1840 self
1841 }
1842
1843 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1850 (*self.0.stub)
1851 .update_custom_target_type(self.0.request, self.0.options)
1852 .await
1853 .map(crate::Response::into_body)
1854 }
1855
1856 pub fn poller(
1858 self,
1859 ) -> impl google_cloud_lro::Poller<crate::model::CustomTargetType, crate::model::OperationMetadata>
1860 {
1861 type Operation = google_cloud_lro::internal::Operation<
1862 crate::model::CustomTargetType,
1863 crate::model::OperationMetadata,
1864 >;
1865 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1866 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1867
1868 let stub = self.0.stub.clone();
1869 let mut options = self.0.options.clone();
1870 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1871 let query = move |name| {
1872 let stub = stub.clone();
1873 let options = options.clone();
1874 async {
1875 let op = GetOperation::new(stub)
1876 .set_name(name)
1877 .with_options(options)
1878 .send()
1879 .await?;
1880 Ok(Operation::new(op))
1881 }
1882 };
1883
1884 let start = move || async {
1885 let op = self.send().await?;
1886 Ok(Operation::new(op))
1887 };
1888
1889 google_cloud_lro::internal::new_poller(
1890 polling_error_policy,
1891 polling_backoff_policy,
1892 start,
1893 query,
1894 )
1895 }
1896
1897 pub fn set_update_mask<T>(mut self, v: T) -> Self
1901 where
1902 T: std::convert::Into<wkt::FieldMask>,
1903 {
1904 self.0.request.update_mask = std::option::Option::Some(v.into());
1905 self
1906 }
1907
1908 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1912 where
1913 T: std::convert::Into<wkt::FieldMask>,
1914 {
1915 self.0.request.update_mask = v.map(|x| x.into());
1916 self
1917 }
1918
1919 pub fn set_custom_target_type<T>(mut self, v: T) -> Self
1923 where
1924 T: std::convert::Into<crate::model::CustomTargetType>,
1925 {
1926 self.0.request.custom_target_type = std::option::Option::Some(v.into());
1927 self
1928 }
1929
1930 pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
1934 where
1935 T: std::convert::Into<crate::model::CustomTargetType>,
1936 {
1937 self.0.request.custom_target_type = v.map(|x| x.into());
1938 self
1939 }
1940
1941 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1943 self.0.request.request_id = v.into();
1944 self
1945 }
1946
1947 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1949 self.0.request.allow_missing = v.into();
1950 self
1951 }
1952
1953 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1955 self.0.request.validate_only = v.into();
1956 self
1957 }
1958 }
1959
1960 #[doc(hidden)]
1961 impl crate::RequestBuilder for UpdateCustomTargetType {
1962 fn request_options(&mut self) -> &mut crate::RequestOptions {
1963 &mut self.0.options
1964 }
1965 }
1966
1967 #[derive(Clone, Debug)]
1985 pub struct DeleteCustomTargetType(RequestBuilder<crate::model::DeleteCustomTargetTypeRequest>);
1986
1987 impl DeleteCustomTargetType {
1988 pub(crate) fn new(
1989 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1990 ) -> Self {
1991 Self(RequestBuilder::new(stub))
1992 }
1993
1994 pub fn with_request<V: Into<crate::model::DeleteCustomTargetTypeRequest>>(
1996 mut self,
1997 v: V,
1998 ) -> Self {
1999 self.0.request = v.into();
2000 self
2001 }
2002
2003 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2005 self.0.options = v.into();
2006 self
2007 }
2008
2009 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2016 (*self.0.stub)
2017 .delete_custom_target_type(self.0.request, self.0.options)
2018 .await
2019 .map(crate::Response::into_body)
2020 }
2021
2022 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2024 type Operation =
2025 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2026 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2027 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2028
2029 let stub = self.0.stub.clone();
2030 let mut options = self.0.options.clone();
2031 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2032 let query = move |name| {
2033 let stub = stub.clone();
2034 let options = options.clone();
2035 async {
2036 let op = GetOperation::new(stub)
2037 .set_name(name)
2038 .with_options(options)
2039 .send()
2040 .await?;
2041 Ok(Operation::new(op))
2042 }
2043 };
2044
2045 let start = move || async {
2046 let op = self.send().await?;
2047 Ok(Operation::new(op))
2048 };
2049
2050 google_cloud_lro::internal::new_unit_response_poller(
2051 polling_error_policy,
2052 polling_backoff_policy,
2053 start,
2054 query,
2055 )
2056 }
2057
2058 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2062 self.0.request.name = v.into();
2063 self
2064 }
2065
2066 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2068 self.0.request.request_id = v.into();
2069 self
2070 }
2071
2072 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2074 self.0.request.allow_missing = v.into();
2075 self
2076 }
2077
2078 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2080 self.0.request.validate_only = v.into();
2081 self
2082 }
2083
2084 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2086 self.0.request.etag = v.into();
2087 self
2088 }
2089 }
2090
2091 #[doc(hidden)]
2092 impl crate::RequestBuilder for DeleteCustomTargetType {
2093 fn request_options(&mut self) -> &mut crate::RequestOptions {
2094 &mut self.0.options
2095 }
2096 }
2097
2098 #[derive(Clone, Debug)]
2119 pub struct ListReleases(RequestBuilder<crate::model::ListReleasesRequest>);
2120
2121 impl ListReleases {
2122 pub(crate) fn new(
2123 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2124 ) -> Self {
2125 Self(RequestBuilder::new(stub))
2126 }
2127
2128 pub fn with_request<V: Into<crate::model::ListReleasesRequest>>(mut self, v: V) -> Self {
2130 self.0.request = v.into();
2131 self
2132 }
2133
2134 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2136 self.0.options = v.into();
2137 self
2138 }
2139
2140 pub async fn send(self) -> Result<crate::model::ListReleasesResponse> {
2142 (*self.0.stub)
2143 .list_releases(self.0.request, self.0.options)
2144 .await
2145 .map(crate::Response::into_body)
2146 }
2147
2148 pub fn by_page(
2150 self,
2151 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListReleasesResponse, crate::Error>
2152 {
2153 use std::clone::Clone;
2154 let token = self.0.request.page_token.clone();
2155 let execute = move |token: String| {
2156 let mut builder = self.clone();
2157 builder.0.request = builder.0.request.set_page_token(token);
2158 builder.send()
2159 };
2160 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2161 }
2162
2163 pub fn by_item(
2165 self,
2166 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2167 crate::model::ListReleasesResponse,
2168 crate::Error,
2169 > {
2170 use google_cloud_gax::paginator::Paginator;
2171 self.by_page().items()
2172 }
2173
2174 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2178 self.0.request.parent = v.into();
2179 self
2180 }
2181
2182 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2184 self.0.request.page_size = v.into();
2185 self
2186 }
2187
2188 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2190 self.0.request.page_token = v.into();
2191 self
2192 }
2193
2194 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2196 self.0.request.filter = v.into();
2197 self
2198 }
2199
2200 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2202 self.0.request.order_by = v.into();
2203 self
2204 }
2205 }
2206
2207 #[doc(hidden)]
2208 impl crate::RequestBuilder for ListReleases {
2209 fn request_options(&mut self) -> &mut crate::RequestOptions {
2210 &mut self.0.options
2211 }
2212 }
2213
2214 #[derive(Clone, Debug)]
2231 pub struct GetRelease(RequestBuilder<crate::model::GetReleaseRequest>);
2232
2233 impl GetRelease {
2234 pub(crate) fn new(
2235 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2236 ) -> Self {
2237 Self(RequestBuilder::new(stub))
2238 }
2239
2240 pub fn with_request<V: Into<crate::model::GetReleaseRequest>>(mut self, v: V) -> Self {
2242 self.0.request = v.into();
2243 self
2244 }
2245
2246 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2248 self.0.options = v.into();
2249 self
2250 }
2251
2252 pub async fn send(self) -> Result<crate::model::Release> {
2254 (*self.0.stub)
2255 .get_release(self.0.request, self.0.options)
2256 .await
2257 .map(crate::Response::into_body)
2258 }
2259
2260 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2264 self.0.request.name = v.into();
2265 self
2266 }
2267 }
2268
2269 #[doc(hidden)]
2270 impl crate::RequestBuilder for GetRelease {
2271 fn request_options(&mut self) -> &mut crate::RequestOptions {
2272 &mut self.0.options
2273 }
2274 }
2275
2276 #[derive(Clone, Debug)]
2294 pub struct CreateRelease(RequestBuilder<crate::model::CreateReleaseRequest>);
2295
2296 impl CreateRelease {
2297 pub(crate) fn new(
2298 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2299 ) -> Self {
2300 Self(RequestBuilder::new(stub))
2301 }
2302
2303 pub fn with_request<V: Into<crate::model::CreateReleaseRequest>>(mut self, v: V) -> Self {
2305 self.0.request = v.into();
2306 self
2307 }
2308
2309 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2311 self.0.options = v.into();
2312 self
2313 }
2314
2315 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2322 (*self.0.stub)
2323 .create_release(self.0.request, self.0.options)
2324 .await
2325 .map(crate::Response::into_body)
2326 }
2327
2328 pub fn poller(
2330 self,
2331 ) -> impl google_cloud_lro::Poller<crate::model::Release, crate::model::OperationMetadata>
2332 {
2333 type Operation = google_cloud_lro::internal::Operation<
2334 crate::model::Release,
2335 crate::model::OperationMetadata,
2336 >;
2337 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2338 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2339
2340 let stub = self.0.stub.clone();
2341 let mut options = self.0.options.clone();
2342 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2343 let query = move |name| {
2344 let stub = stub.clone();
2345 let options = options.clone();
2346 async {
2347 let op = GetOperation::new(stub)
2348 .set_name(name)
2349 .with_options(options)
2350 .send()
2351 .await?;
2352 Ok(Operation::new(op))
2353 }
2354 };
2355
2356 let start = move || async {
2357 let op = self.send().await?;
2358 Ok(Operation::new(op))
2359 };
2360
2361 google_cloud_lro::internal::new_poller(
2362 polling_error_policy,
2363 polling_backoff_policy,
2364 start,
2365 query,
2366 )
2367 }
2368
2369 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2373 self.0.request.parent = v.into();
2374 self
2375 }
2376
2377 pub fn set_release_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2381 self.0.request.release_id = v.into();
2382 self
2383 }
2384
2385 pub fn set_release<T>(mut self, v: T) -> Self
2389 where
2390 T: std::convert::Into<crate::model::Release>,
2391 {
2392 self.0.request.release = std::option::Option::Some(v.into());
2393 self
2394 }
2395
2396 pub fn set_or_clear_release<T>(mut self, v: std::option::Option<T>) -> Self
2400 where
2401 T: std::convert::Into<crate::model::Release>,
2402 {
2403 self.0.request.release = v.map(|x| x.into());
2404 self
2405 }
2406
2407 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2409 self.0.request.request_id = v.into();
2410 self
2411 }
2412
2413 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2415 self.0.request.validate_only = v.into();
2416 self
2417 }
2418
2419 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
2421 where
2422 T: std::iter::IntoIterator<Item = V>,
2423 V: std::convert::Into<std::string::String>,
2424 {
2425 use std::iter::Iterator;
2426 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
2427 self
2428 }
2429 }
2430
2431 #[doc(hidden)]
2432 impl crate::RequestBuilder for CreateRelease {
2433 fn request_options(&mut self) -> &mut crate::RequestOptions {
2434 &mut self.0.options
2435 }
2436 }
2437
2438 #[derive(Clone, Debug)]
2455 pub struct AbandonRelease(RequestBuilder<crate::model::AbandonReleaseRequest>);
2456
2457 impl AbandonRelease {
2458 pub(crate) fn new(
2459 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2460 ) -> Self {
2461 Self(RequestBuilder::new(stub))
2462 }
2463
2464 pub fn with_request<V: Into<crate::model::AbandonReleaseRequest>>(mut self, v: V) -> Self {
2466 self.0.request = v.into();
2467 self
2468 }
2469
2470 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2472 self.0.options = v.into();
2473 self
2474 }
2475
2476 pub async fn send(self) -> Result<crate::model::AbandonReleaseResponse> {
2478 (*self.0.stub)
2479 .abandon_release(self.0.request, self.0.options)
2480 .await
2481 .map(crate::Response::into_body)
2482 }
2483
2484 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2488 self.0.request.name = v.into();
2489 self
2490 }
2491 }
2492
2493 #[doc(hidden)]
2494 impl crate::RequestBuilder for AbandonRelease {
2495 fn request_options(&mut self) -> &mut crate::RequestOptions {
2496 &mut self.0.options
2497 }
2498 }
2499
2500 #[derive(Clone, Debug)]
2518 pub struct CreateDeployPolicy(RequestBuilder<crate::model::CreateDeployPolicyRequest>);
2519
2520 impl CreateDeployPolicy {
2521 pub(crate) fn new(
2522 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2523 ) -> Self {
2524 Self(RequestBuilder::new(stub))
2525 }
2526
2527 pub fn with_request<V: Into<crate::model::CreateDeployPolicyRequest>>(
2529 mut self,
2530 v: V,
2531 ) -> Self {
2532 self.0.request = v.into();
2533 self
2534 }
2535
2536 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2538 self.0.options = v.into();
2539 self
2540 }
2541
2542 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2549 (*self.0.stub)
2550 .create_deploy_policy(self.0.request, self.0.options)
2551 .await
2552 .map(crate::Response::into_body)
2553 }
2554
2555 pub fn poller(
2557 self,
2558 ) -> impl google_cloud_lro::Poller<crate::model::DeployPolicy, crate::model::OperationMetadata>
2559 {
2560 type Operation = google_cloud_lro::internal::Operation<
2561 crate::model::DeployPolicy,
2562 crate::model::OperationMetadata,
2563 >;
2564 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2565 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2566
2567 let stub = self.0.stub.clone();
2568 let mut options = self.0.options.clone();
2569 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2570 let query = move |name| {
2571 let stub = stub.clone();
2572 let options = options.clone();
2573 async {
2574 let op = GetOperation::new(stub)
2575 .set_name(name)
2576 .with_options(options)
2577 .send()
2578 .await?;
2579 Ok(Operation::new(op))
2580 }
2581 };
2582
2583 let start = move || async {
2584 let op = self.send().await?;
2585 Ok(Operation::new(op))
2586 };
2587
2588 google_cloud_lro::internal::new_poller(
2589 polling_error_policy,
2590 polling_backoff_policy,
2591 start,
2592 query,
2593 )
2594 }
2595
2596 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2600 self.0.request.parent = v.into();
2601 self
2602 }
2603
2604 pub fn set_deploy_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2608 self.0.request.deploy_policy_id = v.into();
2609 self
2610 }
2611
2612 pub fn set_deploy_policy<T>(mut self, v: T) -> Self
2616 where
2617 T: std::convert::Into<crate::model::DeployPolicy>,
2618 {
2619 self.0.request.deploy_policy = std::option::Option::Some(v.into());
2620 self
2621 }
2622
2623 pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
2627 where
2628 T: std::convert::Into<crate::model::DeployPolicy>,
2629 {
2630 self.0.request.deploy_policy = v.map(|x| x.into());
2631 self
2632 }
2633
2634 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2636 self.0.request.request_id = v.into();
2637 self
2638 }
2639
2640 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2642 self.0.request.validate_only = v.into();
2643 self
2644 }
2645 }
2646
2647 #[doc(hidden)]
2648 impl crate::RequestBuilder for CreateDeployPolicy {
2649 fn request_options(&mut self) -> &mut crate::RequestOptions {
2650 &mut self.0.options
2651 }
2652 }
2653
2654 #[derive(Clone, Debug)]
2672 pub struct UpdateDeployPolicy(RequestBuilder<crate::model::UpdateDeployPolicyRequest>);
2673
2674 impl UpdateDeployPolicy {
2675 pub(crate) fn new(
2676 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2677 ) -> Self {
2678 Self(RequestBuilder::new(stub))
2679 }
2680
2681 pub fn with_request<V: Into<crate::model::UpdateDeployPolicyRequest>>(
2683 mut self,
2684 v: V,
2685 ) -> Self {
2686 self.0.request = v.into();
2687 self
2688 }
2689
2690 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2692 self.0.options = v.into();
2693 self
2694 }
2695
2696 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2703 (*self.0.stub)
2704 .update_deploy_policy(self.0.request, self.0.options)
2705 .await
2706 .map(crate::Response::into_body)
2707 }
2708
2709 pub fn poller(
2711 self,
2712 ) -> impl google_cloud_lro::Poller<crate::model::DeployPolicy, crate::model::OperationMetadata>
2713 {
2714 type Operation = google_cloud_lro::internal::Operation<
2715 crate::model::DeployPolicy,
2716 crate::model::OperationMetadata,
2717 >;
2718 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2719 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2720
2721 let stub = self.0.stub.clone();
2722 let mut options = self.0.options.clone();
2723 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2724 let query = move |name| {
2725 let stub = stub.clone();
2726 let options = options.clone();
2727 async {
2728 let op = GetOperation::new(stub)
2729 .set_name(name)
2730 .with_options(options)
2731 .send()
2732 .await?;
2733 Ok(Operation::new(op))
2734 }
2735 };
2736
2737 let start = move || async {
2738 let op = self.send().await?;
2739 Ok(Operation::new(op))
2740 };
2741
2742 google_cloud_lro::internal::new_poller(
2743 polling_error_policy,
2744 polling_backoff_policy,
2745 start,
2746 query,
2747 )
2748 }
2749
2750 pub fn set_update_mask<T>(mut self, v: T) -> Self
2754 where
2755 T: std::convert::Into<wkt::FieldMask>,
2756 {
2757 self.0.request.update_mask = std::option::Option::Some(v.into());
2758 self
2759 }
2760
2761 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2765 where
2766 T: std::convert::Into<wkt::FieldMask>,
2767 {
2768 self.0.request.update_mask = v.map(|x| x.into());
2769 self
2770 }
2771
2772 pub fn set_deploy_policy<T>(mut self, v: T) -> Self
2776 where
2777 T: std::convert::Into<crate::model::DeployPolicy>,
2778 {
2779 self.0.request.deploy_policy = std::option::Option::Some(v.into());
2780 self
2781 }
2782
2783 pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
2787 where
2788 T: std::convert::Into<crate::model::DeployPolicy>,
2789 {
2790 self.0.request.deploy_policy = v.map(|x| x.into());
2791 self
2792 }
2793
2794 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2796 self.0.request.request_id = v.into();
2797 self
2798 }
2799
2800 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2802 self.0.request.allow_missing = v.into();
2803 self
2804 }
2805
2806 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2808 self.0.request.validate_only = v.into();
2809 self
2810 }
2811 }
2812
2813 #[doc(hidden)]
2814 impl crate::RequestBuilder for UpdateDeployPolicy {
2815 fn request_options(&mut self) -> &mut crate::RequestOptions {
2816 &mut self.0.options
2817 }
2818 }
2819
2820 #[derive(Clone, Debug)]
2838 pub struct DeleteDeployPolicy(RequestBuilder<crate::model::DeleteDeployPolicyRequest>);
2839
2840 impl DeleteDeployPolicy {
2841 pub(crate) fn new(
2842 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2843 ) -> Self {
2844 Self(RequestBuilder::new(stub))
2845 }
2846
2847 pub fn with_request<V: Into<crate::model::DeleteDeployPolicyRequest>>(
2849 mut self,
2850 v: V,
2851 ) -> Self {
2852 self.0.request = v.into();
2853 self
2854 }
2855
2856 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2858 self.0.options = v.into();
2859 self
2860 }
2861
2862 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2869 (*self.0.stub)
2870 .delete_deploy_policy(self.0.request, self.0.options)
2871 .await
2872 .map(crate::Response::into_body)
2873 }
2874
2875 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2877 type Operation =
2878 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2879 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2880 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2881
2882 let stub = self.0.stub.clone();
2883 let mut options = self.0.options.clone();
2884 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2885 let query = move |name| {
2886 let stub = stub.clone();
2887 let options = options.clone();
2888 async {
2889 let op = GetOperation::new(stub)
2890 .set_name(name)
2891 .with_options(options)
2892 .send()
2893 .await?;
2894 Ok(Operation::new(op))
2895 }
2896 };
2897
2898 let start = move || async {
2899 let op = self.send().await?;
2900 Ok(Operation::new(op))
2901 };
2902
2903 google_cloud_lro::internal::new_unit_response_poller(
2904 polling_error_policy,
2905 polling_backoff_policy,
2906 start,
2907 query,
2908 )
2909 }
2910
2911 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2915 self.0.request.name = v.into();
2916 self
2917 }
2918
2919 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2921 self.0.request.request_id = v.into();
2922 self
2923 }
2924
2925 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2927 self.0.request.allow_missing = v.into();
2928 self
2929 }
2930
2931 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2933 self.0.request.validate_only = v.into();
2934 self
2935 }
2936
2937 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2939 self.0.request.etag = v.into();
2940 self
2941 }
2942 }
2943
2944 #[doc(hidden)]
2945 impl crate::RequestBuilder for DeleteDeployPolicy {
2946 fn request_options(&mut self) -> &mut crate::RequestOptions {
2947 &mut self.0.options
2948 }
2949 }
2950
2951 #[derive(Clone, Debug)]
2972 pub struct ListDeployPolicies(RequestBuilder<crate::model::ListDeployPoliciesRequest>);
2973
2974 impl ListDeployPolicies {
2975 pub(crate) fn new(
2976 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2977 ) -> Self {
2978 Self(RequestBuilder::new(stub))
2979 }
2980
2981 pub fn with_request<V: Into<crate::model::ListDeployPoliciesRequest>>(
2983 mut self,
2984 v: V,
2985 ) -> Self {
2986 self.0.request = v.into();
2987 self
2988 }
2989
2990 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2992 self.0.options = v.into();
2993 self
2994 }
2995
2996 pub async fn send(self) -> Result<crate::model::ListDeployPoliciesResponse> {
2998 (*self.0.stub)
2999 .list_deploy_policies(self.0.request, self.0.options)
3000 .await
3001 .map(crate::Response::into_body)
3002 }
3003
3004 pub fn by_page(
3006 self,
3007 ) -> impl google_cloud_gax::paginator::Paginator<
3008 crate::model::ListDeployPoliciesResponse,
3009 crate::Error,
3010 > {
3011 use std::clone::Clone;
3012 let token = self.0.request.page_token.clone();
3013 let execute = move |token: String| {
3014 let mut builder = self.clone();
3015 builder.0.request = builder.0.request.set_page_token(token);
3016 builder.send()
3017 };
3018 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3019 }
3020
3021 pub fn by_item(
3023 self,
3024 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3025 crate::model::ListDeployPoliciesResponse,
3026 crate::Error,
3027 > {
3028 use google_cloud_gax::paginator::Paginator;
3029 self.by_page().items()
3030 }
3031
3032 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3036 self.0.request.parent = v.into();
3037 self
3038 }
3039
3040 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3042 self.0.request.page_size = v.into();
3043 self
3044 }
3045
3046 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3048 self.0.request.page_token = v.into();
3049 self
3050 }
3051
3052 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3054 self.0.request.filter = v.into();
3055 self
3056 }
3057
3058 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3060 self.0.request.order_by = v.into();
3061 self
3062 }
3063 }
3064
3065 #[doc(hidden)]
3066 impl crate::RequestBuilder for ListDeployPolicies {
3067 fn request_options(&mut self) -> &mut crate::RequestOptions {
3068 &mut self.0.options
3069 }
3070 }
3071
3072 #[derive(Clone, Debug)]
3089 pub struct GetDeployPolicy(RequestBuilder<crate::model::GetDeployPolicyRequest>);
3090
3091 impl GetDeployPolicy {
3092 pub(crate) fn new(
3093 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3094 ) -> Self {
3095 Self(RequestBuilder::new(stub))
3096 }
3097
3098 pub fn with_request<V: Into<crate::model::GetDeployPolicyRequest>>(mut self, v: V) -> Self {
3100 self.0.request = v.into();
3101 self
3102 }
3103
3104 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3106 self.0.options = v.into();
3107 self
3108 }
3109
3110 pub async fn send(self) -> Result<crate::model::DeployPolicy> {
3112 (*self.0.stub)
3113 .get_deploy_policy(self.0.request, self.0.options)
3114 .await
3115 .map(crate::Response::into_body)
3116 }
3117
3118 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3122 self.0.request.name = v.into();
3123 self
3124 }
3125 }
3126
3127 #[doc(hidden)]
3128 impl crate::RequestBuilder for GetDeployPolicy {
3129 fn request_options(&mut self) -> &mut crate::RequestOptions {
3130 &mut self.0.options
3131 }
3132 }
3133
3134 #[derive(Clone, Debug)]
3151 pub struct ApproveRollout(RequestBuilder<crate::model::ApproveRolloutRequest>);
3152
3153 impl ApproveRollout {
3154 pub(crate) fn new(
3155 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3156 ) -> Self {
3157 Self(RequestBuilder::new(stub))
3158 }
3159
3160 pub fn with_request<V: Into<crate::model::ApproveRolloutRequest>>(mut self, v: V) -> Self {
3162 self.0.request = v.into();
3163 self
3164 }
3165
3166 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3168 self.0.options = v.into();
3169 self
3170 }
3171
3172 pub async fn send(self) -> Result<crate::model::ApproveRolloutResponse> {
3174 (*self.0.stub)
3175 .approve_rollout(self.0.request, self.0.options)
3176 .await
3177 .map(crate::Response::into_body)
3178 }
3179
3180 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3184 self.0.request.name = v.into();
3185 self
3186 }
3187
3188 pub fn set_approved<T: Into<bool>>(mut self, v: T) -> Self {
3192 self.0.request.approved = v.into();
3193 self
3194 }
3195
3196 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3198 where
3199 T: std::iter::IntoIterator<Item = V>,
3200 V: std::convert::Into<std::string::String>,
3201 {
3202 use std::iter::Iterator;
3203 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3204 self
3205 }
3206 }
3207
3208 #[doc(hidden)]
3209 impl crate::RequestBuilder for ApproveRollout {
3210 fn request_options(&mut self) -> &mut crate::RequestOptions {
3211 &mut self.0.options
3212 }
3213 }
3214
3215 #[derive(Clone, Debug)]
3232 pub struct AdvanceRollout(RequestBuilder<crate::model::AdvanceRolloutRequest>);
3233
3234 impl AdvanceRollout {
3235 pub(crate) fn new(
3236 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3237 ) -> Self {
3238 Self(RequestBuilder::new(stub))
3239 }
3240
3241 pub fn with_request<V: Into<crate::model::AdvanceRolloutRequest>>(mut self, v: V) -> Self {
3243 self.0.request = v.into();
3244 self
3245 }
3246
3247 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3249 self.0.options = v.into();
3250 self
3251 }
3252
3253 pub async fn send(self) -> Result<crate::model::AdvanceRolloutResponse> {
3255 (*self.0.stub)
3256 .advance_rollout(self.0.request, self.0.options)
3257 .await
3258 .map(crate::Response::into_body)
3259 }
3260
3261 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3265 self.0.request.name = v.into();
3266 self
3267 }
3268
3269 pub fn set_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3273 self.0.request.phase_id = v.into();
3274 self
3275 }
3276
3277 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3279 where
3280 T: std::iter::IntoIterator<Item = V>,
3281 V: std::convert::Into<std::string::String>,
3282 {
3283 use std::iter::Iterator;
3284 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3285 self
3286 }
3287 }
3288
3289 #[doc(hidden)]
3290 impl crate::RequestBuilder for AdvanceRollout {
3291 fn request_options(&mut self) -> &mut crate::RequestOptions {
3292 &mut self.0.options
3293 }
3294 }
3295
3296 #[derive(Clone, Debug)]
3313 pub struct CancelRollout(RequestBuilder<crate::model::CancelRolloutRequest>);
3314
3315 impl CancelRollout {
3316 pub(crate) fn new(
3317 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3318 ) -> Self {
3319 Self(RequestBuilder::new(stub))
3320 }
3321
3322 pub fn with_request<V: Into<crate::model::CancelRolloutRequest>>(mut self, v: V) -> Self {
3324 self.0.request = v.into();
3325 self
3326 }
3327
3328 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3330 self.0.options = v.into();
3331 self
3332 }
3333
3334 pub async fn send(self) -> Result<crate::model::CancelRolloutResponse> {
3336 (*self.0.stub)
3337 .cancel_rollout(self.0.request, self.0.options)
3338 .await
3339 .map(crate::Response::into_body)
3340 }
3341
3342 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3346 self.0.request.name = v.into();
3347 self
3348 }
3349
3350 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3352 where
3353 T: std::iter::IntoIterator<Item = V>,
3354 V: std::convert::Into<std::string::String>,
3355 {
3356 use std::iter::Iterator;
3357 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3358 self
3359 }
3360 }
3361
3362 #[doc(hidden)]
3363 impl crate::RequestBuilder for CancelRollout {
3364 fn request_options(&mut self) -> &mut crate::RequestOptions {
3365 &mut self.0.options
3366 }
3367 }
3368
3369 #[derive(Clone, Debug)]
3390 pub struct ListRollouts(RequestBuilder<crate::model::ListRolloutsRequest>);
3391
3392 impl ListRollouts {
3393 pub(crate) fn new(
3394 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3395 ) -> Self {
3396 Self(RequestBuilder::new(stub))
3397 }
3398
3399 pub fn with_request<V: Into<crate::model::ListRolloutsRequest>>(mut self, v: V) -> Self {
3401 self.0.request = v.into();
3402 self
3403 }
3404
3405 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3407 self.0.options = v.into();
3408 self
3409 }
3410
3411 pub async fn send(self) -> Result<crate::model::ListRolloutsResponse> {
3413 (*self.0.stub)
3414 .list_rollouts(self.0.request, self.0.options)
3415 .await
3416 .map(crate::Response::into_body)
3417 }
3418
3419 pub fn by_page(
3421 self,
3422 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListRolloutsResponse, crate::Error>
3423 {
3424 use std::clone::Clone;
3425 let token = self.0.request.page_token.clone();
3426 let execute = move |token: String| {
3427 let mut builder = self.clone();
3428 builder.0.request = builder.0.request.set_page_token(token);
3429 builder.send()
3430 };
3431 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3432 }
3433
3434 pub fn by_item(
3436 self,
3437 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3438 crate::model::ListRolloutsResponse,
3439 crate::Error,
3440 > {
3441 use google_cloud_gax::paginator::Paginator;
3442 self.by_page().items()
3443 }
3444
3445 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3449 self.0.request.parent = v.into();
3450 self
3451 }
3452
3453 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3455 self.0.request.page_size = v.into();
3456 self
3457 }
3458
3459 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3461 self.0.request.page_token = v.into();
3462 self
3463 }
3464
3465 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3467 self.0.request.filter = v.into();
3468 self
3469 }
3470
3471 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3473 self.0.request.order_by = v.into();
3474 self
3475 }
3476 }
3477
3478 #[doc(hidden)]
3479 impl crate::RequestBuilder for ListRollouts {
3480 fn request_options(&mut self) -> &mut crate::RequestOptions {
3481 &mut self.0.options
3482 }
3483 }
3484
3485 #[derive(Clone, Debug)]
3502 pub struct GetRollout(RequestBuilder<crate::model::GetRolloutRequest>);
3503
3504 impl GetRollout {
3505 pub(crate) fn new(
3506 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3507 ) -> Self {
3508 Self(RequestBuilder::new(stub))
3509 }
3510
3511 pub fn with_request<V: Into<crate::model::GetRolloutRequest>>(mut self, v: V) -> Self {
3513 self.0.request = v.into();
3514 self
3515 }
3516
3517 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3519 self.0.options = v.into();
3520 self
3521 }
3522
3523 pub async fn send(self) -> Result<crate::model::Rollout> {
3525 (*self.0.stub)
3526 .get_rollout(self.0.request, self.0.options)
3527 .await
3528 .map(crate::Response::into_body)
3529 }
3530
3531 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3535 self.0.request.name = v.into();
3536 self
3537 }
3538 }
3539
3540 #[doc(hidden)]
3541 impl crate::RequestBuilder for GetRollout {
3542 fn request_options(&mut self) -> &mut crate::RequestOptions {
3543 &mut self.0.options
3544 }
3545 }
3546
3547 #[derive(Clone, Debug)]
3565 pub struct CreateRollout(RequestBuilder<crate::model::CreateRolloutRequest>);
3566
3567 impl CreateRollout {
3568 pub(crate) fn new(
3569 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3570 ) -> Self {
3571 Self(RequestBuilder::new(stub))
3572 }
3573
3574 pub fn with_request<V: Into<crate::model::CreateRolloutRequest>>(mut self, v: V) -> Self {
3576 self.0.request = v.into();
3577 self
3578 }
3579
3580 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3582 self.0.options = v.into();
3583 self
3584 }
3585
3586 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3593 (*self.0.stub)
3594 .create_rollout(self.0.request, self.0.options)
3595 .await
3596 .map(crate::Response::into_body)
3597 }
3598
3599 pub fn poller(
3601 self,
3602 ) -> impl google_cloud_lro::Poller<crate::model::Rollout, crate::model::OperationMetadata>
3603 {
3604 type Operation = google_cloud_lro::internal::Operation<
3605 crate::model::Rollout,
3606 crate::model::OperationMetadata,
3607 >;
3608 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3609 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3610
3611 let stub = self.0.stub.clone();
3612 let mut options = self.0.options.clone();
3613 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3614 let query = move |name| {
3615 let stub = stub.clone();
3616 let options = options.clone();
3617 async {
3618 let op = GetOperation::new(stub)
3619 .set_name(name)
3620 .with_options(options)
3621 .send()
3622 .await?;
3623 Ok(Operation::new(op))
3624 }
3625 };
3626
3627 let start = move || async {
3628 let op = self.send().await?;
3629 Ok(Operation::new(op))
3630 };
3631
3632 google_cloud_lro::internal::new_poller(
3633 polling_error_policy,
3634 polling_backoff_policy,
3635 start,
3636 query,
3637 )
3638 }
3639
3640 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3644 self.0.request.parent = v.into();
3645 self
3646 }
3647
3648 pub fn set_rollout_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3652 self.0.request.rollout_id = v.into();
3653 self
3654 }
3655
3656 pub fn set_rollout<T>(mut self, v: T) -> Self
3660 where
3661 T: std::convert::Into<crate::model::Rollout>,
3662 {
3663 self.0.request.rollout = std::option::Option::Some(v.into());
3664 self
3665 }
3666
3667 pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
3671 where
3672 T: std::convert::Into<crate::model::Rollout>,
3673 {
3674 self.0.request.rollout = v.map(|x| x.into());
3675 self
3676 }
3677
3678 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3680 self.0.request.request_id = v.into();
3681 self
3682 }
3683
3684 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3686 self.0.request.validate_only = v.into();
3687 self
3688 }
3689
3690 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3692 where
3693 T: std::iter::IntoIterator<Item = V>,
3694 V: std::convert::Into<std::string::String>,
3695 {
3696 use std::iter::Iterator;
3697 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3698 self
3699 }
3700
3701 pub fn set_starting_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3703 self.0.request.starting_phase_id = v.into();
3704 self
3705 }
3706 }
3707
3708 #[doc(hidden)]
3709 impl crate::RequestBuilder for CreateRollout {
3710 fn request_options(&mut self) -> &mut crate::RequestOptions {
3711 &mut self.0.options
3712 }
3713 }
3714
3715 #[derive(Clone, Debug)]
3732 pub struct IgnoreJob(RequestBuilder<crate::model::IgnoreJobRequest>);
3733
3734 impl IgnoreJob {
3735 pub(crate) fn new(
3736 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3737 ) -> Self {
3738 Self(RequestBuilder::new(stub))
3739 }
3740
3741 pub fn with_request<V: Into<crate::model::IgnoreJobRequest>>(mut self, v: V) -> Self {
3743 self.0.request = v.into();
3744 self
3745 }
3746
3747 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3749 self.0.options = v.into();
3750 self
3751 }
3752
3753 pub async fn send(self) -> Result<crate::model::IgnoreJobResponse> {
3755 (*self.0.stub)
3756 .ignore_job(self.0.request, self.0.options)
3757 .await
3758 .map(crate::Response::into_body)
3759 }
3760
3761 pub fn set_rollout<T: Into<std::string::String>>(mut self, v: T) -> Self {
3765 self.0.request.rollout = v.into();
3766 self
3767 }
3768
3769 pub fn set_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3773 self.0.request.phase_id = v.into();
3774 self
3775 }
3776
3777 pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3781 self.0.request.job_id = v.into();
3782 self
3783 }
3784
3785 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3787 where
3788 T: std::iter::IntoIterator<Item = V>,
3789 V: std::convert::Into<std::string::String>,
3790 {
3791 use std::iter::Iterator;
3792 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3793 self
3794 }
3795 }
3796
3797 #[doc(hidden)]
3798 impl crate::RequestBuilder for IgnoreJob {
3799 fn request_options(&mut self) -> &mut crate::RequestOptions {
3800 &mut self.0.options
3801 }
3802 }
3803
3804 #[derive(Clone, Debug)]
3821 pub struct RetryJob(RequestBuilder<crate::model::RetryJobRequest>);
3822
3823 impl RetryJob {
3824 pub(crate) fn new(
3825 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3826 ) -> Self {
3827 Self(RequestBuilder::new(stub))
3828 }
3829
3830 pub fn with_request<V: Into<crate::model::RetryJobRequest>>(mut self, v: V) -> Self {
3832 self.0.request = v.into();
3833 self
3834 }
3835
3836 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3838 self.0.options = v.into();
3839 self
3840 }
3841
3842 pub async fn send(self) -> Result<crate::model::RetryJobResponse> {
3844 (*self.0.stub)
3845 .retry_job(self.0.request, self.0.options)
3846 .await
3847 .map(crate::Response::into_body)
3848 }
3849
3850 pub fn set_rollout<T: Into<std::string::String>>(mut self, v: T) -> Self {
3854 self.0.request.rollout = v.into();
3855 self
3856 }
3857
3858 pub fn set_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3862 self.0.request.phase_id = v.into();
3863 self
3864 }
3865
3866 pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3870 self.0.request.job_id = v.into();
3871 self
3872 }
3873
3874 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3876 where
3877 T: std::iter::IntoIterator<Item = V>,
3878 V: std::convert::Into<std::string::String>,
3879 {
3880 use std::iter::Iterator;
3881 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3882 self
3883 }
3884 }
3885
3886 #[doc(hidden)]
3887 impl crate::RequestBuilder for RetryJob {
3888 fn request_options(&mut self) -> &mut crate::RequestOptions {
3889 &mut self.0.options
3890 }
3891 }
3892
3893 #[derive(Clone, Debug)]
3914 pub struct ListJobRuns(RequestBuilder<crate::model::ListJobRunsRequest>);
3915
3916 impl ListJobRuns {
3917 pub(crate) fn new(
3918 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3919 ) -> Self {
3920 Self(RequestBuilder::new(stub))
3921 }
3922
3923 pub fn with_request<V: Into<crate::model::ListJobRunsRequest>>(mut self, v: V) -> Self {
3925 self.0.request = v.into();
3926 self
3927 }
3928
3929 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3931 self.0.options = v.into();
3932 self
3933 }
3934
3935 pub async fn send(self) -> Result<crate::model::ListJobRunsResponse> {
3937 (*self.0.stub)
3938 .list_job_runs(self.0.request, self.0.options)
3939 .await
3940 .map(crate::Response::into_body)
3941 }
3942
3943 pub fn by_page(
3945 self,
3946 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListJobRunsResponse, crate::Error>
3947 {
3948 use std::clone::Clone;
3949 let token = self.0.request.page_token.clone();
3950 let execute = move |token: String| {
3951 let mut builder = self.clone();
3952 builder.0.request = builder.0.request.set_page_token(token);
3953 builder.send()
3954 };
3955 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3956 }
3957
3958 pub fn by_item(
3960 self,
3961 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3962 crate::model::ListJobRunsResponse,
3963 crate::Error,
3964 > {
3965 use google_cloud_gax::paginator::Paginator;
3966 self.by_page().items()
3967 }
3968
3969 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3973 self.0.request.parent = v.into();
3974 self
3975 }
3976
3977 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3979 self.0.request.page_size = v.into();
3980 self
3981 }
3982
3983 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3985 self.0.request.page_token = v.into();
3986 self
3987 }
3988
3989 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3991 self.0.request.filter = v.into();
3992 self
3993 }
3994
3995 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3997 self.0.request.order_by = v.into();
3998 self
3999 }
4000 }
4001
4002 #[doc(hidden)]
4003 impl crate::RequestBuilder for ListJobRuns {
4004 fn request_options(&mut self) -> &mut crate::RequestOptions {
4005 &mut self.0.options
4006 }
4007 }
4008
4009 #[derive(Clone, Debug)]
4026 pub struct GetJobRun(RequestBuilder<crate::model::GetJobRunRequest>);
4027
4028 impl GetJobRun {
4029 pub(crate) fn new(
4030 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4031 ) -> Self {
4032 Self(RequestBuilder::new(stub))
4033 }
4034
4035 pub fn with_request<V: Into<crate::model::GetJobRunRequest>>(mut self, v: V) -> Self {
4037 self.0.request = v.into();
4038 self
4039 }
4040
4041 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4043 self.0.options = v.into();
4044 self
4045 }
4046
4047 pub async fn send(self) -> Result<crate::model::JobRun> {
4049 (*self.0.stub)
4050 .get_job_run(self.0.request, self.0.options)
4051 .await
4052 .map(crate::Response::into_body)
4053 }
4054
4055 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
4064 #[doc(hidden)]
4065 impl crate::RequestBuilder for GetJobRun {
4066 fn request_options(&mut self) -> &mut crate::RequestOptions {
4067 &mut self.0.options
4068 }
4069 }
4070
4071 #[derive(Clone, Debug)]
4088 pub struct TerminateJobRun(RequestBuilder<crate::model::TerminateJobRunRequest>);
4089
4090 impl TerminateJobRun {
4091 pub(crate) fn new(
4092 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4093 ) -> Self {
4094 Self(RequestBuilder::new(stub))
4095 }
4096
4097 pub fn with_request<V: Into<crate::model::TerminateJobRunRequest>>(mut self, v: V) -> Self {
4099 self.0.request = v.into();
4100 self
4101 }
4102
4103 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4105 self.0.options = v.into();
4106 self
4107 }
4108
4109 pub async fn send(self) -> Result<crate::model::TerminateJobRunResponse> {
4111 (*self.0.stub)
4112 .terminate_job_run(self.0.request, self.0.options)
4113 .await
4114 .map(crate::Response::into_body)
4115 }
4116
4117 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4121 self.0.request.name = v.into();
4122 self
4123 }
4124
4125 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
4127 where
4128 T: std::iter::IntoIterator<Item = V>,
4129 V: std::convert::Into<std::string::String>,
4130 {
4131 use std::iter::Iterator;
4132 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
4133 self
4134 }
4135 }
4136
4137 #[doc(hidden)]
4138 impl crate::RequestBuilder for TerminateJobRun {
4139 fn request_options(&mut self) -> &mut crate::RequestOptions {
4140 &mut self.0.options
4141 }
4142 }
4143
4144 #[derive(Clone, Debug)]
4161 pub struct GetConfig(RequestBuilder<crate::model::GetConfigRequest>);
4162
4163 impl GetConfig {
4164 pub(crate) fn new(
4165 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4166 ) -> Self {
4167 Self(RequestBuilder::new(stub))
4168 }
4169
4170 pub fn with_request<V: Into<crate::model::GetConfigRequest>>(mut self, v: V) -> Self {
4172 self.0.request = v.into();
4173 self
4174 }
4175
4176 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4178 self.0.options = v.into();
4179 self
4180 }
4181
4182 pub async fn send(self) -> Result<crate::model::Config> {
4184 (*self.0.stub)
4185 .get_config(self.0.request, self.0.options)
4186 .await
4187 .map(crate::Response::into_body)
4188 }
4189
4190 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4194 self.0.request.name = v.into();
4195 self
4196 }
4197 }
4198
4199 #[doc(hidden)]
4200 impl crate::RequestBuilder for GetConfig {
4201 fn request_options(&mut self) -> &mut crate::RequestOptions {
4202 &mut self.0.options
4203 }
4204 }
4205
4206 #[derive(Clone, Debug)]
4224 pub struct CreateAutomation(RequestBuilder<crate::model::CreateAutomationRequest>);
4225
4226 impl CreateAutomation {
4227 pub(crate) fn new(
4228 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4229 ) -> Self {
4230 Self(RequestBuilder::new(stub))
4231 }
4232
4233 pub fn with_request<V: Into<crate::model::CreateAutomationRequest>>(
4235 mut self,
4236 v: V,
4237 ) -> Self {
4238 self.0.request = v.into();
4239 self
4240 }
4241
4242 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4244 self.0.options = v.into();
4245 self
4246 }
4247
4248 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4255 (*self.0.stub)
4256 .create_automation(self.0.request, self.0.options)
4257 .await
4258 .map(crate::Response::into_body)
4259 }
4260
4261 pub fn poller(
4263 self,
4264 ) -> impl google_cloud_lro::Poller<crate::model::Automation, crate::model::OperationMetadata>
4265 {
4266 type Operation = google_cloud_lro::internal::Operation<
4267 crate::model::Automation,
4268 crate::model::OperationMetadata,
4269 >;
4270 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4271 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4272
4273 let stub = self.0.stub.clone();
4274 let mut options = self.0.options.clone();
4275 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4276 let query = move |name| {
4277 let stub = stub.clone();
4278 let options = options.clone();
4279 async {
4280 let op = GetOperation::new(stub)
4281 .set_name(name)
4282 .with_options(options)
4283 .send()
4284 .await?;
4285 Ok(Operation::new(op))
4286 }
4287 };
4288
4289 let start = move || async {
4290 let op = self.send().await?;
4291 Ok(Operation::new(op))
4292 };
4293
4294 google_cloud_lro::internal::new_poller(
4295 polling_error_policy,
4296 polling_backoff_policy,
4297 start,
4298 query,
4299 )
4300 }
4301
4302 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4306 self.0.request.parent = v.into();
4307 self
4308 }
4309
4310 pub fn set_automation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4314 self.0.request.automation_id = v.into();
4315 self
4316 }
4317
4318 pub fn set_automation<T>(mut self, v: T) -> Self
4322 where
4323 T: std::convert::Into<crate::model::Automation>,
4324 {
4325 self.0.request.automation = std::option::Option::Some(v.into());
4326 self
4327 }
4328
4329 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
4333 where
4334 T: std::convert::Into<crate::model::Automation>,
4335 {
4336 self.0.request.automation = v.map(|x| x.into());
4337 self
4338 }
4339
4340 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4342 self.0.request.request_id = v.into();
4343 self
4344 }
4345
4346 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4348 self.0.request.validate_only = v.into();
4349 self
4350 }
4351 }
4352
4353 #[doc(hidden)]
4354 impl crate::RequestBuilder for CreateAutomation {
4355 fn request_options(&mut self) -> &mut crate::RequestOptions {
4356 &mut self.0.options
4357 }
4358 }
4359
4360 #[derive(Clone, Debug)]
4378 pub struct UpdateAutomation(RequestBuilder<crate::model::UpdateAutomationRequest>);
4379
4380 impl UpdateAutomation {
4381 pub(crate) fn new(
4382 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4383 ) -> Self {
4384 Self(RequestBuilder::new(stub))
4385 }
4386
4387 pub fn with_request<V: Into<crate::model::UpdateAutomationRequest>>(
4389 mut self,
4390 v: V,
4391 ) -> Self {
4392 self.0.request = v.into();
4393 self
4394 }
4395
4396 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4398 self.0.options = v.into();
4399 self
4400 }
4401
4402 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4409 (*self.0.stub)
4410 .update_automation(self.0.request, self.0.options)
4411 .await
4412 .map(crate::Response::into_body)
4413 }
4414
4415 pub fn poller(
4417 self,
4418 ) -> impl google_cloud_lro::Poller<crate::model::Automation, crate::model::OperationMetadata>
4419 {
4420 type Operation = google_cloud_lro::internal::Operation<
4421 crate::model::Automation,
4422 crate::model::OperationMetadata,
4423 >;
4424 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4425 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4426
4427 let stub = self.0.stub.clone();
4428 let mut options = self.0.options.clone();
4429 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4430 let query = move |name| {
4431 let stub = stub.clone();
4432 let options = options.clone();
4433 async {
4434 let op = GetOperation::new(stub)
4435 .set_name(name)
4436 .with_options(options)
4437 .send()
4438 .await?;
4439 Ok(Operation::new(op))
4440 }
4441 };
4442
4443 let start = move || async {
4444 let op = self.send().await?;
4445 Ok(Operation::new(op))
4446 };
4447
4448 google_cloud_lro::internal::new_poller(
4449 polling_error_policy,
4450 polling_backoff_policy,
4451 start,
4452 query,
4453 )
4454 }
4455
4456 pub fn set_update_mask<T>(mut self, v: T) -> Self
4460 where
4461 T: std::convert::Into<wkt::FieldMask>,
4462 {
4463 self.0.request.update_mask = std::option::Option::Some(v.into());
4464 self
4465 }
4466
4467 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4471 where
4472 T: std::convert::Into<wkt::FieldMask>,
4473 {
4474 self.0.request.update_mask = v.map(|x| x.into());
4475 self
4476 }
4477
4478 pub fn set_automation<T>(mut self, v: T) -> Self
4482 where
4483 T: std::convert::Into<crate::model::Automation>,
4484 {
4485 self.0.request.automation = std::option::Option::Some(v.into());
4486 self
4487 }
4488
4489 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
4493 where
4494 T: std::convert::Into<crate::model::Automation>,
4495 {
4496 self.0.request.automation = v.map(|x| x.into());
4497 self
4498 }
4499
4500 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4502 self.0.request.request_id = v.into();
4503 self
4504 }
4505
4506 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
4508 self.0.request.allow_missing = v.into();
4509 self
4510 }
4511
4512 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4514 self.0.request.validate_only = v.into();
4515 self
4516 }
4517 }
4518
4519 #[doc(hidden)]
4520 impl crate::RequestBuilder for UpdateAutomation {
4521 fn request_options(&mut self) -> &mut crate::RequestOptions {
4522 &mut self.0.options
4523 }
4524 }
4525
4526 #[derive(Clone, Debug)]
4544 pub struct DeleteAutomation(RequestBuilder<crate::model::DeleteAutomationRequest>);
4545
4546 impl DeleteAutomation {
4547 pub(crate) fn new(
4548 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4549 ) -> Self {
4550 Self(RequestBuilder::new(stub))
4551 }
4552
4553 pub fn with_request<V: Into<crate::model::DeleteAutomationRequest>>(
4555 mut self,
4556 v: V,
4557 ) -> Self {
4558 self.0.request = v.into();
4559 self
4560 }
4561
4562 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4564 self.0.options = v.into();
4565 self
4566 }
4567
4568 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4575 (*self.0.stub)
4576 .delete_automation(self.0.request, self.0.options)
4577 .await
4578 .map(crate::Response::into_body)
4579 }
4580
4581 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4583 type Operation =
4584 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4585 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4586 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4587
4588 let stub = self.0.stub.clone();
4589 let mut options = self.0.options.clone();
4590 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4591 let query = move |name| {
4592 let stub = stub.clone();
4593 let options = options.clone();
4594 async {
4595 let op = GetOperation::new(stub)
4596 .set_name(name)
4597 .with_options(options)
4598 .send()
4599 .await?;
4600 Ok(Operation::new(op))
4601 }
4602 };
4603
4604 let start = move || async {
4605 let op = self.send().await?;
4606 Ok(Operation::new(op))
4607 };
4608
4609 google_cloud_lro::internal::new_unit_response_poller(
4610 polling_error_policy,
4611 polling_backoff_policy,
4612 start,
4613 query,
4614 )
4615 }
4616
4617 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4621 self.0.request.name = v.into();
4622 self
4623 }
4624
4625 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4627 self.0.request.request_id = v.into();
4628 self
4629 }
4630
4631 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
4633 self.0.request.allow_missing = v.into();
4634 self
4635 }
4636
4637 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4639 self.0.request.validate_only = v.into();
4640 self
4641 }
4642
4643 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4645 self.0.request.etag = v.into();
4646 self
4647 }
4648 }
4649
4650 #[doc(hidden)]
4651 impl crate::RequestBuilder for DeleteAutomation {
4652 fn request_options(&mut self) -> &mut crate::RequestOptions {
4653 &mut self.0.options
4654 }
4655 }
4656
4657 #[derive(Clone, Debug)]
4674 pub struct GetAutomation(RequestBuilder<crate::model::GetAutomationRequest>);
4675
4676 impl GetAutomation {
4677 pub(crate) fn new(
4678 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4679 ) -> Self {
4680 Self(RequestBuilder::new(stub))
4681 }
4682
4683 pub fn with_request<V: Into<crate::model::GetAutomationRequest>>(mut self, v: V) -> Self {
4685 self.0.request = v.into();
4686 self
4687 }
4688
4689 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4691 self.0.options = v.into();
4692 self
4693 }
4694
4695 pub async fn send(self) -> Result<crate::model::Automation> {
4697 (*self.0.stub)
4698 .get_automation(self.0.request, self.0.options)
4699 .await
4700 .map(crate::Response::into_body)
4701 }
4702
4703 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4707 self.0.request.name = v.into();
4708 self
4709 }
4710 }
4711
4712 #[doc(hidden)]
4713 impl crate::RequestBuilder for GetAutomation {
4714 fn request_options(&mut self) -> &mut crate::RequestOptions {
4715 &mut self.0.options
4716 }
4717 }
4718
4719 #[derive(Clone, Debug)]
4740 pub struct ListAutomations(RequestBuilder<crate::model::ListAutomationsRequest>);
4741
4742 impl ListAutomations {
4743 pub(crate) fn new(
4744 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4745 ) -> Self {
4746 Self(RequestBuilder::new(stub))
4747 }
4748
4749 pub fn with_request<V: Into<crate::model::ListAutomationsRequest>>(mut self, v: V) -> Self {
4751 self.0.request = v.into();
4752 self
4753 }
4754
4755 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4757 self.0.options = v.into();
4758 self
4759 }
4760
4761 pub async fn send(self) -> Result<crate::model::ListAutomationsResponse> {
4763 (*self.0.stub)
4764 .list_automations(self.0.request, self.0.options)
4765 .await
4766 .map(crate::Response::into_body)
4767 }
4768
4769 pub fn by_page(
4771 self,
4772 ) -> impl google_cloud_gax::paginator::Paginator<
4773 crate::model::ListAutomationsResponse,
4774 crate::Error,
4775 > {
4776 use std::clone::Clone;
4777 let token = self.0.request.page_token.clone();
4778 let execute = move |token: String| {
4779 let mut builder = self.clone();
4780 builder.0.request = builder.0.request.set_page_token(token);
4781 builder.send()
4782 };
4783 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4784 }
4785
4786 pub fn by_item(
4788 self,
4789 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4790 crate::model::ListAutomationsResponse,
4791 crate::Error,
4792 > {
4793 use google_cloud_gax::paginator::Paginator;
4794 self.by_page().items()
4795 }
4796
4797 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4801 self.0.request.parent = v.into();
4802 self
4803 }
4804
4805 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4807 self.0.request.page_size = v.into();
4808 self
4809 }
4810
4811 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4813 self.0.request.page_token = v.into();
4814 self
4815 }
4816
4817 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4819 self.0.request.filter = v.into();
4820 self
4821 }
4822
4823 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4825 self.0.request.order_by = v.into();
4826 self
4827 }
4828 }
4829
4830 #[doc(hidden)]
4831 impl crate::RequestBuilder for ListAutomations {
4832 fn request_options(&mut self) -> &mut crate::RequestOptions {
4833 &mut self.0.options
4834 }
4835 }
4836
4837 #[derive(Clone, Debug)]
4854 pub struct GetAutomationRun(RequestBuilder<crate::model::GetAutomationRunRequest>);
4855
4856 impl GetAutomationRun {
4857 pub(crate) fn new(
4858 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4859 ) -> Self {
4860 Self(RequestBuilder::new(stub))
4861 }
4862
4863 pub fn with_request<V: Into<crate::model::GetAutomationRunRequest>>(
4865 mut self,
4866 v: V,
4867 ) -> Self {
4868 self.0.request = v.into();
4869 self
4870 }
4871
4872 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4874 self.0.options = v.into();
4875 self
4876 }
4877
4878 pub async fn send(self) -> Result<crate::model::AutomationRun> {
4880 (*self.0.stub)
4881 .get_automation_run(self.0.request, self.0.options)
4882 .await
4883 .map(crate::Response::into_body)
4884 }
4885
4886 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4890 self.0.request.name = v.into();
4891 self
4892 }
4893 }
4894
4895 #[doc(hidden)]
4896 impl crate::RequestBuilder for GetAutomationRun {
4897 fn request_options(&mut self) -> &mut crate::RequestOptions {
4898 &mut self.0.options
4899 }
4900 }
4901
4902 #[derive(Clone, Debug)]
4923 pub struct ListAutomationRuns(RequestBuilder<crate::model::ListAutomationRunsRequest>);
4924
4925 impl ListAutomationRuns {
4926 pub(crate) fn new(
4927 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4928 ) -> Self {
4929 Self(RequestBuilder::new(stub))
4930 }
4931
4932 pub fn with_request<V: Into<crate::model::ListAutomationRunsRequest>>(
4934 mut self,
4935 v: V,
4936 ) -> Self {
4937 self.0.request = v.into();
4938 self
4939 }
4940
4941 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4943 self.0.options = v.into();
4944 self
4945 }
4946
4947 pub async fn send(self) -> Result<crate::model::ListAutomationRunsResponse> {
4949 (*self.0.stub)
4950 .list_automation_runs(self.0.request, self.0.options)
4951 .await
4952 .map(crate::Response::into_body)
4953 }
4954
4955 pub fn by_page(
4957 self,
4958 ) -> impl google_cloud_gax::paginator::Paginator<
4959 crate::model::ListAutomationRunsResponse,
4960 crate::Error,
4961 > {
4962 use std::clone::Clone;
4963 let token = self.0.request.page_token.clone();
4964 let execute = move |token: String| {
4965 let mut builder = self.clone();
4966 builder.0.request = builder.0.request.set_page_token(token);
4967 builder.send()
4968 };
4969 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4970 }
4971
4972 pub fn by_item(
4974 self,
4975 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4976 crate::model::ListAutomationRunsResponse,
4977 crate::Error,
4978 > {
4979 use google_cloud_gax::paginator::Paginator;
4980 self.by_page().items()
4981 }
4982
4983 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4987 self.0.request.parent = v.into();
4988 self
4989 }
4990
4991 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4993 self.0.request.page_size = v.into();
4994 self
4995 }
4996
4997 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4999 self.0.request.page_token = v.into();
5000 self
5001 }
5002
5003 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5005 self.0.request.filter = v.into();
5006 self
5007 }
5008
5009 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5011 self.0.request.order_by = v.into();
5012 self
5013 }
5014 }
5015
5016 #[doc(hidden)]
5017 impl crate::RequestBuilder for ListAutomationRuns {
5018 fn request_options(&mut self) -> &mut crate::RequestOptions {
5019 &mut self.0.options
5020 }
5021 }
5022
5023 #[derive(Clone, Debug)]
5040 pub struct CancelAutomationRun(RequestBuilder<crate::model::CancelAutomationRunRequest>);
5041
5042 impl CancelAutomationRun {
5043 pub(crate) fn new(
5044 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5045 ) -> Self {
5046 Self(RequestBuilder::new(stub))
5047 }
5048
5049 pub fn with_request<V: Into<crate::model::CancelAutomationRunRequest>>(
5051 mut self,
5052 v: V,
5053 ) -> Self {
5054 self.0.request = v.into();
5055 self
5056 }
5057
5058 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5060 self.0.options = v.into();
5061 self
5062 }
5063
5064 pub async fn send(self) -> Result<crate::model::CancelAutomationRunResponse> {
5066 (*self.0.stub)
5067 .cancel_automation_run(self.0.request, self.0.options)
5068 .await
5069 .map(crate::Response::into_body)
5070 }
5071
5072 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5076 self.0.request.name = v.into();
5077 self
5078 }
5079 }
5080
5081 #[doc(hidden)]
5082 impl crate::RequestBuilder for CancelAutomationRun {
5083 fn request_options(&mut self) -> &mut crate::RequestOptions {
5084 &mut self.0.options
5085 }
5086 }
5087
5088 #[derive(Clone, Debug)]
5109 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
5110
5111 impl ListLocations {
5112 pub(crate) fn new(
5113 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5114 ) -> Self {
5115 Self(RequestBuilder::new(stub))
5116 }
5117
5118 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
5120 mut self,
5121 v: V,
5122 ) -> Self {
5123 self.0.request = v.into();
5124 self
5125 }
5126
5127 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5129 self.0.options = v.into();
5130 self
5131 }
5132
5133 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
5135 (*self.0.stub)
5136 .list_locations(self.0.request, self.0.options)
5137 .await
5138 .map(crate::Response::into_body)
5139 }
5140
5141 pub fn by_page(
5143 self,
5144 ) -> impl google_cloud_gax::paginator::Paginator<
5145 google_cloud_location::model::ListLocationsResponse,
5146 crate::Error,
5147 > {
5148 use std::clone::Clone;
5149 let token = self.0.request.page_token.clone();
5150 let execute = move |token: String| {
5151 let mut builder = self.clone();
5152 builder.0.request = builder.0.request.set_page_token(token);
5153 builder.send()
5154 };
5155 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5156 }
5157
5158 pub fn by_item(
5160 self,
5161 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5162 google_cloud_location::model::ListLocationsResponse,
5163 crate::Error,
5164 > {
5165 use google_cloud_gax::paginator::Paginator;
5166 self.by_page().items()
5167 }
5168
5169 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5171 self.0.request.name = v.into();
5172 self
5173 }
5174
5175 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5177 self.0.request.filter = v.into();
5178 self
5179 }
5180
5181 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5183 self.0.request.page_size = v.into();
5184 self
5185 }
5186
5187 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5189 self.0.request.page_token = v.into();
5190 self
5191 }
5192 }
5193
5194 #[doc(hidden)]
5195 impl crate::RequestBuilder for ListLocations {
5196 fn request_options(&mut self) -> &mut crate::RequestOptions {
5197 &mut self.0.options
5198 }
5199 }
5200
5201 #[derive(Clone, Debug)]
5218 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
5219
5220 impl GetLocation {
5221 pub(crate) fn new(
5222 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5223 ) -> Self {
5224 Self(RequestBuilder::new(stub))
5225 }
5226
5227 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
5229 mut self,
5230 v: V,
5231 ) -> Self {
5232 self.0.request = v.into();
5233 self
5234 }
5235
5236 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5238 self.0.options = v.into();
5239 self
5240 }
5241
5242 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
5244 (*self.0.stub)
5245 .get_location(self.0.request, self.0.options)
5246 .await
5247 .map(crate::Response::into_body)
5248 }
5249
5250 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5252 self.0.request.name = v.into();
5253 self
5254 }
5255 }
5256
5257 #[doc(hidden)]
5258 impl crate::RequestBuilder for GetLocation {
5259 fn request_options(&mut self) -> &mut crate::RequestOptions {
5260 &mut self.0.options
5261 }
5262 }
5263
5264 #[derive(Clone, Debug)]
5281 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
5282
5283 impl SetIamPolicy {
5284 pub(crate) fn new(
5285 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5286 ) -> Self {
5287 Self(RequestBuilder::new(stub))
5288 }
5289
5290 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
5292 mut self,
5293 v: V,
5294 ) -> Self {
5295 self.0.request = v.into();
5296 self
5297 }
5298
5299 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5301 self.0.options = v.into();
5302 self
5303 }
5304
5305 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
5307 (*self.0.stub)
5308 .set_iam_policy(self.0.request, self.0.options)
5309 .await
5310 .map(crate::Response::into_body)
5311 }
5312
5313 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5317 self.0.request.resource = v.into();
5318 self
5319 }
5320
5321 pub fn set_policy<T>(mut self, v: T) -> Self
5325 where
5326 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
5327 {
5328 self.0.request.policy = std::option::Option::Some(v.into());
5329 self
5330 }
5331
5332 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5336 where
5337 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
5338 {
5339 self.0.request.policy = v.map(|x| x.into());
5340 self
5341 }
5342
5343 pub fn set_update_mask<T>(mut self, v: T) -> Self
5345 where
5346 T: std::convert::Into<wkt::FieldMask>,
5347 {
5348 self.0.request.update_mask = std::option::Option::Some(v.into());
5349 self
5350 }
5351
5352 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5354 where
5355 T: std::convert::Into<wkt::FieldMask>,
5356 {
5357 self.0.request.update_mask = v.map(|x| x.into());
5358 self
5359 }
5360 }
5361
5362 #[doc(hidden)]
5363 impl crate::RequestBuilder for SetIamPolicy {
5364 fn request_options(&mut self) -> &mut crate::RequestOptions {
5365 &mut self.0.options
5366 }
5367 }
5368
5369 #[derive(Clone, Debug)]
5386 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
5387
5388 impl GetIamPolicy {
5389 pub(crate) fn new(
5390 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5391 ) -> Self {
5392 Self(RequestBuilder::new(stub))
5393 }
5394
5395 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
5397 mut self,
5398 v: V,
5399 ) -> Self {
5400 self.0.request = v.into();
5401 self
5402 }
5403
5404 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5406 self.0.options = v.into();
5407 self
5408 }
5409
5410 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
5412 (*self.0.stub)
5413 .get_iam_policy(self.0.request, self.0.options)
5414 .await
5415 .map(crate::Response::into_body)
5416 }
5417
5418 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5422 self.0.request.resource = v.into();
5423 self
5424 }
5425
5426 pub fn set_options<T>(mut self, v: T) -> Self
5428 where
5429 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
5430 {
5431 self.0.request.options = std::option::Option::Some(v.into());
5432 self
5433 }
5434
5435 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5437 where
5438 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
5439 {
5440 self.0.request.options = v.map(|x| x.into());
5441 self
5442 }
5443 }
5444
5445 #[doc(hidden)]
5446 impl crate::RequestBuilder for GetIamPolicy {
5447 fn request_options(&mut self) -> &mut crate::RequestOptions {
5448 &mut self.0.options
5449 }
5450 }
5451
5452 #[derive(Clone, Debug)]
5469 pub struct TestIamPermissions(
5470 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
5471 );
5472
5473 impl TestIamPermissions {
5474 pub(crate) fn new(
5475 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5476 ) -> Self {
5477 Self(RequestBuilder::new(stub))
5478 }
5479
5480 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
5482 mut self,
5483 v: V,
5484 ) -> Self {
5485 self.0.request = v.into();
5486 self
5487 }
5488
5489 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5491 self.0.options = v.into();
5492 self
5493 }
5494
5495 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
5497 (*self.0.stub)
5498 .test_iam_permissions(self.0.request, self.0.options)
5499 .await
5500 .map(crate::Response::into_body)
5501 }
5502
5503 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5507 self.0.request.resource = v.into();
5508 self
5509 }
5510
5511 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5515 where
5516 T: std::iter::IntoIterator<Item = V>,
5517 V: std::convert::Into<std::string::String>,
5518 {
5519 use std::iter::Iterator;
5520 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5521 self
5522 }
5523 }
5524
5525 #[doc(hidden)]
5526 impl crate::RequestBuilder for TestIamPermissions {
5527 fn request_options(&mut self) -> &mut crate::RequestOptions {
5528 &mut self.0.options
5529 }
5530 }
5531
5532 #[derive(Clone, Debug)]
5553 pub struct ListOperations(
5554 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5555 );
5556
5557 impl ListOperations {
5558 pub(crate) fn new(
5559 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5560 ) -> Self {
5561 Self(RequestBuilder::new(stub))
5562 }
5563
5564 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5566 mut self,
5567 v: V,
5568 ) -> Self {
5569 self.0.request = v.into();
5570 self
5571 }
5572
5573 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5575 self.0.options = v.into();
5576 self
5577 }
5578
5579 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5581 (*self.0.stub)
5582 .list_operations(self.0.request, self.0.options)
5583 .await
5584 .map(crate::Response::into_body)
5585 }
5586
5587 pub fn by_page(
5589 self,
5590 ) -> impl google_cloud_gax::paginator::Paginator<
5591 google_cloud_longrunning::model::ListOperationsResponse,
5592 crate::Error,
5593 > {
5594 use std::clone::Clone;
5595 let token = self.0.request.page_token.clone();
5596 let execute = move |token: String| {
5597 let mut builder = self.clone();
5598 builder.0.request = builder.0.request.set_page_token(token);
5599 builder.send()
5600 };
5601 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5602 }
5603
5604 pub fn by_item(
5606 self,
5607 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5608 google_cloud_longrunning::model::ListOperationsResponse,
5609 crate::Error,
5610 > {
5611 use google_cloud_gax::paginator::Paginator;
5612 self.by_page().items()
5613 }
5614
5615 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5617 self.0.request.name = v.into();
5618 self
5619 }
5620
5621 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5623 self.0.request.filter = v.into();
5624 self
5625 }
5626
5627 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5629 self.0.request.page_size = v.into();
5630 self
5631 }
5632
5633 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5635 self.0.request.page_token = v.into();
5636 self
5637 }
5638
5639 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5641 self.0.request.return_partial_success = v.into();
5642 self
5643 }
5644 }
5645
5646 #[doc(hidden)]
5647 impl crate::RequestBuilder for ListOperations {
5648 fn request_options(&mut self) -> &mut crate::RequestOptions {
5649 &mut self.0.options
5650 }
5651 }
5652
5653 #[derive(Clone, Debug)]
5670 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5671
5672 impl GetOperation {
5673 pub(crate) fn new(
5674 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5675 ) -> Self {
5676 Self(RequestBuilder::new(stub))
5677 }
5678
5679 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5681 mut self,
5682 v: V,
5683 ) -> Self {
5684 self.0.request = v.into();
5685 self
5686 }
5687
5688 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5690 self.0.options = v.into();
5691 self
5692 }
5693
5694 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5696 (*self.0.stub)
5697 .get_operation(self.0.request, self.0.options)
5698 .await
5699 .map(crate::Response::into_body)
5700 }
5701
5702 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5704 self.0.request.name = v.into();
5705 self
5706 }
5707 }
5708
5709 #[doc(hidden)]
5710 impl crate::RequestBuilder for GetOperation {
5711 fn request_options(&mut self) -> &mut crate::RequestOptions {
5712 &mut self.0.options
5713 }
5714 }
5715
5716 #[derive(Clone, Debug)]
5733 pub struct DeleteOperation(
5734 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5735 );
5736
5737 impl DeleteOperation {
5738 pub(crate) fn new(
5739 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5740 ) -> Self {
5741 Self(RequestBuilder::new(stub))
5742 }
5743
5744 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5746 mut self,
5747 v: V,
5748 ) -> Self {
5749 self.0.request = v.into();
5750 self
5751 }
5752
5753 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5755 self.0.options = v.into();
5756 self
5757 }
5758
5759 pub async fn send(self) -> Result<()> {
5761 (*self.0.stub)
5762 .delete_operation(self.0.request, self.0.options)
5763 .await
5764 .map(crate::Response::into_body)
5765 }
5766
5767 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5769 self.0.request.name = v.into();
5770 self
5771 }
5772 }
5773
5774 #[doc(hidden)]
5775 impl crate::RequestBuilder for DeleteOperation {
5776 fn request_options(&mut self) -> &mut crate::RequestOptions {
5777 &mut self.0.options
5778 }
5779 }
5780
5781 #[derive(Clone, Debug)]
5798 pub struct CancelOperation(
5799 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5800 );
5801
5802 impl CancelOperation {
5803 pub(crate) fn new(
5804 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5805 ) -> Self {
5806 Self(RequestBuilder::new(stub))
5807 }
5808
5809 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5811 mut self,
5812 v: V,
5813 ) -> Self {
5814 self.0.request = v.into();
5815 self
5816 }
5817
5818 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5820 self.0.options = v.into();
5821 self
5822 }
5823
5824 pub async fn send(self) -> Result<()> {
5826 (*self.0.stub)
5827 .cancel_operation(self.0.request, self.0.options)
5828 .await
5829 .map(crate::Response::into_body)
5830 }
5831
5832 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5834 self.0.request.name = v.into();
5835 self
5836 }
5837 }
5838
5839 #[doc(hidden)]
5840 impl crate::RequestBuilder for CancelOperation {
5841 fn request_options(&mut self) -> &mut crate::RequestOptions {
5842 &mut self.0.options
5843 }
5844 }
5845}