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)]
96 pub struct ListAvailableVersions(RequestBuilder<crate::model::ListAvailableVersionsRequest>);
97
98 impl ListAvailableVersions {
99 pub(crate) fn new(
100 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
101 ) -> Self {
102 Self(RequestBuilder::new(stub))
103 }
104
105 pub fn with_request<V: Into<crate::model::ListAvailableVersionsRequest>>(
107 mut self,
108 v: V,
109 ) -> Self {
110 self.0.request = v.into();
111 self
112 }
113
114 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
116 self.0.options = v.into();
117 self
118 }
119
120 pub async fn send(self) -> Result<crate::model::ListAvailableVersionsResponse> {
122 (*self.0.stub)
123 .list_available_versions(self.0.request, self.0.options)
124 .await
125 .map(gax::response::Response::into_body)
126 }
127
128 pub fn by_page(
130 self,
131 ) -> impl gax::paginator::Paginator<crate::model::ListAvailableVersionsResponse, gax::error::Error>
132 {
133 use std::clone::Clone;
134 let token = self.0.request.page_token.clone();
135 let execute = move |token: String| {
136 let mut builder = self.clone();
137 builder.0.request = builder.0.request.set_page_token(token);
138 builder.send()
139 };
140 gax::paginator::internal::new_paginator(token, execute)
141 }
142
143 pub fn by_item(
145 self,
146 ) -> impl gax::paginator::ItemPaginator<
147 crate::model::ListAvailableVersionsResponse,
148 gax::error::Error,
149 > {
150 use gax::paginator::Paginator;
151 self.by_page().items()
152 }
153
154 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
158 self.0.request.parent = v.into();
159 self
160 }
161
162 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
164 self.0.request.page_size = v.into();
165 self
166 }
167
168 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.page_token = v.into();
171 self
172 }
173
174 pub fn set_latest_patch_only<T: Into<bool>>(mut self, v: T) -> Self {
176 self.0.request.latest_patch_only = v.into();
177 self
178 }
179 }
180
181 #[doc(hidden)]
182 impl gax::options::internal::RequestBuilder for ListAvailableVersions {
183 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
184 &mut self.0.options
185 }
186 }
187
188 #[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<gax::options::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(gax::response::Response::into_body)
237 }
238
239 pub fn by_page(
241 self,
242 ) -> impl gax::paginator::Paginator<crate::model::ListInstancesResponse, gax::error::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 gax::paginator::internal::new_paginator(token, execute)
252 }
253
254 pub fn by_item(
256 self,
257 ) -> impl gax::paginator::ItemPaginator<crate::model::ListInstancesResponse, gax::error::Error>
258 {
259 use gax::paginator::Paginator;
260 self.by_page().items()
261 }
262
263 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
267 self.0.request.parent = v.into();
268 self
269 }
270
271 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
273 self.0.request.page_size = v.into();
274 self
275 }
276
277 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
279 self.0.request.page_token = v.into();
280 self
281 }
282
283 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
285 self.0.request.filter = v.into();
286 self
287 }
288
289 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
291 self.0.request.order_by = v.into();
292 self
293 }
294 }
295
296 #[doc(hidden)]
297 impl gax::options::internal::RequestBuilder for ListInstances {
298 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
299 &mut self.0.options
300 }
301 }
302
303 #[derive(Clone, Debug)]
321 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
322
323 impl GetInstance {
324 pub(crate) fn new(
325 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
326 ) -> Self {
327 Self(RequestBuilder::new(stub))
328 }
329
330 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
332 self.0.request = v.into();
333 self
334 }
335
336 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
338 self.0.options = v.into();
339 self
340 }
341
342 pub async fn send(self) -> Result<crate::model::Instance> {
344 (*self.0.stub)
345 .get_instance(self.0.request, self.0.options)
346 .await
347 .map(gax::response::Response::into_body)
348 }
349
350 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
354 self.0.request.name = v.into();
355 self
356 }
357 }
358
359 #[doc(hidden)]
360 impl gax::options::internal::RequestBuilder for GetInstance {
361 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
362 &mut self.0.options
363 }
364 }
365
366 #[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<gax::options::RequestOptions>>(mut self, v: V) -> Self {
402 self.0.options = v.into();
403 self
404 }
405
406 pub async fn send(self) -> Result<longrunning::model::Operation> {
413 (*self.0.stub)
414 .create_instance(self.0.request, self.0.options)
415 .await
416 .map(gax::response::Response::into_body)
417 }
418
419 pub fn poller(
421 self,
422 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
423 type Operation =
424 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
425 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
426 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
427
428 let stub = self.0.stub.clone();
429 let mut options = self.0.options.clone();
430 options.set_retry_policy(gax::retry_policy::NeverRetry);
431 let query = move |name| {
432 let stub = stub.clone();
433 let options = options.clone();
434 async {
435 let op = GetOperation::new(stub)
436 .set_name(name)
437 .with_options(options)
438 .send()
439 .await?;
440 Ok(Operation::new(op))
441 }
442 };
443
444 let start = move || async {
445 let op = self.send().await?;
446 Ok(Operation::new(op))
447 };
448
449 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
450 }
451
452 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
456 self.0.request.parent = v.into();
457 self
458 }
459
460 pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
464 self.0.request.instance_id = v.into();
465 self
466 }
467
468 pub fn set_instance<T>(mut self, v: T) -> Self
470 where
471 T: std::convert::Into<crate::model::Instance>,
472 {
473 self.0.request.instance = std::option::Option::Some(v.into());
474 self
475 }
476
477 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
479 where
480 T: std::convert::Into<crate::model::Instance>,
481 {
482 self.0.request.instance = v.map(|x| x.into());
483 self
484 }
485 }
486
487 #[doc(hidden)]
488 impl gax::options::internal::RequestBuilder for CreateInstance {
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 DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
514
515 impl DeleteInstance {
516 pub(crate) fn new(
517 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
518 ) -> Self {
519 Self(RequestBuilder::new(stub))
520 }
521
522 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(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 .delete_instance(self.0.request, self.0.options)
543 .await
544 .map(gax::response::Response::into_body)
545 }
546
547 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
549 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
550 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
551 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
552
553 let stub = self.0.stub.clone();
554 let mut options = self.0.options.clone();
555 options.set_retry_policy(gax::retry_policy::NeverRetry);
556 let query = move |name| {
557 let stub = stub.clone();
558 let options = options.clone();
559 async {
560 let op = GetOperation::new(stub)
561 .set_name(name)
562 .with_options(options)
563 .send()
564 .await?;
565 Ok(Operation::new(op))
566 }
567 };
568
569 let start = move || async {
570 let op = self.send().await?;
571 Ok(Operation::new(op))
572 };
573
574 lro::internal::new_unit_response_poller(
575 polling_error_policy,
576 polling_backoff_policy,
577 start,
578 query,
579 )
580 }
581
582 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
586 self.0.request.name = v.into();
587 self
588 }
589 }
590
591 #[doc(hidden)]
592 impl gax::options::internal::RequestBuilder for DeleteInstance {
593 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
594 &mut self.0.options
595 }
596 }
597
598 #[derive(Clone, Debug)]
617 pub struct UpdateInstance(RequestBuilder<crate::model::UpdateInstanceRequest>);
618
619 impl UpdateInstance {
620 pub(crate) fn new(
621 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
622 ) -> Self {
623 Self(RequestBuilder::new(stub))
624 }
625
626 pub fn with_request<V: Into<crate::model::UpdateInstanceRequest>>(mut self, v: V) -> Self {
628 self.0.request = v.into();
629 self
630 }
631
632 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
634 self.0.options = v.into();
635 self
636 }
637
638 pub async fn send(self) -> Result<longrunning::model::Operation> {
645 (*self.0.stub)
646 .update_instance(self.0.request, self.0.options)
647 .await
648 .map(gax::response::Response::into_body)
649 }
650
651 pub fn poller(
653 self,
654 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
655 type Operation =
656 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
657 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
658 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
659
660 let stub = self.0.stub.clone();
661 let mut options = self.0.options.clone();
662 options.set_retry_policy(gax::retry_policy::NeverRetry);
663 let query = move |name| {
664 let stub = stub.clone();
665 let options = options.clone();
666 async {
667 let op = GetOperation::new(stub)
668 .set_name(name)
669 .with_options(options)
670 .send()
671 .await?;
672 Ok(Operation::new(op))
673 }
674 };
675
676 let start = move || async {
677 let op = self.send().await?;
678 Ok(Operation::new(op))
679 };
680
681 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
682 }
683
684 pub fn set_instance<T>(mut self, v: T) -> Self
688 where
689 T: std::convert::Into<crate::model::Instance>,
690 {
691 self.0.request.instance = std::option::Option::Some(v.into());
692 self
693 }
694
695 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
699 where
700 T: std::convert::Into<crate::model::Instance>,
701 {
702 self.0.request.instance = v.map(|x| x.into());
703 self
704 }
705
706 pub fn set_update_mask<T>(mut self, v: T) -> Self
708 where
709 T: std::convert::Into<wkt::FieldMask>,
710 {
711 self.0.request.update_mask = std::option::Option::Some(v.into());
712 self
713 }
714
715 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
717 where
718 T: std::convert::Into<wkt::FieldMask>,
719 {
720 self.0.request.update_mask = v.map(|x| x.into());
721 self
722 }
723 }
724
725 #[doc(hidden)]
726 impl gax::options::internal::RequestBuilder for UpdateInstance {
727 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
728 &mut self.0.options
729 }
730 }
731
732 #[derive(Clone, Debug)]
751 pub struct RestartInstance(RequestBuilder<crate::model::RestartInstanceRequest>);
752
753 impl RestartInstance {
754 pub(crate) fn new(
755 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
756 ) -> Self {
757 Self(RequestBuilder::new(stub))
758 }
759
760 pub fn with_request<V: Into<crate::model::RestartInstanceRequest>>(mut self, v: V) -> Self {
762 self.0.request = v.into();
763 self
764 }
765
766 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
768 self.0.options = v.into();
769 self
770 }
771
772 pub async fn send(self) -> Result<longrunning::model::Operation> {
779 (*self.0.stub)
780 .restart_instance(self.0.request, self.0.options)
781 .await
782 .map(gax::response::Response::into_body)
783 }
784
785 pub fn poller(
787 self,
788 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
789 type Operation =
790 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
791 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
792 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
793
794 let stub = self.0.stub.clone();
795 let mut options = self.0.options.clone();
796 options.set_retry_policy(gax::retry_policy::NeverRetry);
797 let query = move |name| {
798 let stub = stub.clone();
799 let options = options.clone();
800 async {
801 let op = GetOperation::new(stub)
802 .set_name(name)
803 .with_options(options)
804 .send()
805 .await?;
806 Ok(Operation::new(op))
807 }
808 };
809
810 let start = move || async {
811 let op = self.send().await?;
812 Ok(Operation::new(op))
813 };
814
815 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
816 }
817
818 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
822 self.0.request.name = v.into();
823 self
824 }
825 }
826
827 #[doc(hidden)]
828 impl gax::options::internal::RequestBuilder for RestartInstance {
829 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
830 &mut self.0.options
831 }
832 }
833
834 #[derive(Clone, Debug)]
856 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
857
858 impl ListOperations {
859 pub(crate) fn new(
860 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
861 ) -> Self {
862 Self(RequestBuilder::new(stub))
863 }
864
865 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
867 mut self,
868 v: V,
869 ) -> Self {
870 self.0.request = v.into();
871 self
872 }
873
874 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
876 self.0.options = v.into();
877 self
878 }
879
880 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
882 (*self.0.stub)
883 .list_operations(self.0.request, self.0.options)
884 .await
885 .map(gax::response::Response::into_body)
886 }
887
888 pub fn by_page(
890 self,
891 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
892 {
893 use std::clone::Clone;
894 let token = self.0.request.page_token.clone();
895 let execute = move |token: String| {
896 let mut builder = self.clone();
897 builder.0.request = builder.0.request.set_page_token(token);
898 builder.send()
899 };
900 gax::paginator::internal::new_paginator(token, execute)
901 }
902
903 pub fn by_item(
905 self,
906 ) -> impl gax::paginator::ItemPaginator<
907 longrunning::model::ListOperationsResponse,
908 gax::error::Error,
909 > {
910 use gax::paginator::Paginator;
911 self.by_page().items()
912 }
913
914 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
916 self.0.request.name = v.into();
917 self
918 }
919
920 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
922 self.0.request.filter = v.into();
923 self
924 }
925
926 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
928 self.0.request.page_size = v.into();
929 self
930 }
931
932 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
934 self.0.request.page_token = v.into();
935 self
936 }
937
938 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
940 self.0.request.return_partial_success = v.into();
941 self
942 }
943 }
944
945 #[doc(hidden)]
946 impl gax::options::internal::RequestBuilder for ListOperations {
947 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
948 &mut self.0.options
949 }
950 }
951
952 #[derive(Clone, Debug)]
970 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
971
972 impl GetOperation {
973 pub(crate) fn new(
974 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
975 ) -> Self {
976 Self(RequestBuilder::new(stub))
977 }
978
979 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
981 mut self,
982 v: V,
983 ) -> Self {
984 self.0.request = v.into();
985 self
986 }
987
988 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
990 self.0.options = v.into();
991 self
992 }
993
994 pub async fn send(self) -> Result<longrunning::model::Operation> {
996 (*self.0.stub)
997 .get_operation(self.0.request, self.0.options)
998 .await
999 .map(gax::response::Response::into_body)
1000 }
1001
1002 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1004 self.0.request.name = v.into();
1005 self
1006 }
1007 }
1008
1009 #[doc(hidden)]
1010 impl gax::options::internal::RequestBuilder for GetOperation {
1011 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1012 &mut self.0.options
1013 }
1014 }
1015
1016 #[derive(Clone, Debug)]
1034 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1035
1036 impl DeleteOperation {
1037 pub(crate) fn new(
1038 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
1039 ) -> Self {
1040 Self(RequestBuilder::new(stub))
1041 }
1042
1043 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1045 mut self,
1046 v: V,
1047 ) -> Self {
1048 self.0.request = v.into();
1049 self
1050 }
1051
1052 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1054 self.0.options = v.into();
1055 self
1056 }
1057
1058 pub async fn send(self) -> Result<()> {
1060 (*self.0.stub)
1061 .delete_operation(self.0.request, self.0.options)
1062 .await
1063 .map(gax::response::Response::into_body)
1064 }
1065
1066 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1068 self.0.request.name = v.into();
1069 self
1070 }
1071 }
1072
1073 #[doc(hidden)]
1074 impl gax::options::internal::RequestBuilder for DeleteOperation {
1075 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1076 &mut self.0.options
1077 }
1078 }
1079
1080 #[derive(Clone, Debug)]
1098 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1099
1100 impl CancelOperation {
1101 pub(crate) fn new(
1102 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataFusion>,
1103 ) -> Self {
1104 Self(RequestBuilder::new(stub))
1105 }
1106
1107 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1109 mut self,
1110 v: V,
1111 ) -> Self {
1112 self.0.request = v.into();
1113 self
1114 }
1115
1116 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1118 self.0.options = v.into();
1119 self
1120 }
1121
1122 pub async fn send(self) -> Result<()> {
1124 (*self.0.stub)
1125 .cancel_operation(self.0.request, self.0.options)
1126 .await
1127 .map(gax::response::Response::into_body)
1128 }
1129
1130 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1132 self.0.request.name = v.into();
1133 self
1134 }
1135 }
1136
1137 #[doc(hidden)]
1138 impl gax::options::internal::RequestBuilder for CancelOperation {
1139 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1140 &mut self.0.options
1141 }
1142 }
1143}