1pub mod cloud_build {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::CloudBuild;
38 pub struct Factory;
39 impl crate::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 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::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<crate::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
120 (*self.0.stub)
121 .create_build(self.0.request, self.0.options)
122 .await
123 .map(crate::Response::into_body)
124 }
125
126 pub fn poller(
128 self,
129 ) -> impl google_cloud_lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata>
130 {
131 type Operation = google_cloud_lro::internal::Operation<
132 crate::model::Build,
133 crate::model::BuildOperationMetadata,
134 >;
135 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
136 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
137
138 let stub = self.0.stub.clone();
139 let mut options = self.0.options.clone();
140 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
141 let query = move |name| {
142 let stub = stub.clone();
143 let options = options.clone();
144 async {
145 let op = GetOperation::new(stub)
146 .set_name(name)
147 .with_options(options)
148 .send()
149 .await?;
150 Ok(Operation::new(op))
151 }
152 };
153
154 let start = move || async {
155 let op = self.send().await?;
156 Ok(Operation::new(op))
157 };
158
159 google_cloud_lro::internal::new_poller(
160 polling_error_policy,
161 polling_backoff_policy,
162 start,
163 query,
164 )
165 }
166
167 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
169 self.0.request.parent = v.into();
170 self
171 }
172
173 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
177 self.0.request.project_id = v.into();
178 self
179 }
180
181 pub fn set_build<T>(mut self, v: T) -> Self
185 where
186 T: std::convert::Into<crate::model::Build>,
187 {
188 self.0.request.build = std::option::Option::Some(v.into());
189 self
190 }
191
192 pub fn set_or_clear_build<T>(mut self, v: std::option::Option<T>) -> Self
196 where
197 T: std::convert::Into<crate::model::Build>,
198 {
199 self.0.request.build = v.map(|x| x.into());
200 self
201 }
202 }
203
204 #[doc(hidden)]
205 impl crate::RequestBuilder for CreateBuild {
206 fn request_options(&mut self) -> &mut crate::RequestOptions {
207 &mut self.0.options
208 }
209 }
210
211 #[derive(Clone, Debug)]
228 pub struct GetBuild(RequestBuilder<crate::model::GetBuildRequest>);
229
230 impl GetBuild {
231 pub(crate) fn new(
232 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
233 ) -> Self {
234 Self(RequestBuilder::new(stub))
235 }
236
237 pub fn with_request<V: Into<crate::model::GetBuildRequest>>(mut self, v: V) -> Self {
239 self.0.request = v.into();
240 self
241 }
242
243 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
245 self.0.options = v.into();
246 self
247 }
248
249 pub async fn send(self) -> Result<crate::model::Build> {
251 (*self.0.stub)
252 .get_build(self.0.request, self.0.options)
253 .await
254 .map(crate::Response::into_body)
255 }
256
257 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
259 self.0.request.name = v.into();
260 self
261 }
262
263 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
267 self.0.request.project_id = v.into();
268 self
269 }
270
271 pub fn set_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
275 self.0.request.id = v.into();
276 self
277 }
278 }
279
280 #[doc(hidden)]
281 impl crate::RequestBuilder for GetBuild {
282 fn request_options(&mut self) -> &mut crate::RequestOptions {
283 &mut self.0.options
284 }
285 }
286
287 #[derive(Clone, Debug)]
308 pub struct ListBuilds(RequestBuilder<crate::model::ListBuildsRequest>);
309
310 impl ListBuilds {
311 pub(crate) fn new(
312 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
313 ) -> Self {
314 Self(RequestBuilder::new(stub))
315 }
316
317 pub fn with_request<V: Into<crate::model::ListBuildsRequest>>(mut self, v: V) -> Self {
319 self.0.request = v.into();
320 self
321 }
322
323 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
325 self.0.options = v.into();
326 self
327 }
328
329 pub async fn send(self) -> Result<crate::model::ListBuildsResponse> {
331 (*self.0.stub)
332 .list_builds(self.0.request, self.0.options)
333 .await
334 .map(crate::Response::into_body)
335 }
336
337 pub fn by_page(
339 self,
340 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListBuildsResponse, crate::Error>
341 {
342 use std::clone::Clone;
343 let token = self.0.request.page_token.clone();
344 let execute = move |token: String| {
345 let mut builder = self.clone();
346 builder.0.request = builder.0.request.set_page_token(token);
347 builder.send()
348 };
349 google_cloud_gax::paginator::internal::new_paginator(token, execute)
350 }
351
352 pub fn by_item(
354 self,
355 ) -> impl google_cloud_gax::paginator::ItemPaginator<
356 crate::model::ListBuildsResponse,
357 crate::Error,
358 > {
359 use google_cloud_gax::paginator::Paginator;
360 self.by_page().items()
361 }
362
363 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
365 self.0.request.parent = v.into();
366 self
367 }
368
369 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
373 self.0.request.project_id = v.into();
374 self
375 }
376
377 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
379 self.0.request.page_size = v.into();
380 self
381 }
382
383 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
385 self.0.request.page_token = v.into();
386 self
387 }
388
389 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
391 self.0.request.filter = v.into();
392 self
393 }
394 }
395
396 #[doc(hidden)]
397 impl crate::RequestBuilder for ListBuilds {
398 fn request_options(&mut self) -> &mut crate::RequestOptions {
399 &mut self.0.options
400 }
401 }
402
403 #[derive(Clone, Debug)]
420 pub struct CancelBuild(RequestBuilder<crate::model::CancelBuildRequest>);
421
422 impl CancelBuild {
423 pub(crate) fn new(
424 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
425 ) -> Self {
426 Self(RequestBuilder::new(stub))
427 }
428
429 pub fn with_request<V: Into<crate::model::CancelBuildRequest>>(mut self, v: V) -> Self {
431 self.0.request = v.into();
432 self
433 }
434
435 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
437 self.0.options = v.into();
438 self
439 }
440
441 pub async fn send(self) -> Result<crate::model::Build> {
443 (*self.0.stub)
444 .cancel_build(self.0.request, self.0.options)
445 .await
446 .map(crate::Response::into_body)
447 }
448
449 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
451 self.0.request.name = v.into();
452 self
453 }
454
455 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
459 self.0.request.project_id = v.into();
460 self
461 }
462
463 pub fn set_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
467 self.0.request.id = v.into();
468 self
469 }
470 }
471
472 #[doc(hidden)]
473 impl crate::RequestBuilder for CancelBuild {
474 fn request_options(&mut self) -> &mut crate::RequestOptions {
475 &mut self.0.options
476 }
477 }
478
479 #[derive(Clone, Debug)]
497 pub struct RetryBuild(RequestBuilder<crate::model::RetryBuildRequest>);
498
499 impl RetryBuild {
500 pub(crate) fn new(
501 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
502 ) -> Self {
503 Self(RequestBuilder::new(stub))
504 }
505
506 pub fn with_request<V: Into<crate::model::RetryBuildRequest>>(mut self, v: V) -> Self {
508 self.0.request = v.into();
509 self
510 }
511
512 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
514 self.0.options = v.into();
515 self
516 }
517
518 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
525 (*self.0.stub)
526 .retry_build(self.0.request, self.0.options)
527 .await
528 .map(crate::Response::into_body)
529 }
530
531 pub fn poller(
533 self,
534 ) -> impl google_cloud_lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata>
535 {
536 type Operation = google_cloud_lro::internal::Operation<
537 crate::model::Build,
538 crate::model::BuildOperationMetadata,
539 >;
540 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
541 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
542
543 let stub = self.0.stub.clone();
544 let mut options = self.0.options.clone();
545 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
546 let query = move |name| {
547 let stub = stub.clone();
548 let options = options.clone();
549 async {
550 let op = GetOperation::new(stub)
551 .set_name(name)
552 .with_options(options)
553 .send()
554 .await?;
555 Ok(Operation::new(op))
556 }
557 };
558
559 let start = move || async {
560 let op = self.send().await?;
561 Ok(Operation::new(op))
562 };
563
564 google_cloud_lro::internal::new_poller(
565 polling_error_policy,
566 polling_backoff_policy,
567 start,
568 query,
569 )
570 }
571
572 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
574 self.0.request.name = v.into();
575 self
576 }
577
578 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
582 self.0.request.project_id = v.into();
583 self
584 }
585
586 pub fn set_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
590 self.0.request.id = v.into();
591 self
592 }
593 }
594
595 #[doc(hidden)]
596 impl crate::RequestBuilder for RetryBuild {
597 fn request_options(&mut self) -> &mut crate::RequestOptions {
598 &mut self.0.options
599 }
600 }
601
602 #[derive(Clone, Debug)]
620 pub struct ApproveBuild(RequestBuilder<crate::model::ApproveBuildRequest>);
621
622 impl ApproveBuild {
623 pub(crate) fn new(
624 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
625 ) -> Self {
626 Self(RequestBuilder::new(stub))
627 }
628
629 pub fn with_request<V: Into<crate::model::ApproveBuildRequest>>(mut self, v: V) -> Self {
631 self.0.request = v.into();
632 self
633 }
634
635 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
637 self.0.options = v.into();
638 self
639 }
640
641 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
648 (*self.0.stub)
649 .approve_build(self.0.request, self.0.options)
650 .await
651 .map(crate::Response::into_body)
652 }
653
654 pub fn poller(
656 self,
657 ) -> impl google_cloud_lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata>
658 {
659 type Operation = google_cloud_lro::internal::Operation<
660 crate::model::Build,
661 crate::model::BuildOperationMetadata,
662 >;
663 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
664 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
665
666 let stub = self.0.stub.clone();
667 let mut options = self.0.options.clone();
668 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
669 let query = move |name| {
670 let stub = stub.clone();
671 let options = options.clone();
672 async {
673 let op = GetOperation::new(stub)
674 .set_name(name)
675 .with_options(options)
676 .send()
677 .await?;
678 Ok(Operation::new(op))
679 }
680 };
681
682 let start = move || async {
683 let op = self.send().await?;
684 Ok(Operation::new(op))
685 };
686
687 google_cloud_lro::internal::new_poller(
688 polling_error_policy,
689 polling_backoff_policy,
690 start,
691 query,
692 )
693 }
694
695 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
699 self.0.request.name = v.into();
700 self
701 }
702
703 pub fn set_approval_result<T>(mut self, v: T) -> Self
705 where
706 T: std::convert::Into<crate::model::ApprovalResult>,
707 {
708 self.0.request.approval_result = std::option::Option::Some(v.into());
709 self
710 }
711
712 pub fn set_or_clear_approval_result<T>(mut self, v: std::option::Option<T>) -> Self
714 where
715 T: std::convert::Into<crate::model::ApprovalResult>,
716 {
717 self.0.request.approval_result = v.map(|x| x.into());
718 self
719 }
720 }
721
722 #[doc(hidden)]
723 impl crate::RequestBuilder for ApproveBuild {
724 fn request_options(&mut self) -> &mut crate::RequestOptions {
725 &mut self.0.options
726 }
727 }
728
729 #[derive(Clone, Debug)]
746 pub struct CreateBuildTrigger(RequestBuilder<crate::model::CreateBuildTriggerRequest>);
747
748 impl CreateBuildTrigger {
749 pub(crate) fn new(
750 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
751 ) -> Self {
752 Self(RequestBuilder::new(stub))
753 }
754
755 pub fn with_request<V: Into<crate::model::CreateBuildTriggerRequest>>(
757 mut self,
758 v: V,
759 ) -> Self {
760 self.0.request = v.into();
761 self
762 }
763
764 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
766 self.0.options = v.into();
767 self
768 }
769
770 pub async fn send(self) -> Result<crate::model::BuildTrigger> {
772 (*self.0.stub)
773 .create_build_trigger(self.0.request, self.0.options)
774 .await
775 .map(crate::Response::into_body)
776 }
777
778 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
780 self.0.request.parent = v.into();
781 self
782 }
783
784 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
788 self.0.request.project_id = v.into();
789 self
790 }
791
792 pub fn set_trigger<T>(mut self, v: T) -> Self
796 where
797 T: std::convert::Into<crate::model::BuildTrigger>,
798 {
799 self.0.request.trigger = std::option::Option::Some(v.into());
800 self
801 }
802
803 pub fn set_or_clear_trigger<T>(mut self, v: std::option::Option<T>) -> Self
807 where
808 T: std::convert::Into<crate::model::BuildTrigger>,
809 {
810 self.0.request.trigger = v.map(|x| x.into());
811 self
812 }
813 }
814
815 #[doc(hidden)]
816 impl crate::RequestBuilder for CreateBuildTrigger {
817 fn request_options(&mut self) -> &mut crate::RequestOptions {
818 &mut self.0.options
819 }
820 }
821
822 #[derive(Clone, Debug)]
839 pub struct GetBuildTrigger(RequestBuilder<crate::model::GetBuildTriggerRequest>);
840
841 impl GetBuildTrigger {
842 pub(crate) fn new(
843 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
844 ) -> Self {
845 Self(RequestBuilder::new(stub))
846 }
847
848 pub fn with_request<V: Into<crate::model::GetBuildTriggerRequest>>(mut self, v: V) -> Self {
850 self.0.request = v.into();
851 self
852 }
853
854 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
856 self.0.options = v.into();
857 self
858 }
859
860 pub async fn send(self) -> Result<crate::model::BuildTrigger> {
862 (*self.0.stub)
863 .get_build_trigger(self.0.request, self.0.options)
864 .await
865 .map(crate::Response::into_body)
866 }
867
868 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
870 self.0.request.name = v.into();
871 self
872 }
873
874 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
878 self.0.request.project_id = v.into();
879 self
880 }
881
882 pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
886 self.0.request.trigger_id = v.into();
887 self
888 }
889 }
890
891 #[doc(hidden)]
892 impl crate::RequestBuilder for GetBuildTrigger {
893 fn request_options(&mut self) -> &mut crate::RequestOptions {
894 &mut self.0.options
895 }
896 }
897
898 #[derive(Clone, Debug)]
919 pub struct ListBuildTriggers(RequestBuilder<crate::model::ListBuildTriggersRequest>);
920
921 impl ListBuildTriggers {
922 pub(crate) fn new(
923 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
924 ) -> Self {
925 Self(RequestBuilder::new(stub))
926 }
927
928 pub fn with_request<V: Into<crate::model::ListBuildTriggersRequest>>(
930 mut self,
931 v: V,
932 ) -> Self {
933 self.0.request = v.into();
934 self
935 }
936
937 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
939 self.0.options = v.into();
940 self
941 }
942
943 pub async fn send(self) -> Result<crate::model::ListBuildTriggersResponse> {
945 (*self.0.stub)
946 .list_build_triggers(self.0.request, self.0.options)
947 .await
948 .map(crate::Response::into_body)
949 }
950
951 pub fn by_page(
953 self,
954 ) -> impl google_cloud_gax::paginator::Paginator<
955 crate::model::ListBuildTriggersResponse,
956 crate::Error,
957 > {
958 use std::clone::Clone;
959 let token = self.0.request.page_token.clone();
960 let execute = move |token: String| {
961 let mut builder = self.clone();
962 builder.0.request = builder.0.request.set_page_token(token);
963 builder.send()
964 };
965 google_cloud_gax::paginator::internal::new_paginator(token, execute)
966 }
967
968 pub fn by_item(
970 self,
971 ) -> impl google_cloud_gax::paginator::ItemPaginator<
972 crate::model::ListBuildTriggersResponse,
973 crate::Error,
974 > {
975 use google_cloud_gax::paginator::Paginator;
976 self.by_page().items()
977 }
978
979 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
981 self.0.request.parent = v.into();
982 self
983 }
984
985 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
989 self.0.request.project_id = v.into();
990 self
991 }
992
993 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
995 self.0.request.page_size = v.into();
996 self
997 }
998
999 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1001 self.0.request.page_token = v.into();
1002 self
1003 }
1004 }
1005
1006 #[doc(hidden)]
1007 impl crate::RequestBuilder for ListBuildTriggers {
1008 fn request_options(&mut self) -> &mut crate::RequestOptions {
1009 &mut self.0.options
1010 }
1011 }
1012
1013 #[derive(Clone, Debug)]
1030 pub struct DeleteBuildTrigger(RequestBuilder<crate::model::DeleteBuildTriggerRequest>);
1031
1032 impl DeleteBuildTrigger {
1033 pub(crate) fn new(
1034 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1035 ) -> Self {
1036 Self(RequestBuilder::new(stub))
1037 }
1038
1039 pub fn with_request<V: Into<crate::model::DeleteBuildTriggerRequest>>(
1041 mut self,
1042 v: V,
1043 ) -> Self {
1044 self.0.request = v.into();
1045 self
1046 }
1047
1048 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1050 self.0.options = v.into();
1051 self
1052 }
1053
1054 pub async fn send(self) -> Result<()> {
1056 (*self.0.stub)
1057 .delete_build_trigger(self.0.request, self.0.options)
1058 .await
1059 .map(crate::Response::into_body)
1060 }
1061
1062 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1064 self.0.request.name = v.into();
1065 self
1066 }
1067
1068 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1072 self.0.request.project_id = v.into();
1073 self
1074 }
1075
1076 pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1080 self.0.request.trigger_id = v.into();
1081 self
1082 }
1083 }
1084
1085 #[doc(hidden)]
1086 impl crate::RequestBuilder for DeleteBuildTrigger {
1087 fn request_options(&mut self) -> &mut crate::RequestOptions {
1088 &mut self.0.options
1089 }
1090 }
1091
1092 #[derive(Clone, Debug)]
1109 pub struct UpdateBuildTrigger(RequestBuilder<crate::model::UpdateBuildTriggerRequest>);
1110
1111 impl UpdateBuildTrigger {
1112 pub(crate) fn new(
1113 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1114 ) -> Self {
1115 Self(RequestBuilder::new(stub))
1116 }
1117
1118 pub fn with_request<V: Into<crate::model::UpdateBuildTriggerRequest>>(
1120 mut self,
1121 v: V,
1122 ) -> Self {
1123 self.0.request = v.into();
1124 self
1125 }
1126
1127 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1129 self.0.options = v.into();
1130 self
1131 }
1132
1133 pub async fn send(self) -> Result<crate::model::BuildTrigger> {
1135 (*self.0.stub)
1136 .update_build_trigger(self.0.request, self.0.options)
1137 .await
1138 .map(crate::Response::into_body)
1139 }
1140
1141 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1145 self.0.request.project_id = v.into();
1146 self
1147 }
1148
1149 pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1153 self.0.request.trigger_id = v.into();
1154 self
1155 }
1156
1157 pub fn set_trigger<T>(mut self, v: T) -> Self
1161 where
1162 T: std::convert::Into<crate::model::BuildTrigger>,
1163 {
1164 self.0.request.trigger = std::option::Option::Some(v.into());
1165 self
1166 }
1167
1168 pub fn set_or_clear_trigger<T>(mut self, v: std::option::Option<T>) -> Self
1172 where
1173 T: std::convert::Into<crate::model::BuildTrigger>,
1174 {
1175 self.0.request.trigger = v.map(|x| x.into());
1176 self
1177 }
1178
1179 pub fn set_update_mask<T>(mut self, v: T) -> Self
1181 where
1182 T: std::convert::Into<wkt::FieldMask>,
1183 {
1184 self.0.request.update_mask = std::option::Option::Some(v.into());
1185 self
1186 }
1187
1188 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1190 where
1191 T: std::convert::Into<wkt::FieldMask>,
1192 {
1193 self.0.request.update_mask = v.map(|x| x.into());
1194 self
1195 }
1196 }
1197
1198 #[doc(hidden)]
1199 impl crate::RequestBuilder for UpdateBuildTrigger {
1200 fn request_options(&mut self) -> &mut crate::RequestOptions {
1201 &mut self.0.options
1202 }
1203 }
1204
1205 #[derive(Clone, Debug)]
1223 pub struct RunBuildTrigger(RequestBuilder<crate::model::RunBuildTriggerRequest>);
1224
1225 impl RunBuildTrigger {
1226 pub(crate) fn new(
1227 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1228 ) -> Self {
1229 Self(RequestBuilder::new(stub))
1230 }
1231
1232 pub fn with_request<V: Into<crate::model::RunBuildTriggerRequest>>(mut self, v: V) -> Self {
1234 self.0.request = v.into();
1235 self
1236 }
1237
1238 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1240 self.0.options = v.into();
1241 self
1242 }
1243
1244 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1251 (*self.0.stub)
1252 .run_build_trigger(self.0.request, self.0.options)
1253 .await
1254 .map(crate::Response::into_body)
1255 }
1256
1257 pub fn poller(
1259 self,
1260 ) -> impl google_cloud_lro::Poller<crate::model::Build, crate::model::BuildOperationMetadata>
1261 {
1262 type Operation = google_cloud_lro::internal::Operation<
1263 crate::model::Build,
1264 crate::model::BuildOperationMetadata,
1265 >;
1266 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1267 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1268
1269 let stub = self.0.stub.clone();
1270 let mut options = self.0.options.clone();
1271 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1272 let query = move |name| {
1273 let stub = stub.clone();
1274 let options = options.clone();
1275 async {
1276 let op = GetOperation::new(stub)
1277 .set_name(name)
1278 .with_options(options)
1279 .send()
1280 .await?;
1281 Ok(Operation::new(op))
1282 }
1283 };
1284
1285 let start = move || async {
1286 let op = self.send().await?;
1287 Ok(Operation::new(op))
1288 };
1289
1290 google_cloud_lro::internal::new_poller(
1291 polling_error_policy,
1292 polling_backoff_policy,
1293 start,
1294 query,
1295 )
1296 }
1297
1298 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1300 self.0.request.name = v.into();
1301 self
1302 }
1303
1304 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1308 self.0.request.project_id = v.into();
1309 self
1310 }
1311
1312 pub fn set_trigger_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1316 self.0.request.trigger_id = v.into();
1317 self
1318 }
1319
1320 pub fn set_source<T>(mut self, v: T) -> Self
1322 where
1323 T: std::convert::Into<crate::model::RepoSource>,
1324 {
1325 self.0.request.source = std::option::Option::Some(v.into());
1326 self
1327 }
1328
1329 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
1331 where
1332 T: std::convert::Into<crate::model::RepoSource>,
1333 {
1334 self.0.request.source = v.map(|x| x.into());
1335 self
1336 }
1337 }
1338
1339 #[doc(hidden)]
1340 impl crate::RequestBuilder for RunBuildTrigger {
1341 fn request_options(&mut self) -> &mut crate::RequestOptions {
1342 &mut self.0.options
1343 }
1344 }
1345
1346 #[derive(Clone, Debug)]
1363 pub struct ReceiveTriggerWebhook(RequestBuilder<crate::model::ReceiveTriggerWebhookRequest>);
1364
1365 impl ReceiveTriggerWebhook {
1366 pub(crate) fn new(
1367 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1368 ) -> Self {
1369 Self(RequestBuilder::new(stub))
1370 }
1371
1372 pub fn with_request<V: Into<crate::model::ReceiveTriggerWebhookRequest>>(
1374 mut self,
1375 v: V,
1376 ) -> Self {
1377 self.0.request = v.into();
1378 self
1379 }
1380
1381 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1383 self.0.options = v.into();
1384 self
1385 }
1386
1387 pub async fn send(self) -> Result<crate::model::ReceiveTriggerWebhookResponse> {
1389 (*self.0.stub)
1390 .receive_trigger_webhook(self.0.request, self.0.options)
1391 .await
1392 .map(crate::Response::into_body)
1393 }
1394
1395 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1397 self.0.request.name = v.into();
1398 self
1399 }
1400
1401 pub fn set_body<T>(mut self, v: T) -> Self
1403 where
1404 T: std::convert::Into<google_cloud_api::model::HttpBody>,
1405 {
1406 self.0.request.body = std::option::Option::Some(v.into());
1407 self
1408 }
1409
1410 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1412 where
1413 T: std::convert::Into<google_cloud_api::model::HttpBody>,
1414 {
1415 self.0.request.body = v.map(|x| x.into());
1416 self
1417 }
1418
1419 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1421 self.0.request.project_id = v.into();
1422 self
1423 }
1424
1425 pub fn set_trigger<T: Into<std::string::String>>(mut self, v: T) -> Self {
1427 self.0.request.trigger = v.into();
1428 self
1429 }
1430
1431 pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
1433 self.0.request.secret = v.into();
1434 self
1435 }
1436 }
1437
1438 #[doc(hidden)]
1439 impl crate::RequestBuilder for ReceiveTriggerWebhook {
1440 fn request_options(&mut self) -> &mut crate::RequestOptions {
1441 &mut self.0.options
1442 }
1443 }
1444
1445 #[derive(Clone, Debug)]
1463 pub struct CreateWorkerPool(RequestBuilder<crate::model::CreateWorkerPoolRequest>);
1464
1465 impl CreateWorkerPool {
1466 pub(crate) fn new(
1467 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1468 ) -> Self {
1469 Self(RequestBuilder::new(stub))
1470 }
1471
1472 pub fn with_request<V: Into<crate::model::CreateWorkerPoolRequest>>(
1474 mut self,
1475 v: V,
1476 ) -> Self {
1477 self.0.request = v.into();
1478 self
1479 }
1480
1481 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1483 self.0.options = v.into();
1484 self
1485 }
1486
1487 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1494 (*self.0.stub)
1495 .create_worker_pool(self.0.request, self.0.options)
1496 .await
1497 .map(crate::Response::into_body)
1498 }
1499
1500 pub fn poller(
1502 self,
1503 ) -> impl google_cloud_lro::Poller<
1504 crate::model::WorkerPool,
1505 crate::model::CreateWorkerPoolOperationMetadata,
1506 > {
1507 type Operation = google_cloud_lro::internal::Operation<
1508 crate::model::WorkerPool,
1509 crate::model::CreateWorkerPoolOperationMetadata,
1510 >;
1511 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1512 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1513
1514 let stub = self.0.stub.clone();
1515 let mut options = self.0.options.clone();
1516 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1517 let query = move |name| {
1518 let stub = stub.clone();
1519 let options = options.clone();
1520 async {
1521 let op = GetOperation::new(stub)
1522 .set_name(name)
1523 .with_options(options)
1524 .send()
1525 .await?;
1526 Ok(Operation::new(op))
1527 }
1528 };
1529
1530 let start = move || async {
1531 let op = self.send().await?;
1532 Ok(Operation::new(op))
1533 };
1534
1535 google_cloud_lro::internal::new_poller(
1536 polling_error_policy,
1537 polling_backoff_policy,
1538 start,
1539 query,
1540 )
1541 }
1542
1543 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1547 self.0.request.parent = v.into();
1548 self
1549 }
1550
1551 pub fn set_worker_pool<T>(mut self, v: T) -> Self
1555 where
1556 T: std::convert::Into<crate::model::WorkerPool>,
1557 {
1558 self.0.request.worker_pool = std::option::Option::Some(v.into());
1559 self
1560 }
1561
1562 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
1566 where
1567 T: std::convert::Into<crate::model::WorkerPool>,
1568 {
1569 self.0.request.worker_pool = v.map(|x| x.into());
1570 self
1571 }
1572
1573 pub fn set_worker_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1577 self.0.request.worker_pool_id = v.into();
1578 self
1579 }
1580
1581 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1583 self.0.request.validate_only = v.into();
1584 self
1585 }
1586 }
1587
1588 #[doc(hidden)]
1589 impl crate::RequestBuilder for CreateWorkerPool {
1590 fn request_options(&mut self) -> &mut crate::RequestOptions {
1591 &mut self.0.options
1592 }
1593 }
1594
1595 #[derive(Clone, Debug)]
1612 pub struct GetWorkerPool(RequestBuilder<crate::model::GetWorkerPoolRequest>);
1613
1614 impl GetWorkerPool {
1615 pub(crate) fn new(
1616 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1617 ) -> Self {
1618 Self(RequestBuilder::new(stub))
1619 }
1620
1621 pub fn with_request<V: Into<crate::model::GetWorkerPoolRequest>>(mut self, v: V) -> Self {
1623 self.0.request = v.into();
1624 self
1625 }
1626
1627 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1629 self.0.options = v.into();
1630 self
1631 }
1632
1633 pub async fn send(self) -> Result<crate::model::WorkerPool> {
1635 (*self.0.stub)
1636 .get_worker_pool(self.0.request, self.0.options)
1637 .await
1638 .map(crate::Response::into_body)
1639 }
1640
1641 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1645 self.0.request.name = v.into();
1646 self
1647 }
1648 }
1649
1650 #[doc(hidden)]
1651 impl crate::RequestBuilder for GetWorkerPool {
1652 fn request_options(&mut self) -> &mut crate::RequestOptions {
1653 &mut self.0.options
1654 }
1655 }
1656
1657 #[derive(Clone, Debug)]
1675 pub struct DeleteWorkerPool(RequestBuilder<crate::model::DeleteWorkerPoolRequest>);
1676
1677 impl DeleteWorkerPool {
1678 pub(crate) fn new(
1679 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1680 ) -> Self {
1681 Self(RequestBuilder::new(stub))
1682 }
1683
1684 pub fn with_request<V: Into<crate::model::DeleteWorkerPoolRequest>>(
1686 mut self,
1687 v: V,
1688 ) -> Self {
1689 self.0.request = v.into();
1690 self
1691 }
1692
1693 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1695 self.0.options = v.into();
1696 self
1697 }
1698
1699 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1706 (*self.0.stub)
1707 .delete_worker_pool(self.0.request, self.0.options)
1708 .await
1709 .map(crate::Response::into_body)
1710 }
1711
1712 pub fn poller(
1714 self,
1715 ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteWorkerPoolOperationMetadata>
1716 {
1717 type Operation = google_cloud_lro::internal::Operation<
1718 wkt::Empty,
1719 crate::model::DeleteWorkerPoolOperationMetadata,
1720 >;
1721 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1722 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1723
1724 let stub = self.0.stub.clone();
1725 let mut options = self.0.options.clone();
1726 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1727 let query = move |name| {
1728 let stub = stub.clone();
1729 let options = options.clone();
1730 async {
1731 let op = GetOperation::new(stub)
1732 .set_name(name)
1733 .with_options(options)
1734 .send()
1735 .await?;
1736 Ok(Operation::new(op))
1737 }
1738 };
1739
1740 let start = move || async {
1741 let op = self.send().await?;
1742 Ok(Operation::new(op))
1743 };
1744
1745 google_cloud_lro::internal::new_unit_response_poller(
1746 polling_error_policy,
1747 polling_backoff_policy,
1748 start,
1749 query,
1750 )
1751 }
1752
1753 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1757 self.0.request.name = v.into();
1758 self
1759 }
1760
1761 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1763 self.0.request.etag = v.into();
1764 self
1765 }
1766
1767 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1769 self.0.request.allow_missing = v.into();
1770 self
1771 }
1772
1773 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1775 self.0.request.validate_only = v.into();
1776 self
1777 }
1778 }
1779
1780 #[doc(hidden)]
1781 impl crate::RequestBuilder for DeleteWorkerPool {
1782 fn request_options(&mut self) -> &mut crate::RequestOptions {
1783 &mut self.0.options
1784 }
1785 }
1786
1787 #[derive(Clone, Debug)]
1805 pub struct UpdateWorkerPool(RequestBuilder<crate::model::UpdateWorkerPoolRequest>);
1806
1807 impl UpdateWorkerPool {
1808 pub(crate) fn new(
1809 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1810 ) -> Self {
1811 Self(RequestBuilder::new(stub))
1812 }
1813
1814 pub fn with_request<V: Into<crate::model::UpdateWorkerPoolRequest>>(
1816 mut self,
1817 v: V,
1818 ) -> Self {
1819 self.0.request = v.into();
1820 self
1821 }
1822
1823 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1825 self.0.options = v.into();
1826 self
1827 }
1828
1829 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1836 (*self.0.stub)
1837 .update_worker_pool(self.0.request, self.0.options)
1838 .await
1839 .map(crate::Response::into_body)
1840 }
1841
1842 pub fn poller(
1844 self,
1845 ) -> impl google_cloud_lro::Poller<
1846 crate::model::WorkerPool,
1847 crate::model::UpdateWorkerPoolOperationMetadata,
1848 > {
1849 type Operation = google_cloud_lro::internal::Operation<
1850 crate::model::WorkerPool,
1851 crate::model::UpdateWorkerPoolOperationMetadata,
1852 >;
1853 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1854 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1855
1856 let stub = self.0.stub.clone();
1857 let mut options = self.0.options.clone();
1858 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1859 let query = move |name| {
1860 let stub = stub.clone();
1861 let options = options.clone();
1862 async {
1863 let op = GetOperation::new(stub)
1864 .set_name(name)
1865 .with_options(options)
1866 .send()
1867 .await?;
1868 Ok(Operation::new(op))
1869 }
1870 };
1871
1872 let start = move || async {
1873 let op = self.send().await?;
1874 Ok(Operation::new(op))
1875 };
1876
1877 google_cloud_lro::internal::new_poller(
1878 polling_error_policy,
1879 polling_backoff_policy,
1880 start,
1881 query,
1882 )
1883 }
1884
1885 pub fn set_worker_pool<T>(mut self, v: T) -> Self
1889 where
1890 T: std::convert::Into<crate::model::WorkerPool>,
1891 {
1892 self.0.request.worker_pool = std::option::Option::Some(v.into());
1893 self
1894 }
1895
1896 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
1900 where
1901 T: std::convert::Into<crate::model::WorkerPool>,
1902 {
1903 self.0.request.worker_pool = v.map(|x| x.into());
1904 self
1905 }
1906
1907 pub fn set_update_mask<T>(mut self, v: T) -> Self
1909 where
1910 T: std::convert::Into<wkt::FieldMask>,
1911 {
1912 self.0.request.update_mask = std::option::Option::Some(v.into());
1913 self
1914 }
1915
1916 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1918 where
1919 T: std::convert::Into<wkt::FieldMask>,
1920 {
1921 self.0.request.update_mask = v.map(|x| x.into());
1922 self
1923 }
1924
1925 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1927 self.0.request.validate_only = v.into();
1928 self
1929 }
1930 }
1931
1932 #[doc(hidden)]
1933 impl crate::RequestBuilder for UpdateWorkerPool {
1934 fn request_options(&mut self) -> &mut crate::RequestOptions {
1935 &mut self.0.options
1936 }
1937 }
1938
1939 #[derive(Clone, Debug)]
1960 pub struct ListWorkerPools(RequestBuilder<crate::model::ListWorkerPoolsRequest>);
1961
1962 impl ListWorkerPools {
1963 pub(crate) fn new(
1964 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
1965 ) -> Self {
1966 Self(RequestBuilder::new(stub))
1967 }
1968
1969 pub fn with_request<V: Into<crate::model::ListWorkerPoolsRequest>>(mut self, v: V) -> Self {
1971 self.0.request = v.into();
1972 self
1973 }
1974
1975 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1977 self.0.options = v.into();
1978 self
1979 }
1980
1981 pub async fn send(self) -> Result<crate::model::ListWorkerPoolsResponse> {
1983 (*self.0.stub)
1984 .list_worker_pools(self.0.request, self.0.options)
1985 .await
1986 .map(crate::Response::into_body)
1987 }
1988
1989 pub fn by_page(
1991 self,
1992 ) -> impl google_cloud_gax::paginator::Paginator<
1993 crate::model::ListWorkerPoolsResponse,
1994 crate::Error,
1995 > {
1996 use std::clone::Clone;
1997 let token = self.0.request.page_token.clone();
1998 let execute = move |token: String| {
1999 let mut builder = self.clone();
2000 builder.0.request = builder.0.request.set_page_token(token);
2001 builder.send()
2002 };
2003 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2004 }
2005
2006 pub fn by_item(
2008 self,
2009 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2010 crate::model::ListWorkerPoolsResponse,
2011 crate::Error,
2012 > {
2013 use google_cloud_gax::paginator::Paginator;
2014 self.by_page().items()
2015 }
2016
2017 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2021 self.0.request.parent = v.into();
2022 self
2023 }
2024
2025 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2027 self.0.request.page_size = v.into();
2028 self
2029 }
2030
2031 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2033 self.0.request.page_token = v.into();
2034 self
2035 }
2036 }
2037
2038 #[doc(hidden)]
2039 impl crate::RequestBuilder for ListWorkerPools {
2040 fn request_options(&mut self) -> &mut crate::RequestOptions {
2041 &mut self.0.options
2042 }
2043 }
2044
2045 #[derive(Clone, Debug)]
2062 pub struct GetDefaultServiceAccount(
2063 RequestBuilder<crate::model::GetDefaultServiceAccountRequest>,
2064 );
2065
2066 impl GetDefaultServiceAccount {
2067 pub(crate) fn new(
2068 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
2069 ) -> Self {
2070 Self(RequestBuilder::new(stub))
2071 }
2072
2073 pub fn with_request<V: Into<crate::model::GetDefaultServiceAccountRequest>>(
2075 mut self,
2076 v: V,
2077 ) -> Self {
2078 self.0.request = v.into();
2079 self
2080 }
2081
2082 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2084 self.0.options = v.into();
2085 self
2086 }
2087
2088 pub async fn send(self) -> Result<crate::model::DefaultServiceAccount> {
2090 (*self.0.stub)
2091 .get_default_service_account(self.0.request, self.0.options)
2092 .await
2093 .map(crate::Response::into_body)
2094 }
2095
2096 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2100 self.0.request.name = v.into();
2101 self
2102 }
2103 }
2104
2105 #[doc(hidden)]
2106 impl crate::RequestBuilder for GetDefaultServiceAccount {
2107 fn request_options(&mut self) -> &mut crate::RequestOptions {
2108 &mut self.0.options
2109 }
2110 }
2111
2112 #[derive(Clone, Debug)]
2129 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2130
2131 impl GetOperation {
2132 pub(crate) fn new(
2133 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
2134 ) -> Self {
2135 Self(RequestBuilder::new(stub))
2136 }
2137
2138 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2140 mut self,
2141 v: V,
2142 ) -> Self {
2143 self.0.request = v.into();
2144 self
2145 }
2146
2147 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2149 self.0.options = v.into();
2150 self
2151 }
2152
2153 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2155 (*self.0.stub)
2156 .get_operation(self.0.request, self.0.options)
2157 .await
2158 .map(crate::Response::into_body)
2159 }
2160
2161 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2163 self.0.request.name = v.into();
2164 self
2165 }
2166 }
2167
2168 #[doc(hidden)]
2169 impl crate::RequestBuilder for GetOperation {
2170 fn request_options(&mut self) -> &mut crate::RequestOptions {
2171 &mut self.0.options
2172 }
2173 }
2174
2175 #[derive(Clone, Debug)]
2192 pub struct CancelOperation(
2193 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2194 );
2195
2196 impl CancelOperation {
2197 pub(crate) fn new(
2198 stub: std::sync::Arc<dyn super::super::stub::dynamic::CloudBuild>,
2199 ) -> Self {
2200 Self(RequestBuilder::new(stub))
2201 }
2202
2203 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2205 mut self,
2206 v: V,
2207 ) -> Self {
2208 self.0.request = v.into();
2209 self
2210 }
2211
2212 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2214 self.0.options = v.into();
2215 self
2216 }
2217
2218 pub async fn send(self) -> Result<()> {
2220 (*self.0.stub)
2221 .cancel_operation(self.0.request, self.0.options)
2222 .await
2223 .map(crate::Response::into_body)
2224 }
2225
2226 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2228 self.0.request.name = v.into();
2229 self
2230 }
2231 }
2232
2233 #[doc(hidden)]
2234 impl crate::RequestBuilder for CancelOperation {
2235 fn request_options(&mut self) -> &mut crate::RequestOptions {
2236 &mut self.0.options
2237 }
2238 }
2239}