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)]
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<gax::options::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(gax::response::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl gax::paginator::Paginator<crate::model::ListWorkflowsResponse, gax::error::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 gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl gax::paginator::ItemPaginator<crate::model::ListWorkflowsResponse, gax::error::Error>
143 {
144 use gax::paginator::Paginator;
145 self.by_page().items()
146 }
147
148 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
152 self.0.request.parent = v.into();
153 self
154 }
155
156 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
158 self.0.request.page_size = v.into();
159 self
160 }
161
162 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
164 self.0.request.page_token = v.into();
165 self
166 }
167
168 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.filter = v.into();
171 self
172 }
173
174 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
176 self.0.request.order_by = v.into();
177 self
178 }
179 }
180
181 #[doc(hidden)]
182 impl gax::options::internal::RequestBuilder for ListWorkflows {
183 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
184 &mut self.0.options
185 }
186 }
187
188 #[derive(Clone, Debug)]
205 pub struct GetWorkflow(RequestBuilder<crate::model::GetWorkflowRequest>);
206
207 impl GetWorkflow {
208 pub(crate) fn new(
209 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
210 ) -> Self {
211 Self(RequestBuilder::new(stub))
212 }
213
214 pub fn with_request<V: Into<crate::model::GetWorkflowRequest>>(mut self, v: V) -> Self {
216 self.0.request = v.into();
217 self
218 }
219
220 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
222 self.0.options = v.into();
223 self
224 }
225
226 pub async fn send(self) -> Result<crate::model::Workflow> {
228 (*self.0.stub)
229 .get_workflow(self.0.request, self.0.options)
230 .await
231 .map(gax::response::Response::into_body)
232 }
233
234 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
238 self.0.request.name = v.into();
239 self
240 }
241
242 pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
244 self.0.request.revision_id = v.into();
245 self
246 }
247 }
248
249 #[doc(hidden)]
250 impl gax::options::internal::RequestBuilder for GetWorkflow {
251 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
252 &mut self.0.options
253 }
254 }
255
256 #[derive(Clone, Debug)]
274 pub struct CreateWorkflow(RequestBuilder<crate::model::CreateWorkflowRequest>);
275
276 impl CreateWorkflow {
277 pub(crate) fn new(
278 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
279 ) -> Self {
280 Self(RequestBuilder::new(stub))
281 }
282
283 pub fn with_request<V: Into<crate::model::CreateWorkflowRequest>>(mut self, v: V) -> Self {
285 self.0.request = v.into();
286 self
287 }
288
289 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
291 self.0.options = v.into();
292 self
293 }
294
295 pub async fn send(self) -> Result<longrunning::model::Operation> {
302 (*self.0.stub)
303 .create_workflow(self.0.request, self.0.options)
304 .await
305 .map(gax::response::Response::into_body)
306 }
307
308 pub fn poller(
310 self,
311 ) -> impl lro::Poller<crate::model::Workflow, crate::model::OperationMetadata> {
312 type Operation =
313 lro::internal::Operation<crate::model::Workflow, crate::model::OperationMetadata>;
314 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
315 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
316
317 let stub = self.0.stub.clone();
318 let mut options = self.0.options.clone();
319 options.set_retry_policy(gax::retry_policy::NeverRetry);
320 let query = move |name| {
321 let stub = stub.clone();
322 let options = options.clone();
323 async {
324 let op = GetOperation::new(stub)
325 .set_name(name)
326 .with_options(options)
327 .send()
328 .await?;
329 Ok(Operation::new(op))
330 }
331 };
332
333 let start = move || async {
334 let op = self.send().await?;
335 Ok(Operation::new(op))
336 };
337
338 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
339 }
340
341 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
345 self.0.request.parent = v.into();
346 self
347 }
348
349 pub fn set_workflow<T>(mut self, v: T) -> Self
353 where
354 T: std::convert::Into<crate::model::Workflow>,
355 {
356 self.0.request.workflow = std::option::Option::Some(v.into());
357 self
358 }
359
360 pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
364 where
365 T: std::convert::Into<crate::model::Workflow>,
366 {
367 self.0.request.workflow = v.map(|x| x.into());
368 self
369 }
370
371 pub fn set_workflow_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
375 self.0.request.workflow_id = v.into();
376 self
377 }
378 }
379
380 #[doc(hidden)]
381 impl gax::options::internal::RequestBuilder for CreateWorkflow {
382 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
383 &mut self.0.options
384 }
385 }
386
387 #[derive(Clone, Debug)]
405 pub struct DeleteWorkflow(RequestBuilder<crate::model::DeleteWorkflowRequest>);
406
407 impl DeleteWorkflow {
408 pub(crate) fn new(
409 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
410 ) -> Self {
411 Self(RequestBuilder::new(stub))
412 }
413
414 pub fn with_request<V: Into<crate::model::DeleteWorkflowRequest>>(mut self, v: V) -> Self {
416 self.0.request = v.into();
417 self
418 }
419
420 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
422 self.0.options = v.into();
423 self
424 }
425
426 pub async fn send(self) -> Result<longrunning::model::Operation> {
433 (*self.0.stub)
434 .delete_workflow(self.0.request, self.0.options)
435 .await
436 .map(gax::response::Response::into_body)
437 }
438
439 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
441 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
442 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
443 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
444
445 let stub = self.0.stub.clone();
446 let mut options = self.0.options.clone();
447 options.set_retry_policy(gax::retry_policy::NeverRetry);
448 let query = move |name| {
449 let stub = stub.clone();
450 let options = options.clone();
451 async {
452 let op = GetOperation::new(stub)
453 .set_name(name)
454 .with_options(options)
455 .send()
456 .await?;
457 Ok(Operation::new(op))
458 }
459 };
460
461 let start = move || async {
462 let op = self.send().await?;
463 Ok(Operation::new(op))
464 };
465
466 lro::internal::new_unit_response_poller(
467 polling_error_policy,
468 polling_backoff_policy,
469 start,
470 query,
471 )
472 }
473
474 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
478 self.0.request.name = v.into();
479 self
480 }
481 }
482
483 #[doc(hidden)]
484 impl gax::options::internal::RequestBuilder for DeleteWorkflow {
485 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
486 &mut self.0.options
487 }
488 }
489
490 #[derive(Clone, Debug)]
508 pub struct UpdateWorkflow(RequestBuilder<crate::model::UpdateWorkflowRequest>);
509
510 impl UpdateWorkflow {
511 pub(crate) fn new(
512 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
513 ) -> Self {
514 Self(RequestBuilder::new(stub))
515 }
516
517 pub fn with_request<V: Into<crate::model::UpdateWorkflowRequest>>(mut self, v: V) -> Self {
519 self.0.request = v.into();
520 self
521 }
522
523 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
525 self.0.options = v.into();
526 self
527 }
528
529 pub async fn send(self) -> Result<longrunning::model::Operation> {
536 (*self.0.stub)
537 .update_workflow(self.0.request, self.0.options)
538 .await
539 .map(gax::response::Response::into_body)
540 }
541
542 pub fn poller(
544 self,
545 ) -> impl lro::Poller<crate::model::Workflow, crate::model::OperationMetadata> {
546 type Operation =
547 lro::internal::Operation<crate::model::Workflow, crate::model::OperationMetadata>;
548 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
549 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
550
551 let stub = self.0.stub.clone();
552 let mut options = self.0.options.clone();
553 options.set_retry_policy(gax::retry_policy::NeverRetry);
554 let query = move |name| {
555 let stub = stub.clone();
556 let options = options.clone();
557 async {
558 let op = GetOperation::new(stub)
559 .set_name(name)
560 .with_options(options)
561 .send()
562 .await?;
563 Ok(Operation::new(op))
564 }
565 };
566
567 let start = move || async {
568 let op = self.send().await?;
569 Ok(Operation::new(op))
570 };
571
572 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
573 }
574
575 pub fn set_workflow<T>(mut self, v: T) -> Self
579 where
580 T: std::convert::Into<crate::model::Workflow>,
581 {
582 self.0.request.workflow = std::option::Option::Some(v.into());
583 self
584 }
585
586 pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
590 where
591 T: std::convert::Into<crate::model::Workflow>,
592 {
593 self.0.request.workflow = v.map(|x| x.into());
594 self
595 }
596
597 pub fn set_update_mask<T>(mut self, v: T) -> Self
599 where
600 T: std::convert::Into<wkt::FieldMask>,
601 {
602 self.0.request.update_mask = std::option::Option::Some(v.into());
603 self
604 }
605
606 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
608 where
609 T: std::convert::Into<wkt::FieldMask>,
610 {
611 self.0.request.update_mask = v.map(|x| x.into());
612 self
613 }
614 }
615
616 #[doc(hidden)]
617 impl gax::options::internal::RequestBuilder for UpdateWorkflow {
618 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
619 &mut self.0.options
620 }
621 }
622
623 #[derive(Clone, Debug)]
644 pub struct ListWorkflowRevisions(RequestBuilder<crate::model::ListWorkflowRevisionsRequest>);
645
646 impl ListWorkflowRevisions {
647 pub(crate) fn new(
648 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
649 ) -> Self {
650 Self(RequestBuilder::new(stub))
651 }
652
653 pub fn with_request<V: Into<crate::model::ListWorkflowRevisionsRequest>>(
655 mut self,
656 v: V,
657 ) -> Self {
658 self.0.request = v.into();
659 self
660 }
661
662 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
664 self.0.options = v.into();
665 self
666 }
667
668 pub async fn send(self) -> Result<crate::model::ListWorkflowRevisionsResponse> {
670 (*self.0.stub)
671 .list_workflow_revisions(self.0.request, self.0.options)
672 .await
673 .map(gax::response::Response::into_body)
674 }
675
676 pub fn by_page(
678 self,
679 ) -> impl gax::paginator::Paginator<crate::model::ListWorkflowRevisionsResponse, gax::error::Error>
680 {
681 use std::clone::Clone;
682 let token = self.0.request.page_token.clone();
683 let execute = move |token: String| {
684 let mut builder = self.clone();
685 builder.0.request = builder.0.request.set_page_token(token);
686 builder.send()
687 };
688 gax::paginator::internal::new_paginator(token, execute)
689 }
690
691 pub fn by_item(
693 self,
694 ) -> impl gax::paginator::ItemPaginator<
695 crate::model::ListWorkflowRevisionsResponse,
696 gax::error::Error,
697 > {
698 use gax::paginator::Paginator;
699 self.by_page().items()
700 }
701
702 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
706 self.0.request.name = v.into();
707 self
708 }
709
710 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
712 self.0.request.page_size = v.into();
713 self
714 }
715
716 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
718 self.0.request.page_token = v.into();
719 self
720 }
721 }
722
723 #[doc(hidden)]
724 impl gax::options::internal::RequestBuilder for ListWorkflowRevisions {
725 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
726 &mut self.0.options
727 }
728 }
729
730 #[derive(Clone, Debug)]
751 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
752
753 impl ListLocations {
754 pub(crate) fn new(
755 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
756 ) -> Self {
757 Self(RequestBuilder::new(stub))
758 }
759
760 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
762 mut self,
763 v: V,
764 ) -> Self {
765 self.0.request = v.into();
766 self
767 }
768
769 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
771 self.0.options = v.into();
772 self
773 }
774
775 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
777 (*self.0.stub)
778 .list_locations(self.0.request, self.0.options)
779 .await
780 .map(gax::response::Response::into_body)
781 }
782
783 pub fn by_page(
785 self,
786 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
787 {
788 use std::clone::Clone;
789 let token = self.0.request.page_token.clone();
790 let execute = move |token: String| {
791 let mut builder = self.clone();
792 builder.0.request = builder.0.request.set_page_token(token);
793 builder.send()
794 };
795 gax::paginator::internal::new_paginator(token, execute)
796 }
797
798 pub fn by_item(
800 self,
801 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
802 {
803 use gax::paginator::Paginator;
804 self.by_page().items()
805 }
806
807 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
809 self.0.request.name = v.into();
810 self
811 }
812
813 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
815 self.0.request.filter = v.into();
816 self
817 }
818
819 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
821 self.0.request.page_size = v.into();
822 self
823 }
824
825 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
827 self.0.request.page_token = v.into();
828 self
829 }
830 }
831
832 #[doc(hidden)]
833 impl gax::options::internal::RequestBuilder for ListLocations {
834 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
835 &mut self.0.options
836 }
837 }
838
839 #[derive(Clone, Debug)]
856 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
857
858 impl GetLocation {
859 pub(crate) fn new(
860 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
861 ) -> Self {
862 Self(RequestBuilder::new(stub))
863 }
864
865 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
867 self.0.request = v.into();
868 self
869 }
870
871 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
873 self.0.options = v.into();
874 self
875 }
876
877 pub async fn send(self) -> Result<location::model::Location> {
879 (*self.0.stub)
880 .get_location(self.0.request, self.0.options)
881 .await
882 .map(gax::response::Response::into_body)
883 }
884
885 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
887 self.0.request.name = v.into();
888 self
889 }
890 }
891
892 #[doc(hidden)]
893 impl gax::options::internal::RequestBuilder for GetLocation {
894 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
895 &mut self.0.options
896 }
897 }
898
899 #[derive(Clone, Debug)]
920 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
921
922 impl ListOperations {
923 pub(crate) fn new(
924 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
925 ) -> Self {
926 Self(RequestBuilder::new(stub))
927 }
928
929 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
931 mut self,
932 v: V,
933 ) -> Self {
934 self.0.request = v.into();
935 self
936 }
937
938 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
940 self.0.options = v.into();
941 self
942 }
943
944 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
946 (*self.0.stub)
947 .list_operations(self.0.request, self.0.options)
948 .await
949 .map(gax::response::Response::into_body)
950 }
951
952 pub fn by_page(
954 self,
955 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
956 {
957 use std::clone::Clone;
958 let token = self.0.request.page_token.clone();
959 let execute = move |token: String| {
960 let mut builder = self.clone();
961 builder.0.request = builder.0.request.set_page_token(token);
962 builder.send()
963 };
964 gax::paginator::internal::new_paginator(token, execute)
965 }
966
967 pub fn by_item(
969 self,
970 ) -> impl gax::paginator::ItemPaginator<
971 longrunning::model::ListOperationsResponse,
972 gax::error::Error,
973 > {
974 use gax::paginator::Paginator;
975 self.by_page().items()
976 }
977
978 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
980 self.0.request.name = v.into();
981 self
982 }
983
984 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
986 self.0.request.filter = v.into();
987 self
988 }
989
990 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
992 self.0.request.page_size = v.into();
993 self
994 }
995
996 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
998 self.0.request.page_token = v.into();
999 self
1000 }
1001
1002 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1004 self.0.request.return_partial_success = v.into();
1005 self
1006 }
1007 }
1008
1009 #[doc(hidden)]
1010 impl gax::options::internal::RequestBuilder for ListOperations {
1011 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1012 &mut self.0.options
1013 }
1014 }
1015
1016 #[derive(Clone, Debug)]
1033 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1034
1035 impl GetOperation {
1036 pub(crate) fn new(
1037 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
1038 ) -> Self {
1039 Self(RequestBuilder::new(stub))
1040 }
1041
1042 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1044 mut self,
1045 v: V,
1046 ) -> Self {
1047 self.0.request = v.into();
1048 self
1049 }
1050
1051 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1053 self.0.options = v.into();
1054 self
1055 }
1056
1057 pub async fn send(self) -> Result<longrunning::model::Operation> {
1059 (*self.0.stub)
1060 .get_operation(self.0.request, self.0.options)
1061 .await
1062 .map(gax::response::Response::into_body)
1063 }
1064
1065 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1067 self.0.request.name = v.into();
1068 self
1069 }
1070 }
1071
1072 #[doc(hidden)]
1073 impl gax::options::internal::RequestBuilder for GetOperation {
1074 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1075 &mut self.0.options
1076 }
1077 }
1078
1079 #[derive(Clone, Debug)]
1096 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1097
1098 impl DeleteOperation {
1099 pub(crate) fn new(
1100 stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
1101 ) -> Self {
1102 Self(RequestBuilder::new(stub))
1103 }
1104
1105 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1107 mut self,
1108 v: V,
1109 ) -> Self {
1110 self.0.request = v.into();
1111 self
1112 }
1113
1114 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1116 self.0.options = v.into();
1117 self
1118 }
1119
1120 pub async fn send(self) -> Result<()> {
1122 (*self.0.stub)
1123 .delete_operation(self.0.request, self.0.options)
1124 .await
1125 .map(gax::response::Response::into_body)
1126 }
1127
1128 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1130 self.0.request.name = v.into();
1131 self
1132 }
1133 }
1134
1135 #[doc(hidden)]
1136 impl gax::options::internal::RequestBuilder for DeleteOperation {
1137 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1138 &mut self.0.options
1139 }
1140 }
1141}