1pub mod database_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::DatabaseAdmin;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = DatabaseAdmin;
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::DatabaseAdmin>,
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::DatabaseAdmin>,
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 ListDatabases(RequestBuilder<crate::model::ListDatabasesRequest>);
96
97 impl ListDatabases {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListDatabasesRequest>>(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::ListDatabasesResponse> {
118 (*self.0.stub)
119 .list_databases(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::ListDatabasesResponse, 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::ListDatabasesResponse,
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
171 #[doc(hidden)]
172 impl crate::RequestBuilder for ListDatabases {
173 fn request_options(&mut self) -> &mut crate::RequestOptions {
174 &mut self.0.options
175 }
176 }
177
178 #[derive(Clone, Debug)]
196 pub struct CreateDatabase(RequestBuilder<crate::model::CreateDatabaseRequest>);
197
198 impl CreateDatabase {
199 pub(crate) fn new(
200 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
201 ) -> Self {
202 Self(RequestBuilder::new(stub))
203 }
204
205 pub fn with_request<V: Into<crate::model::CreateDatabaseRequest>>(mut self, v: V) -> Self {
207 self.0.request = v.into();
208 self
209 }
210
211 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
213 self.0.options = v.into();
214 self
215 }
216
217 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
224 (*self.0.stub)
225 .create_database(self.0.request, self.0.options)
226 .await
227 .map(crate::Response::into_body)
228 }
229
230 pub fn poller(
232 self,
233 ) -> impl google_cloud_lro::Poller<crate::model::Database, crate::model::CreateDatabaseMetadata>
234 {
235 type Operation = google_cloud_lro::internal::Operation<
236 crate::model::Database,
237 crate::model::CreateDatabaseMetadata,
238 >;
239 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
240 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
241 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
242 if let Some(ref mut details) = poller_options.tracing {
243 details.method_name = "google_cloud_spanner_admin_database_v1::client::DatabaseAdmin::create_database::until_done";
244 }
245
246 let stub = self.0.stub.clone();
247 let mut options = self.0.options.clone();
248 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
249 let query = move |name| {
250 let stub = stub.clone();
251 let options = options.clone();
252 async {
253 let op = GetOperation::new(stub)
254 .set_name(name)
255 .with_options(options)
256 .send()
257 .await?;
258 Ok(Operation::new(op))
259 }
260 };
261
262 let start = move || async {
263 let op = self.send().await?;
264 Ok(Operation::new(op))
265 };
266
267 use google_cloud_lro::internal::PollerExt;
268 {
269 google_cloud_lro::internal::new_poller(
270 polling_error_policy,
271 polling_backoff_policy,
272 start,
273 query,
274 )
275 }
276 .with_options(poller_options)
277 }
278
279 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
283 self.0.request.parent = v.into();
284 self
285 }
286
287 pub fn set_create_statement<T: Into<std::string::String>>(mut self, v: T) -> Self {
291 self.0.request.create_statement = v.into();
292 self
293 }
294
295 pub fn set_extra_statements<T, V>(mut self, v: T) -> Self
297 where
298 T: std::iter::IntoIterator<Item = V>,
299 V: std::convert::Into<std::string::String>,
300 {
301 use std::iter::Iterator;
302 self.0.request.extra_statements = v.into_iter().map(|i| i.into()).collect();
303 self
304 }
305
306 pub fn set_encryption_config<T>(mut self, v: T) -> Self
308 where
309 T: std::convert::Into<crate::model::EncryptionConfig>,
310 {
311 self.0.request.encryption_config = std::option::Option::Some(v.into());
312 self
313 }
314
315 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
317 where
318 T: std::convert::Into<crate::model::EncryptionConfig>,
319 {
320 self.0.request.encryption_config = v.map(|x| x.into());
321 self
322 }
323
324 pub fn set_database_dialect<T: Into<crate::model::DatabaseDialect>>(
326 mut self,
327 v: T,
328 ) -> Self {
329 self.0.request.database_dialect = v.into();
330 self
331 }
332
333 pub fn set_proto_descriptors<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
335 self.0.request.proto_descriptors = v.into();
336 self
337 }
338 }
339
340 #[doc(hidden)]
341 impl crate::RequestBuilder for CreateDatabase {
342 fn request_options(&mut self) -> &mut crate::RequestOptions {
343 &mut self.0.options
344 }
345 }
346
347 #[derive(Clone, Debug)]
364 pub struct GetDatabase(RequestBuilder<crate::model::GetDatabaseRequest>);
365
366 impl GetDatabase {
367 pub(crate) fn new(
368 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
369 ) -> Self {
370 Self(RequestBuilder::new(stub))
371 }
372
373 pub fn with_request<V: Into<crate::model::GetDatabaseRequest>>(mut self, v: V) -> Self {
375 self.0.request = v.into();
376 self
377 }
378
379 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
381 self.0.options = v.into();
382 self
383 }
384
385 pub async fn send(self) -> Result<crate::model::Database> {
387 (*self.0.stub)
388 .get_database(self.0.request, self.0.options)
389 .await
390 .map(crate::Response::into_body)
391 }
392
393 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
397 self.0.request.name = v.into();
398 self
399 }
400 }
401
402 #[doc(hidden)]
403 impl crate::RequestBuilder for GetDatabase {
404 fn request_options(&mut self) -> &mut crate::RequestOptions {
405 &mut self.0.options
406 }
407 }
408
409 #[derive(Clone, Debug)]
427 pub struct UpdateDatabase(RequestBuilder<crate::model::UpdateDatabaseRequest>);
428
429 impl UpdateDatabase {
430 pub(crate) fn new(
431 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
432 ) -> Self {
433 Self(RequestBuilder::new(stub))
434 }
435
436 pub fn with_request<V: Into<crate::model::UpdateDatabaseRequest>>(mut self, v: V) -> Self {
438 self.0.request = v.into();
439 self
440 }
441
442 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
444 self.0.options = v.into();
445 self
446 }
447
448 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
455 (*self.0.stub)
456 .update_database(self.0.request, self.0.options)
457 .await
458 .map(crate::Response::into_body)
459 }
460
461 pub fn poller(
463 self,
464 ) -> impl google_cloud_lro::Poller<crate::model::Database, crate::model::UpdateDatabaseMetadata>
465 {
466 type Operation = google_cloud_lro::internal::Operation<
467 crate::model::Database,
468 crate::model::UpdateDatabaseMetadata,
469 >;
470 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
471 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
472 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
473 if let Some(ref mut details) = poller_options.tracing {
474 details.method_name = "google_cloud_spanner_admin_database_v1::client::DatabaseAdmin::update_database::until_done";
475 }
476
477 let stub = self.0.stub.clone();
478 let mut options = self.0.options.clone();
479 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
480 let query = move |name| {
481 let stub = stub.clone();
482 let options = options.clone();
483 async {
484 let op = GetOperation::new(stub)
485 .set_name(name)
486 .with_options(options)
487 .send()
488 .await?;
489 Ok(Operation::new(op))
490 }
491 };
492
493 let start = move || async {
494 let op = self.send().await?;
495 Ok(Operation::new(op))
496 };
497
498 use google_cloud_lro::internal::PollerExt;
499 {
500 google_cloud_lro::internal::new_poller(
501 polling_error_policy,
502 polling_backoff_policy,
503 start,
504 query,
505 )
506 }
507 .with_options(poller_options)
508 }
509
510 pub fn set_database<T>(mut self, v: T) -> Self
514 where
515 T: std::convert::Into<crate::model::Database>,
516 {
517 self.0.request.database = std::option::Option::Some(v.into());
518 self
519 }
520
521 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
525 where
526 T: std::convert::Into<crate::model::Database>,
527 {
528 self.0.request.database = v.map(|x| x.into());
529 self
530 }
531
532 pub fn set_update_mask<T>(mut self, v: T) -> Self
536 where
537 T: std::convert::Into<wkt::FieldMask>,
538 {
539 self.0.request.update_mask = std::option::Option::Some(v.into());
540 self
541 }
542
543 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
547 where
548 T: std::convert::Into<wkt::FieldMask>,
549 {
550 self.0.request.update_mask = v.map(|x| x.into());
551 self
552 }
553 }
554
555 #[doc(hidden)]
556 impl crate::RequestBuilder for UpdateDatabase {
557 fn request_options(&mut self) -> &mut crate::RequestOptions {
558 &mut self.0.options
559 }
560 }
561
562 #[derive(Clone, Debug)]
580 pub struct UpdateDatabaseDdl(RequestBuilder<crate::model::UpdateDatabaseDdlRequest>);
581
582 impl UpdateDatabaseDdl {
583 pub(crate) fn new(
584 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
585 ) -> Self {
586 Self(RequestBuilder::new(stub))
587 }
588
589 pub fn with_request<V: Into<crate::model::UpdateDatabaseDdlRequest>>(
591 mut self,
592 v: V,
593 ) -> Self {
594 self.0.request = v.into();
595 self
596 }
597
598 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
600 self.0.options = v.into();
601 self
602 }
603
604 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
611 (*self.0.stub)
612 .update_database_ddl(self.0.request, self.0.options)
613 .await
614 .map(crate::Response::into_body)
615 }
616
617 pub fn poller(
619 self,
620 ) -> impl google_cloud_lro::Poller<(), crate::model::UpdateDatabaseDdlMetadata> {
621 type Operation = google_cloud_lro::internal::Operation<
622 wkt::Empty,
623 crate::model::UpdateDatabaseDdlMetadata,
624 >;
625 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
626 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
627 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
628 if let Some(ref mut details) = poller_options.tracing {
629 details.method_name = "google_cloud_spanner_admin_database_v1::client::DatabaseAdmin::update_database_ddl::until_done";
630 }
631
632 let stub = self.0.stub.clone();
633 let mut options = self.0.options.clone();
634 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
635 let query = move |name| {
636 let stub = stub.clone();
637 let options = options.clone();
638 async {
639 let op = GetOperation::new(stub)
640 .set_name(name)
641 .with_options(options)
642 .send()
643 .await?;
644 Ok(Operation::new(op))
645 }
646 };
647
648 let start = move || async {
649 let op = self.send().await?;
650 Ok(Operation::new(op))
651 };
652
653 use google_cloud_lro::internal::PollerExt;
654 {
655 google_cloud_lro::internal::new_unit_response_poller(
656 polling_error_policy,
657 polling_backoff_policy,
658 start,
659 query,
660 )
661 }
662 .with_options(poller_options)
663 }
664
665 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
669 self.0.request.database = v.into();
670 self
671 }
672
673 pub fn set_statements<T, V>(mut self, v: T) -> Self
677 where
678 T: std::iter::IntoIterator<Item = V>,
679 V: std::convert::Into<std::string::String>,
680 {
681 use std::iter::Iterator;
682 self.0.request.statements = v.into_iter().map(|i| i.into()).collect();
683 self
684 }
685
686 pub fn set_operation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
688 self.0.request.operation_id = v.into();
689 self
690 }
691
692 pub fn set_proto_descriptors<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
694 self.0.request.proto_descriptors = v.into();
695 self
696 }
697
698 pub fn set_throughput_mode<T: Into<bool>>(mut self, v: T) -> Self {
700 self.0.request.throughput_mode = v.into();
701 self
702 }
703 }
704
705 #[doc(hidden)]
706 impl crate::RequestBuilder for UpdateDatabaseDdl {
707 fn request_options(&mut self) -> &mut crate::RequestOptions {
708 &mut self.0.options
709 }
710 }
711
712 #[derive(Clone, Debug)]
729 pub struct DropDatabase(RequestBuilder<crate::model::DropDatabaseRequest>);
730
731 impl DropDatabase {
732 pub(crate) fn new(
733 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
734 ) -> Self {
735 Self(RequestBuilder::new(stub))
736 }
737
738 pub fn with_request<V: Into<crate::model::DropDatabaseRequest>>(mut self, v: V) -> Self {
740 self.0.request = v.into();
741 self
742 }
743
744 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
746 self.0.options = v.into();
747 self
748 }
749
750 pub async fn send(self) -> Result<()> {
752 (*self.0.stub)
753 .drop_database(self.0.request, self.0.options)
754 .await
755 .map(crate::Response::into_body)
756 }
757
758 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
762 self.0.request.database = v.into();
763 self
764 }
765 }
766
767 #[doc(hidden)]
768 impl crate::RequestBuilder for DropDatabase {
769 fn request_options(&mut self) -> &mut crate::RequestOptions {
770 &mut self.0.options
771 }
772 }
773
774 #[derive(Clone, Debug)]
791 pub struct GetDatabaseDdl(RequestBuilder<crate::model::GetDatabaseDdlRequest>);
792
793 impl GetDatabaseDdl {
794 pub(crate) fn new(
795 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
796 ) -> Self {
797 Self(RequestBuilder::new(stub))
798 }
799
800 pub fn with_request<V: Into<crate::model::GetDatabaseDdlRequest>>(mut self, v: V) -> Self {
802 self.0.request = v.into();
803 self
804 }
805
806 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
808 self.0.options = v.into();
809 self
810 }
811
812 pub async fn send(self) -> Result<crate::model::GetDatabaseDdlResponse> {
814 (*self.0.stub)
815 .get_database_ddl(self.0.request, self.0.options)
816 .await
817 .map(crate::Response::into_body)
818 }
819
820 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
824 self.0.request.database = v.into();
825 self
826 }
827 }
828
829 #[doc(hidden)]
830 impl crate::RequestBuilder for GetDatabaseDdl {
831 fn request_options(&mut self) -> &mut crate::RequestOptions {
832 &mut self.0.options
833 }
834 }
835
836 #[derive(Clone, Debug)]
853 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
854
855 impl SetIamPolicy {
856 pub(crate) fn new(
857 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
858 ) -> Self {
859 Self(RequestBuilder::new(stub))
860 }
861
862 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
864 mut self,
865 v: V,
866 ) -> Self {
867 self.0.request = v.into();
868 self
869 }
870
871 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
873 self.0.options = v.into();
874 self
875 }
876
877 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
879 (*self.0.stub)
880 .set_iam_policy(self.0.request, self.0.options)
881 .await
882 .map(crate::Response::into_body)
883 }
884
885 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
889 self.0.request.resource = v.into();
890 self
891 }
892
893 pub fn set_policy<T>(mut self, v: T) -> Self
897 where
898 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
899 {
900 self.0.request.policy = std::option::Option::Some(v.into());
901 self
902 }
903
904 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
908 where
909 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
910 {
911 self.0.request.policy = v.map(|x| x.into());
912 self
913 }
914
915 pub fn set_update_mask<T>(mut self, v: T) -> Self
917 where
918 T: std::convert::Into<wkt::FieldMask>,
919 {
920 self.0.request.update_mask = std::option::Option::Some(v.into());
921 self
922 }
923
924 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
926 where
927 T: std::convert::Into<wkt::FieldMask>,
928 {
929 self.0.request.update_mask = v.map(|x| x.into());
930 self
931 }
932 }
933
934 #[doc(hidden)]
935 impl crate::RequestBuilder for SetIamPolicy {
936 fn request_options(&mut self) -> &mut crate::RequestOptions {
937 &mut self.0.options
938 }
939 }
940
941 #[derive(Clone, Debug)]
958 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
959
960 impl GetIamPolicy {
961 pub(crate) fn new(
962 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
963 ) -> Self {
964 Self(RequestBuilder::new(stub))
965 }
966
967 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
969 mut self,
970 v: V,
971 ) -> Self {
972 self.0.request = v.into();
973 self
974 }
975
976 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
978 self.0.options = v.into();
979 self
980 }
981
982 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
984 (*self.0.stub)
985 .get_iam_policy(self.0.request, self.0.options)
986 .await
987 .map(crate::Response::into_body)
988 }
989
990 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
994 self.0.request.resource = v.into();
995 self
996 }
997
998 pub fn set_options<T>(mut self, v: T) -> Self
1000 where
1001 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1002 {
1003 self.0.request.options = std::option::Option::Some(v.into());
1004 self
1005 }
1006
1007 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1009 where
1010 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1011 {
1012 self.0.request.options = v.map(|x| x.into());
1013 self
1014 }
1015 }
1016
1017 #[doc(hidden)]
1018 impl crate::RequestBuilder for GetIamPolicy {
1019 fn request_options(&mut self) -> &mut crate::RequestOptions {
1020 &mut self.0.options
1021 }
1022 }
1023
1024 #[derive(Clone, Debug)]
1041 pub struct TestIamPermissions(
1042 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1043 );
1044
1045 impl TestIamPermissions {
1046 pub(crate) fn new(
1047 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1048 ) -> Self {
1049 Self(RequestBuilder::new(stub))
1050 }
1051
1052 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1054 mut self,
1055 v: V,
1056 ) -> Self {
1057 self.0.request = v.into();
1058 self
1059 }
1060
1061 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1063 self.0.options = v.into();
1064 self
1065 }
1066
1067 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1069 (*self.0.stub)
1070 .test_iam_permissions(self.0.request, self.0.options)
1071 .await
1072 .map(crate::Response::into_body)
1073 }
1074
1075 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1079 self.0.request.resource = v.into();
1080 self
1081 }
1082
1083 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1087 where
1088 T: std::iter::IntoIterator<Item = V>,
1089 V: std::convert::Into<std::string::String>,
1090 {
1091 use std::iter::Iterator;
1092 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1093 self
1094 }
1095 }
1096
1097 #[doc(hidden)]
1098 impl crate::RequestBuilder for TestIamPermissions {
1099 fn request_options(&mut self) -> &mut crate::RequestOptions {
1100 &mut self.0.options
1101 }
1102 }
1103
1104 #[derive(Clone, Debug)]
1122 pub struct CreateBackup(RequestBuilder<crate::model::CreateBackupRequest>);
1123
1124 impl CreateBackup {
1125 pub(crate) fn new(
1126 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1127 ) -> Self {
1128 Self(RequestBuilder::new(stub))
1129 }
1130
1131 pub fn with_request<V: Into<crate::model::CreateBackupRequest>>(mut self, v: V) -> Self {
1133 self.0.request = v.into();
1134 self
1135 }
1136
1137 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1139 self.0.options = v.into();
1140 self
1141 }
1142
1143 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1150 (*self.0.stub)
1151 .create_backup(self.0.request, self.0.options)
1152 .await
1153 .map(crate::Response::into_body)
1154 }
1155
1156 pub fn poller(
1158 self,
1159 ) -> impl google_cloud_lro::Poller<crate::model::Backup, crate::model::CreateBackupMetadata>
1160 {
1161 type Operation = google_cloud_lro::internal::Operation<
1162 crate::model::Backup,
1163 crate::model::CreateBackupMetadata,
1164 >;
1165 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1166 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1167 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1168 if let Some(ref mut details) = poller_options.tracing {
1169 details.method_name = "google_cloud_spanner_admin_database_v1::client::DatabaseAdmin::create_backup::until_done";
1170 }
1171
1172 let stub = self.0.stub.clone();
1173 let mut options = self.0.options.clone();
1174 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1175 let query = move |name| {
1176 let stub = stub.clone();
1177 let options = options.clone();
1178 async {
1179 let op = GetOperation::new(stub)
1180 .set_name(name)
1181 .with_options(options)
1182 .send()
1183 .await?;
1184 Ok(Operation::new(op))
1185 }
1186 };
1187
1188 let start = move || async {
1189 let op = self.send().await?;
1190 Ok(Operation::new(op))
1191 };
1192
1193 use google_cloud_lro::internal::PollerExt;
1194 {
1195 google_cloud_lro::internal::new_poller(
1196 polling_error_policy,
1197 polling_backoff_policy,
1198 start,
1199 query,
1200 )
1201 }
1202 .with_options(poller_options)
1203 }
1204
1205 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1209 self.0.request.parent = v.into();
1210 self
1211 }
1212
1213 pub fn set_backup_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1217 self.0.request.backup_id = v.into();
1218 self
1219 }
1220
1221 pub fn set_backup<T>(mut self, v: T) -> Self
1225 where
1226 T: std::convert::Into<crate::model::Backup>,
1227 {
1228 self.0.request.backup = std::option::Option::Some(v.into());
1229 self
1230 }
1231
1232 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
1236 where
1237 T: std::convert::Into<crate::model::Backup>,
1238 {
1239 self.0.request.backup = v.map(|x| x.into());
1240 self
1241 }
1242
1243 pub fn set_encryption_config<T>(mut self, v: T) -> Self
1245 where
1246 T: std::convert::Into<crate::model::CreateBackupEncryptionConfig>,
1247 {
1248 self.0.request.encryption_config = std::option::Option::Some(v.into());
1249 self
1250 }
1251
1252 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
1254 where
1255 T: std::convert::Into<crate::model::CreateBackupEncryptionConfig>,
1256 {
1257 self.0.request.encryption_config = v.map(|x| x.into());
1258 self
1259 }
1260 }
1261
1262 #[doc(hidden)]
1263 impl crate::RequestBuilder for CreateBackup {
1264 fn request_options(&mut self) -> &mut crate::RequestOptions {
1265 &mut self.0.options
1266 }
1267 }
1268
1269 #[derive(Clone, Debug)]
1287 pub struct CopyBackup(RequestBuilder<crate::model::CopyBackupRequest>);
1288
1289 impl CopyBackup {
1290 pub(crate) fn new(
1291 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1292 ) -> Self {
1293 Self(RequestBuilder::new(stub))
1294 }
1295
1296 pub fn with_request<V: Into<crate::model::CopyBackupRequest>>(mut self, v: V) -> Self {
1298 self.0.request = v.into();
1299 self
1300 }
1301
1302 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1304 self.0.options = v.into();
1305 self
1306 }
1307
1308 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1315 (*self.0.stub)
1316 .copy_backup(self.0.request, self.0.options)
1317 .await
1318 .map(crate::Response::into_body)
1319 }
1320
1321 pub fn poller(
1323 self,
1324 ) -> impl google_cloud_lro::Poller<crate::model::Backup, crate::model::CopyBackupMetadata>
1325 {
1326 type Operation = google_cloud_lro::internal::Operation<
1327 crate::model::Backup,
1328 crate::model::CopyBackupMetadata,
1329 >;
1330 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1331 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1332 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1333 if let Some(ref mut details) = poller_options.tracing {
1334 details.method_name = "google_cloud_spanner_admin_database_v1::client::DatabaseAdmin::copy_backup::until_done";
1335 }
1336
1337 let stub = self.0.stub.clone();
1338 let mut options = self.0.options.clone();
1339 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1340 let query = move |name| {
1341 let stub = stub.clone();
1342 let options = options.clone();
1343 async {
1344 let op = GetOperation::new(stub)
1345 .set_name(name)
1346 .with_options(options)
1347 .send()
1348 .await?;
1349 Ok(Operation::new(op))
1350 }
1351 };
1352
1353 let start = move || async {
1354 let op = self.send().await?;
1355 Ok(Operation::new(op))
1356 };
1357
1358 use google_cloud_lro::internal::PollerExt;
1359 {
1360 google_cloud_lro::internal::new_poller(
1361 polling_error_policy,
1362 polling_backoff_policy,
1363 start,
1364 query,
1365 )
1366 }
1367 .with_options(poller_options)
1368 }
1369
1370 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1374 self.0.request.parent = v.into();
1375 self
1376 }
1377
1378 pub fn set_backup_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1382 self.0.request.backup_id = v.into();
1383 self
1384 }
1385
1386 pub fn set_source_backup<T: Into<std::string::String>>(mut self, v: T) -> Self {
1390 self.0.request.source_backup = v.into();
1391 self
1392 }
1393
1394 pub fn set_expire_time<T>(mut self, v: T) -> Self
1398 where
1399 T: std::convert::Into<wkt::Timestamp>,
1400 {
1401 self.0.request.expire_time = std::option::Option::Some(v.into());
1402 self
1403 }
1404
1405 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
1409 where
1410 T: std::convert::Into<wkt::Timestamp>,
1411 {
1412 self.0.request.expire_time = v.map(|x| x.into());
1413 self
1414 }
1415
1416 pub fn set_encryption_config<T>(mut self, v: T) -> Self
1418 where
1419 T: std::convert::Into<crate::model::CopyBackupEncryptionConfig>,
1420 {
1421 self.0.request.encryption_config = std::option::Option::Some(v.into());
1422 self
1423 }
1424
1425 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
1427 where
1428 T: std::convert::Into<crate::model::CopyBackupEncryptionConfig>,
1429 {
1430 self.0.request.encryption_config = v.map(|x| x.into());
1431 self
1432 }
1433 }
1434
1435 #[doc(hidden)]
1436 impl crate::RequestBuilder for CopyBackup {
1437 fn request_options(&mut self) -> &mut crate::RequestOptions {
1438 &mut self.0.options
1439 }
1440 }
1441
1442 #[derive(Clone, Debug)]
1459 pub struct GetBackup(RequestBuilder<crate::model::GetBackupRequest>);
1460
1461 impl GetBackup {
1462 pub(crate) fn new(
1463 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1464 ) -> Self {
1465 Self(RequestBuilder::new(stub))
1466 }
1467
1468 pub fn with_request<V: Into<crate::model::GetBackupRequest>>(mut self, v: V) -> Self {
1470 self.0.request = v.into();
1471 self
1472 }
1473
1474 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1476 self.0.options = v.into();
1477 self
1478 }
1479
1480 pub async fn send(self) -> Result<crate::model::Backup> {
1482 (*self.0.stub)
1483 .get_backup(self.0.request, self.0.options)
1484 .await
1485 .map(crate::Response::into_body)
1486 }
1487
1488 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1492 self.0.request.name = v.into();
1493 self
1494 }
1495 }
1496
1497 #[doc(hidden)]
1498 impl crate::RequestBuilder for GetBackup {
1499 fn request_options(&mut self) -> &mut crate::RequestOptions {
1500 &mut self.0.options
1501 }
1502 }
1503
1504 #[derive(Clone, Debug)]
1521 pub struct UpdateBackup(RequestBuilder<crate::model::UpdateBackupRequest>);
1522
1523 impl UpdateBackup {
1524 pub(crate) fn new(
1525 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1526 ) -> Self {
1527 Self(RequestBuilder::new(stub))
1528 }
1529
1530 pub fn with_request<V: Into<crate::model::UpdateBackupRequest>>(mut self, v: V) -> Self {
1532 self.0.request = v.into();
1533 self
1534 }
1535
1536 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1538 self.0.options = v.into();
1539 self
1540 }
1541
1542 pub async fn send(self) -> Result<crate::model::Backup> {
1544 (*self.0.stub)
1545 .update_backup(self.0.request, self.0.options)
1546 .await
1547 .map(crate::Response::into_body)
1548 }
1549
1550 pub fn set_backup<T>(mut self, v: T) -> Self
1554 where
1555 T: std::convert::Into<crate::model::Backup>,
1556 {
1557 self.0.request.backup = std::option::Option::Some(v.into());
1558 self
1559 }
1560
1561 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
1565 where
1566 T: std::convert::Into<crate::model::Backup>,
1567 {
1568 self.0.request.backup = v.map(|x| x.into());
1569 self
1570 }
1571
1572 pub fn set_update_mask<T>(mut self, v: T) -> Self
1576 where
1577 T: std::convert::Into<wkt::FieldMask>,
1578 {
1579 self.0.request.update_mask = std::option::Option::Some(v.into());
1580 self
1581 }
1582
1583 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1587 where
1588 T: std::convert::Into<wkt::FieldMask>,
1589 {
1590 self.0.request.update_mask = v.map(|x| x.into());
1591 self
1592 }
1593 }
1594
1595 #[doc(hidden)]
1596 impl crate::RequestBuilder for UpdateBackup {
1597 fn request_options(&mut self) -> &mut crate::RequestOptions {
1598 &mut self.0.options
1599 }
1600 }
1601
1602 #[derive(Clone, Debug)]
1619 pub struct DeleteBackup(RequestBuilder<crate::model::DeleteBackupRequest>);
1620
1621 impl DeleteBackup {
1622 pub(crate) fn new(
1623 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1624 ) -> Self {
1625 Self(RequestBuilder::new(stub))
1626 }
1627
1628 pub fn with_request<V: Into<crate::model::DeleteBackupRequest>>(mut self, v: V) -> Self {
1630 self.0.request = v.into();
1631 self
1632 }
1633
1634 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1636 self.0.options = v.into();
1637 self
1638 }
1639
1640 pub async fn send(self) -> Result<()> {
1642 (*self.0.stub)
1643 .delete_backup(self.0.request, self.0.options)
1644 .await
1645 .map(crate::Response::into_body)
1646 }
1647
1648 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1652 self.0.request.name = v.into();
1653 self
1654 }
1655 }
1656
1657 #[doc(hidden)]
1658 impl crate::RequestBuilder for DeleteBackup {
1659 fn request_options(&mut self) -> &mut crate::RequestOptions {
1660 &mut self.0.options
1661 }
1662 }
1663
1664 #[derive(Clone, Debug)]
1685 pub struct ListBackups(RequestBuilder<crate::model::ListBackupsRequest>);
1686
1687 impl ListBackups {
1688 pub(crate) fn new(
1689 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1690 ) -> Self {
1691 Self(RequestBuilder::new(stub))
1692 }
1693
1694 pub fn with_request<V: Into<crate::model::ListBackupsRequest>>(mut self, v: V) -> Self {
1696 self.0.request = v.into();
1697 self
1698 }
1699
1700 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1702 self.0.options = v.into();
1703 self
1704 }
1705
1706 pub async fn send(self) -> Result<crate::model::ListBackupsResponse> {
1708 (*self.0.stub)
1709 .list_backups(self.0.request, self.0.options)
1710 .await
1711 .map(crate::Response::into_body)
1712 }
1713
1714 pub fn by_page(
1716 self,
1717 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListBackupsResponse, crate::Error>
1718 {
1719 use std::clone::Clone;
1720 let token = self.0.request.page_token.clone();
1721 let execute = move |token: String| {
1722 let mut builder = self.clone();
1723 builder.0.request = builder.0.request.set_page_token(token);
1724 builder.send()
1725 };
1726 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1727 }
1728
1729 pub fn by_item(
1731 self,
1732 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1733 crate::model::ListBackupsResponse,
1734 crate::Error,
1735 > {
1736 use google_cloud_gax::paginator::Paginator;
1737 self.by_page().items()
1738 }
1739
1740 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1744 self.0.request.parent = v.into();
1745 self
1746 }
1747
1748 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1750 self.0.request.filter = v.into();
1751 self
1752 }
1753
1754 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1756 self.0.request.page_size = v.into();
1757 self
1758 }
1759
1760 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1762 self.0.request.page_token = v.into();
1763 self
1764 }
1765 }
1766
1767 #[doc(hidden)]
1768 impl crate::RequestBuilder for ListBackups {
1769 fn request_options(&mut self) -> &mut crate::RequestOptions {
1770 &mut self.0.options
1771 }
1772 }
1773
1774 #[derive(Clone, Debug)]
1792 pub struct RestoreDatabase(RequestBuilder<crate::model::RestoreDatabaseRequest>);
1793
1794 impl RestoreDatabase {
1795 pub(crate) fn new(
1796 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1797 ) -> Self {
1798 Self(RequestBuilder::new(stub))
1799 }
1800
1801 pub fn with_request<V: Into<crate::model::RestoreDatabaseRequest>>(mut self, v: V) -> Self {
1803 self.0.request = v.into();
1804 self
1805 }
1806
1807 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1809 self.0.options = v.into();
1810 self
1811 }
1812
1813 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1820 (*self.0.stub)
1821 .restore_database(self.0.request, self.0.options)
1822 .await
1823 .map(crate::Response::into_body)
1824 }
1825
1826 pub fn poller(
1828 self,
1829 ) -> impl google_cloud_lro::Poller<crate::model::Database, crate::model::RestoreDatabaseMetadata>
1830 {
1831 type Operation = google_cloud_lro::internal::Operation<
1832 crate::model::Database,
1833 crate::model::RestoreDatabaseMetadata,
1834 >;
1835 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1836 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1837 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1838 if let Some(ref mut details) = poller_options.tracing {
1839 details.method_name = "google_cloud_spanner_admin_database_v1::client::DatabaseAdmin::restore_database::until_done";
1840 }
1841
1842 let stub = self.0.stub.clone();
1843 let mut options = self.0.options.clone();
1844 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1845 let query = move |name| {
1846 let stub = stub.clone();
1847 let options = options.clone();
1848 async {
1849 let op = GetOperation::new(stub)
1850 .set_name(name)
1851 .with_options(options)
1852 .send()
1853 .await?;
1854 Ok(Operation::new(op))
1855 }
1856 };
1857
1858 let start = move || async {
1859 let op = self.send().await?;
1860 Ok(Operation::new(op))
1861 };
1862
1863 use google_cloud_lro::internal::PollerExt;
1864 {
1865 google_cloud_lro::internal::new_poller(
1866 polling_error_policy,
1867 polling_backoff_policy,
1868 start,
1869 query,
1870 )
1871 }
1872 .with_options(poller_options)
1873 }
1874
1875 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1879 self.0.request.parent = v.into();
1880 self
1881 }
1882
1883 pub fn set_database_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1887 self.0.request.database_id = v.into();
1888 self
1889 }
1890
1891 pub fn set_encryption_config<T>(mut self, v: T) -> Self
1893 where
1894 T: std::convert::Into<crate::model::RestoreDatabaseEncryptionConfig>,
1895 {
1896 self.0.request.encryption_config = std::option::Option::Some(v.into());
1897 self
1898 }
1899
1900 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
1902 where
1903 T: std::convert::Into<crate::model::RestoreDatabaseEncryptionConfig>,
1904 {
1905 self.0.request.encryption_config = v.map(|x| x.into());
1906 self
1907 }
1908
1909 pub fn set_source<T: Into<Option<crate::model::restore_database_request::Source>>>(
1914 mut self,
1915 v: T,
1916 ) -> Self {
1917 self.0.request.source = v.into();
1918 self
1919 }
1920
1921 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1927 self.0.request = self.0.request.set_backup(v);
1928 self
1929 }
1930 }
1931
1932 #[doc(hidden)]
1933 impl crate::RequestBuilder for RestoreDatabase {
1934 fn request_options(&mut self) -> &mut crate::RequestOptions {
1935 &mut self.0.options
1936 }
1937 }
1938
1939 #[derive(Clone, Debug)]
1960 pub struct ListDatabaseOperations(RequestBuilder<crate::model::ListDatabaseOperationsRequest>);
1961
1962 impl ListDatabaseOperations {
1963 pub(crate) fn new(
1964 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1965 ) -> Self {
1966 Self(RequestBuilder::new(stub))
1967 }
1968
1969 pub fn with_request<V: Into<crate::model::ListDatabaseOperationsRequest>>(
1971 mut self,
1972 v: V,
1973 ) -> Self {
1974 self.0.request = v.into();
1975 self
1976 }
1977
1978 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1980 self.0.options = v.into();
1981 self
1982 }
1983
1984 pub async fn send(self) -> Result<crate::model::ListDatabaseOperationsResponse> {
1986 (*self.0.stub)
1987 .list_database_operations(self.0.request, self.0.options)
1988 .await
1989 .map(crate::Response::into_body)
1990 }
1991
1992 pub fn by_page(
1994 self,
1995 ) -> impl google_cloud_gax::paginator::Paginator<
1996 crate::model::ListDatabaseOperationsResponse,
1997 crate::Error,
1998 > {
1999 use std::clone::Clone;
2000 let token = self.0.request.page_token.clone();
2001 let execute = move |token: String| {
2002 let mut builder = self.clone();
2003 builder.0.request = builder.0.request.set_page_token(token);
2004 builder.send()
2005 };
2006 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2007 }
2008
2009 pub fn by_item(
2011 self,
2012 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2013 crate::model::ListDatabaseOperationsResponse,
2014 crate::Error,
2015 > {
2016 use google_cloud_gax::paginator::Paginator;
2017 self.by_page().items()
2018 }
2019
2020 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2024 self.0.request.parent = v.into();
2025 self
2026 }
2027
2028 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2030 self.0.request.filter = v.into();
2031 self
2032 }
2033
2034 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2036 self.0.request.page_size = v.into();
2037 self
2038 }
2039
2040 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2042 self.0.request.page_token = v.into();
2043 self
2044 }
2045 }
2046
2047 #[doc(hidden)]
2048 impl crate::RequestBuilder for ListDatabaseOperations {
2049 fn request_options(&mut self) -> &mut crate::RequestOptions {
2050 &mut self.0.options
2051 }
2052 }
2053
2054 #[derive(Clone, Debug)]
2075 pub struct ListBackupOperations(RequestBuilder<crate::model::ListBackupOperationsRequest>);
2076
2077 impl ListBackupOperations {
2078 pub(crate) fn new(
2079 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2080 ) -> Self {
2081 Self(RequestBuilder::new(stub))
2082 }
2083
2084 pub fn with_request<V: Into<crate::model::ListBackupOperationsRequest>>(
2086 mut self,
2087 v: V,
2088 ) -> Self {
2089 self.0.request = v.into();
2090 self
2091 }
2092
2093 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2095 self.0.options = v.into();
2096 self
2097 }
2098
2099 pub async fn send(self) -> Result<crate::model::ListBackupOperationsResponse> {
2101 (*self.0.stub)
2102 .list_backup_operations(self.0.request, self.0.options)
2103 .await
2104 .map(crate::Response::into_body)
2105 }
2106
2107 pub fn by_page(
2109 self,
2110 ) -> impl google_cloud_gax::paginator::Paginator<
2111 crate::model::ListBackupOperationsResponse,
2112 crate::Error,
2113 > {
2114 use std::clone::Clone;
2115 let token = self.0.request.page_token.clone();
2116 let execute = move |token: String| {
2117 let mut builder = self.clone();
2118 builder.0.request = builder.0.request.set_page_token(token);
2119 builder.send()
2120 };
2121 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2122 }
2123
2124 pub fn by_item(
2126 self,
2127 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2128 crate::model::ListBackupOperationsResponse,
2129 crate::Error,
2130 > {
2131 use google_cloud_gax::paginator::Paginator;
2132 self.by_page().items()
2133 }
2134
2135 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2139 self.0.request.parent = v.into();
2140 self
2141 }
2142
2143 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2145 self.0.request.filter = v.into();
2146 self
2147 }
2148
2149 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2151 self.0.request.page_size = v.into();
2152 self
2153 }
2154
2155 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2157 self.0.request.page_token = v.into();
2158 self
2159 }
2160 }
2161
2162 #[doc(hidden)]
2163 impl crate::RequestBuilder for ListBackupOperations {
2164 fn request_options(&mut self) -> &mut crate::RequestOptions {
2165 &mut self.0.options
2166 }
2167 }
2168
2169 #[derive(Clone, Debug)]
2190 pub struct ListDatabaseRoles(RequestBuilder<crate::model::ListDatabaseRolesRequest>);
2191
2192 impl ListDatabaseRoles {
2193 pub(crate) fn new(
2194 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2195 ) -> Self {
2196 Self(RequestBuilder::new(stub))
2197 }
2198
2199 pub fn with_request<V: Into<crate::model::ListDatabaseRolesRequest>>(
2201 mut self,
2202 v: V,
2203 ) -> Self {
2204 self.0.request = v.into();
2205 self
2206 }
2207
2208 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2210 self.0.options = v.into();
2211 self
2212 }
2213
2214 pub async fn send(self) -> Result<crate::model::ListDatabaseRolesResponse> {
2216 (*self.0.stub)
2217 .list_database_roles(self.0.request, self.0.options)
2218 .await
2219 .map(crate::Response::into_body)
2220 }
2221
2222 pub fn by_page(
2224 self,
2225 ) -> impl google_cloud_gax::paginator::Paginator<
2226 crate::model::ListDatabaseRolesResponse,
2227 crate::Error,
2228 > {
2229 use std::clone::Clone;
2230 let token = self.0.request.page_token.clone();
2231 let execute = move |token: String| {
2232 let mut builder = self.clone();
2233 builder.0.request = builder.0.request.set_page_token(token);
2234 builder.send()
2235 };
2236 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2237 }
2238
2239 pub fn by_item(
2241 self,
2242 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2243 crate::model::ListDatabaseRolesResponse,
2244 crate::Error,
2245 > {
2246 use google_cloud_gax::paginator::Paginator;
2247 self.by_page().items()
2248 }
2249
2250 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2254 self.0.request.parent = v.into();
2255 self
2256 }
2257
2258 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2260 self.0.request.page_size = v.into();
2261 self
2262 }
2263
2264 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2266 self.0.request.page_token = v.into();
2267 self
2268 }
2269 }
2270
2271 #[doc(hidden)]
2272 impl crate::RequestBuilder for ListDatabaseRoles {
2273 fn request_options(&mut self) -> &mut crate::RequestOptions {
2274 &mut self.0.options
2275 }
2276 }
2277
2278 #[derive(Clone, Debug)]
2295 pub struct AddSplitPoints(RequestBuilder<crate::model::AddSplitPointsRequest>);
2296
2297 impl AddSplitPoints {
2298 pub(crate) fn new(
2299 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2300 ) -> Self {
2301 Self(RequestBuilder::new(stub))
2302 }
2303
2304 pub fn with_request<V: Into<crate::model::AddSplitPointsRequest>>(mut self, v: V) -> Self {
2306 self.0.request = v.into();
2307 self
2308 }
2309
2310 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2312 self.0.options = v.into();
2313 self
2314 }
2315
2316 pub async fn send(self) -> Result<crate::model::AddSplitPointsResponse> {
2318 (*self.0.stub)
2319 .add_split_points(self.0.request, self.0.options)
2320 .await
2321 .map(crate::Response::into_body)
2322 }
2323
2324 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
2328 self.0.request.database = v.into();
2329 self
2330 }
2331
2332 pub fn set_split_points<T, V>(mut self, v: T) -> Self
2336 where
2337 T: std::iter::IntoIterator<Item = V>,
2338 V: std::convert::Into<crate::model::SplitPoints>,
2339 {
2340 use std::iter::Iterator;
2341 self.0.request.split_points = v.into_iter().map(|i| i.into()).collect();
2342 self
2343 }
2344
2345 pub fn set_initiator<T: Into<std::string::String>>(mut self, v: T) -> Self {
2347 self.0.request.initiator = v.into();
2348 self
2349 }
2350 }
2351
2352 #[doc(hidden)]
2353 impl crate::RequestBuilder for AddSplitPoints {
2354 fn request_options(&mut self) -> &mut crate::RequestOptions {
2355 &mut self.0.options
2356 }
2357 }
2358
2359 #[derive(Clone, Debug)]
2376 pub struct CreateBackupSchedule(RequestBuilder<crate::model::CreateBackupScheduleRequest>);
2377
2378 impl CreateBackupSchedule {
2379 pub(crate) fn new(
2380 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2381 ) -> Self {
2382 Self(RequestBuilder::new(stub))
2383 }
2384
2385 pub fn with_request<V: Into<crate::model::CreateBackupScheduleRequest>>(
2387 mut self,
2388 v: V,
2389 ) -> Self {
2390 self.0.request = v.into();
2391 self
2392 }
2393
2394 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2396 self.0.options = v.into();
2397 self
2398 }
2399
2400 pub async fn send(self) -> Result<crate::model::BackupSchedule> {
2402 (*self.0.stub)
2403 .create_backup_schedule(self.0.request, self.0.options)
2404 .await
2405 .map(crate::Response::into_body)
2406 }
2407
2408 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2412 self.0.request.parent = v.into();
2413 self
2414 }
2415
2416 pub fn set_backup_schedule_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2420 self.0.request.backup_schedule_id = v.into();
2421 self
2422 }
2423
2424 pub fn set_backup_schedule<T>(mut self, v: T) -> Self
2428 where
2429 T: std::convert::Into<crate::model::BackupSchedule>,
2430 {
2431 self.0.request.backup_schedule = std::option::Option::Some(v.into());
2432 self
2433 }
2434
2435 pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
2439 where
2440 T: std::convert::Into<crate::model::BackupSchedule>,
2441 {
2442 self.0.request.backup_schedule = v.map(|x| x.into());
2443 self
2444 }
2445 }
2446
2447 #[doc(hidden)]
2448 impl crate::RequestBuilder for CreateBackupSchedule {
2449 fn request_options(&mut self) -> &mut crate::RequestOptions {
2450 &mut self.0.options
2451 }
2452 }
2453
2454 #[derive(Clone, Debug)]
2471 pub struct GetBackupSchedule(RequestBuilder<crate::model::GetBackupScheduleRequest>);
2472
2473 impl GetBackupSchedule {
2474 pub(crate) fn new(
2475 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2476 ) -> Self {
2477 Self(RequestBuilder::new(stub))
2478 }
2479
2480 pub fn with_request<V: Into<crate::model::GetBackupScheduleRequest>>(
2482 mut self,
2483 v: V,
2484 ) -> Self {
2485 self.0.request = v.into();
2486 self
2487 }
2488
2489 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2491 self.0.options = v.into();
2492 self
2493 }
2494
2495 pub async fn send(self) -> Result<crate::model::BackupSchedule> {
2497 (*self.0.stub)
2498 .get_backup_schedule(self.0.request, self.0.options)
2499 .await
2500 .map(crate::Response::into_body)
2501 }
2502
2503 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2507 self.0.request.name = v.into();
2508 self
2509 }
2510 }
2511
2512 #[doc(hidden)]
2513 impl crate::RequestBuilder for GetBackupSchedule {
2514 fn request_options(&mut self) -> &mut crate::RequestOptions {
2515 &mut self.0.options
2516 }
2517 }
2518
2519 #[derive(Clone, Debug)]
2536 pub struct UpdateBackupSchedule(RequestBuilder<crate::model::UpdateBackupScheduleRequest>);
2537
2538 impl UpdateBackupSchedule {
2539 pub(crate) fn new(
2540 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2541 ) -> Self {
2542 Self(RequestBuilder::new(stub))
2543 }
2544
2545 pub fn with_request<V: Into<crate::model::UpdateBackupScheduleRequest>>(
2547 mut self,
2548 v: V,
2549 ) -> Self {
2550 self.0.request = v.into();
2551 self
2552 }
2553
2554 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2556 self.0.options = v.into();
2557 self
2558 }
2559
2560 pub async fn send(self) -> Result<crate::model::BackupSchedule> {
2562 (*self.0.stub)
2563 .update_backup_schedule(self.0.request, self.0.options)
2564 .await
2565 .map(crate::Response::into_body)
2566 }
2567
2568 pub fn set_backup_schedule<T>(mut self, v: T) -> Self
2572 where
2573 T: std::convert::Into<crate::model::BackupSchedule>,
2574 {
2575 self.0.request.backup_schedule = std::option::Option::Some(v.into());
2576 self
2577 }
2578
2579 pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
2583 where
2584 T: std::convert::Into<crate::model::BackupSchedule>,
2585 {
2586 self.0.request.backup_schedule = v.map(|x| x.into());
2587 self
2588 }
2589
2590 pub fn set_update_mask<T>(mut self, v: T) -> Self
2594 where
2595 T: std::convert::Into<wkt::FieldMask>,
2596 {
2597 self.0.request.update_mask = std::option::Option::Some(v.into());
2598 self
2599 }
2600
2601 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2605 where
2606 T: std::convert::Into<wkt::FieldMask>,
2607 {
2608 self.0.request.update_mask = v.map(|x| x.into());
2609 self
2610 }
2611 }
2612
2613 #[doc(hidden)]
2614 impl crate::RequestBuilder for UpdateBackupSchedule {
2615 fn request_options(&mut self) -> &mut crate::RequestOptions {
2616 &mut self.0.options
2617 }
2618 }
2619
2620 #[derive(Clone, Debug)]
2637 pub struct DeleteBackupSchedule(RequestBuilder<crate::model::DeleteBackupScheduleRequest>);
2638
2639 impl DeleteBackupSchedule {
2640 pub(crate) fn new(
2641 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2642 ) -> Self {
2643 Self(RequestBuilder::new(stub))
2644 }
2645
2646 pub fn with_request<V: Into<crate::model::DeleteBackupScheduleRequest>>(
2648 mut self,
2649 v: V,
2650 ) -> Self {
2651 self.0.request = v.into();
2652 self
2653 }
2654
2655 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2657 self.0.options = v.into();
2658 self
2659 }
2660
2661 pub async fn send(self) -> Result<()> {
2663 (*self.0.stub)
2664 .delete_backup_schedule(self.0.request, self.0.options)
2665 .await
2666 .map(crate::Response::into_body)
2667 }
2668
2669 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2673 self.0.request.name = v.into();
2674 self
2675 }
2676 }
2677
2678 #[doc(hidden)]
2679 impl crate::RequestBuilder for DeleteBackupSchedule {
2680 fn request_options(&mut self) -> &mut crate::RequestOptions {
2681 &mut self.0.options
2682 }
2683 }
2684
2685 #[derive(Clone, Debug)]
2706 pub struct ListBackupSchedules(RequestBuilder<crate::model::ListBackupSchedulesRequest>);
2707
2708 impl ListBackupSchedules {
2709 pub(crate) fn new(
2710 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2711 ) -> Self {
2712 Self(RequestBuilder::new(stub))
2713 }
2714
2715 pub fn with_request<V: Into<crate::model::ListBackupSchedulesRequest>>(
2717 mut self,
2718 v: V,
2719 ) -> Self {
2720 self.0.request = v.into();
2721 self
2722 }
2723
2724 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2726 self.0.options = v.into();
2727 self
2728 }
2729
2730 pub async fn send(self) -> Result<crate::model::ListBackupSchedulesResponse> {
2732 (*self.0.stub)
2733 .list_backup_schedules(self.0.request, self.0.options)
2734 .await
2735 .map(crate::Response::into_body)
2736 }
2737
2738 pub fn by_page(
2740 self,
2741 ) -> impl google_cloud_gax::paginator::Paginator<
2742 crate::model::ListBackupSchedulesResponse,
2743 crate::Error,
2744 > {
2745 use std::clone::Clone;
2746 let token = self.0.request.page_token.clone();
2747 let execute = move |token: String| {
2748 let mut builder = self.clone();
2749 builder.0.request = builder.0.request.set_page_token(token);
2750 builder.send()
2751 };
2752 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2753 }
2754
2755 pub fn by_item(
2757 self,
2758 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2759 crate::model::ListBackupSchedulesResponse,
2760 crate::Error,
2761 > {
2762 use google_cloud_gax::paginator::Paginator;
2763 self.by_page().items()
2764 }
2765
2766 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2770 self.0.request.parent = v.into();
2771 self
2772 }
2773
2774 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2776 self.0.request.page_size = v.into();
2777 self
2778 }
2779
2780 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2782 self.0.request.page_token = v.into();
2783 self
2784 }
2785 }
2786
2787 #[doc(hidden)]
2788 impl crate::RequestBuilder for ListBackupSchedules {
2789 fn request_options(&mut self) -> &mut crate::RequestOptions {
2790 &mut self.0.options
2791 }
2792 }
2793
2794 #[derive(Clone, Debug)]
2815 pub struct ListOperations(
2816 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2817 );
2818
2819 impl ListOperations {
2820 pub(crate) fn new(
2821 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2822 ) -> Self {
2823 Self(RequestBuilder::new(stub))
2824 }
2825
2826 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2828 mut self,
2829 v: V,
2830 ) -> Self {
2831 self.0.request = v.into();
2832 self
2833 }
2834
2835 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2837 self.0.options = v.into();
2838 self
2839 }
2840
2841 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2843 (*self.0.stub)
2844 .list_operations(self.0.request, self.0.options)
2845 .await
2846 .map(crate::Response::into_body)
2847 }
2848
2849 pub fn by_page(
2851 self,
2852 ) -> impl google_cloud_gax::paginator::Paginator<
2853 google_cloud_longrunning::model::ListOperationsResponse,
2854 crate::Error,
2855 > {
2856 use std::clone::Clone;
2857 let token = self.0.request.page_token.clone();
2858 let execute = move |token: String| {
2859 let mut builder = self.clone();
2860 builder.0.request = builder.0.request.set_page_token(token);
2861 builder.send()
2862 };
2863 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2864 }
2865
2866 pub fn by_item(
2868 self,
2869 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2870 google_cloud_longrunning::model::ListOperationsResponse,
2871 crate::Error,
2872 > {
2873 use google_cloud_gax::paginator::Paginator;
2874 self.by_page().items()
2875 }
2876
2877 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2879 self.0.request.name = v.into();
2880 self
2881 }
2882
2883 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2885 self.0.request.filter = v.into();
2886 self
2887 }
2888
2889 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2891 self.0.request.page_size = v.into();
2892 self
2893 }
2894
2895 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2897 self.0.request.page_token = v.into();
2898 self
2899 }
2900
2901 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2903 self.0.request.return_partial_success = v.into();
2904 self
2905 }
2906 }
2907
2908 #[doc(hidden)]
2909 impl crate::RequestBuilder for ListOperations {
2910 fn request_options(&mut self) -> &mut crate::RequestOptions {
2911 &mut self.0.options
2912 }
2913 }
2914
2915 #[derive(Clone, Debug)]
2932 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2933
2934 impl GetOperation {
2935 pub(crate) fn new(
2936 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2937 ) -> Self {
2938 Self(RequestBuilder::new(stub))
2939 }
2940
2941 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2943 mut self,
2944 v: V,
2945 ) -> Self {
2946 self.0.request = v.into();
2947 self
2948 }
2949
2950 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2952 self.0.options = v.into();
2953 self
2954 }
2955
2956 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2958 (*self.0.stub)
2959 .get_operation(self.0.request, self.0.options)
2960 .await
2961 .map(crate::Response::into_body)
2962 }
2963
2964 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2966 self.0.request.name = v.into();
2967 self
2968 }
2969 }
2970
2971 #[doc(hidden)]
2972 impl crate::RequestBuilder for GetOperation {
2973 fn request_options(&mut self) -> &mut crate::RequestOptions {
2974 &mut self.0.options
2975 }
2976 }
2977
2978 #[derive(Clone, Debug)]
2995 pub struct DeleteOperation(
2996 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2997 );
2998
2999 impl DeleteOperation {
3000 pub(crate) fn new(
3001 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
3002 ) -> Self {
3003 Self(RequestBuilder::new(stub))
3004 }
3005
3006 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3008 mut self,
3009 v: V,
3010 ) -> Self {
3011 self.0.request = v.into();
3012 self
3013 }
3014
3015 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3017 self.0.options = v.into();
3018 self
3019 }
3020
3021 pub async fn send(self) -> Result<()> {
3023 (*self.0.stub)
3024 .delete_operation(self.0.request, self.0.options)
3025 .await
3026 .map(crate::Response::into_body)
3027 }
3028
3029 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3031 self.0.request.name = v.into();
3032 self
3033 }
3034 }
3035
3036 #[doc(hidden)]
3037 impl crate::RequestBuilder for DeleteOperation {
3038 fn request_options(&mut self) -> &mut crate::RequestOptions {
3039 &mut self.0.options
3040 }
3041 }
3042
3043 #[derive(Clone, Debug)]
3060 pub struct CancelOperation(
3061 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3062 );
3063
3064 impl CancelOperation {
3065 pub(crate) fn new(
3066 stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
3067 ) -> Self {
3068 Self(RequestBuilder::new(stub))
3069 }
3070
3071 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3073 mut self,
3074 v: V,
3075 ) -> Self {
3076 self.0.request = v.into();
3077 self
3078 }
3079
3080 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3082 self.0.options = v.into();
3083 self
3084 }
3085
3086 pub async fn send(self) -> Result<()> {
3088 (*self.0.stub)
3089 .cancel_operation(self.0.request, self.0.options)
3090 .await
3091 .map(crate::Response::into_body)
3092 }
3093
3094 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3096 self.0.request.name = v.into();
3097 self
3098 }
3099 }
3100
3101 #[doc(hidden)]
3102 impl crate::RequestBuilder for CancelOperation {
3103 fn request_options(&mut self) -> &mut crate::RequestOptions {
3104 &mut self.0.options
3105 }
3106 }
3107}