1pub mod cloud_deploy {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::CloudDeploy;
38 pub struct Factory;
39 impl gax::client_builder::internal::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 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
96 pub struct ListDeliveryPipelines(RequestBuilder<crate::model::ListDeliveryPipelinesRequest>);
97
98 impl ListDeliveryPipelines {
99 pub(crate) fn new(
100 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
101 ) -> Self {
102 Self(RequestBuilder::new(stub))
103 }
104
105 pub fn with_request<V: Into<crate::model::ListDeliveryPipelinesRequest>>(
107 mut self,
108 v: V,
109 ) -> Self {
110 self.0.request = v.into();
111 self
112 }
113
114 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
116 self.0.options = v.into();
117 self
118 }
119
120 pub async fn send(self) -> Result<crate::model::ListDeliveryPipelinesResponse> {
122 (*self.0.stub)
123 .list_delivery_pipelines(self.0.request, self.0.options)
124 .await
125 .map(gax::response::Response::into_body)
126 }
127
128 pub fn by_page(
130 self,
131 ) -> impl gax::paginator::Paginator<crate::model::ListDeliveryPipelinesResponse, gax::error::Error>
132 {
133 use std::clone::Clone;
134 let token = self.0.request.page_token.clone();
135 let execute = move |token: String| {
136 let mut builder = self.clone();
137 builder.0.request = builder.0.request.set_page_token(token);
138 builder.send()
139 };
140 gax::paginator::internal::new_paginator(token, execute)
141 }
142
143 pub fn by_item(
145 self,
146 ) -> impl gax::paginator::ItemPaginator<
147 crate::model::ListDeliveryPipelinesResponse,
148 gax::error::Error,
149 > {
150 use gax::paginator::Paginator;
151 self.by_page().items()
152 }
153
154 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
158 self.0.request.parent = v.into();
159 self
160 }
161
162 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
164 self.0.request.page_size = v.into();
165 self
166 }
167
168 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.page_token = v.into();
171 self
172 }
173
174 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
176 self.0.request.filter = v.into();
177 self
178 }
179
180 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
182 self.0.request.order_by = v.into();
183 self
184 }
185 }
186
187 #[doc(hidden)]
188 impl gax::options::internal::RequestBuilder for ListDeliveryPipelines {
189 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
190 &mut self.0.options
191 }
192 }
193
194 #[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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for GetDeliveryPipeline {
255 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
256 &mut self.0.options
257 }
258 }
259
260 #[derive(Clone, Debug)]
279 pub struct CreateDeliveryPipeline(RequestBuilder<crate::model::CreateDeliveryPipelineRequest>);
280
281 impl CreateDeliveryPipeline {
282 pub(crate) fn new(
283 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
284 ) -> Self {
285 Self(RequestBuilder::new(stub))
286 }
287
288 pub fn with_request<V: Into<crate::model::CreateDeliveryPipelineRequest>>(
290 mut self,
291 v: V,
292 ) -> Self {
293 self.0.request = v.into();
294 self
295 }
296
297 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
299 self.0.options = v.into();
300 self
301 }
302
303 pub async fn send(self) -> Result<longrunning::model::Operation> {
310 (*self.0.stub)
311 .create_delivery_pipeline(self.0.request, self.0.options)
312 .await
313 .map(gax::response::Response::into_body)
314 }
315
316 pub fn poller(
318 self,
319 ) -> impl lro::Poller<crate::model::DeliveryPipeline, crate::model::OperationMetadata>
320 {
321 type Operation = lro::internal::Operation<
322 crate::model::DeliveryPipeline,
323 crate::model::OperationMetadata,
324 >;
325 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
326 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
327
328 let stub = self.0.stub.clone();
329 let mut options = self.0.options.clone();
330 options.set_retry_policy(gax::retry_policy::NeverRetry);
331 let query = move |name| {
332 let stub = stub.clone();
333 let options = options.clone();
334 async {
335 let op = GetOperation::new(stub)
336 .set_name(name)
337 .with_options(options)
338 .send()
339 .await?;
340 Ok(Operation::new(op))
341 }
342 };
343
344 let start = move || async {
345 let op = self.send().await?;
346 Ok(Operation::new(op))
347 };
348
349 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
350 }
351
352 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
356 self.0.request.parent = v.into();
357 self
358 }
359
360 pub fn set_delivery_pipeline_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
364 self.0.request.delivery_pipeline_id = v.into();
365 self
366 }
367
368 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
372 where
373 T: std::convert::Into<crate::model::DeliveryPipeline>,
374 {
375 self.0.request.delivery_pipeline = std::option::Option::Some(v.into());
376 self
377 }
378
379 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
383 where
384 T: std::convert::Into<crate::model::DeliveryPipeline>,
385 {
386 self.0.request.delivery_pipeline = v.map(|x| x.into());
387 self
388 }
389
390 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
392 self.0.request.request_id = v.into();
393 self
394 }
395
396 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
398 self.0.request.validate_only = v.into();
399 self
400 }
401 }
402
403 #[doc(hidden)]
404 impl gax::options::internal::RequestBuilder for CreateDeliveryPipeline {
405 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
406 &mut self.0.options
407 }
408 }
409
410 #[derive(Clone, Debug)]
429 pub struct UpdateDeliveryPipeline(RequestBuilder<crate::model::UpdateDeliveryPipelineRequest>);
430
431 impl UpdateDeliveryPipeline {
432 pub(crate) fn new(
433 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
434 ) -> Self {
435 Self(RequestBuilder::new(stub))
436 }
437
438 pub fn with_request<V: Into<crate::model::UpdateDeliveryPipelineRequest>>(
440 mut self,
441 v: V,
442 ) -> Self {
443 self.0.request = v.into();
444 self
445 }
446
447 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
449 self.0.options = v.into();
450 self
451 }
452
453 pub async fn send(self) -> Result<longrunning::model::Operation> {
460 (*self.0.stub)
461 .update_delivery_pipeline(self.0.request, self.0.options)
462 .await
463 .map(gax::response::Response::into_body)
464 }
465
466 pub fn poller(
468 self,
469 ) -> impl lro::Poller<crate::model::DeliveryPipeline, crate::model::OperationMetadata>
470 {
471 type Operation = lro::internal::Operation<
472 crate::model::DeliveryPipeline,
473 crate::model::OperationMetadata,
474 >;
475 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
476 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
477
478 let stub = self.0.stub.clone();
479 let mut options = self.0.options.clone();
480 options.set_retry_policy(gax::retry_policy::NeverRetry);
481 let query = move |name| {
482 let stub = stub.clone();
483 let options = options.clone();
484 async {
485 let op = GetOperation::new(stub)
486 .set_name(name)
487 .with_options(options)
488 .send()
489 .await?;
490 Ok(Operation::new(op))
491 }
492 };
493
494 let start = move || async {
495 let op = self.send().await?;
496 Ok(Operation::new(op))
497 };
498
499 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
500 }
501
502 pub fn set_update_mask<T>(mut self, v: T) -> Self
506 where
507 T: std::convert::Into<wkt::FieldMask>,
508 {
509 self.0.request.update_mask = std::option::Option::Some(v.into());
510 self
511 }
512
513 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
517 where
518 T: std::convert::Into<wkt::FieldMask>,
519 {
520 self.0.request.update_mask = v.map(|x| x.into());
521 self
522 }
523
524 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
528 where
529 T: std::convert::Into<crate::model::DeliveryPipeline>,
530 {
531 self.0.request.delivery_pipeline = std::option::Option::Some(v.into());
532 self
533 }
534
535 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
539 where
540 T: std::convert::Into<crate::model::DeliveryPipeline>,
541 {
542 self.0.request.delivery_pipeline = v.map(|x| x.into());
543 self
544 }
545
546 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
548 self.0.request.request_id = v.into();
549 self
550 }
551
552 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
554 self.0.request.allow_missing = v.into();
555 self
556 }
557
558 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
560 self.0.request.validate_only = v.into();
561 self
562 }
563 }
564
565 #[doc(hidden)]
566 impl gax::options::internal::RequestBuilder for UpdateDeliveryPipeline {
567 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
568 &mut self.0.options
569 }
570 }
571
572 #[derive(Clone, Debug)]
591 pub struct DeleteDeliveryPipeline(RequestBuilder<crate::model::DeleteDeliveryPipelineRequest>);
592
593 impl DeleteDeliveryPipeline {
594 pub(crate) fn new(
595 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
596 ) -> Self {
597 Self(RequestBuilder::new(stub))
598 }
599
600 pub fn with_request<V: Into<crate::model::DeleteDeliveryPipelineRequest>>(
602 mut self,
603 v: V,
604 ) -> Self {
605 self.0.request = v.into();
606 self
607 }
608
609 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
611 self.0.options = v.into();
612 self
613 }
614
615 pub async fn send(self) -> Result<longrunning::model::Operation> {
622 (*self.0.stub)
623 .delete_delivery_pipeline(self.0.request, self.0.options)
624 .await
625 .map(gax::response::Response::into_body)
626 }
627
628 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
630 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
631 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
632 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
633
634 let stub = self.0.stub.clone();
635 let mut options = self.0.options.clone();
636 options.set_retry_policy(gax::retry_policy::NeverRetry);
637 let query = move |name| {
638 let stub = stub.clone();
639 let options = options.clone();
640 async {
641 let op = GetOperation::new(stub)
642 .set_name(name)
643 .with_options(options)
644 .send()
645 .await?;
646 Ok(Operation::new(op))
647 }
648 };
649
650 let start = move || async {
651 let op = self.send().await?;
652 Ok(Operation::new(op))
653 };
654
655 lro::internal::new_unit_response_poller(
656 polling_error_policy,
657 polling_backoff_policy,
658 start,
659 query,
660 )
661 }
662
663 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
667 self.0.request.name = v.into();
668 self
669 }
670
671 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
673 self.0.request.request_id = v.into();
674 self
675 }
676
677 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
679 self.0.request.allow_missing = v.into();
680 self
681 }
682
683 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
685 self.0.request.validate_only = v.into();
686 self
687 }
688
689 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
691 self.0.request.force = v.into();
692 self
693 }
694
695 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
697 self.0.request.etag = v.into();
698 self
699 }
700 }
701
702 #[doc(hidden)]
703 impl gax::options::internal::RequestBuilder for DeleteDeliveryPipeline {
704 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
705 &mut self.0.options
706 }
707 }
708
709 #[derive(Clone, Debug)]
731 pub struct ListTargets(RequestBuilder<crate::model::ListTargetsRequest>);
732
733 impl ListTargets {
734 pub(crate) fn new(
735 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
736 ) -> Self {
737 Self(RequestBuilder::new(stub))
738 }
739
740 pub fn with_request<V: Into<crate::model::ListTargetsRequest>>(mut self, v: V) -> Self {
742 self.0.request = v.into();
743 self
744 }
745
746 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
748 self.0.options = v.into();
749 self
750 }
751
752 pub async fn send(self) -> Result<crate::model::ListTargetsResponse> {
754 (*self.0.stub)
755 .list_targets(self.0.request, self.0.options)
756 .await
757 .map(gax::response::Response::into_body)
758 }
759
760 pub fn by_page(
762 self,
763 ) -> impl gax::paginator::Paginator<crate::model::ListTargetsResponse, gax::error::Error>
764 {
765 use std::clone::Clone;
766 let token = self.0.request.page_token.clone();
767 let execute = move |token: String| {
768 let mut builder = self.clone();
769 builder.0.request = builder.0.request.set_page_token(token);
770 builder.send()
771 };
772 gax::paginator::internal::new_paginator(token, execute)
773 }
774
775 pub fn by_item(
777 self,
778 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTargetsResponse, gax::error::Error>
779 {
780 use gax::paginator::Paginator;
781 self.by_page().items()
782 }
783
784 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
788 self.0.request.parent = v.into();
789 self
790 }
791
792 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
794 self.0.request.page_size = v.into();
795 self
796 }
797
798 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
800 self.0.request.page_token = v.into();
801 self
802 }
803
804 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
806 self.0.request.filter = v.into();
807 self
808 }
809
810 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
812 self.0.request.order_by = v.into();
813 self
814 }
815 }
816
817 #[doc(hidden)]
818 impl gax::options::internal::RequestBuilder for ListTargets {
819 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
820 &mut self.0.options
821 }
822 }
823
824 #[derive(Clone, Debug)]
842 pub struct RollbackTarget(RequestBuilder<crate::model::RollbackTargetRequest>);
843
844 impl RollbackTarget {
845 pub(crate) fn new(
846 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
847 ) -> Self {
848 Self(RequestBuilder::new(stub))
849 }
850
851 pub fn with_request<V: Into<crate::model::RollbackTargetRequest>>(mut self, v: V) -> Self {
853 self.0.request = v.into();
854 self
855 }
856
857 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
859 self.0.options = v.into();
860 self
861 }
862
863 pub async fn send(self) -> Result<crate::model::RollbackTargetResponse> {
865 (*self.0.stub)
866 .rollback_target(self.0.request, self.0.options)
867 .await
868 .map(gax::response::Response::into_body)
869 }
870
871 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
875 self.0.request.name = v.into();
876 self
877 }
878
879 pub fn set_target_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
883 self.0.request.target_id = v.into();
884 self
885 }
886
887 pub fn set_rollout_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
891 self.0.request.rollout_id = v.into();
892 self
893 }
894
895 pub fn set_release_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
897 self.0.request.release_id = v.into();
898 self
899 }
900
901 pub fn set_rollout_to_roll_back<T: Into<std::string::String>>(mut self, v: T) -> Self {
903 self.0.request.rollout_to_roll_back = v.into();
904 self
905 }
906
907 pub fn set_rollback_config<T>(mut self, v: T) -> Self
909 where
910 T: std::convert::Into<crate::model::RollbackTargetConfig>,
911 {
912 self.0.request.rollback_config = std::option::Option::Some(v.into());
913 self
914 }
915
916 pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
918 where
919 T: std::convert::Into<crate::model::RollbackTargetConfig>,
920 {
921 self.0.request.rollback_config = v.map(|x| x.into());
922 self
923 }
924
925 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
927 self.0.request.validate_only = v.into();
928 self
929 }
930
931 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
933 where
934 T: std::iter::IntoIterator<Item = V>,
935 V: std::convert::Into<std::string::String>,
936 {
937 use std::iter::Iterator;
938 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
939 self
940 }
941 }
942
943 #[doc(hidden)]
944 impl gax::options::internal::RequestBuilder for RollbackTarget {
945 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
946 &mut self.0.options
947 }
948 }
949
950 #[derive(Clone, Debug)]
968 pub struct GetTarget(RequestBuilder<crate::model::GetTargetRequest>);
969
970 impl GetTarget {
971 pub(crate) fn new(
972 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
973 ) -> Self {
974 Self(RequestBuilder::new(stub))
975 }
976
977 pub fn with_request<V: Into<crate::model::GetTargetRequest>>(mut self, v: V) -> Self {
979 self.0.request = v.into();
980 self
981 }
982
983 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
985 self.0.options = v.into();
986 self
987 }
988
989 pub async fn send(self) -> Result<crate::model::Target> {
991 (*self.0.stub)
992 .get_target(self.0.request, self.0.options)
993 .await
994 .map(gax::response::Response::into_body)
995 }
996
997 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1001 self.0.request.name = v.into();
1002 self
1003 }
1004 }
1005
1006 #[doc(hidden)]
1007 impl gax::options::internal::RequestBuilder for GetTarget {
1008 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1009 &mut self.0.options
1010 }
1011 }
1012
1013 #[derive(Clone, Debug)]
1032 pub struct CreateTarget(RequestBuilder<crate::model::CreateTargetRequest>);
1033
1034 impl CreateTarget {
1035 pub(crate) fn new(
1036 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1037 ) -> Self {
1038 Self(RequestBuilder::new(stub))
1039 }
1040
1041 pub fn with_request<V: Into<crate::model::CreateTargetRequest>>(mut self, v: V) -> Self {
1043 self.0.request = v.into();
1044 self
1045 }
1046
1047 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1049 self.0.options = v.into();
1050 self
1051 }
1052
1053 pub async fn send(self) -> Result<longrunning::model::Operation> {
1060 (*self.0.stub)
1061 .create_target(self.0.request, self.0.options)
1062 .await
1063 .map(gax::response::Response::into_body)
1064 }
1065
1066 pub fn poller(
1068 self,
1069 ) -> impl lro::Poller<crate::model::Target, crate::model::OperationMetadata> {
1070 type Operation =
1071 lro::internal::Operation<crate::model::Target, crate::model::OperationMetadata>;
1072 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1073 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1074
1075 let stub = self.0.stub.clone();
1076 let mut options = self.0.options.clone();
1077 options.set_retry_policy(gax::retry_policy::NeverRetry);
1078 let query = move |name| {
1079 let stub = stub.clone();
1080 let options = options.clone();
1081 async {
1082 let op = GetOperation::new(stub)
1083 .set_name(name)
1084 .with_options(options)
1085 .send()
1086 .await?;
1087 Ok(Operation::new(op))
1088 }
1089 };
1090
1091 let start = move || async {
1092 let op = self.send().await?;
1093 Ok(Operation::new(op))
1094 };
1095
1096 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1097 }
1098
1099 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1103 self.0.request.parent = v.into();
1104 self
1105 }
1106
1107 pub fn set_target_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1111 self.0.request.target_id = v.into();
1112 self
1113 }
1114
1115 pub fn set_target<T>(mut self, v: T) -> Self
1119 where
1120 T: std::convert::Into<crate::model::Target>,
1121 {
1122 self.0.request.target = std::option::Option::Some(v.into());
1123 self
1124 }
1125
1126 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
1130 where
1131 T: std::convert::Into<crate::model::Target>,
1132 {
1133 self.0.request.target = v.map(|x| x.into());
1134 self
1135 }
1136
1137 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1139 self.0.request.request_id = v.into();
1140 self
1141 }
1142
1143 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1145 self.0.request.validate_only = v.into();
1146 self
1147 }
1148 }
1149
1150 #[doc(hidden)]
1151 impl gax::options::internal::RequestBuilder for CreateTarget {
1152 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1153 &mut self.0.options
1154 }
1155 }
1156
1157 #[derive(Clone, Debug)]
1176 pub struct UpdateTarget(RequestBuilder<crate::model::UpdateTargetRequest>);
1177
1178 impl UpdateTarget {
1179 pub(crate) fn new(
1180 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1181 ) -> Self {
1182 Self(RequestBuilder::new(stub))
1183 }
1184
1185 pub fn with_request<V: Into<crate::model::UpdateTargetRequest>>(mut self, v: V) -> Self {
1187 self.0.request = v.into();
1188 self
1189 }
1190
1191 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1193 self.0.options = v.into();
1194 self
1195 }
1196
1197 pub async fn send(self) -> Result<longrunning::model::Operation> {
1204 (*self.0.stub)
1205 .update_target(self.0.request, self.0.options)
1206 .await
1207 .map(gax::response::Response::into_body)
1208 }
1209
1210 pub fn poller(
1212 self,
1213 ) -> impl lro::Poller<crate::model::Target, crate::model::OperationMetadata> {
1214 type Operation =
1215 lro::internal::Operation<crate::model::Target, crate::model::OperationMetadata>;
1216 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1217 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1218
1219 let stub = self.0.stub.clone();
1220 let mut options = self.0.options.clone();
1221 options.set_retry_policy(gax::retry_policy::NeverRetry);
1222 let query = move |name| {
1223 let stub = stub.clone();
1224 let options = options.clone();
1225 async {
1226 let op = GetOperation::new(stub)
1227 .set_name(name)
1228 .with_options(options)
1229 .send()
1230 .await?;
1231 Ok(Operation::new(op))
1232 }
1233 };
1234
1235 let start = move || async {
1236 let op = self.send().await?;
1237 Ok(Operation::new(op))
1238 };
1239
1240 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1241 }
1242
1243 pub fn set_update_mask<T>(mut self, v: T) -> Self
1247 where
1248 T: std::convert::Into<wkt::FieldMask>,
1249 {
1250 self.0.request.update_mask = std::option::Option::Some(v.into());
1251 self
1252 }
1253
1254 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1258 where
1259 T: std::convert::Into<wkt::FieldMask>,
1260 {
1261 self.0.request.update_mask = v.map(|x| x.into());
1262 self
1263 }
1264
1265 pub fn set_target<T>(mut self, v: T) -> Self
1269 where
1270 T: std::convert::Into<crate::model::Target>,
1271 {
1272 self.0.request.target = std::option::Option::Some(v.into());
1273 self
1274 }
1275
1276 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
1280 where
1281 T: std::convert::Into<crate::model::Target>,
1282 {
1283 self.0.request.target = v.map(|x| x.into());
1284 self
1285 }
1286
1287 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1289 self.0.request.request_id = v.into();
1290 self
1291 }
1292
1293 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1295 self.0.request.allow_missing = v.into();
1296 self
1297 }
1298
1299 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1301 self.0.request.validate_only = v.into();
1302 self
1303 }
1304 }
1305
1306 #[doc(hidden)]
1307 impl gax::options::internal::RequestBuilder for UpdateTarget {
1308 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1309 &mut self.0.options
1310 }
1311 }
1312
1313 #[derive(Clone, Debug)]
1332 pub struct DeleteTarget(RequestBuilder<crate::model::DeleteTargetRequest>);
1333
1334 impl DeleteTarget {
1335 pub(crate) fn new(
1336 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1337 ) -> Self {
1338 Self(RequestBuilder::new(stub))
1339 }
1340
1341 pub fn with_request<V: Into<crate::model::DeleteTargetRequest>>(mut self, v: V) -> Self {
1343 self.0.request = v.into();
1344 self
1345 }
1346
1347 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1349 self.0.options = v.into();
1350 self
1351 }
1352
1353 pub async fn send(self) -> Result<longrunning::model::Operation> {
1360 (*self.0.stub)
1361 .delete_target(self.0.request, self.0.options)
1362 .await
1363 .map(gax::response::Response::into_body)
1364 }
1365
1366 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1368 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1369 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1370 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1371
1372 let stub = self.0.stub.clone();
1373 let mut options = self.0.options.clone();
1374 options.set_retry_policy(gax::retry_policy::NeverRetry);
1375 let query = move |name| {
1376 let stub = stub.clone();
1377 let options = options.clone();
1378 async {
1379 let op = GetOperation::new(stub)
1380 .set_name(name)
1381 .with_options(options)
1382 .send()
1383 .await?;
1384 Ok(Operation::new(op))
1385 }
1386 };
1387
1388 let start = move || async {
1389 let op = self.send().await?;
1390 Ok(Operation::new(op))
1391 };
1392
1393 lro::internal::new_unit_response_poller(
1394 polling_error_policy,
1395 polling_backoff_policy,
1396 start,
1397 query,
1398 )
1399 }
1400
1401 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1405 self.0.request.name = v.into();
1406 self
1407 }
1408
1409 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1411 self.0.request.request_id = v.into();
1412 self
1413 }
1414
1415 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1417 self.0.request.allow_missing = v.into();
1418 self
1419 }
1420
1421 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1423 self.0.request.validate_only = v.into();
1424 self
1425 }
1426
1427 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1429 self.0.request.etag = v.into();
1430 self
1431 }
1432 }
1433
1434 #[doc(hidden)]
1435 impl gax::options::internal::RequestBuilder for DeleteTarget {
1436 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1437 &mut self.0.options
1438 }
1439 }
1440
1441 #[derive(Clone, Debug)]
1463 pub struct ListCustomTargetTypes(RequestBuilder<crate::model::ListCustomTargetTypesRequest>);
1464
1465 impl ListCustomTargetTypes {
1466 pub(crate) fn new(
1467 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1468 ) -> Self {
1469 Self(RequestBuilder::new(stub))
1470 }
1471
1472 pub fn with_request<V: Into<crate::model::ListCustomTargetTypesRequest>>(
1474 mut self,
1475 v: V,
1476 ) -> Self {
1477 self.0.request = v.into();
1478 self
1479 }
1480
1481 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1483 self.0.options = v.into();
1484 self
1485 }
1486
1487 pub async fn send(self) -> Result<crate::model::ListCustomTargetTypesResponse> {
1489 (*self.0.stub)
1490 .list_custom_target_types(self.0.request, self.0.options)
1491 .await
1492 .map(gax::response::Response::into_body)
1493 }
1494
1495 pub fn by_page(
1497 self,
1498 ) -> impl gax::paginator::Paginator<crate::model::ListCustomTargetTypesResponse, gax::error::Error>
1499 {
1500 use std::clone::Clone;
1501 let token = self.0.request.page_token.clone();
1502 let execute = move |token: String| {
1503 let mut builder = self.clone();
1504 builder.0.request = builder.0.request.set_page_token(token);
1505 builder.send()
1506 };
1507 gax::paginator::internal::new_paginator(token, execute)
1508 }
1509
1510 pub fn by_item(
1512 self,
1513 ) -> impl gax::paginator::ItemPaginator<
1514 crate::model::ListCustomTargetTypesResponse,
1515 gax::error::Error,
1516 > {
1517 use gax::paginator::Paginator;
1518 self.by_page().items()
1519 }
1520
1521 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1525 self.0.request.parent = v.into();
1526 self
1527 }
1528
1529 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1531 self.0.request.page_size = v.into();
1532 self
1533 }
1534
1535 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1537 self.0.request.page_token = v.into();
1538 self
1539 }
1540
1541 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1543 self.0.request.filter = v.into();
1544 self
1545 }
1546
1547 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1549 self.0.request.order_by = v.into();
1550 self
1551 }
1552 }
1553
1554 #[doc(hidden)]
1555 impl gax::options::internal::RequestBuilder for ListCustomTargetTypes {
1556 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1557 &mut self.0.options
1558 }
1559 }
1560
1561 #[derive(Clone, Debug)]
1579 pub struct GetCustomTargetType(RequestBuilder<crate::model::GetCustomTargetTypeRequest>);
1580
1581 impl GetCustomTargetType {
1582 pub(crate) fn new(
1583 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1584 ) -> Self {
1585 Self(RequestBuilder::new(stub))
1586 }
1587
1588 pub fn with_request<V: Into<crate::model::GetCustomTargetTypeRequest>>(
1590 mut self,
1591 v: V,
1592 ) -> Self {
1593 self.0.request = v.into();
1594 self
1595 }
1596
1597 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1599 self.0.options = v.into();
1600 self
1601 }
1602
1603 pub async fn send(self) -> Result<crate::model::CustomTargetType> {
1605 (*self.0.stub)
1606 .get_custom_target_type(self.0.request, self.0.options)
1607 .await
1608 .map(gax::response::Response::into_body)
1609 }
1610
1611 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1615 self.0.request.name = v.into();
1616 self
1617 }
1618 }
1619
1620 #[doc(hidden)]
1621 impl gax::options::internal::RequestBuilder for GetCustomTargetType {
1622 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1623 &mut self.0.options
1624 }
1625 }
1626
1627 #[derive(Clone, Debug)]
1646 pub struct CreateCustomTargetType(RequestBuilder<crate::model::CreateCustomTargetTypeRequest>);
1647
1648 impl CreateCustomTargetType {
1649 pub(crate) fn new(
1650 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1651 ) -> Self {
1652 Self(RequestBuilder::new(stub))
1653 }
1654
1655 pub fn with_request<V: Into<crate::model::CreateCustomTargetTypeRequest>>(
1657 mut self,
1658 v: V,
1659 ) -> Self {
1660 self.0.request = v.into();
1661 self
1662 }
1663
1664 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1666 self.0.options = v.into();
1667 self
1668 }
1669
1670 pub async fn send(self) -> Result<longrunning::model::Operation> {
1677 (*self.0.stub)
1678 .create_custom_target_type(self.0.request, self.0.options)
1679 .await
1680 .map(gax::response::Response::into_body)
1681 }
1682
1683 pub fn poller(
1685 self,
1686 ) -> impl lro::Poller<crate::model::CustomTargetType, crate::model::OperationMetadata>
1687 {
1688 type Operation = lro::internal::Operation<
1689 crate::model::CustomTargetType,
1690 crate::model::OperationMetadata,
1691 >;
1692 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1693 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1694
1695 let stub = self.0.stub.clone();
1696 let mut options = self.0.options.clone();
1697 options.set_retry_policy(gax::retry_policy::NeverRetry);
1698 let query = move |name| {
1699 let stub = stub.clone();
1700 let options = options.clone();
1701 async {
1702 let op = GetOperation::new(stub)
1703 .set_name(name)
1704 .with_options(options)
1705 .send()
1706 .await?;
1707 Ok(Operation::new(op))
1708 }
1709 };
1710
1711 let start = move || async {
1712 let op = self.send().await?;
1713 Ok(Operation::new(op))
1714 };
1715
1716 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1717 }
1718
1719 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1723 self.0.request.parent = v.into();
1724 self
1725 }
1726
1727 pub fn set_custom_target_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1731 self.0.request.custom_target_type_id = v.into();
1732 self
1733 }
1734
1735 pub fn set_custom_target_type<T>(mut self, v: T) -> Self
1739 where
1740 T: std::convert::Into<crate::model::CustomTargetType>,
1741 {
1742 self.0.request.custom_target_type = std::option::Option::Some(v.into());
1743 self
1744 }
1745
1746 pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
1750 where
1751 T: std::convert::Into<crate::model::CustomTargetType>,
1752 {
1753 self.0.request.custom_target_type = v.map(|x| x.into());
1754 self
1755 }
1756
1757 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1759 self.0.request.request_id = v.into();
1760 self
1761 }
1762
1763 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1765 self.0.request.validate_only = v.into();
1766 self
1767 }
1768 }
1769
1770 #[doc(hidden)]
1771 impl gax::options::internal::RequestBuilder for CreateCustomTargetType {
1772 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1773 &mut self.0.options
1774 }
1775 }
1776
1777 #[derive(Clone, Debug)]
1796 pub struct UpdateCustomTargetType(RequestBuilder<crate::model::UpdateCustomTargetTypeRequest>);
1797
1798 impl UpdateCustomTargetType {
1799 pub(crate) fn new(
1800 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1801 ) -> Self {
1802 Self(RequestBuilder::new(stub))
1803 }
1804
1805 pub fn with_request<V: Into<crate::model::UpdateCustomTargetTypeRequest>>(
1807 mut self,
1808 v: V,
1809 ) -> Self {
1810 self.0.request = v.into();
1811 self
1812 }
1813
1814 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1816 self.0.options = v.into();
1817 self
1818 }
1819
1820 pub async fn send(self) -> Result<longrunning::model::Operation> {
1827 (*self.0.stub)
1828 .update_custom_target_type(self.0.request, self.0.options)
1829 .await
1830 .map(gax::response::Response::into_body)
1831 }
1832
1833 pub fn poller(
1835 self,
1836 ) -> impl lro::Poller<crate::model::CustomTargetType, crate::model::OperationMetadata>
1837 {
1838 type Operation = lro::internal::Operation<
1839 crate::model::CustomTargetType,
1840 crate::model::OperationMetadata,
1841 >;
1842 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1843 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1844
1845 let stub = self.0.stub.clone();
1846 let mut options = self.0.options.clone();
1847 options.set_retry_policy(gax::retry_policy::NeverRetry);
1848 let query = move |name| {
1849 let stub = stub.clone();
1850 let options = options.clone();
1851 async {
1852 let op = GetOperation::new(stub)
1853 .set_name(name)
1854 .with_options(options)
1855 .send()
1856 .await?;
1857 Ok(Operation::new(op))
1858 }
1859 };
1860
1861 let start = move || async {
1862 let op = self.send().await?;
1863 Ok(Operation::new(op))
1864 };
1865
1866 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1867 }
1868
1869 pub fn set_update_mask<T>(mut self, v: T) -> Self
1873 where
1874 T: std::convert::Into<wkt::FieldMask>,
1875 {
1876 self.0.request.update_mask = std::option::Option::Some(v.into());
1877 self
1878 }
1879
1880 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1884 where
1885 T: std::convert::Into<wkt::FieldMask>,
1886 {
1887 self.0.request.update_mask = v.map(|x| x.into());
1888 self
1889 }
1890
1891 pub fn set_custom_target_type<T>(mut self, v: T) -> Self
1895 where
1896 T: std::convert::Into<crate::model::CustomTargetType>,
1897 {
1898 self.0.request.custom_target_type = std::option::Option::Some(v.into());
1899 self
1900 }
1901
1902 pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
1906 where
1907 T: std::convert::Into<crate::model::CustomTargetType>,
1908 {
1909 self.0.request.custom_target_type = v.map(|x| x.into());
1910 self
1911 }
1912
1913 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1915 self.0.request.request_id = v.into();
1916 self
1917 }
1918
1919 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1921 self.0.request.allow_missing = v.into();
1922 self
1923 }
1924
1925 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1927 self.0.request.validate_only = v.into();
1928 self
1929 }
1930 }
1931
1932 #[doc(hidden)]
1933 impl gax::options::internal::RequestBuilder for UpdateCustomTargetType {
1934 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1935 &mut self.0.options
1936 }
1937 }
1938
1939 #[derive(Clone, Debug)]
1958 pub struct DeleteCustomTargetType(RequestBuilder<crate::model::DeleteCustomTargetTypeRequest>);
1959
1960 impl DeleteCustomTargetType {
1961 pub(crate) fn new(
1962 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1963 ) -> Self {
1964 Self(RequestBuilder::new(stub))
1965 }
1966
1967 pub fn with_request<V: Into<crate::model::DeleteCustomTargetTypeRequest>>(
1969 mut self,
1970 v: V,
1971 ) -> Self {
1972 self.0.request = v.into();
1973 self
1974 }
1975
1976 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1978 self.0.options = v.into();
1979 self
1980 }
1981
1982 pub async fn send(self) -> Result<longrunning::model::Operation> {
1989 (*self.0.stub)
1990 .delete_custom_target_type(self.0.request, self.0.options)
1991 .await
1992 .map(gax::response::Response::into_body)
1993 }
1994
1995 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1997 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1998 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1999 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2000
2001 let stub = self.0.stub.clone();
2002 let mut options = self.0.options.clone();
2003 options.set_retry_policy(gax::retry_policy::NeverRetry);
2004 let query = move |name| {
2005 let stub = stub.clone();
2006 let options = options.clone();
2007 async {
2008 let op = GetOperation::new(stub)
2009 .set_name(name)
2010 .with_options(options)
2011 .send()
2012 .await?;
2013 Ok(Operation::new(op))
2014 }
2015 };
2016
2017 let start = move || async {
2018 let op = self.send().await?;
2019 Ok(Operation::new(op))
2020 };
2021
2022 lro::internal::new_unit_response_poller(
2023 polling_error_policy,
2024 polling_backoff_policy,
2025 start,
2026 query,
2027 )
2028 }
2029
2030 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2034 self.0.request.name = v.into();
2035 self
2036 }
2037
2038 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2040 self.0.request.request_id = v.into();
2041 self
2042 }
2043
2044 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2046 self.0.request.allow_missing = v.into();
2047 self
2048 }
2049
2050 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2052 self.0.request.validate_only = v.into();
2053 self
2054 }
2055
2056 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2058 self.0.request.etag = v.into();
2059 self
2060 }
2061 }
2062
2063 #[doc(hidden)]
2064 impl gax::options::internal::RequestBuilder for DeleteCustomTargetType {
2065 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2066 &mut self.0.options
2067 }
2068 }
2069
2070 #[derive(Clone, Debug)]
2092 pub struct ListReleases(RequestBuilder<crate::model::ListReleasesRequest>);
2093
2094 impl ListReleases {
2095 pub(crate) fn new(
2096 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2097 ) -> Self {
2098 Self(RequestBuilder::new(stub))
2099 }
2100
2101 pub fn with_request<V: Into<crate::model::ListReleasesRequest>>(mut self, v: V) -> Self {
2103 self.0.request = v.into();
2104 self
2105 }
2106
2107 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2109 self.0.options = v.into();
2110 self
2111 }
2112
2113 pub async fn send(self) -> Result<crate::model::ListReleasesResponse> {
2115 (*self.0.stub)
2116 .list_releases(self.0.request, self.0.options)
2117 .await
2118 .map(gax::response::Response::into_body)
2119 }
2120
2121 pub fn by_page(
2123 self,
2124 ) -> impl gax::paginator::Paginator<crate::model::ListReleasesResponse, gax::error::Error>
2125 {
2126 use std::clone::Clone;
2127 let token = self.0.request.page_token.clone();
2128 let execute = move |token: String| {
2129 let mut builder = self.clone();
2130 builder.0.request = builder.0.request.set_page_token(token);
2131 builder.send()
2132 };
2133 gax::paginator::internal::new_paginator(token, execute)
2134 }
2135
2136 pub fn by_item(
2138 self,
2139 ) -> impl gax::paginator::ItemPaginator<crate::model::ListReleasesResponse, gax::error::Error>
2140 {
2141 use gax::paginator::Paginator;
2142 self.by_page().items()
2143 }
2144
2145 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2149 self.0.request.parent = v.into();
2150 self
2151 }
2152
2153 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2155 self.0.request.page_size = v.into();
2156 self
2157 }
2158
2159 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2161 self.0.request.page_token = v.into();
2162 self
2163 }
2164
2165 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2167 self.0.request.filter = v.into();
2168 self
2169 }
2170
2171 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2173 self.0.request.order_by = v.into();
2174 self
2175 }
2176 }
2177
2178 #[doc(hidden)]
2179 impl gax::options::internal::RequestBuilder for ListReleases {
2180 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2181 &mut self.0.options
2182 }
2183 }
2184
2185 #[derive(Clone, Debug)]
2203 pub struct GetRelease(RequestBuilder<crate::model::GetReleaseRequest>);
2204
2205 impl GetRelease {
2206 pub(crate) fn new(
2207 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2208 ) -> Self {
2209 Self(RequestBuilder::new(stub))
2210 }
2211
2212 pub fn with_request<V: Into<crate::model::GetReleaseRequest>>(mut self, v: V) -> Self {
2214 self.0.request = v.into();
2215 self
2216 }
2217
2218 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2220 self.0.options = v.into();
2221 self
2222 }
2223
2224 pub async fn send(self) -> Result<crate::model::Release> {
2226 (*self.0.stub)
2227 .get_release(self.0.request, self.0.options)
2228 .await
2229 .map(gax::response::Response::into_body)
2230 }
2231
2232 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2236 self.0.request.name = v.into();
2237 self
2238 }
2239 }
2240
2241 #[doc(hidden)]
2242 impl gax::options::internal::RequestBuilder for GetRelease {
2243 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2244 &mut self.0.options
2245 }
2246 }
2247
2248 #[derive(Clone, Debug)]
2267 pub struct CreateRelease(RequestBuilder<crate::model::CreateReleaseRequest>);
2268
2269 impl CreateRelease {
2270 pub(crate) fn new(
2271 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2272 ) -> Self {
2273 Self(RequestBuilder::new(stub))
2274 }
2275
2276 pub fn with_request<V: Into<crate::model::CreateReleaseRequest>>(mut self, v: V) -> Self {
2278 self.0.request = v.into();
2279 self
2280 }
2281
2282 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2284 self.0.options = v.into();
2285 self
2286 }
2287
2288 pub async fn send(self) -> Result<longrunning::model::Operation> {
2295 (*self.0.stub)
2296 .create_release(self.0.request, self.0.options)
2297 .await
2298 .map(gax::response::Response::into_body)
2299 }
2300
2301 pub fn poller(
2303 self,
2304 ) -> impl lro::Poller<crate::model::Release, crate::model::OperationMetadata> {
2305 type Operation =
2306 lro::internal::Operation<crate::model::Release, crate::model::OperationMetadata>;
2307 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2308 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2309
2310 let stub = self.0.stub.clone();
2311 let mut options = self.0.options.clone();
2312 options.set_retry_policy(gax::retry_policy::NeverRetry);
2313 let query = move |name| {
2314 let stub = stub.clone();
2315 let options = options.clone();
2316 async {
2317 let op = GetOperation::new(stub)
2318 .set_name(name)
2319 .with_options(options)
2320 .send()
2321 .await?;
2322 Ok(Operation::new(op))
2323 }
2324 };
2325
2326 let start = move || async {
2327 let op = self.send().await?;
2328 Ok(Operation::new(op))
2329 };
2330
2331 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2332 }
2333
2334 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2338 self.0.request.parent = v.into();
2339 self
2340 }
2341
2342 pub fn set_release_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2346 self.0.request.release_id = v.into();
2347 self
2348 }
2349
2350 pub fn set_release<T>(mut self, v: T) -> Self
2354 where
2355 T: std::convert::Into<crate::model::Release>,
2356 {
2357 self.0.request.release = std::option::Option::Some(v.into());
2358 self
2359 }
2360
2361 pub fn set_or_clear_release<T>(mut self, v: std::option::Option<T>) -> Self
2365 where
2366 T: std::convert::Into<crate::model::Release>,
2367 {
2368 self.0.request.release = v.map(|x| x.into());
2369 self
2370 }
2371
2372 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2374 self.0.request.request_id = v.into();
2375 self
2376 }
2377
2378 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2380 self.0.request.validate_only = v.into();
2381 self
2382 }
2383
2384 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
2386 where
2387 T: std::iter::IntoIterator<Item = V>,
2388 V: std::convert::Into<std::string::String>,
2389 {
2390 use std::iter::Iterator;
2391 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
2392 self
2393 }
2394 }
2395
2396 #[doc(hidden)]
2397 impl gax::options::internal::RequestBuilder for CreateRelease {
2398 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2399 &mut self.0.options
2400 }
2401 }
2402
2403 #[derive(Clone, Debug)]
2421 pub struct AbandonRelease(RequestBuilder<crate::model::AbandonReleaseRequest>);
2422
2423 impl AbandonRelease {
2424 pub(crate) fn new(
2425 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2426 ) -> Self {
2427 Self(RequestBuilder::new(stub))
2428 }
2429
2430 pub fn with_request<V: Into<crate::model::AbandonReleaseRequest>>(mut self, v: V) -> Self {
2432 self.0.request = v.into();
2433 self
2434 }
2435
2436 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2438 self.0.options = v.into();
2439 self
2440 }
2441
2442 pub async fn send(self) -> Result<crate::model::AbandonReleaseResponse> {
2444 (*self.0.stub)
2445 .abandon_release(self.0.request, self.0.options)
2446 .await
2447 .map(gax::response::Response::into_body)
2448 }
2449
2450 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2454 self.0.request.name = v.into();
2455 self
2456 }
2457 }
2458
2459 #[doc(hidden)]
2460 impl gax::options::internal::RequestBuilder for AbandonRelease {
2461 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2462 &mut self.0.options
2463 }
2464 }
2465
2466 #[derive(Clone, Debug)]
2485 pub struct CreateDeployPolicy(RequestBuilder<crate::model::CreateDeployPolicyRequest>);
2486
2487 impl CreateDeployPolicy {
2488 pub(crate) fn new(
2489 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2490 ) -> Self {
2491 Self(RequestBuilder::new(stub))
2492 }
2493
2494 pub fn with_request<V: Into<crate::model::CreateDeployPolicyRequest>>(
2496 mut self,
2497 v: V,
2498 ) -> Self {
2499 self.0.request = v.into();
2500 self
2501 }
2502
2503 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2505 self.0.options = v.into();
2506 self
2507 }
2508
2509 pub async fn send(self) -> Result<longrunning::model::Operation> {
2516 (*self.0.stub)
2517 .create_deploy_policy(self.0.request, self.0.options)
2518 .await
2519 .map(gax::response::Response::into_body)
2520 }
2521
2522 pub fn poller(
2524 self,
2525 ) -> impl lro::Poller<crate::model::DeployPolicy, crate::model::OperationMetadata> {
2526 type Operation = lro::internal::Operation<
2527 crate::model::DeployPolicy,
2528 crate::model::OperationMetadata,
2529 >;
2530 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2531 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2532
2533 let stub = self.0.stub.clone();
2534 let mut options = self.0.options.clone();
2535 options.set_retry_policy(gax::retry_policy::NeverRetry);
2536 let query = move |name| {
2537 let stub = stub.clone();
2538 let options = options.clone();
2539 async {
2540 let op = GetOperation::new(stub)
2541 .set_name(name)
2542 .with_options(options)
2543 .send()
2544 .await?;
2545 Ok(Operation::new(op))
2546 }
2547 };
2548
2549 let start = move || async {
2550 let op = self.send().await?;
2551 Ok(Operation::new(op))
2552 };
2553
2554 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2555 }
2556
2557 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2561 self.0.request.parent = v.into();
2562 self
2563 }
2564
2565 pub fn set_deploy_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2569 self.0.request.deploy_policy_id = v.into();
2570 self
2571 }
2572
2573 pub fn set_deploy_policy<T>(mut self, v: T) -> Self
2577 where
2578 T: std::convert::Into<crate::model::DeployPolicy>,
2579 {
2580 self.0.request.deploy_policy = std::option::Option::Some(v.into());
2581 self
2582 }
2583
2584 pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
2588 where
2589 T: std::convert::Into<crate::model::DeployPolicy>,
2590 {
2591 self.0.request.deploy_policy = v.map(|x| x.into());
2592 self
2593 }
2594
2595 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2597 self.0.request.request_id = v.into();
2598 self
2599 }
2600
2601 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2603 self.0.request.validate_only = v.into();
2604 self
2605 }
2606 }
2607
2608 #[doc(hidden)]
2609 impl gax::options::internal::RequestBuilder for CreateDeployPolicy {
2610 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2611 &mut self.0.options
2612 }
2613 }
2614
2615 #[derive(Clone, Debug)]
2634 pub struct UpdateDeployPolicy(RequestBuilder<crate::model::UpdateDeployPolicyRequest>);
2635
2636 impl UpdateDeployPolicy {
2637 pub(crate) fn new(
2638 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2639 ) -> Self {
2640 Self(RequestBuilder::new(stub))
2641 }
2642
2643 pub fn with_request<V: Into<crate::model::UpdateDeployPolicyRequest>>(
2645 mut self,
2646 v: V,
2647 ) -> Self {
2648 self.0.request = v.into();
2649 self
2650 }
2651
2652 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2654 self.0.options = v.into();
2655 self
2656 }
2657
2658 pub async fn send(self) -> Result<longrunning::model::Operation> {
2665 (*self.0.stub)
2666 .update_deploy_policy(self.0.request, self.0.options)
2667 .await
2668 .map(gax::response::Response::into_body)
2669 }
2670
2671 pub fn poller(
2673 self,
2674 ) -> impl lro::Poller<crate::model::DeployPolicy, crate::model::OperationMetadata> {
2675 type Operation = lro::internal::Operation<
2676 crate::model::DeployPolicy,
2677 crate::model::OperationMetadata,
2678 >;
2679 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2680 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2681
2682 let stub = self.0.stub.clone();
2683 let mut options = self.0.options.clone();
2684 options.set_retry_policy(gax::retry_policy::NeverRetry);
2685 let query = move |name| {
2686 let stub = stub.clone();
2687 let options = options.clone();
2688 async {
2689 let op = GetOperation::new(stub)
2690 .set_name(name)
2691 .with_options(options)
2692 .send()
2693 .await?;
2694 Ok(Operation::new(op))
2695 }
2696 };
2697
2698 let start = move || async {
2699 let op = self.send().await?;
2700 Ok(Operation::new(op))
2701 };
2702
2703 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2704 }
2705
2706 pub fn set_update_mask<T>(mut self, v: T) -> Self
2710 where
2711 T: std::convert::Into<wkt::FieldMask>,
2712 {
2713 self.0.request.update_mask = std::option::Option::Some(v.into());
2714 self
2715 }
2716
2717 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2721 where
2722 T: std::convert::Into<wkt::FieldMask>,
2723 {
2724 self.0.request.update_mask = v.map(|x| x.into());
2725 self
2726 }
2727
2728 pub fn set_deploy_policy<T>(mut self, v: T) -> Self
2732 where
2733 T: std::convert::Into<crate::model::DeployPolicy>,
2734 {
2735 self.0.request.deploy_policy = std::option::Option::Some(v.into());
2736 self
2737 }
2738
2739 pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
2743 where
2744 T: std::convert::Into<crate::model::DeployPolicy>,
2745 {
2746 self.0.request.deploy_policy = v.map(|x| x.into());
2747 self
2748 }
2749
2750 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2752 self.0.request.request_id = v.into();
2753 self
2754 }
2755
2756 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2758 self.0.request.allow_missing = v.into();
2759 self
2760 }
2761
2762 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2764 self.0.request.validate_only = v.into();
2765 self
2766 }
2767 }
2768
2769 #[doc(hidden)]
2770 impl gax::options::internal::RequestBuilder for UpdateDeployPolicy {
2771 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2772 &mut self.0.options
2773 }
2774 }
2775
2776 #[derive(Clone, Debug)]
2795 pub struct DeleteDeployPolicy(RequestBuilder<crate::model::DeleteDeployPolicyRequest>);
2796
2797 impl DeleteDeployPolicy {
2798 pub(crate) fn new(
2799 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2800 ) -> Self {
2801 Self(RequestBuilder::new(stub))
2802 }
2803
2804 pub fn with_request<V: Into<crate::model::DeleteDeployPolicyRequest>>(
2806 mut self,
2807 v: V,
2808 ) -> Self {
2809 self.0.request = v.into();
2810 self
2811 }
2812
2813 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2815 self.0.options = v.into();
2816 self
2817 }
2818
2819 pub async fn send(self) -> Result<longrunning::model::Operation> {
2826 (*self.0.stub)
2827 .delete_deploy_policy(self.0.request, self.0.options)
2828 .await
2829 .map(gax::response::Response::into_body)
2830 }
2831
2832 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2834 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2835 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2836 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2837
2838 let stub = self.0.stub.clone();
2839 let mut options = self.0.options.clone();
2840 options.set_retry_policy(gax::retry_policy::NeverRetry);
2841 let query = move |name| {
2842 let stub = stub.clone();
2843 let options = options.clone();
2844 async {
2845 let op = GetOperation::new(stub)
2846 .set_name(name)
2847 .with_options(options)
2848 .send()
2849 .await?;
2850 Ok(Operation::new(op))
2851 }
2852 };
2853
2854 let start = move || async {
2855 let op = self.send().await?;
2856 Ok(Operation::new(op))
2857 };
2858
2859 lro::internal::new_unit_response_poller(
2860 polling_error_policy,
2861 polling_backoff_policy,
2862 start,
2863 query,
2864 )
2865 }
2866
2867 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2871 self.0.request.name = v.into();
2872 self
2873 }
2874
2875 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2877 self.0.request.request_id = v.into();
2878 self
2879 }
2880
2881 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2883 self.0.request.allow_missing = v.into();
2884 self
2885 }
2886
2887 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2889 self.0.request.validate_only = v.into();
2890 self
2891 }
2892
2893 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2895 self.0.request.etag = v.into();
2896 self
2897 }
2898 }
2899
2900 #[doc(hidden)]
2901 impl gax::options::internal::RequestBuilder for DeleteDeployPolicy {
2902 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2903 &mut self.0.options
2904 }
2905 }
2906
2907 #[derive(Clone, Debug)]
2929 pub struct ListDeployPolicies(RequestBuilder<crate::model::ListDeployPoliciesRequest>);
2930
2931 impl ListDeployPolicies {
2932 pub(crate) fn new(
2933 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2934 ) -> Self {
2935 Self(RequestBuilder::new(stub))
2936 }
2937
2938 pub fn with_request<V: Into<crate::model::ListDeployPoliciesRequest>>(
2940 mut self,
2941 v: V,
2942 ) -> Self {
2943 self.0.request = v.into();
2944 self
2945 }
2946
2947 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2949 self.0.options = v.into();
2950 self
2951 }
2952
2953 pub async fn send(self) -> Result<crate::model::ListDeployPoliciesResponse> {
2955 (*self.0.stub)
2956 .list_deploy_policies(self.0.request, self.0.options)
2957 .await
2958 .map(gax::response::Response::into_body)
2959 }
2960
2961 pub fn by_page(
2963 self,
2964 ) -> impl gax::paginator::Paginator<crate::model::ListDeployPoliciesResponse, gax::error::Error>
2965 {
2966 use std::clone::Clone;
2967 let token = self.0.request.page_token.clone();
2968 let execute = move |token: String| {
2969 let mut builder = self.clone();
2970 builder.0.request = builder.0.request.set_page_token(token);
2971 builder.send()
2972 };
2973 gax::paginator::internal::new_paginator(token, execute)
2974 }
2975
2976 pub fn by_item(
2978 self,
2979 ) -> impl gax::paginator::ItemPaginator<
2980 crate::model::ListDeployPoliciesResponse,
2981 gax::error::Error,
2982 > {
2983 use gax::paginator::Paginator;
2984 self.by_page().items()
2985 }
2986
2987 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2991 self.0.request.parent = v.into();
2992 self
2993 }
2994
2995 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2997 self.0.request.page_size = v.into();
2998 self
2999 }
3000
3001 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3003 self.0.request.page_token = v.into();
3004 self
3005 }
3006
3007 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3009 self.0.request.filter = v.into();
3010 self
3011 }
3012
3013 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3015 self.0.request.order_by = v.into();
3016 self
3017 }
3018 }
3019
3020 #[doc(hidden)]
3021 impl gax::options::internal::RequestBuilder for ListDeployPolicies {
3022 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3023 &mut self.0.options
3024 }
3025 }
3026
3027 #[derive(Clone, Debug)]
3045 pub struct GetDeployPolicy(RequestBuilder<crate::model::GetDeployPolicyRequest>);
3046
3047 impl GetDeployPolicy {
3048 pub(crate) fn new(
3049 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3050 ) -> Self {
3051 Self(RequestBuilder::new(stub))
3052 }
3053
3054 pub fn with_request<V: Into<crate::model::GetDeployPolicyRequest>>(mut self, v: V) -> Self {
3056 self.0.request = v.into();
3057 self
3058 }
3059
3060 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3062 self.0.options = v.into();
3063 self
3064 }
3065
3066 pub async fn send(self) -> Result<crate::model::DeployPolicy> {
3068 (*self.0.stub)
3069 .get_deploy_policy(self.0.request, self.0.options)
3070 .await
3071 .map(gax::response::Response::into_body)
3072 }
3073
3074 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3078 self.0.request.name = v.into();
3079 self
3080 }
3081 }
3082
3083 #[doc(hidden)]
3084 impl gax::options::internal::RequestBuilder for GetDeployPolicy {
3085 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3086 &mut self.0.options
3087 }
3088 }
3089
3090 #[derive(Clone, Debug)]
3108 pub struct ApproveRollout(RequestBuilder<crate::model::ApproveRolloutRequest>);
3109
3110 impl ApproveRollout {
3111 pub(crate) fn new(
3112 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3113 ) -> Self {
3114 Self(RequestBuilder::new(stub))
3115 }
3116
3117 pub fn with_request<V: Into<crate::model::ApproveRolloutRequest>>(mut self, v: V) -> Self {
3119 self.0.request = v.into();
3120 self
3121 }
3122
3123 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3125 self.0.options = v.into();
3126 self
3127 }
3128
3129 pub async fn send(self) -> Result<crate::model::ApproveRolloutResponse> {
3131 (*self.0.stub)
3132 .approve_rollout(self.0.request, self.0.options)
3133 .await
3134 .map(gax::response::Response::into_body)
3135 }
3136
3137 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3141 self.0.request.name = v.into();
3142 self
3143 }
3144
3145 pub fn set_approved<T: Into<bool>>(mut self, v: T) -> Self {
3149 self.0.request.approved = v.into();
3150 self
3151 }
3152
3153 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3155 where
3156 T: std::iter::IntoIterator<Item = V>,
3157 V: std::convert::Into<std::string::String>,
3158 {
3159 use std::iter::Iterator;
3160 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3161 self
3162 }
3163 }
3164
3165 #[doc(hidden)]
3166 impl gax::options::internal::RequestBuilder for ApproveRollout {
3167 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3168 &mut self.0.options
3169 }
3170 }
3171
3172 #[derive(Clone, Debug)]
3190 pub struct AdvanceRollout(RequestBuilder<crate::model::AdvanceRolloutRequest>);
3191
3192 impl AdvanceRollout {
3193 pub(crate) fn new(
3194 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3195 ) -> Self {
3196 Self(RequestBuilder::new(stub))
3197 }
3198
3199 pub fn with_request<V: Into<crate::model::AdvanceRolloutRequest>>(mut self, v: V) -> Self {
3201 self.0.request = v.into();
3202 self
3203 }
3204
3205 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3207 self.0.options = v.into();
3208 self
3209 }
3210
3211 pub async fn send(self) -> Result<crate::model::AdvanceRolloutResponse> {
3213 (*self.0.stub)
3214 .advance_rollout(self.0.request, self.0.options)
3215 .await
3216 .map(gax::response::Response::into_body)
3217 }
3218
3219 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3223 self.0.request.name = v.into();
3224 self
3225 }
3226
3227 pub fn set_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3231 self.0.request.phase_id = v.into();
3232 self
3233 }
3234
3235 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3237 where
3238 T: std::iter::IntoIterator<Item = V>,
3239 V: std::convert::Into<std::string::String>,
3240 {
3241 use std::iter::Iterator;
3242 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3243 self
3244 }
3245 }
3246
3247 #[doc(hidden)]
3248 impl gax::options::internal::RequestBuilder for AdvanceRollout {
3249 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3250 &mut self.0.options
3251 }
3252 }
3253
3254 #[derive(Clone, Debug)]
3272 pub struct CancelRollout(RequestBuilder<crate::model::CancelRolloutRequest>);
3273
3274 impl CancelRollout {
3275 pub(crate) fn new(
3276 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3277 ) -> Self {
3278 Self(RequestBuilder::new(stub))
3279 }
3280
3281 pub fn with_request<V: Into<crate::model::CancelRolloutRequest>>(mut self, v: V) -> Self {
3283 self.0.request = v.into();
3284 self
3285 }
3286
3287 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3289 self.0.options = v.into();
3290 self
3291 }
3292
3293 pub async fn send(self) -> Result<crate::model::CancelRolloutResponse> {
3295 (*self.0.stub)
3296 .cancel_rollout(self.0.request, self.0.options)
3297 .await
3298 .map(gax::response::Response::into_body)
3299 }
3300
3301 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3305 self.0.request.name = v.into();
3306 self
3307 }
3308
3309 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3311 where
3312 T: std::iter::IntoIterator<Item = V>,
3313 V: std::convert::Into<std::string::String>,
3314 {
3315 use std::iter::Iterator;
3316 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3317 self
3318 }
3319 }
3320
3321 #[doc(hidden)]
3322 impl gax::options::internal::RequestBuilder for CancelRollout {
3323 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3324 &mut self.0.options
3325 }
3326 }
3327
3328 #[derive(Clone, Debug)]
3350 pub struct ListRollouts(RequestBuilder<crate::model::ListRolloutsRequest>);
3351
3352 impl ListRollouts {
3353 pub(crate) fn new(
3354 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3355 ) -> Self {
3356 Self(RequestBuilder::new(stub))
3357 }
3358
3359 pub fn with_request<V: Into<crate::model::ListRolloutsRequest>>(mut self, v: V) -> Self {
3361 self.0.request = v.into();
3362 self
3363 }
3364
3365 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3367 self.0.options = v.into();
3368 self
3369 }
3370
3371 pub async fn send(self) -> Result<crate::model::ListRolloutsResponse> {
3373 (*self.0.stub)
3374 .list_rollouts(self.0.request, self.0.options)
3375 .await
3376 .map(gax::response::Response::into_body)
3377 }
3378
3379 pub fn by_page(
3381 self,
3382 ) -> impl gax::paginator::Paginator<crate::model::ListRolloutsResponse, gax::error::Error>
3383 {
3384 use std::clone::Clone;
3385 let token = self.0.request.page_token.clone();
3386 let execute = move |token: String| {
3387 let mut builder = self.clone();
3388 builder.0.request = builder.0.request.set_page_token(token);
3389 builder.send()
3390 };
3391 gax::paginator::internal::new_paginator(token, execute)
3392 }
3393
3394 pub fn by_item(
3396 self,
3397 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRolloutsResponse, gax::error::Error>
3398 {
3399 use gax::paginator::Paginator;
3400 self.by_page().items()
3401 }
3402
3403 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3407 self.0.request.parent = v.into();
3408 self
3409 }
3410
3411 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3413 self.0.request.page_size = v.into();
3414 self
3415 }
3416
3417 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3419 self.0.request.page_token = v.into();
3420 self
3421 }
3422
3423 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3425 self.0.request.filter = v.into();
3426 self
3427 }
3428
3429 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3431 self.0.request.order_by = v.into();
3432 self
3433 }
3434 }
3435
3436 #[doc(hidden)]
3437 impl gax::options::internal::RequestBuilder for ListRollouts {
3438 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3439 &mut self.0.options
3440 }
3441 }
3442
3443 #[derive(Clone, Debug)]
3461 pub struct GetRollout(RequestBuilder<crate::model::GetRolloutRequest>);
3462
3463 impl GetRollout {
3464 pub(crate) fn new(
3465 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3466 ) -> Self {
3467 Self(RequestBuilder::new(stub))
3468 }
3469
3470 pub fn with_request<V: Into<crate::model::GetRolloutRequest>>(mut self, v: V) -> Self {
3472 self.0.request = v.into();
3473 self
3474 }
3475
3476 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3478 self.0.options = v.into();
3479 self
3480 }
3481
3482 pub async fn send(self) -> Result<crate::model::Rollout> {
3484 (*self.0.stub)
3485 .get_rollout(self.0.request, self.0.options)
3486 .await
3487 .map(gax::response::Response::into_body)
3488 }
3489
3490 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3494 self.0.request.name = v.into();
3495 self
3496 }
3497 }
3498
3499 #[doc(hidden)]
3500 impl gax::options::internal::RequestBuilder for GetRollout {
3501 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3502 &mut self.0.options
3503 }
3504 }
3505
3506 #[derive(Clone, Debug)]
3525 pub struct CreateRollout(RequestBuilder<crate::model::CreateRolloutRequest>);
3526
3527 impl CreateRollout {
3528 pub(crate) fn new(
3529 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3530 ) -> Self {
3531 Self(RequestBuilder::new(stub))
3532 }
3533
3534 pub fn with_request<V: Into<crate::model::CreateRolloutRequest>>(mut self, v: V) -> Self {
3536 self.0.request = v.into();
3537 self
3538 }
3539
3540 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3542 self.0.options = v.into();
3543 self
3544 }
3545
3546 pub async fn send(self) -> Result<longrunning::model::Operation> {
3553 (*self.0.stub)
3554 .create_rollout(self.0.request, self.0.options)
3555 .await
3556 .map(gax::response::Response::into_body)
3557 }
3558
3559 pub fn poller(
3561 self,
3562 ) -> impl lro::Poller<crate::model::Rollout, crate::model::OperationMetadata> {
3563 type Operation =
3564 lro::internal::Operation<crate::model::Rollout, crate::model::OperationMetadata>;
3565 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3566 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3567
3568 let stub = self.0.stub.clone();
3569 let mut options = self.0.options.clone();
3570 options.set_retry_policy(gax::retry_policy::NeverRetry);
3571 let query = move |name| {
3572 let stub = stub.clone();
3573 let options = options.clone();
3574 async {
3575 let op = GetOperation::new(stub)
3576 .set_name(name)
3577 .with_options(options)
3578 .send()
3579 .await?;
3580 Ok(Operation::new(op))
3581 }
3582 };
3583
3584 let start = move || async {
3585 let op = self.send().await?;
3586 Ok(Operation::new(op))
3587 };
3588
3589 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3590 }
3591
3592 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3596 self.0.request.parent = v.into();
3597 self
3598 }
3599
3600 pub fn set_rollout_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3604 self.0.request.rollout_id = v.into();
3605 self
3606 }
3607
3608 pub fn set_rollout<T>(mut self, v: T) -> Self
3612 where
3613 T: std::convert::Into<crate::model::Rollout>,
3614 {
3615 self.0.request.rollout = std::option::Option::Some(v.into());
3616 self
3617 }
3618
3619 pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
3623 where
3624 T: std::convert::Into<crate::model::Rollout>,
3625 {
3626 self.0.request.rollout = v.map(|x| x.into());
3627 self
3628 }
3629
3630 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3632 self.0.request.request_id = v.into();
3633 self
3634 }
3635
3636 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3638 self.0.request.validate_only = v.into();
3639 self
3640 }
3641
3642 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3644 where
3645 T: std::iter::IntoIterator<Item = V>,
3646 V: std::convert::Into<std::string::String>,
3647 {
3648 use std::iter::Iterator;
3649 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3650 self
3651 }
3652
3653 pub fn set_starting_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3655 self.0.request.starting_phase_id = v.into();
3656 self
3657 }
3658 }
3659
3660 #[doc(hidden)]
3661 impl gax::options::internal::RequestBuilder for CreateRollout {
3662 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3663 &mut self.0.options
3664 }
3665 }
3666
3667 #[derive(Clone, Debug)]
3685 pub struct IgnoreJob(RequestBuilder<crate::model::IgnoreJobRequest>);
3686
3687 impl IgnoreJob {
3688 pub(crate) fn new(
3689 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3690 ) -> Self {
3691 Self(RequestBuilder::new(stub))
3692 }
3693
3694 pub fn with_request<V: Into<crate::model::IgnoreJobRequest>>(mut self, v: V) -> Self {
3696 self.0.request = v.into();
3697 self
3698 }
3699
3700 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3702 self.0.options = v.into();
3703 self
3704 }
3705
3706 pub async fn send(self) -> Result<crate::model::IgnoreJobResponse> {
3708 (*self.0.stub)
3709 .ignore_job(self.0.request, self.0.options)
3710 .await
3711 .map(gax::response::Response::into_body)
3712 }
3713
3714 pub fn set_rollout<T: Into<std::string::String>>(mut self, v: T) -> Self {
3718 self.0.request.rollout = v.into();
3719 self
3720 }
3721
3722 pub fn set_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3726 self.0.request.phase_id = v.into();
3727 self
3728 }
3729
3730 pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3734 self.0.request.job_id = v.into();
3735 self
3736 }
3737
3738 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3740 where
3741 T: std::iter::IntoIterator<Item = V>,
3742 V: std::convert::Into<std::string::String>,
3743 {
3744 use std::iter::Iterator;
3745 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3746 self
3747 }
3748 }
3749
3750 #[doc(hidden)]
3751 impl gax::options::internal::RequestBuilder for IgnoreJob {
3752 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3753 &mut self.0.options
3754 }
3755 }
3756
3757 #[derive(Clone, Debug)]
3775 pub struct RetryJob(RequestBuilder<crate::model::RetryJobRequest>);
3776
3777 impl RetryJob {
3778 pub(crate) fn new(
3779 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3780 ) -> Self {
3781 Self(RequestBuilder::new(stub))
3782 }
3783
3784 pub fn with_request<V: Into<crate::model::RetryJobRequest>>(mut self, v: V) -> Self {
3786 self.0.request = v.into();
3787 self
3788 }
3789
3790 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3792 self.0.options = v.into();
3793 self
3794 }
3795
3796 pub async fn send(self) -> Result<crate::model::RetryJobResponse> {
3798 (*self.0.stub)
3799 .retry_job(self.0.request, self.0.options)
3800 .await
3801 .map(gax::response::Response::into_body)
3802 }
3803
3804 pub fn set_rollout<T: Into<std::string::String>>(mut self, v: T) -> Self {
3808 self.0.request.rollout = v.into();
3809 self
3810 }
3811
3812 pub fn set_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3816 self.0.request.phase_id = v.into();
3817 self
3818 }
3819
3820 pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3824 self.0.request.job_id = v.into();
3825 self
3826 }
3827
3828 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3830 where
3831 T: std::iter::IntoIterator<Item = V>,
3832 V: std::convert::Into<std::string::String>,
3833 {
3834 use std::iter::Iterator;
3835 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3836 self
3837 }
3838 }
3839
3840 #[doc(hidden)]
3841 impl gax::options::internal::RequestBuilder for RetryJob {
3842 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3843 &mut self.0.options
3844 }
3845 }
3846
3847 #[derive(Clone, Debug)]
3869 pub struct ListJobRuns(RequestBuilder<crate::model::ListJobRunsRequest>);
3870
3871 impl ListJobRuns {
3872 pub(crate) fn new(
3873 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3874 ) -> Self {
3875 Self(RequestBuilder::new(stub))
3876 }
3877
3878 pub fn with_request<V: Into<crate::model::ListJobRunsRequest>>(mut self, v: V) -> Self {
3880 self.0.request = v.into();
3881 self
3882 }
3883
3884 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3886 self.0.options = v.into();
3887 self
3888 }
3889
3890 pub async fn send(self) -> Result<crate::model::ListJobRunsResponse> {
3892 (*self.0.stub)
3893 .list_job_runs(self.0.request, self.0.options)
3894 .await
3895 .map(gax::response::Response::into_body)
3896 }
3897
3898 pub fn by_page(
3900 self,
3901 ) -> impl gax::paginator::Paginator<crate::model::ListJobRunsResponse, gax::error::Error>
3902 {
3903 use std::clone::Clone;
3904 let token = self.0.request.page_token.clone();
3905 let execute = move |token: String| {
3906 let mut builder = self.clone();
3907 builder.0.request = builder.0.request.set_page_token(token);
3908 builder.send()
3909 };
3910 gax::paginator::internal::new_paginator(token, execute)
3911 }
3912
3913 pub fn by_item(
3915 self,
3916 ) -> impl gax::paginator::ItemPaginator<crate::model::ListJobRunsResponse, gax::error::Error>
3917 {
3918 use gax::paginator::Paginator;
3919 self.by_page().items()
3920 }
3921
3922 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3926 self.0.request.parent = v.into();
3927 self
3928 }
3929
3930 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3932 self.0.request.page_size = v.into();
3933 self
3934 }
3935
3936 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3938 self.0.request.page_token = v.into();
3939 self
3940 }
3941
3942 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3944 self.0.request.filter = v.into();
3945 self
3946 }
3947
3948 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3950 self.0.request.order_by = v.into();
3951 self
3952 }
3953 }
3954
3955 #[doc(hidden)]
3956 impl gax::options::internal::RequestBuilder for ListJobRuns {
3957 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3958 &mut self.0.options
3959 }
3960 }
3961
3962 #[derive(Clone, Debug)]
3980 pub struct GetJobRun(RequestBuilder<crate::model::GetJobRunRequest>);
3981
3982 impl GetJobRun {
3983 pub(crate) fn new(
3984 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3985 ) -> Self {
3986 Self(RequestBuilder::new(stub))
3987 }
3988
3989 pub fn with_request<V: Into<crate::model::GetJobRunRequest>>(mut self, v: V) -> Self {
3991 self.0.request = v.into();
3992 self
3993 }
3994
3995 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3997 self.0.options = v.into();
3998 self
3999 }
4000
4001 pub async fn send(self) -> Result<crate::model::JobRun> {
4003 (*self.0.stub)
4004 .get_job_run(self.0.request, self.0.options)
4005 .await
4006 .map(gax::response::Response::into_body)
4007 }
4008
4009 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4013 self.0.request.name = v.into();
4014 self
4015 }
4016 }
4017
4018 #[doc(hidden)]
4019 impl gax::options::internal::RequestBuilder for GetJobRun {
4020 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4021 &mut self.0.options
4022 }
4023 }
4024
4025 #[derive(Clone, Debug)]
4043 pub struct TerminateJobRun(RequestBuilder<crate::model::TerminateJobRunRequest>);
4044
4045 impl TerminateJobRun {
4046 pub(crate) fn new(
4047 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4048 ) -> Self {
4049 Self(RequestBuilder::new(stub))
4050 }
4051
4052 pub fn with_request<V: Into<crate::model::TerminateJobRunRequest>>(mut self, v: V) -> Self {
4054 self.0.request = v.into();
4055 self
4056 }
4057
4058 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4060 self.0.options = v.into();
4061 self
4062 }
4063
4064 pub async fn send(self) -> Result<crate::model::TerminateJobRunResponse> {
4066 (*self.0.stub)
4067 .terminate_job_run(self.0.request, self.0.options)
4068 .await
4069 .map(gax::response::Response::into_body)
4070 }
4071
4072 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4076 self.0.request.name = v.into();
4077 self
4078 }
4079
4080 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
4082 where
4083 T: std::iter::IntoIterator<Item = V>,
4084 V: std::convert::Into<std::string::String>,
4085 {
4086 use std::iter::Iterator;
4087 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
4088 self
4089 }
4090 }
4091
4092 #[doc(hidden)]
4093 impl gax::options::internal::RequestBuilder for TerminateJobRun {
4094 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4095 &mut self.0.options
4096 }
4097 }
4098
4099 #[derive(Clone, Debug)]
4117 pub struct GetConfig(RequestBuilder<crate::model::GetConfigRequest>);
4118
4119 impl GetConfig {
4120 pub(crate) fn new(
4121 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4122 ) -> Self {
4123 Self(RequestBuilder::new(stub))
4124 }
4125
4126 pub fn with_request<V: Into<crate::model::GetConfigRequest>>(mut self, v: V) -> Self {
4128 self.0.request = v.into();
4129 self
4130 }
4131
4132 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4134 self.0.options = v.into();
4135 self
4136 }
4137
4138 pub async fn send(self) -> Result<crate::model::Config> {
4140 (*self.0.stub)
4141 .get_config(self.0.request, self.0.options)
4142 .await
4143 .map(gax::response::Response::into_body)
4144 }
4145
4146 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4150 self.0.request.name = v.into();
4151 self
4152 }
4153 }
4154
4155 #[doc(hidden)]
4156 impl gax::options::internal::RequestBuilder for GetConfig {
4157 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4158 &mut self.0.options
4159 }
4160 }
4161
4162 #[derive(Clone, Debug)]
4181 pub struct CreateAutomation(RequestBuilder<crate::model::CreateAutomationRequest>);
4182
4183 impl CreateAutomation {
4184 pub(crate) fn new(
4185 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4186 ) -> Self {
4187 Self(RequestBuilder::new(stub))
4188 }
4189
4190 pub fn with_request<V: Into<crate::model::CreateAutomationRequest>>(
4192 mut self,
4193 v: V,
4194 ) -> Self {
4195 self.0.request = v.into();
4196 self
4197 }
4198
4199 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4201 self.0.options = v.into();
4202 self
4203 }
4204
4205 pub async fn send(self) -> Result<longrunning::model::Operation> {
4212 (*self.0.stub)
4213 .create_automation(self.0.request, self.0.options)
4214 .await
4215 .map(gax::response::Response::into_body)
4216 }
4217
4218 pub fn poller(
4220 self,
4221 ) -> impl lro::Poller<crate::model::Automation, crate::model::OperationMetadata> {
4222 type Operation =
4223 lro::internal::Operation<crate::model::Automation, crate::model::OperationMetadata>;
4224 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4225 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4226
4227 let stub = self.0.stub.clone();
4228 let mut options = self.0.options.clone();
4229 options.set_retry_policy(gax::retry_policy::NeverRetry);
4230 let query = move |name| {
4231 let stub = stub.clone();
4232 let options = options.clone();
4233 async {
4234 let op = GetOperation::new(stub)
4235 .set_name(name)
4236 .with_options(options)
4237 .send()
4238 .await?;
4239 Ok(Operation::new(op))
4240 }
4241 };
4242
4243 let start = move || async {
4244 let op = self.send().await?;
4245 Ok(Operation::new(op))
4246 };
4247
4248 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4249 }
4250
4251 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4255 self.0.request.parent = v.into();
4256 self
4257 }
4258
4259 pub fn set_automation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4263 self.0.request.automation_id = v.into();
4264 self
4265 }
4266
4267 pub fn set_automation<T>(mut self, v: T) -> Self
4271 where
4272 T: std::convert::Into<crate::model::Automation>,
4273 {
4274 self.0.request.automation = std::option::Option::Some(v.into());
4275 self
4276 }
4277
4278 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
4282 where
4283 T: std::convert::Into<crate::model::Automation>,
4284 {
4285 self.0.request.automation = v.map(|x| x.into());
4286 self
4287 }
4288
4289 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4291 self.0.request.request_id = v.into();
4292 self
4293 }
4294
4295 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4297 self.0.request.validate_only = v.into();
4298 self
4299 }
4300 }
4301
4302 #[doc(hidden)]
4303 impl gax::options::internal::RequestBuilder for CreateAutomation {
4304 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4305 &mut self.0.options
4306 }
4307 }
4308
4309 #[derive(Clone, Debug)]
4328 pub struct UpdateAutomation(RequestBuilder<crate::model::UpdateAutomationRequest>);
4329
4330 impl UpdateAutomation {
4331 pub(crate) fn new(
4332 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4333 ) -> Self {
4334 Self(RequestBuilder::new(stub))
4335 }
4336
4337 pub fn with_request<V: Into<crate::model::UpdateAutomationRequest>>(
4339 mut self,
4340 v: V,
4341 ) -> Self {
4342 self.0.request = v.into();
4343 self
4344 }
4345
4346 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4348 self.0.options = v.into();
4349 self
4350 }
4351
4352 pub async fn send(self) -> Result<longrunning::model::Operation> {
4359 (*self.0.stub)
4360 .update_automation(self.0.request, self.0.options)
4361 .await
4362 .map(gax::response::Response::into_body)
4363 }
4364
4365 pub fn poller(
4367 self,
4368 ) -> impl lro::Poller<crate::model::Automation, crate::model::OperationMetadata> {
4369 type Operation =
4370 lro::internal::Operation<crate::model::Automation, crate::model::OperationMetadata>;
4371 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4372 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4373
4374 let stub = self.0.stub.clone();
4375 let mut options = self.0.options.clone();
4376 options.set_retry_policy(gax::retry_policy::NeverRetry);
4377 let query = move |name| {
4378 let stub = stub.clone();
4379 let options = options.clone();
4380 async {
4381 let op = GetOperation::new(stub)
4382 .set_name(name)
4383 .with_options(options)
4384 .send()
4385 .await?;
4386 Ok(Operation::new(op))
4387 }
4388 };
4389
4390 let start = move || async {
4391 let op = self.send().await?;
4392 Ok(Operation::new(op))
4393 };
4394
4395 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4396 }
4397
4398 pub fn set_update_mask<T>(mut self, v: T) -> Self
4402 where
4403 T: std::convert::Into<wkt::FieldMask>,
4404 {
4405 self.0.request.update_mask = std::option::Option::Some(v.into());
4406 self
4407 }
4408
4409 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4413 where
4414 T: std::convert::Into<wkt::FieldMask>,
4415 {
4416 self.0.request.update_mask = v.map(|x| x.into());
4417 self
4418 }
4419
4420 pub fn set_automation<T>(mut self, v: T) -> Self
4424 where
4425 T: std::convert::Into<crate::model::Automation>,
4426 {
4427 self.0.request.automation = std::option::Option::Some(v.into());
4428 self
4429 }
4430
4431 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
4435 where
4436 T: std::convert::Into<crate::model::Automation>,
4437 {
4438 self.0.request.automation = v.map(|x| x.into());
4439 self
4440 }
4441
4442 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4444 self.0.request.request_id = v.into();
4445 self
4446 }
4447
4448 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
4450 self.0.request.allow_missing = v.into();
4451 self
4452 }
4453
4454 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4456 self.0.request.validate_only = v.into();
4457 self
4458 }
4459 }
4460
4461 #[doc(hidden)]
4462 impl gax::options::internal::RequestBuilder for UpdateAutomation {
4463 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4464 &mut self.0.options
4465 }
4466 }
4467
4468 #[derive(Clone, Debug)]
4487 pub struct DeleteAutomation(RequestBuilder<crate::model::DeleteAutomationRequest>);
4488
4489 impl DeleteAutomation {
4490 pub(crate) fn new(
4491 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4492 ) -> Self {
4493 Self(RequestBuilder::new(stub))
4494 }
4495
4496 pub fn with_request<V: Into<crate::model::DeleteAutomationRequest>>(
4498 mut self,
4499 v: V,
4500 ) -> Self {
4501 self.0.request = v.into();
4502 self
4503 }
4504
4505 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4507 self.0.options = v.into();
4508 self
4509 }
4510
4511 pub async fn send(self) -> Result<longrunning::model::Operation> {
4518 (*self.0.stub)
4519 .delete_automation(self.0.request, self.0.options)
4520 .await
4521 .map(gax::response::Response::into_body)
4522 }
4523
4524 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4526 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4527 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4528 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4529
4530 let stub = self.0.stub.clone();
4531 let mut options = self.0.options.clone();
4532 options.set_retry_policy(gax::retry_policy::NeverRetry);
4533 let query = move |name| {
4534 let stub = stub.clone();
4535 let options = options.clone();
4536 async {
4537 let op = GetOperation::new(stub)
4538 .set_name(name)
4539 .with_options(options)
4540 .send()
4541 .await?;
4542 Ok(Operation::new(op))
4543 }
4544 };
4545
4546 let start = move || async {
4547 let op = self.send().await?;
4548 Ok(Operation::new(op))
4549 };
4550
4551 lro::internal::new_unit_response_poller(
4552 polling_error_policy,
4553 polling_backoff_policy,
4554 start,
4555 query,
4556 )
4557 }
4558
4559 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4563 self.0.request.name = v.into();
4564 self
4565 }
4566
4567 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4569 self.0.request.request_id = v.into();
4570 self
4571 }
4572
4573 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
4575 self.0.request.allow_missing = v.into();
4576 self
4577 }
4578
4579 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4581 self.0.request.validate_only = v.into();
4582 self
4583 }
4584
4585 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4587 self.0.request.etag = v.into();
4588 self
4589 }
4590 }
4591
4592 #[doc(hidden)]
4593 impl gax::options::internal::RequestBuilder for DeleteAutomation {
4594 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4595 &mut self.0.options
4596 }
4597 }
4598
4599 #[derive(Clone, Debug)]
4617 pub struct GetAutomation(RequestBuilder<crate::model::GetAutomationRequest>);
4618
4619 impl GetAutomation {
4620 pub(crate) fn new(
4621 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4622 ) -> Self {
4623 Self(RequestBuilder::new(stub))
4624 }
4625
4626 pub fn with_request<V: Into<crate::model::GetAutomationRequest>>(mut self, v: V) -> Self {
4628 self.0.request = v.into();
4629 self
4630 }
4631
4632 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4634 self.0.options = v.into();
4635 self
4636 }
4637
4638 pub async fn send(self) -> Result<crate::model::Automation> {
4640 (*self.0.stub)
4641 .get_automation(self.0.request, self.0.options)
4642 .await
4643 .map(gax::response::Response::into_body)
4644 }
4645
4646 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4650 self.0.request.name = v.into();
4651 self
4652 }
4653 }
4654
4655 #[doc(hidden)]
4656 impl gax::options::internal::RequestBuilder for GetAutomation {
4657 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4658 &mut self.0.options
4659 }
4660 }
4661
4662 #[derive(Clone, Debug)]
4684 pub struct ListAutomations(RequestBuilder<crate::model::ListAutomationsRequest>);
4685
4686 impl ListAutomations {
4687 pub(crate) fn new(
4688 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4689 ) -> Self {
4690 Self(RequestBuilder::new(stub))
4691 }
4692
4693 pub fn with_request<V: Into<crate::model::ListAutomationsRequest>>(mut self, v: V) -> Self {
4695 self.0.request = v.into();
4696 self
4697 }
4698
4699 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4701 self.0.options = v.into();
4702 self
4703 }
4704
4705 pub async fn send(self) -> Result<crate::model::ListAutomationsResponse> {
4707 (*self.0.stub)
4708 .list_automations(self.0.request, self.0.options)
4709 .await
4710 .map(gax::response::Response::into_body)
4711 }
4712
4713 pub fn by_page(
4715 self,
4716 ) -> impl gax::paginator::Paginator<crate::model::ListAutomationsResponse, gax::error::Error>
4717 {
4718 use std::clone::Clone;
4719 let token = self.0.request.page_token.clone();
4720 let execute = move |token: String| {
4721 let mut builder = self.clone();
4722 builder.0.request = builder.0.request.set_page_token(token);
4723 builder.send()
4724 };
4725 gax::paginator::internal::new_paginator(token, execute)
4726 }
4727
4728 pub fn by_item(
4730 self,
4731 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAutomationsResponse, gax::error::Error>
4732 {
4733 use gax::paginator::Paginator;
4734 self.by_page().items()
4735 }
4736
4737 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4741 self.0.request.parent = v.into();
4742 self
4743 }
4744
4745 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4747 self.0.request.page_size = v.into();
4748 self
4749 }
4750
4751 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4753 self.0.request.page_token = v.into();
4754 self
4755 }
4756
4757 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4759 self.0.request.filter = v.into();
4760 self
4761 }
4762
4763 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4765 self.0.request.order_by = v.into();
4766 self
4767 }
4768 }
4769
4770 #[doc(hidden)]
4771 impl gax::options::internal::RequestBuilder for ListAutomations {
4772 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4773 &mut self.0.options
4774 }
4775 }
4776
4777 #[derive(Clone, Debug)]
4795 pub struct GetAutomationRun(RequestBuilder<crate::model::GetAutomationRunRequest>);
4796
4797 impl GetAutomationRun {
4798 pub(crate) fn new(
4799 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4800 ) -> Self {
4801 Self(RequestBuilder::new(stub))
4802 }
4803
4804 pub fn with_request<V: Into<crate::model::GetAutomationRunRequest>>(
4806 mut self,
4807 v: V,
4808 ) -> Self {
4809 self.0.request = v.into();
4810 self
4811 }
4812
4813 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4815 self.0.options = v.into();
4816 self
4817 }
4818
4819 pub async fn send(self) -> Result<crate::model::AutomationRun> {
4821 (*self.0.stub)
4822 .get_automation_run(self.0.request, self.0.options)
4823 .await
4824 .map(gax::response::Response::into_body)
4825 }
4826
4827 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4831 self.0.request.name = v.into();
4832 self
4833 }
4834 }
4835
4836 #[doc(hidden)]
4837 impl gax::options::internal::RequestBuilder for GetAutomationRun {
4838 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4839 &mut self.0.options
4840 }
4841 }
4842
4843 #[derive(Clone, Debug)]
4865 pub struct ListAutomationRuns(RequestBuilder<crate::model::ListAutomationRunsRequest>);
4866
4867 impl ListAutomationRuns {
4868 pub(crate) fn new(
4869 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4870 ) -> Self {
4871 Self(RequestBuilder::new(stub))
4872 }
4873
4874 pub fn with_request<V: Into<crate::model::ListAutomationRunsRequest>>(
4876 mut self,
4877 v: V,
4878 ) -> Self {
4879 self.0.request = v.into();
4880 self
4881 }
4882
4883 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4885 self.0.options = v.into();
4886 self
4887 }
4888
4889 pub async fn send(self) -> Result<crate::model::ListAutomationRunsResponse> {
4891 (*self.0.stub)
4892 .list_automation_runs(self.0.request, self.0.options)
4893 .await
4894 .map(gax::response::Response::into_body)
4895 }
4896
4897 pub fn by_page(
4899 self,
4900 ) -> impl gax::paginator::Paginator<crate::model::ListAutomationRunsResponse, gax::error::Error>
4901 {
4902 use std::clone::Clone;
4903 let token = self.0.request.page_token.clone();
4904 let execute = move |token: String| {
4905 let mut builder = self.clone();
4906 builder.0.request = builder.0.request.set_page_token(token);
4907 builder.send()
4908 };
4909 gax::paginator::internal::new_paginator(token, execute)
4910 }
4911
4912 pub fn by_item(
4914 self,
4915 ) -> impl gax::paginator::ItemPaginator<
4916 crate::model::ListAutomationRunsResponse,
4917 gax::error::Error,
4918 > {
4919 use gax::paginator::Paginator;
4920 self.by_page().items()
4921 }
4922
4923 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4927 self.0.request.parent = v.into();
4928 self
4929 }
4930
4931 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4933 self.0.request.page_size = v.into();
4934 self
4935 }
4936
4937 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4939 self.0.request.page_token = v.into();
4940 self
4941 }
4942
4943 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4945 self.0.request.filter = v.into();
4946 self
4947 }
4948
4949 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4951 self.0.request.order_by = v.into();
4952 self
4953 }
4954 }
4955
4956 #[doc(hidden)]
4957 impl gax::options::internal::RequestBuilder for ListAutomationRuns {
4958 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4959 &mut self.0.options
4960 }
4961 }
4962
4963 #[derive(Clone, Debug)]
4981 pub struct CancelAutomationRun(RequestBuilder<crate::model::CancelAutomationRunRequest>);
4982
4983 impl CancelAutomationRun {
4984 pub(crate) fn new(
4985 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4986 ) -> Self {
4987 Self(RequestBuilder::new(stub))
4988 }
4989
4990 pub fn with_request<V: Into<crate::model::CancelAutomationRunRequest>>(
4992 mut self,
4993 v: V,
4994 ) -> Self {
4995 self.0.request = v.into();
4996 self
4997 }
4998
4999 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5001 self.0.options = v.into();
5002 self
5003 }
5004
5005 pub async fn send(self) -> Result<crate::model::CancelAutomationRunResponse> {
5007 (*self.0.stub)
5008 .cancel_automation_run(self.0.request, self.0.options)
5009 .await
5010 .map(gax::response::Response::into_body)
5011 }
5012
5013 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5017 self.0.request.name = v.into();
5018 self
5019 }
5020 }
5021
5022 #[doc(hidden)]
5023 impl gax::options::internal::RequestBuilder for CancelAutomationRun {
5024 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5025 &mut self.0.options
5026 }
5027 }
5028
5029 #[derive(Clone, Debug)]
5051 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5052
5053 impl ListLocations {
5054 pub(crate) fn new(
5055 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5056 ) -> Self {
5057 Self(RequestBuilder::new(stub))
5058 }
5059
5060 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5062 mut self,
5063 v: V,
5064 ) -> Self {
5065 self.0.request = v.into();
5066 self
5067 }
5068
5069 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5071 self.0.options = v.into();
5072 self
5073 }
5074
5075 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5077 (*self.0.stub)
5078 .list_locations(self.0.request, self.0.options)
5079 .await
5080 .map(gax::response::Response::into_body)
5081 }
5082
5083 pub fn by_page(
5085 self,
5086 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5087 {
5088 use std::clone::Clone;
5089 let token = self.0.request.page_token.clone();
5090 let execute = move |token: String| {
5091 let mut builder = self.clone();
5092 builder.0.request = builder.0.request.set_page_token(token);
5093 builder.send()
5094 };
5095 gax::paginator::internal::new_paginator(token, execute)
5096 }
5097
5098 pub fn by_item(
5100 self,
5101 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5102 {
5103 use gax::paginator::Paginator;
5104 self.by_page().items()
5105 }
5106
5107 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5109 self.0.request.name = v.into();
5110 self
5111 }
5112
5113 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5115 self.0.request.filter = v.into();
5116 self
5117 }
5118
5119 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5121 self.0.request.page_size = v.into();
5122 self
5123 }
5124
5125 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5127 self.0.request.page_token = v.into();
5128 self
5129 }
5130 }
5131
5132 #[doc(hidden)]
5133 impl gax::options::internal::RequestBuilder for ListLocations {
5134 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5135 &mut self.0.options
5136 }
5137 }
5138
5139 #[derive(Clone, Debug)]
5157 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5158
5159 impl GetLocation {
5160 pub(crate) fn new(
5161 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5162 ) -> Self {
5163 Self(RequestBuilder::new(stub))
5164 }
5165
5166 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5168 self.0.request = v.into();
5169 self
5170 }
5171
5172 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5174 self.0.options = v.into();
5175 self
5176 }
5177
5178 pub async fn send(self) -> Result<location::model::Location> {
5180 (*self.0.stub)
5181 .get_location(self.0.request, self.0.options)
5182 .await
5183 .map(gax::response::Response::into_body)
5184 }
5185
5186 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5188 self.0.request.name = v.into();
5189 self
5190 }
5191 }
5192
5193 #[doc(hidden)]
5194 impl gax::options::internal::RequestBuilder for GetLocation {
5195 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5196 &mut self.0.options
5197 }
5198 }
5199
5200 #[derive(Clone, Debug)]
5218 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5219
5220 impl SetIamPolicy {
5221 pub(crate) fn new(
5222 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5223 ) -> Self {
5224 Self(RequestBuilder::new(stub))
5225 }
5226
5227 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5229 self.0.request = v.into();
5230 self
5231 }
5232
5233 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5235 self.0.options = v.into();
5236 self
5237 }
5238
5239 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5241 (*self.0.stub)
5242 .set_iam_policy(self.0.request, self.0.options)
5243 .await
5244 .map(gax::response::Response::into_body)
5245 }
5246
5247 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5251 self.0.request.resource = v.into();
5252 self
5253 }
5254
5255 pub fn set_policy<T>(mut self, v: T) -> Self
5259 where
5260 T: std::convert::Into<iam_v1::model::Policy>,
5261 {
5262 self.0.request.policy = std::option::Option::Some(v.into());
5263 self
5264 }
5265
5266 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5270 where
5271 T: std::convert::Into<iam_v1::model::Policy>,
5272 {
5273 self.0.request.policy = v.map(|x| x.into());
5274 self
5275 }
5276
5277 pub fn set_update_mask<T>(mut self, v: T) -> Self
5279 where
5280 T: std::convert::Into<wkt::FieldMask>,
5281 {
5282 self.0.request.update_mask = std::option::Option::Some(v.into());
5283 self
5284 }
5285
5286 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5288 where
5289 T: std::convert::Into<wkt::FieldMask>,
5290 {
5291 self.0.request.update_mask = v.map(|x| x.into());
5292 self
5293 }
5294 }
5295
5296 #[doc(hidden)]
5297 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5298 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5299 &mut self.0.options
5300 }
5301 }
5302
5303 #[derive(Clone, Debug)]
5321 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5322
5323 impl GetIamPolicy {
5324 pub(crate) fn new(
5325 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5326 ) -> Self {
5327 Self(RequestBuilder::new(stub))
5328 }
5329
5330 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5332 self.0.request = v.into();
5333 self
5334 }
5335
5336 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5338 self.0.options = v.into();
5339 self
5340 }
5341
5342 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5344 (*self.0.stub)
5345 .get_iam_policy(self.0.request, self.0.options)
5346 .await
5347 .map(gax::response::Response::into_body)
5348 }
5349
5350 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5354 self.0.request.resource = v.into();
5355 self
5356 }
5357
5358 pub fn set_options<T>(mut self, v: T) -> Self
5360 where
5361 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5362 {
5363 self.0.request.options = std::option::Option::Some(v.into());
5364 self
5365 }
5366
5367 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5369 where
5370 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5371 {
5372 self.0.request.options = v.map(|x| x.into());
5373 self
5374 }
5375 }
5376
5377 #[doc(hidden)]
5378 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5379 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5380 &mut self.0.options
5381 }
5382 }
5383
5384 #[derive(Clone, Debug)]
5402 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5403
5404 impl TestIamPermissions {
5405 pub(crate) fn new(
5406 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5407 ) -> Self {
5408 Self(RequestBuilder::new(stub))
5409 }
5410
5411 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5413 mut self,
5414 v: V,
5415 ) -> Self {
5416 self.0.request = v.into();
5417 self
5418 }
5419
5420 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5422 self.0.options = v.into();
5423 self
5424 }
5425
5426 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5428 (*self.0.stub)
5429 .test_iam_permissions(self.0.request, self.0.options)
5430 .await
5431 .map(gax::response::Response::into_body)
5432 }
5433
5434 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5438 self.0.request.resource = v.into();
5439 self
5440 }
5441
5442 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5446 where
5447 T: std::iter::IntoIterator<Item = V>,
5448 V: std::convert::Into<std::string::String>,
5449 {
5450 use std::iter::Iterator;
5451 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5452 self
5453 }
5454 }
5455
5456 #[doc(hidden)]
5457 impl gax::options::internal::RequestBuilder for TestIamPermissions {
5458 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5459 &mut self.0.options
5460 }
5461 }
5462
5463 #[derive(Clone, Debug)]
5485 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5486
5487 impl ListOperations {
5488 pub(crate) fn new(
5489 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5490 ) -> Self {
5491 Self(RequestBuilder::new(stub))
5492 }
5493
5494 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5496 mut self,
5497 v: V,
5498 ) -> Self {
5499 self.0.request = v.into();
5500 self
5501 }
5502
5503 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5505 self.0.options = v.into();
5506 self
5507 }
5508
5509 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5511 (*self.0.stub)
5512 .list_operations(self.0.request, self.0.options)
5513 .await
5514 .map(gax::response::Response::into_body)
5515 }
5516
5517 pub fn by_page(
5519 self,
5520 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5521 {
5522 use std::clone::Clone;
5523 let token = self.0.request.page_token.clone();
5524 let execute = move |token: String| {
5525 let mut builder = self.clone();
5526 builder.0.request = builder.0.request.set_page_token(token);
5527 builder.send()
5528 };
5529 gax::paginator::internal::new_paginator(token, execute)
5530 }
5531
5532 pub fn by_item(
5534 self,
5535 ) -> impl gax::paginator::ItemPaginator<
5536 longrunning::model::ListOperationsResponse,
5537 gax::error::Error,
5538 > {
5539 use gax::paginator::Paginator;
5540 self.by_page().items()
5541 }
5542
5543 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5545 self.0.request.name = v.into();
5546 self
5547 }
5548
5549 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5551 self.0.request.filter = v.into();
5552 self
5553 }
5554
5555 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5557 self.0.request.page_size = v.into();
5558 self
5559 }
5560
5561 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5563 self.0.request.page_token = v.into();
5564 self
5565 }
5566 }
5567
5568 #[doc(hidden)]
5569 impl gax::options::internal::RequestBuilder for ListOperations {
5570 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5571 &mut self.0.options
5572 }
5573 }
5574
5575 #[derive(Clone, Debug)]
5593 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5594
5595 impl GetOperation {
5596 pub(crate) fn new(
5597 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5598 ) -> Self {
5599 Self(RequestBuilder::new(stub))
5600 }
5601
5602 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5604 mut self,
5605 v: V,
5606 ) -> Self {
5607 self.0.request = v.into();
5608 self
5609 }
5610
5611 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5613 self.0.options = v.into();
5614 self
5615 }
5616
5617 pub async fn send(self) -> Result<longrunning::model::Operation> {
5619 (*self.0.stub)
5620 .get_operation(self.0.request, self.0.options)
5621 .await
5622 .map(gax::response::Response::into_body)
5623 }
5624
5625 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5627 self.0.request.name = v.into();
5628 self
5629 }
5630 }
5631
5632 #[doc(hidden)]
5633 impl gax::options::internal::RequestBuilder for GetOperation {
5634 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5635 &mut self.0.options
5636 }
5637 }
5638
5639 #[derive(Clone, Debug)]
5657 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5658
5659 impl DeleteOperation {
5660 pub(crate) fn new(
5661 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5662 ) -> Self {
5663 Self(RequestBuilder::new(stub))
5664 }
5665
5666 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5668 mut self,
5669 v: V,
5670 ) -> Self {
5671 self.0.request = v.into();
5672 self
5673 }
5674
5675 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5677 self.0.options = v.into();
5678 self
5679 }
5680
5681 pub async fn send(self) -> Result<()> {
5683 (*self.0.stub)
5684 .delete_operation(self.0.request, self.0.options)
5685 .await
5686 .map(gax::response::Response::into_body)
5687 }
5688
5689 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5691 self.0.request.name = v.into();
5692 self
5693 }
5694 }
5695
5696 #[doc(hidden)]
5697 impl gax::options::internal::RequestBuilder for DeleteOperation {
5698 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5699 &mut self.0.options
5700 }
5701 }
5702
5703 #[derive(Clone, Debug)]
5721 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5722
5723 impl CancelOperation {
5724 pub(crate) fn new(
5725 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5726 ) -> Self {
5727 Self(RequestBuilder::new(stub))
5728 }
5729
5730 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5732 mut self,
5733 v: V,
5734 ) -> Self {
5735 self.0.request = v.into();
5736 self
5737 }
5738
5739 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5741 self.0.options = v.into();
5742 self
5743 }
5744
5745 pub async fn send(self) -> Result<()> {
5747 (*self.0.stub)
5748 .cancel_operation(self.0.request, self.0.options)
5749 .await
5750 .map(gax::response::Response::into_body)
5751 }
5752
5753 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5755 self.0.request.name = v.into();
5756 self
5757 }
5758 }
5759
5760 #[doc(hidden)]
5761 impl gax::options::internal::RequestBuilder for CancelOperation {
5762 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5763 &mut self.0.options
5764 }
5765 }
5766}