google_cloud_workflows_v1/
builder.rs1pub mod workflows {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::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 gax::client_builder::internal::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 ) -> gax::client_builder::Result<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: gax::options::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: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
96 pub struct ListWorkflows(RequestBuilder<crate::model::ListWorkflowsRequest>);
97
98 impl ListWorkflows {
99 pub(crate) fn new(
100 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
101 ) -> Self {
102 Self(RequestBuilder::new(stub))
103 }
104
105 pub fn with_request<V: Into<crate::model::ListWorkflowsRequest>>(mut self, v: V) -> Self {
107 self.0.request = v.into();
108 self
109 }
110
111 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
113 self.0.options = v.into();
114 self
115 }
116
117 pub async fn send(self) -> Result<crate::model::ListWorkflowsResponse> {
119 (*self.0.stub)
120 .list_workflows(self.0.request, self.0.options)
121 .await
122 .map(gax::response::Response::into_body)
123 }
124
125 pub fn by_page(
127 self,
128 ) -> impl gax::paginator::Paginator<crate::model::ListWorkflowsResponse, gax::error::Error>
129 {
130 use std::clone::Clone;
131 let token = self.0.request.page_token.clone();
132 let execute = move |token: String| {
133 let mut builder = self.clone();
134 builder.0.request = builder.0.request.set_page_token(token);
135 builder.send()
136 };
137 gax::paginator::internal::new_paginator(token, execute)
138 }
139
140 pub fn by_item(
142 self,
143 ) -> impl gax::paginator::ItemPaginator<crate::model::ListWorkflowsResponse, gax::error::Error>
144 {
145 use 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 gax::options::internal::RequestBuilder for ListWorkflows {
184 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
185 &mut self.0.options
186 }
187 }
188
189 #[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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for GetWorkflow {
253 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
254 &mut self.0.options
255 }
256 }
257
258 #[derive(Clone, Debug)]
277 pub struct CreateWorkflow(RequestBuilder<crate::model::CreateWorkflowRequest>);
278
279 impl CreateWorkflow {
280 pub(crate) fn new(
281 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
282 ) -> Self {
283 Self(RequestBuilder::new(stub))
284 }
285
286 pub fn with_request<V: Into<crate::model::CreateWorkflowRequest>>(mut self, v: V) -> Self {
288 self.0.request = v.into();
289 self
290 }
291
292 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
294 self.0.options = v.into();
295 self
296 }
297
298 pub async fn send(self) -> Result<longrunning::model::Operation> {
305 (*self.0.stub)
306 .create_workflow(self.0.request, self.0.options)
307 .await
308 .map(gax::response::Response::into_body)
309 }
310
311 pub fn poller(
313 self,
314 ) -> impl lro::Poller<crate::model::Workflow, crate::model::OperationMetadata> {
315 type Operation =
316 lro::internal::Operation<crate::model::Workflow, crate::model::OperationMetadata>;
317 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
318 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
319
320 let stub = self.0.stub.clone();
321 let mut options = self.0.options.clone();
322 options.set_retry_policy(gax::retry_policy::NeverRetry);
323 let query = move |name| {
324 let stub = stub.clone();
325 let options = options.clone();
326 async {
327 let op = GetOperation::new(stub)
328 .set_name(name)
329 .with_options(options)
330 .send()
331 .await?;
332 Ok(Operation::new(op))
333 }
334 };
335
336 let start = move || async {
337 let op = self.send().await?;
338 Ok(Operation::new(op))
339 };
340
341 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
342 }
343
344 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
348 self.0.request.parent = v.into();
349 self
350 }
351
352 pub fn set_workflow<T>(mut self, v: T) -> Self
356 where
357 T: std::convert::Into<crate::model::Workflow>,
358 {
359 self.0.request.workflow = std::option::Option::Some(v.into());
360 self
361 }
362
363 pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
367 where
368 T: std::convert::Into<crate::model::Workflow>,
369 {
370 self.0.request.workflow = v.map(|x| x.into());
371 self
372 }
373
374 pub fn set_workflow_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
378 self.0.request.workflow_id = v.into();
379 self
380 }
381 }
382
383 #[doc(hidden)]
384 impl gax::options::internal::RequestBuilder for CreateWorkflow {
385 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
386 &mut self.0.options
387 }
388 }
389
390 #[derive(Clone, Debug)]
409 pub struct DeleteWorkflow(RequestBuilder<crate::model::DeleteWorkflowRequest>);
410
411 impl DeleteWorkflow {
412 pub(crate) fn new(
413 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
414 ) -> Self {
415 Self(RequestBuilder::new(stub))
416 }
417
418 pub fn with_request<V: Into<crate::model::DeleteWorkflowRequest>>(mut self, v: V) -> Self {
420 self.0.request = v.into();
421 self
422 }
423
424 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
426 self.0.options = v.into();
427 self
428 }
429
430 pub async fn send(self) -> Result<longrunning::model::Operation> {
437 (*self.0.stub)
438 .delete_workflow(self.0.request, self.0.options)
439 .await
440 .map(gax::response::Response::into_body)
441 }
442
443 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
445 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
446 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
447 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
448
449 let stub = self.0.stub.clone();
450 let mut options = self.0.options.clone();
451 options.set_retry_policy(gax::retry_policy::NeverRetry);
452 let query = move |name| {
453 let stub = stub.clone();
454 let options = options.clone();
455 async {
456 let op = GetOperation::new(stub)
457 .set_name(name)
458 .with_options(options)
459 .send()
460 .await?;
461 Ok(Operation::new(op))
462 }
463 };
464
465 let start = move || async {
466 let op = self.send().await?;
467 Ok(Operation::new(op))
468 };
469
470 lro::internal::new_unit_response_poller(
471 polling_error_policy,
472 polling_backoff_policy,
473 start,
474 query,
475 )
476 }
477
478 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
482 self.0.request.name = v.into();
483 self
484 }
485 }
486
487 #[doc(hidden)]
488 impl gax::options::internal::RequestBuilder for DeleteWorkflow {
489 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
490 &mut self.0.options
491 }
492 }
493
494 #[derive(Clone, Debug)]
513 pub struct UpdateWorkflow(RequestBuilder<crate::model::UpdateWorkflowRequest>);
514
515 impl UpdateWorkflow {
516 pub(crate) fn new(
517 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
518 ) -> Self {
519 Self(RequestBuilder::new(stub))
520 }
521
522 pub fn with_request<V: Into<crate::model::UpdateWorkflowRequest>>(mut self, v: V) -> Self {
524 self.0.request = v.into();
525 self
526 }
527
528 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
530 self.0.options = v.into();
531 self
532 }
533
534 pub async fn send(self) -> Result<longrunning::model::Operation> {
541 (*self.0.stub)
542 .update_workflow(self.0.request, self.0.options)
543 .await
544 .map(gax::response::Response::into_body)
545 }
546
547 pub fn poller(
549 self,
550 ) -> impl lro::Poller<crate::model::Workflow, crate::model::OperationMetadata> {
551 type Operation =
552 lro::internal::Operation<crate::model::Workflow, crate::model::OperationMetadata>;
553 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
554 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
555
556 let stub = self.0.stub.clone();
557 let mut options = self.0.options.clone();
558 options.set_retry_policy(gax::retry_policy::NeverRetry);
559 let query = move |name| {
560 let stub = stub.clone();
561 let options = options.clone();
562 async {
563 let op = GetOperation::new(stub)
564 .set_name(name)
565 .with_options(options)
566 .send()
567 .await?;
568 Ok(Operation::new(op))
569 }
570 };
571
572 let start = move || async {
573 let op = self.send().await?;
574 Ok(Operation::new(op))
575 };
576
577 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
578 }
579
580 pub fn set_workflow<T>(mut self, v: T) -> Self
584 where
585 T: std::convert::Into<crate::model::Workflow>,
586 {
587 self.0.request.workflow = std::option::Option::Some(v.into());
588 self
589 }
590
591 pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
595 where
596 T: std::convert::Into<crate::model::Workflow>,
597 {
598 self.0.request.workflow = v.map(|x| x.into());
599 self
600 }
601
602 pub fn set_update_mask<T>(mut self, v: T) -> Self
604 where
605 T: std::convert::Into<wkt::FieldMask>,
606 {
607 self.0.request.update_mask = std::option::Option::Some(v.into());
608 self
609 }
610
611 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
613 where
614 T: std::convert::Into<wkt::FieldMask>,
615 {
616 self.0.request.update_mask = v.map(|x| x.into());
617 self
618 }
619 }
620
621 #[doc(hidden)]
622 impl gax::options::internal::RequestBuilder for UpdateWorkflow {
623 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
624 &mut self.0.options
625 }
626 }
627
628 #[derive(Clone, Debug)]
650 pub struct ListWorkflowRevisions(RequestBuilder<crate::model::ListWorkflowRevisionsRequest>);
651
652 impl ListWorkflowRevisions {
653 pub(crate) fn new(
654 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
655 ) -> Self {
656 Self(RequestBuilder::new(stub))
657 }
658
659 pub fn with_request<V: Into<crate::model::ListWorkflowRevisionsRequest>>(
661 mut self,
662 v: V,
663 ) -> Self {
664 self.0.request = v.into();
665 self
666 }
667
668 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
670 self.0.options = v.into();
671 self
672 }
673
674 pub async fn send(self) -> Result<crate::model::ListWorkflowRevisionsResponse> {
676 (*self.0.stub)
677 .list_workflow_revisions(self.0.request, self.0.options)
678 .await
679 .map(gax::response::Response::into_body)
680 }
681
682 pub fn by_page(
684 self,
685 ) -> impl gax::paginator::Paginator<crate::model::ListWorkflowRevisionsResponse, gax::error::Error>
686 {
687 use std::clone::Clone;
688 let token = self.0.request.page_token.clone();
689 let execute = move |token: String| {
690 let mut builder = self.clone();
691 builder.0.request = builder.0.request.set_page_token(token);
692 builder.send()
693 };
694 gax::paginator::internal::new_paginator(token, execute)
695 }
696
697 pub fn by_item(
699 self,
700 ) -> impl gax::paginator::ItemPaginator<
701 crate::model::ListWorkflowRevisionsResponse,
702 gax::error::Error,
703 > {
704 use gax::paginator::Paginator;
705 self.by_page().items()
706 }
707
708 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
712 self.0.request.name = v.into();
713 self
714 }
715
716 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
718 self.0.request.page_size = v.into();
719 self
720 }
721
722 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
724 self.0.request.page_token = v.into();
725 self
726 }
727 }
728
729 #[doc(hidden)]
730 impl gax::options::internal::RequestBuilder for ListWorkflowRevisions {
731 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
732 &mut self.0.options
733 }
734 }
735
736 #[derive(Clone, Debug)]
758 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
759
760 impl ListLocations {
761 pub(crate) fn new(
762 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
763 ) -> Self {
764 Self(RequestBuilder::new(stub))
765 }
766
767 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
769 mut self,
770 v: V,
771 ) -> Self {
772 self.0.request = v.into();
773 self
774 }
775
776 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
778 self.0.options = v.into();
779 self
780 }
781
782 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
784 (*self.0.stub)
785 .list_locations(self.0.request, self.0.options)
786 .await
787 .map(gax::response::Response::into_body)
788 }
789
790 pub fn by_page(
792 self,
793 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
794 {
795 use std::clone::Clone;
796 let token = self.0.request.page_token.clone();
797 let execute = move |token: String| {
798 let mut builder = self.clone();
799 builder.0.request = builder.0.request.set_page_token(token);
800 builder.send()
801 };
802 gax::paginator::internal::new_paginator(token, execute)
803 }
804
805 pub fn by_item(
807 self,
808 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
809 {
810 use gax::paginator::Paginator;
811 self.by_page().items()
812 }
813
814 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
816 self.0.request.name = v.into();
817 self
818 }
819
820 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
822 self.0.request.filter = v.into();
823 self
824 }
825
826 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
828 self.0.request.page_size = v.into();
829 self
830 }
831
832 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
834 self.0.request.page_token = v.into();
835 self
836 }
837 }
838
839 #[doc(hidden)]
840 impl gax::options::internal::RequestBuilder for ListLocations {
841 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
842 &mut self.0.options
843 }
844 }
845
846 #[derive(Clone, Debug)]
864 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
865
866 impl GetLocation {
867 pub(crate) fn new(
868 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
869 ) -> Self {
870 Self(RequestBuilder::new(stub))
871 }
872
873 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
875 self.0.request = v.into();
876 self
877 }
878
879 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
881 self.0.options = v.into();
882 self
883 }
884
885 pub async fn send(self) -> Result<location::model::Location> {
887 (*self.0.stub)
888 .get_location(self.0.request, self.0.options)
889 .await
890 .map(gax::response::Response::into_body)
891 }
892
893 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
895 self.0.request.name = v.into();
896 self
897 }
898 }
899
900 #[doc(hidden)]
901 impl gax::options::internal::RequestBuilder for GetLocation {
902 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
903 &mut self.0.options
904 }
905 }
906
907 #[derive(Clone, Debug)]
929 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
930
931 impl ListOperations {
932 pub(crate) fn new(
933 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
934 ) -> Self {
935 Self(RequestBuilder::new(stub))
936 }
937
938 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
940 mut self,
941 v: V,
942 ) -> Self {
943 self.0.request = v.into();
944 self
945 }
946
947 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
949 self.0.options = v.into();
950 self
951 }
952
953 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
955 (*self.0.stub)
956 .list_operations(self.0.request, self.0.options)
957 .await
958 .map(gax::response::Response::into_body)
959 }
960
961 pub fn by_page(
963 self,
964 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
965 {
966 use std::clone::Clone;
967 let token = self.0.request.page_token.clone();
968 let execute = move |token: String| {
969 let mut builder = self.clone();
970 builder.0.request = builder.0.request.set_page_token(token);
971 builder.send()
972 };
973 gax::paginator::internal::new_paginator(token, execute)
974 }
975
976 pub fn by_item(
978 self,
979 ) -> impl gax::paginator::ItemPaginator<
980 longrunning::model::ListOperationsResponse,
981 gax::error::Error,
982 > {
983 use gax::paginator::Paginator;
984 self.by_page().items()
985 }
986
987 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
989 self.0.request.name = v.into();
990 self
991 }
992
993 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
995 self.0.request.filter = v.into();
996 self
997 }
998
999 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1001 self.0.request.page_size = v.into();
1002 self
1003 }
1004
1005 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1007 self.0.request.page_token = v.into();
1008 self
1009 }
1010
1011 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1013 self.0.request.return_partial_success = v.into();
1014 self
1015 }
1016 }
1017
1018 #[doc(hidden)]
1019 impl gax::options::internal::RequestBuilder for ListOperations {
1020 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1021 &mut self.0.options
1022 }
1023 }
1024
1025 #[derive(Clone, Debug)]
1043 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1044
1045 impl GetOperation {
1046 pub(crate) fn new(
1047 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
1048 ) -> Self {
1049 Self(RequestBuilder::new(stub))
1050 }
1051
1052 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1054 mut self,
1055 v: V,
1056 ) -> Self {
1057 self.0.request = v.into();
1058 self
1059 }
1060
1061 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1063 self.0.options = v.into();
1064 self
1065 }
1066
1067 pub async fn send(self) -> Result<longrunning::model::Operation> {
1069 (*self.0.stub)
1070 .get_operation(self.0.request, self.0.options)
1071 .await
1072 .map(gax::response::Response::into_body)
1073 }
1074
1075 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1077 self.0.request.name = v.into();
1078 self
1079 }
1080 }
1081
1082 #[doc(hidden)]
1083 impl gax::options::internal::RequestBuilder for GetOperation {
1084 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1085 &mut self.0.options
1086 }
1087 }
1088
1089 #[derive(Clone, Debug)]
1107 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1108
1109 impl DeleteOperation {
1110 pub(crate) fn new(
1111 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
1112 ) -> Self {
1113 Self(RequestBuilder::new(stub))
1114 }
1115
1116 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1118 mut self,
1119 v: V,
1120 ) -> Self {
1121 self.0.request = v.into();
1122 self
1123 }
1124
1125 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1127 self.0.options = v.into();
1128 self
1129 }
1130
1131 pub async fn send(self) -> Result<()> {
1133 (*self.0.stub)
1134 .delete_operation(self.0.request, self.0.options)
1135 .await
1136 .map(gax::response::Response::into_body)
1137 }
1138
1139 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1141 self.0.request.name = v.into();
1142 self
1143 }
1144 }
1145
1146 #[doc(hidden)]
1147 impl gax::options::internal::RequestBuilder for DeleteOperation {
1148 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1149 &mut self.0.options
1150 }
1151 }
1152}