google_cloud_datafusion_v1/
builder.rs1pub mod data_fusion {
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::DataFusion;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = DataFusion;
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::DataFusion>,
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::DataFusion>,
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 ListAvailableVersions(RequestBuilder<crate::model::ListAvailableVersionsRequest>);
96
97 impl ListAvailableVersions {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListAvailableVersionsRequest>>(
106 mut self,
107 v: V,
108 ) -> Self {
109 self.0.request = v.into();
110 self
111 }
112
113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
115 self.0.options = v.into();
116 self
117 }
118
119 pub async fn send(self) -> Result<crate::model::ListAvailableVersionsResponse> {
121 (*self.0.stub)
122 .list_available_versions(self.0.request, self.0.options)
123 .await
124 .map(crate::Response::into_body)
125 }
126
127 pub fn by_page(
129 self,
130 ) -> impl google_cloud_gax::paginator::Paginator<
131 crate::model::ListAvailableVersionsResponse,
132 crate::Error,
133 > {
134 use std::clone::Clone;
135 let token = self.0.request.page_token.clone();
136 let execute = move |token: String| {
137 let mut builder = self.clone();
138 builder.0.request = builder.0.request.set_page_token(token);
139 builder.send()
140 };
141 google_cloud_gax::paginator::internal::new_paginator(token, execute)
142 }
143
144 pub fn by_item(
146 self,
147 ) -> impl google_cloud_gax::paginator::ItemPaginator<
148 crate::model::ListAvailableVersionsResponse,
149 crate::Error,
150 > {
151 use google_cloud_gax::paginator::Paginator;
152 self.by_page().items()
153 }
154
155 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
159 self.0.request.parent = v.into();
160 self
161 }
162
163 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
165 self.0.request.page_size = v.into();
166 self
167 }
168
169 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.page_token = v.into();
172 self
173 }
174
175 pub fn set_latest_patch_only<T: Into<bool>>(mut self, v: T) -> Self {
177 self.0.request.latest_patch_only = v.into();
178 self
179 }
180 }
181
182 #[doc(hidden)]
183 impl crate::RequestBuilder for ListAvailableVersions {
184 fn request_options(&mut self) -> &mut crate::RequestOptions {
185 &mut self.0.options
186 }
187 }
188
189 #[derive(Clone, Debug)]
210 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
211
212 impl ListInstances {
213 pub(crate) fn new(
214 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
215 ) -> Self {
216 Self(RequestBuilder::new(stub))
217 }
218
219 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
221 self.0.request = v.into();
222 self
223 }
224
225 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
227 self.0.options = v.into();
228 self
229 }
230
231 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
233 (*self.0.stub)
234 .list_instances(self.0.request, self.0.options)
235 .await
236 .map(crate::Response::into_body)
237 }
238
239 pub fn by_page(
241 self,
242 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListInstancesResponse, crate::Error>
243 {
244 use std::clone::Clone;
245 let token = self.0.request.page_token.clone();
246 let execute = move |token: String| {
247 let mut builder = self.clone();
248 builder.0.request = builder.0.request.set_page_token(token);
249 builder.send()
250 };
251 google_cloud_gax::paginator::internal::new_paginator(token, execute)
252 }
253
254 pub fn by_item(
256 self,
257 ) -> impl google_cloud_gax::paginator::ItemPaginator<
258 crate::model::ListInstancesResponse,
259 crate::Error,
260 > {
261 use google_cloud_gax::paginator::Paginator;
262 self.by_page().items()
263 }
264
265 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
269 self.0.request.parent = v.into();
270 self
271 }
272
273 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
275 self.0.request.page_size = v.into();
276 self
277 }
278
279 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
281 self.0.request.page_token = v.into();
282 self
283 }
284
285 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
287 self.0.request.filter = v.into();
288 self
289 }
290
291 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
293 self.0.request.order_by = v.into();
294 self
295 }
296 }
297
298 #[doc(hidden)]
299 impl crate::RequestBuilder for ListInstances {
300 fn request_options(&mut self) -> &mut crate::RequestOptions {
301 &mut self.0.options
302 }
303 }
304
305 #[derive(Clone, Debug)]
322 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
323
324 impl GetInstance {
325 pub(crate) fn new(
326 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
327 ) -> Self {
328 Self(RequestBuilder::new(stub))
329 }
330
331 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
333 self.0.request = v.into();
334 self
335 }
336
337 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
339 self.0.options = v.into();
340 self
341 }
342
343 pub async fn send(self) -> Result<crate::model::Instance> {
345 (*self.0.stub)
346 .get_instance(self.0.request, self.0.options)
347 .await
348 .map(crate::Response::into_body)
349 }
350
351 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
355 self.0.request.name = v.into();
356 self
357 }
358 }
359
360 #[doc(hidden)]
361 impl crate::RequestBuilder for GetInstance {
362 fn request_options(&mut self) -> &mut crate::RequestOptions {
363 &mut self.0.options
364 }
365 }
366
367 #[derive(Clone, Debug)]
385 pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
386
387 impl CreateInstance {
388 pub(crate) fn new(
389 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
390 ) -> Self {
391 Self(RequestBuilder::new(stub))
392 }
393
394 pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> Self {
396 self.0.request = v.into();
397 self
398 }
399
400 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
402 self.0.options = v.into();
403 self
404 }
405
406 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
413 (*self.0.stub)
414 .create_instance(self.0.request, self.0.options)
415 .await
416 .map(crate::Response::into_body)
417 }
418
419 pub fn poller(
421 self,
422 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
423 {
424 type Operation = google_cloud_lro::internal::Operation<
425 crate::model::Instance,
426 crate::model::OperationMetadata,
427 >;
428 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
429 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
430 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
431 if let Some(ref mut details) = poller_options.tracing {
432 details.method_name =
433 "google_cloud_datafusion_v1::client::DataFusion::create_instance::until_done";
434 }
435
436 let stub = self.0.stub.clone();
437 let mut options = self.0.options.clone();
438 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
439 let query = move |name| {
440 let stub = stub.clone();
441 let options = options.clone();
442 async {
443 let op = GetOperation::new(stub)
444 .set_name(name)
445 .with_options(options)
446 .send()
447 .await?;
448 Ok(Operation::new(op))
449 }
450 };
451
452 let start = move || async {
453 let op = self.send().await?;
454 Ok(Operation::new(op))
455 };
456
457 use google_cloud_lro::internal::PollerExt;
458 {
459 google_cloud_lro::internal::new_poller(
460 polling_error_policy,
461 polling_backoff_policy,
462 start,
463 query,
464 )
465 }
466 .with_options(poller_options)
467 }
468
469 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
473 self.0.request.parent = v.into();
474 self
475 }
476
477 pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
481 self.0.request.instance_id = v.into();
482 self
483 }
484
485 pub fn set_instance<T>(mut self, v: T) -> Self
487 where
488 T: std::convert::Into<crate::model::Instance>,
489 {
490 self.0.request.instance = std::option::Option::Some(v.into());
491 self
492 }
493
494 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
496 where
497 T: std::convert::Into<crate::model::Instance>,
498 {
499 self.0.request.instance = v.map(|x| x.into());
500 self
501 }
502 }
503
504 #[doc(hidden)]
505 impl crate::RequestBuilder for CreateInstance {
506 fn request_options(&mut self) -> &mut crate::RequestOptions {
507 &mut self.0.options
508 }
509 }
510
511 #[derive(Clone, Debug)]
529 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
530
531 impl DeleteInstance {
532 pub(crate) fn new(
533 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
534 ) -> Self {
535 Self(RequestBuilder::new(stub))
536 }
537
538 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
540 self.0.request = v.into();
541 self
542 }
543
544 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
546 self.0.options = v.into();
547 self
548 }
549
550 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
557 (*self.0.stub)
558 .delete_instance(self.0.request, self.0.options)
559 .await
560 .map(crate::Response::into_body)
561 }
562
563 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
565 type Operation =
566 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
567 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
568 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
569 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
570 if let Some(ref mut details) = poller_options.tracing {
571 details.method_name =
572 "google_cloud_datafusion_v1::client::DataFusion::delete_instance::until_done";
573 }
574
575 let stub = self.0.stub.clone();
576 let mut options = self.0.options.clone();
577 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
578 let query = move |name| {
579 let stub = stub.clone();
580 let options = options.clone();
581 async {
582 let op = GetOperation::new(stub)
583 .set_name(name)
584 .with_options(options)
585 .send()
586 .await?;
587 Ok(Operation::new(op))
588 }
589 };
590
591 let start = move || async {
592 let op = self.send().await?;
593 Ok(Operation::new(op))
594 };
595
596 use google_cloud_lro::internal::PollerExt;
597 {
598 google_cloud_lro::internal::new_unit_response_poller(
599 polling_error_policy,
600 polling_backoff_policy,
601 start,
602 query,
603 )
604 }
605 .with_options(poller_options)
606 }
607
608 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
612 self.0.request.name = v.into();
613 self
614 }
615 }
616
617 #[doc(hidden)]
618 impl crate::RequestBuilder for DeleteInstance {
619 fn request_options(&mut self) -> &mut crate::RequestOptions {
620 &mut self.0.options
621 }
622 }
623
624 #[derive(Clone, Debug)]
642 pub struct UpdateInstance(RequestBuilder<crate::model::UpdateInstanceRequest>);
643
644 impl UpdateInstance {
645 pub(crate) fn new(
646 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
647 ) -> Self {
648 Self(RequestBuilder::new(stub))
649 }
650
651 pub fn with_request<V: Into<crate::model::UpdateInstanceRequest>>(mut self, v: V) -> Self {
653 self.0.request = v.into();
654 self
655 }
656
657 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
659 self.0.options = v.into();
660 self
661 }
662
663 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
670 (*self.0.stub)
671 .update_instance(self.0.request, self.0.options)
672 .await
673 .map(crate::Response::into_body)
674 }
675
676 pub fn poller(
678 self,
679 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
680 {
681 type Operation = google_cloud_lro::internal::Operation<
682 crate::model::Instance,
683 crate::model::OperationMetadata,
684 >;
685 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
686 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
687 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
688 if let Some(ref mut details) = poller_options.tracing {
689 details.method_name =
690 "google_cloud_datafusion_v1::client::DataFusion::update_instance::until_done";
691 }
692
693 let stub = self.0.stub.clone();
694 let mut options = self.0.options.clone();
695 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
696 let query = move |name| {
697 let stub = stub.clone();
698 let options = options.clone();
699 async {
700 let op = GetOperation::new(stub)
701 .set_name(name)
702 .with_options(options)
703 .send()
704 .await?;
705 Ok(Operation::new(op))
706 }
707 };
708
709 let start = move || async {
710 let op = self.send().await?;
711 Ok(Operation::new(op))
712 };
713
714 use google_cloud_lro::internal::PollerExt;
715 {
716 google_cloud_lro::internal::new_poller(
717 polling_error_policy,
718 polling_backoff_policy,
719 start,
720 query,
721 )
722 }
723 .with_options(poller_options)
724 }
725
726 pub fn set_instance<T>(mut self, v: T) -> Self
730 where
731 T: std::convert::Into<crate::model::Instance>,
732 {
733 self.0.request.instance = std::option::Option::Some(v.into());
734 self
735 }
736
737 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
741 where
742 T: std::convert::Into<crate::model::Instance>,
743 {
744 self.0.request.instance = v.map(|x| x.into());
745 self
746 }
747
748 pub fn set_update_mask<T>(mut self, v: T) -> Self
750 where
751 T: std::convert::Into<wkt::FieldMask>,
752 {
753 self.0.request.update_mask = std::option::Option::Some(v.into());
754 self
755 }
756
757 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
759 where
760 T: std::convert::Into<wkt::FieldMask>,
761 {
762 self.0.request.update_mask = v.map(|x| x.into());
763 self
764 }
765 }
766
767 #[doc(hidden)]
768 impl crate::RequestBuilder for UpdateInstance {
769 fn request_options(&mut self) -> &mut crate::RequestOptions {
770 &mut self.0.options
771 }
772 }
773
774 #[derive(Clone, Debug)]
792 pub struct RestartInstance(RequestBuilder<crate::model::RestartInstanceRequest>);
793
794 impl RestartInstance {
795 pub(crate) fn new(
796 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
797 ) -> Self {
798 Self(RequestBuilder::new(stub))
799 }
800
801 pub fn with_request<V: Into<crate::model::RestartInstanceRequest>>(mut self, v: V) -> Self {
803 self.0.request = v.into();
804 self
805 }
806
807 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
809 self.0.options = v.into();
810 self
811 }
812
813 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
820 (*self.0.stub)
821 .restart_instance(self.0.request, self.0.options)
822 .await
823 .map(crate::Response::into_body)
824 }
825
826 pub fn poller(
828 self,
829 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
830 {
831 type Operation = google_cloud_lro::internal::Operation<
832 crate::model::Instance,
833 crate::model::OperationMetadata,
834 >;
835 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
836 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
837 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
838 if let Some(ref mut details) = poller_options.tracing {
839 details.method_name =
840 "google_cloud_datafusion_v1::client::DataFusion::restart_instance::until_done";
841 }
842
843 let stub = self.0.stub.clone();
844 let mut options = self.0.options.clone();
845 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
846 let query = move |name| {
847 let stub = stub.clone();
848 let options = options.clone();
849 async {
850 let op = GetOperation::new(stub)
851 .set_name(name)
852 .with_options(options)
853 .send()
854 .await?;
855 Ok(Operation::new(op))
856 }
857 };
858
859 let start = move || async {
860 let op = self.send().await?;
861 Ok(Operation::new(op))
862 };
863
864 use google_cloud_lro::internal::PollerExt;
865 {
866 google_cloud_lro::internal::new_poller(
867 polling_error_policy,
868 polling_backoff_policy,
869 start,
870 query,
871 )
872 }
873 .with_options(poller_options)
874 }
875
876 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
880 self.0.request.name = v.into();
881 self
882 }
883 }
884
885 #[doc(hidden)]
886 impl crate::RequestBuilder for RestartInstance {
887 fn request_options(&mut self) -> &mut crate::RequestOptions {
888 &mut self.0.options
889 }
890 }
891
892 #[derive(Clone, Debug)]
913 pub struct ListOperations(
914 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
915 );
916
917 impl ListOperations {
918 pub(crate) fn new(
919 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
920 ) -> Self {
921 Self(RequestBuilder::new(stub))
922 }
923
924 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
926 mut self,
927 v: V,
928 ) -> Self {
929 self.0.request = v.into();
930 self
931 }
932
933 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
935 self.0.options = v.into();
936 self
937 }
938
939 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
941 (*self.0.stub)
942 .list_operations(self.0.request, self.0.options)
943 .await
944 .map(crate::Response::into_body)
945 }
946
947 pub fn by_page(
949 self,
950 ) -> impl google_cloud_gax::paginator::Paginator<
951 google_cloud_longrunning::model::ListOperationsResponse,
952 crate::Error,
953 > {
954 use std::clone::Clone;
955 let token = self.0.request.page_token.clone();
956 let execute = move |token: String| {
957 let mut builder = self.clone();
958 builder.0.request = builder.0.request.set_page_token(token);
959 builder.send()
960 };
961 google_cloud_gax::paginator::internal::new_paginator(token, execute)
962 }
963
964 pub fn by_item(
966 self,
967 ) -> impl google_cloud_gax::paginator::ItemPaginator<
968 google_cloud_longrunning::model::ListOperationsResponse,
969 crate::Error,
970 > {
971 use google_cloud_gax::paginator::Paginator;
972 self.by_page().items()
973 }
974
975 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
977 self.0.request.name = v.into();
978 self
979 }
980
981 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
983 self.0.request.filter = v.into();
984 self
985 }
986
987 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
989 self.0.request.page_size = v.into();
990 self
991 }
992
993 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
995 self.0.request.page_token = v.into();
996 self
997 }
998
999 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1001 self.0.request.return_partial_success = v.into();
1002 self
1003 }
1004 }
1005
1006 #[doc(hidden)]
1007 impl crate::RequestBuilder for ListOperations {
1008 fn request_options(&mut self) -> &mut crate::RequestOptions {
1009 &mut self.0.options
1010 }
1011 }
1012
1013 #[derive(Clone, Debug)]
1030 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1031
1032 impl GetOperation {
1033 pub(crate) fn new(
1034 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
1035 ) -> Self {
1036 Self(RequestBuilder::new(stub))
1037 }
1038
1039 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1041 mut self,
1042 v: V,
1043 ) -> Self {
1044 self.0.request = v.into();
1045 self
1046 }
1047
1048 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1050 self.0.options = v.into();
1051 self
1052 }
1053
1054 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1056 (*self.0.stub)
1057 .get_operation(self.0.request, self.0.options)
1058 .await
1059 .map(crate::Response::into_body)
1060 }
1061
1062 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1064 self.0.request.name = v.into();
1065 self
1066 }
1067 }
1068
1069 #[doc(hidden)]
1070 impl crate::RequestBuilder for GetOperation {
1071 fn request_options(&mut self) -> &mut crate::RequestOptions {
1072 &mut self.0.options
1073 }
1074 }
1075
1076 #[derive(Clone, Debug)]
1093 pub struct DeleteOperation(
1094 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1095 );
1096
1097 impl DeleteOperation {
1098 pub(crate) fn new(
1099 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
1100 ) -> Self {
1101 Self(RequestBuilder::new(stub))
1102 }
1103
1104 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1106 mut self,
1107 v: V,
1108 ) -> Self {
1109 self.0.request = v.into();
1110 self
1111 }
1112
1113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1115 self.0.options = v.into();
1116 self
1117 }
1118
1119 pub async fn send(self) -> Result<()> {
1121 (*self.0.stub)
1122 .delete_operation(self.0.request, self.0.options)
1123 .await
1124 .map(crate::Response::into_body)
1125 }
1126
1127 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1129 self.0.request.name = v.into();
1130 self
1131 }
1132 }
1133
1134 #[doc(hidden)]
1135 impl crate::RequestBuilder for DeleteOperation {
1136 fn request_options(&mut self) -> &mut crate::RequestOptions {
1137 &mut self.0.options
1138 }
1139 }
1140
1141 #[derive(Clone, Debug)]
1158 pub struct CancelOperation(
1159 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1160 );
1161
1162 impl CancelOperation {
1163 pub(crate) fn new(
1164 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
1165 ) -> Self {
1166 Self(RequestBuilder::new(stub))
1167 }
1168
1169 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1171 mut self,
1172 v: V,
1173 ) -> Self {
1174 self.0.request = v.into();
1175 self
1176 }
1177
1178 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1180 self.0.options = v.into();
1181 self
1182 }
1183
1184 pub async fn send(self) -> Result<()> {
1186 (*self.0.stub)
1187 .cancel_operation(self.0.request, self.0.options)
1188 .await
1189 .map(crate::Response::into_body)
1190 }
1191
1192 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1194 self.0.request.name = v.into();
1195 self
1196 }
1197 }
1198
1199 #[doc(hidden)]
1200 impl crate::RequestBuilder for CancelOperation {
1201 fn request_options(&mut self) -> &mut crate::RequestOptions {
1202 &mut self.0.options
1203 }
1204 }
1205}