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)]
92 pub struct CreateBuild(RequestBuilder<crate::model::CreateBuildRequest>);
93
94 impl CreateBuild {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 pub fn with_request<V: Into<crate::model::CreateBuildRequest>>(mut self, v: V) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 pub async fn send(self) -> Result<longrunning::model::Operation> {
120 (*self.0.stub)
121 .create_build(self.0.request, self.0.options)
122 .await
123 .map(gax::response::Response::into_body)
124 }
125
126 pub fn poller(
128 self,
129 ) -> impl lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata> {
130 type Operation =
131 lro::internal::Operation<crate::model::Build, crate::model::BuildOperationMetadata>;
132 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
133 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
134
135 let stub = self.0.stub.clone();
136 let mut options = self.0.options.clone();
137 options.set_retry_policy(gax::retry_policy::NeverRetry);
138 let query = move |name| {
139 let stub = stub.clone();
140 let options = options.clone();
141 async {
142 let op = GetOperation::new(stub)
143 .set_name(name)
144 .with_options(options)
145 .send()
146 .await?;
147 Ok(Operation::new(op))
148 }
149 };
150
151 let start = move || async {
152 let op = self.send().await?;
153 Ok(Operation::new(op))
154 };
155
156 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
157 }
158
159 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
161 self.0.request.parent = v.into();
162 self
163 }
164
165 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
169 self.0.request.project_id = v.into();
170 self
171 }
172
173 pub fn set_build<T>(mut self, v: T) -> Self
177 where
178 T: std::convert::Into<crate::model::Build>,
179 {
180 self.0.request.build = std::option::Option::Some(v.into());
181 self
182 }
183
184 pub fn set_or_clear_build<T>(mut self, v: std::option::Option<T>) -> Self
188 where
189 T: std::convert::Into<crate::model::Build>,
190 {
191 self.0.request.build = v.map(|x| x.into());
192 self
193 }
194 }
195
196 #[doc(hidden)]
197 impl gax::options::internal::RequestBuilder for CreateBuild {
198 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
199 &mut self.0.options
200 }
201 }
202
203 #[derive(Clone, Debug)]
220 pub struct GetBuild(RequestBuilder<crate::model::GetBuildRequest>);
221
222 impl GetBuild {
223 pub(crate) fn new(
224 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
225 ) -> Self {
226 Self(RequestBuilder::new(stub))
227 }
228
229 pub fn with_request<V: Into<crate::model::GetBuildRequest>>(mut self, v: V) -> Self {
231 self.0.request = v.into();
232 self
233 }
234
235 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
237 self.0.options = v.into();
238 self
239 }
240
241 pub async fn send(self) -> Result<crate::model::Build> {
243 (*self.0.stub)
244 .get_build(self.0.request, self.0.options)
245 .await
246 .map(gax::response::Response::into_body)
247 }
248
249 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
251 self.0.request.name = v.into();
252 self
253 }
254
255 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
259 self.0.request.project_id = v.into();
260 self
261 }
262
263 pub fn set_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
267 self.0.request.id = v.into();
268 self
269 }
270 }
271
272 #[doc(hidden)]
273 impl gax::options::internal::RequestBuilder for GetBuild {
274 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
275 &mut self.0.options
276 }
277 }
278
279 #[derive(Clone, Debug)]
300 pub struct ListBuilds(RequestBuilder<crate::model::ListBuildsRequest>);
301
302 impl ListBuilds {
303 pub(crate) fn new(
304 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
305 ) -> Self {
306 Self(RequestBuilder::new(stub))
307 }
308
309 pub fn with_request<V: Into<crate::model::ListBuildsRequest>>(mut self, v: V) -> Self {
311 self.0.request = v.into();
312 self
313 }
314
315 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
317 self.0.options = v.into();
318 self
319 }
320
321 pub async fn send(self) -> Result<crate::model::ListBuildsResponse> {
323 (*self.0.stub)
324 .list_builds(self.0.request, self.0.options)
325 .await
326 .map(gax::response::Response::into_body)
327 }
328
329 pub fn by_page(
331 self,
332 ) -> impl gax::paginator::Paginator<crate::model::ListBuildsResponse, gax::error::Error>
333 {
334 use std::clone::Clone;
335 let token = self.0.request.page_token.clone();
336 let execute = move |token: String| {
337 let mut builder = self.clone();
338 builder.0.request = builder.0.request.set_page_token(token);
339 builder.send()
340 };
341 gax::paginator::internal::new_paginator(token, execute)
342 }
343
344 pub fn by_item(
346 self,
347 ) -> impl gax::paginator::ItemPaginator<crate::model::ListBuildsResponse, gax::error::Error>
348 {
349 use gax::paginator::Paginator;
350 self.by_page().items()
351 }
352
353 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
355 self.0.request.parent = v.into();
356 self
357 }
358
359 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
363 self.0.request.project_id = v.into();
364 self
365 }
366
367 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
369 self.0.request.page_size = v.into();
370 self
371 }
372
373 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
375 self.0.request.page_token = v.into();
376 self
377 }
378
379 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
381 self.0.request.filter = v.into();
382 self
383 }
384 }
385
386 #[doc(hidden)]
387 impl gax::options::internal::RequestBuilder for ListBuilds {
388 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
389 &mut self.0.options
390 }
391 }
392
393 #[derive(Clone, Debug)]
410 pub struct CancelBuild(RequestBuilder<crate::model::CancelBuildRequest>);
411
412 impl CancelBuild {
413 pub(crate) fn new(
414 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
415 ) -> Self {
416 Self(RequestBuilder::new(stub))
417 }
418
419 pub fn with_request<V: Into<crate::model::CancelBuildRequest>>(mut self, v: V) -> Self {
421 self.0.request = v.into();
422 self
423 }
424
425 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
427 self.0.options = v.into();
428 self
429 }
430
431 pub async fn send(self) -> Result<crate::model::Build> {
433 (*self.0.stub)
434 .cancel_build(self.0.request, self.0.options)
435 .await
436 .map(gax::response::Response::into_body)
437 }
438
439 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
441 self.0.request.name = v.into();
442 self
443 }
444
445 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
449 self.0.request.project_id = v.into();
450 self
451 }
452
453 pub fn set_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
457 self.0.request.id = v.into();
458 self
459 }
460 }
461
462 #[doc(hidden)]
463 impl gax::options::internal::RequestBuilder for CancelBuild {
464 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
465 &mut self.0.options
466 }
467 }
468
469 #[derive(Clone, Debug)]
487 pub struct RetryBuild(RequestBuilder<crate::model::RetryBuildRequest>);
488
489 impl RetryBuild {
490 pub(crate) fn new(
491 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
492 ) -> Self {
493 Self(RequestBuilder::new(stub))
494 }
495
496 pub fn with_request<V: Into<crate::model::RetryBuildRequest>>(mut self, v: V) -> Self {
498 self.0.request = v.into();
499 self
500 }
501
502 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
504 self.0.options = v.into();
505 self
506 }
507
508 pub async fn send(self) -> Result<longrunning::model::Operation> {
515 (*self.0.stub)
516 .retry_build(self.0.request, self.0.options)
517 .await
518 .map(gax::response::Response::into_body)
519 }
520
521 pub fn poller(
523 self,
524 ) -> impl lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata> {
525 type Operation =
526 lro::internal::Operation<crate::model::Build, crate::model::BuildOperationMetadata>;
527 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
528 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
529
530 let stub = self.0.stub.clone();
531 let mut options = self.0.options.clone();
532 options.set_retry_policy(gax::retry_policy::NeverRetry);
533 let query = move |name| {
534 let stub = stub.clone();
535 let options = options.clone();
536 async {
537 let op = GetOperation::new(stub)
538 .set_name(name)
539 .with_options(options)
540 .send()
541 .await?;
542 Ok(Operation::new(op))
543 }
544 };
545
546 let start = move || async {
547 let op = self.send().await?;
548 Ok(Operation::new(op))
549 };
550
551 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
552 }
553
554 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
556 self.0.request.name = v.into();
557 self
558 }
559
560 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
564 self.0.request.project_id = v.into();
565 self
566 }
567
568 pub fn set_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
572 self.0.request.id = v.into();
573 self
574 }
575 }
576
577 #[doc(hidden)]
578 impl gax::options::internal::RequestBuilder for RetryBuild {
579 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
580 &mut self.0.options
581 }
582 }
583
584 #[derive(Clone, Debug)]
602 pub struct ApproveBuild(RequestBuilder<crate::model::ApproveBuildRequest>);
603
604 impl ApproveBuild {
605 pub(crate) fn new(
606 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
607 ) -> Self {
608 Self(RequestBuilder::new(stub))
609 }
610
611 pub fn with_request<V: Into<crate::model::ApproveBuildRequest>>(mut self, v: V) -> Self {
613 self.0.request = v.into();
614 self
615 }
616
617 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
619 self.0.options = v.into();
620 self
621 }
622
623 pub async fn send(self) -> Result<longrunning::model::Operation> {
630 (*self.0.stub)
631 .approve_build(self.0.request, self.0.options)
632 .await
633 .map(gax::response::Response::into_body)
634 }
635
636 pub fn poller(
638 self,
639 ) -> impl lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata> {
640 type Operation =
641 lro::internal::Operation<crate::model::Build, crate::model::BuildOperationMetadata>;
642 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
643 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
644
645 let stub = self.0.stub.clone();
646 let mut options = self.0.options.clone();
647 options.set_retry_policy(gax::retry_policy::NeverRetry);
648 let query = move |name| {
649 let stub = stub.clone();
650 let options = options.clone();
651 async {
652 let op = GetOperation::new(stub)
653 .set_name(name)
654 .with_options(options)
655 .send()
656 .await?;
657 Ok(Operation::new(op))
658 }
659 };
660
661 let start = move || async {
662 let op = self.send().await?;
663 Ok(Operation::new(op))
664 };
665
666 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
667 }
668
669 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
673 self.0.request.name = v.into();
674 self
675 }
676
677 pub fn set_approval_result<T>(mut self, v: T) -> Self
679 where
680 T: std::convert::Into<crate::model::ApprovalResult>,
681 {
682 self.0.request.approval_result = std::option::Option::Some(v.into());
683 self
684 }
685
686 pub fn set_or_clear_approval_result<T>(mut self, v: std::option::Option<T>) -> Self
688 where
689 T: std::convert::Into<crate::model::ApprovalResult>,
690 {
691 self.0.request.approval_result = v.map(|x| x.into());
692 self
693 }
694 }
695
696 #[doc(hidden)]
697 impl gax::options::internal::RequestBuilder for ApproveBuild {
698 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
699 &mut self.0.options
700 }
701 }
702
703 #[derive(Clone, Debug)]
720 pub struct CreateBuildTrigger(RequestBuilder<crate::model::CreateBuildTriggerRequest>);
721
722 impl CreateBuildTrigger {
723 pub(crate) fn new(
724 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
725 ) -> Self {
726 Self(RequestBuilder::new(stub))
727 }
728
729 pub fn with_request<V: Into<crate::model::CreateBuildTriggerRequest>>(
731 mut self,
732 v: V,
733 ) -> Self {
734 self.0.request = v.into();
735 self
736 }
737
738 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
740 self.0.options = v.into();
741 self
742 }
743
744 pub async fn send(self) -> Result<crate::model::BuildTrigger> {
746 (*self.0.stub)
747 .create_build_trigger(self.0.request, self.0.options)
748 .await
749 .map(gax::response::Response::into_body)
750 }
751
752 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
754 self.0.request.parent = v.into();
755 self
756 }
757
758 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
762 self.0.request.project_id = v.into();
763 self
764 }
765
766 pub fn set_trigger<T>(mut self, v: T) -> Self
770 where
771 T: std::convert::Into<crate::model::BuildTrigger>,
772 {
773 self.0.request.trigger = std::option::Option::Some(v.into());
774 self
775 }
776
777 pub fn set_or_clear_trigger<T>(mut self, v: std::option::Option<T>) -> Self
781 where
782 T: std::convert::Into<crate::model::BuildTrigger>,
783 {
784 self.0.request.trigger = v.map(|x| x.into());
785 self
786 }
787 }
788
789 #[doc(hidden)]
790 impl gax::options::internal::RequestBuilder for CreateBuildTrigger {
791 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
792 &mut self.0.options
793 }
794 }
795
796 #[derive(Clone, Debug)]
813 pub struct GetBuildTrigger(RequestBuilder<crate::model::GetBuildTriggerRequest>);
814
815 impl GetBuildTrigger {
816 pub(crate) fn new(
817 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
818 ) -> Self {
819 Self(RequestBuilder::new(stub))
820 }
821
822 pub fn with_request<V: Into<crate::model::GetBuildTriggerRequest>>(mut self, v: V) -> Self {
824 self.0.request = v.into();
825 self
826 }
827
828 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
830 self.0.options = v.into();
831 self
832 }
833
834 pub async fn send(self) -> Result<crate::model::BuildTrigger> {
836 (*self.0.stub)
837 .get_build_trigger(self.0.request, self.0.options)
838 .await
839 .map(gax::response::Response::into_body)
840 }
841
842 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
844 self.0.request.name = v.into();
845 self
846 }
847
848 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
852 self.0.request.project_id = v.into();
853 self
854 }
855
856 pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
860 self.0.request.trigger_id = v.into();
861 self
862 }
863 }
864
865 #[doc(hidden)]
866 impl gax::options::internal::RequestBuilder for GetBuildTrigger {
867 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
868 &mut self.0.options
869 }
870 }
871
872 #[derive(Clone, Debug)]
893 pub struct ListBuildTriggers(RequestBuilder<crate::model::ListBuildTriggersRequest>);
894
895 impl ListBuildTriggers {
896 pub(crate) fn new(
897 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
898 ) -> Self {
899 Self(RequestBuilder::new(stub))
900 }
901
902 pub fn with_request<V: Into<crate::model::ListBuildTriggersRequest>>(
904 mut self,
905 v: V,
906 ) -> Self {
907 self.0.request = v.into();
908 self
909 }
910
911 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
913 self.0.options = v.into();
914 self
915 }
916
917 pub async fn send(self) -> Result<crate::model::ListBuildTriggersResponse> {
919 (*self.0.stub)
920 .list_build_triggers(self.0.request, self.0.options)
921 .await
922 .map(gax::response::Response::into_body)
923 }
924
925 pub fn by_page(
927 self,
928 ) -> impl gax::paginator::Paginator<crate::model::ListBuildTriggersResponse, gax::error::Error>
929 {
930 use std::clone::Clone;
931 let token = self.0.request.page_token.clone();
932 let execute = move |token: String| {
933 let mut builder = self.clone();
934 builder.0.request = builder.0.request.set_page_token(token);
935 builder.send()
936 };
937 gax::paginator::internal::new_paginator(token, execute)
938 }
939
940 pub fn by_item(
942 self,
943 ) -> impl gax::paginator::ItemPaginator<crate::model::ListBuildTriggersResponse, gax::error::Error>
944 {
945 use gax::paginator::Paginator;
946 self.by_page().items()
947 }
948
949 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
951 self.0.request.parent = v.into();
952 self
953 }
954
955 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
959 self.0.request.project_id = v.into();
960 self
961 }
962
963 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
965 self.0.request.page_size = v.into();
966 self
967 }
968
969 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
971 self.0.request.page_token = v.into();
972 self
973 }
974 }
975
976 #[doc(hidden)]
977 impl gax::options::internal::RequestBuilder for ListBuildTriggers {
978 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
979 &mut self.0.options
980 }
981 }
982
983 #[derive(Clone, Debug)]
1000 pub struct DeleteBuildTrigger(RequestBuilder<crate::model::DeleteBuildTriggerRequest>);
1001
1002 impl DeleteBuildTrigger {
1003 pub(crate) fn new(
1004 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1005 ) -> Self {
1006 Self(RequestBuilder::new(stub))
1007 }
1008
1009 pub fn with_request<V: Into<crate::model::DeleteBuildTriggerRequest>>(
1011 mut self,
1012 v: V,
1013 ) -> Self {
1014 self.0.request = v.into();
1015 self
1016 }
1017
1018 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1020 self.0.options = v.into();
1021 self
1022 }
1023
1024 pub async fn send(self) -> Result<()> {
1026 (*self.0.stub)
1027 .delete_build_trigger(self.0.request, self.0.options)
1028 .await
1029 .map(gax::response::Response::into_body)
1030 }
1031
1032 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1034 self.0.request.name = v.into();
1035 self
1036 }
1037
1038 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1042 self.0.request.project_id = v.into();
1043 self
1044 }
1045
1046 pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1050 self.0.request.trigger_id = v.into();
1051 self
1052 }
1053 }
1054
1055 #[doc(hidden)]
1056 impl gax::options::internal::RequestBuilder for DeleteBuildTrigger {
1057 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1058 &mut self.0.options
1059 }
1060 }
1061
1062 #[derive(Clone, Debug)]
1079 pub struct UpdateBuildTrigger(RequestBuilder<crate::model::UpdateBuildTriggerRequest>);
1080
1081 impl UpdateBuildTrigger {
1082 pub(crate) fn new(
1083 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1084 ) -> Self {
1085 Self(RequestBuilder::new(stub))
1086 }
1087
1088 pub fn with_request<V: Into<crate::model::UpdateBuildTriggerRequest>>(
1090 mut self,
1091 v: V,
1092 ) -> Self {
1093 self.0.request = v.into();
1094 self
1095 }
1096
1097 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1099 self.0.options = v.into();
1100 self
1101 }
1102
1103 pub async fn send(self) -> Result<crate::model::BuildTrigger> {
1105 (*self.0.stub)
1106 .update_build_trigger(self.0.request, self.0.options)
1107 .await
1108 .map(gax::response::Response::into_body)
1109 }
1110
1111 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1115 self.0.request.project_id = v.into();
1116 self
1117 }
1118
1119 pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1123 self.0.request.trigger_id = v.into();
1124 self
1125 }
1126
1127 pub fn set_trigger<T>(mut self, v: T) -> Self
1131 where
1132 T: std::convert::Into<crate::model::BuildTrigger>,
1133 {
1134 self.0.request.trigger = std::option::Option::Some(v.into());
1135 self
1136 }
1137
1138 pub fn set_or_clear_trigger<T>(mut self, v: std::option::Option<T>) -> Self
1142 where
1143 T: std::convert::Into<crate::model::BuildTrigger>,
1144 {
1145 self.0.request.trigger = v.map(|x| x.into());
1146 self
1147 }
1148
1149 pub fn set_update_mask<T>(mut self, v: T) -> Self
1151 where
1152 T: std::convert::Into<wkt::FieldMask>,
1153 {
1154 self.0.request.update_mask = std::option::Option::Some(v.into());
1155 self
1156 }
1157
1158 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1160 where
1161 T: std::convert::Into<wkt::FieldMask>,
1162 {
1163 self.0.request.update_mask = v.map(|x| x.into());
1164 self
1165 }
1166 }
1167
1168 #[doc(hidden)]
1169 impl gax::options::internal::RequestBuilder for UpdateBuildTrigger {
1170 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1171 &mut self.0.options
1172 }
1173 }
1174
1175 #[derive(Clone, Debug)]
1193 pub struct RunBuildTrigger(RequestBuilder<crate::model::RunBuildTriggerRequest>);
1194
1195 impl RunBuildTrigger {
1196 pub(crate) fn new(
1197 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1198 ) -> Self {
1199 Self(RequestBuilder::new(stub))
1200 }
1201
1202 pub fn with_request<V: Into<crate::model::RunBuildTriggerRequest>>(mut self, v: V) -> Self {
1204 self.0.request = v.into();
1205 self
1206 }
1207
1208 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1210 self.0.options = v.into();
1211 self
1212 }
1213
1214 pub async fn send(self) -> Result<longrunning::model::Operation> {
1221 (*self.0.stub)
1222 .run_build_trigger(self.0.request, self.0.options)
1223 .await
1224 .map(gax::response::Response::into_body)
1225 }
1226
1227 pub fn poller(
1229 self,
1230 ) -> impl lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata> {
1231 type Operation =
1232 lro::internal::Operation<crate::model::Build, crate::model::BuildOperationMetadata>;
1233 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1234 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1235
1236 let stub = self.0.stub.clone();
1237 let mut options = self.0.options.clone();
1238 options.set_retry_policy(gax::retry_policy::NeverRetry);
1239 let query = move |name| {
1240 let stub = stub.clone();
1241 let options = options.clone();
1242 async {
1243 let op = GetOperation::new(stub)
1244 .set_name(name)
1245 .with_options(options)
1246 .send()
1247 .await?;
1248 Ok(Operation::new(op))
1249 }
1250 };
1251
1252 let start = move || async {
1253 let op = self.send().await?;
1254 Ok(Operation::new(op))
1255 };
1256
1257 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1258 }
1259
1260 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1262 self.0.request.name = v.into();
1263 self
1264 }
1265
1266 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1270 self.0.request.project_id = v.into();
1271 self
1272 }
1273
1274 pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1278 self.0.request.trigger_id = v.into();
1279 self
1280 }
1281
1282 pub fn set_source<T>(mut self, v: T) -> Self
1284 where
1285 T: std::convert::Into<crate::model::RepoSource>,
1286 {
1287 self.0.request.source = std::option::Option::Some(v.into());
1288 self
1289 }
1290
1291 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
1293 where
1294 T: std::convert::Into<crate::model::RepoSource>,
1295 {
1296 self.0.request.source = v.map(|x| x.into());
1297 self
1298 }
1299 }
1300
1301 #[doc(hidden)]
1302 impl gax::options::internal::RequestBuilder for RunBuildTrigger {
1303 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1304 &mut self.0.options
1305 }
1306 }
1307
1308 #[derive(Clone, Debug)]
1325 pub struct ReceiveTriggerWebhook(RequestBuilder<crate::model::ReceiveTriggerWebhookRequest>);
1326
1327 impl ReceiveTriggerWebhook {
1328 pub(crate) fn new(
1329 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1330 ) -> Self {
1331 Self(RequestBuilder::new(stub))
1332 }
1333
1334 pub fn with_request<V: Into<crate::model::ReceiveTriggerWebhookRequest>>(
1336 mut self,
1337 v: V,
1338 ) -> Self {
1339 self.0.request = v.into();
1340 self
1341 }
1342
1343 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1345 self.0.options = v.into();
1346 self
1347 }
1348
1349 pub async fn send(self) -> Result<crate::model::ReceiveTriggerWebhookResponse> {
1351 (*self.0.stub)
1352 .receive_trigger_webhook(self.0.request, self.0.options)
1353 .await
1354 .map(gax::response::Response::into_body)
1355 }
1356
1357 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1359 self.0.request.name = v.into();
1360 self
1361 }
1362
1363 pub fn set_body<T>(mut self, v: T) -> Self
1365 where
1366 T: std::convert::Into<api::model::HttpBody>,
1367 {
1368 self.0.request.body = std::option::Option::Some(v.into());
1369 self
1370 }
1371
1372 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1374 where
1375 T: std::convert::Into<api::model::HttpBody>,
1376 {
1377 self.0.request.body = v.map(|x| x.into());
1378 self
1379 }
1380
1381 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1383 self.0.request.project_id = v.into();
1384 self
1385 }
1386
1387 pub fn set_trigger<T: Into<std::string::String>>(mut self, v: T) -> Self {
1389 self.0.request.trigger = v.into();
1390 self
1391 }
1392
1393 pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
1395 self.0.request.secret = v.into();
1396 self
1397 }
1398 }
1399
1400 #[doc(hidden)]
1401 impl gax::options::internal::RequestBuilder for ReceiveTriggerWebhook {
1402 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1403 &mut self.0.options
1404 }
1405 }
1406
1407 #[derive(Clone, Debug)]
1425 pub struct CreateWorkerPool(RequestBuilder<crate::model::CreateWorkerPoolRequest>);
1426
1427 impl CreateWorkerPool {
1428 pub(crate) fn new(
1429 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1430 ) -> Self {
1431 Self(RequestBuilder::new(stub))
1432 }
1433
1434 pub fn with_request<V: Into<crate::model::CreateWorkerPoolRequest>>(
1436 mut self,
1437 v: V,
1438 ) -> Self {
1439 self.0.request = v.into();
1440 self
1441 }
1442
1443 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1445 self.0.options = v.into();
1446 self
1447 }
1448
1449 pub async fn send(self) -> Result<longrunning::model::Operation> {
1456 (*self.0.stub)
1457 .create_worker_pool(self.0.request, self.0.options)
1458 .await
1459 .map(gax::response::Response::into_body)
1460 }
1461
1462 pub fn poller(
1464 self,
1465 ) -> impl lro::Poller<crate::model::WorkerPool, crate::model::CreateWorkerPoolOperationMetadata>
1466 {
1467 type Operation = lro::internal::Operation<
1468 crate::model::WorkerPool,
1469 crate::model::CreateWorkerPoolOperationMetadata,
1470 >;
1471 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1472 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1473
1474 let stub = self.0.stub.clone();
1475 let mut options = self.0.options.clone();
1476 options.set_retry_policy(gax::retry_policy::NeverRetry);
1477 let query = move |name| {
1478 let stub = stub.clone();
1479 let options = options.clone();
1480 async {
1481 let op = GetOperation::new(stub)
1482 .set_name(name)
1483 .with_options(options)
1484 .send()
1485 .await?;
1486 Ok(Operation::new(op))
1487 }
1488 };
1489
1490 let start = move || async {
1491 let op = self.send().await?;
1492 Ok(Operation::new(op))
1493 };
1494
1495 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1496 }
1497
1498 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1502 self.0.request.parent = v.into();
1503 self
1504 }
1505
1506 pub fn set_worker_pool<T>(mut self, v: T) -> Self
1510 where
1511 T: std::convert::Into<crate::model::WorkerPool>,
1512 {
1513 self.0.request.worker_pool = std::option::Option::Some(v.into());
1514 self
1515 }
1516
1517 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
1521 where
1522 T: std::convert::Into<crate::model::WorkerPool>,
1523 {
1524 self.0.request.worker_pool = v.map(|x| x.into());
1525 self
1526 }
1527
1528 pub fn set_worker_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1532 self.0.request.worker_pool_id = v.into();
1533 self
1534 }
1535
1536 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1538 self.0.request.validate_only = v.into();
1539 self
1540 }
1541 }
1542
1543 #[doc(hidden)]
1544 impl gax::options::internal::RequestBuilder for CreateWorkerPool {
1545 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1546 &mut self.0.options
1547 }
1548 }
1549
1550 #[derive(Clone, Debug)]
1567 pub struct GetWorkerPool(RequestBuilder<crate::model::GetWorkerPoolRequest>);
1568
1569 impl GetWorkerPool {
1570 pub(crate) fn new(
1571 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1572 ) -> Self {
1573 Self(RequestBuilder::new(stub))
1574 }
1575
1576 pub fn with_request<V: Into<crate::model::GetWorkerPoolRequest>>(mut self, v: V) -> Self {
1578 self.0.request = v.into();
1579 self
1580 }
1581
1582 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1584 self.0.options = v.into();
1585 self
1586 }
1587
1588 pub async fn send(self) -> Result<crate::model::WorkerPool> {
1590 (*self.0.stub)
1591 .get_worker_pool(self.0.request, self.0.options)
1592 .await
1593 .map(gax::response::Response::into_body)
1594 }
1595
1596 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1600 self.0.request.name = v.into();
1601 self
1602 }
1603 }
1604
1605 #[doc(hidden)]
1606 impl gax::options::internal::RequestBuilder for GetWorkerPool {
1607 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1608 &mut self.0.options
1609 }
1610 }
1611
1612 #[derive(Clone, Debug)]
1630 pub struct DeleteWorkerPool(RequestBuilder<crate::model::DeleteWorkerPoolRequest>);
1631
1632 impl DeleteWorkerPool {
1633 pub(crate) fn new(
1634 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1635 ) -> Self {
1636 Self(RequestBuilder::new(stub))
1637 }
1638
1639 pub fn with_request<V: Into<crate::model::DeleteWorkerPoolRequest>>(
1641 mut self,
1642 v: V,
1643 ) -> Self {
1644 self.0.request = v.into();
1645 self
1646 }
1647
1648 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1650 self.0.options = v.into();
1651 self
1652 }
1653
1654 pub async fn send(self) -> Result<longrunning::model::Operation> {
1661 (*self.0.stub)
1662 .delete_worker_pool(self.0.request, self.0.options)
1663 .await
1664 .map(gax::response::Response::into_body)
1665 }
1666
1667 pub fn poller(
1669 self,
1670 ) -> impl lro::Poller<(), crate::model::DeleteWorkerPoolOperationMetadata> {
1671 type Operation = lro::internal::Operation<
1672 wkt::Empty,
1673 crate::model::DeleteWorkerPoolOperationMetadata,
1674 >;
1675 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1676 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1677
1678 let stub = self.0.stub.clone();
1679 let mut options = self.0.options.clone();
1680 options.set_retry_policy(gax::retry_policy::NeverRetry);
1681 let query = move |name| {
1682 let stub = stub.clone();
1683 let options = options.clone();
1684 async {
1685 let op = GetOperation::new(stub)
1686 .set_name(name)
1687 .with_options(options)
1688 .send()
1689 .await?;
1690 Ok(Operation::new(op))
1691 }
1692 };
1693
1694 let start = move || async {
1695 let op = self.send().await?;
1696 Ok(Operation::new(op))
1697 };
1698
1699 lro::internal::new_unit_response_poller(
1700 polling_error_policy,
1701 polling_backoff_policy,
1702 start,
1703 query,
1704 )
1705 }
1706
1707 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1711 self.0.request.name = v.into();
1712 self
1713 }
1714
1715 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1717 self.0.request.etag = v.into();
1718 self
1719 }
1720
1721 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1723 self.0.request.allow_missing = v.into();
1724 self
1725 }
1726
1727 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1729 self.0.request.validate_only = v.into();
1730 self
1731 }
1732 }
1733
1734 #[doc(hidden)]
1735 impl gax::options::internal::RequestBuilder for DeleteWorkerPool {
1736 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1737 &mut self.0.options
1738 }
1739 }
1740
1741 #[derive(Clone, Debug)]
1759 pub struct UpdateWorkerPool(RequestBuilder<crate::model::UpdateWorkerPoolRequest>);
1760
1761 impl UpdateWorkerPool {
1762 pub(crate) fn new(
1763 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1764 ) -> Self {
1765 Self(RequestBuilder::new(stub))
1766 }
1767
1768 pub fn with_request<V: Into<crate::model::UpdateWorkerPoolRequest>>(
1770 mut self,
1771 v: V,
1772 ) -> Self {
1773 self.0.request = v.into();
1774 self
1775 }
1776
1777 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1779 self.0.options = v.into();
1780 self
1781 }
1782
1783 pub async fn send(self) -> Result<longrunning::model::Operation> {
1790 (*self.0.stub)
1791 .update_worker_pool(self.0.request, self.0.options)
1792 .await
1793 .map(gax::response::Response::into_body)
1794 }
1795
1796 pub fn poller(
1798 self,
1799 ) -> impl lro::Poller<crate::model::WorkerPool, crate::model::UpdateWorkerPoolOperationMetadata>
1800 {
1801 type Operation = lro::internal::Operation<
1802 crate::model::WorkerPool,
1803 crate::model::UpdateWorkerPoolOperationMetadata,
1804 >;
1805 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1806 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1807
1808 let stub = self.0.stub.clone();
1809 let mut options = self.0.options.clone();
1810 options.set_retry_policy(gax::retry_policy::NeverRetry);
1811 let query = move |name| {
1812 let stub = stub.clone();
1813 let options = options.clone();
1814 async {
1815 let op = GetOperation::new(stub)
1816 .set_name(name)
1817 .with_options(options)
1818 .send()
1819 .await?;
1820 Ok(Operation::new(op))
1821 }
1822 };
1823
1824 let start = move || async {
1825 let op = self.send().await?;
1826 Ok(Operation::new(op))
1827 };
1828
1829 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1830 }
1831
1832 pub fn set_worker_pool<T>(mut self, v: T) -> Self
1836 where
1837 T: std::convert::Into<crate::model::WorkerPool>,
1838 {
1839 self.0.request.worker_pool = std::option::Option::Some(v.into());
1840 self
1841 }
1842
1843 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
1847 where
1848 T: std::convert::Into<crate::model::WorkerPool>,
1849 {
1850 self.0.request.worker_pool = v.map(|x| x.into());
1851 self
1852 }
1853
1854 pub fn set_update_mask<T>(mut self, v: T) -> Self
1856 where
1857 T: std::convert::Into<wkt::FieldMask>,
1858 {
1859 self.0.request.update_mask = std::option::Option::Some(v.into());
1860 self
1861 }
1862
1863 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1865 where
1866 T: std::convert::Into<wkt::FieldMask>,
1867 {
1868 self.0.request.update_mask = v.map(|x| x.into());
1869 self
1870 }
1871
1872 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1874 self.0.request.validate_only = v.into();
1875 self
1876 }
1877 }
1878
1879 #[doc(hidden)]
1880 impl gax::options::internal::RequestBuilder for UpdateWorkerPool {
1881 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1882 &mut self.0.options
1883 }
1884 }
1885
1886 #[derive(Clone, Debug)]
1907 pub struct ListWorkerPools(RequestBuilder<crate::model::ListWorkerPoolsRequest>);
1908
1909 impl ListWorkerPools {
1910 pub(crate) fn new(
1911 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1912 ) -> Self {
1913 Self(RequestBuilder::new(stub))
1914 }
1915
1916 pub fn with_request<V: Into<crate::model::ListWorkerPoolsRequest>>(mut self, v: V) -> Self {
1918 self.0.request = v.into();
1919 self
1920 }
1921
1922 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1924 self.0.options = v.into();
1925 self
1926 }
1927
1928 pub async fn send(self) -> Result<crate::model::ListWorkerPoolsResponse> {
1930 (*self.0.stub)
1931 .list_worker_pools(self.0.request, self.0.options)
1932 .await
1933 .map(gax::response::Response::into_body)
1934 }
1935
1936 pub fn by_page(
1938 self,
1939 ) -> impl gax::paginator::Paginator<crate::model::ListWorkerPoolsResponse, gax::error::Error>
1940 {
1941 use std::clone::Clone;
1942 let token = self.0.request.page_token.clone();
1943 let execute = move |token: String| {
1944 let mut builder = self.clone();
1945 builder.0.request = builder.0.request.set_page_token(token);
1946 builder.send()
1947 };
1948 gax::paginator::internal::new_paginator(token, execute)
1949 }
1950
1951 pub fn by_item(
1953 self,
1954 ) -> impl gax::paginator::ItemPaginator<crate::model::ListWorkerPoolsResponse, gax::error::Error>
1955 {
1956 use gax::paginator::Paginator;
1957 self.by_page().items()
1958 }
1959
1960 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1964 self.0.request.parent = v.into();
1965 self
1966 }
1967
1968 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1970 self.0.request.page_size = v.into();
1971 self
1972 }
1973
1974 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1976 self.0.request.page_token = v.into();
1977 self
1978 }
1979 }
1980
1981 #[doc(hidden)]
1982 impl gax::options::internal::RequestBuilder for ListWorkerPools {
1983 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1984 &mut self.0.options
1985 }
1986 }
1987
1988 #[derive(Clone, Debug)]
2005 pub struct GetDefaultServiceAccount(
2006 RequestBuilder<crate::model::GetDefaultServiceAccountRequest>,
2007 );
2008
2009 impl GetDefaultServiceAccount {
2010 pub(crate) fn new(
2011 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
2012 ) -> Self {
2013 Self(RequestBuilder::new(stub))
2014 }
2015
2016 pub fn with_request<V: Into<crate::model::GetDefaultServiceAccountRequest>>(
2018 mut self,
2019 v: V,
2020 ) -> Self {
2021 self.0.request = v.into();
2022 self
2023 }
2024
2025 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2027 self.0.options = v.into();
2028 self
2029 }
2030
2031 pub async fn send(self) -> Result<crate::model::DefaultServiceAccount> {
2033 (*self.0.stub)
2034 .get_default_service_account(self.0.request, self.0.options)
2035 .await
2036 .map(gax::response::Response::into_body)
2037 }
2038
2039 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2043 self.0.request.name = v.into();
2044 self
2045 }
2046 }
2047
2048 #[doc(hidden)]
2049 impl gax::options::internal::RequestBuilder for GetDefaultServiceAccount {
2050 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2051 &mut self.0.options
2052 }
2053 }
2054
2055 #[derive(Clone, Debug)]
2072 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2073
2074 impl GetOperation {
2075 pub(crate) fn new(
2076 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
2077 ) -> Self {
2078 Self(RequestBuilder::new(stub))
2079 }
2080
2081 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2083 mut self,
2084 v: V,
2085 ) -> 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<longrunning::model::Operation> {
2098 (*self.0.stub)
2099 .get_operation(self.0.request, self.0.options)
2100 .await
2101 .map(gax::response::Response::into_body)
2102 }
2103
2104 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2106 self.0.request.name = v.into();
2107 self
2108 }
2109 }
2110
2111 #[doc(hidden)]
2112 impl gax::options::internal::RequestBuilder for GetOperation {
2113 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2114 &mut self.0.options
2115 }
2116 }
2117
2118 #[derive(Clone, Debug)]
2135 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2136
2137 impl CancelOperation {
2138 pub(crate) fn new(
2139 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
2140 ) -> Self {
2141 Self(RequestBuilder::new(stub))
2142 }
2143
2144 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2146 mut self,
2147 v: V,
2148 ) -> Self {
2149 self.0.request = v.into();
2150 self
2151 }
2152
2153 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2155 self.0.options = v.into();
2156 self
2157 }
2158
2159 pub async fn send(self) -> Result<()> {
2161 (*self.0.stub)
2162 .cancel_operation(self.0.request, self.0.options)
2163 .await
2164 .map(gax::response::Response::into_body)
2165 }
2166
2167 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2169 self.0.request.name = v.into();
2170 self
2171 }
2172 }
2173
2174 #[doc(hidden)]
2175 impl gax::options::internal::RequestBuilder for CancelOperation {
2176 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2177 &mut self.0.options
2178 }
2179 }
2180}