1pub mod sql_backup_runs_service {
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::SqlBackupRunsService;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = SqlBackupRunsService;
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::SqlBackupRunsService>,
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::SqlBackupRunsService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
91 pub struct Delete(RequestBuilder<crate::model::SqlBackupRunsDeleteRequest>);
92
93 impl Delete {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::SqlBackupRunsDeleteRequest>>(
102 mut self,
103 v: V,
104 ) -> Self {
105 self.0.request = v.into();
106 self
107 }
108
109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 pub async fn send(self) -> Result<crate::model::Operation> {
117 (*self.0.stub)
118 .delete(self.0.request, self.0.options)
119 .await
120 .map(crate::Response::into_body)
121 }
122
123 pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
125 self.0.request.id = v.into();
126 self
127 }
128
129 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
131 self.0.request.instance = v.into();
132 self
133 }
134
135 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
137 self.0.request.project = v.into();
138 self
139 }
140 }
141
142 #[doc(hidden)]
143 impl crate::RequestBuilder for Delete {
144 fn request_options(&mut self) -> &mut crate::RequestOptions {
145 &mut self.0.options
146 }
147 }
148
149 #[derive(Clone, Debug)]
166 pub struct Get(RequestBuilder<crate::model::SqlBackupRunsGetRequest>);
167
168 impl Get {
169 pub(crate) fn new(
170 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
171 ) -> Self {
172 Self(RequestBuilder::new(stub))
173 }
174
175 pub fn with_request<V: Into<crate::model::SqlBackupRunsGetRequest>>(
177 mut self,
178 v: V,
179 ) -> Self {
180 self.0.request = v.into();
181 self
182 }
183
184 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
186 self.0.options = v.into();
187 self
188 }
189
190 pub async fn send(self) -> Result<crate::model::BackupRun> {
192 (*self.0.stub)
193 .get(self.0.request, self.0.options)
194 .await
195 .map(crate::Response::into_body)
196 }
197
198 pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
200 self.0.request.id = v.into();
201 self
202 }
203
204 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
206 self.0.request.instance = v.into();
207 self
208 }
209
210 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
212 self.0.request.project = v.into();
213 self
214 }
215 }
216
217 #[doc(hidden)]
218 impl crate::RequestBuilder for Get {
219 fn request_options(&mut self) -> &mut crate::RequestOptions {
220 &mut self.0.options
221 }
222 }
223
224 #[derive(Clone, Debug)]
241 pub struct Insert(RequestBuilder<crate::model::SqlBackupRunsInsertRequest>);
242
243 impl Insert {
244 pub(crate) fn new(
245 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
246 ) -> Self {
247 Self(RequestBuilder::new(stub))
248 }
249
250 pub fn with_request<V: Into<crate::model::SqlBackupRunsInsertRequest>>(
252 mut self,
253 v: V,
254 ) -> Self {
255 self.0.request = v.into();
256 self
257 }
258
259 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
261 self.0.options = v.into();
262 self
263 }
264
265 pub async fn send(self) -> Result<crate::model::Operation> {
267 (*self.0.stub)
268 .insert(self.0.request, self.0.options)
269 .await
270 .map(crate::Response::into_body)
271 }
272
273 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
275 self.0.request.instance = v.into();
276 self
277 }
278
279 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
281 self.0.request.project = v.into();
282 self
283 }
284
285 pub fn set_body<T>(mut self, v: T) -> Self
287 where
288 T: std::convert::Into<crate::model::BackupRun>,
289 {
290 self.0.request.body = std::option::Option::Some(v.into());
291 self
292 }
293
294 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
296 where
297 T: std::convert::Into<crate::model::BackupRun>,
298 {
299 self.0.request.body = v.map(|x| x.into());
300 self
301 }
302 }
303
304 #[doc(hidden)]
305 impl crate::RequestBuilder for Insert {
306 fn request_options(&mut self) -> &mut crate::RequestOptions {
307 &mut self.0.options
308 }
309 }
310
311 #[derive(Clone, Debug)]
332 pub struct List(RequestBuilder<crate::model::SqlBackupRunsListRequest>);
333
334 impl List {
335 pub(crate) fn new(
336 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
337 ) -> Self {
338 Self(RequestBuilder::new(stub))
339 }
340
341 pub fn with_request<V: Into<crate::model::SqlBackupRunsListRequest>>(
343 mut self,
344 v: V,
345 ) -> Self {
346 self.0.request = v.into();
347 self
348 }
349
350 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
352 self.0.options = v.into();
353 self
354 }
355
356 pub async fn send(self) -> Result<crate::model::BackupRunsListResponse> {
358 (*self.0.stub)
359 .list(self.0.request, self.0.options)
360 .await
361 .map(crate::Response::into_body)
362 }
363
364 pub fn by_page(
366 self,
367 ) -> impl google_cloud_gax::paginator::Paginator<
368 crate::model::BackupRunsListResponse,
369 crate::Error,
370 > {
371 use std::clone::Clone;
372 let token = self.0.request.page_token.clone();
373 let execute = move |token: String| {
374 let mut builder = self.clone();
375 builder.0.request = builder.0.request.set_page_token(token);
376 builder.send()
377 };
378 google_cloud_gax::paginator::internal::new_paginator(token, execute)
379 }
380
381 pub fn by_item(
383 self,
384 ) -> impl google_cloud_gax::paginator::ItemPaginator<
385 crate::model::BackupRunsListResponse,
386 crate::Error,
387 > {
388 use google_cloud_gax::paginator::Paginator;
389 self.by_page().items()
390 }
391
392 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
394 self.0.request.instance = v.into();
395 self
396 }
397
398 pub fn set_max_results<T: Into<i32>>(mut self, v: T) -> Self {
400 self.0.request.max_results = v.into();
401 self
402 }
403
404 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
406 self.0.request.page_token = v.into();
407 self
408 }
409
410 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
412 self.0.request.project = v.into();
413 self
414 }
415 }
416
417 #[doc(hidden)]
418 impl crate::RequestBuilder for List {
419 fn request_options(&mut self) -> &mut crate::RequestOptions {
420 &mut self.0.options
421 }
422 }
423}
424
425pub mod sql_backups_service {
427 use crate::Result;
428
429 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
443
444 pub(crate) mod client {
445 use super::super::super::client::SqlBackupsService;
446 pub struct Factory;
447 impl crate::ClientFactory for Factory {
448 type Client = SqlBackupsService;
449 type Credentials = gaxi::options::Credentials;
450 async fn build(
451 self,
452 config: gaxi::options::ClientConfig,
453 ) -> crate::ClientBuilderResult<Self::Client> {
454 Self::Client::new(config).await
455 }
456 }
457 }
458
459 #[derive(Clone, Debug)]
461 pub(crate) struct RequestBuilder<R: std::default::Default> {
462 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
463 request: R,
464 options: crate::RequestOptions,
465 }
466
467 impl<R> RequestBuilder<R>
468 where
469 R: std::default::Default,
470 {
471 pub(crate) fn new(
472 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
473 ) -> Self {
474 Self {
475 stub,
476 request: R::default(),
477 options: crate::RequestOptions::default(),
478 }
479 }
480 }
481
482 #[derive(Clone, Debug)]
499 pub struct CreateBackup(RequestBuilder<crate::model::CreateBackupRequest>);
500
501 impl CreateBackup {
502 pub(crate) fn new(
503 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
504 ) -> Self {
505 Self(RequestBuilder::new(stub))
506 }
507
508 pub fn with_request<V: Into<crate::model::CreateBackupRequest>>(mut self, v: V) -> Self {
510 self.0.request = v.into();
511 self
512 }
513
514 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
516 self.0.options = v.into();
517 self
518 }
519
520 pub async fn send(self) -> Result<crate::model::Operation> {
522 (*self.0.stub)
523 .create_backup(self.0.request, self.0.options)
524 .await
525 .map(crate::Response::into_body)
526 }
527
528 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
532 self.0.request.parent = v.into();
533 self
534 }
535
536 pub fn set_backup<T>(mut self, v: T) -> Self
540 where
541 T: std::convert::Into<crate::model::Backup>,
542 {
543 self.0.request.backup = std::option::Option::Some(v.into());
544 self
545 }
546
547 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
551 where
552 T: std::convert::Into<crate::model::Backup>,
553 {
554 self.0.request.backup = v.map(|x| x.into());
555 self
556 }
557 }
558
559 #[doc(hidden)]
560 impl crate::RequestBuilder for CreateBackup {
561 fn request_options(&mut self) -> &mut crate::RequestOptions {
562 &mut self.0.options
563 }
564 }
565
566 #[derive(Clone, Debug)]
583 pub struct GetBackup(RequestBuilder<crate::model::GetBackupRequest>);
584
585 impl GetBackup {
586 pub(crate) fn new(
587 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
588 ) -> Self {
589 Self(RequestBuilder::new(stub))
590 }
591
592 pub fn with_request<V: Into<crate::model::GetBackupRequest>>(mut self, v: V) -> 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<crate::model::Backup> {
606 (*self.0.stub)
607 .get_backup(self.0.request, self.0.options)
608 .await
609 .map(crate::Response::into_body)
610 }
611
612 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
616 self.0.request.name = v.into();
617 self
618 }
619 }
620
621 #[doc(hidden)]
622 impl crate::RequestBuilder for GetBackup {
623 fn request_options(&mut self) -> &mut crate::RequestOptions {
624 &mut self.0.options
625 }
626 }
627
628 #[derive(Clone, Debug)]
649 pub struct ListBackups(RequestBuilder<crate::model::ListBackupsRequest>);
650
651 impl ListBackups {
652 pub(crate) fn new(
653 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
654 ) -> Self {
655 Self(RequestBuilder::new(stub))
656 }
657
658 pub fn with_request<V: Into<crate::model::ListBackupsRequest>>(mut self, v: V) -> Self {
660 self.0.request = v.into();
661 self
662 }
663
664 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
666 self.0.options = v.into();
667 self
668 }
669
670 pub async fn send(self) -> Result<crate::model::ListBackupsResponse> {
672 (*self.0.stub)
673 .list_backups(self.0.request, self.0.options)
674 .await
675 .map(crate::Response::into_body)
676 }
677
678 pub fn by_page(
680 self,
681 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListBackupsResponse, crate::Error>
682 {
683 use std::clone::Clone;
684 let token = self.0.request.page_token.clone();
685 let execute = move |token: String| {
686 let mut builder = self.clone();
687 builder.0.request = builder.0.request.set_page_token(token);
688 builder.send()
689 };
690 google_cloud_gax::paginator::internal::new_paginator(token, execute)
691 }
692
693 pub fn by_item(
695 self,
696 ) -> impl google_cloud_gax::paginator::ItemPaginator<
697 crate::model::ListBackupsResponse,
698 crate::Error,
699 > {
700 use google_cloud_gax::paginator::Paginator;
701 self.by_page().items()
702 }
703
704 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
708 self.0.request.parent = v.into();
709 self
710 }
711
712 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
714 self.0.request.page_size = v.into();
715 self
716 }
717
718 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
720 self.0.request.page_token = v.into();
721 self
722 }
723
724 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
726 self.0.request.filter = v.into();
727 self
728 }
729 }
730
731 #[doc(hidden)]
732 impl crate::RequestBuilder for ListBackups {
733 fn request_options(&mut self) -> &mut crate::RequestOptions {
734 &mut self.0.options
735 }
736 }
737
738 #[derive(Clone, Debug)]
755 pub struct UpdateBackup(RequestBuilder<crate::model::UpdateBackupRequest>);
756
757 impl UpdateBackup {
758 pub(crate) fn new(
759 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
760 ) -> Self {
761 Self(RequestBuilder::new(stub))
762 }
763
764 pub fn with_request<V: Into<crate::model::UpdateBackupRequest>>(mut self, v: V) -> Self {
766 self.0.request = v.into();
767 self
768 }
769
770 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
772 self.0.options = v.into();
773 self
774 }
775
776 pub async fn send(self) -> Result<crate::model::Operation> {
778 (*self.0.stub)
779 .update_backup(self.0.request, self.0.options)
780 .await
781 .map(crate::Response::into_body)
782 }
783
784 pub fn set_backup<T>(mut self, v: T) -> Self
788 where
789 T: std::convert::Into<crate::model::Backup>,
790 {
791 self.0.request.backup = std::option::Option::Some(v.into());
792 self
793 }
794
795 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
799 where
800 T: std::convert::Into<crate::model::Backup>,
801 {
802 self.0.request.backup = v.map(|x| x.into());
803 self
804 }
805
806 pub fn set_update_mask<T>(mut self, v: T) -> Self
808 where
809 T: std::convert::Into<wkt::FieldMask>,
810 {
811 self.0.request.update_mask = std::option::Option::Some(v.into());
812 self
813 }
814
815 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
817 where
818 T: std::convert::Into<wkt::FieldMask>,
819 {
820 self.0.request.update_mask = v.map(|x| x.into());
821 self
822 }
823 }
824
825 #[doc(hidden)]
826 impl crate::RequestBuilder for UpdateBackup {
827 fn request_options(&mut self) -> &mut crate::RequestOptions {
828 &mut self.0.options
829 }
830 }
831
832 #[derive(Clone, Debug)]
849 pub struct DeleteBackup(RequestBuilder<crate::model::DeleteBackupRequest>);
850
851 impl DeleteBackup {
852 pub(crate) fn new(
853 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
854 ) -> Self {
855 Self(RequestBuilder::new(stub))
856 }
857
858 pub fn with_request<V: Into<crate::model::DeleteBackupRequest>>(mut self, v: V) -> Self {
860 self.0.request = v.into();
861 self
862 }
863
864 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
866 self.0.options = v.into();
867 self
868 }
869
870 pub async fn send(self) -> Result<crate::model::Operation> {
872 (*self.0.stub)
873 .delete_backup(self.0.request, self.0.options)
874 .await
875 .map(crate::Response::into_body)
876 }
877
878 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
882 self.0.request.name = v.into();
883 self
884 }
885 }
886
887 #[doc(hidden)]
888 impl crate::RequestBuilder for DeleteBackup {
889 fn request_options(&mut self) -> &mut crate::RequestOptions {
890 &mut self.0.options
891 }
892 }
893}
894
895pub mod sql_connect_service {
897 use crate::Result;
898
899 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
913
914 pub(crate) mod client {
915 use super::super::super::client::SqlConnectService;
916 pub struct Factory;
917 impl crate::ClientFactory for Factory {
918 type Client = SqlConnectService;
919 type Credentials = gaxi::options::Credentials;
920 async fn build(
921 self,
922 config: gaxi::options::ClientConfig,
923 ) -> crate::ClientBuilderResult<Self::Client> {
924 Self::Client::new(config).await
925 }
926 }
927 }
928
929 #[derive(Clone, Debug)]
931 pub(crate) struct RequestBuilder<R: std::default::Default> {
932 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
933 request: R,
934 options: crate::RequestOptions,
935 }
936
937 impl<R> RequestBuilder<R>
938 where
939 R: std::default::Default,
940 {
941 pub(crate) fn new(
942 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
943 ) -> Self {
944 Self {
945 stub,
946 request: R::default(),
947 options: crate::RequestOptions::default(),
948 }
949 }
950 }
951
952 #[derive(Clone, Debug)]
969 pub struct GetConnectSettings(RequestBuilder<crate::model::GetConnectSettingsRequest>);
970
971 impl GetConnectSettings {
972 pub(crate) fn new(
973 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
974 ) -> Self {
975 Self(RequestBuilder::new(stub))
976 }
977
978 pub fn with_request<V: Into<crate::model::GetConnectSettingsRequest>>(
980 mut self,
981 v: V,
982 ) -> Self {
983 self.0.request = v.into();
984 self
985 }
986
987 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
989 self.0.options = v.into();
990 self
991 }
992
993 pub async fn send(self) -> Result<crate::model::ConnectSettings> {
995 (*self.0.stub)
996 .get_connect_settings(self.0.request, self.0.options)
997 .await
998 .map(crate::Response::into_body)
999 }
1000
1001 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1003 self.0.request.instance = v.into();
1004 self
1005 }
1006
1007 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1009 self.0.request.project = v.into();
1010 self
1011 }
1012
1013 pub fn set_read_time<T>(mut self, v: T) -> Self
1015 where
1016 T: std::convert::Into<wkt::Timestamp>,
1017 {
1018 self.0.request.read_time = std::option::Option::Some(v.into());
1019 self
1020 }
1021
1022 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1024 where
1025 T: std::convert::Into<wkt::Timestamp>,
1026 {
1027 self.0.request.read_time = v.map(|x| x.into());
1028 self
1029 }
1030 }
1031
1032 #[doc(hidden)]
1033 impl crate::RequestBuilder for GetConnectSettings {
1034 fn request_options(&mut self) -> &mut crate::RequestOptions {
1035 &mut self.0.options
1036 }
1037 }
1038
1039 #[derive(Clone, Debug)]
1056 pub struct ResolveConnectSettings(RequestBuilder<crate::model::ResolveConnectSettingsRequest>);
1057
1058 impl ResolveConnectSettings {
1059 pub(crate) fn new(
1060 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
1061 ) -> Self {
1062 Self(RequestBuilder::new(stub))
1063 }
1064
1065 pub fn with_request<V: Into<crate::model::ResolveConnectSettingsRequest>>(
1067 mut self,
1068 v: V,
1069 ) -> Self {
1070 self.0.request = v.into();
1071 self
1072 }
1073
1074 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1076 self.0.options = v.into();
1077 self
1078 }
1079
1080 pub async fn send(self) -> Result<crate::model::ConnectSettings> {
1082 (*self.0.stub)
1083 .resolve_connect_settings(self.0.request, self.0.options)
1084 .await
1085 .map(crate::Response::into_body)
1086 }
1087
1088 pub fn set_dns_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1092 self.0.request.dns_name = v.into();
1093 self
1094 }
1095
1096 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1100 self.0.request.location = v.into();
1101 self
1102 }
1103 }
1104
1105 #[doc(hidden)]
1106 impl crate::RequestBuilder for ResolveConnectSettings {
1107 fn request_options(&mut self) -> &mut crate::RequestOptions {
1108 &mut self.0.options
1109 }
1110 }
1111
1112 #[derive(Clone, Debug)]
1129 pub struct GenerateEphemeralCert(RequestBuilder<crate::model::GenerateEphemeralCertRequest>);
1130
1131 impl GenerateEphemeralCert {
1132 pub(crate) fn new(
1133 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
1134 ) -> Self {
1135 Self(RequestBuilder::new(stub))
1136 }
1137
1138 pub fn with_request<V: Into<crate::model::GenerateEphemeralCertRequest>>(
1140 mut self,
1141 v: V,
1142 ) -> Self {
1143 self.0.request = v.into();
1144 self
1145 }
1146
1147 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1149 self.0.options = v.into();
1150 self
1151 }
1152
1153 pub async fn send(self) -> Result<crate::model::GenerateEphemeralCertResponse> {
1155 (*self.0.stub)
1156 .generate_ephemeral_cert(self.0.request, self.0.options)
1157 .await
1158 .map(crate::Response::into_body)
1159 }
1160
1161 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1163 self.0.request.instance = v.into();
1164 self
1165 }
1166
1167 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1169 self.0.request.project = v.into();
1170 self
1171 }
1172
1173 pub fn set_public_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1175 self.0.request.public_key = v.into();
1176 self
1177 }
1178
1179 pub fn set_access_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1181 self.0.request.access_token = v.into();
1182 self
1183 }
1184
1185 pub fn set_read_time<T>(mut self, v: T) -> Self
1187 where
1188 T: std::convert::Into<wkt::Timestamp>,
1189 {
1190 self.0.request.read_time = std::option::Option::Some(v.into());
1191 self
1192 }
1193
1194 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1196 where
1197 T: std::convert::Into<wkt::Timestamp>,
1198 {
1199 self.0.request.read_time = v.map(|x| x.into());
1200 self
1201 }
1202
1203 pub fn set_valid_duration<T>(mut self, v: T) -> Self
1205 where
1206 T: std::convert::Into<wkt::Duration>,
1207 {
1208 self.0.request.valid_duration = std::option::Option::Some(v.into());
1209 self
1210 }
1211
1212 pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
1214 where
1215 T: std::convert::Into<wkt::Duration>,
1216 {
1217 self.0.request.valid_duration = v.map(|x| x.into());
1218 self
1219 }
1220 }
1221
1222 #[doc(hidden)]
1223 impl crate::RequestBuilder for GenerateEphemeralCert {
1224 fn request_options(&mut self) -> &mut crate::RequestOptions {
1225 &mut self.0.options
1226 }
1227 }
1228}
1229
1230pub mod sql_databases_service {
1232 use crate::Result;
1233
1234 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1248
1249 pub(crate) mod client {
1250 use super::super::super::client::SqlDatabasesService;
1251 pub struct Factory;
1252 impl crate::ClientFactory for Factory {
1253 type Client = SqlDatabasesService;
1254 type Credentials = gaxi::options::Credentials;
1255 async fn build(
1256 self,
1257 config: gaxi::options::ClientConfig,
1258 ) -> crate::ClientBuilderResult<Self::Client> {
1259 Self::Client::new(config).await
1260 }
1261 }
1262 }
1263
1264 #[derive(Clone, Debug)]
1266 pub(crate) struct RequestBuilder<R: std::default::Default> {
1267 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1268 request: R,
1269 options: crate::RequestOptions,
1270 }
1271
1272 impl<R> RequestBuilder<R>
1273 where
1274 R: std::default::Default,
1275 {
1276 pub(crate) fn new(
1277 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1278 ) -> Self {
1279 Self {
1280 stub,
1281 request: R::default(),
1282 options: crate::RequestOptions::default(),
1283 }
1284 }
1285 }
1286
1287 #[derive(Clone, Debug)]
1304 pub struct Delete(RequestBuilder<crate::model::SqlDatabasesDeleteRequest>);
1305
1306 impl Delete {
1307 pub(crate) fn new(
1308 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1309 ) -> Self {
1310 Self(RequestBuilder::new(stub))
1311 }
1312
1313 pub fn with_request<V: Into<crate::model::SqlDatabasesDeleteRequest>>(
1315 mut self,
1316 v: V,
1317 ) -> Self {
1318 self.0.request = v.into();
1319 self
1320 }
1321
1322 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1324 self.0.options = v.into();
1325 self
1326 }
1327
1328 pub async fn send(self) -> Result<crate::model::Operation> {
1330 (*self.0.stub)
1331 .delete(self.0.request, self.0.options)
1332 .await
1333 .map(crate::Response::into_body)
1334 }
1335
1336 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1338 self.0.request.database = v.into();
1339 self
1340 }
1341
1342 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1344 self.0.request.instance = v.into();
1345 self
1346 }
1347
1348 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1350 self.0.request.project = v.into();
1351 self
1352 }
1353 }
1354
1355 #[doc(hidden)]
1356 impl crate::RequestBuilder for Delete {
1357 fn request_options(&mut self) -> &mut crate::RequestOptions {
1358 &mut self.0.options
1359 }
1360 }
1361
1362 #[derive(Clone, Debug)]
1379 pub struct Get(RequestBuilder<crate::model::SqlDatabasesGetRequest>);
1380
1381 impl Get {
1382 pub(crate) fn new(
1383 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1384 ) -> Self {
1385 Self(RequestBuilder::new(stub))
1386 }
1387
1388 pub fn with_request<V: Into<crate::model::SqlDatabasesGetRequest>>(mut self, v: V) -> Self {
1390 self.0.request = v.into();
1391 self
1392 }
1393
1394 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1396 self.0.options = v.into();
1397 self
1398 }
1399
1400 pub async fn send(self) -> Result<crate::model::Database> {
1402 (*self.0.stub)
1403 .get(self.0.request, self.0.options)
1404 .await
1405 .map(crate::Response::into_body)
1406 }
1407
1408 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1410 self.0.request.database = v.into();
1411 self
1412 }
1413
1414 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1416 self.0.request.instance = v.into();
1417 self
1418 }
1419
1420 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1422 self.0.request.project = v.into();
1423 self
1424 }
1425 }
1426
1427 #[doc(hidden)]
1428 impl crate::RequestBuilder for Get {
1429 fn request_options(&mut self) -> &mut crate::RequestOptions {
1430 &mut self.0.options
1431 }
1432 }
1433
1434 #[derive(Clone, Debug)]
1451 pub struct Insert(RequestBuilder<crate::model::SqlDatabasesInsertRequest>);
1452
1453 impl Insert {
1454 pub(crate) fn new(
1455 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1456 ) -> Self {
1457 Self(RequestBuilder::new(stub))
1458 }
1459
1460 pub fn with_request<V: Into<crate::model::SqlDatabasesInsertRequest>>(
1462 mut self,
1463 v: V,
1464 ) -> Self {
1465 self.0.request = v.into();
1466 self
1467 }
1468
1469 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1471 self.0.options = v.into();
1472 self
1473 }
1474
1475 pub async fn send(self) -> Result<crate::model::Operation> {
1477 (*self.0.stub)
1478 .insert(self.0.request, self.0.options)
1479 .await
1480 .map(crate::Response::into_body)
1481 }
1482
1483 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1485 self.0.request.instance = v.into();
1486 self
1487 }
1488
1489 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1491 self.0.request.project = v.into();
1492 self
1493 }
1494
1495 pub fn set_body<T>(mut self, v: T) -> Self
1497 where
1498 T: std::convert::Into<crate::model::Database>,
1499 {
1500 self.0.request.body = std::option::Option::Some(v.into());
1501 self
1502 }
1503
1504 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1506 where
1507 T: std::convert::Into<crate::model::Database>,
1508 {
1509 self.0.request.body = v.map(|x| x.into());
1510 self
1511 }
1512 }
1513
1514 #[doc(hidden)]
1515 impl crate::RequestBuilder for Insert {
1516 fn request_options(&mut self) -> &mut crate::RequestOptions {
1517 &mut self.0.options
1518 }
1519 }
1520
1521 #[derive(Clone, Debug)]
1538 pub struct List(RequestBuilder<crate::model::SqlDatabasesListRequest>);
1539
1540 impl List {
1541 pub(crate) fn new(
1542 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1543 ) -> Self {
1544 Self(RequestBuilder::new(stub))
1545 }
1546
1547 pub fn with_request<V: Into<crate::model::SqlDatabasesListRequest>>(
1549 mut self,
1550 v: V,
1551 ) -> Self {
1552 self.0.request = v.into();
1553 self
1554 }
1555
1556 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1558 self.0.options = v.into();
1559 self
1560 }
1561
1562 pub async fn send(self) -> Result<crate::model::DatabasesListResponse> {
1564 (*self.0.stub)
1565 .list(self.0.request, self.0.options)
1566 .await
1567 .map(crate::Response::into_body)
1568 }
1569
1570 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1572 self.0.request.instance = v.into();
1573 self
1574 }
1575
1576 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1578 self.0.request.project = v.into();
1579 self
1580 }
1581 }
1582
1583 #[doc(hidden)]
1584 impl crate::RequestBuilder for List {
1585 fn request_options(&mut self) -> &mut crate::RequestOptions {
1586 &mut self.0.options
1587 }
1588 }
1589
1590 #[derive(Clone, Debug)]
1607 pub struct Patch(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1608
1609 impl Patch {
1610 pub(crate) fn new(
1611 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1612 ) -> Self {
1613 Self(RequestBuilder::new(stub))
1614 }
1615
1616 pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1618 mut self,
1619 v: V,
1620 ) -> Self {
1621 self.0.request = v.into();
1622 self
1623 }
1624
1625 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1627 self.0.options = v.into();
1628 self
1629 }
1630
1631 pub async fn send(self) -> Result<crate::model::Operation> {
1633 (*self.0.stub)
1634 .patch(self.0.request, self.0.options)
1635 .await
1636 .map(crate::Response::into_body)
1637 }
1638
1639 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1641 self.0.request.database = v.into();
1642 self
1643 }
1644
1645 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1647 self.0.request.instance = v.into();
1648 self
1649 }
1650
1651 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1653 self.0.request.project = v.into();
1654 self
1655 }
1656
1657 pub fn set_body<T>(mut self, v: T) -> Self
1659 where
1660 T: std::convert::Into<crate::model::Database>,
1661 {
1662 self.0.request.body = std::option::Option::Some(v.into());
1663 self
1664 }
1665
1666 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1668 where
1669 T: std::convert::Into<crate::model::Database>,
1670 {
1671 self.0.request.body = v.map(|x| x.into());
1672 self
1673 }
1674 }
1675
1676 #[doc(hidden)]
1677 impl crate::RequestBuilder for Patch {
1678 fn request_options(&mut self) -> &mut crate::RequestOptions {
1679 &mut self.0.options
1680 }
1681 }
1682
1683 #[derive(Clone, Debug)]
1700 pub struct Update(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1701
1702 impl Update {
1703 pub(crate) fn new(
1704 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1705 ) -> Self {
1706 Self(RequestBuilder::new(stub))
1707 }
1708
1709 pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1711 mut self,
1712 v: V,
1713 ) -> Self {
1714 self.0.request = v.into();
1715 self
1716 }
1717
1718 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1720 self.0.options = v.into();
1721 self
1722 }
1723
1724 pub async fn send(self) -> Result<crate::model::Operation> {
1726 (*self.0.stub)
1727 .update(self.0.request, self.0.options)
1728 .await
1729 .map(crate::Response::into_body)
1730 }
1731
1732 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1734 self.0.request.database = v.into();
1735 self
1736 }
1737
1738 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1740 self.0.request.instance = v.into();
1741 self
1742 }
1743
1744 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1746 self.0.request.project = v.into();
1747 self
1748 }
1749
1750 pub fn set_body<T>(mut self, v: T) -> Self
1752 where
1753 T: std::convert::Into<crate::model::Database>,
1754 {
1755 self.0.request.body = std::option::Option::Some(v.into());
1756 self
1757 }
1758
1759 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1761 where
1762 T: std::convert::Into<crate::model::Database>,
1763 {
1764 self.0.request.body = v.map(|x| x.into());
1765 self
1766 }
1767 }
1768
1769 #[doc(hidden)]
1770 impl crate::RequestBuilder for Update {
1771 fn request_options(&mut self) -> &mut crate::RequestOptions {
1772 &mut self.0.options
1773 }
1774 }
1775}
1776
1777pub mod sql_flags_service {
1779 use crate::Result;
1780
1781 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1795
1796 pub(crate) mod client {
1797 use super::super::super::client::SqlFlagsService;
1798 pub struct Factory;
1799 impl crate::ClientFactory for Factory {
1800 type Client = SqlFlagsService;
1801 type Credentials = gaxi::options::Credentials;
1802 async fn build(
1803 self,
1804 config: gaxi::options::ClientConfig,
1805 ) -> crate::ClientBuilderResult<Self::Client> {
1806 Self::Client::new(config).await
1807 }
1808 }
1809 }
1810
1811 #[derive(Clone, Debug)]
1813 pub(crate) struct RequestBuilder<R: std::default::Default> {
1814 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1815 request: R,
1816 options: crate::RequestOptions,
1817 }
1818
1819 impl<R> RequestBuilder<R>
1820 where
1821 R: std::default::Default,
1822 {
1823 pub(crate) fn new(
1824 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1825 ) -> Self {
1826 Self {
1827 stub,
1828 request: R::default(),
1829 options: crate::RequestOptions::default(),
1830 }
1831 }
1832 }
1833
1834 #[derive(Clone, Debug)]
1851 pub struct List(RequestBuilder<crate::model::SqlFlagsListRequest>);
1852
1853 impl List {
1854 pub(crate) fn new(
1855 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1856 ) -> Self {
1857 Self(RequestBuilder::new(stub))
1858 }
1859
1860 pub fn with_request<V: Into<crate::model::SqlFlagsListRequest>>(mut self, v: V) -> Self {
1862 self.0.request = v.into();
1863 self
1864 }
1865
1866 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1868 self.0.options = v.into();
1869 self
1870 }
1871
1872 pub async fn send(self) -> Result<crate::model::FlagsListResponse> {
1874 (*self.0.stub)
1875 .list(self.0.request, self.0.options)
1876 .await
1877 .map(crate::Response::into_body)
1878 }
1879
1880 pub fn set_database_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
1882 self.0.request.database_version = v.into();
1883 self
1884 }
1885
1886 pub fn set_flag_scope<T>(mut self, v: T) -> Self
1888 where
1889 T: std::convert::Into<crate::model::SqlFlagScope>,
1890 {
1891 self.0.request.flag_scope = std::option::Option::Some(v.into());
1892 self
1893 }
1894
1895 pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
1897 where
1898 T: std::convert::Into<crate::model::SqlFlagScope>,
1899 {
1900 self.0.request.flag_scope = v.map(|x| x.into());
1901 self
1902 }
1903 }
1904
1905 #[doc(hidden)]
1906 impl crate::RequestBuilder for List {
1907 fn request_options(&mut self) -> &mut crate::RequestOptions {
1908 &mut self.0.options
1909 }
1910 }
1911}
1912
1913pub mod sql_instances_service {
1915 use crate::Result;
1916
1917 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1931
1932 pub(crate) mod client {
1933 use super::super::super::client::SqlInstancesService;
1934 pub struct Factory;
1935 impl crate::ClientFactory for Factory {
1936 type Client = SqlInstancesService;
1937 type Credentials = gaxi::options::Credentials;
1938 async fn build(
1939 self,
1940 config: gaxi::options::ClientConfig,
1941 ) -> crate::ClientBuilderResult<Self::Client> {
1942 Self::Client::new(config).await
1943 }
1944 }
1945 }
1946
1947 #[derive(Clone, Debug)]
1949 pub(crate) struct RequestBuilder<R: std::default::Default> {
1950 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1951 request: R,
1952 options: crate::RequestOptions,
1953 }
1954
1955 impl<R> RequestBuilder<R>
1956 where
1957 R: std::default::Default,
1958 {
1959 pub(crate) fn new(
1960 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1961 ) -> Self {
1962 Self {
1963 stub,
1964 request: R::default(),
1965 options: crate::RequestOptions::default(),
1966 }
1967 }
1968 }
1969
1970 #[derive(Clone, Debug)]
1987 pub struct AddServerCa(RequestBuilder<crate::model::SqlInstancesAddServerCaRequest>);
1988
1989 impl AddServerCa {
1990 pub(crate) fn new(
1991 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1992 ) -> Self {
1993 Self(RequestBuilder::new(stub))
1994 }
1995
1996 pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCaRequest>>(
1998 mut self,
1999 v: V,
2000 ) -> Self {
2001 self.0.request = v.into();
2002 self
2003 }
2004
2005 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2007 self.0.options = v.into();
2008 self
2009 }
2010
2011 pub async fn send(self) -> Result<crate::model::Operation> {
2013 (*self.0.stub)
2014 .add_server_ca(self.0.request, self.0.options)
2015 .await
2016 .map(crate::Response::into_body)
2017 }
2018
2019 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2021 self.0.request.instance = v.into();
2022 self
2023 }
2024
2025 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2027 self.0.request.project = v.into();
2028 self
2029 }
2030 }
2031
2032 #[doc(hidden)]
2033 impl crate::RequestBuilder for AddServerCa {
2034 fn request_options(&mut self) -> &mut crate::RequestOptions {
2035 &mut self.0.options
2036 }
2037 }
2038
2039 #[derive(Clone, Debug)]
2056 pub struct AddServerCertificate(
2057 RequestBuilder<crate::model::SqlInstancesAddServerCertificateRequest>,
2058 );
2059
2060 impl AddServerCertificate {
2061 pub(crate) fn new(
2062 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2063 ) -> Self {
2064 Self(RequestBuilder::new(stub))
2065 }
2066
2067 pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCertificateRequest>>(
2069 mut self,
2070 v: V,
2071 ) -> Self {
2072 self.0.request = v.into();
2073 self
2074 }
2075
2076 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2078 self.0.options = v.into();
2079 self
2080 }
2081
2082 pub async fn send(self) -> Result<crate::model::Operation> {
2084 (*self.0.stub)
2085 .add_server_certificate(self.0.request, self.0.options)
2086 .await
2087 .map(crate::Response::into_body)
2088 }
2089
2090 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2092 self.0.request.instance = v.into();
2093 self
2094 }
2095
2096 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2098 self.0.request.project = v.into();
2099 self
2100 }
2101 }
2102
2103 #[doc(hidden)]
2104 impl crate::RequestBuilder for AddServerCertificate {
2105 fn request_options(&mut self) -> &mut crate::RequestOptions {
2106 &mut self.0.options
2107 }
2108 }
2109
2110 #[derive(Clone, Debug)]
2127 pub struct AddEntraIdCertificate(
2128 RequestBuilder<crate::model::SqlInstancesAddEntraIdCertificateRequest>,
2129 );
2130
2131 impl AddEntraIdCertificate {
2132 pub(crate) fn new(
2133 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2134 ) -> Self {
2135 Self(RequestBuilder::new(stub))
2136 }
2137
2138 pub fn with_request<V: Into<crate::model::SqlInstancesAddEntraIdCertificateRequest>>(
2140 mut self,
2141 v: V,
2142 ) -> Self {
2143 self.0.request = v.into();
2144 self
2145 }
2146
2147 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2149 self.0.options = v.into();
2150 self
2151 }
2152
2153 pub async fn send(self) -> Result<crate::model::Operation> {
2155 (*self.0.stub)
2156 .add_entra_id_certificate(self.0.request, self.0.options)
2157 .await
2158 .map(crate::Response::into_body)
2159 }
2160
2161 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2165 self.0.request.instance = v.into();
2166 self
2167 }
2168
2169 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2173 self.0.request.project = v.into();
2174 self
2175 }
2176 }
2177
2178 #[doc(hidden)]
2179 impl crate::RequestBuilder for AddEntraIdCertificate {
2180 fn request_options(&mut self) -> &mut crate::RequestOptions {
2181 &mut self.0.options
2182 }
2183 }
2184
2185 #[derive(Clone, Debug)]
2202 pub struct Clone(RequestBuilder<crate::model::SqlInstancesCloneRequest>);
2203
2204 impl Clone {
2205 pub(crate) fn new(
2206 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2207 ) -> Self {
2208 Self(RequestBuilder::new(stub))
2209 }
2210
2211 pub fn with_request<V: Into<crate::model::SqlInstancesCloneRequest>>(
2213 mut self,
2214 v: V,
2215 ) -> Self {
2216 self.0.request = v.into();
2217 self
2218 }
2219
2220 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2222 self.0.options = v.into();
2223 self
2224 }
2225
2226 pub async fn send(self) -> Result<crate::model::Operation> {
2228 (*self.0.stub)
2229 .clone(self.0.request, self.0.options)
2230 .await
2231 .map(crate::Response::into_body)
2232 }
2233
2234 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2238 self.0.request.instance = v.into();
2239 self
2240 }
2241
2242 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2246 self.0.request.project = v.into();
2247 self
2248 }
2249
2250 pub fn set_body<T>(mut self, v: T) -> Self
2254 where
2255 T: std::convert::Into<crate::model::InstancesCloneRequest>,
2256 {
2257 self.0.request.body = std::option::Option::Some(v.into());
2258 self
2259 }
2260
2261 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2265 where
2266 T: std::convert::Into<crate::model::InstancesCloneRequest>,
2267 {
2268 self.0.request.body = v.map(|x| x.into());
2269 self
2270 }
2271 }
2272
2273 #[doc(hidden)]
2274 impl crate::RequestBuilder for Clone {
2275 fn request_options(&mut self) -> &mut crate::RequestOptions {
2276 &mut self.0.options
2277 }
2278 }
2279
2280 #[derive(Clone, Debug)]
2297 pub struct Delete(RequestBuilder<crate::model::SqlInstancesDeleteRequest>);
2298
2299 impl Delete {
2300 pub(crate) fn new(
2301 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2302 ) -> Self {
2303 Self(RequestBuilder::new(stub))
2304 }
2305
2306 pub fn with_request<V: Into<crate::model::SqlInstancesDeleteRequest>>(
2308 mut self,
2309 v: V,
2310 ) -> Self {
2311 self.0.request = v.into();
2312 self
2313 }
2314
2315 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2317 self.0.options = v.into();
2318 self
2319 }
2320
2321 pub async fn send(self) -> Result<crate::model::Operation> {
2323 (*self.0.stub)
2324 .delete(self.0.request, self.0.options)
2325 .await
2326 .map(crate::Response::into_body)
2327 }
2328
2329 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2331 self.0.request.instance = v.into();
2332 self
2333 }
2334
2335 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2337 self.0.request.project = v.into();
2338 self
2339 }
2340
2341 pub fn set_enable_final_backup<T>(mut self, v: T) -> Self
2343 where
2344 T: std::convert::Into<bool>,
2345 {
2346 self.0.request.enable_final_backup = std::option::Option::Some(v.into());
2347 self
2348 }
2349
2350 pub fn set_or_clear_enable_final_backup<T>(mut self, v: std::option::Option<T>) -> Self
2352 where
2353 T: std::convert::Into<bool>,
2354 {
2355 self.0.request.enable_final_backup = v.map(|x| x.into());
2356 self
2357 }
2358
2359 pub fn set_final_backup_description<T: Into<std::string::String>>(mut self, v: T) -> Self {
2361 self.0.request.final_backup_description = v.into();
2362 self
2363 }
2364
2365 pub fn set_expiration<
2370 T: Into<Option<crate::model::sql_instances_delete_request::Expiration>>,
2371 >(
2372 mut self,
2373 v: T,
2374 ) -> Self {
2375 self.0.request.expiration = v.into();
2376 self
2377 }
2378
2379 pub fn set_final_backup_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2385 self.0.request = self.0.request.set_final_backup_ttl_days(v);
2386 self
2387 }
2388
2389 pub fn set_final_backup_expiry_time<
2395 T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>,
2396 >(
2397 mut self,
2398 v: T,
2399 ) -> Self {
2400 self.0.request = self.0.request.set_final_backup_expiry_time(v);
2401 self
2402 }
2403 }
2404
2405 #[doc(hidden)]
2406 impl crate::RequestBuilder for Delete {
2407 fn request_options(&mut self) -> &mut crate::RequestOptions {
2408 &mut self.0.options
2409 }
2410 }
2411
2412 #[derive(Clone, Debug)]
2429 pub struct DemoteMaster(RequestBuilder<crate::model::SqlInstancesDemoteMasterRequest>);
2430
2431 impl DemoteMaster {
2432 pub(crate) fn new(
2433 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2434 ) -> Self {
2435 Self(RequestBuilder::new(stub))
2436 }
2437
2438 pub fn with_request<V: Into<crate::model::SqlInstancesDemoteMasterRequest>>(
2440 mut self,
2441 v: V,
2442 ) -> Self {
2443 self.0.request = v.into();
2444 self
2445 }
2446
2447 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2449 self.0.options = v.into();
2450 self
2451 }
2452
2453 pub async fn send(self) -> Result<crate::model::Operation> {
2455 (*self.0.stub)
2456 .demote_master(self.0.request, self.0.options)
2457 .await
2458 .map(crate::Response::into_body)
2459 }
2460
2461 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2463 self.0.request.instance = v.into();
2464 self
2465 }
2466
2467 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2469 self.0.request.project = v.into();
2470 self
2471 }
2472
2473 pub fn set_body<T>(mut self, v: T) -> Self
2475 where
2476 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
2477 {
2478 self.0.request.body = std::option::Option::Some(v.into());
2479 self
2480 }
2481
2482 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2484 where
2485 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
2486 {
2487 self.0.request.body = v.map(|x| x.into());
2488 self
2489 }
2490 }
2491
2492 #[doc(hidden)]
2493 impl crate::RequestBuilder for DemoteMaster {
2494 fn request_options(&mut self) -> &mut crate::RequestOptions {
2495 &mut self.0.options
2496 }
2497 }
2498
2499 #[derive(Clone, Debug)]
2516 pub struct Demote(RequestBuilder<crate::model::SqlInstancesDemoteRequest>);
2517
2518 impl Demote {
2519 pub(crate) fn new(
2520 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2521 ) -> Self {
2522 Self(RequestBuilder::new(stub))
2523 }
2524
2525 pub fn with_request<V: Into<crate::model::SqlInstancesDemoteRequest>>(
2527 mut self,
2528 v: V,
2529 ) -> Self {
2530 self.0.request = v.into();
2531 self
2532 }
2533
2534 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2536 self.0.options = v.into();
2537 self
2538 }
2539
2540 pub async fn send(self) -> Result<crate::model::Operation> {
2542 (*self.0.stub)
2543 .demote(self.0.request, self.0.options)
2544 .await
2545 .map(crate::Response::into_body)
2546 }
2547
2548 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2552 self.0.request.instance = v.into();
2553 self
2554 }
2555
2556 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2560 self.0.request.project = v.into();
2561 self
2562 }
2563
2564 pub fn set_body<T>(mut self, v: T) -> Self
2568 where
2569 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
2570 {
2571 self.0.request.body = std::option::Option::Some(v.into());
2572 self
2573 }
2574
2575 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2579 where
2580 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
2581 {
2582 self.0.request.body = v.map(|x| x.into());
2583 self
2584 }
2585 }
2586
2587 #[doc(hidden)]
2588 impl crate::RequestBuilder for Demote {
2589 fn request_options(&mut self) -> &mut crate::RequestOptions {
2590 &mut self.0.options
2591 }
2592 }
2593
2594 #[derive(Clone, Debug)]
2611 pub struct Export(RequestBuilder<crate::model::SqlInstancesExportRequest>);
2612
2613 impl Export {
2614 pub(crate) fn new(
2615 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2616 ) -> Self {
2617 Self(RequestBuilder::new(stub))
2618 }
2619
2620 pub fn with_request<V: Into<crate::model::SqlInstancesExportRequest>>(
2622 mut self,
2623 v: V,
2624 ) -> Self {
2625 self.0.request = v.into();
2626 self
2627 }
2628
2629 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2631 self.0.options = v.into();
2632 self
2633 }
2634
2635 pub async fn send(self) -> Result<crate::model::Operation> {
2637 (*self.0.stub)
2638 .export(self.0.request, self.0.options)
2639 .await
2640 .map(crate::Response::into_body)
2641 }
2642
2643 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2645 self.0.request.instance = v.into();
2646 self
2647 }
2648
2649 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2651 self.0.request.project = v.into();
2652 self
2653 }
2654
2655 pub fn set_body<T>(mut self, v: T) -> Self
2657 where
2658 T: std::convert::Into<crate::model::InstancesExportRequest>,
2659 {
2660 self.0.request.body = std::option::Option::Some(v.into());
2661 self
2662 }
2663
2664 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2666 where
2667 T: std::convert::Into<crate::model::InstancesExportRequest>,
2668 {
2669 self.0.request.body = v.map(|x| x.into());
2670 self
2671 }
2672 }
2673
2674 #[doc(hidden)]
2675 impl crate::RequestBuilder for Export {
2676 fn request_options(&mut self) -> &mut crate::RequestOptions {
2677 &mut self.0.options
2678 }
2679 }
2680
2681 #[derive(Clone, Debug)]
2698 pub struct Failover(RequestBuilder<crate::model::SqlInstancesFailoverRequest>);
2699
2700 impl Failover {
2701 pub(crate) fn new(
2702 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2703 ) -> Self {
2704 Self(RequestBuilder::new(stub))
2705 }
2706
2707 pub fn with_request<V: Into<crate::model::SqlInstancesFailoverRequest>>(
2709 mut self,
2710 v: V,
2711 ) -> Self {
2712 self.0.request = v.into();
2713 self
2714 }
2715
2716 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2718 self.0.options = v.into();
2719 self
2720 }
2721
2722 pub async fn send(self) -> Result<crate::model::Operation> {
2724 (*self.0.stub)
2725 .failover(self.0.request, self.0.options)
2726 .await
2727 .map(crate::Response::into_body)
2728 }
2729
2730 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2732 self.0.request.instance = v.into();
2733 self
2734 }
2735
2736 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2738 self.0.request.project = v.into();
2739 self
2740 }
2741
2742 pub fn set_body<T>(mut self, v: T) -> Self
2744 where
2745 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
2746 {
2747 self.0.request.body = std::option::Option::Some(v.into());
2748 self
2749 }
2750
2751 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2753 where
2754 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
2755 {
2756 self.0.request.body = v.map(|x| x.into());
2757 self
2758 }
2759 }
2760
2761 #[doc(hidden)]
2762 impl crate::RequestBuilder for Failover {
2763 fn request_options(&mut self) -> &mut crate::RequestOptions {
2764 &mut self.0.options
2765 }
2766 }
2767
2768 #[derive(Clone, Debug)]
2785 pub struct Reencrypt(RequestBuilder<crate::model::SqlInstancesReencryptRequest>);
2786
2787 impl Reencrypt {
2788 pub(crate) fn new(
2789 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2790 ) -> Self {
2791 Self(RequestBuilder::new(stub))
2792 }
2793
2794 pub fn with_request<V: Into<crate::model::SqlInstancesReencryptRequest>>(
2796 mut self,
2797 v: V,
2798 ) -> Self {
2799 self.0.request = v.into();
2800 self
2801 }
2802
2803 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2805 self.0.options = v.into();
2806 self
2807 }
2808
2809 pub async fn send(self) -> Result<crate::model::Operation> {
2811 (*self.0.stub)
2812 .reencrypt(self.0.request, self.0.options)
2813 .await
2814 .map(crate::Response::into_body)
2815 }
2816
2817 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2819 self.0.request.instance = v.into();
2820 self
2821 }
2822
2823 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2825 self.0.request.project = v.into();
2826 self
2827 }
2828
2829 pub fn set_body<T>(mut self, v: T) -> Self
2831 where
2832 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2833 {
2834 self.0.request.body = std::option::Option::Some(v.into());
2835 self
2836 }
2837
2838 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2840 where
2841 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2842 {
2843 self.0.request.body = v.map(|x| x.into());
2844 self
2845 }
2846 }
2847
2848 #[doc(hidden)]
2849 impl crate::RequestBuilder for Reencrypt {
2850 fn request_options(&mut self) -> &mut crate::RequestOptions {
2851 &mut self.0.options
2852 }
2853 }
2854
2855 #[derive(Clone, Debug)]
2872 pub struct Get(RequestBuilder<crate::model::SqlInstancesGetRequest>);
2873
2874 impl Get {
2875 pub(crate) fn new(
2876 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2877 ) -> Self {
2878 Self(RequestBuilder::new(stub))
2879 }
2880
2881 pub fn with_request<V: Into<crate::model::SqlInstancesGetRequest>>(mut self, v: V) -> Self {
2883 self.0.request = v.into();
2884 self
2885 }
2886
2887 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2889 self.0.options = v.into();
2890 self
2891 }
2892
2893 pub async fn send(self) -> Result<crate::model::DatabaseInstance> {
2895 (*self.0.stub)
2896 .get(self.0.request, self.0.options)
2897 .await
2898 .map(crate::Response::into_body)
2899 }
2900
2901 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2905 self.0.request.instance = v.into();
2906 self
2907 }
2908
2909 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2913 self.0.request.project = v.into();
2914 self
2915 }
2916 }
2917
2918 #[doc(hidden)]
2919 impl crate::RequestBuilder for Get {
2920 fn request_options(&mut self) -> &mut crate::RequestOptions {
2921 &mut self.0.options
2922 }
2923 }
2924
2925 #[derive(Clone, Debug)]
2942 pub struct Import(RequestBuilder<crate::model::SqlInstancesImportRequest>);
2943
2944 impl Import {
2945 pub(crate) fn new(
2946 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2947 ) -> Self {
2948 Self(RequestBuilder::new(stub))
2949 }
2950
2951 pub fn with_request<V: Into<crate::model::SqlInstancesImportRequest>>(
2953 mut self,
2954 v: V,
2955 ) -> Self {
2956 self.0.request = v.into();
2957 self
2958 }
2959
2960 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2962 self.0.options = v.into();
2963 self
2964 }
2965
2966 pub async fn send(self) -> Result<crate::model::Operation> {
2968 (*self.0.stub)
2969 .import(self.0.request, self.0.options)
2970 .await
2971 .map(crate::Response::into_body)
2972 }
2973
2974 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2976 self.0.request.instance = v.into();
2977 self
2978 }
2979
2980 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2982 self.0.request.project = v.into();
2983 self
2984 }
2985
2986 pub fn set_body<T>(mut self, v: T) -> Self
2988 where
2989 T: std::convert::Into<crate::model::InstancesImportRequest>,
2990 {
2991 self.0.request.body = std::option::Option::Some(v.into());
2992 self
2993 }
2994
2995 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2997 where
2998 T: std::convert::Into<crate::model::InstancesImportRequest>,
2999 {
3000 self.0.request.body = v.map(|x| x.into());
3001 self
3002 }
3003 }
3004
3005 #[doc(hidden)]
3006 impl crate::RequestBuilder for Import {
3007 fn request_options(&mut self) -> &mut crate::RequestOptions {
3008 &mut self.0.options
3009 }
3010 }
3011
3012 #[derive(Clone, Debug)]
3029 pub struct Insert(RequestBuilder<crate::model::SqlInstancesInsertRequest>);
3030
3031 impl Insert {
3032 pub(crate) fn new(
3033 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3034 ) -> Self {
3035 Self(RequestBuilder::new(stub))
3036 }
3037
3038 pub fn with_request<V: Into<crate::model::SqlInstancesInsertRequest>>(
3040 mut self,
3041 v: V,
3042 ) -> Self {
3043 self.0.request = v.into();
3044 self
3045 }
3046
3047 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3049 self.0.options = v.into();
3050 self
3051 }
3052
3053 pub async fn send(self) -> Result<crate::model::Operation> {
3055 (*self.0.stub)
3056 .insert(self.0.request, self.0.options)
3057 .await
3058 .map(crate::Response::into_body)
3059 }
3060
3061 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3063 self.0.request.project = v.into();
3064 self
3065 }
3066
3067 pub fn set_body<T>(mut self, v: T) -> Self
3069 where
3070 T: std::convert::Into<crate::model::DatabaseInstance>,
3071 {
3072 self.0.request.body = std::option::Option::Some(v.into());
3073 self
3074 }
3075
3076 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3078 where
3079 T: std::convert::Into<crate::model::DatabaseInstance>,
3080 {
3081 self.0.request.body = v.map(|x| x.into());
3082 self
3083 }
3084 }
3085
3086 #[doc(hidden)]
3087 impl crate::RequestBuilder for Insert {
3088 fn request_options(&mut self) -> &mut crate::RequestOptions {
3089 &mut self.0.options
3090 }
3091 }
3092
3093 #[derive(Clone, Debug)]
3114 pub struct List(RequestBuilder<crate::model::SqlInstancesListRequest>);
3115
3116 impl List {
3117 pub(crate) fn new(
3118 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3119 ) -> Self {
3120 Self(RequestBuilder::new(stub))
3121 }
3122
3123 pub fn with_request<V: Into<crate::model::SqlInstancesListRequest>>(
3125 mut self,
3126 v: V,
3127 ) -> Self {
3128 self.0.request = v.into();
3129 self
3130 }
3131
3132 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3134 self.0.options = v.into();
3135 self
3136 }
3137
3138 pub async fn send(self) -> Result<crate::model::InstancesListResponse> {
3140 (*self.0.stub)
3141 .list(self.0.request, self.0.options)
3142 .await
3143 .map(crate::Response::into_body)
3144 }
3145
3146 pub fn by_page(
3148 self,
3149 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::InstancesListResponse, crate::Error>
3150 {
3151 use std::clone::Clone;
3152 let token = self.0.request.page_token.clone();
3153 let execute = move |token: String| {
3154 let mut builder = self.clone();
3155 builder.0.request = builder.0.request.set_page_token(token);
3156 builder.send()
3157 };
3158 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3159 }
3160
3161 pub fn by_item(
3163 self,
3164 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3165 crate::model::InstancesListResponse,
3166 crate::Error,
3167 > {
3168 use google_cloud_gax::paginator::Paginator;
3169 self.by_page().items()
3170 }
3171
3172 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3174 self.0.request.filter = v.into();
3175 self
3176 }
3177
3178 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
3180 self.0.request.max_results = v.into();
3181 self
3182 }
3183
3184 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3186 self.0.request.page_token = v.into();
3187 self
3188 }
3189
3190 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3192 self.0.request.project = v.into();
3193 self
3194 }
3195 }
3196
3197 #[doc(hidden)]
3198 impl crate::RequestBuilder for List {
3199 fn request_options(&mut self) -> &mut crate::RequestOptions {
3200 &mut self.0.options
3201 }
3202 }
3203
3204 #[derive(Clone, Debug)]
3221 pub struct ListServerCas(RequestBuilder<crate::model::SqlInstancesListServerCasRequest>);
3222
3223 impl ListServerCas {
3224 pub(crate) fn new(
3225 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3226 ) -> Self {
3227 Self(RequestBuilder::new(stub))
3228 }
3229
3230 pub fn with_request<V: Into<crate::model::SqlInstancesListServerCasRequest>>(
3232 mut self,
3233 v: V,
3234 ) -> Self {
3235 self.0.request = v.into();
3236 self
3237 }
3238
3239 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3241 self.0.options = v.into();
3242 self
3243 }
3244
3245 pub async fn send(self) -> Result<crate::model::InstancesListServerCasResponse> {
3247 (*self.0.stub)
3248 .list_server_cas(self.0.request, self.0.options)
3249 .await
3250 .map(crate::Response::into_body)
3251 }
3252
3253 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3255 self.0.request.instance = v.into();
3256 self
3257 }
3258
3259 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3261 self.0.request.project = v.into();
3262 self
3263 }
3264 }
3265
3266 #[doc(hidden)]
3267 impl crate::RequestBuilder for ListServerCas {
3268 fn request_options(&mut self) -> &mut crate::RequestOptions {
3269 &mut self.0.options
3270 }
3271 }
3272
3273 #[derive(Clone, Debug)]
3290 pub struct ListServerCertificates(
3291 RequestBuilder<crate::model::SqlInstancesListServerCertificatesRequest>,
3292 );
3293
3294 impl ListServerCertificates {
3295 pub(crate) fn new(
3296 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3297 ) -> Self {
3298 Self(RequestBuilder::new(stub))
3299 }
3300
3301 pub fn with_request<V: Into<crate::model::SqlInstancesListServerCertificatesRequest>>(
3303 mut self,
3304 v: V,
3305 ) -> Self {
3306 self.0.request = v.into();
3307 self
3308 }
3309
3310 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3312 self.0.options = v.into();
3313 self
3314 }
3315
3316 pub async fn send(self) -> Result<crate::model::InstancesListServerCertificatesResponse> {
3318 (*self.0.stub)
3319 .list_server_certificates(self.0.request, self.0.options)
3320 .await
3321 .map(crate::Response::into_body)
3322 }
3323
3324 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3328 self.0.request.instance = v.into();
3329 self
3330 }
3331
3332 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3336 self.0.request.project = v.into();
3337 self
3338 }
3339 }
3340
3341 #[doc(hidden)]
3342 impl crate::RequestBuilder for ListServerCertificates {
3343 fn request_options(&mut self) -> &mut crate::RequestOptions {
3344 &mut self.0.options
3345 }
3346 }
3347
3348 #[derive(Clone, Debug)]
3365 pub struct ListEntraIdCertificates(
3366 RequestBuilder<crate::model::SqlInstancesListEntraIdCertificatesRequest>,
3367 );
3368
3369 impl ListEntraIdCertificates {
3370 pub(crate) fn new(
3371 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3372 ) -> Self {
3373 Self(RequestBuilder::new(stub))
3374 }
3375
3376 pub fn with_request<V: Into<crate::model::SqlInstancesListEntraIdCertificatesRequest>>(
3378 mut self,
3379 v: V,
3380 ) -> Self {
3381 self.0.request = v.into();
3382 self
3383 }
3384
3385 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3387 self.0.options = v.into();
3388 self
3389 }
3390
3391 pub async fn send(self) -> Result<crate::model::InstancesListEntraIdCertificatesResponse> {
3393 (*self.0.stub)
3394 .list_entra_id_certificates(self.0.request, self.0.options)
3395 .await
3396 .map(crate::Response::into_body)
3397 }
3398
3399 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3403 self.0.request.instance = v.into();
3404 self
3405 }
3406
3407 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3411 self.0.request.project = v.into();
3412 self
3413 }
3414 }
3415
3416 #[doc(hidden)]
3417 impl crate::RequestBuilder for ListEntraIdCertificates {
3418 fn request_options(&mut self) -> &mut crate::RequestOptions {
3419 &mut self.0.options
3420 }
3421 }
3422
3423 #[derive(Clone, Debug)]
3440 pub struct Patch(RequestBuilder<crate::model::SqlInstancesPatchRequest>);
3441
3442 impl Patch {
3443 pub(crate) fn new(
3444 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3445 ) -> Self {
3446 Self(RequestBuilder::new(stub))
3447 }
3448
3449 pub fn with_request<V: Into<crate::model::SqlInstancesPatchRequest>>(
3451 mut self,
3452 v: V,
3453 ) -> Self {
3454 self.0.request = v.into();
3455 self
3456 }
3457
3458 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3460 self.0.options = v.into();
3461 self
3462 }
3463
3464 pub async fn send(self) -> Result<crate::model::Operation> {
3466 (*self.0.stub)
3467 .patch(self.0.request, self.0.options)
3468 .await
3469 .map(crate::Response::into_body)
3470 }
3471
3472 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3474 self.0.request.instance = v.into();
3475 self
3476 }
3477
3478 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3480 self.0.request.project = v.into();
3481 self
3482 }
3483
3484 pub fn set_reconcile_psc_networking<T>(mut self, v: T) -> Self
3486 where
3487 T: std::convert::Into<bool>,
3488 {
3489 self.0.request.reconcile_psc_networking = std::option::Option::Some(v.into());
3490 self
3491 }
3492
3493 pub fn set_or_clear_reconcile_psc_networking<T>(mut self, v: std::option::Option<T>) -> Self
3495 where
3496 T: std::convert::Into<bool>,
3497 {
3498 self.0.request.reconcile_psc_networking = v.map(|x| x.into());
3499 self
3500 }
3501
3502 pub fn set_reconcile_psc_networking_force<T>(mut self, v: T) -> Self
3504 where
3505 T: std::convert::Into<bool>,
3506 {
3507 self.0.request.reconcile_psc_networking_force = std::option::Option::Some(v.into());
3508 self
3509 }
3510
3511 pub fn set_or_clear_reconcile_psc_networking_force<T>(
3513 mut self,
3514 v: std::option::Option<T>,
3515 ) -> Self
3516 where
3517 T: std::convert::Into<bool>,
3518 {
3519 self.0.request.reconcile_psc_networking_force = v.map(|x| x.into());
3520 self
3521 }
3522
3523 pub fn set_body<T>(mut self, v: T) -> Self
3525 where
3526 T: std::convert::Into<crate::model::DatabaseInstance>,
3527 {
3528 self.0.request.body = std::option::Option::Some(v.into());
3529 self
3530 }
3531
3532 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3534 where
3535 T: std::convert::Into<crate::model::DatabaseInstance>,
3536 {
3537 self.0.request.body = v.map(|x| x.into());
3538 self
3539 }
3540 }
3541
3542 #[doc(hidden)]
3543 impl crate::RequestBuilder for Patch {
3544 fn request_options(&mut self) -> &mut crate::RequestOptions {
3545 &mut self.0.options
3546 }
3547 }
3548
3549 #[derive(Clone, Debug)]
3566 pub struct PromoteReplica(RequestBuilder<crate::model::SqlInstancesPromoteReplicaRequest>);
3567
3568 impl PromoteReplica {
3569 pub(crate) fn new(
3570 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3571 ) -> Self {
3572 Self(RequestBuilder::new(stub))
3573 }
3574
3575 pub fn with_request<V: Into<crate::model::SqlInstancesPromoteReplicaRequest>>(
3577 mut self,
3578 v: V,
3579 ) -> Self {
3580 self.0.request = v.into();
3581 self
3582 }
3583
3584 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3586 self.0.options = v.into();
3587 self
3588 }
3589
3590 pub async fn send(self) -> Result<crate::model::Operation> {
3592 (*self.0.stub)
3593 .promote_replica(self.0.request, self.0.options)
3594 .await
3595 .map(crate::Response::into_body)
3596 }
3597
3598 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3600 self.0.request.instance = v.into();
3601 self
3602 }
3603
3604 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3606 self.0.request.project = v.into();
3607 self
3608 }
3609
3610 pub fn set_failover<T: Into<bool>>(mut self, v: T) -> Self {
3612 self.0.request.failover = v.into();
3613 self
3614 }
3615 }
3616
3617 #[doc(hidden)]
3618 impl crate::RequestBuilder for PromoteReplica {
3619 fn request_options(&mut self) -> &mut crate::RequestOptions {
3620 &mut self.0.options
3621 }
3622 }
3623
3624 #[derive(Clone, Debug)]
3641 pub struct Switchover(RequestBuilder<crate::model::SqlInstancesSwitchoverRequest>);
3642
3643 impl Switchover {
3644 pub(crate) fn new(
3645 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3646 ) -> Self {
3647 Self(RequestBuilder::new(stub))
3648 }
3649
3650 pub fn with_request<V: Into<crate::model::SqlInstancesSwitchoverRequest>>(
3652 mut self,
3653 v: V,
3654 ) -> Self {
3655 self.0.request = v.into();
3656 self
3657 }
3658
3659 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3661 self.0.options = v.into();
3662 self
3663 }
3664
3665 pub async fn send(self) -> Result<crate::model::Operation> {
3667 (*self.0.stub)
3668 .switchover(self.0.request, self.0.options)
3669 .await
3670 .map(crate::Response::into_body)
3671 }
3672
3673 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3675 self.0.request.instance = v.into();
3676 self
3677 }
3678
3679 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3681 self.0.request.project = v.into();
3682 self
3683 }
3684
3685 pub fn set_db_timeout<T>(mut self, v: T) -> Self
3687 where
3688 T: std::convert::Into<wkt::Duration>,
3689 {
3690 self.0.request.db_timeout = std::option::Option::Some(v.into());
3691 self
3692 }
3693
3694 pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
3696 where
3697 T: std::convert::Into<wkt::Duration>,
3698 {
3699 self.0.request.db_timeout = v.map(|x| x.into());
3700 self
3701 }
3702 }
3703
3704 #[doc(hidden)]
3705 impl crate::RequestBuilder for Switchover {
3706 fn request_options(&mut self) -> &mut crate::RequestOptions {
3707 &mut self.0.options
3708 }
3709 }
3710
3711 #[derive(Clone, Debug)]
3728 pub struct ResetSslConfig(RequestBuilder<crate::model::SqlInstancesResetSslConfigRequest>);
3729
3730 impl ResetSslConfig {
3731 pub(crate) fn new(
3732 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3733 ) -> Self {
3734 Self(RequestBuilder::new(stub))
3735 }
3736
3737 pub fn with_request<V: Into<crate::model::SqlInstancesResetSslConfigRequest>>(
3739 mut self,
3740 v: V,
3741 ) -> Self {
3742 self.0.request = v.into();
3743 self
3744 }
3745
3746 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3748 self.0.options = v.into();
3749 self
3750 }
3751
3752 pub async fn send(self) -> Result<crate::model::Operation> {
3754 (*self.0.stub)
3755 .reset_ssl_config(self.0.request, self.0.options)
3756 .await
3757 .map(crate::Response::into_body)
3758 }
3759
3760 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3762 self.0.request.instance = v.into();
3763 self
3764 }
3765
3766 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3768 self.0.request.project = v.into();
3769 self
3770 }
3771
3772 pub fn set_mode<
3774 T: Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
3775 >(
3776 mut self,
3777 v: T,
3778 ) -> Self {
3779 self.0.request.mode = v.into();
3780 self
3781 }
3782 }
3783
3784 #[doc(hidden)]
3785 impl crate::RequestBuilder for ResetSslConfig {
3786 fn request_options(&mut self) -> &mut crate::RequestOptions {
3787 &mut self.0.options
3788 }
3789 }
3790
3791 #[derive(Clone, Debug)]
3808 pub struct Restart(RequestBuilder<crate::model::SqlInstancesRestartRequest>);
3809
3810 impl Restart {
3811 pub(crate) fn new(
3812 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3813 ) -> Self {
3814 Self(RequestBuilder::new(stub))
3815 }
3816
3817 pub fn with_request<V: Into<crate::model::SqlInstancesRestartRequest>>(
3819 mut self,
3820 v: V,
3821 ) -> Self {
3822 self.0.request = v.into();
3823 self
3824 }
3825
3826 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3828 self.0.options = v.into();
3829 self
3830 }
3831
3832 pub async fn send(self) -> Result<crate::model::Operation> {
3834 (*self.0.stub)
3835 .restart(self.0.request, self.0.options)
3836 .await
3837 .map(crate::Response::into_body)
3838 }
3839
3840 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3842 self.0.request.instance = v.into();
3843 self
3844 }
3845
3846 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3848 self.0.request.project = v.into();
3849 self
3850 }
3851 }
3852
3853 #[doc(hidden)]
3854 impl crate::RequestBuilder for Restart {
3855 fn request_options(&mut self) -> &mut crate::RequestOptions {
3856 &mut self.0.options
3857 }
3858 }
3859
3860 #[derive(Clone, Debug)]
3877 pub struct RestoreBackup(RequestBuilder<crate::model::SqlInstancesRestoreBackupRequest>);
3878
3879 impl RestoreBackup {
3880 pub(crate) fn new(
3881 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3882 ) -> Self {
3883 Self(RequestBuilder::new(stub))
3884 }
3885
3886 pub fn with_request<V: Into<crate::model::SqlInstancesRestoreBackupRequest>>(
3888 mut self,
3889 v: V,
3890 ) -> Self {
3891 self.0.request = v.into();
3892 self
3893 }
3894
3895 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3897 self.0.options = v.into();
3898 self
3899 }
3900
3901 pub async fn send(self) -> Result<crate::model::Operation> {
3903 (*self.0.stub)
3904 .restore_backup(self.0.request, self.0.options)
3905 .await
3906 .map(crate::Response::into_body)
3907 }
3908
3909 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3911 self.0.request.instance = v.into();
3912 self
3913 }
3914
3915 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3917 self.0.request.project = v.into();
3918 self
3919 }
3920
3921 pub fn set_body<T>(mut self, v: T) -> Self
3923 where
3924 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
3925 {
3926 self.0.request.body = std::option::Option::Some(v.into());
3927 self
3928 }
3929
3930 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3932 where
3933 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
3934 {
3935 self.0.request.body = v.map(|x| x.into());
3936 self
3937 }
3938 }
3939
3940 #[doc(hidden)]
3941 impl crate::RequestBuilder for RestoreBackup {
3942 fn request_options(&mut self) -> &mut crate::RequestOptions {
3943 &mut self.0.options
3944 }
3945 }
3946
3947 #[derive(Clone, Debug)]
3964 pub struct RotateServerCa(RequestBuilder<crate::model::SqlInstancesRotateServerCaRequest>);
3965
3966 impl RotateServerCa {
3967 pub(crate) fn new(
3968 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3969 ) -> Self {
3970 Self(RequestBuilder::new(stub))
3971 }
3972
3973 pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCaRequest>>(
3975 mut self,
3976 v: V,
3977 ) -> Self {
3978 self.0.request = v.into();
3979 self
3980 }
3981
3982 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3984 self.0.options = v.into();
3985 self
3986 }
3987
3988 pub async fn send(self) -> Result<crate::model::Operation> {
3990 (*self.0.stub)
3991 .rotate_server_ca(self.0.request, self.0.options)
3992 .await
3993 .map(crate::Response::into_body)
3994 }
3995
3996 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3998 self.0.request.instance = v.into();
3999 self
4000 }
4001
4002 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4004 self.0.request.project = v.into();
4005 self
4006 }
4007
4008 pub fn set_body<T>(mut self, v: T) -> Self
4010 where
4011 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
4012 {
4013 self.0.request.body = std::option::Option::Some(v.into());
4014 self
4015 }
4016
4017 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4019 where
4020 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
4021 {
4022 self.0.request.body = v.map(|x| x.into());
4023 self
4024 }
4025 }
4026
4027 #[doc(hidden)]
4028 impl crate::RequestBuilder for RotateServerCa {
4029 fn request_options(&mut self) -> &mut crate::RequestOptions {
4030 &mut self.0.options
4031 }
4032 }
4033
4034 #[derive(Clone, Debug)]
4051 pub struct RotateServerCertificate(
4052 RequestBuilder<crate::model::SqlInstancesRotateServerCertificateRequest>,
4053 );
4054
4055 impl RotateServerCertificate {
4056 pub(crate) fn new(
4057 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4058 ) -> Self {
4059 Self(RequestBuilder::new(stub))
4060 }
4061
4062 pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCertificateRequest>>(
4064 mut self,
4065 v: V,
4066 ) -> Self {
4067 self.0.request = v.into();
4068 self
4069 }
4070
4071 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4073 self.0.options = v.into();
4074 self
4075 }
4076
4077 pub async fn send(self) -> Result<crate::model::Operation> {
4079 (*self.0.stub)
4080 .rotate_server_certificate(self.0.request, self.0.options)
4081 .await
4082 .map(crate::Response::into_body)
4083 }
4084
4085 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4089 self.0.request.instance = v.into();
4090 self
4091 }
4092
4093 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4097 self.0.request.project = v.into();
4098 self
4099 }
4100
4101 pub fn set_body<T>(mut self, v: T) -> Self
4103 where
4104 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
4105 {
4106 self.0.request.body = std::option::Option::Some(v.into());
4107 self
4108 }
4109
4110 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4112 where
4113 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
4114 {
4115 self.0.request.body = v.map(|x| x.into());
4116 self
4117 }
4118 }
4119
4120 #[doc(hidden)]
4121 impl crate::RequestBuilder for RotateServerCertificate {
4122 fn request_options(&mut self) -> &mut crate::RequestOptions {
4123 &mut self.0.options
4124 }
4125 }
4126
4127 #[derive(Clone, Debug)]
4144 pub struct RotateEntraIdCertificate(
4145 RequestBuilder<crate::model::SqlInstancesRotateEntraIdCertificateRequest>,
4146 );
4147
4148 impl RotateEntraIdCertificate {
4149 pub(crate) fn new(
4150 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4151 ) -> Self {
4152 Self(RequestBuilder::new(stub))
4153 }
4154
4155 pub fn with_request<V: Into<crate::model::SqlInstancesRotateEntraIdCertificateRequest>>(
4157 mut self,
4158 v: V,
4159 ) -> Self {
4160 self.0.request = v.into();
4161 self
4162 }
4163
4164 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4166 self.0.options = v.into();
4167 self
4168 }
4169
4170 pub async fn send(self) -> Result<crate::model::Operation> {
4172 (*self.0.stub)
4173 .rotate_entra_id_certificate(self.0.request, self.0.options)
4174 .await
4175 .map(crate::Response::into_body)
4176 }
4177
4178 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4182 self.0.request.instance = v.into();
4183 self
4184 }
4185
4186 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4190 self.0.request.project = v.into();
4191 self
4192 }
4193
4194 pub fn set_body<T>(mut self, v: T) -> Self
4196 where
4197 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
4198 {
4199 self.0.request.body = std::option::Option::Some(v.into());
4200 self
4201 }
4202
4203 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4205 where
4206 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
4207 {
4208 self.0.request.body = v.map(|x| x.into());
4209 self
4210 }
4211 }
4212
4213 #[doc(hidden)]
4214 impl crate::RequestBuilder for RotateEntraIdCertificate {
4215 fn request_options(&mut self) -> &mut crate::RequestOptions {
4216 &mut self.0.options
4217 }
4218 }
4219
4220 #[derive(Clone, Debug)]
4237 pub struct StartReplica(RequestBuilder<crate::model::SqlInstancesStartReplicaRequest>);
4238
4239 impl StartReplica {
4240 pub(crate) fn new(
4241 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4242 ) -> Self {
4243 Self(RequestBuilder::new(stub))
4244 }
4245
4246 pub fn with_request<V: Into<crate::model::SqlInstancesStartReplicaRequest>>(
4248 mut self,
4249 v: V,
4250 ) -> Self {
4251 self.0.request = v.into();
4252 self
4253 }
4254
4255 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4257 self.0.options = v.into();
4258 self
4259 }
4260
4261 pub async fn send(self) -> Result<crate::model::Operation> {
4263 (*self.0.stub)
4264 .start_replica(self.0.request, self.0.options)
4265 .await
4266 .map(crate::Response::into_body)
4267 }
4268
4269 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4271 self.0.request.instance = v.into();
4272 self
4273 }
4274
4275 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4277 self.0.request.project = v.into();
4278 self
4279 }
4280 }
4281
4282 #[doc(hidden)]
4283 impl crate::RequestBuilder for StartReplica {
4284 fn request_options(&mut self) -> &mut crate::RequestOptions {
4285 &mut self.0.options
4286 }
4287 }
4288
4289 #[derive(Clone, Debug)]
4306 pub struct StopReplica(RequestBuilder<crate::model::SqlInstancesStopReplicaRequest>);
4307
4308 impl StopReplica {
4309 pub(crate) fn new(
4310 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4311 ) -> Self {
4312 Self(RequestBuilder::new(stub))
4313 }
4314
4315 pub fn with_request<V: Into<crate::model::SqlInstancesStopReplicaRequest>>(
4317 mut self,
4318 v: V,
4319 ) -> Self {
4320 self.0.request = v.into();
4321 self
4322 }
4323
4324 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4326 self.0.options = v.into();
4327 self
4328 }
4329
4330 pub async fn send(self) -> Result<crate::model::Operation> {
4332 (*self.0.stub)
4333 .stop_replica(self.0.request, self.0.options)
4334 .await
4335 .map(crate::Response::into_body)
4336 }
4337
4338 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4340 self.0.request.instance = v.into();
4341 self
4342 }
4343
4344 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4346 self.0.request.project = v.into();
4347 self
4348 }
4349 }
4350
4351 #[doc(hidden)]
4352 impl crate::RequestBuilder for StopReplica {
4353 fn request_options(&mut self) -> &mut crate::RequestOptions {
4354 &mut self.0.options
4355 }
4356 }
4357
4358 #[derive(Clone, Debug)]
4375 pub struct TruncateLog(RequestBuilder<crate::model::SqlInstancesTruncateLogRequest>);
4376
4377 impl TruncateLog {
4378 pub(crate) fn new(
4379 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4380 ) -> Self {
4381 Self(RequestBuilder::new(stub))
4382 }
4383
4384 pub fn with_request<V: Into<crate::model::SqlInstancesTruncateLogRequest>>(
4386 mut self,
4387 v: V,
4388 ) -> Self {
4389 self.0.request = v.into();
4390 self
4391 }
4392
4393 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4395 self.0.options = v.into();
4396 self
4397 }
4398
4399 pub async fn send(self) -> Result<crate::model::Operation> {
4401 (*self.0.stub)
4402 .truncate_log(self.0.request, self.0.options)
4403 .await
4404 .map(crate::Response::into_body)
4405 }
4406
4407 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4409 self.0.request.instance = v.into();
4410 self
4411 }
4412
4413 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4415 self.0.request.project = v.into();
4416 self
4417 }
4418
4419 pub fn set_body<T>(mut self, v: T) -> Self
4421 where
4422 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
4423 {
4424 self.0.request.body = std::option::Option::Some(v.into());
4425 self
4426 }
4427
4428 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4430 where
4431 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
4432 {
4433 self.0.request.body = v.map(|x| x.into());
4434 self
4435 }
4436 }
4437
4438 #[doc(hidden)]
4439 impl crate::RequestBuilder for TruncateLog {
4440 fn request_options(&mut self) -> &mut crate::RequestOptions {
4441 &mut self.0.options
4442 }
4443 }
4444
4445 #[derive(Clone, Debug)]
4462 pub struct Update(RequestBuilder<crate::model::SqlInstancesUpdateRequest>);
4463
4464 impl Update {
4465 pub(crate) fn new(
4466 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4467 ) -> Self {
4468 Self(RequestBuilder::new(stub))
4469 }
4470
4471 pub fn with_request<V: Into<crate::model::SqlInstancesUpdateRequest>>(
4473 mut self,
4474 v: V,
4475 ) -> Self {
4476 self.0.request = v.into();
4477 self
4478 }
4479
4480 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4482 self.0.options = v.into();
4483 self
4484 }
4485
4486 pub async fn send(self) -> Result<crate::model::Operation> {
4488 (*self.0.stub)
4489 .update(self.0.request, self.0.options)
4490 .await
4491 .map(crate::Response::into_body)
4492 }
4493
4494 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4496 self.0.request.instance = v.into();
4497 self
4498 }
4499
4500 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4502 self.0.request.project = v.into();
4503 self
4504 }
4505
4506 pub fn set_body<T>(mut self, v: T) -> Self
4508 where
4509 T: std::convert::Into<crate::model::DatabaseInstance>,
4510 {
4511 self.0.request.body = std::option::Option::Some(v.into());
4512 self
4513 }
4514
4515 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4517 where
4518 T: std::convert::Into<crate::model::DatabaseInstance>,
4519 {
4520 self.0.request.body = v.map(|x| x.into());
4521 self
4522 }
4523 }
4524
4525 #[doc(hidden)]
4526 impl crate::RequestBuilder for Update {
4527 fn request_options(&mut self) -> &mut crate::RequestOptions {
4528 &mut self.0.options
4529 }
4530 }
4531
4532 #[derive(Clone, Debug)]
4549 pub struct CreateEphemeral(
4550 RequestBuilder<crate::model::SqlInstancesCreateEphemeralCertRequest>,
4551 );
4552
4553 impl CreateEphemeral {
4554 pub(crate) fn new(
4555 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4556 ) -> Self {
4557 Self(RequestBuilder::new(stub))
4558 }
4559
4560 pub fn with_request<V: Into<crate::model::SqlInstancesCreateEphemeralCertRequest>>(
4562 mut self,
4563 v: V,
4564 ) -> Self {
4565 self.0.request = v.into();
4566 self
4567 }
4568
4569 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4571 self.0.options = v.into();
4572 self
4573 }
4574
4575 pub async fn send(self) -> Result<crate::model::SslCert> {
4577 (*self.0.stub)
4578 .create_ephemeral(self.0.request, self.0.options)
4579 .await
4580 .map(crate::Response::into_body)
4581 }
4582
4583 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4585 self.0.request.instance = v.into();
4586 self
4587 }
4588
4589 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4591 self.0.request.project = v.into();
4592 self
4593 }
4594
4595 pub fn set_body<T>(mut self, v: T) -> Self
4597 where
4598 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
4599 {
4600 self.0.request.body = std::option::Option::Some(v.into());
4601 self
4602 }
4603
4604 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4606 where
4607 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
4608 {
4609 self.0.request.body = v.map(|x| x.into());
4610 self
4611 }
4612 }
4613
4614 #[doc(hidden)]
4615 impl crate::RequestBuilder for CreateEphemeral {
4616 fn request_options(&mut self) -> &mut crate::RequestOptions {
4617 &mut self.0.options
4618 }
4619 }
4620
4621 #[derive(Clone, Debug)]
4638 pub struct RescheduleMaintenance(
4639 RequestBuilder<crate::model::SqlInstancesRescheduleMaintenanceRequest>,
4640 );
4641
4642 impl RescheduleMaintenance {
4643 pub(crate) fn new(
4644 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4645 ) -> Self {
4646 Self(RequestBuilder::new(stub))
4647 }
4648
4649 pub fn with_request<V: Into<crate::model::SqlInstancesRescheduleMaintenanceRequest>>(
4651 mut self,
4652 v: V,
4653 ) -> Self {
4654 self.0.request = v.into();
4655 self
4656 }
4657
4658 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4660 self.0.options = v.into();
4661 self
4662 }
4663
4664 pub async fn send(self) -> Result<crate::model::Operation> {
4666 (*self.0.stub)
4667 .reschedule_maintenance(self.0.request, self.0.options)
4668 .await
4669 .map(crate::Response::into_body)
4670 }
4671
4672 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4674 self.0.request.instance = v.into();
4675 self
4676 }
4677
4678 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4680 self.0.request.project = v.into();
4681 self
4682 }
4683
4684 pub fn set_body<T>(mut self, v: T) -> Self
4686 where
4687 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4688 {
4689 self.0.request.body = std::option::Option::Some(v.into());
4690 self
4691 }
4692
4693 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4695 where
4696 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4697 {
4698 self.0.request.body = v.map(|x| x.into());
4699 self
4700 }
4701 }
4702
4703 #[doc(hidden)]
4704 impl crate::RequestBuilder for RescheduleMaintenance {
4705 fn request_options(&mut self) -> &mut crate::RequestOptions {
4706 &mut self.0.options
4707 }
4708 }
4709
4710 #[derive(Clone, Debug)]
4727 pub struct VerifyExternalSyncSettings(
4728 RequestBuilder<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
4729 );
4730
4731 impl VerifyExternalSyncSettings {
4732 pub(crate) fn new(
4733 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4734 ) -> Self {
4735 Self(RequestBuilder::new(stub))
4736 }
4737
4738 pub fn with_request<
4740 V: Into<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
4741 >(
4742 mut self,
4743 v: V,
4744 ) -> Self {
4745 self.0.request = v.into();
4746 self
4747 }
4748
4749 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4751 self.0.options = v.into();
4752 self
4753 }
4754
4755 pub async fn send(
4757 self,
4758 ) -> Result<crate::model::SqlInstancesVerifyExternalSyncSettingsResponse> {
4759 (*self.0.stub)
4760 .verify_external_sync_settings(self.0.request, self.0.options)
4761 .await
4762 .map(crate::Response::into_body)
4763 }
4764
4765 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4767 self.0.request.instance = v.into();
4768 self
4769 }
4770
4771 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4773 self.0.request.project = v.into();
4774 self
4775 }
4776
4777 pub fn set_verify_connection_only<T: Into<bool>>(mut self, v: T) -> Self {
4779 self.0.request.verify_connection_only = v.into();
4780 self
4781 }
4782
4783 pub fn set_sync_mode<
4785 T: Into<
4786 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
4787 >,
4788 >(
4789 mut self,
4790 v: T,
4791 ) -> Self {
4792 self.0.request.sync_mode = v.into();
4793 self
4794 }
4795
4796 pub fn set_verify_replication_only<T: Into<bool>>(mut self, v: T) -> Self {
4798 self.0.request.verify_replication_only = v.into();
4799 self
4800 }
4801
4802 pub fn set_migration_type<
4804 T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
4805 >(
4806 mut self,
4807 v: T,
4808 ) -> Self {
4809 self.0.request.migration_type = v.into();
4810 self
4811 }
4812
4813 pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
4815 mut self,
4816 v: T,
4817 ) -> Self {
4818 self.0.request.sync_parallel_level = v.into();
4819 self
4820 }
4821
4822 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
4824 where
4825 T: std::iter::IntoIterator<Item = V>,
4826 V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
4827 {
4828 use std::iter::Iterator;
4829 self.0.request.selected_objects = v.into_iter().map(|i| i.into()).collect();
4830 self
4831 }
4832
4833 pub fn set_sync_config<
4838 T: Into<
4839 Option<
4840 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
4841 >,
4842 >,
4843 >(
4844 mut self,
4845 v: T,
4846 ) -> Self {
4847 self.0.request.sync_config = v.into();
4848 self
4849 }
4850
4851 pub fn set_mysql_sync_config<
4857 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
4858 >(
4859 mut self,
4860 v: T,
4861 ) -> Self {
4862 self.0.request = self.0.request.set_mysql_sync_config(v);
4863 self
4864 }
4865 }
4866
4867 #[doc(hidden)]
4868 impl crate::RequestBuilder for VerifyExternalSyncSettings {
4869 fn request_options(&mut self) -> &mut crate::RequestOptions {
4870 &mut self.0.options
4871 }
4872 }
4873
4874 #[derive(Clone, Debug)]
4891 pub struct StartExternalSync(
4892 RequestBuilder<crate::model::SqlInstancesStartExternalSyncRequest>,
4893 );
4894
4895 impl StartExternalSync {
4896 pub(crate) fn new(
4897 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4898 ) -> Self {
4899 Self(RequestBuilder::new(stub))
4900 }
4901
4902 pub fn with_request<V: Into<crate::model::SqlInstancesStartExternalSyncRequest>>(
4904 mut self,
4905 v: V,
4906 ) -> Self {
4907 self.0.request = v.into();
4908 self
4909 }
4910
4911 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4913 self.0.options = v.into();
4914 self
4915 }
4916
4917 pub async fn send(self) -> Result<crate::model::Operation> {
4919 (*self.0.stub)
4920 .start_external_sync(self.0.request, self.0.options)
4921 .await
4922 .map(crate::Response::into_body)
4923 }
4924
4925 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4927 self.0.request.instance = v.into();
4928 self
4929 }
4930
4931 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4933 self.0.request.project = v.into();
4934 self
4935 }
4936
4937 pub fn set_sync_mode<
4939 T: Into<
4940 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
4941 >,
4942 >(
4943 mut self,
4944 v: T,
4945 ) -> Self {
4946 self.0.request.sync_mode = v.into();
4947 self
4948 }
4949
4950 pub fn set_skip_verification<T: Into<bool>>(mut self, v: T) -> Self {
4952 self.0.request.skip_verification = v.into();
4953 self
4954 }
4955
4956 pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
4958 mut self,
4959 v: T,
4960 ) -> Self {
4961 self.0.request.sync_parallel_level = v.into();
4962 self
4963 }
4964
4965 pub fn set_migration_type<
4967 T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
4968 >(
4969 mut self,
4970 v: T,
4971 ) -> Self {
4972 self.0.request.migration_type = v.into();
4973 self
4974 }
4975
4976 pub fn set_replica_overwrite_enabled<T: Into<bool>>(mut self, v: T) -> Self {
4978 self.0.request.replica_overwrite_enabled = v.into();
4979 self
4980 }
4981
4982 pub fn set_sync_config<
4987 T: Into<Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>>,
4988 >(
4989 mut self,
4990 v: T,
4991 ) -> Self {
4992 self.0.request.sync_config = v.into();
4993 self
4994 }
4995
4996 pub fn set_mysql_sync_config<
5002 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
5003 >(
5004 mut self,
5005 v: T,
5006 ) -> Self {
5007 self.0.request = self.0.request.set_mysql_sync_config(v);
5008 self
5009 }
5010 }
5011
5012 #[doc(hidden)]
5013 impl crate::RequestBuilder for StartExternalSync {
5014 fn request_options(&mut self) -> &mut crate::RequestOptions {
5015 &mut self.0.options
5016 }
5017 }
5018
5019 #[derive(Clone, Debug)]
5036 pub struct PerformDiskShrink(
5037 RequestBuilder<crate::model::SqlInstancesPerformDiskShrinkRequest>,
5038 );
5039
5040 impl PerformDiskShrink {
5041 pub(crate) fn new(
5042 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5043 ) -> Self {
5044 Self(RequestBuilder::new(stub))
5045 }
5046
5047 pub fn with_request<V: Into<crate::model::SqlInstancesPerformDiskShrinkRequest>>(
5049 mut self,
5050 v: V,
5051 ) -> Self {
5052 self.0.request = v.into();
5053 self
5054 }
5055
5056 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5058 self.0.options = v.into();
5059 self
5060 }
5061
5062 pub async fn send(self) -> Result<crate::model::Operation> {
5064 (*self.0.stub)
5065 .perform_disk_shrink(self.0.request, self.0.options)
5066 .await
5067 .map(crate::Response::into_body)
5068 }
5069
5070 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5072 self.0.request.instance = v.into();
5073 self
5074 }
5075
5076 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5078 self.0.request.project = v.into();
5079 self
5080 }
5081
5082 pub fn set_body<T>(mut self, v: T) -> Self
5084 where
5085 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
5086 {
5087 self.0.request.body = std::option::Option::Some(v.into());
5088 self
5089 }
5090
5091 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5093 where
5094 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
5095 {
5096 self.0.request.body = v.map(|x| x.into());
5097 self
5098 }
5099 }
5100
5101 #[doc(hidden)]
5102 impl crate::RequestBuilder for PerformDiskShrink {
5103 fn request_options(&mut self) -> &mut crate::RequestOptions {
5104 &mut self.0.options
5105 }
5106 }
5107
5108 #[derive(Clone, Debug)]
5125 pub struct GetDiskShrinkConfig(
5126 RequestBuilder<crate::model::SqlInstancesGetDiskShrinkConfigRequest>,
5127 );
5128
5129 impl GetDiskShrinkConfig {
5130 pub(crate) fn new(
5131 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5132 ) -> Self {
5133 Self(RequestBuilder::new(stub))
5134 }
5135
5136 pub fn with_request<V: Into<crate::model::SqlInstancesGetDiskShrinkConfigRequest>>(
5138 mut self,
5139 v: V,
5140 ) -> Self {
5141 self.0.request = v.into();
5142 self
5143 }
5144
5145 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5147 self.0.options = v.into();
5148 self
5149 }
5150
5151 pub async fn send(self) -> Result<crate::model::SqlInstancesGetDiskShrinkConfigResponse> {
5153 (*self.0.stub)
5154 .get_disk_shrink_config(self.0.request, self.0.options)
5155 .await
5156 .map(crate::Response::into_body)
5157 }
5158
5159 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5161 self.0.request.instance = v.into();
5162 self
5163 }
5164
5165 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5167 self.0.request.project = v.into();
5168 self
5169 }
5170 }
5171
5172 #[doc(hidden)]
5173 impl crate::RequestBuilder for GetDiskShrinkConfig {
5174 fn request_options(&mut self) -> &mut crate::RequestOptions {
5175 &mut self.0.options
5176 }
5177 }
5178
5179 #[derive(Clone, Debug)]
5196 pub struct ResetReplicaSize(RequestBuilder<crate::model::SqlInstancesResetReplicaSizeRequest>);
5197
5198 impl ResetReplicaSize {
5199 pub(crate) fn new(
5200 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5201 ) -> Self {
5202 Self(RequestBuilder::new(stub))
5203 }
5204
5205 pub fn with_request<V: Into<crate::model::SqlInstancesResetReplicaSizeRequest>>(
5207 mut self,
5208 v: V,
5209 ) -> Self {
5210 self.0.request = v.into();
5211 self
5212 }
5213
5214 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5216 self.0.options = v.into();
5217 self
5218 }
5219
5220 pub async fn send(self) -> Result<crate::model::Operation> {
5222 (*self.0.stub)
5223 .reset_replica_size(self.0.request, self.0.options)
5224 .await
5225 .map(crate::Response::into_body)
5226 }
5227
5228 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5230 self.0.request.instance = v.into();
5231 self
5232 }
5233
5234 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5236 self.0.request.project = v.into();
5237 self
5238 }
5239 }
5240
5241 #[doc(hidden)]
5242 impl crate::RequestBuilder for ResetReplicaSize {
5243 fn request_options(&mut self) -> &mut crate::RequestOptions {
5244 &mut self.0.options
5245 }
5246 }
5247
5248 #[derive(Clone, Debug)]
5265 pub struct GetLatestRecoveryTime(
5266 RequestBuilder<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>,
5267 );
5268
5269 impl GetLatestRecoveryTime {
5270 pub(crate) fn new(
5271 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5272 ) -> Self {
5273 Self(RequestBuilder::new(stub))
5274 }
5275
5276 pub fn with_request<V: Into<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>>(
5278 mut self,
5279 v: V,
5280 ) -> Self {
5281 self.0.request = v.into();
5282 self
5283 }
5284
5285 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5287 self.0.options = v.into();
5288 self
5289 }
5290
5291 pub async fn send(self) -> Result<crate::model::SqlInstancesGetLatestRecoveryTimeResponse> {
5293 (*self.0.stub)
5294 .get_latest_recovery_time(self.0.request, self.0.options)
5295 .await
5296 .map(crate::Response::into_body)
5297 }
5298
5299 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5301 self.0.request.instance = v.into();
5302 self
5303 }
5304
5305 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5307 self.0.request.project = v.into();
5308 self
5309 }
5310
5311 pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
5313 where
5314 T: std::convert::Into<wkt::Timestamp>,
5315 {
5316 self.0.request.source_instance_deletion_time = std::option::Option::Some(v.into());
5317 self
5318 }
5319
5320 pub fn set_or_clear_source_instance_deletion_time<T>(
5322 mut self,
5323 v: std::option::Option<T>,
5324 ) -> Self
5325 where
5326 T: std::convert::Into<wkt::Timestamp>,
5327 {
5328 self.0.request.source_instance_deletion_time = v.map(|x| x.into());
5329 self
5330 }
5331 }
5332
5333 #[doc(hidden)]
5334 impl crate::RequestBuilder for GetLatestRecoveryTime {
5335 fn request_options(&mut self) -> &mut crate::RequestOptions {
5336 &mut self.0.options
5337 }
5338 }
5339
5340 #[derive(Clone, Debug)]
5357 pub struct ExecuteSql(RequestBuilder<crate::model::SqlInstancesExecuteSqlRequest>);
5358
5359 impl ExecuteSql {
5360 pub(crate) fn new(
5361 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5362 ) -> Self {
5363 Self(RequestBuilder::new(stub))
5364 }
5365
5366 pub fn with_request<V: Into<crate::model::SqlInstancesExecuteSqlRequest>>(
5368 mut self,
5369 v: V,
5370 ) -> Self {
5371 self.0.request = v.into();
5372 self
5373 }
5374
5375 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5377 self.0.options = v.into();
5378 self
5379 }
5380
5381 pub async fn send(self) -> Result<crate::model::SqlInstancesExecuteSqlResponse> {
5383 (*self.0.stub)
5384 .execute_sql(self.0.request, self.0.options)
5385 .await
5386 .map(crate::Response::into_body)
5387 }
5388
5389 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5393 self.0.request.instance = v.into();
5394 self
5395 }
5396
5397 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5401 self.0.request.project = v.into();
5402 self
5403 }
5404
5405 pub fn set_body<T>(mut self, v: T) -> Self
5407 where
5408 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
5409 {
5410 self.0.request.body = std::option::Option::Some(v.into());
5411 self
5412 }
5413
5414 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5416 where
5417 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
5418 {
5419 self.0.request.body = v.map(|x| x.into());
5420 self
5421 }
5422 }
5423
5424 #[doc(hidden)]
5425 impl crate::RequestBuilder for ExecuteSql {
5426 fn request_options(&mut self) -> &mut crate::RequestOptions {
5427 &mut self.0.options
5428 }
5429 }
5430
5431 #[derive(Clone, Debug)]
5448 pub struct AcquireSsrsLease(RequestBuilder<crate::model::SqlInstancesAcquireSsrsLeaseRequest>);
5449
5450 impl AcquireSsrsLease {
5451 pub(crate) fn new(
5452 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5453 ) -> Self {
5454 Self(RequestBuilder::new(stub))
5455 }
5456
5457 pub fn with_request<V: Into<crate::model::SqlInstancesAcquireSsrsLeaseRequest>>(
5459 mut self,
5460 v: V,
5461 ) -> Self {
5462 self.0.request = v.into();
5463 self
5464 }
5465
5466 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5468 self.0.options = v.into();
5469 self
5470 }
5471
5472 pub async fn send(self) -> Result<crate::model::SqlInstancesAcquireSsrsLeaseResponse> {
5474 (*self.0.stub)
5475 .acquire_ssrs_lease(self.0.request, self.0.options)
5476 .await
5477 .map(crate::Response::into_body)
5478 }
5479
5480 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5484 self.0.request.instance = v.into();
5485 self
5486 }
5487
5488 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5492 self.0.request.project = v.into();
5493 self
5494 }
5495
5496 pub fn set_body<T>(mut self, v: T) -> Self
5500 where
5501 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
5502 {
5503 self.0.request.body = std::option::Option::Some(v.into());
5504 self
5505 }
5506
5507 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5511 where
5512 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
5513 {
5514 self.0.request.body = v.map(|x| x.into());
5515 self
5516 }
5517 }
5518
5519 #[doc(hidden)]
5520 impl crate::RequestBuilder for AcquireSsrsLease {
5521 fn request_options(&mut self) -> &mut crate::RequestOptions {
5522 &mut self.0.options
5523 }
5524 }
5525
5526 #[derive(Clone, Debug)]
5543 pub struct ReleaseSsrsLease(RequestBuilder<crate::model::SqlInstancesReleaseSsrsLeaseRequest>);
5544
5545 impl ReleaseSsrsLease {
5546 pub(crate) fn new(
5547 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5548 ) -> Self {
5549 Self(RequestBuilder::new(stub))
5550 }
5551
5552 pub fn with_request<V: Into<crate::model::SqlInstancesReleaseSsrsLeaseRequest>>(
5554 mut self,
5555 v: V,
5556 ) -> Self {
5557 self.0.request = v.into();
5558 self
5559 }
5560
5561 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5563 self.0.options = v.into();
5564 self
5565 }
5566
5567 pub async fn send(self) -> Result<crate::model::SqlInstancesReleaseSsrsLeaseResponse> {
5569 (*self.0.stub)
5570 .release_ssrs_lease(self.0.request, self.0.options)
5571 .await
5572 .map(crate::Response::into_body)
5573 }
5574
5575 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5579 self.0.request.instance = v.into();
5580 self
5581 }
5582
5583 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5587 self.0.request.project = v.into();
5588 self
5589 }
5590 }
5591
5592 #[doc(hidden)]
5593 impl crate::RequestBuilder for ReleaseSsrsLease {
5594 fn request_options(&mut self) -> &mut crate::RequestOptions {
5595 &mut self.0.options
5596 }
5597 }
5598
5599 #[derive(Clone, Debug)]
5616 pub struct PreCheckMajorVersionUpgrade(
5617 RequestBuilder<crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest>,
5618 );
5619
5620 impl PreCheckMajorVersionUpgrade {
5621 pub(crate) fn new(
5622 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5623 ) -> Self {
5624 Self(RequestBuilder::new(stub))
5625 }
5626
5627 pub fn with_request<
5629 V: Into<crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest>,
5630 >(
5631 mut self,
5632 v: V,
5633 ) -> Self {
5634 self.0.request = v.into();
5635 self
5636 }
5637
5638 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5640 self.0.options = v.into();
5641 self
5642 }
5643
5644 pub async fn send(self) -> Result<crate::model::Operation> {
5646 (*self.0.stub)
5647 .pre_check_major_version_upgrade(self.0.request, self.0.options)
5648 .await
5649 .map(crate::Response::into_body)
5650 }
5651
5652 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5656 self.0.request.instance = v.into();
5657 self
5658 }
5659
5660 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5664 self.0.request.project = v.into();
5665 self
5666 }
5667
5668 pub fn set_body<T>(mut self, v: T) -> Self
5672 where
5673 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
5674 {
5675 self.0.request.body = std::option::Option::Some(v.into());
5676 self
5677 }
5678
5679 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5683 where
5684 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
5685 {
5686 self.0.request.body = v.map(|x| x.into());
5687 self
5688 }
5689 }
5690
5691 #[doc(hidden)]
5692 impl crate::RequestBuilder for PreCheckMajorVersionUpgrade {
5693 fn request_options(&mut self) -> &mut crate::RequestOptions {
5694 &mut self.0.options
5695 }
5696 }
5697
5698 #[derive(Clone, Debug)]
5715 pub struct PointInTimeRestore(
5716 RequestBuilder<crate::model::SqlInstancesPointInTimeRestoreRequest>,
5717 );
5718
5719 impl PointInTimeRestore {
5720 pub(crate) fn new(
5721 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5722 ) -> Self {
5723 Self(RequestBuilder::new(stub))
5724 }
5725
5726 pub fn with_request<V: Into<crate::model::SqlInstancesPointInTimeRestoreRequest>>(
5728 mut self,
5729 v: V,
5730 ) -> Self {
5731 self.0.request = v.into();
5732 self
5733 }
5734
5735 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5737 self.0.options = v.into();
5738 self
5739 }
5740
5741 pub async fn send(self) -> Result<crate::model::Operation> {
5743 (*self.0.stub)
5744 .point_in_time_restore(self.0.request, self.0.options)
5745 .await
5746 .map(crate::Response::into_body)
5747 }
5748
5749 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5753 self.0.request.parent = v.into();
5754 self
5755 }
5756
5757 pub fn set_context<T>(mut self, v: T) -> Self
5761 where
5762 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
5763 {
5764 self.0.request.context = std::option::Option::Some(v.into());
5765 self
5766 }
5767
5768 pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
5772 where
5773 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
5774 {
5775 self.0.request.context = v.map(|x| x.into());
5776 self
5777 }
5778 }
5779
5780 #[doc(hidden)]
5781 impl crate::RequestBuilder for PointInTimeRestore {
5782 fn request_options(&mut self) -> &mut crate::RequestOptions {
5783 &mut self.0.options
5784 }
5785 }
5786}
5787
5788pub mod sql_operations_service {
5790 use crate::Result;
5791
5792 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5806
5807 pub(crate) mod client {
5808 use super::super::super::client::SqlOperationsService;
5809 pub struct Factory;
5810 impl crate::ClientFactory for Factory {
5811 type Client = SqlOperationsService;
5812 type Credentials = gaxi::options::Credentials;
5813 async fn build(
5814 self,
5815 config: gaxi::options::ClientConfig,
5816 ) -> crate::ClientBuilderResult<Self::Client> {
5817 Self::Client::new(config).await
5818 }
5819 }
5820 }
5821
5822 #[derive(Clone, Debug)]
5824 pub(crate) struct RequestBuilder<R: std::default::Default> {
5825 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5826 request: R,
5827 options: crate::RequestOptions,
5828 }
5829
5830 impl<R> RequestBuilder<R>
5831 where
5832 R: std::default::Default,
5833 {
5834 pub(crate) fn new(
5835 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5836 ) -> Self {
5837 Self {
5838 stub,
5839 request: R::default(),
5840 options: crate::RequestOptions::default(),
5841 }
5842 }
5843 }
5844
5845 #[derive(Clone, Debug)]
5862 pub struct Get(RequestBuilder<crate::model::SqlOperationsGetRequest>);
5863
5864 impl Get {
5865 pub(crate) fn new(
5866 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5867 ) -> Self {
5868 Self(RequestBuilder::new(stub))
5869 }
5870
5871 pub fn with_request<V: Into<crate::model::SqlOperationsGetRequest>>(
5873 mut self,
5874 v: V,
5875 ) -> Self {
5876 self.0.request = v.into();
5877 self
5878 }
5879
5880 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5882 self.0.options = v.into();
5883 self
5884 }
5885
5886 pub async fn send(self) -> Result<crate::model::Operation> {
5888 (*self.0.stub)
5889 .get(self.0.request, self.0.options)
5890 .await
5891 .map(crate::Response::into_body)
5892 }
5893
5894 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
5898 self.0.request.operation = v.into();
5899 self
5900 }
5901
5902 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5906 self.0.request.project = v.into();
5907 self
5908 }
5909 }
5910
5911 #[doc(hidden)]
5912 impl crate::RequestBuilder for Get {
5913 fn request_options(&mut self) -> &mut crate::RequestOptions {
5914 &mut self.0.options
5915 }
5916 }
5917
5918 #[derive(Clone, Debug)]
5939 pub struct List(RequestBuilder<crate::model::SqlOperationsListRequest>);
5940
5941 impl List {
5942 pub(crate) fn new(
5943 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5944 ) -> Self {
5945 Self(RequestBuilder::new(stub))
5946 }
5947
5948 pub fn with_request<V: Into<crate::model::SqlOperationsListRequest>>(
5950 mut self,
5951 v: V,
5952 ) -> Self {
5953 self.0.request = v.into();
5954 self
5955 }
5956
5957 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5959 self.0.options = v.into();
5960 self
5961 }
5962
5963 pub async fn send(self) -> Result<crate::model::OperationsListResponse> {
5965 (*self.0.stub)
5966 .list(self.0.request, self.0.options)
5967 .await
5968 .map(crate::Response::into_body)
5969 }
5970
5971 pub fn by_page(
5973 self,
5974 ) -> impl google_cloud_gax::paginator::Paginator<
5975 crate::model::OperationsListResponse,
5976 crate::Error,
5977 > {
5978 use std::clone::Clone;
5979 let token = self.0.request.page_token.clone();
5980 let execute = move |token: String| {
5981 let mut builder = self.clone();
5982 builder.0.request = builder.0.request.set_page_token(token);
5983 builder.send()
5984 };
5985 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5986 }
5987
5988 pub fn by_item(
5990 self,
5991 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5992 crate::model::OperationsListResponse,
5993 crate::Error,
5994 > {
5995 use google_cloud_gax::paginator::Paginator;
5996 self.by_page().items()
5997 }
5998
5999 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6001 self.0.request.instance = v.into();
6002 self
6003 }
6004
6005 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
6007 self.0.request.max_results = v.into();
6008 self
6009 }
6010
6011 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6013 self.0.request.page_token = v.into();
6014 self
6015 }
6016
6017 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6019 self.0.request.project = v.into();
6020 self
6021 }
6022 }
6023
6024 #[doc(hidden)]
6025 impl crate::RequestBuilder for List {
6026 fn request_options(&mut self) -> &mut crate::RequestOptions {
6027 &mut self.0.options
6028 }
6029 }
6030
6031 #[derive(Clone, Debug)]
6048 pub struct Cancel(RequestBuilder<crate::model::SqlOperationsCancelRequest>);
6049
6050 impl Cancel {
6051 pub(crate) fn new(
6052 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
6053 ) -> Self {
6054 Self(RequestBuilder::new(stub))
6055 }
6056
6057 pub fn with_request<V: Into<crate::model::SqlOperationsCancelRequest>>(
6059 mut self,
6060 v: V,
6061 ) -> Self {
6062 self.0.request = v.into();
6063 self
6064 }
6065
6066 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6068 self.0.options = v.into();
6069 self
6070 }
6071
6072 pub async fn send(self) -> Result<()> {
6074 (*self.0.stub)
6075 .cancel(self.0.request, self.0.options)
6076 .await
6077 .map(crate::Response::into_body)
6078 }
6079
6080 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
6082 self.0.request.operation = v.into();
6083 self
6084 }
6085
6086 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6088 self.0.request.project = v.into();
6089 self
6090 }
6091 }
6092
6093 #[doc(hidden)]
6094 impl crate::RequestBuilder for Cancel {
6095 fn request_options(&mut self) -> &mut crate::RequestOptions {
6096 &mut self.0.options
6097 }
6098 }
6099}
6100
6101pub mod sql_ssl_certs_service {
6103 use crate::Result;
6104
6105 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6119
6120 pub(crate) mod client {
6121 use super::super::super::client::SqlSslCertsService;
6122 pub struct Factory;
6123 impl crate::ClientFactory for Factory {
6124 type Client = SqlSslCertsService;
6125 type Credentials = gaxi::options::Credentials;
6126 async fn build(
6127 self,
6128 config: gaxi::options::ClientConfig,
6129 ) -> crate::ClientBuilderResult<Self::Client> {
6130 Self::Client::new(config).await
6131 }
6132 }
6133 }
6134
6135 #[derive(Clone, Debug)]
6137 pub(crate) struct RequestBuilder<R: std::default::Default> {
6138 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6139 request: R,
6140 options: crate::RequestOptions,
6141 }
6142
6143 impl<R> RequestBuilder<R>
6144 where
6145 R: std::default::Default,
6146 {
6147 pub(crate) fn new(
6148 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6149 ) -> Self {
6150 Self {
6151 stub,
6152 request: R::default(),
6153 options: crate::RequestOptions::default(),
6154 }
6155 }
6156 }
6157
6158 #[derive(Clone, Debug)]
6175 pub struct Delete(RequestBuilder<crate::model::SqlSslCertsDeleteRequest>);
6176
6177 impl Delete {
6178 pub(crate) fn new(
6179 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6180 ) -> Self {
6181 Self(RequestBuilder::new(stub))
6182 }
6183
6184 pub fn with_request<V: Into<crate::model::SqlSslCertsDeleteRequest>>(
6186 mut self,
6187 v: V,
6188 ) -> Self {
6189 self.0.request = v.into();
6190 self
6191 }
6192
6193 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6195 self.0.options = v.into();
6196 self
6197 }
6198
6199 pub async fn send(self) -> Result<crate::model::Operation> {
6201 (*self.0.stub)
6202 .delete(self.0.request, self.0.options)
6203 .await
6204 .map(crate::Response::into_body)
6205 }
6206
6207 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6209 self.0.request.instance = v.into();
6210 self
6211 }
6212
6213 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6215 self.0.request.project = v.into();
6216 self
6217 }
6218
6219 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6221 self.0.request.sha1_fingerprint = v.into();
6222 self
6223 }
6224 }
6225
6226 #[doc(hidden)]
6227 impl crate::RequestBuilder for Delete {
6228 fn request_options(&mut self) -> &mut crate::RequestOptions {
6229 &mut self.0.options
6230 }
6231 }
6232
6233 #[derive(Clone, Debug)]
6250 pub struct Get(RequestBuilder<crate::model::SqlSslCertsGetRequest>);
6251
6252 impl Get {
6253 pub(crate) fn new(
6254 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6255 ) -> Self {
6256 Self(RequestBuilder::new(stub))
6257 }
6258
6259 pub fn with_request<V: Into<crate::model::SqlSslCertsGetRequest>>(mut self, v: V) -> Self {
6261 self.0.request = v.into();
6262 self
6263 }
6264
6265 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6267 self.0.options = v.into();
6268 self
6269 }
6270
6271 pub async fn send(self) -> Result<crate::model::SslCert> {
6273 (*self.0.stub)
6274 .get(self.0.request, self.0.options)
6275 .await
6276 .map(crate::Response::into_body)
6277 }
6278
6279 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6281 self.0.request.instance = v.into();
6282 self
6283 }
6284
6285 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6287 self.0.request.project = v.into();
6288 self
6289 }
6290
6291 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6293 self.0.request.sha1_fingerprint = v.into();
6294 self
6295 }
6296 }
6297
6298 #[doc(hidden)]
6299 impl crate::RequestBuilder for Get {
6300 fn request_options(&mut self) -> &mut crate::RequestOptions {
6301 &mut self.0.options
6302 }
6303 }
6304
6305 #[derive(Clone, Debug)]
6322 pub struct Insert(RequestBuilder<crate::model::SqlSslCertsInsertRequest>);
6323
6324 impl Insert {
6325 pub(crate) fn new(
6326 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6327 ) -> Self {
6328 Self(RequestBuilder::new(stub))
6329 }
6330
6331 pub fn with_request<V: Into<crate::model::SqlSslCertsInsertRequest>>(
6333 mut self,
6334 v: V,
6335 ) -> Self {
6336 self.0.request = v.into();
6337 self
6338 }
6339
6340 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6342 self.0.options = v.into();
6343 self
6344 }
6345
6346 pub async fn send(self) -> Result<crate::model::SslCertsInsertResponse> {
6348 (*self.0.stub)
6349 .insert(self.0.request, self.0.options)
6350 .await
6351 .map(crate::Response::into_body)
6352 }
6353
6354 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6356 self.0.request.instance = v.into();
6357 self
6358 }
6359
6360 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6362 self.0.request.project = v.into();
6363 self
6364 }
6365
6366 pub fn set_body<T>(mut self, v: T) -> Self
6368 where
6369 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6370 {
6371 self.0.request.body = std::option::Option::Some(v.into());
6372 self
6373 }
6374
6375 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6377 where
6378 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6379 {
6380 self.0.request.body = v.map(|x| x.into());
6381 self
6382 }
6383 }
6384
6385 #[doc(hidden)]
6386 impl crate::RequestBuilder for Insert {
6387 fn request_options(&mut self) -> &mut crate::RequestOptions {
6388 &mut self.0.options
6389 }
6390 }
6391
6392 #[derive(Clone, Debug)]
6409 pub struct List(RequestBuilder<crate::model::SqlSslCertsListRequest>);
6410
6411 impl List {
6412 pub(crate) fn new(
6413 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6414 ) -> Self {
6415 Self(RequestBuilder::new(stub))
6416 }
6417
6418 pub fn with_request<V: Into<crate::model::SqlSslCertsListRequest>>(mut self, v: V) -> Self {
6420 self.0.request = v.into();
6421 self
6422 }
6423
6424 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6426 self.0.options = v.into();
6427 self
6428 }
6429
6430 pub async fn send(self) -> Result<crate::model::SslCertsListResponse> {
6432 (*self.0.stub)
6433 .list(self.0.request, self.0.options)
6434 .await
6435 .map(crate::Response::into_body)
6436 }
6437
6438 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6440 self.0.request.instance = v.into();
6441 self
6442 }
6443
6444 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6446 self.0.request.project = v.into();
6447 self
6448 }
6449 }
6450
6451 #[doc(hidden)]
6452 impl crate::RequestBuilder for List {
6453 fn request_options(&mut self) -> &mut crate::RequestOptions {
6454 &mut self.0.options
6455 }
6456 }
6457}
6458
6459pub mod sql_tiers_service {
6461 use crate::Result;
6462
6463 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6477
6478 pub(crate) mod client {
6479 use super::super::super::client::SqlTiersService;
6480 pub struct Factory;
6481 impl crate::ClientFactory for Factory {
6482 type Client = SqlTiersService;
6483 type Credentials = gaxi::options::Credentials;
6484 async fn build(
6485 self,
6486 config: gaxi::options::ClientConfig,
6487 ) -> crate::ClientBuilderResult<Self::Client> {
6488 Self::Client::new(config).await
6489 }
6490 }
6491 }
6492
6493 #[derive(Clone, Debug)]
6495 pub(crate) struct RequestBuilder<R: std::default::Default> {
6496 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6497 request: R,
6498 options: crate::RequestOptions,
6499 }
6500
6501 impl<R> RequestBuilder<R>
6502 where
6503 R: std::default::Default,
6504 {
6505 pub(crate) fn new(
6506 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6507 ) -> Self {
6508 Self {
6509 stub,
6510 request: R::default(),
6511 options: crate::RequestOptions::default(),
6512 }
6513 }
6514 }
6515
6516 #[derive(Clone, Debug)]
6533 pub struct List(RequestBuilder<crate::model::SqlTiersListRequest>);
6534
6535 impl List {
6536 pub(crate) fn new(
6537 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6538 ) -> Self {
6539 Self(RequestBuilder::new(stub))
6540 }
6541
6542 pub fn with_request<V: Into<crate::model::SqlTiersListRequest>>(mut self, v: V) -> Self {
6544 self.0.request = v.into();
6545 self
6546 }
6547
6548 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6550 self.0.options = v.into();
6551 self
6552 }
6553
6554 pub async fn send(self) -> Result<crate::model::TiersListResponse> {
6556 (*self.0.stub)
6557 .list(self.0.request, self.0.options)
6558 .await
6559 .map(crate::Response::into_body)
6560 }
6561
6562 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6564 self.0.request.project = v.into();
6565 self
6566 }
6567 }
6568
6569 #[doc(hidden)]
6570 impl crate::RequestBuilder for List {
6571 fn request_options(&mut self) -> &mut crate::RequestOptions {
6572 &mut self.0.options
6573 }
6574 }
6575}
6576
6577pub mod sql_users_service {
6579 use crate::Result;
6580
6581 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6595
6596 pub(crate) mod client {
6597 use super::super::super::client::SqlUsersService;
6598 pub struct Factory;
6599 impl crate::ClientFactory for Factory {
6600 type Client = SqlUsersService;
6601 type Credentials = gaxi::options::Credentials;
6602 async fn build(
6603 self,
6604 config: gaxi::options::ClientConfig,
6605 ) -> crate::ClientBuilderResult<Self::Client> {
6606 Self::Client::new(config).await
6607 }
6608 }
6609 }
6610
6611 #[derive(Clone, Debug)]
6613 pub(crate) struct RequestBuilder<R: std::default::Default> {
6614 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6615 request: R,
6616 options: crate::RequestOptions,
6617 }
6618
6619 impl<R> RequestBuilder<R>
6620 where
6621 R: std::default::Default,
6622 {
6623 pub(crate) fn new(
6624 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6625 ) -> Self {
6626 Self {
6627 stub,
6628 request: R::default(),
6629 options: crate::RequestOptions::default(),
6630 }
6631 }
6632 }
6633
6634 #[derive(Clone, Debug)]
6651 pub struct Delete(RequestBuilder<crate::model::SqlUsersDeleteRequest>);
6652
6653 impl Delete {
6654 pub(crate) fn new(
6655 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6656 ) -> Self {
6657 Self(RequestBuilder::new(stub))
6658 }
6659
6660 pub fn with_request<V: Into<crate::model::SqlUsersDeleteRequest>>(mut self, v: V) -> Self {
6662 self.0.request = v.into();
6663 self
6664 }
6665
6666 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6668 self.0.options = v.into();
6669 self
6670 }
6671
6672 pub async fn send(self) -> Result<crate::model::Operation> {
6674 (*self.0.stub)
6675 .delete(self.0.request, self.0.options)
6676 .await
6677 .map(crate::Response::into_body)
6678 }
6679
6680 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6682 self.0.request.host = v.into();
6683 self
6684 }
6685
6686 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6688 self.0.request.instance = v.into();
6689 self
6690 }
6691
6692 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6694 self.0.request.name = v.into();
6695 self
6696 }
6697
6698 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6700 self.0.request.project = v.into();
6701 self
6702 }
6703 }
6704
6705 #[doc(hidden)]
6706 impl crate::RequestBuilder for Delete {
6707 fn request_options(&mut self) -> &mut crate::RequestOptions {
6708 &mut self.0.options
6709 }
6710 }
6711
6712 #[derive(Clone, Debug)]
6729 pub struct Get(RequestBuilder<crate::model::SqlUsersGetRequest>);
6730
6731 impl Get {
6732 pub(crate) fn new(
6733 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6734 ) -> Self {
6735 Self(RequestBuilder::new(stub))
6736 }
6737
6738 pub fn with_request<V: Into<crate::model::SqlUsersGetRequest>>(mut self, v: V) -> Self {
6740 self.0.request = v.into();
6741 self
6742 }
6743
6744 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6746 self.0.options = v.into();
6747 self
6748 }
6749
6750 pub async fn send(self) -> Result<crate::model::User> {
6752 (*self.0.stub)
6753 .get(self.0.request, self.0.options)
6754 .await
6755 .map(crate::Response::into_body)
6756 }
6757
6758 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6760 self.0.request.instance = v.into();
6761 self
6762 }
6763
6764 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6766 self.0.request.name = v.into();
6767 self
6768 }
6769
6770 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6772 self.0.request.project = v.into();
6773 self
6774 }
6775
6776 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6778 self.0.request.host = v.into();
6779 self
6780 }
6781 }
6782
6783 #[doc(hidden)]
6784 impl crate::RequestBuilder for Get {
6785 fn request_options(&mut self) -> &mut crate::RequestOptions {
6786 &mut self.0.options
6787 }
6788 }
6789
6790 #[derive(Clone, Debug)]
6807 pub struct Insert(RequestBuilder<crate::model::SqlUsersInsertRequest>);
6808
6809 impl Insert {
6810 pub(crate) fn new(
6811 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6812 ) -> Self {
6813 Self(RequestBuilder::new(stub))
6814 }
6815
6816 pub fn with_request<V: Into<crate::model::SqlUsersInsertRequest>>(mut self, v: V) -> Self {
6818 self.0.request = v.into();
6819 self
6820 }
6821
6822 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6824 self.0.options = v.into();
6825 self
6826 }
6827
6828 pub async fn send(self) -> Result<crate::model::Operation> {
6830 (*self.0.stub)
6831 .insert(self.0.request, self.0.options)
6832 .await
6833 .map(crate::Response::into_body)
6834 }
6835
6836 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6838 self.0.request.instance = v.into();
6839 self
6840 }
6841
6842 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6844 self.0.request.project = v.into();
6845 self
6846 }
6847
6848 pub fn set_body<T>(mut self, v: T) -> Self
6850 where
6851 T: std::convert::Into<crate::model::User>,
6852 {
6853 self.0.request.body = std::option::Option::Some(v.into());
6854 self
6855 }
6856
6857 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6859 where
6860 T: std::convert::Into<crate::model::User>,
6861 {
6862 self.0.request.body = v.map(|x| x.into());
6863 self
6864 }
6865 }
6866
6867 #[doc(hidden)]
6868 impl crate::RequestBuilder for Insert {
6869 fn request_options(&mut self) -> &mut crate::RequestOptions {
6870 &mut self.0.options
6871 }
6872 }
6873
6874 #[derive(Clone, Debug)]
6891 pub struct List(RequestBuilder<crate::model::SqlUsersListRequest>);
6892
6893 impl List {
6894 pub(crate) fn new(
6895 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6896 ) -> Self {
6897 Self(RequestBuilder::new(stub))
6898 }
6899
6900 pub fn with_request<V: Into<crate::model::SqlUsersListRequest>>(mut self, v: V) -> Self {
6902 self.0.request = v.into();
6903 self
6904 }
6905
6906 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6908 self.0.options = v.into();
6909 self
6910 }
6911
6912 pub async fn send(self) -> Result<crate::model::UsersListResponse> {
6914 (*self.0.stub)
6915 .list(self.0.request, self.0.options)
6916 .await
6917 .map(crate::Response::into_body)
6918 }
6919
6920 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6922 self.0.request.instance = v.into();
6923 self
6924 }
6925
6926 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6928 self.0.request.project = v.into();
6929 self
6930 }
6931 }
6932
6933 #[doc(hidden)]
6934 impl crate::RequestBuilder for List {
6935 fn request_options(&mut self) -> &mut crate::RequestOptions {
6936 &mut self.0.options
6937 }
6938 }
6939
6940 #[derive(Clone, Debug)]
6957 pub struct Update(RequestBuilder<crate::model::SqlUsersUpdateRequest>);
6958
6959 impl Update {
6960 pub(crate) fn new(
6961 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6962 ) -> Self {
6963 Self(RequestBuilder::new(stub))
6964 }
6965
6966 pub fn with_request<V: Into<crate::model::SqlUsersUpdateRequest>>(mut self, v: V) -> Self {
6968 self.0.request = v.into();
6969 self
6970 }
6971
6972 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6974 self.0.options = v.into();
6975 self
6976 }
6977
6978 pub async fn send(self) -> Result<crate::model::Operation> {
6980 (*self.0.stub)
6981 .update(self.0.request, self.0.options)
6982 .await
6983 .map(crate::Response::into_body)
6984 }
6985
6986 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6988 self.0.request.host = v.into();
6989 self
6990 }
6991
6992 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6994 self.0.request.instance = v.into();
6995 self
6996 }
6997
6998 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7000 self.0.request.name = v.into();
7001 self
7002 }
7003
7004 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7006 self.0.request.project = v.into();
7007 self
7008 }
7009
7010 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
7012 where
7013 T: std::iter::IntoIterator<Item = V>,
7014 V: std::convert::Into<std::string::String>,
7015 {
7016 use std::iter::Iterator;
7017 self.0.request.database_roles = v.into_iter().map(|i| i.into()).collect();
7018 self
7019 }
7020
7021 pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
7023 where
7024 T: std::convert::Into<bool>,
7025 {
7026 self.0.request.revoke_existing_roles = std::option::Option::Some(v.into());
7027 self
7028 }
7029
7030 pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
7032 where
7033 T: std::convert::Into<bool>,
7034 {
7035 self.0.request.revoke_existing_roles = v.map(|x| x.into());
7036 self
7037 }
7038
7039 pub fn set_body<T>(mut self, v: T) -> Self
7041 where
7042 T: std::convert::Into<crate::model::User>,
7043 {
7044 self.0.request.body = std::option::Option::Some(v.into());
7045 self
7046 }
7047
7048 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7050 where
7051 T: std::convert::Into<crate::model::User>,
7052 {
7053 self.0.request.body = v.map(|x| x.into());
7054 self
7055 }
7056 }
7057
7058 #[doc(hidden)]
7059 impl crate::RequestBuilder for Update {
7060 fn request_options(&mut self) -> &mut crate::RequestOptions {
7061 &mut self.0.options
7062 }
7063 }
7064}