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
322 let stub = self.0.stub.clone();
323 let mut options = self.0.options.clone();
324 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
325 let query = move |name| {
326 let stub = stub.clone();
327 let options = options.clone();
328 async {
329 let op = GetOperation::new(stub)
330 .set_name(name)
331 .with_options(options)
332 .send()
333 .await?;
334 Ok(Operation::new(op))
335 }
336 };
337
338 let start = move || async {
339 let op = self.send().await?;
340 Ok(Operation::new(op))
341 };
342
343 google_cloud_lro::internal::new_poller(
344 polling_error_policy,
345 polling_backoff_policy,
346 start,
347 query,
348 )
349 }
350
351 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
355 self.0.request.parent = v.into();
356 self
357 }
358
359 pub fn set_workflow<T>(mut self, v: T) -> Self
363 where
364 T: std::convert::Into<crate::model::Workflow>,
365 {
366 self.0.request.workflow = std::option::Option::Some(v.into());
367 self
368 }
369
370 pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
374 where
375 T: std::convert::Into<crate::model::Workflow>,
376 {
377 self.0.request.workflow = v.map(|x| x.into());
378 self
379 }
380
381 pub fn set_workflow_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
385 self.0.request.workflow_id = v.into();
386 self
387 }
388 }
389
390 #[doc(hidden)]
391 impl crate::RequestBuilder for CreateWorkflow {
392 fn request_options(&mut self) -> &mut crate::RequestOptions {
393 &mut self.0.options
394 }
395 }
396
397 #[derive(Clone, Debug)]
415 pub struct DeleteWorkflow(RequestBuilder<crate::model::DeleteWorkflowRequest>);
416
417 impl DeleteWorkflow {
418 pub(crate) fn new(
419 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
420 ) -> Self {
421 Self(RequestBuilder::new(stub))
422 }
423
424 pub fn with_request<V: Into<crate::model::DeleteWorkflowRequest>>(mut self, v: V) -> Self {
426 self.0.request = v.into();
427 self
428 }
429
430 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
432 self.0.options = v.into();
433 self
434 }
435
436 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
443 (*self.0.stub)
444 .delete_workflow(self.0.request, self.0.options)
445 .await
446 .map(crate::Response::into_body)
447 }
448
449 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
451 type Operation =
452 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
453 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
454 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
455
456 let stub = self.0.stub.clone();
457 let mut options = self.0.options.clone();
458 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
459 let query = move |name| {
460 let stub = stub.clone();
461 let options = options.clone();
462 async {
463 let op = GetOperation::new(stub)
464 .set_name(name)
465 .with_options(options)
466 .send()
467 .await?;
468 Ok(Operation::new(op))
469 }
470 };
471
472 let start = move || async {
473 let op = self.send().await?;
474 Ok(Operation::new(op))
475 };
476
477 google_cloud_lro::internal::new_unit_response_poller(
478 polling_error_policy,
479 polling_backoff_policy,
480 start,
481 query,
482 )
483 }
484
485 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
489 self.0.request.name = v.into();
490 self
491 }
492 }
493
494 #[doc(hidden)]
495 impl crate::RequestBuilder for DeleteWorkflow {
496 fn request_options(&mut self) -> &mut crate::RequestOptions {
497 &mut self.0.options
498 }
499 }
500
501 #[derive(Clone, Debug)]
519 pub struct UpdateWorkflow(RequestBuilder<crate::model::UpdateWorkflowRequest>);
520
521 impl UpdateWorkflow {
522 pub(crate) fn new(
523 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
524 ) -> Self {
525 Self(RequestBuilder::new(stub))
526 }
527
528 pub fn with_request<V: Into<crate::model::UpdateWorkflowRequest>>(mut self, v: V) -> Self {
530 self.0.request = v.into();
531 self
532 }
533
534 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
536 self.0.options = v.into();
537 self
538 }
539
540 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
547 (*self.0.stub)
548 .update_workflow(self.0.request, self.0.options)
549 .await
550 .map(crate::Response::into_body)
551 }
552
553 pub fn poller(
555 self,
556 ) -> impl google_cloud_lro::Poller<crate::model::Workflow, crate::model::OperationMetadata>
557 {
558 type Operation = google_cloud_lro::internal::Operation<
559 crate::model::Workflow,
560 crate::model::OperationMetadata,
561 >;
562 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
563 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
564
565 let stub = self.0.stub.clone();
566 let mut options = self.0.options.clone();
567 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
568 let query = move |name| {
569 let stub = stub.clone();
570 let options = options.clone();
571 async {
572 let op = GetOperation::new(stub)
573 .set_name(name)
574 .with_options(options)
575 .send()
576 .await?;
577 Ok(Operation::new(op))
578 }
579 };
580
581 let start = move || async {
582 let op = self.send().await?;
583 Ok(Operation::new(op))
584 };
585
586 google_cloud_lro::internal::new_poller(
587 polling_error_policy,
588 polling_backoff_policy,
589 start,
590 query,
591 )
592 }
593
594 pub fn set_workflow<T>(mut self, v: T) -> Self
598 where
599 T: std::convert::Into<crate::model::Workflow>,
600 {
601 self.0.request.workflow = std::option::Option::Some(v.into());
602 self
603 }
604
605 pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
609 where
610 T: std::convert::Into<crate::model::Workflow>,
611 {
612 self.0.request.workflow = v.map(|x| x.into());
613 self
614 }
615
616 pub fn set_update_mask<T>(mut self, v: T) -> Self
618 where
619 T: std::convert::Into<wkt::FieldMask>,
620 {
621 self.0.request.update_mask = std::option::Option::Some(v.into());
622 self
623 }
624
625 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
627 where
628 T: std::convert::Into<wkt::FieldMask>,
629 {
630 self.0.request.update_mask = v.map(|x| x.into());
631 self
632 }
633 }
634
635 #[doc(hidden)]
636 impl crate::RequestBuilder for UpdateWorkflow {
637 fn request_options(&mut self) -> &mut crate::RequestOptions {
638 &mut self.0.options
639 }
640 }
641
642 #[derive(Clone, Debug)]
663 pub struct ListWorkflowRevisions(RequestBuilder<crate::model::ListWorkflowRevisionsRequest>);
664
665 impl ListWorkflowRevisions {
666 pub(crate) fn new(
667 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
668 ) -> Self {
669 Self(RequestBuilder::new(stub))
670 }
671
672 pub fn with_request<V: Into<crate::model::ListWorkflowRevisionsRequest>>(
674 mut self,
675 v: V,
676 ) -> Self {
677 self.0.request = v.into();
678 self
679 }
680
681 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
683 self.0.options = v.into();
684 self
685 }
686
687 pub async fn send(self) -> Result<crate::model::ListWorkflowRevisionsResponse> {
689 (*self.0.stub)
690 .list_workflow_revisions(self.0.request, self.0.options)
691 .await
692 .map(crate::Response::into_body)
693 }
694
695 pub fn by_page(
697 self,
698 ) -> impl google_cloud_gax::paginator::Paginator<
699 crate::model::ListWorkflowRevisionsResponse,
700 crate::Error,
701 > {
702 use std::clone::Clone;
703 let token = self.0.request.page_token.clone();
704 let execute = move |token: String| {
705 let mut builder = self.clone();
706 builder.0.request = builder.0.request.set_page_token(token);
707 builder.send()
708 };
709 google_cloud_gax::paginator::internal::new_paginator(token, execute)
710 }
711
712 pub fn by_item(
714 self,
715 ) -> impl google_cloud_gax::paginator::ItemPaginator<
716 crate::model::ListWorkflowRevisionsResponse,
717 crate::Error,
718 > {
719 use google_cloud_gax::paginator::Paginator;
720 self.by_page().items()
721 }
722
723 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
727 self.0.request.name = v.into();
728 self
729 }
730
731 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
733 self.0.request.page_size = v.into();
734 self
735 }
736
737 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
739 self.0.request.page_token = v.into();
740 self
741 }
742 }
743
744 #[doc(hidden)]
745 impl crate::RequestBuilder for ListWorkflowRevisions {
746 fn request_options(&mut self) -> &mut crate::RequestOptions {
747 &mut self.0.options
748 }
749 }
750
751 #[derive(Clone, Debug)]
772 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
773
774 impl ListLocations {
775 pub(crate) fn new(
776 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
777 ) -> Self {
778 Self(RequestBuilder::new(stub))
779 }
780
781 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
783 mut self,
784 v: V,
785 ) -> Self {
786 self.0.request = v.into();
787 self
788 }
789
790 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
792 self.0.options = v.into();
793 self
794 }
795
796 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
798 (*self.0.stub)
799 .list_locations(self.0.request, self.0.options)
800 .await
801 .map(crate::Response::into_body)
802 }
803
804 pub fn by_page(
806 self,
807 ) -> impl google_cloud_gax::paginator::Paginator<
808 google_cloud_location::model::ListLocationsResponse,
809 crate::Error,
810 > {
811 use std::clone::Clone;
812 let token = self.0.request.page_token.clone();
813 let execute = move |token: String| {
814 let mut builder = self.clone();
815 builder.0.request = builder.0.request.set_page_token(token);
816 builder.send()
817 };
818 google_cloud_gax::paginator::internal::new_paginator(token, execute)
819 }
820
821 pub fn by_item(
823 self,
824 ) -> impl google_cloud_gax::paginator::ItemPaginator<
825 google_cloud_location::model::ListLocationsResponse,
826 crate::Error,
827 > {
828 use google_cloud_gax::paginator::Paginator;
829 self.by_page().items()
830 }
831
832 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
834 self.0.request.name = v.into();
835 self
836 }
837
838 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
840 self.0.request.filter = v.into();
841 self
842 }
843
844 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
846 self.0.request.page_size = v.into();
847 self
848 }
849
850 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
852 self.0.request.page_token = v.into();
853 self
854 }
855 }
856
857 #[doc(hidden)]
858 impl crate::RequestBuilder for ListLocations {
859 fn request_options(&mut self) -> &mut crate::RequestOptions {
860 &mut self.0.options
861 }
862 }
863
864 #[derive(Clone, Debug)]
881 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
882
883 impl GetLocation {
884 pub(crate) fn new(
885 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
886 ) -> Self {
887 Self(RequestBuilder::new(stub))
888 }
889
890 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
892 mut self,
893 v: V,
894 ) -> Self {
895 self.0.request = v.into();
896 self
897 }
898
899 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
901 self.0.options = v.into();
902 self
903 }
904
905 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
907 (*self.0.stub)
908 .get_location(self.0.request, self.0.options)
909 .await
910 .map(crate::Response::into_body)
911 }
912
913 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
915 self.0.request.name = v.into();
916 self
917 }
918 }
919
920 #[doc(hidden)]
921 impl crate::RequestBuilder for GetLocation {
922 fn request_options(&mut self) -> &mut crate::RequestOptions {
923 &mut self.0.options
924 }
925 }
926
927 #[derive(Clone, Debug)]
948 pub struct ListOperations(
949 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
950 );
951
952 impl ListOperations {
953 pub(crate) fn new(
954 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
955 ) -> Self {
956 Self(RequestBuilder::new(stub))
957 }
958
959 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
961 mut self,
962 v: V,
963 ) -> Self {
964 self.0.request = v.into();
965 self
966 }
967
968 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
970 self.0.options = v.into();
971 self
972 }
973
974 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
976 (*self.0.stub)
977 .list_operations(self.0.request, self.0.options)
978 .await
979 .map(crate::Response::into_body)
980 }
981
982 pub fn by_page(
984 self,
985 ) -> impl google_cloud_gax::paginator::Paginator<
986 google_cloud_longrunning::model::ListOperationsResponse,
987 crate::Error,
988 > {
989 use std::clone::Clone;
990 let token = self.0.request.page_token.clone();
991 let execute = move |token: String| {
992 let mut builder = self.clone();
993 builder.0.request = builder.0.request.set_page_token(token);
994 builder.send()
995 };
996 google_cloud_gax::paginator::internal::new_paginator(token, execute)
997 }
998
999 pub fn by_item(
1001 self,
1002 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1003 google_cloud_longrunning::model::ListOperationsResponse,
1004 crate::Error,
1005 > {
1006 use google_cloud_gax::paginator::Paginator;
1007 self.by_page().items()
1008 }
1009
1010 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1012 self.0.request.name = v.into();
1013 self
1014 }
1015
1016 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1018 self.0.request.filter = v.into();
1019 self
1020 }
1021
1022 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1024 self.0.request.page_size = v.into();
1025 self
1026 }
1027
1028 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1030 self.0.request.page_token = v.into();
1031 self
1032 }
1033
1034 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1036 self.0.request.return_partial_success = v.into();
1037 self
1038 }
1039 }
1040
1041 #[doc(hidden)]
1042 impl crate::RequestBuilder for ListOperations {
1043 fn request_options(&mut self) -> &mut crate::RequestOptions {
1044 &mut self.0.options
1045 }
1046 }
1047
1048 #[derive(Clone, Debug)]
1065 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1066
1067 impl GetOperation {
1068 pub(crate) fn new(
1069 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
1070 ) -> Self {
1071 Self(RequestBuilder::new(stub))
1072 }
1073
1074 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1076 mut self,
1077 v: V,
1078 ) -> Self {
1079 self.0.request = v.into();
1080 self
1081 }
1082
1083 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1085 self.0.options = v.into();
1086 self
1087 }
1088
1089 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1091 (*self.0.stub)
1092 .get_operation(self.0.request, self.0.options)
1093 .await
1094 .map(crate::Response::into_body)
1095 }
1096
1097 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1099 self.0.request.name = v.into();
1100 self
1101 }
1102 }
1103
1104 #[doc(hidden)]
1105 impl crate::RequestBuilder for GetOperation {
1106 fn request_options(&mut self) -> &mut crate::RequestOptions {
1107 &mut self.0.options
1108 }
1109 }
1110
1111 #[derive(Clone, Debug)]
1128 pub struct DeleteOperation(
1129 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1130 );
1131
1132 impl DeleteOperation {
1133 pub(crate) fn new(
1134 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
1135 ) -> Self {
1136 Self(RequestBuilder::new(stub))
1137 }
1138
1139 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1141 mut self,
1142 v: V,
1143 ) -> Self {
1144 self.0.request = v.into();
1145 self
1146 }
1147
1148 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1150 self.0.options = v.into();
1151 self
1152 }
1153
1154 pub async fn send(self) -> Result<()> {
1156 (*self.0.stub)
1157 .delete_operation(self.0.request, self.0.options)
1158 .await
1159 .map(crate::Response::into_body)
1160 }
1161
1162 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1164 self.0.request.name = v.into();
1165 self
1166 }
1167 }
1168
1169 #[doc(hidden)]
1170 impl crate::RequestBuilder for DeleteOperation {
1171 fn request_options(&mut self) -> &mut crate::RequestOptions {
1172 &mut self.0.options
1173 }
1174 }
1175}