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