1pub mod cloud_build {
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::CloudBuild;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = CloudBuild;
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::CloudBuild>,
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::CloudBuild>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
93 pub struct CreateBuild(RequestBuilder<crate::model::CreateBuildRequest>);
94
95 impl CreateBuild {
96 pub(crate) fn new(
97 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
98 ) -> Self {
99 Self(RequestBuilder::new(stub))
100 }
101
102 pub fn with_request<V: Into<crate::model::CreateBuildRequest>>(mut self, v: V) -> Self {
104 self.0.request = v.into();
105 self
106 }
107
108 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
110 self.0.options = v.into();
111 self
112 }
113
114 pub async fn send(self) -> Result<longrunning::model::Operation> {
121 (*self.0.stub)
122 .create_build(self.0.request, self.0.options)
123 .await
124 .map(gax::response::Response::into_body)
125 }
126
127 pub fn poller(
129 self,
130 ) -> impl lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata> {
131 type Operation =
132 lro::internal::Operation<crate::model::Build, crate::model::BuildOperationMetadata>;
133 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
134 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
135
136 let stub = self.0.stub.clone();
137 let mut options = self.0.options.clone();
138 options.set_retry_policy(gax::retry_policy::NeverRetry);
139 let query = move |name| {
140 let stub = stub.clone();
141 let options = options.clone();
142 async {
143 let op = GetOperation::new(stub)
144 .set_name(name)
145 .with_options(options)
146 .send()
147 .await?;
148 Ok(Operation::new(op))
149 }
150 };
151
152 let start = move || async {
153 let op = self.send().await?;
154 Ok(Operation::new(op))
155 };
156
157 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
158 }
159
160 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
162 self.0.request.parent = v.into();
163 self
164 }
165
166 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.project_id = v.into();
171 self
172 }
173
174 pub fn set_build<T>(mut self, v: T) -> Self
178 where
179 T: std::convert::Into<crate::model::Build>,
180 {
181 self.0.request.build = std::option::Option::Some(v.into());
182 self
183 }
184
185 pub fn set_or_clear_build<T>(mut self, v: std::option::Option<T>) -> Self
189 where
190 T: std::convert::Into<crate::model::Build>,
191 {
192 self.0.request.build = v.map(|x| x.into());
193 self
194 }
195 }
196
197 #[doc(hidden)]
198 impl gax::options::internal::RequestBuilder for CreateBuild {
199 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
200 &mut self.0.options
201 }
202 }
203
204 #[derive(Clone, Debug)]
222 pub struct GetBuild(RequestBuilder<crate::model::GetBuildRequest>);
223
224 impl GetBuild {
225 pub(crate) fn new(
226 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
227 ) -> Self {
228 Self(RequestBuilder::new(stub))
229 }
230
231 pub fn with_request<V: Into<crate::model::GetBuildRequest>>(mut self, v: V) -> Self {
233 self.0.request = v.into();
234 self
235 }
236
237 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
239 self.0.options = v.into();
240 self
241 }
242
243 pub async fn send(self) -> Result<crate::model::Build> {
245 (*self.0.stub)
246 .get_build(self.0.request, self.0.options)
247 .await
248 .map(gax::response::Response::into_body)
249 }
250
251 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
253 self.0.request.name = v.into();
254 self
255 }
256
257 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
261 self.0.request.project_id = v.into();
262 self
263 }
264
265 pub fn set_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
269 self.0.request.id = v.into();
270 self
271 }
272 }
273
274 #[doc(hidden)]
275 impl gax::options::internal::RequestBuilder for GetBuild {
276 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
277 &mut self.0.options
278 }
279 }
280
281 #[derive(Clone, Debug)]
303 pub struct ListBuilds(RequestBuilder<crate::model::ListBuildsRequest>);
304
305 impl ListBuilds {
306 pub(crate) fn new(
307 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
308 ) -> Self {
309 Self(RequestBuilder::new(stub))
310 }
311
312 pub fn with_request<V: Into<crate::model::ListBuildsRequest>>(mut self, v: V) -> Self {
314 self.0.request = v.into();
315 self
316 }
317
318 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
320 self.0.options = v.into();
321 self
322 }
323
324 pub async fn send(self) -> Result<crate::model::ListBuildsResponse> {
326 (*self.0.stub)
327 .list_builds(self.0.request, self.0.options)
328 .await
329 .map(gax::response::Response::into_body)
330 }
331
332 pub fn by_page(
334 self,
335 ) -> impl gax::paginator::Paginator<crate::model::ListBuildsResponse, gax::error::Error>
336 {
337 use std::clone::Clone;
338 let token = self.0.request.page_token.clone();
339 let execute = move |token: String| {
340 let mut builder = self.clone();
341 builder.0.request = builder.0.request.set_page_token(token);
342 builder.send()
343 };
344 gax::paginator::internal::new_paginator(token, execute)
345 }
346
347 pub fn by_item(
349 self,
350 ) -> impl gax::paginator::ItemPaginator<crate::model::ListBuildsResponse, gax::error::Error>
351 {
352 use gax::paginator::Paginator;
353 self.by_page().items()
354 }
355
356 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
358 self.0.request.parent = v.into();
359 self
360 }
361
362 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
366 self.0.request.project_id = v.into();
367 self
368 }
369
370 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
372 self.0.request.page_size = v.into();
373 self
374 }
375
376 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
378 self.0.request.page_token = v.into();
379 self
380 }
381
382 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
384 self.0.request.filter = v.into();
385 self
386 }
387 }
388
389 #[doc(hidden)]
390 impl gax::options::internal::RequestBuilder for ListBuilds {
391 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
392 &mut self.0.options
393 }
394 }
395
396 #[derive(Clone, Debug)]
414 pub struct CancelBuild(RequestBuilder<crate::model::CancelBuildRequest>);
415
416 impl CancelBuild {
417 pub(crate) fn new(
418 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
419 ) -> Self {
420 Self(RequestBuilder::new(stub))
421 }
422
423 pub fn with_request<V: Into<crate::model::CancelBuildRequest>>(mut self, v: V) -> Self {
425 self.0.request = v.into();
426 self
427 }
428
429 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
431 self.0.options = v.into();
432 self
433 }
434
435 pub async fn send(self) -> Result<crate::model::Build> {
437 (*self.0.stub)
438 .cancel_build(self.0.request, self.0.options)
439 .await
440 .map(gax::response::Response::into_body)
441 }
442
443 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
445 self.0.request.name = v.into();
446 self
447 }
448
449 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
453 self.0.request.project_id = v.into();
454 self
455 }
456
457 pub fn set_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
461 self.0.request.id = v.into();
462 self
463 }
464 }
465
466 #[doc(hidden)]
467 impl gax::options::internal::RequestBuilder for CancelBuild {
468 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
469 &mut self.0.options
470 }
471 }
472
473 #[derive(Clone, Debug)]
492 pub struct RetryBuild(RequestBuilder<crate::model::RetryBuildRequest>);
493
494 impl RetryBuild {
495 pub(crate) fn new(
496 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
497 ) -> Self {
498 Self(RequestBuilder::new(stub))
499 }
500
501 pub fn with_request<V: Into<crate::model::RetryBuildRequest>>(mut self, v: V) -> Self {
503 self.0.request = v.into();
504 self
505 }
506
507 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
509 self.0.options = v.into();
510 self
511 }
512
513 pub async fn send(self) -> Result<longrunning::model::Operation> {
520 (*self.0.stub)
521 .retry_build(self.0.request, self.0.options)
522 .await
523 .map(gax::response::Response::into_body)
524 }
525
526 pub fn poller(
528 self,
529 ) -> impl lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata> {
530 type Operation =
531 lro::internal::Operation<crate::model::Build, crate::model::BuildOperationMetadata>;
532 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
533 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
534
535 let stub = self.0.stub.clone();
536 let mut options = self.0.options.clone();
537 options.set_retry_policy(gax::retry_policy::NeverRetry);
538 let query = move |name| {
539 let stub = stub.clone();
540 let options = options.clone();
541 async {
542 let op = GetOperation::new(stub)
543 .set_name(name)
544 .with_options(options)
545 .send()
546 .await?;
547 Ok(Operation::new(op))
548 }
549 };
550
551 let start = move || async {
552 let op = self.send().await?;
553 Ok(Operation::new(op))
554 };
555
556 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
557 }
558
559 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
561 self.0.request.name = v.into();
562 self
563 }
564
565 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
569 self.0.request.project_id = v.into();
570 self
571 }
572
573 pub fn set_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
577 self.0.request.id = v.into();
578 self
579 }
580 }
581
582 #[doc(hidden)]
583 impl gax::options::internal::RequestBuilder for RetryBuild {
584 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
585 &mut self.0.options
586 }
587 }
588
589 #[derive(Clone, Debug)]
608 pub struct ApproveBuild(RequestBuilder<crate::model::ApproveBuildRequest>);
609
610 impl ApproveBuild {
611 pub(crate) fn new(
612 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
613 ) -> Self {
614 Self(RequestBuilder::new(stub))
615 }
616
617 pub fn with_request<V: Into<crate::model::ApproveBuildRequest>>(mut self, v: V) -> Self {
619 self.0.request = v.into();
620 self
621 }
622
623 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
625 self.0.options = v.into();
626 self
627 }
628
629 pub async fn send(self) -> Result<longrunning::model::Operation> {
636 (*self.0.stub)
637 .approve_build(self.0.request, self.0.options)
638 .await
639 .map(gax::response::Response::into_body)
640 }
641
642 pub fn poller(
644 self,
645 ) -> impl lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata> {
646 type Operation =
647 lro::internal::Operation<crate::model::Build, crate::model::BuildOperationMetadata>;
648 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
649 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
650
651 let stub = self.0.stub.clone();
652 let mut options = self.0.options.clone();
653 options.set_retry_policy(gax::retry_policy::NeverRetry);
654 let query = move |name| {
655 let stub = stub.clone();
656 let options = options.clone();
657 async {
658 let op = GetOperation::new(stub)
659 .set_name(name)
660 .with_options(options)
661 .send()
662 .await?;
663 Ok(Operation::new(op))
664 }
665 };
666
667 let start = move || async {
668 let op = self.send().await?;
669 Ok(Operation::new(op))
670 };
671
672 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
673 }
674
675 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
679 self.0.request.name = v.into();
680 self
681 }
682
683 pub fn set_approval_result<T>(mut self, v: T) -> Self
685 where
686 T: std::convert::Into<crate::model::ApprovalResult>,
687 {
688 self.0.request.approval_result = std::option::Option::Some(v.into());
689 self
690 }
691
692 pub fn set_or_clear_approval_result<T>(mut self, v: std::option::Option<T>) -> Self
694 where
695 T: std::convert::Into<crate::model::ApprovalResult>,
696 {
697 self.0.request.approval_result = v.map(|x| x.into());
698 self
699 }
700 }
701
702 #[doc(hidden)]
703 impl gax::options::internal::RequestBuilder for ApproveBuild {
704 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
705 &mut self.0.options
706 }
707 }
708
709 #[derive(Clone, Debug)]
727 pub struct CreateBuildTrigger(RequestBuilder<crate::model::CreateBuildTriggerRequest>);
728
729 impl CreateBuildTrigger {
730 pub(crate) fn new(
731 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
732 ) -> Self {
733 Self(RequestBuilder::new(stub))
734 }
735
736 pub fn with_request<V: Into<crate::model::CreateBuildTriggerRequest>>(
738 mut self,
739 v: V,
740 ) -> Self {
741 self.0.request = v.into();
742 self
743 }
744
745 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
747 self.0.options = v.into();
748 self
749 }
750
751 pub async fn send(self) -> Result<crate::model::BuildTrigger> {
753 (*self.0.stub)
754 .create_build_trigger(self.0.request, self.0.options)
755 .await
756 .map(gax::response::Response::into_body)
757 }
758
759 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
761 self.0.request.parent = v.into();
762 self
763 }
764
765 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
769 self.0.request.project_id = v.into();
770 self
771 }
772
773 pub fn set_trigger<T>(mut self, v: T) -> Self
777 where
778 T: std::convert::Into<crate::model::BuildTrigger>,
779 {
780 self.0.request.trigger = std::option::Option::Some(v.into());
781 self
782 }
783
784 pub fn set_or_clear_trigger<T>(mut self, v: std::option::Option<T>) -> Self
788 where
789 T: std::convert::Into<crate::model::BuildTrigger>,
790 {
791 self.0.request.trigger = v.map(|x| x.into());
792 self
793 }
794 }
795
796 #[doc(hidden)]
797 impl gax::options::internal::RequestBuilder for CreateBuildTrigger {
798 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
799 &mut self.0.options
800 }
801 }
802
803 #[derive(Clone, Debug)]
821 pub struct GetBuildTrigger(RequestBuilder<crate::model::GetBuildTriggerRequest>);
822
823 impl GetBuildTrigger {
824 pub(crate) fn new(
825 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
826 ) -> Self {
827 Self(RequestBuilder::new(stub))
828 }
829
830 pub fn with_request<V: Into<crate::model::GetBuildTriggerRequest>>(mut self, v: V) -> Self {
832 self.0.request = v.into();
833 self
834 }
835
836 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
838 self.0.options = v.into();
839 self
840 }
841
842 pub async fn send(self) -> Result<crate::model::BuildTrigger> {
844 (*self.0.stub)
845 .get_build_trigger(self.0.request, self.0.options)
846 .await
847 .map(gax::response::Response::into_body)
848 }
849
850 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
852 self.0.request.name = v.into();
853 self
854 }
855
856 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
860 self.0.request.project_id = v.into();
861 self
862 }
863
864 pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
868 self.0.request.trigger_id = v.into();
869 self
870 }
871 }
872
873 #[doc(hidden)]
874 impl gax::options::internal::RequestBuilder for GetBuildTrigger {
875 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
876 &mut self.0.options
877 }
878 }
879
880 #[derive(Clone, Debug)]
902 pub struct ListBuildTriggers(RequestBuilder<crate::model::ListBuildTriggersRequest>);
903
904 impl ListBuildTriggers {
905 pub(crate) fn new(
906 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
907 ) -> Self {
908 Self(RequestBuilder::new(stub))
909 }
910
911 pub fn with_request<V: Into<crate::model::ListBuildTriggersRequest>>(
913 mut self,
914 v: V,
915 ) -> Self {
916 self.0.request = v.into();
917 self
918 }
919
920 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
922 self.0.options = v.into();
923 self
924 }
925
926 pub async fn send(self) -> Result<crate::model::ListBuildTriggersResponse> {
928 (*self.0.stub)
929 .list_build_triggers(self.0.request, self.0.options)
930 .await
931 .map(gax::response::Response::into_body)
932 }
933
934 pub fn by_page(
936 self,
937 ) -> impl gax::paginator::Paginator<crate::model::ListBuildTriggersResponse, gax::error::Error>
938 {
939 use std::clone::Clone;
940 let token = self.0.request.page_token.clone();
941 let execute = move |token: String| {
942 let mut builder = self.clone();
943 builder.0.request = builder.0.request.set_page_token(token);
944 builder.send()
945 };
946 gax::paginator::internal::new_paginator(token, execute)
947 }
948
949 pub fn by_item(
951 self,
952 ) -> impl gax::paginator::ItemPaginator<crate::model::ListBuildTriggersResponse, gax::error::Error>
953 {
954 use gax::paginator::Paginator;
955 self.by_page().items()
956 }
957
958 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
960 self.0.request.parent = v.into();
961 self
962 }
963
964 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
968 self.0.request.project_id = v.into();
969 self
970 }
971
972 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
974 self.0.request.page_size = v.into();
975 self
976 }
977
978 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
980 self.0.request.page_token = v.into();
981 self
982 }
983 }
984
985 #[doc(hidden)]
986 impl gax::options::internal::RequestBuilder for ListBuildTriggers {
987 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
988 &mut self.0.options
989 }
990 }
991
992 #[derive(Clone, Debug)]
1010 pub struct DeleteBuildTrigger(RequestBuilder<crate::model::DeleteBuildTriggerRequest>);
1011
1012 impl DeleteBuildTrigger {
1013 pub(crate) fn new(
1014 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1015 ) -> Self {
1016 Self(RequestBuilder::new(stub))
1017 }
1018
1019 pub fn with_request<V: Into<crate::model::DeleteBuildTriggerRequest>>(
1021 mut self,
1022 v: V,
1023 ) -> Self {
1024 self.0.request = v.into();
1025 self
1026 }
1027
1028 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1030 self.0.options = v.into();
1031 self
1032 }
1033
1034 pub async fn send(self) -> Result<()> {
1036 (*self.0.stub)
1037 .delete_build_trigger(self.0.request, self.0.options)
1038 .await
1039 .map(gax::response::Response::into_body)
1040 }
1041
1042 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1044 self.0.request.name = v.into();
1045 self
1046 }
1047
1048 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1052 self.0.request.project_id = v.into();
1053 self
1054 }
1055
1056 pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1060 self.0.request.trigger_id = v.into();
1061 self
1062 }
1063 }
1064
1065 #[doc(hidden)]
1066 impl gax::options::internal::RequestBuilder for DeleteBuildTrigger {
1067 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1068 &mut self.0.options
1069 }
1070 }
1071
1072 #[derive(Clone, Debug)]
1090 pub struct UpdateBuildTrigger(RequestBuilder<crate::model::UpdateBuildTriggerRequest>);
1091
1092 impl UpdateBuildTrigger {
1093 pub(crate) fn new(
1094 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1095 ) -> Self {
1096 Self(RequestBuilder::new(stub))
1097 }
1098
1099 pub fn with_request<V: Into<crate::model::UpdateBuildTriggerRequest>>(
1101 mut self,
1102 v: V,
1103 ) -> Self {
1104 self.0.request = v.into();
1105 self
1106 }
1107
1108 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1110 self.0.options = v.into();
1111 self
1112 }
1113
1114 pub async fn send(self) -> Result<crate::model::BuildTrigger> {
1116 (*self.0.stub)
1117 .update_build_trigger(self.0.request, self.0.options)
1118 .await
1119 .map(gax::response::Response::into_body)
1120 }
1121
1122 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1126 self.0.request.project_id = v.into();
1127 self
1128 }
1129
1130 pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1134 self.0.request.trigger_id = v.into();
1135 self
1136 }
1137
1138 pub fn set_trigger<T>(mut self, v: T) -> Self
1142 where
1143 T: std::convert::Into<crate::model::BuildTrigger>,
1144 {
1145 self.0.request.trigger = std::option::Option::Some(v.into());
1146 self
1147 }
1148
1149 pub fn set_or_clear_trigger<T>(mut self, v: std::option::Option<T>) -> Self
1153 where
1154 T: std::convert::Into<crate::model::BuildTrigger>,
1155 {
1156 self.0.request.trigger = v.map(|x| x.into());
1157 self
1158 }
1159
1160 pub fn set_update_mask<T>(mut self, v: T) -> Self
1162 where
1163 T: std::convert::Into<wkt::FieldMask>,
1164 {
1165 self.0.request.update_mask = std::option::Option::Some(v.into());
1166 self
1167 }
1168
1169 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1171 where
1172 T: std::convert::Into<wkt::FieldMask>,
1173 {
1174 self.0.request.update_mask = v.map(|x| x.into());
1175 self
1176 }
1177 }
1178
1179 #[doc(hidden)]
1180 impl gax::options::internal::RequestBuilder for UpdateBuildTrigger {
1181 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1182 &mut self.0.options
1183 }
1184 }
1185
1186 #[derive(Clone, Debug)]
1205 pub struct RunBuildTrigger(RequestBuilder<crate::model::RunBuildTriggerRequest>);
1206
1207 impl RunBuildTrigger {
1208 pub(crate) fn new(
1209 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1210 ) -> Self {
1211 Self(RequestBuilder::new(stub))
1212 }
1213
1214 pub fn with_request<V: Into<crate::model::RunBuildTriggerRequest>>(mut self, v: V) -> Self {
1216 self.0.request = v.into();
1217 self
1218 }
1219
1220 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1222 self.0.options = v.into();
1223 self
1224 }
1225
1226 pub async fn send(self) -> Result<longrunning::model::Operation> {
1233 (*self.0.stub)
1234 .run_build_trigger(self.0.request, self.0.options)
1235 .await
1236 .map(gax::response::Response::into_body)
1237 }
1238
1239 pub fn poller(
1241 self,
1242 ) -> impl lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata> {
1243 type Operation =
1244 lro::internal::Operation<crate::model::Build, crate::model::BuildOperationMetadata>;
1245 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1246 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1247
1248 let stub = self.0.stub.clone();
1249 let mut options = self.0.options.clone();
1250 options.set_retry_policy(gax::retry_policy::NeverRetry);
1251 let query = move |name| {
1252 let stub = stub.clone();
1253 let options = options.clone();
1254 async {
1255 let op = GetOperation::new(stub)
1256 .set_name(name)
1257 .with_options(options)
1258 .send()
1259 .await?;
1260 Ok(Operation::new(op))
1261 }
1262 };
1263
1264 let start = move || async {
1265 let op = self.send().await?;
1266 Ok(Operation::new(op))
1267 };
1268
1269 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1270 }
1271
1272 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1274 self.0.request.name = v.into();
1275 self
1276 }
1277
1278 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1282 self.0.request.project_id = v.into();
1283 self
1284 }
1285
1286 pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1290 self.0.request.trigger_id = v.into();
1291 self
1292 }
1293
1294 pub fn set_source<T>(mut self, v: T) -> Self
1296 where
1297 T: std::convert::Into<crate::model::RepoSource>,
1298 {
1299 self.0.request.source = std::option::Option::Some(v.into());
1300 self
1301 }
1302
1303 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
1305 where
1306 T: std::convert::Into<crate::model::RepoSource>,
1307 {
1308 self.0.request.source = v.map(|x| x.into());
1309 self
1310 }
1311 }
1312
1313 #[doc(hidden)]
1314 impl gax::options::internal::RequestBuilder for RunBuildTrigger {
1315 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1316 &mut self.0.options
1317 }
1318 }
1319
1320 #[derive(Clone, Debug)]
1338 pub struct ReceiveTriggerWebhook(RequestBuilder<crate::model::ReceiveTriggerWebhookRequest>);
1339
1340 impl ReceiveTriggerWebhook {
1341 pub(crate) fn new(
1342 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1343 ) -> Self {
1344 Self(RequestBuilder::new(stub))
1345 }
1346
1347 pub fn with_request<V: Into<crate::model::ReceiveTriggerWebhookRequest>>(
1349 mut self,
1350 v: V,
1351 ) -> Self {
1352 self.0.request = v.into();
1353 self
1354 }
1355
1356 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1358 self.0.options = v.into();
1359 self
1360 }
1361
1362 pub async fn send(self) -> Result<crate::model::ReceiveTriggerWebhookResponse> {
1364 (*self.0.stub)
1365 .receive_trigger_webhook(self.0.request, self.0.options)
1366 .await
1367 .map(gax::response::Response::into_body)
1368 }
1369
1370 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1372 self.0.request.name = v.into();
1373 self
1374 }
1375
1376 pub fn set_body<T>(mut self, v: T) -> Self
1378 where
1379 T: std::convert::Into<api::model::HttpBody>,
1380 {
1381 self.0.request.body = std::option::Option::Some(v.into());
1382 self
1383 }
1384
1385 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1387 where
1388 T: std::convert::Into<api::model::HttpBody>,
1389 {
1390 self.0.request.body = v.map(|x| x.into());
1391 self
1392 }
1393
1394 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1396 self.0.request.project_id = v.into();
1397 self
1398 }
1399
1400 pub fn set_trigger<T: Into<std::string::String>>(mut self, v: T) -> Self {
1402 self.0.request.trigger = v.into();
1403 self
1404 }
1405
1406 pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
1408 self.0.request.secret = v.into();
1409 self
1410 }
1411 }
1412
1413 #[doc(hidden)]
1414 impl gax::options::internal::RequestBuilder for ReceiveTriggerWebhook {
1415 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1416 &mut self.0.options
1417 }
1418 }
1419
1420 #[derive(Clone, Debug)]
1439 pub struct CreateWorkerPool(RequestBuilder<crate::model::CreateWorkerPoolRequest>);
1440
1441 impl CreateWorkerPool {
1442 pub(crate) fn new(
1443 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1444 ) -> Self {
1445 Self(RequestBuilder::new(stub))
1446 }
1447
1448 pub fn with_request<V: Into<crate::model::CreateWorkerPoolRequest>>(
1450 mut self,
1451 v: V,
1452 ) -> Self {
1453 self.0.request = v.into();
1454 self
1455 }
1456
1457 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1459 self.0.options = v.into();
1460 self
1461 }
1462
1463 pub async fn send(self) -> Result<longrunning::model::Operation> {
1470 (*self.0.stub)
1471 .create_worker_pool(self.0.request, self.0.options)
1472 .await
1473 .map(gax::response::Response::into_body)
1474 }
1475
1476 pub fn poller(
1478 self,
1479 ) -> impl lro::Poller<crate::model::WorkerPool, crate::model::CreateWorkerPoolOperationMetadata>
1480 {
1481 type Operation = lro::internal::Operation<
1482 crate::model::WorkerPool,
1483 crate::model::CreateWorkerPoolOperationMetadata,
1484 >;
1485 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1486 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1487
1488 let stub = self.0.stub.clone();
1489 let mut options = self.0.options.clone();
1490 options.set_retry_policy(gax::retry_policy::NeverRetry);
1491 let query = move |name| {
1492 let stub = stub.clone();
1493 let options = options.clone();
1494 async {
1495 let op = GetOperation::new(stub)
1496 .set_name(name)
1497 .with_options(options)
1498 .send()
1499 .await?;
1500 Ok(Operation::new(op))
1501 }
1502 };
1503
1504 let start = move || async {
1505 let op = self.send().await?;
1506 Ok(Operation::new(op))
1507 };
1508
1509 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1510 }
1511
1512 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1516 self.0.request.parent = v.into();
1517 self
1518 }
1519
1520 pub fn set_worker_pool<T>(mut self, v: T) -> Self
1524 where
1525 T: std::convert::Into<crate::model::WorkerPool>,
1526 {
1527 self.0.request.worker_pool = std::option::Option::Some(v.into());
1528 self
1529 }
1530
1531 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
1535 where
1536 T: std::convert::Into<crate::model::WorkerPool>,
1537 {
1538 self.0.request.worker_pool = v.map(|x| x.into());
1539 self
1540 }
1541
1542 pub fn set_worker_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1546 self.0.request.worker_pool_id = v.into();
1547 self
1548 }
1549
1550 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1552 self.0.request.validate_only = v.into();
1553 self
1554 }
1555 }
1556
1557 #[doc(hidden)]
1558 impl gax::options::internal::RequestBuilder for CreateWorkerPool {
1559 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1560 &mut self.0.options
1561 }
1562 }
1563
1564 #[derive(Clone, Debug)]
1582 pub struct GetWorkerPool(RequestBuilder<crate::model::GetWorkerPoolRequest>);
1583
1584 impl GetWorkerPool {
1585 pub(crate) fn new(
1586 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1587 ) -> Self {
1588 Self(RequestBuilder::new(stub))
1589 }
1590
1591 pub fn with_request<V: Into<crate::model::GetWorkerPoolRequest>>(mut self, v: V) -> Self {
1593 self.0.request = v.into();
1594 self
1595 }
1596
1597 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1599 self.0.options = v.into();
1600 self
1601 }
1602
1603 pub async fn send(self) -> Result<crate::model::WorkerPool> {
1605 (*self.0.stub)
1606 .get_worker_pool(self.0.request, self.0.options)
1607 .await
1608 .map(gax::response::Response::into_body)
1609 }
1610
1611 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1615 self.0.request.name = v.into();
1616 self
1617 }
1618 }
1619
1620 #[doc(hidden)]
1621 impl gax::options::internal::RequestBuilder for GetWorkerPool {
1622 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1623 &mut self.0.options
1624 }
1625 }
1626
1627 #[derive(Clone, Debug)]
1646 pub struct DeleteWorkerPool(RequestBuilder<crate::model::DeleteWorkerPoolRequest>);
1647
1648 impl DeleteWorkerPool {
1649 pub(crate) fn new(
1650 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1651 ) -> Self {
1652 Self(RequestBuilder::new(stub))
1653 }
1654
1655 pub fn with_request<V: Into<crate::model::DeleteWorkerPoolRequest>>(
1657 mut self,
1658 v: V,
1659 ) -> Self {
1660 self.0.request = v.into();
1661 self
1662 }
1663
1664 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1666 self.0.options = v.into();
1667 self
1668 }
1669
1670 pub async fn send(self) -> Result<longrunning::model::Operation> {
1677 (*self.0.stub)
1678 .delete_worker_pool(self.0.request, self.0.options)
1679 .await
1680 .map(gax::response::Response::into_body)
1681 }
1682
1683 pub fn poller(
1685 self,
1686 ) -> impl lro::Poller<(), crate::model::DeleteWorkerPoolOperationMetadata> {
1687 type Operation = lro::internal::Operation<
1688 wkt::Empty,
1689 crate::model::DeleteWorkerPoolOperationMetadata,
1690 >;
1691 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1692 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1693
1694 let stub = self.0.stub.clone();
1695 let mut options = self.0.options.clone();
1696 options.set_retry_policy(gax::retry_policy::NeverRetry);
1697 let query = move |name| {
1698 let stub = stub.clone();
1699 let options = options.clone();
1700 async {
1701 let op = GetOperation::new(stub)
1702 .set_name(name)
1703 .with_options(options)
1704 .send()
1705 .await?;
1706 Ok(Operation::new(op))
1707 }
1708 };
1709
1710 let start = move || async {
1711 let op = self.send().await?;
1712 Ok(Operation::new(op))
1713 };
1714
1715 lro::internal::new_unit_response_poller(
1716 polling_error_policy,
1717 polling_backoff_policy,
1718 start,
1719 query,
1720 )
1721 }
1722
1723 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1727 self.0.request.name = v.into();
1728 self
1729 }
1730
1731 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1733 self.0.request.etag = v.into();
1734 self
1735 }
1736
1737 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1739 self.0.request.allow_missing = v.into();
1740 self
1741 }
1742
1743 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1745 self.0.request.validate_only = v.into();
1746 self
1747 }
1748 }
1749
1750 #[doc(hidden)]
1751 impl gax::options::internal::RequestBuilder for DeleteWorkerPool {
1752 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1753 &mut self.0.options
1754 }
1755 }
1756
1757 #[derive(Clone, Debug)]
1776 pub struct UpdateWorkerPool(RequestBuilder<crate::model::UpdateWorkerPoolRequest>);
1777
1778 impl UpdateWorkerPool {
1779 pub(crate) fn new(
1780 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1781 ) -> Self {
1782 Self(RequestBuilder::new(stub))
1783 }
1784
1785 pub fn with_request<V: Into<crate::model::UpdateWorkerPoolRequest>>(
1787 mut self,
1788 v: V,
1789 ) -> Self {
1790 self.0.request = v.into();
1791 self
1792 }
1793
1794 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1796 self.0.options = v.into();
1797 self
1798 }
1799
1800 pub async fn send(self) -> Result<longrunning::model::Operation> {
1807 (*self.0.stub)
1808 .update_worker_pool(self.0.request, self.0.options)
1809 .await
1810 .map(gax::response::Response::into_body)
1811 }
1812
1813 pub fn poller(
1815 self,
1816 ) -> impl lro::Poller<crate::model::WorkerPool, crate::model::UpdateWorkerPoolOperationMetadata>
1817 {
1818 type Operation = lro::internal::Operation<
1819 crate::model::WorkerPool,
1820 crate::model::UpdateWorkerPoolOperationMetadata,
1821 >;
1822 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1823 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1824
1825 let stub = self.0.stub.clone();
1826 let mut options = self.0.options.clone();
1827 options.set_retry_policy(gax::retry_policy::NeverRetry);
1828 let query = move |name| {
1829 let stub = stub.clone();
1830 let options = options.clone();
1831 async {
1832 let op = GetOperation::new(stub)
1833 .set_name(name)
1834 .with_options(options)
1835 .send()
1836 .await?;
1837 Ok(Operation::new(op))
1838 }
1839 };
1840
1841 let start = move || async {
1842 let op = self.send().await?;
1843 Ok(Operation::new(op))
1844 };
1845
1846 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1847 }
1848
1849 pub fn set_worker_pool<T>(mut self, v: T) -> Self
1853 where
1854 T: std::convert::Into<crate::model::WorkerPool>,
1855 {
1856 self.0.request.worker_pool = std::option::Option::Some(v.into());
1857 self
1858 }
1859
1860 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
1864 where
1865 T: std::convert::Into<crate::model::WorkerPool>,
1866 {
1867 self.0.request.worker_pool = v.map(|x| x.into());
1868 self
1869 }
1870
1871 pub fn set_update_mask<T>(mut self, v: T) -> Self
1873 where
1874 T: std::convert::Into<wkt::FieldMask>,
1875 {
1876 self.0.request.update_mask = std::option::Option::Some(v.into());
1877 self
1878 }
1879
1880 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1882 where
1883 T: std::convert::Into<wkt::FieldMask>,
1884 {
1885 self.0.request.update_mask = v.map(|x| x.into());
1886 self
1887 }
1888
1889 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1891 self.0.request.validate_only = v.into();
1892 self
1893 }
1894 }
1895
1896 #[doc(hidden)]
1897 impl gax::options::internal::RequestBuilder for UpdateWorkerPool {
1898 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1899 &mut self.0.options
1900 }
1901 }
1902
1903 #[derive(Clone, Debug)]
1925 pub struct ListWorkerPools(RequestBuilder<crate::model::ListWorkerPoolsRequest>);
1926
1927 impl ListWorkerPools {
1928 pub(crate) fn new(
1929 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1930 ) -> Self {
1931 Self(RequestBuilder::new(stub))
1932 }
1933
1934 pub fn with_request<V: Into<crate::model::ListWorkerPoolsRequest>>(mut self, v: V) -> Self {
1936 self.0.request = v.into();
1937 self
1938 }
1939
1940 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1942 self.0.options = v.into();
1943 self
1944 }
1945
1946 pub async fn send(self) -> Result<crate::model::ListWorkerPoolsResponse> {
1948 (*self.0.stub)
1949 .list_worker_pools(self.0.request, self.0.options)
1950 .await
1951 .map(gax::response::Response::into_body)
1952 }
1953
1954 pub fn by_page(
1956 self,
1957 ) -> impl gax::paginator::Paginator<crate::model::ListWorkerPoolsResponse, gax::error::Error>
1958 {
1959 use std::clone::Clone;
1960 let token = self.0.request.page_token.clone();
1961 let execute = move |token: String| {
1962 let mut builder = self.clone();
1963 builder.0.request = builder.0.request.set_page_token(token);
1964 builder.send()
1965 };
1966 gax::paginator::internal::new_paginator(token, execute)
1967 }
1968
1969 pub fn by_item(
1971 self,
1972 ) -> impl gax::paginator::ItemPaginator<crate::model::ListWorkerPoolsResponse, gax::error::Error>
1973 {
1974 use gax::paginator::Paginator;
1975 self.by_page().items()
1976 }
1977
1978 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1982 self.0.request.parent = v.into();
1983 self
1984 }
1985
1986 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1988 self.0.request.page_size = v.into();
1989 self
1990 }
1991
1992 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1994 self.0.request.page_token = v.into();
1995 self
1996 }
1997 }
1998
1999 #[doc(hidden)]
2000 impl gax::options::internal::RequestBuilder for ListWorkerPools {
2001 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2002 &mut self.0.options
2003 }
2004 }
2005
2006 #[derive(Clone, Debug)]
2024 pub struct GetDefaultServiceAccount(
2025 RequestBuilder<crate::model::GetDefaultServiceAccountRequest>,
2026 );
2027
2028 impl GetDefaultServiceAccount {
2029 pub(crate) fn new(
2030 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
2031 ) -> Self {
2032 Self(RequestBuilder::new(stub))
2033 }
2034
2035 pub fn with_request<V: Into<crate::model::GetDefaultServiceAccountRequest>>(
2037 mut self,
2038 v: V,
2039 ) -> Self {
2040 self.0.request = v.into();
2041 self
2042 }
2043
2044 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2046 self.0.options = v.into();
2047 self
2048 }
2049
2050 pub async fn send(self) -> Result<crate::model::DefaultServiceAccount> {
2052 (*self.0.stub)
2053 .get_default_service_account(self.0.request, self.0.options)
2054 .await
2055 .map(gax::response::Response::into_body)
2056 }
2057
2058 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2062 self.0.request.name = v.into();
2063 self
2064 }
2065 }
2066
2067 #[doc(hidden)]
2068 impl gax::options::internal::RequestBuilder for GetDefaultServiceAccount {
2069 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2070 &mut self.0.options
2071 }
2072 }
2073
2074 #[derive(Clone, Debug)]
2092 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2093
2094 impl GetOperation {
2095 pub(crate) fn new(
2096 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
2097 ) -> Self {
2098 Self(RequestBuilder::new(stub))
2099 }
2100
2101 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2103 mut self,
2104 v: V,
2105 ) -> Self {
2106 self.0.request = v.into();
2107 self
2108 }
2109
2110 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2112 self.0.options = v.into();
2113 self
2114 }
2115
2116 pub async fn send(self) -> Result<longrunning::model::Operation> {
2118 (*self.0.stub)
2119 .get_operation(self.0.request, self.0.options)
2120 .await
2121 .map(gax::response::Response::into_body)
2122 }
2123
2124 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2126 self.0.request.name = v.into();
2127 self
2128 }
2129 }
2130
2131 #[doc(hidden)]
2132 impl gax::options::internal::RequestBuilder for GetOperation {
2133 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2134 &mut self.0.options
2135 }
2136 }
2137
2138 #[derive(Clone, Debug)]
2156 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2157
2158 impl CancelOperation {
2159 pub(crate) fn new(
2160 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
2161 ) -> Self {
2162 Self(RequestBuilder::new(stub))
2163 }
2164
2165 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2167 mut self,
2168 v: V,
2169 ) -> Self {
2170 self.0.request = v.into();
2171 self
2172 }
2173
2174 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2176 self.0.options = v.into();
2177 self
2178 }
2179
2180 pub async fn send(self) -> Result<()> {
2182 (*self.0.stub)
2183 .cancel_operation(self.0.request, self.0.options)
2184 .await
2185 .map(gax::response::Response::into_body)
2186 }
2187
2188 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2190 self.0.request.name = v.into();
2191 self
2192 }
2193 }
2194
2195 #[doc(hidden)]
2196 impl gax::options::internal::RequestBuilder for CancelOperation {
2197 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2198 &mut self.0.options
2199 }
2200 }
2201}