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)]
95 pub struct ListDeliveryPipelines(RequestBuilder<crate::model::ListDeliveryPipelinesRequest>);
96
97 impl ListDeliveryPipelines {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListDeliveryPipelinesRequest>>(
106 mut self,
107 v: V,
108 ) -> Self {
109 self.0.request = v.into();
110 self
111 }
112
113 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
115 self.0.options = v.into();
116 self
117 }
118
119 pub async fn send(self) -> Result<crate::model::ListDeliveryPipelinesResponse> {
121 (*self.0.stub)
122 .list_delivery_pipelines(self.0.request, self.0.options)
123 .await
124 .map(gax::response::Response::into_body)
125 }
126
127 pub fn by_page(
129 self,
130 ) -> impl gax::paginator::Paginator<crate::model::ListDeliveryPipelinesResponse, gax::error::Error>
131 {
132 use std::clone::Clone;
133 let token = self.0.request.page_token.clone();
134 let execute = move |token: String| {
135 let mut builder = self.clone();
136 builder.0.request = builder.0.request.set_page_token(token);
137 builder.send()
138 };
139 gax::paginator::internal::new_paginator(token, execute)
140 }
141
142 pub fn by_item(
144 self,
145 ) -> impl gax::paginator::ItemPaginator<
146 crate::model::ListDeliveryPipelinesResponse,
147 gax::error::Error,
148 > {
149 use gax::paginator::Paginator;
150 self.by_page().items()
151 }
152
153 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
157 self.0.request.parent = v.into();
158 self
159 }
160
161 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
163 self.0.request.page_size = v.into();
164 self
165 }
166
167 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
169 self.0.request.page_token = v.into();
170 self
171 }
172
173 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
175 self.0.request.filter = v.into();
176 self
177 }
178
179 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
181 self.0.request.order_by = v.into();
182 self
183 }
184 }
185
186 #[doc(hidden)]
187 impl gax::options::internal::RequestBuilder for ListDeliveryPipelines {
188 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
189 &mut self.0.options
190 }
191 }
192
193 #[derive(Clone, Debug)]
210 pub struct GetDeliveryPipeline(RequestBuilder<crate::model::GetDeliveryPipelineRequest>);
211
212 impl GetDeliveryPipeline {
213 pub(crate) fn new(
214 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
215 ) -> Self {
216 Self(RequestBuilder::new(stub))
217 }
218
219 pub fn with_request<V: Into<crate::model::GetDeliveryPipelineRequest>>(
221 mut self,
222 v: V,
223 ) -> Self {
224 self.0.request = v.into();
225 self
226 }
227
228 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
230 self.0.options = v.into();
231 self
232 }
233
234 pub async fn send(self) -> Result<crate::model::DeliveryPipeline> {
236 (*self.0.stub)
237 .get_delivery_pipeline(self.0.request, self.0.options)
238 .await
239 .map(gax::response::Response::into_body)
240 }
241
242 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
246 self.0.request.name = v.into();
247 self
248 }
249 }
250
251 #[doc(hidden)]
252 impl gax::options::internal::RequestBuilder for GetDeliveryPipeline {
253 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
254 &mut self.0.options
255 }
256 }
257
258 #[derive(Clone, Debug)]
276 pub struct CreateDeliveryPipeline(RequestBuilder<crate::model::CreateDeliveryPipelineRequest>);
277
278 impl CreateDeliveryPipeline {
279 pub(crate) fn new(
280 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
281 ) -> Self {
282 Self(RequestBuilder::new(stub))
283 }
284
285 pub fn with_request<V: Into<crate::model::CreateDeliveryPipelineRequest>>(
287 mut self,
288 v: V,
289 ) -> Self {
290 self.0.request = v.into();
291 self
292 }
293
294 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
296 self.0.options = v.into();
297 self
298 }
299
300 pub async fn send(self) -> Result<longrunning::model::Operation> {
307 (*self.0.stub)
308 .create_delivery_pipeline(self.0.request, self.0.options)
309 .await
310 .map(gax::response::Response::into_body)
311 }
312
313 pub fn poller(
315 self,
316 ) -> impl lro::Poller<crate::model::DeliveryPipeline, crate::model::OperationMetadata>
317 {
318 type Operation = lro::internal::Operation<
319 crate::model::DeliveryPipeline,
320 crate::model::OperationMetadata,
321 >;
322 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
323 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
324
325 let stub = self.0.stub.clone();
326 let mut options = self.0.options.clone();
327 options.set_retry_policy(gax::retry_policy::NeverRetry);
328 let query = move |name| {
329 let stub = stub.clone();
330 let options = options.clone();
331 async {
332 let op = GetOperation::new(stub)
333 .set_name(name)
334 .with_options(options)
335 .send()
336 .await?;
337 Ok(Operation::new(op))
338 }
339 };
340
341 let start = move || async {
342 let op = self.send().await?;
343 Ok(Operation::new(op))
344 };
345
346 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
347 }
348
349 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
353 self.0.request.parent = v.into();
354 self
355 }
356
357 pub fn set_delivery_pipeline_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
361 self.0.request.delivery_pipeline_id = v.into();
362 self
363 }
364
365 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
369 where
370 T: std::convert::Into<crate::model::DeliveryPipeline>,
371 {
372 self.0.request.delivery_pipeline = std::option::Option::Some(v.into());
373 self
374 }
375
376 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
380 where
381 T: std::convert::Into<crate::model::DeliveryPipeline>,
382 {
383 self.0.request.delivery_pipeline = v.map(|x| x.into());
384 self
385 }
386
387 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
389 self.0.request.request_id = v.into();
390 self
391 }
392
393 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
395 self.0.request.validate_only = v.into();
396 self
397 }
398 }
399
400 #[doc(hidden)]
401 impl gax::options::internal::RequestBuilder for CreateDeliveryPipeline {
402 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
403 &mut self.0.options
404 }
405 }
406
407 #[derive(Clone, Debug)]
425 pub struct UpdateDeliveryPipeline(RequestBuilder<crate::model::UpdateDeliveryPipelineRequest>);
426
427 impl UpdateDeliveryPipeline {
428 pub(crate) fn new(
429 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
430 ) -> Self {
431 Self(RequestBuilder::new(stub))
432 }
433
434 pub fn with_request<V: Into<crate::model::UpdateDeliveryPipelineRequest>>(
436 mut self,
437 v: V,
438 ) -> Self {
439 self.0.request = v.into();
440 self
441 }
442
443 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
445 self.0.options = v.into();
446 self
447 }
448
449 pub async fn send(self) -> Result<longrunning::model::Operation> {
456 (*self.0.stub)
457 .update_delivery_pipeline(self.0.request, self.0.options)
458 .await
459 .map(gax::response::Response::into_body)
460 }
461
462 pub fn poller(
464 self,
465 ) -> impl lro::Poller<crate::model::DeliveryPipeline, crate::model::OperationMetadata>
466 {
467 type Operation = lro::internal::Operation<
468 crate::model::DeliveryPipeline,
469 crate::model::OperationMetadata,
470 >;
471 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
472 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
473
474 let stub = self.0.stub.clone();
475 let mut options = self.0.options.clone();
476 options.set_retry_policy(gax::retry_policy::NeverRetry);
477 let query = move |name| {
478 let stub = stub.clone();
479 let options = options.clone();
480 async {
481 let op = GetOperation::new(stub)
482 .set_name(name)
483 .with_options(options)
484 .send()
485 .await?;
486 Ok(Operation::new(op))
487 }
488 };
489
490 let start = move || async {
491 let op = self.send().await?;
492 Ok(Operation::new(op))
493 };
494
495 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
496 }
497
498 pub fn set_update_mask<T>(mut self, v: T) -> Self
502 where
503 T: std::convert::Into<wkt::FieldMask>,
504 {
505 self.0.request.update_mask = std::option::Option::Some(v.into());
506 self
507 }
508
509 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
513 where
514 T: std::convert::Into<wkt::FieldMask>,
515 {
516 self.0.request.update_mask = v.map(|x| x.into());
517 self
518 }
519
520 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
524 where
525 T: std::convert::Into<crate::model::DeliveryPipeline>,
526 {
527 self.0.request.delivery_pipeline = std::option::Option::Some(v.into());
528 self
529 }
530
531 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
535 where
536 T: std::convert::Into<crate::model::DeliveryPipeline>,
537 {
538 self.0.request.delivery_pipeline = v.map(|x| x.into());
539 self
540 }
541
542 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
544 self.0.request.request_id = v.into();
545 self
546 }
547
548 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
550 self.0.request.allow_missing = v.into();
551 self
552 }
553
554 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
556 self.0.request.validate_only = v.into();
557 self
558 }
559 }
560
561 #[doc(hidden)]
562 impl gax::options::internal::RequestBuilder for UpdateDeliveryPipeline {
563 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
564 &mut self.0.options
565 }
566 }
567
568 #[derive(Clone, Debug)]
586 pub struct DeleteDeliveryPipeline(RequestBuilder<crate::model::DeleteDeliveryPipelineRequest>);
587
588 impl DeleteDeliveryPipeline {
589 pub(crate) fn new(
590 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
591 ) -> Self {
592 Self(RequestBuilder::new(stub))
593 }
594
595 pub fn with_request<V: Into<crate::model::DeleteDeliveryPipelineRequest>>(
597 mut self,
598 v: V,
599 ) -> Self {
600 self.0.request = v.into();
601 self
602 }
603
604 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
606 self.0.options = v.into();
607 self
608 }
609
610 pub async fn send(self) -> Result<longrunning::model::Operation> {
617 (*self.0.stub)
618 .delete_delivery_pipeline(self.0.request, self.0.options)
619 .await
620 .map(gax::response::Response::into_body)
621 }
622
623 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
625 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
626 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
627 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
628
629 let stub = self.0.stub.clone();
630 let mut options = self.0.options.clone();
631 options.set_retry_policy(gax::retry_policy::NeverRetry);
632 let query = move |name| {
633 let stub = stub.clone();
634 let options = options.clone();
635 async {
636 let op = GetOperation::new(stub)
637 .set_name(name)
638 .with_options(options)
639 .send()
640 .await?;
641 Ok(Operation::new(op))
642 }
643 };
644
645 let start = move || async {
646 let op = self.send().await?;
647 Ok(Operation::new(op))
648 };
649
650 lro::internal::new_unit_response_poller(
651 polling_error_policy,
652 polling_backoff_policy,
653 start,
654 query,
655 )
656 }
657
658 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
662 self.0.request.name = v.into();
663 self
664 }
665
666 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
668 self.0.request.request_id = v.into();
669 self
670 }
671
672 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
674 self.0.request.allow_missing = v.into();
675 self
676 }
677
678 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
680 self.0.request.validate_only = v.into();
681 self
682 }
683
684 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
686 self.0.request.force = v.into();
687 self
688 }
689
690 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
692 self.0.request.etag = v.into();
693 self
694 }
695 }
696
697 #[doc(hidden)]
698 impl gax::options::internal::RequestBuilder for DeleteDeliveryPipeline {
699 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
700 &mut self.0.options
701 }
702 }
703
704 #[derive(Clone, Debug)]
725 pub struct ListTargets(RequestBuilder<crate::model::ListTargetsRequest>);
726
727 impl ListTargets {
728 pub(crate) fn new(
729 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
730 ) -> Self {
731 Self(RequestBuilder::new(stub))
732 }
733
734 pub fn with_request<V: Into<crate::model::ListTargetsRequest>>(mut self, v: V) -> Self {
736 self.0.request = v.into();
737 self
738 }
739
740 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
742 self.0.options = v.into();
743 self
744 }
745
746 pub async fn send(self) -> Result<crate::model::ListTargetsResponse> {
748 (*self.0.stub)
749 .list_targets(self.0.request, self.0.options)
750 .await
751 .map(gax::response::Response::into_body)
752 }
753
754 pub fn by_page(
756 self,
757 ) -> impl gax::paginator::Paginator<crate::model::ListTargetsResponse, gax::error::Error>
758 {
759 use std::clone::Clone;
760 let token = self.0.request.page_token.clone();
761 let execute = move |token: String| {
762 let mut builder = self.clone();
763 builder.0.request = builder.0.request.set_page_token(token);
764 builder.send()
765 };
766 gax::paginator::internal::new_paginator(token, execute)
767 }
768
769 pub fn by_item(
771 self,
772 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTargetsResponse, gax::error::Error>
773 {
774 use gax::paginator::Paginator;
775 self.by_page().items()
776 }
777
778 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
782 self.0.request.parent = v.into();
783 self
784 }
785
786 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
788 self.0.request.page_size = v.into();
789 self
790 }
791
792 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
794 self.0.request.page_token = v.into();
795 self
796 }
797
798 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
800 self.0.request.filter = v.into();
801 self
802 }
803
804 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
806 self.0.request.order_by = v.into();
807 self
808 }
809 }
810
811 #[doc(hidden)]
812 impl gax::options::internal::RequestBuilder for ListTargets {
813 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
814 &mut self.0.options
815 }
816 }
817
818 #[derive(Clone, Debug)]
835 pub struct RollbackTarget(RequestBuilder<crate::model::RollbackTargetRequest>);
836
837 impl RollbackTarget {
838 pub(crate) fn new(
839 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
840 ) -> Self {
841 Self(RequestBuilder::new(stub))
842 }
843
844 pub fn with_request<V: Into<crate::model::RollbackTargetRequest>>(mut self, v: V) -> Self {
846 self.0.request = v.into();
847 self
848 }
849
850 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
852 self.0.options = v.into();
853 self
854 }
855
856 pub async fn send(self) -> Result<crate::model::RollbackTargetResponse> {
858 (*self.0.stub)
859 .rollback_target(self.0.request, self.0.options)
860 .await
861 .map(gax::response::Response::into_body)
862 }
863
864 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
868 self.0.request.name = v.into();
869 self
870 }
871
872 pub fn set_target_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
876 self.0.request.target_id = v.into();
877 self
878 }
879
880 pub fn set_rollout_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
884 self.0.request.rollout_id = v.into();
885 self
886 }
887
888 pub fn set_release_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
890 self.0.request.release_id = v.into();
891 self
892 }
893
894 pub fn set_rollout_to_roll_back<T: Into<std::string::String>>(mut self, v: T) -> Self {
896 self.0.request.rollout_to_roll_back = v.into();
897 self
898 }
899
900 pub fn set_rollback_config<T>(mut self, v: T) -> Self
902 where
903 T: std::convert::Into<crate::model::RollbackTargetConfig>,
904 {
905 self.0.request.rollback_config = std::option::Option::Some(v.into());
906 self
907 }
908
909 pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
911 where
912 T: std::convert::Into<crate::model::RollbackTargetConfig>,
913 {
914 self.0.request.rollback_config = v.map(|x| x.into());
915 self
916 }
917
918 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
920 self.0.request.validate_only = v.into();
921 self
922 }
923
924 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
926 where
927 T: std::iter::IntoIterator<Item = V>,
928 V: std::convert::Into<std::string::String>,
929 {
930 use std::iter::Iterator;
931 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
932 self
933 }
934 }
935
936 #[doc(hidden)]
937 impl gax::options::internal::RequestBuilder for RollbackTarget {
938 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
939 &mut self.0.options
940 }
941 }
942
943 #[derive(Clone, Debug)]
960 pub struct GetTarget(RequestBuilder<crate::model::GetTargetRequest>);
961
962 impl GetTarget {
963 pub(crate) fn new(
964 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
965 ) -> Self {
966 Self(RequestBuilder::new(stub))
967 }
968
969 pub fn with_request<V: Into<crate::model::GetTargetRequest>>(mut self, v: V) -> Self {
971 self.0.request = v.into();
972 self
973 }
974
975 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
977 self.0.options = v.into();
978 self
979 }
980
981 pub async fn send(self) -> Result<crate::model::Target> {
983 (*self.0.stub)
984 .get_target(self.0.request, self.0.options)
985 .await
986 .map(gax::response::Response::into_body)
987 }
988
989 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
993 self.0.request.name = v.into();
994 self
995 }
996 }
997
998 #[doc(hidden)]
999 impl gax::options::internal::RequestBuilder for GetTarget {
1000 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1001 &mut self.0.options
1002 }
1003 }
1004
1005 #[derive(Clone, Debug)]
1023 pub struct CreateTarget(RequestBuilder<crate::model::CreateTargetRequest>);
1024
1025 impl CreateTarget {
1026 pub(crate) fn new(
1027 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1028 ) -> Self {
1029 Self(RequestBuilder::new(stub))
1030 }
1031
1032 pub fn with_request<V: Into<crate::model::CreateTargetRequest>>(mut self, v: V) -> Self {
1034 self.0.request = v.into();
1035 self
1036 }
1037
1038 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1040 self.0.options = v.into();
1041 self
1042 }
1043
1044 pub async fn send(self) -> Result<longrunning::model::Operation> {
1051 (*self.0.stub)
1052 .create_target(self.0.request, self.0.options)
1053 .await
1054 .map(gax::response::Response::into_body)
1055 }
1056
1057 pub fn poller(
1059 self,
1060 ) -> impl lro::Poller<crate::model::Target, crate::model::OperationMetadata> {
1061 type Operation =
1062 lro::internal::Operation<crate::model::Target, crate::model::OperationMetadata>;
1063 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1064 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1065
1066 let stub = self.0.stub.clone();
1067 let mut options = self.0.options.clone();
1068 options.set_retry_policy(gax::retry_policy::NeverRetry);
1069 let query = move |name| {
1070 let stub = stub.clone();
1071 let options = options.clone();
1072 async {
1073 let op = GetOperation::new(stub)
1074 .set_name(name)
1075 .with_options(options)
1076 .send()
1077 .await?;
1078 Ok(Operation::new(op))
1079 }
1080 };
1081
1082 let start = move || async {
1083 let op = self.send().await?;
1084 Ok(Operation::new(op))
1085 };
1086
1087 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1088 }
1089
1090 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1094 self.0.request.parent = v.into();
1095 self
1096 }
1097
1098 pub fn set_target_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1102 self.0.request.target_id = v.into();
1103 self
1104 }
1105
1106 pub fn set_target<T>(mut self, v: T) -> Self
1110 where
1111 T: std::convert::Into<crate::model::Target>,
1112 {
1113 self.0.request.target = std::option::Option::Some(v.into());
1114 self
1115 }
1116
1117 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
1121 where
1122 T: std::convert::Into<crate::model::Target>,
1123 {
1124 self.0.request.target = v.map(|x| x.into());
1125 self
1126 }
1127
1128 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1130 self.0.request.request_id = v.into();
1131 self
1132 }
1133
1134 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1136 self.0.request.validate_only = v.into();
1137 self
1138 }
1139 }
1140
1141 #[doc(hidden)]
1142 impl gax::options::internal::RequestBuilder for CreateTarget {
1143 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1144 &mut self.0.options
1145 }
1146 }
1147
1148 #[derive(Clone, Debug)]
1166 pub struct UpdateTarget(RequestBuilder<crate::model::UpdateTargetRequest>);
1167
1168 impl UpdateTarget {
1169 pub(crate) fn new(
1170 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1171 ) -> Self {
1172 Self(RequestBuilder::new(stub))
1173 }
1174
1175 pub fn with_request<V: Into<crate::model::UpdateTargetRequest>>(mut self, v: V) -> Self {
1177 self.0.request = v.into();
1178 self
1179 }
1180
1181 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1183 self.0.options = v.into();
1184 self
1185 }
1186
1187 pub async fn send(self) -> Result<longrunning::model::Operation> {
1194 (*self.0.stub)
1195 .update_target(self.0.request, self.0.options)
1196 .await
1197 .map(gax::response::Response::into_body)
1198 }
1199
1200 pub fn poller(
1202 self,
1203 ) -> impl lro::Poller<crate::model::Target, crate::model::OperationMetadata> {
1204 type Operation =
1205 lro::internal::Operation<crate::model::Target, crate::model::OperationMetadata>;
1206 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1207 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1208
1209 let stub = self.0.stub.clone();
1210 let mut options = self.0.options.clone();
1211 options.set_retry_policy(gax::retry_policy::NeverRetry);
1212 let query = move |name| {
1213 let stub = stub.clone();
1214 let options = options.clone();
1215 async {
1216 let op = GetOperation::new(stub)
1217 .set_name(name)
1218 .with_options(options)
1219 .send()
1220 .await?;
1221 Ok(Operation::new(op))
1222 }
1223 };
1224
1225 let start = move || async {
1226 let op = self.send().await?;
1227 Ok(Operation::new(op))
1228 };
1229
1230 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1231 }
1232
1233 pub fn set_update_mask<T>(mut self, v: T) -> Self
1237 where
1238 T: std::convert::Into<wkt::FieldMask>,
1239 {
1240 self.0.request.update_mask = std::option::Option::Some(v.into());
1241 self
1242 }
1243
1244 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1248 where
1249 T: std::convert::Into<wkt::FieldMask>,
1250 {
1251 self.0.request.update_mask = v.map(|x| x.into());
1252 self
1253 }
1254
1255 pub fn set_target<T>(mut self, v: T) -> Self
1259 where
1260 T: std::convert::Into<crate::model::Target>,
1261 {
1262 self.0.request.target = std::option::Option::Some(v.into());
1263 self
1264 }
1265
1266 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
1270 where
1271 T: std::convert::Into<crate::model::Target>,
1272 {
1273 self.0.request.target = v.map(|x| x.into());
1274 self
1275 }
1276
1277 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1279 self.0.request.request_id = v.into();
1280 self
1281 }
1282
1283 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1285 self.0.request.allow_missing = v.into();
1286 self
1287 }
1288
1289 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1291 self.0.request.validate_only = v.into();
1292 self
1293 }
1294 }
1295
1296 #[doc(hidden)]
1297 impl gax::options::internal::RequestBuilder for UpdateTarget {
1298 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1299 &mut self.0.options
1300 }
1301 }
1302
1303 #[derive(Clone, Debug)]
1321 pub struct DeleteTarget(RequestBuilder<crate::model::DeleteTargetRequest>);
1322
1323 impl DeleteTarget {
1324 pub(crate) fn new(
1325 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1326 ) -> Self {
1327 Self(RequestBuilder::new(stub))
1328 }
1329
1330 pub fn with_request<V: Into<crate::model::DeleteTargetRequest>>(mut self, v: V) -> Self {
1332 self.0.request = v.into();
1333 self
1334 }
1335
1336 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1338 self.0.options = v.into();
1339 self
1340 }
1341
1342 pub async fn send(self) -> Result<longrunning::model::Operation> {
1349 (*self.0.stub)
1350 .delete_target(self.0.request, self.0.options)
1351 .await
1352 .map(gax::response::Response::into_body)
1353 }
1354
1355 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1357 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1358 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1359 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1360
1361 let stub = self.0.stub.clone();
1362 let mut options = self.0.options.clone();
1363 options.set_retry_policy(gax::retry_policy::NeverRetry);
1364 let query = move |name| {
1365 let stub = stub.clone();
1366 let options = options.clone();
1367 async {
1368 let op = GetOperation::new(stub)
1369 .set_name(name)
1370 .with_options(options)
1371 .send()
1372 .await?;
1373 Ok(Operation::new(op))
1374 }
1375 };
1376
1377 let start = move || async {
1378 let op = self.send().await?;
1379 Ok(Operation::new(op))
1380 };
1381
1382 lro::internal::new_unit_response_poller(
1383 polling_error_policy,
1384 polling_backoff_policy,
1385 start,
1386 query,
1387 )
1388 }
1389
1390 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1394 self.0.request.name = v.into();
1395 self
1396 }
1397
1398 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1400 self.0.request.request_id = v.into();
1401 self
1402 }
1403
1404 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1406 self.0.request.allow_missing = v.into();
1407 self
1408 }
1409
1410 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1412 self.0.request.validate_only = v.into();
1413 self
1414 }
1415
1416 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1418 self.0.request.etag = v.into();
1419 self
1420 }
1421 }
1422
1423 #[doc(hidden)]
1424 impl gax::options::internal::RequestBuilder for DeleteTarget {
1425 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1426 &mut self.0.options
1427 }
1428 }
1429
1430 #[derive(Clone, Debug)]
1451 pub struct ListCustomTargetTypes(RequestBuilder<crate::model::ListCustomTargetTypesRequest>);
1452
1453 impl ListCustomTargetTypes {
1454 pub(crate) fn new(
1455 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1456 ) -> Self {
1457 Self(RequestBuilder::new(stub))
1458 }
1459
1460 pub fn with_request<V: Into<crate::model::ListCustomTargetTypesRequest>>(
1462 mut self,
1463 v: V,
1464 ) -> Self {
1465 self.0.request = v.into();
1466 self
1467 }
1468
1469 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1471 self.0.options = v.into();
1472 self
1473 }
1474
1475 pub async fn send(self) -> Result<crate::model::ListCustomTargetTypesResponse> {
1477 (*self.0.stub)
1478 .list_custom_target_types(self.0.request, self.0.options)
1479 .await
1480 .map(gax::response::Response::into_body)
1481 }
1482
1483 pub fn by_page(
1485 self,
1486 ) -> impl gax::paginator::Paginator<crate::model::ListCustomTargetTypesResponse, gax::error::Error>
1487 {
1488 use std::clone::Clone;
1489 let token = self.0.request.page_token.clone();
1490 let execute = move |token: String| {
1491 let mut builder = self.clone();
1492 builder.0.request = builder.0.request.set_page_token(token);
1493 builder.send()
1494 };
1495 gax::paginator::internal::new_paginator(token, execute)
1496 }
1497
1498 pub fn by_item(
1500 self,
1501 ) -> impl gax::paginator::ItemPaginator<
1502 crate::model::ListCustomTargetTypesResponse,
1503 gax::error::Error,
1504 > {
1505 use gax::paginator::Paginator;
1506 self.by_page().items()
1507 }
1508
1509 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1513 self.0.request.parent = v.into();
1514 self
1515 }
1516
1517 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1519 self.0.request.page_size = v.into();
1520 self
1521 }
1522
1523 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1525 self.0.request.page_token = v.into();
1526 self
1527 }
1528
1529 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1531 self.0.request.filter = v.into();
1532 self
1533 }
1534
1535 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1537 self.0.request.order_by = v.into();
1538 self
1539 }
1540 }
1541
1542 #[doc(hidden)]
1543 impl gax::options::internal::RequestBuilder for ListCustomTargetTypes {
1544 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1545 &mut self.0.options
1546 }
1547 }
1548
1549 #[derive(Clone, Debug)]
1566 pub struct GetCustomTargetType(RequestBuilder<crate::model::GetCustomTargetTypeRequest>);
1567
1568 impl GetCustomTargetType {
1569 pub(crate) fn new(
1570 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1571 ) -> Self {
1572 Self(RequestBuilder::new(stub))
1573 }
1574
1575 pub fn with_request<V: Into<crate::model::GetCustomTargetTypeRequest>>(
1577 mut self,
1578 v: V,
1579 ) -> Self {
1580 self.0.request = v.into();
1581 self
1582 }
1583
1584 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1586 self.0.options = v.into();
1587 self
1588 }
1589
1590 pub async fn send(self) -> Result<crate::model::CustomTargetType> {
1592 (*self.0.stub)
1593 .get_custom_target_type(self.0.request, self.0.options)
1594 .await
1595 .map(gax::response::Response::into_body)
1596 }
1597
1598 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1602 self.0.request.name = v.into();
1603 self
1604 }
1605 }
1606
1607 #[doc(hidden)]
1608 impl gax::options::internal::RequestBuilder for GetCustomTargetType {
1609 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1610 &mut self.0.options
1611 }
1612 }
1613
1614 #[derive(Clone, Debug)]
1632 pub struct CreateCustomTargetType(RequestBuilder<crate::model::CreateCustomTargetTypeRequest>);
1633
1634 impl CreateCustomTargetType {
1635 pub(crate) fn new(
1636 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1637 ) -> Self {
1638 Self(RequestBuilder::new(stub))
1639 }
1640
1641 pub fn with_request<V: Into<crate::model::CreateCustomTargetTypeRequest>>(
1643 mut self,
1644 v: V,
1645 ) -> Self {
1646 self.0.request = v.into();
1647 self
1648 }
1649
1650 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1652 self.0.options = v.into();
1653 self
1654 }
1655
1656 pub async fn send(self) -> Result<longrunning::model::Operation> {
1663 (*self.0.stub)
1664 .create_custom_target_type(self.0.request, self.0.options)
1665 .await
1666 .map(gax::response::Response::into_body)
1667 }
1668
1669 pub fn poller(
1671 self,
1672 ) -> impl lro::Poller<crate::model::CustomTargetType, crate::model::OperationMetadata>
1673 {
1674 type Operation = lro::internal::Operation<
1675 crate::model::CustomTargetType,
1676 crate::model::OperationMetadata,
1677 >;
1678 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1679 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1680
1681 let stub = self.0.stub.clone();
1682 let mut options = self.0.options.clone();
1683 options.set_retry_policy(gax::retry_policy::NeverRetry);
1684 let query = move |name| {
1685 let stub = stub.clone();
1686 let options = options.clone();
1687 async {
1688 let op = GetOperation::new(stub)
1689 .set_name(name)
1690 .with_options(options)
1691 .send()
1692 .await?;
1693 Ok(Operation::new(op))
1694 }
1695 };
1696
1697 let start = move || async {
1698 let op = self.send().await?;
1699 Ok(Operation::new(op))
1700 };
1701
1702 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1703 }
1704
1705 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1709 self.0.request.parent = v.into();
1710 self
1711 }
1712
1713 pub fn set_custom_target_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1717 self.0.request.custom_target_type_id = v.into();
1718 self
1719 }
1720
1721 pub fn set_custom_target_type<T>(mut self, v: T) -> Self
1725 where
1726 T: std::convert::Into<crate::model::CustomTargetType>,
1727 {
1728 self.0.request.custom_target_type = std::option::Option::Some(v.into());
1729 self
1730 }
1731
1732 pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
1736 where
1737 T: std::convert::Into<crate::model::CustomTargetType>,
1738 {
1739 self.0.request.custom_target_type = v.map(|x| x.into());
1740 self
1741 }
1742
1743 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1745 self.0.request.request_id = v.into();
1746 self
1747 }
1748
1749 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1751 self.0.request.validate_only = v.into();
1752 self
1753 }
1754 }
1755
1756 #[doc(hidden)]
1757 impl gax::options::internal::RequestBuilder for CreateCustomTargetType {
1758 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1759 &mut self.0.options
1760 }
1761 }
1762
1763 #[derive(Clone, Debug)]
1781 pub struct UpdateCustomTargetType(RequestBuilder<crate::model::UpdateCustomTargetTypeRequest>);
1782
1783 impl UpdateCustomTargetType {
1784 pub(crate) fn new(
1785 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1786 ) -> Self {
1787 Self(RequestBuilder::new(stub))
1788 }
1789
1790 pub fn with_request<V: Into<crate::model::UpdateCustomTargetTypeRequest>>(
1792 mut self,
1793 v: V,
1794 ) -> Self {
1795 self.0.request = v.into();
1796 self
1797 }
1798
1799 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1801 self.0.options = v.into();
1802 self
1803 }
1804
1805 pub async fn send(self) -> Result<longrunning::model::Operation> {
1812 (*self.0.stub)
1813 .update_custom_target_type(self.0.request, self.0.options)
1814 .await
1815 .map(gax::response::Response::into_body)
1816 }
1817
1818 pub fn poller(
1820 self,
1821 ) -> impl lro::Poller<crate::model::CustomTargetType, crate::model::OperationMetadata>
1822 {
1823 type Operation = lro::internal::Operation<
1824 crate::model::CustomTargetType,
1825 crate::model::OperationMetadata,
1826 >;
1827 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1828 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1829
1830 let stub = self.0.stub.clone();
1831 let mut options = self.0.options.clone();
1832 options.set_retry_policy(gax::retry_policy::NeverRetry);
1833 let query = move |name| {
1834 let stub = stub.clone();
1835 let options = options.clone();
1836 async {
1837 let op = GetOperation::new(stub)
1838 .set_name(name)
1839 .with_options(options)
1840 .send()
1841 .await?;
1842 Ok(Operation::new(op))
1843 }
1844 };
1845
1846 let start = move || async {
1847 let op = self.send().await?;
1848 Ok(Operation::new(op))
1849 };
1850
1851 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1852 }
1853
1854 pub fn set_update_mask<T>(mut self, v: T) -> Self
1858 where
1859 T: std::convert::Into<wkt::FieldMask>,
1860 {
1861 self.0.request.update_mask = std::option::Option::Some(v.into());
1862 self
1863 }
1864
1865 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1869 where
1870 T: std::convert::Into<wkt::FieldMask>,
1871 {
1872 self.0.request.update_mask = v.map(|x| x.into());
1873 self
1874 }
1875
1876 pub fn set_custom_target_type<T>(mut self, v: T) -> Self
1880 where
1881 T: std::convert::Into<crate::model::CustomTargetType>,
1882 {
1883 self.0.request.custom_target_type = std::option::Option::Some(v.into());
1884 self
1885 }
1886
1887 pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
1891 where
1892 T: std::convert::Into<crate::model::CustomTargetType>,
1893 {
1894 self.0.request.custom_target_type = v.map(|x| x.into());
1895 self
1896 }
1897
1898 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1900 self.0.request.request_id = v.into();
1901 self
1902 }
1903
1904 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1906 self.0.request.allow_missing = v.into();
1907 self
1908 }
1909
1910 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1912 self.0.request.validate_only = v.into();
1913 self
1914 }
1915 }
1916
1917 #[doc(hidden)]
1918 impl gax::options::internal::RequestBuilder for UpdateCustomTargetType {
1919 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1920 &mut self.0.options
1921 }
1922 }
1923
1924 #[derive(Clone, Debug)]
1942 pub struct DeleteCustomTargetType(RequestBuilder<crate::model::DeleteCustomTargetTypeRequest>);
1943
1944 impl DeleteCustomTargetType {
1945 pub(crate) fn new(
1946 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
1947 ) -> Self {
1948 Self(RequestBuilder::new(stub))
1949 }
1950
1951 pub fn with_request<V: Into<crate::model::DeleteCustomTargetTypeRequest>>(
1953 mut self,
1954 v: V,
1955 ) -> Self {
1956 self.0.request = v.into();
1957 self
1958 }
1959
1960 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1962 self.0.options = v.into();
1963 self
1964 }
1965
1966 pub async fn send(self) -> Result<longrunning::model::Operation> {
1973 (*self.0.stub)
1974 .delete_custom_target_type(self.0.request, self.0.options)
1975 .await
1976 .map(gax::response::Response::into_body)
1977 }
1978
1979 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1981 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1982 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1983 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1984
1985 let stub = self.0.stub.clone();
1986 let mut options = self.0.options.clone();
1987 options.set_retry_policy(gax::retry_policy::NeverRetry);
1988 let query = move |name| {
1989 let stub = stub.clone();
1990 let options = options.clone();
1991 async {
1992 let op = GetOperation::new(stub)
1993 .set_name(name)
1994 .with_options(options)
1995 .send()
1996 .await?;
1997 Ok(Operation::new(op))
1998 }
1999 };
2000
2001 let start = move || async {
2002 let op = self.send().await?;
2003 Ok(Operation::new(op))
2004 };
2005
2006 lro::internal::new_unit_response_poller(
2007 polling_error_policy,
2008 polling_backoff_policy,
2009 start,
2010 query,
2011 )
2012 }
2013
2014 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2018 self.0.request.name = v.into();
2019 self
2020 }
2021
2022 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2024 self.0.request.request_id = v.into();
2025 self
2026 }
2027
2028 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2030 self.0.request.allow_missing = v.into();
2031 self
2032 }
2033
2034 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2036 self.0.request.validate_only = v.into();
2037 self
2038 }
2039
2040 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2042 self.0.request.etag = v.into();
2043 self
2044 }
2045 }
2046
2047 #[doc(hidden)]
2048 impl gax::options::internal::RequestBuilder for DeleteCustomTargetType {
2049 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2050 &mut self.0.options
2051 }
2052 }
2053
2054 #[derive(Clone, Debug)]
2075 pub struct ListReleases(RequestBuilder<crate::model::ListReleasesRequest>);
2076
2077 impl ListReleases {
2078 pub(crate) fn new(
2079 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2080 ) -> Self {
2081 Self(RequestBuilder::new(stub))
2082 }
2083
2084 pub fn with_request<V: Into<crate::model::ListReleasesRequest>>(mut self, v: V) -> Self {
2086 self.0.request = v.into();
2087 self
2088 }
2089
2090 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2092 self.0.options = v.into();
2093 self
2094 }
2095
2096 pub async fn send(self) -> Result<crate::model::ListReleasesResponse> {
2098 (*self.0.stub)
2099 .list_releases(self.0.request, self.0.options)
2100 .await
2101 .map(gax::response::Response::into_body)
2102 }
2103
2104 pub fn by_page(
2106 self,
2107 ) -> impl gax::paginator::Paginator<crate::model::ListReleasesResponse, gax::error::Error>
2108 {
2109 use std::clone::Clone;
2110 let token = self.0.request.page_token.clone();
2111 let execute = move |token: String| {
2112 let mut builder = self.clone();
2113 builder.0.request = builder.0.request.set_page_token(token);
2114 builder.send()
2115 };
2116 gax::paginator::internal::new_paginator(token, execute)
2117 }
2118
2119 pub fn by_item(
2121 self,
2122 ) -> impl gax::paginator::ItemPaginator<crate::model::ListReleasesResponse, gax::error::Error>
2123 {
2124 use gax::paginator::Paginator;
2125 self.by_page().items()
2126 }
2127
2128 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2132 self.0.request.parent = v.into();
2133 self
2134 }
2135
2136 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2138 self.0.request.page_size = v.into();
2139 self
2140 }
2141
2142 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2144 self.0.request.page_token = v.into();
2145 self
2146 }
2147
2148 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2150 self.0.request.filter = v.into();
2151 self
2152 }
2153
2154 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2156 self.0.request.order_by = v.into();
2157 self
2158 }
2159 }
2160
2161 #[doc(hidden)]
2162 impl gax::options::internal::RequestBuilder for ListReleases {
2163 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2164 &mut self.0.options
2165 }
2166 }
2167
2168 #[derive(Clone, Debug)]
2185 pub struct GetRelease(RequestBuilder<crate::model::GetReleaseRequest>);
2186
2187 impl GetRelease {
2188 pub(crate) fn new(
2189 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2190 ) -> Self {
2191 Self(RequestBuilder::new(stub))
2192 }
2193
2194 pub fn with_request<V: Into<crate::model::GetReleaseRequest>>(mut self, v: V) -> Self {
2196 self.0.request = v.into();
2197 self
2198 }
2199
2200 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2202 self.0.options = v.into();
2203 self
2204 }
2205
2206 pub async fn send(self) -> Result<crate::model::Release> {
2208 (*self.0.stub)
2209 .get_release(self.0.request, self.0.options)
2210 .await
2211 .map(gax::response::Response::into_body)
2212 }
2213
2214 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2218 self.0.request.name = v.into();
2219 self
2220 }
2221 }
2222
2223 #[doc(hidden)]
2224 impl gax::options::internal::RequestBuilder for GetRelease {
2225 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2226 &mut self.0.options
2227 }
2228 }
2229
2230 #[derive(Clone, Debug)]
2248 pub struct CreateRelease(RequestBuilder<crate::model::CreateReleaseRequest>);
2249
2250 impl CreateRelease {
2251 pub(crate) fn new(
2252 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2253 ) -> Self {
2254 Self(RequestBuilder::new(stub))
2255 }
2256
2257 pub fn with_request<V: Into<crate::model::CreateReleaseRequest>>(mut self, v: V) -> Self {
2259 self.0.request = v.into();
2260 self
2261 }
2262
2263 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2265 self.0.options = v.into();
2266 self
2267 }
2268
2269 pub async fn send(self) -> Result<longrunning::model::Operation> {
2276 (*self.0.stub)
2277 .create_release(self.0.request, self.0.options)
2278 .await
2279 .map(gax::response::Response::into_body)
2280 }
2281
2282 pub fn poller(
2284 self,
2285 ) -> impl lro::Poller<crate::model::Release, crate::model::OperationMetadata> {
2286 type Operation =
2287 lro::internal::Operation<crate::model::Release, crate::model::OperationMetadata>;
2288 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2289 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2290
2291 let stub = self.0.stub.clone();
2292 let mut options = self.0.options.clone();
2293 options.set_retry_policy(gax::retry_policy::NeverRetry);
2294 let query = move |name| {
2295 let stub = stub.clone();
2296 let options = options.clone();
2297 async {
2298 let op = GetOperation::new(stub)
2299 .set_name(name)
2300 .with_options(options)
2301 .send()
2302 .await?;
2303 Ok(Operation::new(op))
2304 }
2305 };
2306
2307 let start = move || async {
2308 let op = self.send().await?;
2309 Ok(Operation::new(op))
2310 };
2311
2312 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2313 }
2314
2315 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2319 self.0.request.parent = v.into();
2320 self
2321 }
2322
2323 pub fn set_release_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2327 self.0.request.release_id = v.into();
2328 self
2329 }
2330
2331 pub fn set_release<T>(mut self, v: T) -> Self
2335 where
2336 T: std::convert::Into<crate::model::Release>,
2337 {
2338 self.0.request.release = std::option::Option::Some(v.into());
2339 self
2340 }
2341
2342 pub fn set_or_clear_release<T>(mut self, v: std::option::Option<T>) -> Self
2346 where
2347 T: std::convert::Into<crate::model::Release>,
2348 {
2349 self.0.request.release = v.map(|x| x.into());
2350 self
2351 }
2352
2353 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2355 self.0.request.request_id = v.into();
2356 self
2357 }
2358
2359 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2361 self.0.request.validate_only = v.into();
2362 self
2363 }
2364
2365 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
2367 where
2368 T: std::iter::IntoIterator<Item = V>,
2369 V: std::convert::Into<std::string::String>,
2370 {
2371 use std::iter::Iterator;
2372 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
2373 self
2374 }
2375 }
2376
2377 #[doc(hidden)]
2378 impl gax::options::internal::RequestBuilder for CreateRelease {
2379 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2380 &mut self.0.options
2381 }
2382 }
2383
2384 #[derive(Clone, Debug)]
2401 pub struct AbandonRelease(RequestBuilder<crate::model::AbandonReleaseRequest>);
2402
2403 impl AbandonRelease {
2404 pub(crate) fn new(
2405 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2406 ) -> Self {
2407 Self(RequestBuilder::new(stub))
2408 }
2409
2410 pub fn with_request<V: Into<crate::model::AbandonReleaseRequest>>(mut self, v: V) -> Self {
2412 self.0.request = v.into();
2413 self
2414 }
2415
2416 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2418 self.0.options = v.into();
2419 self
2420 }
2421
2422 pub async fn send(self) -> Result<crate::model::AbandonReleaseResponse> {
2424 (*self.0.stub)
2425 .abandon_release(self.0.request, self.0.options)
2426 .await
2427 .map(gax::response::Response::into_body)
2428 }
2429
2430 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2434 self.0.request.name = v.into();
2435 self
2436 }
2437 }
2438
2439 #[doc(hidden)]
2440 impl gax::options::internal::RequestBuilder for AbandonRelease {
2441 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2442 &mut self.0.options
2443 }
2444 }
2445
2446 #[derive(Clone, Debug)]
2464 pub struct CreateDeployPolicy(RequestBuilder<crate::model::CreateDeployPolicyRequest>);
2465
2466 impl CreateDeployPolicy {
2467 pub(crate) fn new(
2468 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2469 ) -> Self {
2470 Self(RequestBuilder::new(stub))
2471 }
2472
2473 pub fn with_request<V: Into<crate::model::CreateDeployPolicyRequest>>(
2475 mut self,
2476 v: V,
2477 ) -> Self {
2478 self.0.request = v.into();
2479 self
2480 }
2481
2482 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2484 self.0.options = v.into();
2485 self
2486 }
2487
2488 pub async fn send(self) -> Result<longrunning::model::Operation> {
2495 (*self.0.stub)
2496 .create_deploy_policy(self.0.request, self.0.options)
2497 .await
2498 .map(gax::response::Response::into_body)
2499 }
2500
2501 pub fn poller(
2503 self,
2504 ) -> impl lro::Poller<crate::model::DeployPolicy, crate::model::OperationMetadata> {
2505 type Operation = lro::internal::Operation<
2506 crate::model::DeployPolicy,
2507 crate::model::OperationMetadata,
2508 >;
2509 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2510 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2511
2512 let stub = self.0.stub.clone();
2513 let mut options = self.0.options.clone();
2514 options.set_retry_policy(gax::retry_policy::NeverRetry);
2515 let query = move |name| {
2516 let stub = stub.clone();
2517 let options = options.clone();
2518 async {
2519 let op = GetOperation::new(stub)
2520 .set_name(name)
2521 .with_options(options)
2522 .send()
2523 .await?;
2524 Ok(Operation::new(op))
2525 }
2526 };
2527
2528 let start = move || async {
2529 let op = self.send().await?;
2530 Ok(Operation::new(op))
2531 };
2532
2533 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2534 }
2535
2536 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2540 self.0.request.parent = v.into();
2541 self
2542 }
2543
2544 pub fn set_deploy_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2548 self.0.request.deploy_policy_id = v.into();
2549 self
2550 }
2551
2552 pub fn set_deploy_policy<T>(mut self, v: T) -> Self
2556 where
2557 T: std::convert::Into<crate::model::DeployPolicy>,
2558 {
2559 self.0.request.deploy_policy = std::option::Option::Some(v.into());
2560 self
2561 }
2562
2563 pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
2567 where
2568 T: std::convert::Into<crate::model::DeployPolicy>,
2569 {
2570 self.0.request.deploy_policy = v.map(|x| x.into());
2571 self
2572 }
2573
2574 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2576 self.0.request.request_id = v.into();
2577 self
2578 }
2579
2580 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2582 self.0.request.validate_only = v.into();
2583 self
2584 }
2585 }
2586
2587 #[doc(hidden)]
2588 impl gax::options::internal::RequestBuilder for CreateDeployPolicy {
2589 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2590 &mut self.0.options
2591 }
2592 }
2593
2594 #[derive(Clone, Debug)]
2612 pub struct UpdateDeployPolicy(RequestBuilder<crate::model::UpdateDeployPolicyRequest>);
2613
2614 impl UpdateDeployPolicy {
2615 pub(crate) fn new(
2616 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2617 ) -> Self {
2618 Self(RequestBuilder::new(stub))
2619 }
2620
2621 pub fn with_request<V: Into<crate::model::UpdateDeployPolicyRequest>>(
2623 mut self,
2624 v: V,
2625 ) -> Self {
2626 self.0.request = v.into();
2627 self
2628 }
2629
2630 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2632 self.0.options = v.into();
2633 self
2634 }
2635
2636 pub async fn send(self) -> Result<longrunning::model::Operation> {
2643 (*self.0.stub)
2644 .update_deploy_policy(self.0.request, self.0.options)
2645 .await
2646 .map(gax::response::Response::into_body)
2647 }
2648
2649 pub fn poller(
2651 self,
2652 ) -> impl lro::Poller<crate::model::DeployPolicy, crate::model::OperationMetadata> {
2653 type Operation = lro::internal::Operation<
2654 crate::model::DeployPolicy,
2655 crate::model::OperationMetadata,
2656 >;
2657 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2658 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2659
2660 let stub = self.0.stub.clone();
2661 let mut options = self.0.options.clone();
2662 options.set_retry_policy(gax::retry_policy::NeverRetry);
2663 let query = move |name| {
2664 let stub = stub.clone();
2665 let options = options.clone();
2666 async {
2667 let op = GetOperation::new(stub)
2668 .set_name(name)
2669 .with_options(options)
2670 .send()
2671 .await?;
2672 Ok(Operation::new(op))
2673 }
2674 };
2675
2676 let start = move || async {
2677 let op = self.send().await?;
2678 Ok(Operation::new(op))
2679 };
2680
2681 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2682 }
2683
2684 pub fn set_update_mask<T>(mut self, v: T) -> Self
2688 where
2689 T: std::convert::Into<wkt::FieldMask>,
2690 {
2691 self.0.request.update_mask = std::option::Option::Some(v.into());
2692 self
2693 }
2694
2695 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2699 where
2700 T: std::convert::Into<wkt::FieldMask>,
2701 {
2702 self.0.request.update_mask = v.map(|x| x.into());
2703 self
2704 }
2705
2706 pub fn set_deploy_policy<T>(mut self, v: T) -> Self
2710 where
2711 T: std::convert::Into<crate::model::DeployPolicy>,
2712 {
2713 self.0.request.deploy_policy = std::option::Option::Some(v.into());
2714 self
2715 }
2716
2717 pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
2721 where
2722 T: std::convert::Into<crate::model::DeployPolicy>,
2723 {
2724 self.0.request.deploy_policy = v.map(|x| x.into());
2725 self
2726 }
2727
2728 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2730 self.0.request.request_id = v.into();
2731 self
2732 }
2733
2734 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2736 self.0.request.allow_missing = v.into();
2737 self
2738 }
2739
2740 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2742 self.0.request.validate_only = v.into();
2743 self
2744 }
2745 }
2746
2747 #[doc(hidden)]
2748 impl gax::options::internal::RequestBuilder for UpdateDeployPolicy {
2749 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2750 &mut self.0.options
2751 }
2752 }
2753
2754 #[derive(Clone, Debug)]
2772 pub struct DeleteDeployPolicy(RequestBuilder<crate::model::DeleteDeployPolicyRequest>);
2773
2774 impl DeleteDeployPolicy {
2775 pub(crate) fn new(
2776 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2777 ) -> Self {
2778 Self(RequestBuilder::new(stub))
2779 }
2780
2781 pub fn with_request<V: Into<crate::model::DeleteDeployPolicyRequest>>(
2783 mut self,
2784 v: V,
2785 ) -> Self {
2786 self.0.request = v.into();
2787 self
2788 }
2789
2790 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2792 self.0.options = v.into();
2793 self
2794 }
2795
2796 pub async fn send(self) -> Result<longrunning::model::Operation> {
2803 (*self.0.stub)
2804 .delete_deploy_policy(self.0.request, self.0.options)
2805 .await
2806 .map(gax::response::Response::into_body)
2807 }
2808
2809 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2811 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2812 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2813 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2814
2815 let stub = self.0.stub.clone();
2816 let mut options = self.0.options.clone();
2817 options.set_retry_policy(gax::retry_policy::NeverRetry);
2818 let query = move |name| {
2819 let stub = stub.clone();
2820 let options = options.clone();
2821 async {
2822 let op = GetOperation::new(stub)
2823 .set_name(name)
2824 .with_options(options)
2825 .send()
2826 .await?;
2827 Ok(Operation::new(op))
2828 }
2829 };
2830
2831 let start = move || async {
2832 let op = self.send().await?;
2833 Ok(Operation::new(op))
2834 };
2835
2836 lro::internal::new_unit_response_poller(
2837 polling_error_policy,
2838 polling_backoff_policy,
2839 start,
2840 query,
2841 )
2842 }
2843
2844 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2848 self.0.request.name = v.into();
2849 self
2850 }
2851
2852 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2854 self.0.request.request_id = v.into();
2855 self
2856 }
2857
2858 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2860 self.0.request.allow_missing = v.into();
2861 self
2862 }
2863
2864 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2866 self.0.request.validate_only = v.into();
2867 self
2868 }
2869
2870 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2872 self.0.request.etag = v.into();
2873 self
2874 }
2875 }
2876
2877 #[doc(hidden)]
2878 impl gax::options::internal::RequestBuilder for DeleteDeployPolicy {
2879 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2880 &mut self.0.options
2881 }
2882 }
2883
2884 #[derive(Clone, Debug)]
2905 pub struct ListDeployPolicies(RequestBuilder<crate::model::ListDeployPoliciesRequest>);
2906
2907 impl ListDeployPolicies {
2908 pub(crate) fn new(
2909 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
2910 ) -> Self {
2911 Self(RequestBuilder::new(stub))
2912 }
2913
2914 pub fn with_request<V: Into<crate::model::ListDeployPoliciesRequest>>(
2916 mut self,
2917 v: V,
2918 ) -> Self {
2919 self.0.request = v.into();
2920 self
2921 }
2922
2923 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2925 self.0.options = v.into();
2926 self
2927 }
2928
2929 pub async fn send(self) -> Result<crate::model::ListDeployPoliciesResponse> {
2931 (*self.0.stub)
2932 .list_deploy_policies(self.0.request, self.0.options)
2933 .await
2934 .map(gax::response::Response::into_body)
2935 }
2936
2937 pub fn by_page(
2939 self,
2940 ) -> impl gax::paginator::Paginator<crate::model::ListDeployPoliciesResponse, gax::error::Error>
2941 {
2942 use std::clone::Clone;
2943 let token = self.0.request.page_token.clone();
2944 let execute = move |token: String| {
2945 let mut builder = self.clone();
2946 builder.0.request = builder.0.request.set_page_token(token);
2947 builder.send()
2948 };
2949 gax::paginator::internal::new_paginator(token, execute)
2950 }
2951
2952 pub fn by_item(
2954 self,
2955 ) -> impl gax::paginator::ItemPaginator<
2956 crate::model::ListDeployPoliciesResponse,
2957 gax::error::Error,
2958 > {
2959 use gax::paginator::Paginator;
2960 self.by_page().items()
2961 }
2962
2963 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2967 self.0.request.parent = v.into();
2968 self
2969 }
2970
2971 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2973 self.0.request.page_size = v.into();
2974 self
2975 }
2976
2977 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2979 self.0.request.page_token = v.into();
2980 self
2981 }
2982
2983 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2985 self.0.request.filter = v.into();
2986 self
2987 }
2988
2989 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2991 self.0.request.order_by = v.into();
2992 self
2993 }
2994 }
2995
2996 #[doc(hidden)]
2997 impl gax::options::internal::RequestBuilder for ListDeployPolicies {
2998 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2999 &mut self.0.options
3000 }
3001 }
3002
3003 #[derive(Clone, Debug)]
3020 pub struct GetDeployPolicy(RequestBuilder<crate::model::GetDeployPolicyRequest>);
3021
3022 impl GetDeployPolicy {
3023 pub(crate) fn new(
3024 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3025 ) -> Self {
3026 Self(RequestBuilder::new(stub))
3027 }
3028
3029 pub fn with_request<V: Into<crate::model::GetDeployPolicyRequest>>(mut self, v: V) -> Self {
3031 self.0.request = v.into();
3032 self
3033 }
3034
3035 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3037 self.0.options = v.into();
3038 self
3039 }
3040
3041 pub async fn send(self) -> Result<crate::model::DeployPolicy> {
3043 (*self.0.stub)
3044 .get_deploy_policy(self.0.request, self.0.options)
3045 .await
3046 .map(gax::response::Response::into_body)
3047 }
3048
3049 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3053 self.0.request.name = v.into();
3054 self
3055 }
3056 }
3057
3058 #[doc(hidden)]
3059 impl gax::options::internal::RequestBuilder for GetDeployPolicy {
3060 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3061 &mut self.0.options
3062 }
3063 }
3064
3065 #[derive(Clone, Debug)]
3082 pub struct ApproveRollout(RequestBuilder<crate::model::ApproveRolloutRequest>);
3083
3084 impl ApproveRollout {
3085 pub(crate) fn new(
3086 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3087 ) -> Self {
3088 Self(RequestBuilder::new(stub))
3089 }
3090
3091 pub fn with_request<V: Into<crate::model::ApproveRolloutRequest>>(mut self, v: V) -> Self {
3093 self.0.request = v.into();
3094 self
3095 }
3096
3097 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3099 self.0.options = v.into();
3100 self
3101 }
3102
3103 pub async fn send(self) -> Result<crate::model::ApproveRolloutResponse> {
3105 (*self.0.stub)
3106 .approve_rollout(self.0.request, self.0.options)
3107 .await
3108 .map(gax::response::Response::into_body)
3109 }
3110
3111 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3115 self.0.request.name = v.into();
3116 self
3117 }
3118
3119 pub fn set_approved<T: Into<bool>>(mut self, v: T) -> Self {
3123 self.0.request.approved = v.into();
3124 self
3125 }
3126
3127 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3129 where
3130 T: std::iter::IntoIterator<Item = V>,
3131 V: std::convert::Into<std::string::String>,
3132 {
3133 use std::iter::Iterator;
3134 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3135 self
3136 }
3137 }
3138
3139 #[doc(hidden)]
3140 impl gax::options::internal::RequestBuilder for ApproveRollout {
3141 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3142 &mut self.0.options
3143 }
3144 }
3145
3146 #[derive(Clone, Debug)]
3163 pub struct AdvanceRollout(RequestBuilder<crate::model::AdvanceRolloutRequest>);
3164
3165 impl AdvanceRollout {
3166 pub(crate) fn new(
3167 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3168 ) -> Self {
3169 Self(RequestBuilder::new(stub))
3170 }
3171
3172 pub fn with_request<V: Into<crate::model::AdvanceRolloutRequest>>(mut self, v: V) -> Self {
3174 self.0.request = v.into();
3175 self
3176 }
3177
3178 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3180 self.0.options = v.into();
3181 self
3182 }
3183
3184 pub async fn send(self) -> Result<crate::model::AdvanceRolloutResponse> {
3186 (*self.0.stub)
3187 .advance_rollout(self.0.request, self.0.options)
3188 .await
3189 .map(gax::response::Response::into_body)
3190 }
3191
3192 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3196 self.0.request.name = v.into();
3197 self
3198 }
3199
3200 pub fn set_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3204 self.0.request.phase_id = v.into();
3205 self
3206 }
3207
3208 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3210 where
3211 T: std::iter::IntoIterator<Item = V>,
3212 V: std::convert::Into<std::string::String>,
3213 {
3214 use std::iter::Iterator;
3215 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3216 self
3217 }
3218 }
3219
3220 #[doc(hidden)]
3221 impl gax::options::internal::RequestBuilder for AdvanceRollout {
3222 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3223 &mut self.0.options
3224 }
3225 }
3226
3227 #[derive(Clone, Debug)]
3244 pub struct CancelRollout(RequestBuilder<crate::model::CancelRolloutRequest>);
3245
3246 impl CancelRollout {
3247 pub(crate) fn new(
3248 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3249 ) -> Self {
3250 Self(RequestBuilder::new(stub))
3251 }
3252
3253 pub fn with_request<V: Into<crate::model::CancelRolloutRequest>>(mut self, v: V) -> Self {
3255 self.0.request = v.into();
3256 self
3257 }
3258
3259 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3261 self.0.options = v.into();
3262 self
3263 }
3264
3265 pub async fn send(self) -> Result<crate::model::CancelRolloutResponse> {
3267 (*self.0.stub)
3268 .cancel_rollout(self.0.request, self.0.options)
3269 .await
3270 .map(gax::response::Response::into_body)
3271 }
3272
3273 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3277 self.0.request.name = v.into();
3278 self
3279 }
3280
3281 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3283 where
3284 T: std::iter::IntoIterator<Item = V>,
3285 V: std::convert::Into<std::string::String>,
3286 {
3287 use std::iter::Iterator;
3288 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3289 self
3290 }
3291 }
3292
3293 #[doc(hidden)]
3294 impl gax::options::internal::RequestBuilder for CancelRollout {
3295 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3296 &mut self.0.options
3297 }
3298 }
3299
3300 #[derive(Clone, Debug)]
3321 pub struct ListRollouts(RequestBuilder<crate::model::ListRolloutsRequest>);
3322
3323 impl ListRollouts {
3324 pub(crate) fn new(
3325 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3326 ) -> Self {
3327 Self(RequestBuilder::new(stub))
3328 }
3329
3330 pub fn with_request<V: Into<crate::model::ListRolloutsRequest>>(mut self, v: V) -> Self {
3332 self.0.request = v.into();
3333 self
3334 }
3335
3336 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3338 self.0.options = v.into();
3339 self
3340 }
3341
3342 pub async fn send(self) -> Result<crate::model::ListRolloutsResponse> {
3344 (*self.0.stub)
3345 .list_rollouts(self.0.request, self.0.options)
3346 .await
3347 .map(gax::response::Response::into_body)
3348 }
3349
3350 pub fn by_page(
3352 self,
3353 ) -> impl gax::paginator::Paginator<crate::model::ListRolloutsResponse, gax::error::Error>
3354 {
3355 use std::clone::Clone;
3356 let token = self.0.request.page_token.clone();
3357 let execute = move |token: String| {
3358 let mut builder = self.clone();
3359 builder.0.request = builder.0.request.set_page_token(token);
3360 builder.send()
3361 };
3362 gax::paginator::internal::new_paginator(token, execute)
3363 }
3364
3365 pub fn by_item(
3367 self,
3368 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRolloutsResponse, gax::error::Error>
3369 {
3370 use gax::paginator::Paginator;
3371 self.by_page().items()
3372 }
3373
3374 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3378 self.0.request.parent = v.into();
3379 self
3380 }
3381
3382 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3384 self.0.request.page_size = v.into();
3385 self
3386 }
3387
3388 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3390 self.0.request.page_token = v.into();
3391 self
3392 }
3393
3394 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3396 self.0.request.filter = v.into();
3397 self
3398 }
3399
3400 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3402 self.0.request.order_by = v.into();
3403 self
3404 }
3405 }
3406
3407 #[doc(hidden)]
3408 impl gax::options::internal::RequestBuilder for ListRollouts {
3409 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3410 &mut self.0.options
3411 }
3412 }
3413
3414 #[derive(Clone, Debug)]
3431 pub struct GetRollout(RequestBuilder<crate::model::GetRolloutRequest>);
3432
3433 impl GetRollout {
3434 pub(crate) fn new(
3435 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3436 ) -> Self {
3437 Self(RequestBuilder::new(stub))
3438 }
3439
3440 pub fn with_request<V: Into<crate::model::GetRolloutRequest>>(mut self, v: V) -> Self {
3442 self.0.request = v.into();
3443 self
3444 }
3445
3446 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3448 self.0.options = v.into();
3449 self
3450 }
3451
3452 pub async fn send(self) -> Result<crate::model::Rollout> {
3454 (*self.0.stub)
3455 .get_rollout(self.0.request, self.0.options)
3456 .await
3457 .map(gax::response::Response::into_body)
3458 }
3459
3460 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3464 self.0.request.name = v.into();
3465 self
3466 }
3467 }
3468
3469 #[doc(hidden)]
3470 impl gax::options::internal::RequestBuilder for GetRollout {
3471 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3472 &mut self.0.options
3473 }
3474 }
3475
3476 #[derive(Clone, Debug)]
3494 pub struct CreateRollout(RequestBuilder<crate::model::CreateRolloutRequest>);
3495
3496 impl CreateRollout {
3497 pub(crate) fn new(
3498 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3499 ) -> Self {
3500 Self(RequestBuilder::new(stub))
3501 }
3502
3503 pub fn with_request<V: Into<crate::model::CreateRolloutRequest>>(mut self, v: V) -> Self {
3505 self.0.request = v.into();
3506 self
3507 }
3508
3509 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3511 self.0.options = v.into();
3512 self
3513 }
3514
3515 pub async fn send(self) -> Result<longrunning::model::Operation> {
3522 (*self.0.stub)
3523 .create_rollout(self.0.request, self.0.options)
3524 .await
3525 .map(gax::response::Response::into_body)
3526 }
3527
3528 pub fn poller(
3530 self,
3531 ) -> impl lro::Poller<crate::model::Rollout, crate::model::OperationMetadata> {
3532 type Operation =
3533 lro::internal::Operation<crate::model::Rollout, crate::model::OperationMetadata>;
3534 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3535 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3536
3537 let stub = self.0.stub.clone();
3538 let mut options = self.0.options.clone();
3539 options.set_retry_policy(gax::retry_policy::NeverRetry);
3540 let query = move |name| {
3541 let stub = stub.clone();
3542 let options = options.clone();
3543 async {
3544 let op = GetOperation::new(stub)
3545 .set_name(name)
3546 .with_options(options)
3547 .send()
3548 .await?;
3549 Ok(Operation::new(op))
3550 }
3551 };
3552
3553 let start = move || async {
3554 let op = self.send().await?;
3555 Ok(Operation::new(op))
3556 };
3557
3558 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3559 }
3560
3561 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3565 self.0.request.parent = v.into();
3566 self
3567 }
3568
3569 pub fn set_rollout_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3573 self.0.request.rollout_id = v.into();
3574 self
3575 }
3576
3577 pub fn set_rollout<T>(mut self, v: T) -> Self
3581 where
3582 T: std::convert::Into<crate::model::Rollout>,
3583 {
3584 self.0.request.rollout = std::option::Option::Some(v.into());
3585 self
3586 }
3587
3588 pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
3592 where
3593 T: std::convert::Into<crate::model::Rollout>,
3594 {
3595 self.0.request.rollout = v.map(|x| x.into());
3596 self
3597 }
3598
3599 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3601 self.0.request.request_id = v.into();
3602 self
3603 }
3604
3605 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3607 self.0.request.validate_only = v.into();
3608 self
3609 }
3610
3611 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3613 where
3614 T: std::iter::IntoIterator<Item = V>,
3615 V: std::convert::Into<std::string::String>,
3616 {
3617 use std::iter::Iterator;
3618 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3619 self
3620 }
3621
3622 pub fn set_starting_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3624 self.0.request.starting_phase_id = v.into();
3625 self
3626 }
3627 }
3628
3629 #[doc(hidden)]
3630 impl gax::options::internal::RequestBuilder for CreateRollout {
3631 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3632 &mut self.0.options
3633 }
3634 }
3635
3636 #[derive(Clone, Debug)]
3653 pub struct IgnoreJob(RequestBuilder<crate::model::IgnoreJobRequest>);
3654
3655 impl IgnoreJob {
3656 pub(crate) fn new(
3657 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3658 ) -> Self {
3659 Self(RequestBuilder::new(stub))
3660 }
3661
3662 pub fn with_request<V: Into<crate::model::IgnoreJobRequest>>(mut self, v: V) -> Self {
3664 self.0.request = v.into();
3665 self
3666 }
3667
3668 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3670 self.0.options = v.into();
3671 self
3672 }
3673
3674 pub async fn send(self) -> Result<crate::model::IgnoreJobResponse> {
3676 (*self.0.stub)
3677 .ignore_job(self.0.request, self.0.options)
3678 .await
3679 .map(gax::response::Response::into_body)
3680 }
3681
3682 pub fn set_rollout<T: Into<std::string::String>>(mut self, v: T) -> Self {
3686 self.0.request.rollout = v.into();
3687 self
3688 }
3689
3690 pub fn set_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3694 self.0.request.phase_id = v.into();
3695 self
3696 }
3697
3698 pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3702 self.0.request.job_id = v.into();
3703 self
3704 }
3705
3706 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3708 where
3709 T: std::iter::IntoIterator<Item = V>,
3710 V: std::convert::Into<std::string::String>,
3711 {
3712 use std::iter::Iterator;
3713 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3714 self
3715 }
3716 }
3717
3718 #[doc(hidden)]
3719 impl gax::options::internal::RequestBuilder for IgnoreJob {
3720 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3721 &mut self.0.options
3722 }
3723 }
3724
3725 #[derive(Clone, Debug)]
3742 pub struct RetryJob(RequestBuilder<crate::model::RetryJobRequest>);
3743
3744 impl RetryJob {
3745 pub(crate) fn new(
3746 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3747 ) -> Self {
3748 Self(RequestBuilder::new(stub))
3749 }
3750
3751 pub fn with_request<V: Into<crate::model::RetryJobRequest>>(mut self, v: V) -> Self {
3753 self.0.request = v.into();
3754 self
3755 }
3756
3757 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3759 self.0.options = v.into();
3760 self
3761 }
3762
3763 pub async fn send(self) -> Result<crate::model::RetryJobResponse> {
3765 (*self.0.stub)
3766 .retry_job(self.0.request, self.0.options)
3767 .await
3768 .map(gax::response::Response::into_body)
3769 }
3770
3771 pub fn set_rollout<T: Into<std::string::String>>(mut self, v: T) -> Self {
3775 self.0.request.rollout = v.into();
3776 self
3777 }
3778
3779 pub fn set_phase_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3783 self.0.request.phase_id = v.into();
3784 self
3785 }
3786
3787 pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3791 self.0.request.job_id = v.into();
3792 self
3793 }
3794
3795 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3797 where
3798 T: std::iter::IntoIterator<Item = V>,
3799 V: std::convert::Into<std::string::String>,
3800 {
3801 use std::iter::Iterator;
3802 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3803 self
3804 }
3805 }
3806
3807 #[doc(hidden)]
3808 impl gax::options::internal::RequestBuilder for RetryJob {
3809 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3810 &mut self.0.options
3811 }
3812 }
3813
3814 #[derive(Clone, Debug)]
3835 pub struct ListJobRuns(RequestBuilder<crate::model::ListJobRunsRequest>);
3836
3837 impl ListJobRuns {
3838 pub(crate) fn new(
3839 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3840 ) -> Self {
3841 Self(RequestBuilder::new(stub))
3842 }
3843
3844 pub fn with_request<V: Into<crate::model::ListJobRunsRequest>>(mut self, v: V) -> Self {
3846 self.0.request = v.into();
3847 self
3848 }
3849
3850 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3852 self.0.options = v.into();
3853 self
3854 }
3855
3856 pub async fn send(self) -> Result<crate::model::ListJobRunsResponse> {
3858 (*self.0.stub)
3859 .list_job_runs(self.0.request, self.0.options)
3860 .await
3861 .map(gax::response::Response::into_body)
3862 }
3863
3864 pub fn by_page(
3866 self,
3867 ) -> impl gax::paginator::Paginator<crate::model::ListJobRunsResponse, gax::error::Error>
3868 {
3869 use std::clone::Clone;
3870 let token = self.0.request.page_token.clone();
3871 let execute = move |token: String| {
3872 let mut builder = self.clone();
3873 builder.0.request = builder.0.request.set_page_token(token);
3874 builder.send()
3875 };
3876 gax::paginator::internal::new_paginator(token, execute)
3877 }
3878
3879 pub fn by_item(
3881 self,
3882 ) -> impl gax::paginator::ItemPaginator<crate::model::ListJobRunsResponse, gax::error::Error>
3883 {
3884 use gax::paginator::Paginator;
3885 self.by_page().items()
3886 }
3887
3888 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3892 self.0.request.parent = v.into();
3893 self
3894 }
3895
3896 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3898 self.0.request.page_size = v.into();
3899 self
3900 }
3901
3902 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3904 self.0.request.page_token = v.into();
3905 self
3906 }
3907
3908 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3910 self.0.request.filter = v.into();
3911 self
3912 }
3913
3914 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3916 self.0.request.order_by = v.into();
3917 self
3918 }
3919 }
3920
3921 #[doc(hidden)]
3922 impl gax::options::internal::RequestBuilder for ListJobRuns {
3923 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3924 &mut self.0.options
3925 }
3926 }
3927
3928 #[derive(Clone, Debug)]
3945 pub struct GetJobRun(RequestBuilder<crate::model::GetJobRunRequest>);
3946
3947 impl GetJobRun {
3948 pub(crate) fn new(
3949 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
3950 ) -> Self {
3951 Self(RequestBuilder::new(stub))
3952 }
3953
3954 pub fn with_request<V: Into<crate::model::GetJobRunRequest>>(mut self, v: V) -> Self {
3956 self.0.request = v.into();
3957 self
3958 }
3959
3960 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3962 self.0.options = v.into();
3963 self
3964 }
3965
3966 pub async fn send(self) -> Result<crate::model::JobRun> {
3968 (*self.0.stub)
3969 .get_job_run(self.0.request, self.0.options)
3970 .await
3971 .map(gax::response::Response::into_body)
3972 }
3973
3974 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3978 self.0.request.name = v.into();
3979 self
3980 }
3981 }
3982
3983 #[doc(hidden)]
3984 impl gax::options::internal::RequestBuilder for GetJobRun {
3985 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3986 &mut self.0.options
3987 }
3988 }
3989
3990 #[derive(Clone, Debug)]
4007 pub struct TerminateJobRun(RequestBuilder<crate::model::TerminateJobRunRequest>);
4008
4009 impl TerminateJobRun {
4010 pub(crate) fn new(
4011 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4012 ) -> Self {
4013 Self(RequestBuilder::new(stub))
4014 }
4015
4016 pub fn with_request<V: Into<crate::model::TerminateJobRunRequest>>(mut self, v: V) -> Self {
4018 self.0.request = v.into();
4019 self
4020 }
4021
4022 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4024 self.0.options = v.into();
4025 self
4026 }
4027
4028 pub async fn send(self) -> Result<crate::model::TerminateJobRunResponse> {
4030 (*self.0.stub)
4031 .terminate_job_run(self.0.request, self.0.options)
4032 .await
4033 .map(gax::response::Response::into_body)
4034 }
4035
4036 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4040 self.0.request.name = v.into();
4041 self
4042 }
4043
4044 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
4046 where
4047 T: std::iter::IntoIterator<Item = V>,
4048 V: std::convert::Into<std::string::String>,
4049 {
4050 use std::iter::Iterator;
4051 self.0.request.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
4052 self
4053 }
4054 }
4055
4056 #[doc(hidden)]
4057 impl gax::options::internal::RequestBuilder for TerminateJobRun {
4058 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4059 &mut self.0.options
4060 }
4061 }
4062
4063 #[derive(Clone, Debug)]
4080 pub struct GetConfig(RequestBuilder<crate::model::GetConfigRequest>);
4081
4082 impl GetConfig {
4083 pub(crate) fn new(
4084 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4085 ) -> Self {
4086 Self(RequestBuilder::new(stub))
4087 }
4088
4089 pub fn with_request<V: Into<crate::model::GetConfigRequest>>(mut self, v: V) -> Self {
4091 self.0.request = v.into();
4092 self
4093 }
4094
4095 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4097 self.0.options = v.into();
4098 self
4099 }
4100
4101 pub async fn send(self) -> Result<crate::model::Config> {
4103 (*self.0.stub)
4104 .get_config(self.0.request, self.0.options)
4105 .await
4106 .map(gax::response::Response::into_body)
4107 }
4108
4109 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4113 self.0.request.name = v.into();
4114 self
4115 }
4116 }
4117
4118 #[doc(hidden)]
4119 impl gax::options::internal::RequestBuilder for GetConfig {
4120 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4121 &mut self.0.options
4122 }
4123 }
4124
4125 #[derive(Clone, Debug)]
4143 pub struct CreateAutomation(RequestBuilder<crate::model::CreateAutomationRequest>);
4144
4145 impl CreateAutomation {
4146 pub(crate) fn new(
4147 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4148 ) -> Self {
4149 Self(RequestBuilder::new(stub))
4150 }
4151
4152 pub fn with_request<V: Into<crate::model::CreateAutomationRequest>>(
4154 mut self,
4155 v: V,
4156 ) -> Self {
4157 self.0.request = v.into();
4158 self
4159 }
4160
4161 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4163 self.0.options = v.into();
4164 self
4165 }
4166
4167 pub async fn send(self) -> Result<longrunning::model::Operation> {
4174 (*self.0.stub)
4175 .create_automation(self.0.request, self.0.options)
4176 .await
4177 .map(gax::response::Response::into_body)
4178 }
4179
4180 pub fn poller(
4182 self,
4183 ) -> impl lro::Poller<crate::model::Automation, crate::model::OperationMetadata> {
4184 type Operation =
4185 lro::internal::Operation<crate::model::Automation, crate::model::OperationMetadata>;
4186 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4187 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4188
4189 let stub = self.0.stub.clone();
4190 let mut options = self.0.options.clone();
4191 options.set_retry_policy(gax::retry_policy::NeverRetry);
4192 let query = move |name| {
4193 let stub = stub.clone();
4194 let options = options.clone();
4195 async {
4196 let op = GetOperation::new(stub)
4197 .set_name(name)
4198 .with_options(options)
4199 .send()
4200 .await?;
4201 Ok(Operation::new(op))
4202 }
4203 };
4204
4205 let start = move || async {
4206 let op = self.send().await?;
4207 Ok(Operation::new(op))
4208 };
4209
4210 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4211 }
4212
4213 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4217 self.0.request.parent = v.into();
4218 self
4219 }
4220
4221 pub fn set_automation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4225 self.0.request.automation_id = v.into();
4226 self
4227 }
4228
4229 pub fn set_automation<T>(mut self, v: T) -> Self
4233 where
4234 T: std::convert::Into<crate::model::Automation>,
4235 {
4236 self.0.request.automation = std::option::Option::Some(v.into());
4237 self
4238 }
4239
4240 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
4244 where
4245 T: std::convert::Into<crate::model::Automation>,
4246 {
4247 self.0.request.automation = v.map(|x| x.into());
4248 self
4249 }
4250
4251 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4253 self.0.request.request_id = v.into();
4254 self
4255 }
4256
4257 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4259 self.0.request.validate_only = v.into();
4260 self
4261 }
4262 }
4263
4264 #[doc(hidden)]
4265 impl gax::options::internal::RequestBuilder for CreateAutomation {
4266 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4267 &mut self.0.options
4268 }
4269 }
4270
4271 #[derive(Clone, Debug)]
4289 pub struct UpdateAutomation(RequestBuilder<crate::model::UpdateAutomationRequest>);
4290
4291 impl UpdateAutomation {
4292 pub(crate) fn new(
4293 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4294 ) -> Self {
4295 Self(RequestBuilder::new(stub))
4296 }
4297
4298 pub fn with_request<V: Into<crate::model::UpdateAutomationRequest>>(
4300 mut self,
4301 v: V,
4302 ) -> Self {
4303 self.0.request = v.into();
4304 self
4305 }
4306
4307 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4309 self.0.options = v.into();
4310 self
4311 }
4312
4313 pub async fn send(self) -> Result<longrunning::model::Operation> {
4320 (*self.0.stub)
4321 .update_automation(self.0.request, self.0.options)
4322 .await
4323 .map(gax::response::Response::into_body)
4324 }
4325
4326 pub fn poller(
4328 self,
4329 ) -> impl lro::Poller<crate::model::Automation, crate::model::OperationMetadata> {
4330 type Operation =
4331 lro::internal::Operation<crate::model::Automation, crate::model::OperationMetadata>;
4332 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4333 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4334
4335 let stub = self.0.stub.clone();
4336 let mut options = self.0.options.clone();
4337 options.set_retry_policy(gax::retry_policy::NeverRetry);
4338 let query = move |name| {
4339 let stub = stub.clone();
4340 let options = options.clone();
4341 async {
4342 let op = GetOperation::new(stub)
4343 .set_name(name)
4344 .with_options(options)
4345 .send()
4346 .await?;
4347 Ok(Operation::new(op))
4348 }
4349 };
4350
4351 let start = move || async {
4352 let op = self.send().await?;
4353 Ok(Operation::new(op))
4354 };
4355
4356 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4357 }
4358
4359 pub fn set_update_mask<T>(mut self, v: T) -> Self
4363 where
4364 T: std::convert::Into<wkt::FieldMask>,
4365 {
4366 self.0.request.update_mask = std::option::Option::Some(v.into());
4367 self
4368 }
4369
4370 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4374 where
4375 T: std::convert::Into<wkt::FieldMask>,
4376 {
4377 self.0.request.update_mask = v.map(|x| x.into());
4378 self
4379 }
4380
4381 pub fn set_automation<T>(mut self, v: T) -> Self
4385 where
4386 T: std::convert::Into<crate::model::Automation>,
4387 {
4388 self.0.request.automation = std::option::Option::Some(v.into());
4389 self
4390 }
4391
4392 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
4396 where
4397 T: std::convert::Into<crate::model::Automation>,
4398 {
4399 self.0.request.automation = v.map(|x| x.into());
4400 self
4401 }
4402
4403 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4405 self.0.request.request_id = v.into();
4406 self
4407 }
4408
4409 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
4411 self.0.request.allow_missing = v.into();
4412 self
4413 }
4414
4415 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4417 self.0.request.validate_only = v.into();
4418 self
4419 }
4420 }
4421
4422 #[doc(hidden)]
4423 impl gax::options::internal::RequestBuilder for UpdateAutomation {
4424 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4425 &mut self.0.options
4426 }
4427 }
4428
4429 #[derive(Clone, Debug)]
4447 pub struct DeleteAutomation(RequestBuilder<crate::model::DeleteAutomationRequest>);
4448
4449 impl DeleteAutomation {
4450 pub(crate) fn new(
4451 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4452 ) -> Self {
4453 Self(RequestBuilder::new(stub))
4454 }
4455
4456 pub fn with_request<V: Into<crate::model::DeleteAutomationRequest>>(
4458 mut self,
4459 v: V,
4460 ) -> Self {
4461 self.0.request = v.into();
4462 self
4463 }
4464
4465 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4467 self.0.options = v.into();
4468 self
4469 }
4470
4471 pub async fn send(self) -> Result<longrunning::model::Operation> {
4478 (*self.0.stub)
4479 .delete_automation(self.0.request, self.0.options)
4480 .await
4481 .map(gax::response::Response::into_body)
4482 }
4483
4484 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4486 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4487 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4488 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4489
4490 let stub = self.0.stub.clone();
4491 let mut options = self.0.options.clone();
4492 options.set_retry_policy(gax::retry_policy::NeverRetry);
4493 let query = move |name| {
4494 let stub = stub.clone();
4495 let options = options.clone();
4496 async {
4497 let op = GetOperation::new(stub)
4498 .set_name(name)
4499 .with_options(options)
4500 .send()
4501 .await?;
4502 Ok(Operation::new(op))
4503 }
4504 };
4505
4506 let start = move || async {
4507 let op = self.send().await?;
4508 Ok(Operation::new(op))
4509 };
4510
4511 lro::internal::new_unit_response_poller(
4512 polling_error_policy,
4513 polling_backoff_policy,
4514 start,
4515 query,
4516 )
4517 }
4518
4519 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4523 self.0.request.name = v.into();
4524 self
4525 }
4526
4527 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4529 self.0.request.request_id = v.into();
4530 self
4531 }
4532
4533 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
4535 self.0.request.allow_missing = v.into();
4536 self
4537 }
4538
4539 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4541 self.0.request.validate_only = v.into();
4542 self
4543 }
4544
4545 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4547 self.0.request.etag = v.into();
4548 self
4549 }
4550 }
4551
4552 #[doc(hidden)]
4553 impl gax::options::internal::RequestBuilder for DeleteAutomation {
4554 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4555 &mut self.0.options
4556 }
4557 }
4558
4559 #[derive(Clone, Debug)]
4576 pub struct GetAutomation(RequestBuilder<crate::model::GetAutomationRequest>);
4577
4578 impl GetAutomation {
4579 pub(crate) fn new(
4580 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4581 ) -> Self {
4582 Self(RequestBuilder::new(stub))
4583 }
4584
4585 pub fn with_request<V: Into<crate::model::GetAutomationRequest>>(mut self, v: V) -> Self {
4587 self.0.request = v.into();
4588 self
4589 }
4590
4591 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4593 self.0.options = v.into();
4594 self
4595 }
4596
4597 pub async fn send(self) -> Result<crate::model::Automation> {
4599 (*self.0.stub)
4600 .get_automation(self.0.request, self.0.options)
4601 .await
4602 .map(gax::response::Response::into_body)
4603 }
4604
4605 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4609 self.0.request.name = v.into();
4610 self
4611 }
4612 }
4613
4614 #[doc(hidden)]
4615 impl gax::options::internal::RequestBuilder for GetAutomation {
4616 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4617 &mut self.0.options
4618 }
4619 }
4620
4621 #[derive(Clone, Debug)]
4642 pub struct ListAutomations(RequestBuilder<crate::model::ListAutomationsRequest>);
4643
4644 impl ListAutomations {
4645 pub(crate) fn new(
4646 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4647 ) -> Self {
4648 Self(RequestBuilder::new(stub))
4649 }
4650
4651 pub fn with_request<V: Into<crate::model::ListAutomationsRequest>>(mut self, v: V) -> Self {
4653 self.0.request = v.into();
4654 self
4655 }
4656
4657 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4659 self.0.options = v.into();
4660 self
4661 }
4662
4663 pub async fn send(self) -> Result<crate::model::ListAutomationsResponse> {
4665 (*self.0.stub)
4666 .list_automations(self.0.request, self.0.options)
4667 .await
4668 .map(gax::response::Response::into_body)
4669 }
4670
4671 pub fn by_page(
4673 self,
4674 ) -> impl gax::paginator::Paginator<crate::model::ListAutomationsResponse, gax::error::Error>
4675 {
4676 use std::clone::Clone;
4677 let token = self.0.request.page_token.clone();
4678 let execute = move |token: String| {
4679 let mut builder = self.clone();
4680 builder.0.request = builder.0.request.set_page_token(token);
4681 builder.send()
4682 };
4683 gax::paginator::internal::new_paginator(token, execute)
4684 }
4685
4686 pub fn by_item(
4688 self,
4689 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAutomationsResponse, gax::error::Error>
4690 {
4691 use gax::paginator::Paginator;
4692 self.by_page().items()
4693 }
4694
4695 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4699 self.0.request.parent = v.into();
4700 self
4701 }
4702
4703 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4705 self.0.request.page_size = v.into();
4706 self
4707 }
4708
4709 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4711 self.0.request.page_token = v.into();
4712 self
4713 }
4714
4715 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4717 self.0.request.filter = v.into();
4718 self
4719 }
4720
4721 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4723 self.0.request.order_by = v.into();
4724 self
4725 }
4726 }
4727
4728 #[doc(hidden)]
4729 impl gax::options::internal::RequestBuilder for ListAutomations {
4730 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4731 &mut self.0.options
4732 }
4733 }
4734
4735 #[derive(Clone, Debug)]
4752 pub struct GetAutomationRun(RequestBuilder<crate::model::GetAutomationRunRequest>);
4753
4754 impl GetAutomationRun {
4755 pub(crate) fn new(
4756 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4757 ) -> Self {
4758 Self(RequestBuilder::new(stub))
4759 }
4760
4761 pub fn with_request<V: Into<crate::model::GetAutomationRunRequest>>(
4763 mut self,
4764 v: V,
4765 ) -> Self {
4766 self.0.request = v.into();
4767 self
4768 }
4769
4770 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4772 self.0.options = v.into();
4773 self
4774 }
4775
4776 pub async fn send(self) -> Result<crate::model::AutomationRun> {
4778 (*self.0.stub)
4779 .get_automation_run(self.0.request, self.0.options)
4780 .await
4781 .map(gax::response::Response::into_body)
4782 }
4783
4784 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4788 self.0.request.name = v.into();
4789 self
4790 }
4791 }
4792
4793 #[doc(hidden)]
4794 impl gax::options::internal::RequestBuilder for GetAutomationRun {
4795 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4796 &mut self.0.options
4797 }
4798 }
4799
4800 #[derive(Clone, Debug)]
4821 pub struct ListAutomationRuns(RequestBuilder<crate::model::ListAutomationRunsRequest>);
4822
4823 impl ListAutomationRuns {
4824 pub(crate) fn new(
4825 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4826 ) -> Self {
4827 Self(RequestBuilder::new(stub))
4828 }
4829
4830 pub fn with_request<V: Into<crate::model::ListAutomationRunsRequest>>(
4832 mut self,
4833 v: V,
4834 ) -> Self {
4835 self.0.request = v.into();
4836 self
4837 }
4838
4839 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4841 self.0.options = v.into();
4842 self
4843 }
4844
4845 pub async fn send(self) -> Result<crate::model::ListAutomationRunsResponse> {
4847 (*self.0.stub)
4848 .list_automation_runs(self.0.request, self.0.options)
4849 .await
4850 .map(gax::response::Response::into_body)
4851 }
4852
4853 pub fn by_page(
4855 self,
4856 ) -> impl gax::paginator::Paginator<crate::model::ListAutomationRunsResponse, gax::error::Error>
4857 {
4858 use std::clone::Clone;
4859 let token = self.0.request.page_token.clone();
4860 let execute = move |token: String| {
4861 let mut builder = self.clone();
4862 builder.0.request = builder.0.request.set_page_token(token);
4863 builder.send()
4864 };
4865 gax::paginator::internal::new_paginator(token, execute)
4866 }
4867
4868 pub fn by_item(
4870 self,
4871 ) -> impl gax::paginator::ItemPaginator<
4872 crate::model::ListAutomationRunsResponse,
4873 gax::error::Error,
4874 > {
4875 use gax::paginator::Paginator;
4876 self.by_page().items()
4877 }
4878
4879 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4883 self.0.request.parent = v.into();
4884 self
4885 }
4886
4887 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4889 self.0.request.page_size = v.into();
4890 self
4891 }
4892
4893 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4895 self.0.request.page_token = v.into();
4896 self
4897 }
4898
4899 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4901 self.0.request.filter = v.into();
4902 self
4903 }
4904
4905 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4907 self.0.request.order_by = v.into();
4908 self
4909 }
4910 }
4911
4912 #[doc(hidden)]
4913 impl gax::options::internal::RequestBuilder for ListAutomationRuns {
4914 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4915 &mut self.0.options
4916 }
4917 }
4918
4919 #[derive(Clone, Debug)]
4936 pub struct CancelAutomationRun(RequestBuilder<crate::model::CancelAutomationRunRequest>);
4937
4938 impl CancelAutomationRun {
4939 pub(crate) fn new(
4940 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
4941 ) -> Self {
4942 Self(RequestBuilder::new(stub))
4943 }
4944
4945 pub fn with_request<V: Into<crate::model::CancelAutomationRunRequest>>(
4947 mut self,
4948 v: V,
4949 ) -> Self {
4950 self.0.request = v.into();
4951 self
4952 }
4953
4954 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4956 self.0.options = v.into();
4957 self
4958 }
4959
4960 pub async fn send(self) -> Result<crate::model::CancelAutomationRunResponse> {
4962 (*self.0.stub)
4963 .cancel_automation_run(self.0.request, self.0.options)
4964 .await
4965 .map(gax::response::Response::into_body)
4966 }
4967
4968 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4972 self.0.request.name = v.into();
4973 self
4974 }
4975 }
4976
4977 #[doc(hidden)]
4978 impl gax::options::internal::RequestBuilder for CancelAutomationRun {
4979 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4980 &mut self.0.options
4981 }
4982 }
4983
4984 #[derive(Clone, Debug)]
5005 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5006
5007 impl ListLocations {
5008 pub(crate) fn new(
5009 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5010 ) -> Self {
5011 Self(RequestBuilder::new(stub))
5012 }
5013
5014 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5016 mut self,
5017 v: V,
5018 ) -> Self {
5019 self.0.request = v.into();
5020 self
5021 }
5022
5023 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5025 self.0.options = v.into();
5026 self
5027 }
5028
5029 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5031 (*self.0.stub)
5032 .list_locations(self.0.request, self.0.options)
5033 .await
5034 .map(gax::response::Response::into_body)
5035 }
5036
5037 pub fn by_page(
5039 self,
5040 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5041 {
5042 use std::clone::Clone;
5043 let token = self.0.request.page_token.clone();
5044 let execute = move |token: String| {
5045 let mut builder = self.clone();
5046 builder.0.request = builder.0.request.set_page_token(token);
5047 builder.send()
5048 };
5049 gax::paginator::internal::new_paginator(token, execute)
5050 }
5051
5052 pub fn by_item(
5054 self,
5055 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5056 {
5057 use gax::paginator::Paginator;
5058 self.by_page().items()
5059 }
5060
5061 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5063 self.0.request.name = v.into();
5064 self
5065 }
5066
5067 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5069 self.0.request.filter = v.into();
5070 self
5071 }
5072
5073 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5075 self.0.request.page_size = v.into();
5076 self
5077 }
5078
5079 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5081 self.0.request.page_token = v.into();
5082 self
5083 }
5084 }
5085
5086 #[doc(hidden)]
5087 impl gax::options::internal::RequestBuilder for ListLocations {
5088 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5089 &mut self.0.options
5090 }
5091 }
5092
5093 #[derive(Clone, Debug)]
5110 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5111
5112 impl GetLocation {
5113 pub(crate) fn new(
5114 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5115 ) -> Self {
5116 Self(RequestBuilder::new(stub))
5117 }
5118
5119 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5121 self.0.request = v.into();
5122 self
5123 }
5124
5125 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5127 self.0.options = v.into();
5128 self
5129 }
5130
5131 pub async fn send(self) -> Result<location::model::Location> {
5133 (*self.0.stub)
5134 .get_location(self.0.request, self.0.options)
5135 .await
5136 .map(gax::response::Response::into_body)
5137 }
5138
5139 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5141 self.0.request.name = v.into();
5142 self
5143 }
5144 }
5145
5146 #[doc(hidden)]
5147 impl gax::options::internal::RequestBuilder for GetLocation {
5148 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5149 &mut self.0.options
5150 }
5151 }
5152
5153 #[derive(Clone, Debug)]
5170 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5171
5172 impl SetIamPolicy {
5173 pub(crate) fn new(
5174 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5175 ) -> Self {
5176 Self(RequestBuilder::new(stub))
5177 }
5178
5179 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5181 self.0.request = v.into();
5182 self
5183 }
5184
5185 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5187 self.0.options = v.into();
5188 self
5189 }
5190
5191 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5193 (*self.0.stub)
5194 .set_iam_policy(self.0.request, self.0.options)
5195 .await
5196 .map(gax::response::Response::into_body)
5197 }
5198
5199 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5203 self.0.request.resource = v.into();
5204 self
5205 }
5206
5207 pub fn set_policy<T>(mut self, v: T) -> Self
5211 where
5212 T: std::convert::Into<iam_v1::model::Policy>,
5213 {
5214 self.0.request.policy = std::option::Option::Some(v.into());
5215 self
5216 }
5217
5218 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5222 where
5223 T: std::convert::Into<iam_v1::model::Policy>,
5224 {
5225 self.0.request.policy = v.map(|x| x.into());
5226 self
5227 }
5228
5229 pub fn set_update_mask<T>(mut self, v: T) -> Self
5231 where
5232 T: std::convert::Into<wkt::FieldMask>,
5233 {
5234 self.0.request.update_mask = std::option::Option::Some(v.into());
5235 self
5236 }
5237
5238 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5240 where
5241 T: std::convert::Into<wkt::FieldMask>,
5242 {
5243 self.0.request.update_mask = v.map(|x| x.into());
5244 self
5245 }
5246 }
5247
5248 #[doc(hidden)]
5249 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5250 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5251 &mut self.0.options
5252 }
5253 }
5254
5255 #[derive(Clone, Debug)]
5272 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5273
5274 impl GetIamPolicy {
5275 pub(crate) fn new(
5276 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5277 ) -> Self {
5278 Self(RequestBuilder::new(stub))
5279 }
5280
5281 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5283 self.0.request = v.into();
5284 self
5285 }
5286
5287 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5289 self.0.options = v.into();
5290 self
5291 }
5292
5293 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5295 (*self.0.stub)
5296 .get_iam_policy(self.0.request, self.0.options)
5297 .await
5298 .map(gax::response::Response::into_body)
5299 }
5300
5301 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5305 self.0.request.resource = v.into();
5306 self
5307 }
5308
5309 pub fn set_options<T>(mut self, v: T) -> Self
5311 where
5312 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5313 {
5314 self.0.request.options = std::option::Option::Some(v.into());
5315 self
5316 }
5317
5318 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5320 where
5321 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5322 {
5323 self.0.request.options = v.map(|x| x.into());
5324 self
5325 }
5326 }
5327
5328 #[doc(hidden)]
5329 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5330 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5331 &mut self.0.options
5332 }
5333 }
5334
5335 #[derive(Clone, Debug)]
5352 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5353
5354 impl TestIamPermissions {
5355 pub(crate) fn new(
5356 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5357 ) -> Self {
5358 Self(RequestBuilder::new(stub))
5359 }
5360
5361 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5363 mut self,
5364 v: V,
5365 ) -> Self {
5366 self.0.request = v.into();
5367 self
5368 }
5369
5370 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5372 self.0.options = v.into();
5373 self
5374 }
5375
5376 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5378 (*self.0.stub)
5379 .test_iam_permissions(self.0.request, self.0.options)
5380 .await
5381 .map(gax::response::Response::into_body)
5382 }
5383
5384 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5388 self.0.request.resource = v.into();
5389 self
5390 }
5391
5392 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5396 where
5397 T: std::iter::IntoIterator<Item = V>,
5398 V: std::convert::Into<std::string::String>,
5399 {
5400 use std::iter::Iterator;
5401 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5402 self
5403 }
5404 }
5405
5406 #[doc(hidden)]
5407 impl gax::options::internal::RequestBuilder for TestIamPermissions {
5408 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5409 &mut self.0.options
5410 }
5411 }
5412
5413 #[derive(Clone, Debug)]
5434 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5435
5436 impl ListOperations {
5437 pub(crate) fn new(
5438 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5439 ) -> Self {
5440 Self(RequestBuilder::new(stub))
5441 }
5442
5443 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5445 mut self,
5446 v: V,
5447 ) -> Self {
5448 self.0.request = v.into();
5449 self
5450 }
5451
5452 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5454 self.0.options = v.into();
5455 self
5456 }
5457
5458 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5460 (*self.0.stub)
5461 .list_operations(self.0.request, self.0.options)
5462 .await
5463 .map(gax::response::Response::into_body)
5464 }
5465
5466 pub fn by_page(
5468 self,
5469 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5470 {
5471 use std::clone::Clone;
5472 let token = self.0.request.page_token.clone();
5473 let execute = move |token: String| {
5474 let mut builder = self.clone();
5475 builder.0.request = builder.0.request.set_page_token(token);
5476 builder.send()
5477 };
5478 gax::paginator::internal::new_paginator(token, execute)
5479 }
5480
5481 pub fn by_item(
5483 self,
5484 ) -> impl gax::paginator::ItemPaginator<
5485 longrunning::model::ListOperationsResponse,
5486 gax::error::Error,
5487 > {
5488 use gax::paginator::Paginator;
5489 self.by_page().items()
5490 }
5491
5492 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5494 self.0.request.name = v.into();
5495 self
5496 }
5497
5498 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5500 self.0.request.filter = v.into();
5501 self
5502 }
5503
5504 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5506 self.0.request.page_size = v.into();
5507 self
5508 }
5509
5510 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5512 self.0.request.page_token = v.into();
5513 self
5514 }
5515
5516 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5518 self.0.request.return_partial_success = v.into();
5519 self
5520 }
5521 }
5522
5523 #[doc(hidden)]
5524 impl gax::options::internal::RequestBuilder for ListOperations {
5525 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5526 &mut self.0.options
5527 }
5528 }
5529
5530 #[derive(Clone, Debug)]
5547 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5548
5549 impl GetOperation {
5550 pub(crate) fn new(
5551 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5552 ) -> Self {
5553 Self(RequestBuilder::new(stub))
5554 }
5555
5556 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5558 mut self,
5559 v: V,
5560 ) -> Self {
5561 self.0.request = v.into();
5562 self
5563 }
5564
5565 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5567 self.0.options = v.into();
5568 self
5569 }
5570
5571 pub async fn send(self) -> Result<longrunning::model::Operation> {
5573 (*self.0.stub)
5574 .get_operation(self.0.request, self.0.options)
5575 .await
5576 .map(gax::response::Response::into_body)
5577 }
5578
5579 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5581 self.0.request.name = v.into();
5582 self
5583 }
5584 }
5585
5586 #[doc(hidden)]
5587 impl gax::options::internal::RequestBuilder for GetOperation {
5588 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5589 &mut self.0.options
5590 }
5591 }
5592
5593 #[derive(Clone, Debug)]
5610 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5611
5612 impl DeleteOperation {
5613 pub(crate) fn new(
5614 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5615 ) -> Self {
5616 Self(RequestBuilder::new(stub))
5617 }
5618
5619 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5621 mut self,
5622 v: V,
5623 ) -> Self {
5624 self.0.request = v.into();
5625 self
5626 }
5627
5628 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5630 self.0.options = v.into();
5631 self
5632 }
5633
5634 pub async fn send(self) -> Result<()> {
5636 (*self.0.stub)
5637 .delete_operation(self.0.request, self.0.options)
5638 .await
5639 .map(gax::response::Response::into_body)
5640 }
5641
5642 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5644 self.0.request.name = v.into();
5645 self
5646 }
5647 }
5648
5649 #[doc(hidden)]
5650 impl gax::options::internal::RequestBuilder for DeleteOperation {
5651 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5652 &mut self.0.options
5653 }
5654 }
5655
5656 #[derive(Clone, Debug)]
5673 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5674
5675 impl CancelOperation {
5676 pub(crate) fn new(
5677 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudDeploy>,
5678 ) -> Self {
5679 Self(RequestBuilder::new(stub))
5680 }
5681
5682 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5684 mut self,
5685 v: V,
5686 ) -> Self {
5687 self.0.request = v.into();
5688 self
5689 }
5690
5691 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5693 self.0.options = v.into();
5694 self
5695 }
5696
5697 pub async fn send(self) -> Result<()> {
5699 (*self.0.stub)
5700 .cancel_operation(self.0.request, self.0.options)
5701 .await
5702 .map(gax::response::Response::into_body)
5703 }
5704
5705 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5707 self.0.request.name = v.into();
5708 self
5709 }
5710 }
5711
5712 #[doc(hidden)]
5713 impl gax::options::internal::RequestBuilder for CancelOperation {
5714 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5715 &mut self.0.options
5716 }
5717 }
5718}