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 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5912 self.0.request.location = v.into();
5913 self
5914 }
5915 }
5916
5917 #[doc(hidden)]
5918 impl crate::RequestBuilder for Get {
5919 fn request_options(&mut self) -> &mut crate::RequestOptions {
5920 &mut self.0.options
5921 }
5922 }
5923
5924 #[derive(Clone, Debug)]
5945 pub struct List(RequestBuilder<crate::model::SqlOperationsListRequest>);
5946
5947 impl List {
5948 pub(crate) fn new(
5949 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5950 ) -> Self {
5951 Self(RequestBuilder::new(stub))
5952 }
5953
5954 pub fn with_request<V: Into<crate::model::SqlOperationsListRequest>>(
5956 mut self,
5957 v: V,
5958 ) -> Self {
5959 self.0.request = v.into();
5960 self
5961 }
5962
5963 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5965 self.0.options = v.into();
5966 self
5967 }
5968
5969 pub async fn send(self) -> Result<crate::model::OperationsListResponse> {
5971 (*self.0.stub)
5972 .list(self.0.request, self.0.options)
5973 .await
5974 .map(crate::Response::into_body)
5975 }
5976
5977 pub fn by_page(
5979 self,
5980 ) -> impl google_cloud_gax::paginator::Paginator<
5981 crate::model::OperationsListResponse,
5982 crate::Error,
5983 > {
5984 use std::clone::Clone;
5985 let token = self.0.request.page_token.clone();
5986 let execute = move |token: String| {
5987 let mut builder = self.clone();
5988 builder.0.request = builder.0.request.set_page_token(token);
5989 builder.send()
5990 };
5991 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5992 }
5993
5994 pub fn by_item(
5996 self,
5997 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5998 crate::model::OperationsListResponse,
5999 crate::Error,
6000 > {
6001 use google_cloud_gax::paginator::Paginator;
6002 self.by_page().items()
6003 }
6004
6005 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6007 self.0.request.instance = v.into();
6008 self
6009 }
6010
6011 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
6013 self.0.request.max_results = v.into();
6014 self
6015 }
6016
6017 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6019 self.0.request.page_token = v.into();
6020 self
6021 }
6022
6023 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6025 self.0.request.project = v.into();
6026 self
6027 }
6028
6029 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6031 self.0.request.location = v.into();
6032 self
6033 }
6034 }
6035
6036 #[doc(hidden)]
6037 impl crate::RequestBuilder for List {
6038 fn request_options(&mut self) -> &mut crate::RequestOptions {
6039 &mut self.0.options
6040 }
6041 }
6042
6043 #[derive(Clone, Debug)]
6060 pub struct Cancel(RequestBuilder<crate::model::SqlOperationsCancelRequest>);
6061
6062 impl Cancel {
6063 pub(crate) fn new(
6064 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
6065 ) -> Self {
6066 Self(RequestBuilder::new(stub))
6067 }
6068
6069 pub fn with_request<V: Into<crate::model::SqlOperationsCancelRequest>>(
6071 mut self,
6072 v: V,
6073 ) -> Self {
6074 self.0.request = v.into();
6075 self
6076 }
6077
6078 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6080 self.0.options = v.into();
6081 self
6082 }
6083
6084 pub async fn send(self) -> Result<()> {
6086 (*self.0.stub)
6087 .cancel(self.0.request, self.0.options)
6088 .await
6089 .map(crate::Response::into_body)
6090 }
6091
6092 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
6094 self.0.request.operation = v.into();
6095 self
6096 }
6097
6098 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6100 self.0.request.project = v.into();
6101 self
6102 }
6103
6104 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6106 self.0.request.location = v.into();
6107 self
6108 }
6109 }
6110
6111 #[doc(hidden)]
6112 impl crate::RequestBuilder for Cancel {
6113 fn request_options(&mut self) -> &mut crate::RequestOptions {
6114 &mut self.0.options
6115 }
6116 }
6117}
6118
6119pub mod sql_ssl_certs_service {
6121 use crate::Result;
6122
6123 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6137
6138 pub(crate) mod client {
6139 use super::super::super::client::SqlSslCertsService;
6140 pub struct Factory;
6141 impl crate::ClientFactory for Factory {
6142 type Client = SqlSslCertsService;
6143 type Credentials = gaxi::options::Credentials;
6144 async fn build(
6145 self,
6146 config: gaxi::options::ClientConfig,
6147 ) -> crate::ClientBuilderResult<Self::Client> {
6148 Self::Client::new(config).await
6149 }
6150 }
6151 }
6152
6153 #[derive(Clone, Debug)]
6155 pub(crate) struct RequestBuilder<R: std::default::Default> {
6156 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6157 request: R,
6158 options: crate::RequestOptions,
6159 }
6160
6161 impl<R> RequestBuilder<R>
6162 where
6163 R: std::default::Default,
6164 {
6165 pub(crate) fn new(
6166 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6167 ) -> Self {
6168 Self {
6169 stub,
6170 request: R::default(),
6171 options: crate::RequestOptions::default(),
6172 }
6173 }
6174 }
6175
6176 #[derive(Clone, Debug)]
6193 pub struct Delete(RequestBuilder<crate::model::SqlSslCertsDeleteRequest>);
6194
6195 impl Delete {
6196 pub(crate) fn new(
6197 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6198 ) -> Self {
6199 Self(RequestBuilder::new(stub))
6200 }
6201
6202 pub fn with_request<V: Into<crate::model::SqlSslCertsDeleteRequest>>(
6204 mut self,
6205 v: V,
6206 ) -> Self {
6207 self.0.request = v.into();
6208 self
6209 }
6210
6211 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6213 self.0.options = v.into();
6214 self
6215 }
6216
6217 pub async fn send(self) -> Result<crate::model::Operation> {
6219 (*self.0.stub)
6220 .delete(self.0.request, self.0.options)
6221 .await
6222 .map(crate::Response::into_body)
6223 }
6224
6225 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6227 self.0.request.instance = v.into();
6228 self
6229 }
6230
6231 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6233 self.0.request.project = v.into();
6234 self
6235 }
6236
6237 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6239 self.0.request.sha1_fingerprint = v.into();
6240 self
6241 }
6242 }
6243
6244 #[doc(hidden)]
6245 impl crate::RequestBuilder for Delete {
6246 fn request_options(&mut self) -> &mut crate::RequestOptions {
6247 &mut self.0.options
6248 }
6249 }
6250
6251 #[derive(Clone, Debug)]
6268 pub struct Get(RequestBuilder<crate::model::SqlSslCertsGetRequest>);
6269
6270 impl Get {
6271 pub(crate) fn new(
6272 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6273 ) -> Self {
6274 Self(RequestBuilder::new(stub))
6275 }
6276
6277 pub fn with_request<V: Into<crate::model::SqlSslCertsGetRequest>>(mut self, v: V) -> Self {
6279 self.0.request = v.into();
6280 self
6281 }
6282
6283 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6285 self.0.options = v.into();
6286 self
6287 }
6288
6289 pub async fn send(self) -> Result<crate::model::SslCert> {
6291 (*self.0.stub)
6292 .get(self.0.request, self.0.options)
6293 .await
6294 .map(crate::Response::into_body)
6295 }
6296
6297 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6299 self.0.request.instance = v.into();
6300 self
6301 }
6302
6303 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6305 self.0.request.project = v.into();
6306 self
6307 }
6308
6309 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6311 self.0.request.sha1_fingerprint = v.into();
6312 self
6313 }
6314 }
6315
6316 #[doc(hidden)]
6317 impl crate::RequestBuilder for Get {
6318 fn request_options(&mut self) -> &mut crate::RequestOptions {
6319 &mut self.0.options
6320 }
6321 }
6322
6323 #[derive(Clone, Debug)]
6340 pub struct Insert(RequestBuilder<crate::model::SqlSslCertsInsertRequest>);
6341
6342 impl Insert {
6343 pub(crate) fn new(
6344 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6345 ) -> Self {
6346 Self(RequestBuilder::new(stub))
6347 }
6348
6349 pub fn with_request<V: Into<crate::model::SqlSslCertsInsertRequest>>(
6351 mut self,
6352 v: V,
6353 ) -> Self {
6354 self.0.request = v.into();
6355 self
6356 }
6357
6358 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6360 self.0.options = v.into();
6361 self
6362 }
6363
6364 pub async fn send(self) -> Result<crate::model::SslCertsInsertResponse> {
6366 (*self.0.stub)
6367 .insert(self.0.request, self.0.options)
6368 .await
6369 .map(crate::Response::into_body)
6370 }
6371
6372 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6374 self.0.request.instance = v.into();
6375 self
6376 }
6377
6378 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6380 self.0.request.project = v.into();
6381 self
6382 }
6383
6384 pub fn set_body<T>(mut self, v: T) -> Self
6386 where
6387 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6388 {
6389 self.0.request.body = std::option::Option::Some(v.into());
6390 self
6391 }
6392
6393 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6395 where
6396 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6397 {
6398 self.0.request.body = v.map(|x| x.into());
6399 self
6400 }
6401 }
6402
6403 #[doc(hidden)]
6404 impl crate::RequestBuilder for Insert {
6405 fn request_options(&mut self) -> &mut crate::RequestOptions {
6406 &mut self.0.options
6407 }
6408 }
6409
6410 #[derive(Clone, Debug)]
6427 pub struct List(RequestBuilder<crate::model::SqlSslCertsListRequest>);
6428
6429 impl List {
6430 pub(crate) fn new(
6431 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6432 ) -> Self {
6433 Self(RequestBuilder::new(stub))
6434 }
6435
6436 pub fn with_request<V: Into<crate::model::SqlSslCertsListRequest>>(mut self, v: V) -> Self {
6438 self.0.request = v.into();
6439 self
6440 }
6441
6442 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6444 self.0.options = v.into();
6445 self
6446 }
6447
6448 pub async fn send(self) -> Result<crate::model::SslCertsListResponse> {
6450 (*self.0.stub)
6451 .list(self.0.request, self.0.options)
6452 .await
6453 .map(crate::Response::into_body)
6454 }
6455
6456 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6458 self.0.request.instance = v.into();
6459 self
6460 }
6461
6462 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6464 self.0.request.project = v.into();
6465 self
6466 }
6467 }
6468
6469 #[doc(hidden)]
6470 impl crate::RequestBuilder for List {
6471 fn request_options(&mut self) -> &mut crate::RequestOptions {
6472 &mut self.0.options
6473 }
6474 }
6475}
6476
6477pub mod sql_tiers_service {
6479 use crate::Result;
6480
6481 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6495
6496 pub(crate) mod client {
6497 use super::super::super::client::SqlTiersService;
6498 pub struct Factory;
6499 impl crate::ClientFactory for Factory {
6500 type Client = SqlTiersService;
6501 type Credentials = gaxi::options::Credentials;
6502 async fn build(
6503 self,
6504 config: gaxi::options::ClientConfig,
6505 ) -> crate::ClientBuilderResult<Self::Client> {
6506 Self::Client::new(config).await
6507 }
6508 }
6509 }
6510
6511 #[derive(Clone, Debug)]
6513 pub(crate) struct RequestBuilder<R: std::default::Default> {
6514 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6515 request: R,
6516 options: crate::RequestOptions,
6517 }
6518
6519 impl<R> RequestBuilder<R>
6520 where
6521 R: std::default::Default,
6522 {
6523 pub(crate) fn new(
6524 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6525 ) -> Self {
6526 Self {
6527 stub,
6528 request: R::default(),
6529 options: crate::RequestOptions::default(),
6530 }
6531 }
6532 }
6533
6534 #[derive(Clone, Debug)]
6551 pub struct List(RequestBuilder<crate::model::SqlTiersListRequest>);
6552
6553 impl List {
6554 pub(crate) fn new(
6555 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6556 ) -> Self {
6557 Self(RequestBuilder::new(stub))
6558 }
6559
6560 pub fn with_request<V: Into<crate::model::SqlTiersListRequest>>(mut self, v: V) -> Self {
6562 self.0.request = v.into();
6563 self
6564 }
6565
6566 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6568 self.0.options = v.into();
6569 self
6570 }
6571
6572 pub async fn send(self) -> Result<crate::model::TiersListResponse> {
6574 (*self.0.stub)
6575 .list(self.0.request, self.0.options)
6576 .await
6577 .map(crate::Response::into_body)
6578 }
6579
6580 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6582 self.0.request.project = v.into();
6583 self
6584 }
6585 }
6586
6587 #[doc(hidden)]
6588 impl crate::RequestBuilder for List {
6589 fn request_options(&mut self) -> &mut crate::RequestOptions {
6590 &mut self.0.options
6591 }
6592 }
6593}
6594
6595pub mod sql_users_service {
6597 use crate::Result;
6598
6599 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6613
6614 pub(crate) mod client {
6615 use super::super::super::client::SqlUsersService;
6616 pub struct Factory;
6617 impl crate::ClientFactory for Factory {
6618 type Client = SqlUsersService;
6619 type Credentials = gaxi::options::Credentials;
6620 async fn build(
6621 self,
6622 config: gaxi::options::ClientConfig,
6623 ) -> crate::ClientBuilderResult<Self::Client> {
6624 Self::Client::new(config).await
6625 }
6626 }
6627 }
6628
6629 #[derive(Clone, Debug)]
6631 pub(crate) struct RequestBuilder<R: std::default::Default> {
6632 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6633 request: R,
6634 options: crate::RequestOptions,
6635 }
6636
6637 impl<R> RequestBuilder<R>
6638 where
6639 R: std::default::Default,
6640 {
6641 pub(crate) fn new(
6642 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6643 ) -> Self {
6644 Self {
6645 stub,
6646 request: R::default(),
6647 options: crate::RequestOptions::default(),
6648 }
6649 }
6650 }
6651
6652 #[derive(Clone, Debug)]
6669 pub struct Delete(RequestBuilder<crate::model::SqlUsersDeleteRequest>);
6670
6671 impl Delete {
6672 pub(crate) fn new(
6673 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6674 ) -> Self {
6675 Self(RequestBuilder::new(stub))
6676 }
6677
6678 pub fn with_request<V: Into<crate::model::SqlUsersDeleteRequest>>(mut self, v: V) -> Self {
6680 self.0.request = v.into();
6681 self
6682 }
6683
6684 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6686 self.0.options = v.into();
6687 self
6688 }
6689
6690 pub async fn send(self) -> Result<crate::model::Operation> {
6692 (*self.0.stub)
6693 .delete(self.0.request, self.0.options)
6694 .await
6695 .map(crate::Response::into_body)
6696 }
6697
6698 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6700 self.0.request.host = v.into();
6701 self
6702 }
6703
6704 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6706 self.0.request.instance = v.into();
6707 self
6708 }
6709
6710 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6712 self.0.request.name = v.into();
6713 self
6714 }
6715
6716 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6718 self.0.request.project = v.into();
6719 self
6720 }
6721 }
6722
6723 #[doc(hidden)]
6724 impl crate::RequestBuilder for Delete {
6725 fn request_options(&mut self) -> &mut crate::RequestOptions {
6726 &mut self.0.options
6727 }
6728 }
6729
6730 #[derive(Clone, Debug)]
6747 pub struct Get(RequestBuilder<crate::model::SqlUsersGetRequest>);
6748
6749 impl Get {
6750 pub(crate) fn new(
6751 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6752 ) -> Self {
6753 Self(RequestBuilder::new(stub))
6754 }
6755
6756 pub fn with_request<V: Into<crate::model::SqlUsersGetRequest>>(mut self, v: V) -> Self {
6758 self.0.request = v.into();
6759 self
6760 }
6761
6762 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6764 self.0.options = v.into();
6765 self
6766 }
6767
6768 pub async fn send(self) -> Result<crate::model::User> {
6770 (*self.0.stub)
6771 .get(self.0.request, self.0.options)
6772 .await
6773 .map(crate::Response::into_body)
6774 }
6775
6776 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6778 self.0.request.instance = v.into();
6779 self
6780 }
6781
6782 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6784 self.0.request.name = v.into();
6785 self
6786 }
6787
6788 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6790 self.0.request.project = v.into();
6791 self
6792 }
6793
6794 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6796 self.0.request.host = v.into();
6797 self
6798 }
6799 }
6800
6801 #[doc(hidden)]
6802 impl crate::RequestBuilder for Get {
6803 fn request_options(&mut self) -> &mut crate::RequestOptions {
6804 &mut self.0.options
6805 }
6806 }
6807
6808 #[derive(Clone, Debug)]
6825 pub struct Insert(RequestBuilder<crate::model::SqlUsersInsertRequest>);
6826
6827 impl Insert {
6828 pub(crate) fn new(
6829 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6830 ) -> Self {
6831 Self(RequestBuilder::new(stub))
6832 }
6833
6834 pub fn with_request<V: Into<crate::model::SqlUsersInsertRequest>>(mut self, v: V) -> Self {
6836 self.0.request = v.into();
6837 self
6838 }
6839
6840 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6842 self.0.options = v.into();
6843 self
6844 }
6845
6846 pub async fn send(self) -> Result<crate::model::Operation> {
6848 (*self.0.stub)
6849 .insert(self.0.request, self.0.options)
6850 .await
6851 .map(crate::Response::into_body)
6852 }
6853
6854 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6856 self.0.request.instance = v.into();
6857 self
6858 }
6859
6860 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6862 self.0.request.project = v.into();
6863 self
6864 }
6865
6866 pub fn set_body<T>(mut self, v: T) -> Self
6868 where
6869 T: std::convert::Into<crate::model::User>,
6870 {
6871 self.0.request.body = std::option::Option::Some(v.into());
6872 self
6873 }
6874
6875 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6877 where
6878 T: std::convert::Into<crate::model::User>,
6879 {
6880 self.0.request.body = v.map(|x| x.into());
6881 self
6882 }
6883 }
6884
6885 #[doc(hidden)]
6886 impl crate::RequestBuilder for Insert {
6887 fn request_options(&mut self) -> &mut crate::RequestOptions {
6888 &mut self.0.options
6889 }
6890 }
6891
6892 #[derive(Clone, Debug)]
6909 pub struct List(RequestBuilder<crate::model::SqlUsersListRequest>);
6910
6911 impl List {
6912 pub(crate) fn new(
6913 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6914 ) -> Self {
6915 Self(RequestBuilder::new(stub))
6916 }
6917
6918 pub fn with_request<V: Into<crate::model::SqlUsersListRequest>>(mut self, v: V) -> Self {
6920 self.0.request = v.into();
6921 self
6922 }
6923
6924 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6926 self.0.options = v.into();
6927 self
6928 }
6929
6930 pub async fn send(self) -> Result<crate::model::UsersListResponse> {
6932 (*self.0.stub)
6933 .list(self.0.request, self.0.options)
6934 .await
6935 .map(crate::Response::into_body)
6936 }
6937
6938 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6940 self.0.request.instance = v.into();
6941 self
6942 }
6943
6944 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6946 self.0.request.project = v.into();
6947 self
6948 }
6949 }
6950
6951 #[doc(hidden)]
6952 impl crate::RequestBuilder for List {
6953 fn request_options(&mut self) -> &mut crate::RequestOptions {
6954 &mut self.0.options
6955 }
6956 }
6957
6958 #[derive(Clone, Debug)]
6975 pub struct Update(RequestBuilder<crate::model::SqlUsersUpdateRequest>);
6976
6977 impl Update {
6978 pub(crate) fn new(
6979 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6980 ) -> Self {
6981 Self(RequestBuilder::new(stub))
6982 }
6983
6984 pub fn with_request<V: Into<crate::model::SqlUsersUpdateRequest>>(mut self, v: V) -> Self {
6986 self.0.request = v.into();
6987 self
6988 }
6989
6990 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6992 self.0.options = v.into();
6993 self
6994 }
6995
6996 pub async fn send(self) -> Result<crate::model::Operation> {
6998 (*self.0.stub)
6999 .update(self.0.request, self.0.options)
7000 .await
7001 .map(crate::Response::into_body)
7002 }
7003
7004 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
7006 self.0.request.host = v.into();
7007 self
7008 }
7009
7010 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7012 self.0.request.instance = v.into();
7013 self
7014 }
7015
7016 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7018 self.0.request.name = v.into();
7019 self
7020 }
7021
7022 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7024 self.0.request.project = v.into();
7025 self
7026 }
7027
7028 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
7030 where
7031 T: std::iter::IntoIterator<Item = V>,
7032 V: std::convert::Into<std::string::String>,
7033 {
7034 use std::iter::Iterator;
7035 self.0.request.database_roles = v.into_iter().map(|i| i.into()).collect();
7036 self
7037 }
7038
7039 pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
7041 where
7042 T: std::convert::Into<bool>,
7043 {
7044 self.0.request.revoke_existing_roles = std::option::Option::Some(v.into());
7045 self
7046 }
7047
7048 pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
7050 where
7051 T: std::convert::Into<bool>,
7052 {
7053 self.0.request.revoke_existing_roles = v.map(|x| x.into());
7054 self
7055 }
7056
7057 pub fn set_server_roles<T, V>(mut self, v: T) -> Self
7059 where
7060 T: std::iter::IntoIterator<Item = V>,
7061 V: std::convert::Into<std::string::String>,
7062 {
7063 use std::iter::Iterator;
7064 self.0.request.server_roles = v.into_iter().map(|i| i.into()).collect();
7065 self
7066 }
7067
7068 pub fn set_revoke_existing_server_roles<T>(mut self, v: T) -> Self
7070 where
7071 T: std::convert::Into<bool>,
7072 {
7073 self.0.request.revoke_existing_server_roles = std::option::Option::Some(v.into());
7074 self
7075 }
7076
7077 pub fn set_or_clear_revoke_existing_server_roles<T>(
7079 mut self,
7080 v: std::option::Option<T>,
7081 ) -> Self
7082 where
7083 T: std::convert::Into<bool>,
7084 {
7085 self.0.request.revoke_existing_server_roles = v.map(|x| x.into());
7086 self
7087 }
7088
7089 pub fn set_body<T>(mut self, v: T) -> Self
7091 where
7092 T: std::convert::Into<crate::model::User>,
7093 {
7094 self.0.request.body = std::option::Option::Some(v.into());
7095 self
7096 }
7097
7098 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7100 where
7101 T: std::convert::Into<crate::model::User>,
7102 {
7103 self.0.request.body = v.map(|x| x.into());
7104 self
7105 }
7106 }
7107
7108 #[doc(hidden)]
7109 impl crate::RequestBuilder for Update {
7110 fn request_options(&mut self) -> &mut crate::RequestOptions {
7111 &mut self.0.options
7112 }
7113 }
7114}