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