google_cloud_datafusion_v1/
builder.rs1pub mod data_fusion {
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::DataFusion;
38 pub struct Factory;
39 impl gax::client_builder::internal::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 ) -> 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::DataFusion>,
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::DataFusion>,
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 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<gax::options::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(gax::response::Response::into_body)
125 }
126
127 pub fn by_page(
129 self,
130 ) -> impl gax::paginator::Paginator<crate::model::ListAvailableVersionsResponse, gax::error::Error>
131 {
132 use std::clone::Clone;
133 let token = self.0.request.page_token.clone();
134 let execute = move |token: String| {
135 let mut builder = self.clone();
136 builder.0.request = builder.0.request.set_page_token(token);
137 builder.send()
138 };
139 gax::paginator::internal::new_paginator(token, execute)
140 }
141
142 pub fn by_item(
144 self,
145 ) -> impl gax::paginator::ItemPaginator<
146 crate::model::ListAvailableVersionsResponse,
147 gax::error::Error,
148 > {
149 use gax::paginator::Paginator;
150 self.by_page().items()
151 }
152
153 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
157 self.0.request.parent = v.into();
158 self
159 }
160
161 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
163 self.0.request.page_size = v.into();
164 self
165 }
166
167 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
169 self.0.request.page_token = v.into();
170 self
171 }
172
173 pub fn set_latest_patch_only<T: Into<bool>>(mut self, v: T) -> Self {
175 self.0.request.latest_patch_only = v.into();
176 self
177 }
178 }
179
180 #[doc(hidden)]
181 impl gax::options::internal::RequestBuilder for ListAvailableVersions {
182 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
183 &mut self.0.options
184 }
185 }
186
187 #[derive(Clone, Debug)]
208 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
209
210 impl ListInstances {
211 pub(crate) fn new(
212 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
213 ) -> Self {
214 Self(RequestBuilder::new(stub))
215 }
216
217 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
219 self.0.request = v.into();
220 self
221 }
222
223 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
225 self.0.options = v.into();
226 self
227 }
228
229 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
231 (*self.0.stub)
232 .list_instances(self.0.request, self.0.options)
233 .await
234 .map(gax::response::Response::into_body)
235 }
236
237 pub fn by_page(
239 self,
240 ) -> impl gax::paginator::Paginator<crate::model::ListInstancesResponse, gax::error::Error>
241 {
242 use std::clone::Clone;
243 let token = self.0.request.page_token.clone();
244 let execute = move |token: String| {
245 let mut builder = self.clone();
246 builder.0.request = builder.0.request.set_page_token(token);
247 builder.send()
248 };
249 gax::paginator::internal::new_paginator(token, execute)
250 }
251
252 pub fn by_item(
254 self,
255 ) -> impl gax::paginator::ItemPaginator<crate::model::ListInstancesResponse, gax::error::Error>
256 {
257 use gax::paginator::Paginator;
258 self.by_page().items()
259 }
260
261 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
265 self.0.request.parent = v.into();
266 self
267 }
268
269 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
271 self.0.request.page_size = v.into();
272 self
273 }
274
275 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
277 self.0.request.page_token = v.into();
278 self
279 }
280
281 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
283 self.0.request.filter = v.into();
284 self
285 }
286
287 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
289 self.0.request.order_by = v.into();
290 self
291 }
292 }
293
294 #[doc(hidden)]
295 impl gax::options::internal::RequestBuilder for ListInstances {
296 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
297 &mut self.0.options
298 }
299 }
300
301 #[derive(Clone, Debug)]
318 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
319
320 impl GetInstance {
321 pub(crate) fn new(
322 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
323 ) -> Self {
324 Self(RequestBuilder::new(stub))
325 }
326
327 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
329 self.0.request = v.into();
330 self
331 }
332
333 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
335 self.0.options = v.into();
336 self
337 }
338
339 pub async fn send(self) -> Result<crate::model::Instance> {
341 (*self.0.stub)
342 .get_instance(self.0.request, self.0.options)
343 .await
344 .map(gax::response::Response::into_body)
345 }
346
347 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
351 self.0.request.name = v.into();
352 self
353 }
354 }
355
356 #[doc(hidden)]
357 impl gax::options::internal::RequestBuilder for GetInstance {
358 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
359 &mut self.0.options
360 }
361 }
362
363 #[derive(Clone, Debug)]
381 pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
382
383 impl CreateInstance {
384 pub(crate) fn new(
385 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
386 ) -> Self {
387 Self(RequestBuilder::new(stub))
388 }
389
390 pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> Self {
392 self.0.request = v.into();
393 self
394 }
395
396 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
398 self.0.options = v.into();
399 self
400 }
401
402 pub async fn send(self) -> Result<longrunning::model::Operation> {
409 (*self.0.stub)
410 .create_instance(self.0.request, self.0.options)
411 .await
412 .map(gax::response::Response::into_body)
413 }
414
415 pub fn poller(
417 self,
418 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
419 type Operation =
420 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
421 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
422 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
423
424 let stub = self.0.stub.clone();
425 let mut options = self.0.options.clone();
426 options.set_retry_policy(gax::retry_policy::NeverRetry);
427 let query = move |name| {
428 let stub = stub.clone();
429 let options = options.clone();
430 async {
431 let op = GetOperation::new(stub)
432 .set_name(name)
433 .with_options(options)
434 .send()
435 .await?;
436 Ok(Operation::new(op))
437 }
438 };
439
440 let start = move || async {
441 let op = self.send().await?;
442 Ok(Operation::new(op))
443 };
444
445 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
446 }
447
448 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
452 self.0.request.parent = v.into();
453 self
454 }
455
456 pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
460 self.0.request.instance_id = v.into();
461 self
462 }
463
464 pub fn set_instance<T>(mut self, v: T) -> Self
466 where
467 T: std::convert::Into<crate::model::Instance>,
468 {
469 self.0.request.instance = std::option::Option::Some(v.into());
470 self
471 }
472
473 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
475 where
476 T: std::convert::Into<crate::model::Instance>,
477 {
478 self.0.request.instance = v.map(|x| x.into());
479 self
480 }
481 }
482
483 #[doc(hidden)]
484 impl gax::options::internal::RequestBuilder for CreateInstance {
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 DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
509
510 impl DeleteInstance {
511 pub(crate) fn new(
512 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
513 ) -> Self {
514 Self(RequestBuilder::new(stub))
515 }
516
517 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(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 .delete_instance(self.0.request, self.0.options)
538 .await
539 .map(gax::response::Response::into_body)
540 }
541
542 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
544 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
545 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
546 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
547
548 let stub = self.0.stub.clone();
549 let mut options = self.0.options.clone();
550 options.set_retry_policy(gax::retry_policy::NeverRetry);
551 let query = move |name| {
552 let stub = stub.clone();
553 let options = options.clone();
554 async {
555 let op = GetOperation::new(stub)
556 .set_name(name)
557 .with_options(options)
558 .send()
559 .await?;
560 Ok(Operation::new(op))
561 }
562 };
563
564 let start = move || async {
565 let op = self.send().await?;
566 Ok(Operation::new(op))
567 };
568
569 lro::internal::new_unit_response_poller(
570 polling_error_policy,
571 polling_backoff_policy,
572 start,
573 query,
574 )
575 }
576
577 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
581 self.0.request.name = v.into();
582 self
583 }
584 }
585
586 #[doc(hidden)]
587 impl gax::options::internal::RequestBuilder for DeleteInstance {
588 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
589 &mut self.0.options
590 }
591 }
592
593 #[derive(Clone, Debug)]
611 pub struct UpdateInstance(RequestBuilder<crate::model::UpdateInstanceRequest>);
612
613 impl UpdateInstance {
614 pub(crate) fn new(
615 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
616 ) -> Self {
617 Self(RequestBuilder::new(stub))
618 }
619
620 pub fn with_request<V: Into<crate::model::UpdateInstanceRequest>>(mut self, v: V) -> Self {
622 self.0.request = v.into();
623 self
624 }
625
626 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
628 self.0.options = v.into();
629 self
630 }
631
632 pub async fn send(self) -> Result<longrunning::model::Operation> {
639 (*self.0.stub)
640 .update_instance(self.0.request, self.0.options)
641 .await
642 .map(gax::response::Response::into_body)
643 }
644
645 pub fn poller(
647 self,
648 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
649 type Operation =
650 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
651 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
652 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
653
654 let stub = self.0.stub.clone();
655 let mut options = self.0.options.clone();
656 options.set_retry_policy(gax::retry_policy::NeverRetry);
657 let query = move |name| {
658 let stub = stub.clone();
659 let options = options.clone();
660 async {
661 let op = GetOperation::new(stub)
662 .set_name(name)
663 .with_options(options)
664 .send()
665 .await?;
666 Ok(Operation::new(op))
667 }
668 };
669
670 let start = move || async {
671 let op = self.send().await?;
672 Ok(Operation::new(op))
673 };
674
675 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
676 }
677
678 pub fn set_instance<T>(mut self, v: T) -> Self
682 where
683 T: std::convert::Into<crate::model::Instance>,
684 {
685 self.0.request.instance = std::option::Option::Some(v.into());
686 self
687 }
688
689 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
693 where
694 T: std::convert::Into<crate::model::Instance>,
695 {
696 self.0.request.instance = v.map(|x| x.into());
697 self
698 }
699
700 pub fn set_update_mask<T>(mut self, v: T) -> Self
702 where
703 T: std::convert::Into<wkt::FieldMask>,
704 {
705 self.0.request.update_mask = std::option::Option::Some(v.into());
706 self
707 }
708
709 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
711 where
712 T: std::convert::Into<wkt::FieldMask>,
713 {
714 self.0.request.update_mask = v.map(|x| x.into());
715 self
716 }
717 }
718
719 #[doc(hidden)]
720 impl gax::options::internal::RequestBuilder for UpdateInstance {
721 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
722 &mut self.0.options
723 }
724 }
725
726 #[derive(Clone, Debug)]
744 pub struct RestartInstance(RequestBuilder<crate::model::RestartInstanceRequest>);
745
746 impl RestartInstance {
747 pub(crate) fn new(
748 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
749 ) -> Self {
750 Self(RequestBuilder::new(stub))
751 }
752
753 pub fn with_request<V: Into<crate::model::RestartInstanceRequest>>(mut self, v: V) -> Self {
755 self.0.request = v.into();
756 self
757 }
758
759 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
761 self.0.options = v.into();
762 self
763 }
764
765 pub async fn send(self) -> Result<longrunning::model::Operation> {
772 (*self.0.stub)
773 .restart_instance(self.0.request, self.0.options)
774 .await
775 .map(gax::response::Response::into_body)
776 }
777
778 pub fn poller(
780 self,
781 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
782 type Operation =
783 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
784 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
785 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
786
787 let stub = self.0.stub.clone();
788 let mut options = self.0.options.clone();
789 options.set_retry_policy(gax::retry_policy::NeverRetry);
790 let query = move |name| {
791 let stub = stub.clone();
792 let options = options.clone();
793 async {
794 let op = GetOperation::new(stub)
795 .set_name(name)
796 .with_options(options)
797 .send()
798 .await?;
799 Ok(Operation::new(op))
800 }
801 };
802
803 let start = move || async {
804 let op = self.send().await?;
805 Ok(Operation::new(op))
806 };
807
808 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
809 }
810
811 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
815 self.0.request.name = v.into();
816 self
817 }
818 }
819
820 #[doc(hidden)]
821 impl gax::options::internal::RequestBuilder for RestartInstance {
822 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
823 &mut self.0.options
824 }
825 }
826
827 #[derive(Clone, Debug)]
848 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
849
850 impl ListOperations {
851 pub(crate) fn new(
852 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
853 ) -> Self {
854 Self(RequestBuilder::new(stub))
855 }
856
857 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
859 mut self,
860 v: V,
861 ) -> Self {
862 self.0.request = v.into();
863 self
864 }
865
866 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
868 self.0.options = v.into();
869 self
870 }
871
872 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
874 (*self.0.stub)
875 .list_operations(self.0.request, self.0.options)
876 .await
877 .map(gax::response::Response::into_body)
878 }
879
880 pub fn by_page(
882 self,
883 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
884 {
885 use std::clone::Clone;
886 let token = self.0.request.page_token.clone();
887 let execute = move |token: String| {
888 let mut builder = self.clone();
889 builder.0.request = builder.0.request.set_page_token(token);
890 builder.send()
891 };
892 gax::paginator::internal::new_paginator(token, execute)
893 }
894
895 pub fn by_item(
897 self,
898 ) -> impl gax::paginator::ItemPaginator<
899 longrunning::model::ListOperationsResponse,
900 gax::error::Error,
901 > {
902 use gax::paginator::Paginator;
903 self.by_page().items()
904 }
905
906 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
908 self.0.request.name = v.into();
909 self
910 }
911
912 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
914 self.0.request.filter = v.into();
915 self
916 }
917
918 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
920 self.0.request.page_size = v.into();
921 self
922 }
923
924 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
926 self.0.request.page_token = v.into();
927 self
928 }
929
930 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
932 self.0.request.return_partial_success = v.into();
933 self
934 }
935 }
936
937 #[doc(hidden)]
938 impl gax::options::internal::RequestBuilder for ListOperations {
939 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
940 &mut self.0.options
941 }
942 }
943
944 #[derive(Clone, Debug)]
961 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
962
963 impl GetOperation {
964 pub(crate) fn new(
965 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
966 ) -> Self {
967 Self(RequestBuilder::new(stub))
968 }
969
970 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
972 mut self,
973 v: V,
974 ) -> Self {
975 self.0.request = v.into();
976 self
977 }
978
979 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
981 self.0.options = v.into();
982 self
983 }
984
985 pub async fn send(self) -> Result<longrunning::model::Operation> {
987 (*self.0.stub)
988 .get_operation(self.0.request, self.0.options)
989 .await
990 .map(gax::response::Response::into_body)
991 }
992
993 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
995 self.0.request.name = v.into();
996 self
997 }
998 }
999
1000 #[doc(hidden)]
1001 impl gax::options::internal::RequestBuilder for GetOperation {
1002 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1003 &mut self.0.options
1004 }
1005 }
1006
1007 #[derive(Clone, Debug)]
1024 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1025
1026 impl DeleteOperation {
1027 pub(crate) fn new(
1028 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
1029 ) -> Self {
1030 Self(RequestBuilder::new(stub))
1031 }
1032
1033 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1035 mut self,
1036 v: V,
1037 ) -> Self {
1038 self.0.request = v.into();
1039 self
1040 }
1041
1042 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1044 self.0.options = v.into();
1045 self
1046 }
1047
1048 pub async fn send(self) -> Result<()> {
1050 (*self.0.stub)
1051 .delete_operation(self.0.request, self.0.options)
1052 .await
1053 .map(gax::response::Response::into_body)
1054 }
1055
1056 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1058 self.0.request.name = v.into();
1059 self
1060 }
1061 }
1062
1063 #[doc(hidden)]
1064 impl gax::options::internal::RequestBuilder for DeleteOperation {
1065 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1066 &mut self.0.options
1067 }
1068 }
1069
1070 #[derive(Clone, Debug)]
1087 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1088
1089 impl CancelOperation {
1090 pub(crate) fn new(
1091 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
1092 ) -> Self {
1093 Self(RequestBuilder::new(stub))
1094 }
1095
1096 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1098 mut self,
1099 v: V,
1100 ) -> Self {
1101 self.0.request = v.into();
1102 self
1103 }
1104
1105 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1107 self.0.options = v.into();
1108 self
1109 }
1110
1111 pub async fn send(self) -> Result<()> {
1113 (*self.0.stub)
1114 .cancel_operation(self.0.request, self.0.options)
1115 .await
1116 .map(gax::response::Response::into_body)
1117 }
1118
1119 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1121 self.0.request.name = v.into();
1122 self
1123 }
1124 }
1125
1126 #[doc(hidden)]
1127 impl gax::options::internal::RequestBuilder for CancelOperation {
1128 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1129 &mut self.0.options
1130 }
1131 }
1132}