google_cloud_blockchainnodeengine_v1/
builder.rs1pub mod blockchain_node_engine {
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::BlockchainNodeEngine;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = BlockchainNodeEngine;
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::BlockchainNodeEngine>,
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::BlockchainNodeEngine>,
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 ListBlockchainNodes(RequestBuilder<crate::model::ListBlockchainNodesRequest>);
96
97 impl ListBlockchainNodes {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListBlockchainNodesRequest>>(
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::ListBlockchainNodesResponse> {
121 (*self.0.stub)
122 .list_blockchain_nodes(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::ListBlockchainNodesResponse,
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::ListBlockchainNodesResponse,
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_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
177 self.0.request.filter = v.into();
178 self
179 }
180
181 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
183 self.0.request.order_by = v.into();
184 self
185 }
186 }
187
188 #[doc(hidden)]
189 impl crate::RequestBuilder for ListBlockchainNodes {
190 fn request_options(&mut self) -> &mut crate::RequestOptions {
191 &mut self.0.options
192 }
193 }
194
195 #[derive(Clone, Debug)]
212 pub struct GetBlockchainNode(RequestBuilder<crate::model::GetBlockchainNodeRequest>);
213
214 impl GetBlockchainNode {
215 pub(crate) fn new(
216 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
217 ) -> Self {
218 Self(RequestBuilder::new(stub))
219 }
220
221 pub fn with_request<V: Into<crate::model::GetBlockchainNodeRequest>>(
223 mut self,
224 v: V,
225 ) -> Self {
226 self.0.request = v.into();
227 self
228 }
229
230 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
232 self.0.options = v.into();
233 self
234 }
235
236 pub async fn send(self) -> Result<crate::model::BlockchainNode> {
238 (*self.0.stub)
239 .get_blockchain_node(self.0.request, self.0.options)
240 .await
241 .map(crate::Response::into_body)
242 }
243
244 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
248 self.0.request.name = v.into();
249 self
250 }
251 }
252
253 #[doc(hidden)]
254 impl crate::RequestBuilder for GetBlockchainNode {
255 fn request_options(&mut self) -> &mut crate::RequestOptions {
256 &mut self.0.options
257 }
258 }
259
260 #[derive(Clone, Debug)]
278 pub struct CreateBlockchainNode(RequestBuilder<crate::model::CreateBlockchainNodeRequest>);
279
280 impl CreateBlockchainNode {
281 pub(crate) fn new(
282 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
283 ) -> Self {
284 Self(RequestBuilder::new(stub))
285 }
286
287 pub fn with_request<V: Into<crate::model::CreateBlockchainNodeRequest>>(
289 mut self,
290 v: V,
291 ) -> Self {
292 self.0.request = v.into();
293 self
294 }
295
296 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
298 self.0.options = v.into();
299 self
300 }
301
302 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
309 (*self.0.stub)
310 .create_blockchain_node(self.0.request, self.0.options)
311 .await
312 .map(crate::Response::into_body)
313 }
314
315 pub fn poller(
317 self,
318 ) -> impl google_cloud_lro::Poller<crate::model::BlockchainNode, crate::model::OperationMetadata>
319 {
320 type Operation = google_cloud_lro::internal::Operation<
321 crate::model::BlockchainNode,
322 crate::model::OperationMetadata,
323 >;
324 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
325 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
326 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
327 if let Some(ref mut details) = poller_options.tracing {
328 details.method_name = "google_cloud_blockchainnodeengine_v1::client::BlockchainNodeEngine::create_blockchain_node::until_done";
329 }
330
331 let stub = self.0.stub.clone();
332 let mut options = self.0.options.clone();
333 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
334 let query = move |name| {
335 let stub = stub.clone();
336 let options = options.clone();
337 async {
338 let op = GetOperation::new(stub)
339 .set_name(name)
340 .with_options(options)
341 .send()
342 .await?;
343 Ok(Operation::new(op))
344 }
345 };
346
347 let start = move || async {
348 let op = self.send().await?;
349 Ok(Operation::new(op))
350 };
351
352 use google_cloud_lro::internal::PollerExt;
353 {
354 google_cloud_lro::internal::new_poller(
355 polling_error_policy,
356 polling_backoff_policy,
357 start,
358 query,
359 )
360 }
361 .with_options(poller_options)
362 }
363
364 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
368 self.0.request.parent = v.into();
369 self
370 }
371
372 pub fn set_blockchain_node_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
376 self.0.request.blockchain_node_id = v.into();
377 self
378 }
379
380 pub fn set_blockchain_node<T>(mut self, v: T) -> Self
384 where
385 T: std::convert::Into<crate::model::BlockchainNode>,
386 {
387 self.0.request.blockchain_node = std::option::Option::Some(v.into());
388 self
389 }
390
391 pub fn set_or_clear_blockchain_node<T>(mut self, v: std::option::Option<T>) -> Self
395 where
396 T: std::convert::Into<crate::model::BlockchainNode>,
397 {
398 self.0.request.blockchain_node = v.map(|x| x.into());
399 self
400 }
401
402 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
404 self.0.request.request_id = v.into();
405 self
406 }
407 }
408
409 #[doc(hidden)]
410 impl crate::RequestBuilder for CreateBlockchainNode {
411 fn request_options(&mut self) -> &mut crate::RequestOptions {
412 &mut self.0.options
413 }
414 }
415
416 #[derive(Clone, Debug)]
434 pub struct UpdateBlockchainNode(RequestBuilder<crate::model::UpdateBlockchainNodeRequest>);
435
436 impl UpdateBlockchainNode {
437 pub(crate) fn new(
438 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
439 ) -> Self {
440 Self(RequestBuilder::new(stub))
441 }
442
443 pub fn with_request<V: Into<crate::model::UpdateBlockchainNodeRequest>>(
445 mut self,
446 v: V,
447 ) -> Self {
448 self.0.request = v.into();
449 self
450 }
451
452 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
454 self.0.options = v.into();
455 self
456 }
457
458 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
465 (*self.0.stub)
466 .update_blockchain_node(self.0.request, self.0.options)
467 .await
468 .map(crate::Response::into_body)
469 }
470
471 pub fn poller(
473 self,
474 ) -> impl google_cloud_lro::Poller<crate::model::BlockchainNode, crate::model::OperationMetadata>
475 {
476 type Operation = google_cloud_lro::internal::Operation<
477 crate::model::BlockchainNode,
478 crate::model::OperationMetadata,
479 >;
480 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
481 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
482 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
483 if let Some(ref mut details) = poller_options.tracing {
484 details.method_name = "google_cloud_blockchainnodeengine_v1::client::BlockchainNodeEngine::update_blockchain_node::until_done";
485 }
486
487 let stub = self.0.stub.clone();
488 let mut options = self.0.options.clone();
489 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
490 let query = move |name| {
491 let stub = stub.clone();
492 let options = options.clone();
493 async {
494 let op = GetOperation::new(stub)
495 .set_name(name)
496 .with_options(options)
497 .send()
498 .await?;
499 Ok(Operation::new(op))
500 }
501 };
502
503 let start = move || async {
504 let op = self.send().await?;
505 Ok(Operation::new(op))
506 };
507
508 use google_cloud_lro::internal::PollerExt;
509 {
510 google_cloud_lro::internal::new_poller(
511 polling_error_policy,
512 polling_backoff_policy,
513 start,
514 query,
515 )
516 }
517 .with_options(poller_options)
518 }
519
520 pub fn set_update_mask<T>(mut self, v: T) -> Self
524 where
525 T: std::convert::Into<wkt::FieldMask>,
526 {
527 self.0.request.update_mask = std::option::Option::Some(v.into());
528 self
529 }
530
531 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
535 where
536 T: std::convert::Into<wkt::FieldMask>,
537 {
538 self.0.request.update_mask = v.map(|x| x.into());
539 self
540 }
541
542 pub fn set_blockchain_node<T>(mut self, v: T) -> Self
546 where
547 T: std::convert::Into<crate::model::BlockchainNode>,
548 {
549 self.0.request.blockchain_node = std::option::Option::Some(v.into());
550 self
551 }
552
553 pub fn set_or_clear_blockchain_node<T>(mut self, v: std::option::Option<T>) -> Self
557 where
558 T: std::convert::Into<crate::model::BlockchainNode>,
559 {
560 self.0.request.blockchain_node = v.map(|x| x.into());
561 self
562 }
563
564 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
566 self.0.request.request_id = v.into();
567 self
568 }
569 }
570
571 #[doc(hidden)]
572 impl crate::RequestBuilder for UpdateBlockchainNode {
573 fn request_options(&mut self) -> &mut crate::RequestOptions {
574 &mut self.0.options
575 }
576 }
577
578 #[derive(Clone, Debug)]
596 pub struct DeleteBlockchainNode(RequestBuilder<crate::model::DeleteBlockchainNodeRequest>);
597
598 impl DeleteBlockchainNode {
599 pub(crate) fn new(
600 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
601 ) -> Self {
602 Self(RequestBuilder::new(stub))
603 }
604
605 pub fn with_request<V: Into<crate::model::DeleteBlockchainNodeRequest>>(
607 mut self,
608 v: V,
609 ) -> Self {
610 self.0.request = v.into();
611 self
612 }
613
614 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
616 self.0.options = v.into();
617 self
618 }
619
620 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
627 (*self.0.stub)
628 .delete_blockchain_node(self.0.request, self.0.options)
629 .await
630 .map(crate::Response::into_body)
631 }
632
633 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
635 type Operation =
636 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
637 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
638 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
639 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
640 if let Some(ref mut details) = poller_options.tracing {
641 details.method_name = "google_cloud_blockchainnodeengine_v1::client::BlockchainNodeEngine::delete_blockchain_node::until_done";
642 }
643
644 let stub = self.0.stub.clone();
645 let mut options = self.0.options.clone();
646 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
647 let query = move |name| {
648 let stub = stub.clone();
649 let options = options.clone();
650 async {
651 let op = GetOperation::new(stub)
652 .set_name(name)
653 .with_options(options)
654 .send()
655 .await?;
656 Ok(Operation::new(op))
657 }
658 };
659
660 let start = move || async {
661 let op = self.send().await?;
662 Ok(Operation::new(op))
663 };
664
665 use google_cloud_lro::internal::PollerExt;
666 {
667 google_cloud_lro::internal::new_unit_response_poller(
668 polling_error_policy,
669 polling_backoff_policy,
670 start,
671 query,
672 )
673 }
674 .with_options(poller_options)
675 }
676
677 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
681 self.0.request.name = v.into();
682 self
683 }
684
685 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
687 self.0.request.request_id = v.into();
688 self
689 }
690 }
691
692 #[doc(hidden)]
693 impl crate::RequestBuilder for DeleteBlockchainNode {
694 fn request_options(&mut self) -> &mut crate::RequestOptions {
695 &mut self.0.options
696 }
697 }
698
699 #[derive(Clone, Debug)]
720 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
721
722 impl ListLocations {
723 pub(crate) fn new(
724 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
725 ) -> Self {
726 Self(RequestBuilder::new(stub))
727 }
728
729 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
731 mut self,
732 v: V,
733 ) -> Self {
734 self.0.request = v.into();
735 self
736 }
737
738 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
740 self.0.options = v.into();
741 self
742 }
743
744 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
746 (*self.0.stub)
747 .list_locations(self.0.request, self.0.options)
748 .await
749 .map(crate::Response::into_body)
750 }
751
752 pub fn by_page(
754 self,
755 ) -> impl google_cloud_gax::paginator::Paginator<
756 google_cloud_location::model::ListLocationsResponse,
757 crate::Error,
758 > {
759 use std::clone::Clone;
760 let token = self.0.request.page_token.clone();
761 let execute = move |token: String| {
762 let mut builder = self.clone();
763 builder.0.request = builder.0.request.set_page_token(token);
764 builder.send()
765 };
766 google_cloud_gax::paginator::internal::new_paginator(token, execute)
767 }
768
769 pub fn by_item(
771 self,
772 ) -> impl google_cloud_gax::paginator::ItemPaginator<
773 google_cloud_location::model::ListLocationsResponse,
774 crate::Error,
775 > {
776 use google_cloud_gax::paginator::Paginator;
777 self.by_page().items()
778 }
779
780 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
782 self.0.request.name = v.into();
783 self
784 }
785
786 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
788 self.0.request.filter = v.into();
789 self
790 }
791
792 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
794 self.0.request.page_size = v.into();
795 self
796 }
797
798 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
800 self.0.request.page_token = v.into();
801 self
802 }
803 }
804
805 #[doc(hidden)]
806 impl crate::RequestBuilder for ListLocations {
807 fn request_options(&mut self) -> &mut crate::RequestOptions {
808 &mut self.0.options
809 }
810 }
811
812 #[derive(Clone, Debug)]
829 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
830
831 impl GetLocation {
832 pub(crate) fn new(
833 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
834 ) -> Self {
835 Self(RequestBuilder::new(stub))
836 }
837
838 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
840 mut self,
841 v: V,
842 ) -> Self {
843 self.0.request = v.into();
844 self
845 }
846
847 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
849 self.0.options = v.into();
850 self
851 }
852
853 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
855 (*self.0.stub)
856 .get_location(self.0.request, self.0.options)
857 .await
858 .map(crate::Response::into_body)
859 }
860
861 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
863 self.0.request.name = v.into();
864 self
865 }
866 }
867
868 #[doc(hidden)]
869 impl crate::RequestBuilder for GetLocation {
870 fn request_options(&mut self) -> &mut crate::RequestOptions {
871 &mut self.0.options
872 }
873 }
874
875 #[derive(Clone, Debug)]
896 pub struct ListOperations(
897 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
898 );
899
900 impl ListOperations {
901 pub(crate) fn new(
902 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
903 ) -> Self {
904 Self(RequestBuilder::new(stub))
905 }
906
907 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
909 mut self,
910 v: V,
911 ) -> Self {
912 self.0.request = v.into();
913 self
914 }
915
916 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
918 self.0.options = v.into();
919 self
920 }
921
922 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
924 (*self.0.stub)
925 .list_operations(self.0.request, self.0.options)
926 .await
927 .map(crate::Response::into_body)
928 }
929
930 pub fn by_page(
932 self,
933 ) -> impl google_cloud_gax::paginator::Paginator<
934 google_cloud_longrunning::model::ListOperationsResponse,
935 crate::Error,
936 > {
937 use std::clone::Clone;
938 let token = self.0.request.page_token.clone();
939 let execute = move |token: String| {
940 let mut builder = self.clone();
941 builder.0.request = builder.0.request.set_page_token(token);
942 builder.send()
943 };
944 google_cloud_gax::paginator::internal::new_paginator(token, execute)
945 }
946
947 pub fn by_item(
949 self,
950 ) -> impl google_cloud_gax::paginator::ItemPaginator<
951 google_cloud_longrunning::model::ListOperationsResponse,
952 crate::Error,
953 > {
954 use google_cloud_gax::paginator::Paginator;
955 self.by_page().items()
956 }
957
958 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
960 self.0.request.name = v.into();
961 self
962 }
963
964 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
966 self.0.request.filter = v.into();
967 self
968 }
969
970 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
972 self.0.request.page_size = v.into();
973 self
974 }
975
976 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
978 self.0.request.page_token = v.into();
979 self
980 }
981
982 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
984 self.0.request.return_partial_success = v.into();
985 self
986 }
987 }
988
989 #[doc(hidden)]
990 impl crate::RequestBuilder for ListOperations {
991 fn request_options(&mut self) -> &mut crate::RequestOptions {
992 &mut self.0.options
993 }
994 }
995
996 #[derive(Clone, Debug)]
1013 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1014
1015 impl GetOperation {
1016 pub(crate) fn new(
1017 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
1018 ) -> Self {
1019 Self(RequestBuilder::new(stub))
1020 }
1021
1022 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1024 mut self,
1025 v: V,
1026 ) -> Self {
1027 self.0.request = v.into();
1028 self
1029 }
1030
1031 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1033 self.0.options = v.into();
1034 self
1035 }
1036
1037 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1039 (*self.0.stub)
1040 .get_operation(self.0.request, self.0.options)
1041 .await
1042 .map(crate::Response::into_body)
1043 }
1044
1045 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1047 self.0.request.name = v.into();
1048 self
1049 }
1050 }
1051
1052 #[doc(hidden)]
1053 impl crate::RequestBuilder for GetOperation {
1054 fn request_options(&mut self) -> &mut crate::RequestOptions {
1055 &mut self.0.options
1056 }
1057 }
1058
1059 #[derive(Clone, Debug)]
1076 pub struct DeleteOperation(
1077 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1078 );
1079
1080 impl DeleteOperation {
1081 pub(crate) fn new(
1082 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
1083 ) -> Self {
1084 Self(RequestBuilder::new(stub))
1085 }
1086
1087 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1089 mut self,
1090 v: V,
1091 ) -> Self {
1092 self.0.request = v.into();
1093 self
1094 }
1095
1096 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1098 self.0.options = v.into();
1099 self
1100 }
1101
1102 pub async fn send(self) -> Result<()> {
1104 (*self.0.stub)
1105 .delete_operation(self.0.request, self.0.options)
1106 .await
1107 .map(crate::Response::into_body)
1108 }
1109
1110 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1112 self.0.request.name = v.into();
1113 self
1114 }
1115 }
1116
1117 #[doc(hidden)]
1118 impl crate::RequestBuilder for DeleteOperation {
1119 fn request_options(&mut self) -> &mut crate::RequestOptions {
1120 &mut self.0.options
1121 }
1122 }
1123
1124 #[derive(Clone, Debug)]
1141 pub struct CancelOperation(
1142 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1143 );
1144
1145 impl CancelOperation {
1146 pub(crate) fn new(
1147 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
1148 ) -> Self {
1149 Self(RequestBuilder::new(stub))
1150 }
1151
1152 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1154 mut self,
1155 v: V,
1156 ) -> Self {
1157 self.0.request = v.into();
1158 self
1159 }
1160
1161 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1163 self.0.options = v.into();
1164 self
1165 }
1166
1167 pub async fn send(self) -> Result<()> {
1169 (*self.0.stub)
1170 .cancel_operation(self.0.request, self.0.options)
1171 .await
1172 .map(crate::Response::into_body)
1173 }
1174
1175 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1177 self.0.request.name = v.into();
1178 self
1179 }
1180 }
1181
1182 #[doc(hidden)]
1183 impl crate::RequestBuilder for CancelOperation {
1184 fn request_options(&mut self) -> &mut crate::RequestOptions {
1185 &mut self.0.options
1186 }
1187 }
1188}