google_cloud_workflows_v1/
builder.rs1pub mod workflows {
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::Workflows;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = Workflows;
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::Workflows>,
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::Workflows>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct ListWorkflows(RequestBuilder<crate::model::ListWorkflowsRequest>);
96
97 impl ListWorkflows {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListWorkflowsRequest>>(mut self, v: V) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<crate::model::ListWorkflowsResponse> {
118 (*self.0.stub)
119 .list_workflows(self.0.request, self.0.options)
120 .await
121 .map(crate::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListWorkflowsResponse, crate::Error>
128 {
129 use std::clone::Clone;
130 let token = self.0.request.page_token.clone();
131 let execute = move |token: String| {
132 let mut builder = self.clone();
133 builder.0.request = builder.0.request.set_page_token(token);
134 builder.send()
135 };
136 google_cloud_gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl google_cloud_gax::paginator::ItemPaginator<
143 crate::model::ListWorkflowsResponse,
144 crate::Error,
145 > {
146 use google_cloud_gax::paginator::Paginator;
147 self.by_page().items()
148 }
149
150 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
154 self.0.request.parent = v.into();
155 self
156 }
157
158 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
160 self.0.request.page_size = v.into();
161 self
162 }
163
164 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
166 self.0.request.page_token = v.into();
167 self
168 }
169
170 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
172 self.0.request.filter = v.into();
173 self
174 }
175
176 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
178 self.0.request.order_by = v.into();
179 self
180 }
181 }
182
183 #[doc(hidden)]
184 impl crate::RequestBuilder for ListWorkflows {
185 fn request_options(&mut self) -> &mut crate::RequestOptions {
186 &mut self.0.options
187 }
188 }
189
190 #[derive(Clone, Debug)]
207 pub struct GetWorkflow(RequestBuilder<crate::model::GetWorkflowRequest>);
208
209 impl GetWorkflow {
210 pub(crate) fn new(
211 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
212 ) -> Self {
213 Self(RequestBuilder::new(stub))
214 }
215
216 pub fn with_request<V: Into<crate::model::GetWorkflowRequest>>(mut self, v: V) -> Self {
218 self.0.request = v.into();
219 self
220 }
221
222 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
224 self.0.options = v.into();
225 self
226 }
227
228 pub async fn send(self) -> Result<crate::model::Workflow> {
230 (*self.0.stub)
231 .get_workflow(self.0.request, self.0.options)
232 .await
233 .map(crate::Response::into_body)
234 }
235
236 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
240 self.0.request.name = v.into();
241 self
242 }
243
244 pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
246 self.0.request.revision_id = v.into();
247 self
248 }
249 }
250
251 #[doc(hidden)]
252 impl crate::RequestBuilder for GetWorkflow {
253 fn request_options(&mut self) -> &mut crate::RequestOptions {
254 &mut self.0.options
255 }
256 }
257
258 #[derive(Clone, Debug)]
276 pub struct CreateWorkflow(RequestBuilder<crate::model::CreateWorkflowRequest>);
277
278 impl CreateWorkflow {
279 pub(crate) fn new(
280 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
281 ) -> Self {
282 Self(RequestBuilder::new(stub))
283 }
284
285 pub fn with_request<V: Into<crate::model::CreateWorkflowRequest>>(mut self, v: V) -> Self {
287 self.0.request = v.into();
288 self
289 }
290
291 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
293 self.0.options = v.into();
294 self
295 }
296
297 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
304 (*self.0.stub)
305 .create_workflow(self.0.request, self.0.options)
306 .await
307 .map(crate::Response::into_body)
308 }
309
310 pub fn poller(
312 self,
313 ) -> impl google_cloud_lro::Poller<crate::model::Workflow, crate::model::OperationMetadata>
314 {
315 type Operation = google_cloud_lro::internal::Operation<
316 crate::model::Workflow,
317 crate::model::OperationMetadata,
318 >;
319 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
320 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
321 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
322 if let Some(ref mut details) = poller_options.tracing {
323 details.method_name =
324 "google_cloud_workflows_v1::client::Workflows::create_workflow::until_done";
325 }
326
327 let stub = self.0.stub.clone();
328 let mut options = self.0.options.clone();
329 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
330 let query = move |name| {
331 let stub = stub.clone();
332 let options = options.clone();
333 async {
334 let op = GetOperation::new(stub)
335 .set_name(name)
336 .with_options(options)
337 .send()
338 .await?;
339 Ok(Operation::new(op))
340 }
341 };
342
343 let start = move || async {
344 let op = self.send().await?;
345 Ok(Operation::new(op))
346 };
347
348 use google_cloud_lro::internal::PollerExt;
349 {
350 google_cloud_lro::internal::new_poller(
351 polling_error_policy,
352 polling_backoff_policy,
353 start,
354 query,
355 )
356 }
357 .with_options(poller_options)
358 }
359
360 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_workflow<T>(mut self, v: T) -> Self
372 where
373 T: std::convert::Into<crate::model::Workflow>,
374 {
375 self.0.request.workflow = std::option::Option::Some(v.into());
376 self
377 }
378
379 pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
383 where
384 T: std::convert::Into<crate::model::Workflow>,
385 {
386 self.0.request.workflow = v.map(|x| x.into());
387 self
388 }
389
390 pub fn set_workflow_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
394 self.0.request.workflow_id = v.into();
395 self
396 }
397 }
398
399 #[doc(hidden)]
400 impl crate::RequestBuilder for CreateWorkflow {
401 fn request_options(&mut self) -> &mut crate::RequestOptions {
402 &mut self.0.options
403 }
404 }
405
406 #[derive(Clone, Debug)]
424 pub struct DeleteWorkflow(RequestBuilder<crate::model::DeleteWorkflowRequest>);
425
426 impl DeleteWorkflow {
427 pub(crate) fn new(
428 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
429 ) -> Self {
430 Self(RequestBuilder::new(stub))
431 }
432
433 pub fn with_request<V: Into<crate::model::DeleteWorkflowRequest>>(mut self, v: V) -> Self {
435 self.0.request = v.into();
436 self
437 }
438
439 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
441 self.0.options = v.into();
442 self
443 }
444
445 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
452 (*self.0.stub)
453 .delete_workflow(self.0.request, self.0.options)
454 .await
455 .map(crate::Response::into_body)
456 }
457
458 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
460 type Operation =
461 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
462 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
463 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
464 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
465 if let Some(ref mut details) = poller_options.tracing {
466 details.method_name =
467 "google_cloud_workflows_v1::client::Workflows::delete_workflow::until_done";
468 }
469
470 let stub = self.0.stub.clone();
471 let mut options = self.0.options.clone();
472 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
473 let query = move |name| {
474 let stub = stub.clone();
475 let options = options.clone();
476 async {
477 let op = GetOperation::new(stub)
478 .set_name(name)
479 .with_options(options)
480 .send()
481 .await?;
482 Ok(Operation::new(op))
483 }
484 };
485
486 let start = move || async {
487 let op = self.send().await?;
488 Ok(Operation::new(op))
489 };
490
491 use google_cloud_lro::internal::PollerExt;
492 {
493 google_cloud_lro::internal::new_unit_response_poller(
494 polling_error_policy,
495 polling_backoff_policy,
496 start,
497 query,
498 )
499 }
500 .with_options(poller_options)
501 }
502
503 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
507 self.0.request.name = v.into();
508 self
509 }
510 }
511
512 #[doc(hidden)]
513 impl crate::RequestBuilder for DeleteWorkflow {
514 fn request_options(&mut self) -> &mut crate::RequestOptions {
515 &mut self.0.options
516 }
517 }
518
519 #[derive(Clone, Debug)]
537 pub struct UpdateWorkflow(RequestBuilder<crate::model::UpdateWorkflowRequest>);
538
539 impl UpdateWorkflow {
540 pub(crate) fn new(
541 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
542 ) -> Self {
543 Self(RequestBuilder::new(stub))
544 }
545
546 pub fn with_request<V: Into<crate::model::UpdateWorkflowRequest>>(mut self, v: V) -> Self {
548 self.0.request = v.into();
549 self
550 }
551
552 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
554 self.0.options = v.into();
555 self
556 }
557
558 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
565 (*self.0.stub)
566 .update_workflow(self.0.request, self.0.options)
567 .await
568 .map(crate::Response::into_body)
569 }
570
571 pub fn poller(
573 self,
574 ) -> impl google_cloud_lro::Poller<crate::model::Workflow, crate::model::OperationMetadata>
575 {
576 type Operation = google_cloud_lro::internal::Operation<
577 crate::model::Workflow,
578 crate::model::OperationMetadata,
579 >;
580 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
581 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
582 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
583 if let Some(ref mut details) = poller_options.tracing {
584 details.method_name =
585 "google_cloud_workflows_v1::client::Workflows::update_workflow::until_done";
586 }
587
588 let stub = self.0.stub.clone();
589 let mut options = self.0.options.clone();
590 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
591 let query = move |name| {
592 let stub = stub.clone();
593 let options = options.clone();
594 async {
595 let op = GetOperation::new(stub)
596 .set_name(name)
597 .with_options(options)
598 .send()
599 .await?;
600 Ok(Operation::new(op))
601 }
602 };
603
604 let start = move || async {
605 let op = self.send().await?;
606 Ok(Operation::new(op))
607 };
608
609 use google_cloud_lro::internal::PollerExt;
610 {
611 google_cloud_lro::internal::new_poller(
612 polling_error_policy,
613 polling_backoff_policy,
614 start,
615 query,
616 )
617 }
618 .with_options(poller_options)
619 }
620
621 pub fn set_workflow<T>(mut self, v: T) -> Self
625 where
626 T: std::convert::Into<crate::model::Workflow>,
627 {
628 self.0.request.workflow = std::option::Option::Some(v.into());
629 self
630 }
631
632 pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
636 where
637 T: std::convert::Into<crate::model::Workflow>,
638 {
639 self.0.request.workflow = v.map(|x| x.into());
640 self
641 }
642
643 pub fn set_update_mask<T>(mut self, v: T) -> Self
645 where
646 T: std::convert::Into<wkt::FieldMask>,
647 {
648 self.0.request.update_mask = std::option::Option::Some(v.into());
649 self
650 }
651
652 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
654 where
655 T: std::convert::Into<wkt::FieldMask>,
656 {
657 self.0.request.update_mask = v.map(|x| x.into());
658 self
659 }
660 }
661
662 #[doc(hidden)]
663 impl crate::RequestBuilder for UpdateWorkflow {
664 fn request_options(&mut self) -> &mut crate::RequestOptions {
665 &mut self.0.options
666 }
667 }
668
669 #[derive(Clone, Debug)]
690 pub struct ListWorkflowRevisions(RequestBuilder<crate::model::ListWorkflowRevisionsRequest>);
691
692 impl ListWorkflowRevisions {
693 pub(crate) fn new(
694 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
695 ) -> Self {
696 Self(RequestBuilder::new(stub))
697 }
698
699 pub fn with_request<V: Into<crate::model::ListWorkflowRevisionsRequest>>(
701 mut self,
702 v: V,
703 ) -> Self {
704 self.0.request = v.into();
705 self
706 }
707
708 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
710 self.0.options = v.into();
711 self
712 }
713
714 pub async fn send(self) -> Result<crate::model::ListWorkflowRevisionsResponse> {
716 (*self.0.stub)
717 .list_workflow_revisions(self.0.request, self.0.options)
718 .await
719 .map(crate::Response::into_body)
720 }
721
722 pub fn by_page(
724 self,
725 ) -> impl google_cloud_gax::paginator::Paginator<
726 crate::model::ListWorkflowRevisionsResponse,
727 crate::Error,
728 > {
729 use std::clone::Clone;
730 let token = self.0.request.page_token.clone();
731 let execute = move |token: String| {
732 let mut builder = self.clone();
733 builder.0.request = builder.0.request.set_page_token(token);
734 builder.send()
735 };
736 google_cloud_gax::paginator::internal::new_paginator(token, execute)
737 }
738
739 pub fn by_item(
741 self,
742 ) -> impl google_cloud_gax::paginator::ItemPaginator<
743 crate::model::ListWorkflowRevisionsResponse,
744 crate::Error,
745 > {
746 use google_cloud_gax::paginator::Paginator;
747 self.by_page().items()
748 }
749
750 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
754 self.0.request.name = v.into();
755 self
756 }
757
758 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
760 self.0.request.page_size = v.into();
761 self
762 }
763
764 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
766 self.0.request.page_token = v.into();
767 self
768 }
769 }
770
771 #[doc(hidden)]
772 impl crate::RequestBuilder for ListWorkflowRevisions {
773 fn request_options(&mut self) -> &mut crate::RequestOptions {
774 &mut self.0.options
775 }
776 }
777
778 #[derive(Clone, Debug)]
799 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
800
801 impl ListLocations {
802 pub(crate) fn new(
803 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
804 ) -> Self {
805 Self(RequestBuilder::new(stub))
806 }
807
808 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
810 mut self,
811 v: V,
812 ) -> Self {
813 self.0.request = v.into();
814 self
815 }
816
817 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
819 self.0.options = v.into();
820 self
821 }
822
823 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
825 (*self.0.stub)
826 .list_locations(self.0.request, self.0.options)
827 .await
828 .map(crate::Response::into_body)
829 }
830
831 pub fn by_page(
833 self,
834 ) -> impl google_cloud_gax::paginator::Paginator<
835 google_cloud_location::model::ListLocationsResponse,
836 crate::Error,
837 > {
838 use std::clone::Clone;
839 let token = self.0.request.page_token.clone();
840 let execute = move |token: String| {
841 let mut builder = self.clone();
842 builder.0.request = builder.0.request.set_page_token(token);
843 builder.send()
844 };
845 google_cloud_gax::paginator::internal::new_paginator(token, execute)
846 }
847
848 pub fn by_item(
850 self,
851 ) -> impl google_cloud_gax::paginator::ItemPaginator<
852 google_cloud_location::model::ListLocationsResponse,
853 crate::Error,
854 > {
855 use google_cloud_gax::paginator::Paginator;
856 self.by_page().items()
857 }
858
859 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
861 self.0.request.name = v.into();
862 self
863 }
864
865 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
867 self.0.request.filter = v.into();
868 self
869 }
870
871 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
873 self.0.request.page_size = v.into();
874 self
875 }
876
877 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
879 self.0.request.page_token = v.into();
880 self
881 }
882 }
883
884 #[doc(hidden)]
885 impl crate::RequestBuilder for ListLocations {
886 fn request_options(&mut self) -> &mut crate::RequestOptions {
887 &mut self.0.options
888 }
889 }
890
891 #[derive(Clone, Debug)]
908 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
909
910 impl GetLocation {
911 pub(crate) fn new(
912 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
913 ) -> Self {
914 Self(RequestBuilder::new(stub))
915 }
916
917 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
919 mut self,
920 v: V,
921 ) -> Self {
922 self.0.request = v.into();
923 self
924 }
925
926 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
928 self.0.options = v.into();
929 self
930 }
931
932 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
934 (*self.0.stub)
935 .get_location(self.0.request, self.0.options)
936 .await
937 .map(crate::Response::into_body)
938 }
939
940 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
942 self.0.request.name = v.into();
943 self
944 }
945 }
946
947 #[doc(hidden)]
948 impl crate::RequestBuilder for GetLocation {
949 fn request_options(&mut self) -> &mut crate::RequestOptions {
950 &mut self.0.options
951 }
952 }
953
954 #[derive(Clone, Debug)]
975 pub struct ListOperations(
976 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
977 );
978
979 impl ListOperations {
980 pub(crate) fn new(
981 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
982 ) -> Self {
983 Self(RequestBuilder::new(stub))
984 }
985
986 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
988 mut self,
989 v: V,
990 ) -> Self {
991 self.0.request = v.into();
992 self
993 }
994
995 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
997 self.0.options = v.into();
998 self
999 }
1000
1001 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1003 (*self.0.stub)
1004 .list_operations(self.0.request, self.0.options)
1005 .await
1006 .map(crate::Response::into_body)
1007 }
1008
1009 pub fn by_page(
1011 self,
1012 ) -> impl google_cloud_gax::paginator::Paginator<
1013 google_cloud_longrunning::model::ListOperationsResponse,
1014 crate::Error,
1015 > {
1016 use std::clone::Clone;
1017 let token = self.0.request.page_token.clone();
1018 let execute = move |token: String| {
1019 let mut builder = self.clone();
1020 builder.0.request = builder.0.request.set_page_token(token);
1021 builder.send()
1022 };
1023 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1024 }
1025
1026 pub fn by_item(
1028 self,
1029 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1030 google_cloud_longrunning::model::ListOperationsResponse,
1031 crate::Error,
1032 > {
1033 use google_cloud_gax::paginator::Paginator;
1034 self.by_page().items()
1035 }
1036
1037 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1039 self.0.request.name = v.into();
1040 self
1041 }
1042
1043 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1045 self.0.request.filter = v.into();
1046 self
1047 }
1048
1049 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1051 self.0.request.page_size = v.into();
1052 self
1053 }
1054
1055 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1057 self.0.request.page_token = v.into();
1058 self
1059 }
1060
1061 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1063 self.0.request.return_partial_success = v.into();
1064 self
1065 }
1066 }
1067
1068 #[doc(hidden)]
1069 impl crate::RequestBuilder for ListOperations {
1070 fn request_options(&mut self) -> &mut crate::RequestOptions {
1071 &mut self.0.options
1072 }
1073 }
1074
1075 #[derive(Clone, Debug)]
1092 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1093
1094 impl GetOperation {
1095 pub(crate) fn new(
1096 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
1097 ) -> Self {
1098 Self(RequestBuilder::new(stub))
1099 }
1100
1101 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1103 mut self,
1104 v: V,
1105 ) -> Self {
1106 self.0.request = v.into();
1107 self
1108 }
1109
1110 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1112 self.0.options = v.into();
1113 self
1114 }
1115
1116 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1118 (*self.0.stub)
1119 .get_operation(self.0.request, self.0.options)
1120 .await
1121 .map(crate::Response::into_body)
1122 }
1123
1124 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1126 self.0.request.name = v.into();
1127 self
1128 }
1129 }
1130
1131 #[doc(hidden)]
1132 impl crate::RequestBuilder for GetOperation {
1133 fn request_options(&mut self) -> &mut crate::RequestOptions {
1134 &mut self.0.options
1135 }
1136 }
1137
1138 #[derive(Clone, Debug)]
1155 pub struct DeleteOperation(
1156 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1157 );
1158
1159 impl DeleteOperation {
1160 pub(crate) fn new(
1161 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
1162 ) -> Self {
1163 Self(RequestBuilder::new(stub))
1164 }
1165
1166 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1168 mut self,
1169 v: V,
1170 ) -> Self {
1171 self.0.request = v.into();
1172 self
1173 }
1174
1175 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1177 self.0.options = v.into();
1178 self
1179 }
1180
1181 pub async fn send(self) -> Result<()> {
1183 (*self.0.stub)
1184 .delete_operation(self.0.request, self.0.options)
1185 .await
1186 .map(crate::Response::into_body)
1187 }
1188
1189 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1191 self.0.request.name = v.into();
1192 self
1193 }
1194 }
1195
1196 #[doc(hidden)]
1197 impl crate::RequestBuilder for DeleteOperation {
1198 fn request_options(&mut self) -> &mut crate::RequestOptions {
1199 &mut self.0.options
1200 }
1201 }
1202}