1pub mod datastore_admin {
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::DatastoreAdmin;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = DatastoreAdmin;
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::DatastoreAdmin>,
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::DatastoreAdmin>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
92 pub struct ExportEntities(RequestBuilder<crate::model::ExportEntitiesRequest>);
93
94 impl ExportEntities {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatastoreAdmin>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 pub fn with_request<V: Into<crate::model::ExportEntitiesRequest>>(mut self, v: V) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
120 (*self.0.stub)
121 .export_entities(self.0.request, self.0.options)
122 .await
123 .map(crate::Response::into_body)
124 }
125
126 pub fn poller(
128 self,
129 ) -> impl google_cloud_lro::Poller<
130 crate::model::ExportEntitiesResponse,
131 crate::model::ExportEntitiesMetadata,
132 > {
133 type Operation = google_cloud_lro::internal::Operation<
134 crate::model::ExportEntitiesResponse,
135 crate::model::ExportEntitiesMetadata,
136 >;
137 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
138 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
139 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
140 if let Some(ref mut details) = poller_options.tracing {
141 details.method_name = "google_cloud_datastore_admin_v1::client::DatastoreAdmin::export_entities::until_done";
142 }
143
144 let stub = self.0.stub.clone();
145 let mut options = self.0.options.clone();
146 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
147 let query = move |name| {
148 let stub = stub.clone();
149 let options = options.clone();
150 async {
151 let op = GetOperation::new(stub)
152 .set_name(name)
153 .with_options(options)
154 .send()
155 .await?;
156 Ok(Operation::new(op))
157 }
158 };
159
160 let start = move || async {
161 let op = self.send().await?;
162 Ok(Operation::new(op))
163 };
164
165 use google_cloud_lro::internal::PollerExt;
166 {
167 google_cloud_lro::internal::new_poller(
168 polling_error_policy,
169 polling_backoff_policy,
170 start,
171 query,
172 )
173 }
174 .with_options(poller_options)
175 }
176
177 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
181 self.0.request.project_id = v.into();
182 self
183 }
184
185 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
187 where
188 T: std::iter::IntoIterator<Item = (K, V)>,
189 K: std::convert::Into<std::string::String>,
190 V: std::convert::Into<std::string::String>,
191 {
192 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
193 self
194 }
195
196 pub fn set_entity_filter<T>(mut self, v: T) -> Self
198 where
199 T: std::convert::Into<crate::model::EntityFilter>,
200 {
201 self.0.request.entity_filter = std::option::Option::Some(v.into());
202 self
203 }
204
205 pub fn set_or_clear_entity_filter<T>(mut self, v: std::option::Option<T>) -> Self
207 where
208 T: std::convert::Into<crate::model::EntityFilter>,
209 {
210 self.0.request.entity_filter = v.map(|x| x.into());
211 self
212 }
213
214 pub fn set_output_url_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
218 self.0.request.output_url_prefix = v.into();
219 self
220 }
221 }
222
223 #[doc(hidden)]
224 impl crate::RequestBuilder for ExportEntities {
225 fn request_options(&mut self) -> &mut crate::RequestOptions {
226 &mut self.0.options
227 }
228 }
229
230 #[derive(Clone, Debug)]
248 pub struct ImportEntities(RequestBuilder<crate::model::ImportEntitiesRequest>);
249
250 impl ImportEntities {
251 pub(crate) fn new(
252 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatastoreAdmin>,
253 ) -> Self {
254 Self(RequestBuilder::new(stub))
255 }
256
257 pub fn with_request<V: Into<crate::model::ImportEntitiesRequest>>(mut self, v: V) -> Self {
259 self.0.request = v.into();
260 self
261 }
262
263 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
265 self.0.options = v.into();
266 self
267 }
268
269 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
276 (*self.0.stub)
277 .import_entities(self.0.request, self.0.options)
278 .await
279 .map(crate::Response::into_body)
280 }
281
282 pub fn poller(
284 self,
285 ) -> impl google_cloud_lro::Poller<(), crate::model::ImportEntitiesMetadata> {
286 type Operation = google_cloud_lro::internal::Operation<
287 wkt::Empty,
288 crate::model::ImportEntitiesMetadata,
289 >;
290 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
291 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
292 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
293 if let Some(ref mut details) = poller_options.tracing {
294 details.method_name = "google_cloud_datastore_admin_v1::client::DatastoreAdmin::import_entities::until_done";
295 }
296
297 let stub = self.0.stub.clone();
298 let mut options = self.0.options.clone();
299 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
300 let query = move |name| {
301 let stub = stub.clone();
302 let options = options.clone();
303 async {
304 let op = GetOperation::new(stub)
305 .set_name(name)
306 .with_options(options)
307 .send()
308 .await?;
309 Ok(Operation::new(op))
310 }
311 };
312
313 let start = move || async {
314 let op = self.send().await?;
315 Ok(Operation::new(op))
316 };
317
318 use google_cloud_lro::internal::PollerExt;
319 {
320 google_cloud_lro::internal::new_unit_response_poller(
321 polling_error_policy,
322 polling_backoff_policy,
323 start,
324 query,
325 )
326 }
327 .with_options(poller_options)
328 }
329
330 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
334 self.0.request.project_id = v.into();
335 self
336 }
337
338 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
340 where
341 T: std::iter::IntoIterator<Item = (K, V)>,
342 K: std::convert::Into<std::string::String>,
343 V: std::convert::Into<std::string::String>,
344 {
345 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
346 self
347 }
348
349 pub fn set_input_url<T: Into<std::string::String>>(mut self, v: T) -> Self {
353 self.0.request.input_url = v.into();
354 self
355 }
356
357 pub fn set_entity_filter<T>(mut self, v: T) -> Self
359 where
360 T: std::convert::Into<crate::model::EntityFilter>,
361 {
362 self.0.request.entity_filter = std::option::Option::Some(v.into());
363 self
364 }
365
366 pub fn set_or_clear_entity_filter<T>(mut self, v: std::option::Option<T>) -> Self
368 where
369 T: std::convert::Into<crate::model::EntityFilter>,
370 {
371 self.0.request.entity_filter = v.map(|x| x.into());
372 self
373 }
374 }
375
376 #[doc(hidden)]
377 impl crate::RequestBuilder for ImportEntities {
378 fn request_options(&mut self) -> &mut crate::RequestOptions {
379 &mut self.0.options
380 }
381 }
382
383 #[derive(Clone, Debug)]
401 pub struct CreateIndex(RequestBuilder<crate::model::CreateIndexRequest>);
402
403 impl CreateIndex {
404 pub(crate) fn new(
405 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatastoreAdmin>,
406 ) -> Self {
407 Self(RequestBuilder::new(stub))
408 }
409
410 pub fn with_request<V: Into<crate::model::CreateIndexRequest>>(mut self, v: V) -> Self {
412 self.0.request = v.into();
413 self
414 }
415
416 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
418 self.0.options = v.into();
419 self
420 }
421
422 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
429 (*self.0.stub)
430 .create_index(self.0.request, self.0.options)
431 .await
432 .map(crate::Response::into_body)
433 }
434
435 pub fn poller(
437 self,
438 ) -> impl google_cloud_lro::Poller<crate::model::Index, crate::model::IndexOperationMetadata>
439 {
440 type Operation = google_cloud_lro::internal::Operation<
441 crate::model::Index,
442 crate::model::IndexOperationMetadata,
443 >;
444 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
445 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
446 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
447 if let Some(ref mut details) = poller_options.tracing {
448 details.method_name = "google_cloud_datastore_admin_v1::client::DatastoreAdmin::create_index::until_done";
449 }
450
451 let stub = self.0.stub.clone();
452 let mut options = self.0.options.clone();
453 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
454 let query = move |name| {
455 let stub = stub.clone();
456 let options = options.clone();
457 async {
458 let op = GetOperation::new(stub)
459 .set_name(name)
460 .with_options(options)
461 .send()
462 .await?;
463 Ok(Operation::new(op))
464 }
465 };
466
467 let start = move || async {
468 let op = self.send().await?;
469 Ok(Operation::new(op))
470 };
471
472 use google_cloud_lro::internal::PollerExt;
473 {
474 google_cloud_lro::internal::new_poller(
475 polling_error_policy,
476 polling_backoff_policy,
477 start,
478 query,
479 )
480 }
481 .with_options(poller_options)
482 }
483
484 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
486 self.0.request.project_id = v.into();
487 self
488 }
489
490 pub fn set_index<T>(mut self, v: T) -> Self
492 where
493 T: std::convert::Into<crate::model::Index>,
494 {
495 self.0.request.index = std::option::Option::Some(v.into());
496 self
497 }
498
499 pub fn set_or_clear_index<T>(mut self, v: std::option::Option<T>) -> Self
501 where
502 T: std::convert::Into<crate::model::Index>,
503 {
504 self.0.request.index = v.map(|x| x.into());
505 self
506 }
507 }
508
509 #[doc(hidden)]
510 impl crate::RequestBuilder for CreateIndex {
511 fn request_options(&mut self) -> &mut crate::RequestOptions {
512 &mut self.0.options
513 }
514 }
515
516 #[derive(Clone, Debug)]
534 pub struct DeleteIndex(RequestBuilder<crate::model::DeleteIndexRequest>);
535
536 impl DeleteIndex {
537 pub(crate) fn new(
538 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatastoreAdmin>,
539 ) -> Self {
540 Self(RequestBuilder::new(stub))
541 }
542
543 pub fn with_request<V: Into<crate::model::DeleteIndexRequest>>(mut self, v: V) -> Self {
545 self.0.request = v.into();
546 self
547 }
548
549 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
551 self.0.options = v.into();
552 self
553 }
554
555 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
562 (*self.0.stub)
563 .delete_index(self.0.request, self.0.options)
564 .await
565 .map(crate::Response::into_body)
566 }
567
568 pub fn poller(
570 self,
571 ) -> impl google_cloud_lro::Poller<crate::model::Index, crate::model::IndexOperationMetadata>
572 {
573 type Operation = google_cloud_lro::internal::Operation<
574 crate::model::Index,
575 crate::model::IndexOperationMetadata,
576 >;
577 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
578 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
579 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
580 if let Some(ref mut details) = poller_options.tracing {
581 details.method_name = "google_cloud_datastore_admin_v1::client::DatastoreAdmin::delete_index::until_done";
582 }
583
584 let stub = self.0.stub.clone();
585 let mut options = self.0.options.clone();
586 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
587 let query = move |name| {
588 let stub = stub.clone();
589 let options = options.clone();
590 async {
591 let op = GetOperation::new(stub)
592 .set_name(name)
593 .with_options(options)
594 .send()
595 .await?;
596 Ok(Operation::new(op))
597 }
598 };
599
600 let start = move || async {
601 let op = self.send().await?;
602 Ok(Operation::new(op))
603 };
604
605 use google_cloud_lro::internal::PollerExt;
606 {
607 google_cloud_lro::internal::new_poller(
608 polling_error_policy,
609 polling_backoff_policy,
610 start,
611 query,
612 )
613 }
614 .with_options(poller_options)
615 }
616
617 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
619 self.0.request.project_id = v.into();
620 self
621 }
622
623 pub fn set_index_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
625 self.0.request.index_id = v.into();
626 self
627 }
628 }
629
630 #[doc(hidden)]
631 impl crate::RequestBuilder for DeleteIndex {
632 fn request_options(&mut self) -> &mut crate::RequestOptions {
633 &mut self.0.options
634 }
635 }
636
637 #[derive(Clone, Debug)]
654 pub struct GetIndex(RequestBuilder<crate::model::GetIndexRequest>);
655
656 impl GetIndex {
657 pub(crate) fn new(
658 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatastoreAdmin>,
659 ) -> Self {
660 Self(RequestBuilder::new(stub))
661 }
662
663 pub fn with_request<V: Into<crate::model::GetIndexRequest>>(mut self, v: V) -> Self {
665 self.0.request = v.into();
666 self
667 }
668
669 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
671 self.0.options = v.into();
672 self
673 }
674
675 pub async fn send(self) -> Result<crate::model::Index> {
677 (*self.0.stub)
678 .get_index(self.0.request, self.0.options)
679 .await
680 .map(crate::Response::into_body)
681 }
682
683 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
685 self.0.request.project_id = v.into();
686 self
687 }
688
689 pub fn set_index_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
691 self.0.request.index_id = v.into();
692 self
693 }
694 }
695
696 #[doc(hidden)]
697 impl crate::RequestBuilder for GetIndex {
698 fn request_options(&mut self) -> &mut crate::RequestOptions {
699 &mut self.0.options
700 }
701 }
702
703 #[derive(Clone, Debug)]
724 pub struct ListIndexes(RequestBuilder<crate::model::ListIndexesRequest>);
725
726 impl ListIndexes {
727 pub(crate) fn new(
728 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatastoreAdmin>,
729 ) -> Self {
730 Self(RequestBuilder::new(stub))
731 }
732
733 pub fn with_request<V: Into<crate::model::ListIndexesRequest>>(mut self, v: V) -> Self {
735 self.0.request = v.into();
736 self
737 }
738
739 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
741 self.0.options = v.into();
742 self
743 }
744
745 pub async fn send(self) -> Result<crate::model::ListIndexesResponse> {
747 (*self.0.stub)
748 .list_indexes(self.0.request, self.0.options)
749 .await
750 .map(crate::Response::into_body)
751 }
752
753 pub fn by_page(
755 self,
756 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListIndexesResponse, crate::Error>
757 {
758 use std::clone::Clone;
759 let token = self.0.request.page_token.clone();
760 let execute = move |token: String| {
761 let mut builder = self.clone();
762 builder.0.request = builder.0.request.set_page_token(token);
763 builder.send()
764 };
765 google_cloud_gax::paginator::internal::new_paginator(token, execute)
766 }
767
768 pub fn by_item(
770 self,
771 ) -> impl google_cloud_gax::paginator::ItemPaginator<
772 crate::model::ListIndexesResponse,
773 crate::Error,
774 > {
775 use google_cloud_gax::paginator::Paginator;
776 self.by_page().items()
777 }
778
779 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
781 self.0.request.project_id = v.into();
782 self
783 }
784
785 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
787 self.0.request.filter = v.into();
788 self
789 }
790
791 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
793 self.0.request.page_size = v.into();
794 self
795 }
796
797 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
799 self.0.request.page_token = v.into();
800 self
801 }
802 }
803
804 #[doc(hidden)]
805 impl crate::RequestBuilder for ListIndexes {
806 fn request_options(&mut self) -> &mut crate::RequestOptions {
807 &mut self.0.options
808 }
809 }
810
811 #[derive(Clone, Debug)]
832 pub struct ListOperations(
833 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
834 );
835
836 impl ListOperations {
837 pub(crate) fn new(
838 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatastoreAdmin>,
839 ) -> Self {
840 Self(RequestBuilder::new(stub))
841 }
842
843 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
845 mut self,
846 v: V,
847 ) -> Self {
848 self.0.request = v.into();
849 self
850 }
851
852 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
854 self.0.options = v.into();
855 self
856 }
857
858 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
860 (*self.0.stub)
861 .list_operations(self.0.request, self.0.options)
862 .await
863 .map(crate::Response::into_body)
864 }
865
866 pub fn by_page(
868 self,
869 ) -> impl google_cloud_gax::paginator::Paginator<
870 google_cloud_longrunning::model::ListOperationsResponse,
871 crate::Error,
872 > {
873 use std::clone::Clone;
874 let token = self.0.request.page_token.clone();
875 let execute = move |token: String| {
876 let mut builder = self.clone();
877 builder.0.request = builder.0.request.set_page_token(token);
878 builder.send()
879 };
880 google_cloud_gax::paginator::internal::new_paginator(token, execute)
881 }
882
883 pub fn by_item(
885 self,
886 ) -> impl google_cloud_gax::paginator::ItemPaginator<
887 google_cloud_longrunning::model::ListOperationsResponse,
888 crate::Error,
889 > {
890 use google_cloud_gax::paginator::Paginator;
891 self.by_page().items()
892 }
893
894 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
896 self.0.request.name = v.into();
897 self
898 }
899
900 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
902 self.0.request.filter = v.into();
903 self
904 }
905
906 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
908 self.0.request.page_size = v.into();
909 self
910 }
911
912 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
914 self.0.request.page_token = v.into();
915 self
916 }
917
918 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
920 self.0.request.return_partial_success = v.into();
921 self
922 }
923 }
924
925 #[doc(hidden)]
926 impl crate::RequestBuilder for ListOperations {
927 fn request_options(&mut self) -> &mut crate::RequestOptions {
928 &mut self.0.options
929 }
930 }
931
932 #[derive(Clone, Debug)]
949 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
950
951 impl GetOperation {
952 pub(crate) fn new(
953 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatastoreAdmin>,
954 ) -> Self {
955 Self(RequestBuilder::new(stub))
956 }
957
958 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
960 mut self,
961 v: V,
962 ) -> Self {
963 self.0.request = v.into();
964 self
965 }
966
967 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
969 self.0.options = v.into();
970 self
971 }
972
973 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
975 (*self.0.stub)
976 .get_operation(self.0.request, self.0.options)
977 .await
978 .map(crate::Response::into_body)
979 }
980
981 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
983 self.0.request.name = v.into();
984 self
985 }
986 }
987
988 #[doc(hidden)]
989 impl crate::RequestBuilder for GetOperation {
990 fn request_options(&mut self) -> &mut crate::RequestOptions {
991 &mut self.0.options
992 }
993 }
994
995 #[derive(Clone, Debug)]
1012 pub struct DeleteOperation(
1013 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1014 );
1015
1016 impl DeleteOperation {
1017 pub(crate) fn new(
1018 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatastoreAdmin>,
1019 ) -> Self {
1020 Self(RequestBuilder::new(stub))
1021 }
1022
1023 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1025 mut self,
1026 v: V,
1027 ) -> Self {
1028 self.0.request = v.into();
1029 self
1030 }
1031
1032 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1034 self.0.options = v.into();
1035 self
1036 }
1037
1038 pub async fn send(self) -> Result<()> {
1040 (*self.0.stub)
1041 .delete_operation(self.0.request, self.0.options)
1042 .await
1043 .map(crate::Response::into_body)
1044 }
1045
1046 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1048 self.0.request.name = v.into();
1049 self
1050 }
1051 }
1052
1053 #[doc(hidden)]
1054 impl crate::RequestBuilder for DeleteOperation {
1055 fn request_options(&mut self) -> &mut crate::RequestOptions {
1056 &mut self.0.options
1057 }
1058 }
1059
1060 #[derive(Clone, Debug)]
1077 pub struct CancelOperation(
1078 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1079 );
1080
1081 impl CancelOperation {
1082 pub(crate) fn new(
1083 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatastoreAdmin>,
1084 ) -> Self {
1085 Self(RequestBuilder::new(stub))
1086 }
1087
1088 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1090 mut self,
1091 v: V,
1092 ) -> Self {
1093 self.0.request = v.into();
1094 self
1095 }
1096
1097 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1099 self.0.options = v.into();
1100 self
1101 }
1102
1103 pub async fn send(self) -> Result<()> {
1105 (*self.0.stub)
1106 .cancel_operation(self.0.request, self.0.options)
1107 .await
1108 .map(crate::Response::into_body)
1109 }
1110
1111 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1113 self.0.request.name = v.into();
1114 self
1115 }
1116 }
1117
1118 #[doc(hidden)]
1119 impl crate::RequestBuilder for CancelOperation {
1120 fn request_options(&mut self) -> &mut crate::RequestOptions {
1121 &mut self.0.options
1122 }
1123 }
1124}