google_cloud_workflows_v1/
builder.rs1pub mod workflows {
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::Workflows;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = Workflows;
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::Workflows>,
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::Workflows>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
94 pub struct ListWorkflows(RequestBuilder<crate::model::ListWorkflowsRequest>);
95
96 impl ListWorkflows {
97 pub(crate) fn new(
98 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
99 ) -> Self {
100 Self(RequestBuilder::new(stub))
101 }
102
103 pub fn with_request<V: Into<crate::model::ListWorkflowsRequest>>(mut self, v: V) -> Self {
105 self.0.request = v.into();
106 self
107 }
108
109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 pub async fn send(self) -> Result<crate::model::ListWorkflowsResponse> {
117 (*self.0.stub)
118 .list_workflows(self.0.request, self.0.options)
119 .await
120 .map(crate::Response::into_body)
121 }
122
123 pub fn by_page(
125 self,
126 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListWorkflowsResponse, crate::Error>
127 {
128 use std::clone::Clone;
129 let token = self.0.request.page_token.clone();
130 let execute = move |token: String| {
131 let mut builder = self.clone();
132 builder.0.request = builder.0.request.set_page_token(token);
133 builder.send()
134 };
135 google_cloud_gax::paginator::internal::new_paginator(token, execute)
136 }
137
138 pub fn by_item(
140 self,
141 ) -> impl google_cloud_gax::paginator::ItemPaginator<
142 crate::model::ListWorkflowsResponse,
143 crate::Error,
144 > {
145 use google_cloud_gax::paginator::Paginator;
146 self.by_page().items()
147 }
148
149 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
153 self.0.request.parent = v.into();
154 self
155 }
156
157 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
159 self.0.request.page_size = v.into();
160 self
161 }
162
163 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
165 self.0.request.page_token = v.into();
166 self
167 }
168
169 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.filter = v.into();
172 self
173 }
174
175 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
177 self.0.request.order_by = v.into();
178 self
179 }
180 }
181
182 #[doc(hidden)]
183 impl crate::RequestBuilder for ListWorkflows {
184 fn request_options(&mut self) -> &mut crate::RequestOptions {
185 &mut self.0.options
186 }
187 }
188
189 #[derive(Clone, Debug)]
206 pub struct GetWorkflow(RequestBuilder<crate::model::GetWorkflowRequest>);
207
208 impl GetWorkflow {
209 pub(crate) fn new(
210 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
211 ) -> Self {
212 Self(RequestBuilder::new(stub))
213 }
214
215 pub fn with_request<V: Into<crate::model::GetWorkflowRequest>>(mut self, v: V) -> Self {
217 self.0.request = v.into();
218 self
219 }
220
221 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
223 self.0.options = v.into();
224 self
225 }
226
227 pub async fn send(self) -> Result<crate::model::Workflow> {
229 (*self.0.stub)
230 .get_workflow(self.0.request, self.0.options)
231 .await
232 .map(crate::Response::into_body)
233 }
234
235 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
239 self.0.request.name = v.into();
240 self
241 }
242
243 pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
245 self.0.request.revision_id = v.into();
246 self
247 }
248 }
249
250 #[doc(hidden)]
251 impl crate::RequestBuilder for GetWorkflow {
252 fn request_options(&mut self) -> &mut crate::RequestOptions {
253 &mut self.0.options
254 }
255 }
256
257 #[derive(Clone, Debug)]
275 pub struct CreateWorkflow(RequestBuilder<crate::model::CreateWorkflowRequest>);
276
277 impl CreateWorkflow {
278 pub(crate) fn new(
279 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
280 ) -> Self {
281 Self(RequestBuilder::new(stub))
282 }
283
284 pub fn with_request<V: Into<crate::model::CreateWorkflowRequest>>(mut self, v: V) -> Self {
286 self.0.request = v.into();
287 self
288 }
289
290 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
292 self.0.options = v.into();
293 self
294 }
295
296 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
303 (*self.0.stub)
304 .create_workflow(self.0.request, self.0.options)
305 .await
306 .map(crate::Response::into_body)
307 }
308
309 pub fn poller(
311 self,
312 ) -> impl google_cloud_lro::Poller<crate::model::Workflow, crate::model::OperationMetadata>
313 {
314 type Operation = google_cloud_lro::internal::Operation<
315 crate::model::Workflow,
316 crate::model::OperationMetadata,
317 >;
318 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
319 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
320
321 let stub = self.0.stub.clone();
322 let mut options = self.0.options.clone();
323 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
324 let query = move |name| {
325 let stub = stub.clone();
326 let options = options.clone();
327 async {
328 let op = GetOperation::new(stub)
329 .set_name(name)
330 .with_options(options)
331 .send()
332 .await?;
333 Ok(Operation::new(op))
334 }
335 };
336
337 let start = move || async {
338 let op = self.send().await?;
339 Ok(Operation::new(op))
340 };
341
342 google_cloud_lro::internal::new_poller(
343 polling_error_policy,
344 polling_backoff_policy,
345 start,
346 query,
347 )
348 }
349
350 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
354 self.0.request.parent = v.into();
355 self
356 }
357
358 pub fn set_workflow<T>(mut self, v: T) -> Self
362 where
363 T: std::convert::Into<crate::model::Workflow>,
364 {
365 self.0.request.workflow = std::option::Option::Some(v.into());
366 self
367 }
368
369 pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
373 where
374 T: std::convert::Into<crate::model::Workflow>,
375 {
376 self.0.request.workflow = v.map(|x| x.into());
377 self
378 }
379
380 pub fn set_workflow_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
384 self.0.request.workflow_id = v.into();
385 self
386 }
387 }
388
389 #[doc(hidden)]
390 impl crate::RequestBuilder for CreateWorkflow {
391 fn request_options(&mut self) -> &mut crate::RequestOptions {
392 &mut self.0.options
393 }
394 }
395
396 #[derive(Clone, Debug)]
414 pub struct DeleteWorkflow(RequestBuilder<crate::model::DeleteWorkflowRequest>);
415
416 impl DeleteWorkflow {
417 pub(crate) fn new(
418 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
419 ) -> Self {
420 Self(RequestBuilder::new(stub))
421 }
422
423 pub fn with_request<V: Into<crate::model::DeleteWorkflowRequest>>(mut self, v: V) -> Self {
425 self.0.request = v.into();
426 self
427 }
428
429 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
431 self.0.options = v.into();
432 self
433 }
434
435 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
442 (*self.0.stub)
443 .delete_workflow(self.0.request, self.0.options)
444 .await
445 .map(crate::Response::into_body)
446 }
447
448 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
450 type Operation =
451 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
452 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
453 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
454
455 let stub = self.0.stub.clone();
456 let mut options = self.0.options.clone();
457 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
458 let query = move |name| {
459 let stub = stub.clone();
460 let options = options.clone();
461 async {
462 let op = GetOperation::new(stub)
463 .set_name(name)
464 .with_options(options)
465 .send()
466 .await?;
467 Ok(Operation::new(op))
468 }
469 };
470
471 let start = move || async {
472 let op = self.send().await?;
473 Ok(Operation::new(op))
474 };
475
476 google_cloud_lro::internal::new_unit_response_poller(
477 polling_error_policy,
478 polling_backoff_policy,
479 start,
480 query,
481 )
482 }
483
484 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
488 self.0.request.name = v.into();
489 self
490 }
491 }
492
493 #[doc(hidden)]
494 impl crate::RequestBuilder for DeleteWorkflow {
495 fn request_options(&mut self) -> &mut crate::RequestOptions {
496 &mut self.0.options
497 }
498 }
499
500 #[derive(Clone, Debug)]
518 pub struct UpdateWorkflow(RequestBuilder<crate::model::UpdateWorkflowRequest>);
519
520 impl UpdateWorkflow {
521 pub(crate) fn new(
522 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
523 ) -> Self {
524 Self(RequestBuilder::new(stub))
525 }
526
527 pub fn with_request<V: Into<crate::model::UpdateWorkflowRequest>>(mut self, v: V) -> Self {
529 self.0.request = v.into();
530 self
531 }
532
533 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
535 self.0.options = v.into();
536 self
537 }
538
539 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
546 (*self.0.stub)
547 .update_workflow(self.0.request, self.0.options)
548 .await
549 .map(crate::Response::into_body)
550 }
551
552 pub fn poller(
554 self,
555 ) -> impl google_cloud_lro::Poller<crate::model::Workflow, crate::model::OperationMetadata>
556 {
557 type Operation = google_cloud_lro::internal::Operation<
558 crate::model::Workflow,
559 crate::model::OperationMetadata,
560 >;
561 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
562 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
563
564 let stub = self.0.stub.clone();
565 let mut options = self.0.options.clone();
566 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
567 let query = move |name| {
568 let stub = stub.clone();
569 let options = options.clone();
570 async {
571 let op = GetOperation::new(stub)
572 .set_name(name)
573 .with_options(options)
574 .send()
575 .await?;
576 Ok(Operation::new(op))
577 }
578 };
579
580 let start = move || async {
581 let op = self.send().await?;
582 Ok(Operation::new(op))
583 };
584
585 google_cloud_lro::internal::new_poller(
586 polling_error_policy,
587 polling_backoff_policy,
588 start,
589 query,
590 )
591 }
592
593 pub fn set_workflow<T>(mut self, v: T) -> Self
597 where
598 T: std::convert::Into<crate::model::Workflow>,
599 {
600 self.0.request.workflow = std::option::Option::Some(v.into());
601 self
602 }
603
604 pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
608 where
609 T: std::convert::Into<crate::model::Workflow>,
610 {
611 self.0.request.workflow = v.map(|x| x.into());
612 self
613 }
614
615 pub fn set_update_mask<T>(mut self, v: T) -> Self
617 where
618 T: std::convert::Into<wkt::FieldMask>,
619 {
620 self.0.request.update_mask = std::option::Option::Some(v.into());
621 self
622 }
623
624 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
626 where
627 T: std::convert::Into<wkt::FieldMask>,
628 {
629 self.0.request.update_mask = v.map(|x| x.into());
630 self
631 }
632 }
633
634 #[doc(hidden)]
635 impl crate::RequestBuilder for UpdateWorkflow {
636 fn request_options(&mut self) -> &mut crate::RequestOptions {
637 &mut self.0.options
638 }
639 }
640
641 #[derive(Clone, Debug)]
662 pub struct ListWorkflowRevisions(RequestBuilder<crate::model::ListWorkflowRevisionsRequest>);
663
664 impl ListWorkflowRevisions {
665 pub(crate) fn new(
666 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
667 ) -> Self {
668 Self(RequestBuilder::new(stub))
669 }
670
671 pub fn with_request<V: Into<crate::model::ListWorkflowRevisionsRequest>>(
673 mut self,
674 v: V,
675 ) -> Self {
676 self.0.request = v.into();
677 self
678 }
679
680 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
682 self.0.options = v.into();
683 self
684 }
685
686 pub async fn send(self) -> Result<crate::model::ListWorkflowRevisionsResponse> {
688 (*self.0.stub)
689 .list_workflow_revisions(self.0.request, self.0.options)
690 .await
691 .map(crate::Response::into_body)
692 }
693
694 pub fn by_page(
696 self,
697 ) -> impl google_cloud_gax::paginator::Paginator<
698 crate::model::ListWorkflowRevisionsResponse,
699 crate::Error,
700 > {
701 use std::clone::Clone;
702 let token = self.0.request.page_token.clone();
703 let execute = move |token: String| {
704 let mut builder = self.clone();
705 builder.0.request = builder.0.request.set_page_token(token);
706 builder.send()
707 };
708 google_cloud_gax::paginator::internal::new_paginator(token, execute)
709 }
710
711 pub fn by_item(
713 self,
714 ) -> impl google_cloud_gax::paginator::ItemPaginator<
715 crate::model::ListWorkflowRevisionsResponse,
716 crate::Error,
717 > {
718 use google_cloud_gax::paginator::Paginator;
719 self.by_page().items()
720 }
721
722 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
726 self.0.request.name = v.into();
727 self
728 }
729
730 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
732 self.0.request.page_size = v.into();
733 self
734 }
735
736 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
738 self.0.request.page_token = v.into();
739 self
740 }
741 }
742
743 #[doc(hidden)]
744 impl crate::RequestBuilder for ListWorkflowRevisions {
745 fn request_options(&mut self) -> &mut crate::RequestOptions {
746 &mut self.0.options
747 }
748 }
749
750 #[derive(Clone, Debug)]
771 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
772
773 impl ListLocations {
774 pub(crate) fn new(
775 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
776 ) -> Self {
777 Self(RequestBuilder::new(stub))
778 }
779
780 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
782 mut self,
783 v: V,
784 ) -> Self {
785 self.0.request = v.into();
786 self
787 }
788
789 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
791 self.0.options = v.into();
792 self
793 }
794
795 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
797 (*self.0.stub)
798 .list_locations(self.0.request, self.0.options)
799 .await
800 .map(crate::Response::into_body)
801 }
802
803 pub fn by_page(
805 self,
806 ) -> impl google_cloud_gax::paginator::Paginator<
807 google_cloud_location::model::ListLocationsResponse,
808 crate::Error,
809 > {
810 use std::clone::Clone;
811 let token = self.0.request.page_token.clone();
812 let execute = move |token: String| {
813 let mut builder = self.clone();
814 builder.0.request = builder.0.request.set_page_token(token);
815 builder.send()
816 };
817 google_cloud_gax::paginator::internal::new_paginator(token, execute)
818 }
819
820 pub fn by_item(
822 self,
823 ) -> impl google_cloud_gax::paginator::ItemPaginator<
824 google_cloud_location::model::ListLocationsResponse,
825 crate::Error,
826 > {
827 use google_cloud_gax::paginator::Paginator;
828 self.by_page().items()
829 }
830
831 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
833 self.0.request.name = v.into();
834 self
835 }
836
837 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
839 self.0.request.filter = v.into();
840 self
841 }
842
843 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
845 self.0.request.page_size = v.into();
846 self
847 }
848
849 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
851 self.0.request.page_token = v.into();
852 self
853 }
854 }
855
856 #[doc(hidden)]
857 impl crate::RequestBuilder for ListLocations {
858 fn request_options(&mut self) -> &mut crate::RequestOptions {
859 &mut self.0.options
860 }
861 }
862
863 #[derive(Clone, Debug)]
880 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
881
882 impl GetLocation {
883 pub(crate) fn new(
884 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
885 ) -> Self {
886 Self(RequestBuilder::new(stub))
887 }
888
889 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
891 mut self,
892 v: V,
893 ) -> Self {
894 self.0.request = v.into();
895 self
896 }
897
898 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
900 self.0.options = v.into();
901 self
902 }
903
904 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
906 (*self.0.stub)
907 .get_location(self.0.request, self.0.options)
908 .await
909 .map(crate::Response::into_body)
910 }
911
912 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
914 self.0.request.name = v.into();
915 self
916 }
917 }
918
919 #[doc(hidden)]
920 impl crate::RequestBuilder for GetLocation {
921 fn request_options(&mut self) -> &mut crate::RequestOptions {
922 &mut self.0.options
923 }
924 }
925
926 #[derive(Clone, Debug)]
947 pub struct ListOperations(
948 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
949 );
950
951 impl ListOperations {
952 pub(crate) fn new(
953 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
954 ) -> Self {
955 Self(RequestBuilder::new(stub))
956 }
957
958 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
960 mut self,
961 v: V,
962 ) -> Self {
963 self.0.request = v.into();
964 self
965 }
966
967 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
969 self.0.options = v.into();
970 self
971 }
972
973 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
975 (*self.0.stub)
976 .list_operations(self.0.request, self.0.options)
977 .await
978 .map(crate::Response::into_body)
979 }
980
981 pub fn by_page(
983 self,
984 ) -> impl google_cloud_gax::paginator::Paginator<
985 google_cloud_longrunning::model::ListOperationsResponse,
986 crate::Error,
987 > {
988 use std::clone::Clone;
989 let token = self.0.request.page_token.clone();
990 let execute = move |token: String| {
991 let mut builder = self.clone();
992 builder.0.request = builder.0.request.set_page_token(token);
993 builder.send()
994 };
995 google_cloud_gax::paginator::internal::new_paginator(token, execute)
996 }
997
998 pub fn by_item(
1000 self,
1001 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1002 google_cloud_longrunning::model::ListOperationsResponse,
1003 crate::Error,
1004 > {
1005 use google_cloud_gax::paginator::Paginator;
1006 self.by_page().items()
1007 }
1008
1009 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1011 self.0.request.name = v.into();
1012 self
1013 }
1014
1015 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1017 self.0.request.filter = v.into();
1018 self
1019 }
1020
1021 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1023 self.0.request.page_size = v.into();
1024 self
1025 }
1026
1027 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1029 self.0.request.page_token = v.into();
1030 self
1031 }
1032
1033 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1035 self.0.request.return_partial_success = v.into();
1036 self
1037 }
1038 }
1039
1040 #[doc(hidden)]
1041 impl crate::RequestBuilder for ListOperations {
1042 fn request_options(&mut self) -> &mut crate::RequestOptions {
1043 &mut self.0.options
1044 }
1045 }
1046
1047 #[derive(Clone, Debug)]
1064 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1065
1066 impl GetOperation {
1067 pub(crate) fn new(
1068 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
1069 ) -> Self {
1070 Self(RequestBuilder::new(stub))
1071 }
1072
1073 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1075 mut self,
1076 v: V,
1077 ) -> Self {
1078 self.0.request = v.into();
1079 self
1080 }
1081
1082 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1084 self.0.options = v.into();
1085 self
1086 }
1087
1088 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1090 (*self.0.stub)
1091 .get_operation(self.0.request, self.0.options)
1092 .await
1093 .map(crate::Response::into_body)
1094 }
1095
1096 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1098 self.0.request.name = v.into();
1099 self
1100 }
1101 }
1102
1103 #[doc(hidden)]
1104 impl crate::RequestBuilder for GetOperation {
1105 fn request_options(&mut self) -> &mut crate::RequestOptions {
1106 &mut self.0.options
1107 }
1108 }
1109
1110 #[derive(Clone, Debug)]
1127 pub struct DeleteOperation(
1128 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1129 );
1130
1131 impl DeleteOperation {
1132 pub(crate) fn new(
1133 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
1134 ) -> Self {
1135 Self(RequestBuilder::new(stub))
1136 }
1137
1138 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1140 mut self,
1141 v: V,
1142 ) -> Self {
1143 self.0.request = v.into();
1144 self
1145 }
1146
1147 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1149 self.0.options = v.into();
1150 self
1151 }
1152
1153 pub async fn send(self) -> Result<()> {
1155 (*self.0.stub)
1156 .delete_operation(self.0.request, self.0.options)
1157 .await
1158 .map(crate::Response::into_body)
1159 }
1160
1161 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1163 self.0.request.name = v.into();
1164 self
1165 }
1166 }
1167
1168 #[doc(hidden)]
1169 impl crate::RequestBuilder for DeleteOperation {
1170 fn request_options(&mut self) -> &mut crate::RequestOptions {
1171 &mut self.0.options
1172 }
1173 }
1174}