google_cloud_hypercomputecluster_v1/
builder.rs1pub mod hypercompute_cluster {
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::HypercomputeCluster;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = HypercomputeCluster;
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::HypercomputeCluster>,
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::HypercomputeCluster>,
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 ListClusters(RequestBuilder<crate::model::ListClustersRequest>);
96
97 impl ListClusters {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::HypercomputeCluster>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListClustersRequest>>(mut self, v: V) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<crate::model::ListClustersResponse> {
118 (*self.0.stub)
119 .list_clusters(self.0.request, self.0.options)
120 .await
121 .map(crate::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListClustersResponse, crate::Error>
128 {
129 use std::clone::Clone;
130 let token = self.0.request.page_token.clone();
131 let execute = move |token: String| {
132 let mut builder = self.clone();
133 builder.0.request = builder.0.request.set_page_token(token);
134 builder.send()
135 };
136 google_cloud_gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl google_cloud_gax::paginator::ItemPaginator<
143 crate::model::ListClustersResponse,
144 crate::Error,
145 > {
146 use google_cloud_gax::paginator::Paginator;
147 self.by_page().items()
148 }
149
150 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
154 self.0.request.parent = v.into();
155 self
156 }
157
158 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
160 self.0.request.page_size = v.into();
161 self
162 }
163
164 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
166 self.0.request.page_token = v.into();
167 self
168 }
169
170 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
172 self.0.request.filter = v.into();
173 self
174 }
175
176 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
178 self.0.request.order_by = v.into();
179 self
180 }
181 }
182
183 #[doc(hidden)]
184 impl crate::RequestBuilder for ListClusters {
185 fn request_options(&mut self) -> &mut crate::RequestOptions {
186 &mut self.0.options
187 }
188 }
189
190 #[derive(Clone, Debug)]
207 pub struct GetCluster(RequestBuilder<crate::model::GetClusterRequest>);
208
209 impl GetCluster {
210 pub(crate) fn new(
211 stub: std::sync::Arc<dyn super::super::stub::dynamic::HypercomputeCluster>,
212 ) -> Self {
213 Self(RequestBuilder::new(stub))
214 }
215
216 pub fn with_request<V: Into<crate::model::GetClusterRequest>>(mut self, v: V) -> Self {
218 self.0.request = v.into();
219 self
220 }
221
222 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
224 self.0.options = v.into();
225 self
226 }
227
228 pub async fn send(self) -> Result<crate::model::Cluster> {
230 (*self.0.stub)
231 .get_cluster(self.0.request, self.0.options)
232 .await
233 .map(crate::Response::into_body)
234 }
235
236 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
240 self.0.request.name = v.into();
241 self
242 }
243 }
244
245 #[doc(hidden)]
246 impl crate::RequestBuilder for GetCluster {
247 fn request_options(&mut self) -> &mut crate::RequestOptions {
248 &mut self.0.options
249 }
250 }
251
252 #[derive(Clone, Debug)]
270 pub struct CreateCluster(RequestBuilder<crate::model::CreateClusterRequest>);
271
272 impl CreateCluster {
273 pub(crate) fn new(
274 stub: std::sync::Arc<dyn super::super::stub::dynamic::HypercomputeCluster>,
275 ) -> Self {
276 Self(RequestBuilder::new(stub))
277 }
278
279 pub fn with_request<V: Into<crate::model::CreateClusterRequest>>(mut self, v: V) -> Self {
281 self.0.request = v.into();
282 self
283 }
284
285 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
287 self.0.options = v.into();
288 self
289 }
290
291 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
298 (*self.0.stub)
299 .create_cluster(self.0.request, self.0.options)
300 .await
301 .map(crate::Response::into_body)
302 }
303
304 pub fn poller(
306 self,
307 ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::OperationMetadata>
308 {
309 type Operation = google_cloud_lro::internal::Operation<
310 crate::model::Cluster,
311 crate::model::OperationMetadata,
312 >;
313 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
314 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
315 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
316 if let Some(ref mut details) = poller_options.tracing {
317 details.method_name = "google_cloud_hypercomputecluster_v1::client::HypercomputeCluster::create_cluster::until_done";
318 }
319
320 let stub = self.0.stub.clone();
321 let mut options = self.0.options.clone();
322 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
323 let query = move |name| {
324 let stub = stub.clone();
325 let options = options.clone();
326 async {
327 let op = GetOperation::new(stub)
328 .set_name(name)
329 .with_options(options)
330 .send()
331 .await?;
332 Ok(Operation::new(op))
333 }
334 };
335
336 let start = move || async {
337 let op = self.send().await?;
338 Ok(Operation::new(op))
339 };
340
341 use google_cloud_lro::internal::PollerExt;
342 {
343 google_cloud_lro::internal::new_poller(
344 polling_error_policy,
345 polling_backoff_policy,
346 start,
347 query,
348 )
349 }
350 .with_options(poller_options)
351 }
352
353 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
357 self.0.request.parent = v.into();
358 self
359 }
360
361 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
365 self.0.request.cluster_id = v.into();
366 self
367 }
368
369 pub fn set_cluster<T>(mut self, v: T) -> Self
373 where
374 T: std::convert::Into<crate::model::Cluster>,
375 {
376 self.0.request.cluster = std::option::Option::Some(v.into());
377 self
378 }
379
380 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
384 where
385 T: std::convert::Into<crate::model::Cluster>,
386 {
387 self.0.request.cluster = v.map(|x| x.into());
388 self
389 }
390
391 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
393 self.0.request.request_id = v.into();
394 self
395 }
396 }
397
398 #[doc(hidden)]
399 impl crate::RequestBuilder for CreateCluster {
400 fn request_options(&mut self) -> &mut crate::RequestOptions {
401 &mut self.0.options
402 }
403 }
404
405 #[derive(Clone, Debug)]
423 pub struct UpdateCluster(RequestBuilder<crate::model::UpdateClusterRequest>);
424
425 impl UpdateCluster {
426 pub(crate) fn new(
427 stub: std::sync::Arc<dyn super::super::stub::dynamic::HypercomputeCluster>,
428 ) -> Self {
429 Self(RequestBuilder::new(stub))
430 }
431
432 pub fn with_request<V: Into<crate::model::UpdateClusterRequest>>(mut self, v: V) -> Self {
434 self.0.request = v.into();
435 self
436 }
437
438 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
440 self.0.options = v.into();
441 self
442 }
443
444 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
451 (*self.0.stub)
452 .update_cluster(self.0.request, self.0.options)
453 .await
454 .map(crate::Response::into_body)
455 }
456
457 pub fn poller(
459 self,
460 ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::OperationMetadata>
461 {
462 type Operation = google_cloud_lro::internal::Operation<
463 crate::model::Cluster,
464 crate::model::OperationMetadata,
465 >;
466 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
467 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
468 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
469 if let Some(ref mut details) = poller_options.tracing {
470 details.method_name = "google_cloud_hypercomputecluster_v1::client::HypercomputeCluster::update_cluster::until_done";
471 }
472
473 let stub = self.0.stub.clone();
474 let mut options = self.0.options.clone();
475 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
476 let query = move |name| {
477 let stub = stub.clone();
478 let options = options.clone();
479 async {
480 let op = GetOperation::new(stub)
481 .set_name(name)
482 .with_options(options)
483 .send()
484 .await?;
485 Ok(Operation::new(op))
486 }
487 };
488
489 let start = move || async {
490 let op = self.send().await?;
491 Ok(Operation::new(op))
492 };
493
494 use google_cloud_lro::internal::PollerExt;
495 {
496 google_cloud_lro::internal::new_poller(
497 polling_error_policy,
498 polling_backoff_policy,
499 start,
500 query,
501 )
502 }
503 .with_options(poller_options)
504 }
505
506 pub fn set_cluster<T>(mut self, v: T) -> Self
510 where
511 T: std::convert::Into<crate::model::Cluster>,
512 {
513 self.0.request.cluster = std::option::Option::Some(v.into());
514 self
515 }
516
517 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
521 where
522 T: std::convert::Into<crate::model::Cluster>,
523 {
524 self.0.request.cluster = v.map(|x| x.into());
525 self
526 }
527
528 pub fn set_update_mask<T>(mut self, v: T) -> Self
530 where
531 T: std::convert::Into<wkt::FieldMask>,
532 {
533 self.0.request.update_mask = std::option::Option::Some(v.into());
534 self
535 }
536
537 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
539 where
540 T: std::convert::Into<wkt::FieldMask>,
541 {
542 self.0.request.update_mask = v.map(|x| x.into());
543 self
544 }
545
546 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
548 self.0.request.request_id = v.into();
549 self
550 }
551 }
552
553 #[doc(hidden)]
554 impl crate::RequestBuilder for UpdateCluster {
555 fn request_options(&mut self) -> &mut crate::RequestOptions {
556 &mut self.0.options
557 }
558 }
559
560 #[derive(Clone, Debug)]
578 pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
579
580 impl DeleteCluster {
581 pub(crate) fn new(
582 stub: std::sync::Arc<dyn super::super::stub::dynamic::HypercomputeCluster>,
583 ) -> Self {
584 Self(RequestBuilder::new(stub))
585 }
586
587 pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
589 self.0.request = v.into();
590 self
591 }
592
593 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
595 self.0.options = v.into();
596 self
597 }
598
599 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
606 (*self.0.stub)
607 .delete_cluster(self.0.request, self.0.options)
608 .await
609 .map(crate::Response::into_body)
610 }
611
612 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
614 type Operation =
615 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
616 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
617 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
618 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
619 if let Some(ref mut details) = poller_options.tracing {
620 details.method_name = "google_cloud_hypercomputecluster_v1::client::HypercomputeCluster::delete_cluster::until_done";
621 }
622
623 let stub = self.0.stub.clone();
624 let mut options = self.0.options.clone();
625 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
626 let query = move |name| {
627 let stub = stub.clone();
628 let options = options.clone();
629 async {
630 let op = GetOperation::new(stub)
631 .set_name(name)
632 .with_options(options)
633 .send()
634 .await?;
635 Ok(Operation::new(op))
636 }
637 };
638
639 let start = move || async {
640 let op = self.send().await?;
641 Ok(Operation::new(op))
642 };
643
644 use google_cloud_lro::internal::PollerExt;
645 {
646 google_cloud_lro::internal::new_unit_response_poller(
647 polling_error_policy,
648 polling_backoff_policy,
649 start,
650 query,
651 )
652 }
653 .with_options(poller_options)
654 }
655
656 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
660 self.0.request.name = v.into();
661 self
662 }
663
664 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
666 self.0.request.request_id = v.into();
667 self
668 }
669 }
670
671 #[doc(hidden)]
672 impl crate::RequestBuilder for DeleteCluster {
673 fn request_options(&mut self) -> &mut crate::RequestOptions {
674 &mut self.0.options
675 }
676 }
677
678 #[derive(Clone, Debug)]
699 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
700
701 impl ListLocations {
702 pub(crate) fn new(
703 stub: std::sync::Arc<dyn super::super::stub::dynamic::HypercomputeCluster>,
704 ) -> Self {
705 Self(RequestBuilder::new(stub))
706 }
707
708 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
710 mut self,
711 v: V,
712 ) -> Self {
713 self.0.request = v.into();
714 self
715 }
716
717 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
719 self.0.options = v.into();
720 self
721 }
722
723 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
725 (*self.0.stub)
726 .list_locations(self.0.request, self.0.options)
727 .await
728 .map(crate::Response::into_body)
729 }
730
731 pub fn by_page(
733 self,
734 ) -> impl google_cloud_gax::paginator::Paginator<
735 google_cloud_location::model::ListLocationsResponse,
736 crate::Error,
737 > {
738 use std::clone::Clone;
739 let token = self.0.request.page_token.clone();
740 let execute = move |token: String| {
741 let mut builder = self.clone();
742 builder.0.request = builder.0.request.set_page_token(token);
743 builder.send()
744 };
745 google_cloud_gax::paginator::internal::new_paginator(token, execute)
746 }
747
748 pub fn by_item(
750 self,
751 ) -> impl google_cloud_gax::paginator::ItemPaginator<
752 google_cloud_location::model::ListLocationsResponse,
753 crate::Error,
754 > {
755 use google_cloud_gax::paginator::Paginator;
756 self.by_page().items()
757 }
758
759 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
761 self.0.request.name = v.into();
762 self
763 }
764
765 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
767 self.0.request.filter = v.into();
768 self
769 }
770
771 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
773 self.0.request.page_size = v.into();
774 self
775 }
776
777 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
779 self.0.request.page_token = v.into();
780 self
781 }
782 }
783
784 #[doc(hidden)]
785 impl crate::RequestBuilder for ListLocations {
786 fn request_options(&mut self) -> &mut crate::RequestOptions {
787 &mut self.0.options
788 }
789 }
790
791 #[derive(Clone, Debug)]
808 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
809
810 impl GetLocation {
811 pub(crate) fn new(
812 stub: std::sync::Arc<dyn super::super::stub::dynamic::HypercomputeCluster>,
813 ) -> Self {
814 Self(RequestBuilder::new(stub))
815 }
816
817 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
819 mut self,
820 v: V,
821 ) -> Self {
822 self.0.request = v.into();
823 self
824 }
825
826 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
828 self.0.options = v.into();
829 self
830 }
831
832 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
834 (*self.0.stub)
835 .get_location(self.0.request, self.0.options)
836 .await
837 .map(crate::Response::into_body)
838 }
839
840 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
842 self.0.request.name = v.into();
843 self
844 }
845 }
846
847 #[doc(hidden)]
848 impl crate::RequestBuilder for GetLocation {
849 fn request_options(&mut self) -> &mut crate::RequestOptions {
850 &mut self.0.options
851 }
852 }
853
854 #[derive(Clone, Debug)]
875 pub struct ListOperations(
876 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
877 );
878
879 impl ListOperations {
880 pub(crate) fn new(
881 stub: std::sync::Arc<dyn super::super::stub::dynamic::HypercomputeCluster>,
882 ) -> Self {
883 Self(RequestBuilder::new(stub))
884 }
885
886 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
888 mut self,
889 v: V,
890 ) -> Self {
891 self.0.request = v.into();
892 self
893 }
894
895 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
897 self.0.options = v.into();
898 self
899 }
900
901 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
903 (*self.0.stub)
904 .list_operations(self.0.request, self.0.options)
905 .await
906 .map(crate::Response::into_body)
907 }
908
909 pub fn by_page(
911 self,
912 ) -> impl google_cloud_gax::paginator::Paginator<
913 google_cloud_longrunning::model::ListOperationsResponse,
914 crate::Error,
915 > {
916 use std::clone::Clone;
917 let token = self.0.request.page_token.clone();
918 let execute = move |token: String| {
919 let mut builder = self.clone();
920 builder.0.request = builder.0.request.set_page_token(token);
921 builder.send()
922 };
923 google_cloud_gax::paginator::internal::new_paginator(token, execute)
924 }
925
926 pub fn by_item(
928 self,
929 ) -> impl google_cloud_gax::paginator::ItemPaginator<
930 google_cloud_longrunning::model::ListOperationsResponse,
931 crate::Error,
932 > {
933 use google_cloud_gax::paginator::Paginator;
934 self.by_page().items()
935 }
936
937 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
939 self.0.request.name = v.into();
940 self
941 }
942
943 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
945 self.0.request.filter = v.into();
946 self
947 }
948
949 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
951 self.0.request.page_size = v.into();
952 self
953 }
954
955 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
957 self.0.request.page_token = v.into();
958 self
959 }
960
961 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
963 self.0.request.return_partial_success = v.into();
964 self
965 }
966 }
967
968 #[doc(hidden)]
969 impl crate::RequestBuilder for ListOperations {
970 fn request_options(&mut self) -> &mut crate::RequestOptions {
971 &mut self.0.options
972 }
973 }
974
975 #[derive(Clone, Debug)]
992 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
993
994 impl GetOperation {
995 pub(crate) fn new(
996 stub: std::sync::Arc<dyn super::super::stub::dynamic::HypercomputeCluster>,
997 ) -> Self {
998 Self(RequestBuilder::new(stub))
999 }
1000
1001 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1003 mut self,
1004 v: V,
1005 ) -> Self {
1006 self.0.request = v.into();
1007 self
1008 }
1009
1010 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1012 self.0.options = v.into();
1013 self
1014 }
1015
1016 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1018 (*self.0.stub)
1019 .get_operation(self.0.request, self.0.options)
1020 .await
1021 .map(crate::Response::into_body)
1022 }
1023
1024 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1026 self.0.request.name = v.into();
1027 self
1028 }
1029 }
1030
1031 #[doc(hidden)]
1032 impl crate::RequestBuilder for GetOperation {
1033 fn request_options(&mut self) -> &mut crate::RequestOptions {
1034 &mut self.0.options
1035 }
1036 }
1037
1038 #[derive(Clone, Debug)]
1055 pub struct DeleteOperation(
1056 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1057 );
1058
1059 impl DeleteOperation {
1060 pub(crate) fn new(
1061 stub: std::sync::Arc<dyn super::super::stub::dynamic::HypercomputeCluster>,
1062 ) -> Self {
1063 Self(RequestBuilder::new(stub))
1064 }
1065
1066 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1068 mut self,
1069 v: V,
1070 ) -> Self {
1071 self.0.request = v.into();
1072 self
1073 }
1074
1075 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1077 self.0.options = v.into();
1078 self
1079 }
1080
1081 pub async fn send(self) -> Result<()> {
1083 (*self.0.stub)
1084 .delete_operation(self.0.request, self.0.options)
1085 .await
1086 .map(crate::Response::into_body)
1087 }
1088
1089 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1091 self.0.request.name = v.into();
1092 self
1093 }
1094 }
1095
1096 #[doc(hidden)]
1097 impl crate::RequestBuilder for DeleteOperation {
1098 fn request_options(&mut self) -> &mut crate::RequestOptions {
1099 &mut self.0.options
1100 }
1101 }
1102
1103 #[derive(Clone, Debug)]
1120 pub struct CancelOperation(
1121 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1122 );
1123
1124 impl CancelOperation {
1125 pub(crate) fn new(
1126 stub: std::sync::Arc<dyn super::super::stub::dynamic::HypercomputeCluster>,
1127 ) -> Self {
1128 Self(RequestBuilder::new(stub))
1129 }
1130
1131 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1133 mut self,
1134 v: V,
1135 ) -> Self {
1136 self.0.request = v.into();
1137 self
1138 }
1139
1140 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1142 self.0.options = v.into();
1143 self
1144 }
1145
1146 pub async fn send(self) -> Result<()> {
1148 (*self.0.stub)
1149 .cancel_operation(self.0.request, self.0.options)
1150 .await
1151 .map(crate::Response::into_body)
1152 }
1153
1154 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1156 self.0.request.name = v.into();
1157 self
1158 }
1159 }
1160
1161 #[doc(hidden)]
1162 impl crate::RequestBuilder for CancelOperation {
1163 fn request_options(&mut self) -> &mut crate::RequestOptions {
1164 &mut self.0.options
1165 }
1166 }
1167}