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 GenerateEphemeralCert(RequestBuilder<crate::model::GenerateEphemeralCertRequest>);
1057
1058 impl GenerateEphemeralCert {
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::GenerateEphemeralCertRequest>>(
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::GenerateEphemeralCertResponse> {
1082 (*self.0.stub)
1083 .generate_ephemeral_cert(self.0.request, self.0.options)
1084 .await
1085 .map(crate::Response::into_body)
1086 }
1087
1088 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1090 self.0.request.instance = v.into();
1091 self
1092 }
1093
1094 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1096 self.0.request.project = v.into();
1097 self
1098 }
1099
1100 pub fn set_public_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1102 self.0.request.public_key = v.into();
1103 self
1104 }
1105
1106 pub fn set_access_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1108 self.0.request.access_token = v.into();
1109 self
1110 }
1111
1112 pub fn set_read_time<T>(mut self, v: T) -> Self
1114 where
1115 T: std::convert::Into<wkt::Timestamp>,
1116 {
1117 self.0.request.read_time = std::option::Option::Some(v.into());
1118 self
1119 }
1120
1121 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1123 where
1124 T: std::convert::Into<wkt::Timestamp>,
1125 {
1126 self.0.request.read_time = v.map(|x| x.into());
1127 self
1128 }
1129
1130 pub fn set_valid_duration<T>(mut self, v: T) -> Self
1132 where
1133 T: std::convert::Into<wkt::Duration>,
1134 {
1135 self.0.request.valid_duration = std::option::Option::Some(v.into());
1136 self
1137 }
1138
1139 pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
1141 where
1142 T: std::convert::Into<wkt::Duration>,
1143 {
1144 self.0.request.valid_duration = v.map(|x| x.into());
1145 self
1146 }
1147 }
1148
1149 #[doc(hidden)]
1150 impl crate::RequestBuilder for GenerateEphemeralCert {
1151 fn request_options(&mut self) -> &mut crate::RequestOptions {
1152 &mut self.0.options
1153 }
1154 }
1155}
1156
1157pub mod sql_databases_service {
1159 use crate::Result;
1160
1161 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1175
1176 pub(crate) mod client {
1177 use super::super::super::client::SqlDatabasesService;
1178 pub struct Factory;
1179 impl crate::ClientFactory for Factory {
1180 type Client = SqlDatabasesService;
1181 type Credentials = gaxi::options::Credentials;
1182 async fn build(
1183 self,
1184 config: gaxi::options::ClientConfig,
1185 ) -> crate::ClientBuilderResult<Self::Client> {
1186 Self::Client::new(config).await
1187 }
1188 }
1189 }
1190
1191 #[derive(Clone, Debug)]
1193 pub(crate) struct RequestBuilder<R: std::default::Default> {
1194 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1195 request: R,
1196 options: crate::RequestOptions,
1197 }
1198
1199 impl<R> RequestBuilder<R>
1200 where
1201 R: std::default::Default,
1202 {
1203 pub(crate) fn new(
1204 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1205 ) -> Self {
1206 Self {
1207 stub,
1208 request: R::default(),
1209 options: crate::RequestOptions::default(),
1210 }
1211 }
1212 }
1213
1214 #[derive(Clone, Debug)]
1231 pub struct Delete(RequestBuilder<crate::model::SqlDatabasesDeleteRequest>);
1232
1233 impl Delete {
1234 pub(crate) fn new(
1235 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1236 ) -> Self {
1237 Self(RequestBuilder::new(stub))
1238 }
1239
1240 pub fn with_request<V: Into<crate::model::SqlDatabasesDeleteRequest>>(
1242 mut self,
1243 v: V,
1244 ) -> Self {
1245 self.0.request = v.into();
1246 self
1247 }
1248
1249 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1251 self.0.options = v.into();
1252 self
1253 }
1254
1255 pub async fn send(self) -> Result<crate::model::Operation> {
1257 (*self.0.stub)
1258 .delete(self.0.request, self.0.options)
1259 .await
1260 .map(crate::Response::into_body)
1261 }
1262
1263 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1265 self.0.request.database = v.into();
1266 self
1267 }
1268
1269 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1271 self.0.request.instance = v.into();
1272 self
1273 }
1274
1275 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1277 self.0.request.project = v.into();
1278 self
1279 }
1280 }
1281
1282 #[doc(hidden)]
1283 impl crate::RequestBuilder for Delete {
1284 fn request_options(&mut self) -> &mut crate::RequestOptions {
1285 &mut self.0.options
1286 }
1287 }
1288
1289 #[derive(Clone, Debug)]
1306 pub struct Get(RequestBuilder<crate::model::SqlDatabasesGetRequest>);
1307
1308 impl Get {
1309 pub(crate) fn new(
1310 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1311 ) -> Self {
1312 Self(RequestBuilder::new(stub))
1313 }
1314
1315 pub fn with_request<V: Into<crate::model::SqlDatabasesGetRequest>>(mut self, v: V) -> Self {
1317 self.0.request = v.into();
1318 self
1319 }
1320
1321 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1323 self.0.options = v.into();
1324 self
1325 }
1326
1327 pub async fn send(self) -> Result<crate::model::Database> {
1329 (*self.0.stub)
1330 .get(self.0.request, self.0.options)
1331 .await
1332 .map(crate::Response::into_body)
1333 }
1334
1335 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1337 self.0.request.database = v.into();
1338 self
1339 }
1340
1341 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1343 self.0.request.instance = v.into();
1344 self
1345 }
1346
1347 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1349 self.0.request.project = v.into();
1350 self
1351 }
1352 }
1353
1354 #[doc(hidden)]
1355 impl crate::RequestBuilder for Get {
1356 fn request_options(&mut self) -> &mut crate::RequestOptions {
1357 &mut self.0.options
1358 }
1359 }
1360
1361 #[derive(Clone, Debug)]
1378 pub struct Insert(RequestBuilder<crate::model::SqlDatabasesInsertRequest>);
1379
1380 impl Insert {
1381 pub(crate) fn new(
1382 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1383 ) -> Self {
1384 Self(RequestBuilder::new(stub))
1385 }
1386
1387 pub fn with_request<V: Into<crate::model::SqlDatabasesInsertRequest>>(
1389 mut self,
1390 v: V,
1391 ) -> Self {
1392 self.0.request = v.into();
1393 self
1394 }
1395
1396 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1398 self.0.options = v.into();
1399 self
1400 }
1401
1402 pub async fn send(self) -> Result<crate::model::Operation> {
1404 (*self.0.stub)
1405 .insert(self.0.request, self.0.options)
1406 .await
1407 .map(crate::Response::into_body)
1408 }
1409
1410 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1412 self.0.request.instance = v.into();
1413 self
1414 }
1415
1416 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1418 self.0.request.project = v.into();
1419 self
1420 }
1421
1422 pub fn set_body<T>(mut self, v: T) -> Self
1424 where
1425 T: std::convert::Into<crate::model::Database>,
1426 {
1427 self.0.request.body = std::option::Option::Some(v.into());
1428 self
1429 }
1430
1431 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1433 where
1434 T: std::convert::Into<crate::model::Database>,
1435 {
1436 self.0.request.body = v.map(|x| x.into());
1437 self
1438 }
1439 }
1440
1441 #[doc(hidden)]
1442 impl crate::RequestBuilder for Insert {
1443 fn request_options(&mut self) -> &mut crate::RequestOptions {
1444 &mut self.0.options
1445 }
1446 }
1447
1448 #[derive(Clone, Debug)]
1465 pub struct List(RequestBuilder<crate::model::SqlDatabasesListRequest>);
1466
1467 impl List {
1468 pub(crate) fn new(
1469 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1470 ) -> Self {
1471 Self(RequestBuilder::new(stub))
1472 }
1473
1474 pub fn with_request<V: Into<crate::model::SqlDatabasesListRequest>>(
1476 mut self,
1477 v: V,
1478 ) -> Self {
1479 self.0.request = v.into();
1480 self
1481 }
1482
1483 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1485 self.0.options = v.into();
1486 self
1487 }
1488
1489 pub async fn send(self) -> Result<crate::model::DatabasesListResponse> {
1491 (*self.0.stub)
1492 .list(self.0.request, self.0.options)
1493 .await
1494 .map(crate::Response::into_body)
1495 }
1496
1497 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1499 self.0.request.instance = v.into();
1500 self
1501 }
1502
1503 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1505 self.0.request.project = v.into();
1506 self
1507 }
1508 }
1509
1510 #[doc(hidden)]
1511 impl crate::RequestBuilder for List {
1512 fn request_options(&mut self) -> &mut crate::RequestOptions {
1513 &mut self.0.options
1514 }
1515 }
1516
1517 #[derive(Clone, Debug)]
1534 pub struct Patch(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1535
1536 impl Patch {
1537 pub(crate) fn new(
1538 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1539 ) -> Self {
1540 Self(RequestBuilder::new(stub))
1541 }
1542
1543 pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1545 mut self,
1546 v: V,
1547 ) -> Self {
1548 self.0.request = v.into();
1549 self
1550 }
1551
1552 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1554 self.0.options = v.into();
1555 self
1556 }
1557
1558 pub async fn send(self) -> Result<crate::model::Operation> {
1560 (*self.0.stub)
1561 .patch(self.0.request, self.0.options)
1562 .await
1563 .map(crate::Response::into_body)
1564 }
1565
1566 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1568 self.0.request.database = v.into();
1569 self
1570 }
1571
1572 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1574 self.0.request.instance = v.into();
1575 self
1576 }
1577
1578 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1580 self.0.request.project = v.into();
1581 self
1582 }
1583
1584 pub fn set_body<T>(mut self, v: T) -> Self
1586 where
1587 T: std::convert::Into<crate::model::Database>,
1588 {
1589 self.0.request.body = std::option::Option::Some(v.into());
1590 self
1591 }
1592
1593 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1595 where
1596 T: std::convert::Into<crate::model::Database>,
1597 {
1598 self.0.request.body = v.map(|x| x.into());
1599 self
1600 }
1601 }
1602
1603 #[doc(hidden)]
1604 impl crate::RequestBuilder for Patch {
1605 fn request_options(&mut self) -> &mut crate::RequestOptions {
1606 &mut self.0.options
1607 }
1608 }
1609
1610 #[derive(Clone, Debug)]
1627 pub struct Update(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1628
1629 impl Update {
1630 pub(crate) fn new(
1631 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1632 ) -> Self {
1633 Self(RequestBuilder::new(stub))
1634 }
1635
1636 pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1638 mut self,
1639 v: V,
1640 ) -> Self {
1641 self.0.request = v.into();
1642 self
1643 }
1644
1645 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1647 self.0.options = v.into();
1648 self
1649 }
1650
1651 pub async fn send(self) -> Result<crate::model::Operation> {
1653 (*self.0.stub)
1654 .update(self.0.request, self.0.options)
1655 .await
1656 .map(crate::Response::into_body)
1657 }
1658
1659 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1661 self.0.request.database = v.into();
1662 self
1663 }
1664
1665 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1667 self.0.request.instance = v.into();
1668 self
1669 }
1670
1671 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1673 self.0.request.project = v.into();
1674 self
1675 }
1676
1677 pub fn set_body<T>(mut self, v: T) -> Self
1679 where
1680 T: std::convert::Into<crate::model::Database>,
1681 {
1682 self.0.request.body = std::option::Option::Some(v.into());
1683 self
1684 }
1685
1686 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1688 where
1689 T: std::convert::Into<crate::model::Database>,
1690 {
1691 self.0.request.body = v.map(|x| x.into());
1692 self
1693 }
1694 }
1695
1696 #[doc(hidden)]
1697 impl crate::RequestBuilder for Update {
1698 fn request_options(&mut self) -> &mut crate::RequestOptions {
1699 &mut self.0.options
1700 }
1701 }
1702}
1703
1704pub mod sql_flags_service {
1706 use crate::Result;
1707
1708 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1722
1723 pub(crate) mod client {
1724 use super::super::super::client::SqlFlagsService;
1725 pub struct Factory;
1726 impl crate::ClientFactory for Factory {
1727 type Client = SqlFlagsService;
1728 type Credentials = gaxi::options::Credentials;
1729 async fn build(
1730 self,
1731 config: gaxi::options::ClientConfig,
1732 ) -> crate::ClientBuilderResult<Self::Client> {
1733 Self::Client::new(config).await
1734 }
1735 }
1736 }
1737
1738 #[derive(Clone, Debug)]
1740 pub(crate) struct RequestBuilder<R: std::default::Default> {
1741 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1742 request: R,
1743 options: crate::RequestOptions,
1744 }
1745
1746 impl<R> RequestBuilder<R>
1747 where
1748 R: std::default::Default,
1749 {
1750 pub(crate) fn new(
1751 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1752 ) -> Self {
1753 Self {
1754 stub,
1755 request: R::default(),
1756 options: crate::RequestOptions::default(),
1757 }
1758 }
1759 }
1760
1761 #[derive(Clone, Debug)]
1778 pub struct List(RequestBuilder<crate::model::SqlFlagsListRequest>);
1779
1780 impl List {
1781 pub(crate) fn new(
1782 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1783 ) -> Self {
1784 Self(RequestBuilder::new(stub))
1785 }
1786
1787 pub fn with_request<V: Into<crate::model::SqlFlagsListRequest>>(mut self, v: V) -> Self {
1789 self.0.request = v.into();
1790 self
1791 }
1792
1793 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1795 self.0.options = v.into();
1796 self
1797 }
1798
1799 pub async fn send(self) -> Result<crate::model::FlagsListResponse> {
1801 (*self.0.stub)
1802 .list(self.0.request, self.0.options)
1803 .await
1804 .map(crate::Response::into_body)
1805 }
1806
1807 pub fn set_database_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
1809 self.0.request.database_version = v.into();
1810 self
1811 }
1812
1813 pub fn set_flag_scope<T>(mut self, v: T) -> Self
1815 where
1816 T: std::convert::Into<crate::model::SqlFlagScope>,
1817 {
1818 self.0.request.flag_scope = std::option::Option::Some(v.into());
1819 self
1820 }
1821
1822 pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
1824 where
1825 T: std::convert::Into<crate::model::SqlFlagScope>,
1826 {
1827 self.0.request.flag_scope = v.map(|x| x.into());
1828 self
1829 }
1830 }
1831
1832 #[doc(hidden)]
1833 impl crate::RequestBuilder for List {
1834 fn request_options(&mut self) -> &mut crate::RequestOptions {
1835 &mut self.0.options
1836 }
1837 }
1838}
1839
1840pub mod sql_instances_service {
1842 use crate::Result;
1843
1844 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1858
1859 pub(crate) mod client {
1860 use super::super::super::client::SqlInstancesService;
1861 pub struct Factory;
1862 impl crate::ClientFactory for Factory {
1863 type Client = SqlInstancesService;
1864 type Credentials = gaxi::options::Credentials;
1865 async fn build(
1866 self,
1867 config: gaxi::options::ClientConfig,
1868 ) -> crate::ClientBuilderResult<Self::Client> {
1869 Self::Client::new(config).await
1870 }
1871 }
1872 }
1873
1874 #[derive(Clone, Debug)]
1876 pub(crate) struct RequestBuilder<R: std::default::Default> {
1877 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1878 request: R,
1879 options: crate::RequestOptions,
1880 }
1881
1882 impl<R> RequestBuilder<R>
1883 where
1884 R: std::default::Default,
1885 {
1886 pub(crate) fn new(
1887 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1888 ) -> Self {
1889 Self {
1890 stub,
1891 request: R::default(),
1892 options: crate::RequestOptions::default(),
1893 }
1894 }
1895 }
1896
1897 #[derive(Clone, Debug)]
1914 pub struct AddServerCa(RequestBuilder<crate::model::SqlInstancesAddServerCaRequest>);
1915
1916 impl AddServerCa {
1917 pub(crate) fn new(
1918 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1919 ) -> Self {
1920 Self(RequestBuilder::new(stub))
1921 }
1922
1923 pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCaRequest>>(
1925 mut self,
1926 v: V,
1927 ) -> Self {
1928 self.0.request = v.into();
1929 self
1930 }
1931
1932 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1934 self.0.options = v.into();
1935 self
1936 }
1937
1938 pub async fn send(self) -> Result<crate::model::Operation> {
1940 (*self.0.stub)
1941 .add_server_ca(self.0.request, self.0.options)
1942 .await
1943 .map(crate::Response::into_body)
1944 }
1945
1946 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1948 self.0.request.instance = v.into();
1949 self
1950 }
1951
1952 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1954 self.0.request.project = v.into();
1955 self
1956 }
1957 }
1958
1959 #[doc(hidden)]
1960 impl crate::RequestBuilder for AddServerCa {
1961 fn request_options(&mut self) -> &mut crate::RequestOptions {
1962 &mut self.0.options
1963 }
1964 }
1965
1966 #[derive(Clone, Debug)]
1983 pub struct AddServerCertificate(
1984 RequestBuilder<crate::model::SqlInstancesAddServerCertificateRequest>,
1985 );
1986
1987 impl AddServerCertificate {
1988 pub(crate) fn new(
1989 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1990 ) -> Self {
1991 Self(RequestBuilder::new(stub))
1992 }
1993
1994 pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCertificateRequest>>(
1996 mut self,
1997 v: V,
1998 ) -> Self {
1999 self.0.request = v.into();
2000 self
2001 }
2002
2003 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2005 self.0.options = v.into();
2006 self
2007 }
2008
2009 pub async fn send(self) -> Result<crate::model::Operation> {
2011 (*self.0.stub)
2012 .add_server_certificate(self.0.request, self.0.options)
2013 .await
2014 .map(crate::Response::into_body)
2015 }
2016
2017 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2019 self.0.request.instance = v.into();
2020 self
2021 }
2022
2023 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2025 self.0.request.project = v.into();
2026 self
2027 }
2028 }
2029
2030 #[doc(hidden)]
2031 impl crate::RequestBuilder for AddServerCertificate {
2032 fn request_options(&mut self) -> &mut crate::RequestOptions {
2033 &mut self.0.options
2034 }
2035 }
2036
2037 #[derive(Clone, Debug)]
2054 pub struct AddEntraIdCertificate(
2055 RequestBuilder<crate::model::SqlInstancesAddEntraIdCertificateRequest>,
2056 );
2057
2058 impl AddEntraIdCertificate {
2059 pub(crate) fn new(
2060 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2061 ) -> Self {
2062 Self(RequestBuilder::new(stub))
2063 }
2064
2065 pub fn with_request<V: Into<crate::model::SqlInstancesAddEntraIdCertificateRequest>>(
2067 mut self,
2068 v: V,
2069 ) -> Self {
2070 self.0.request = v.into();
2071 self
2072 }
2073
2074 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2076 self.0.options = v.into();
2077 self
2078 }
2079
2080 pub async fn send(self) -> Result<crate::model::Operation> {
2082 (*self.0.stub)
2083 .add_entra_id_certificate(self.0.request, self.0.options)
2084 .await
2085 .map(crate::Response::into_body)
2086 }
2087
2088 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 {
2100 self.0.request.project = v.into();
2101 self
2102 }
2103 }
2104
2105 #[doc(hidden)]
2106 impl crate::RequestBuilder for AddEntraIdCertificate {
2107 fn request_options(&mut self) -> &mut crate::RequestOptions {
2108 &mut self.0.options
2109 }
2110 }
2111
2112 #[derive(Clone, Debug)]
2129 pub struct Clone(RequestBuilder<crate::model::SqlInstancesCloneRequest>);
2130
2131 impl Clone {
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::SqlInstancesCloneRequest>>(
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 .clone(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 pub fn set_body<T>(mut self, v: T) -> Self
2181 where
2182 T: std::convert::Into<crate::model::InstancesCloneRequest>,
2183 {
2184 self.0.request.body = std::option::Option::Some(v.into());
2185 self
2186 }
2187
2188 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2192 where
2193 T: std::convert::Into<crate::model::InstancesCloneRequest>,
2194 {
2195 self.0.request.body = v.map(|x| x.into());
2196 self
2197 }
2198 }
2199
2200 #[doc(hidden)]
2201 impl crate::RequestBuilder for Clone {
2202 fn request_options(&mut self) -> &mut crate::RequestOptions {
2203 &mut self.0.options
2204 }
2205 }
2206
2207 #[derive(Clone, Debug)]
2224 pub struct Delete(RequestBuilder<crate::model::SqlInstancesDeleteRequest>);
2225
2226 impl Delete {
2227 pub(crate) fn new(
2228 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2229 ) -> Self {
2230 Self(RequestBuilder::new(stub))
2231 }
2232
2233 pub fn with_request<V: Into<crate::model::SqlInstancesDeleteRequest>>(
2235 mut self,
2236 v: V,
2237 ) -> Self {
2238 self.0.request = v.into();
2239 self
2240 }
2241
2242 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2244 self.0.options = v.into();
2245 self
2246 }
2247
2248 pub async fn send(self) -> Result<crate::model::Operation> {
2250 (*self.0.stub)
2251 .delete(self.0.request, self.0.options)
2252 .await
2253 .map(crate::Response::into_body)
2254 }
2255
2256 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2258 self.0.request.instance = v.into();
2259 self
2260 }
2261
2262 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2264 self.0.request.project = v.into();
2265 self
2266 }
2267
2268 pub fn set_enable_final_backup<T>(mut self, v: T) -> Self
2270 where
2271 T: std::convert::Into<bool>,
2272 {
2273 self.0.request.enable_final_backup = std::option::Option::Some(v.into());
2274 self
2275 }
2276
2277 pub fn set_or_clear_enable_final_backup<T>(mut self, v: std::option::Option<T>) -> Self
2279 where
2280 T: std::convert::Into<bool>,
2281 {
2282 self.0.request.enable_final_backup = v.map(|x| x.into());
2283 self
2284 }
2285
2286 pub fn set_final_backup_description<T: Into<std::string::String>>(mut self, v: T) -> Self {
2288 self.0.request.final_backup_description = v.into();
2289 self
2290 }
2291
2292 pub fn set_expiration<
2297 T: Into<Option<crate::model::sql_instances_delete_request::Expiration>>,
2298 >(
2299 mut self,
2300 v: T,
2301 ) -> Self {
2302 self.0.request.expiration = v.into();
2303 self
2304 }
2305
2306 pub fn set_final_backup_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2312 self.0.request = self.0.request.set_final_backup_ttl_days(v);
2313 self
2314 }
2315
2316 pub fn set_final_backup_expiry_time<
2322 T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>,
2323 >(
2324 mut self,
2325 v: T,
2326 ) -> Self {
2327 self.0.request = self.0.request.set_final_backup_expiry_time(v);
2328 self
2329 }
2330 }
2331
2332 #[doc(hidden)]
2333 impl crate::RequestBuilder for Delete {
2334 fn request_options(&mut self) -> &mut crate::RequestOptions {
2335 &mut self.0.options
2336 }
2337 }
2338
2339 #[derive(Clone, Debug)]
2356 pub struct DemoteMaster(RequestBuilder<crate::model::SqlInstancesDemoteMasterRequest>);
2357
2358 impl DemoteMaster {
2359 pub(crate) fn new(
2360 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2361 ) -> Self {
2362 Self(RequestBuilder::new(stub))
2363 }
2364
2365 pub fn with_request<V: Into<crate::model::SqlInstancesDemoteMasterRequest>>(
2367 mut self,
2368 v: V,
2369 ) -> Self {
2370 self.0.request = v.into();
2371 self
2372 }
2373
2374 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2376 self.0.options = v.into();
2377 self
2378 }
2379
2380 pub async fn send(self) -> Result<crate::model::Operation> {
2382 (*self.0.stub)
2383 .demote_master(self.0.request, self.0.options)
2384 .await
2385 .map(crate::Response::into_body)
2386 }
2387
2388 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2390 self.0.request.instance = v.into();
2391 self
2392 }
2393
2394 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2396 self.0.request.project = v.into();
2397 self
2398 }
2399
2400 pub fn set_body<T>(mut self, v: T) -> Self
2402 where
2403 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
2404 {
2405 self.0.request.body = std::option::Option::Some(v.into());
2406 self
2407 }
2408
2409 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2411 where
2412 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
2413 {
2414 self.0.request.body = v.map(|x| x.into());
2415 self
2416 }
2417 }
2418
2419 #[doc(hidden)]
2420 impl crate::RequestBuilder for DemoteMaster {
2421 fn request_options(&mut self) -> &mut crate::RequestOptions {
2422 &mut self.0.options
2423 }
2424 }
2425
2426 #[derive(Clone, Debug)]
2443 pub struct Demote(RequestBuilder<crate::model::SqlInstancesDemoteRequest>);
2444
2445 impl Demote {
2446 pub(crate) fn new(
2447 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2448 ) -> Self {
2449 Self(RequestBuilder::new(stub))
2450 }
2451
2452 pub fn with_request<V: Into<crate::model::SqlInstancesDemoteRequest>>(
2454 mut self,
2455 v: V,
2456 ) -> Self {
2457 self.0.request = v.into();
2458 self
2459 }
2460
2461 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2463 self.0.options = v.into();
2464 self
2465 }
2466
2467 pub async fn send(self) -> Result<crate::model::Operation> {
2469 (*self.0.stub)
2470 .demote(self.0.request, self.0.options)
2471 .await
2472 .map(crate::Response::into_body)
2473 }
2474
2475 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2479 self.0.request.instance = v.into();
2480 self
2481 }
2482
2483 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2487 self.0.request.project = v.into();
2488 self
2489 }
2490
2491 pub fn set_body<T>(mut self, v: T) -> Self
2495 where
2496 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
2497 {
2498 self.0.request.body = std::option::Option::Some(v.into());
2499 self
2500 }
2501
2502 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2506 where
2507 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
2508 {
2509 self.0.request.body = v.map(|x| x.into());
2510 self
2511 }
2512 }
2513
2514 #[doc(hidden)]
2515 impl crate::RequestBuilder for Demote {
2516 fn request_options(&mut self) -> &mut crate::RequestOptions {
2517 &mut self.0.options
2518 }
2519 }
2520
2521 #[derive(Clone, Debug)]
2538 pub struct Export(RequestBuilder<crate::model::SqlInstancesExportRequest>);
2539
2540 impl Export {
2541 pub(crate) fn new(
2542 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2543 ) -> Self {
2544 Self(RequestBuilder::new(stub))
2545 }
2546
2547 pub fn with_request<V: Into<crate::model::SqlInstancesExportRequest>>(
2549 mut self,
2550 v: V,
2551 ) -> Self {
2552 self.0.request = v.into();
2553 self
2554 }
2555
2556 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2558 self.0.options = v.into();
2559 self
2560 }
2561
2562 pub async fn send(self) -> Result<crate::model::Operation> {
2564 (*self.0.stub)
2565 .export(self.0.request, self.0.options)
2566 .await
2567 .map(crate::Response::into_body)
2568 }
2569
2570 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2572 self.0.request.instance = v.into();
2573 self
2574 }
2575
2576 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2578 self.0.request.project = v.into();
2579 self
2580 }
2581
2582 pub fn set_body<T>(mut self, v: T) -> Self
2584 where
2585 T: std::convert::Into<crate::model::InstancesExportRequest>,
2586 {
2587 self.0.request.body = std::option::Option::Some(v.into());
2588 self
2589 }
2590
2591 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2593 where
2594 T: std::convert::Into<crate::model::InstancesExportRequest>,
2595 {
2596 self.0.request.body = v.map(|x| x.into());
2597 self
2598 }
2599 }
2600
2601 #[doc(hidden)]
2602 impl crate::RequestBuilder for Export {
2603 fn request_options(&mut self) -> &mut crate::RequestOptions {
2604 &mut self.0.options
2605 }
2606 }
2607
2608 #[derive(Clone, Debug)]
2625 pub struct Failover(RequestBuilder<crate::model::SqlInstancesFailoverRequest>);
2626
2627 impl Failover {
2628 pub(crate) fn new(
2629 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2630 ) -> Self {
2631 Self(RequestBuilder::new(stub))
2632 }
2633
2634 pub fn with_request<V: Into<crate::model::SqlInstancesFailoverRequest>>(
2636 mut self,
2637 v: V,
2638 ) -> Self {
2639 self.0.request = v.into();
2640 self
2641 }
2642
2643 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2645 self.0.options = v.into();
2646 self
2647 }
2648
2649 pub async fn send(self) -> Result<crate::model::Operation> {
2651 (*self.0.stub)
2652 .failover(self.0.request, self.0.options)
2653 .await
2654 .map(crate::Response::into_body)
2655 }
2656
2657 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2659 self.0.request.instance = v.into();
2660 self
2661 }
2662
2663 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2665 self.0.request.project = v.into();
2666 self
2667 }
2668
2669 pub fn set_body<T>(mut self, v: T) -> Self
2671 where
2672 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
2673 {
2674 self.0.request.body = std::option::Option::Some(v.into());
2675 self
2676 }
2677
2678 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2680 where
2681 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
2682 {
2683 self.0.request.body = v.map(|x| x.into());
2684 self
2685 }
2686 }
2687
2688 #[doc(hidden)]
2689 impl crate::RequestBuilder for Failover {
2690 fn request_options(&mut self) -> &mut crate::RequestOptions {
2691 &mut self.0.options
2692 }
2693 }
2694
2695 #[derive(Clone, Debug)]
2712 pub struct Reencrypt(RequestBuilder<crate::model::SqlInstancesReencryptRequest>);
2713
2714 impl Reencrypt {
2715 pub(crate) fn new(
2716 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2717 ) -> Self {
2718 Self(RequestBuilder::new(stub))
2719 }
2720
2721 pub fn with_request<V: Into<crate::model::SqlInstancesReencryptRequest>>(
2723 mut self,
2724 v: V,
2725 ) -> Self {
2726 self.0.request = v.into();
2727 self
2728 }
2729
2730 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2732 self.0.options = v.into();
2733 self
2734 }
2735
2736 pub async fn send(self) -> Result<crate::model::Operation> {
2738 (*self.0.stub)
2739 .reencrypt(self.0.request, self.0.options)
2740 .await
2741 .map(crate::Response::into_body)
2742 }
2743
2744 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2746 self.0.request.instance = v.into();
2747 self
2748 }
2749
2750 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2752 self.0.request.project = v.into();
2753 self
2754 }
2755
2756 pub fn set_body<T>(mut self, v: T) -> Self
2758 where
2759 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2760 {
2761 self.0.request.body = std::option::Option::Some(v.into());
2762 self
2763 }
2764
2765 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2767 where
2768 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2769 {
2770 self.0.request.body = v.map(|x| x.into());
2771 self
2772 }
2773 }
2774
2775 #[doc(hidden)]
2776 impl crate::RequestBuilder for Reencrypt {
2777 fn request_options(&mut self) -> &mut crate::RequestOptions {
2778 &mut self.0.options
2779 }
2780 }
2781
2782 #[derive(Clone, Debug)]
2799 pub struct Get(RequestBuilder<crate::model::SqlInstancesGetRequest>);
2800
2801 impl Get {
2802 pub(crate) fn new(
2803 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2804 ) -> Self {
2805 Self(RequestBuilder::new(stub))
2806 }
2807
2808 pub fn with_request<V: Into<crate::model::SqlInstancesGetRequest>>(mut self, v: V) -> Self {
2810 self.0.request = v.into();
2811 self
2812 }
2813
2814 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2816 self.0.options = v.into();
2817 self
2818 }
2819
2820 pub async fn send(self) -> Result<crate::model::DatabaseInstance> {
2822 (*self.0.stub)
2823 .get(self.0.request, self.0.options)
2824 .await
2825 .map(crate::Response::into_body)
2826 }
2827
2828 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2832 self.0.request.instance = v.into();
2833 self
2834 }
2835
2836 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2840 self.0.request.project = v.into();
2841 self
2842 }
2843 }
2844
2845 #[doc(hidden)]
2846 impl crate::RequestBuilder for Get {
2847 fn request_options(&mut self) -> &mut crate::RequestOptions {
2848 &mut self.0.options
2849 }
2850 }
2851
2852 #[derive(Clone, Debug)]
2869 pub struct Import(RequestBuilder<crate::model::SqlInstancesImportRequest>);
2870
2871 impl Import {
2872 pub(crate) fn new(
2873 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2874 ) -> Self {
2875 Self(RequestBuilder::new(stub))
2876 }
2877
2878 pub fn with_request<V: Into<crate::model::SqlInstancesImportRequest>>(
2880 mut self,
2881 v: V,
2882 ) -> 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::Operation> {
2895 (*self.0.stub)
2896 .import(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 {
2903 self.0.request.instance = v.into();
2904 self
2905 }
2906
2907 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2909 self.0.request.project = v.into();
2910 self
2911 }
2912
2913 pub fn set_body<T>(mut self, v: T) -> Self
2915 where
2916 T: std::convert::Into<crate::model::InstancesImportRequest>,
2917 {
2918 self.0.request.body = std::option::Option::Some(v.into());
2919 self
2920 }
2921
2922 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2924 where
2925 T: std::convert::Into<crate::model::InstancesImportRequest>,
2926 {
2927 self.0.request.body = v.map(|x| x.into());
2928 self
2929 }
2930 }
2931
2932 #[doc(hidden)]
2933 impl crate::RequestBuilder for Import {
2934 fn request_options(&mut self) -> &mut crate::RequestOptions {
2935 &mut self.0.options
2936 }
2937 }
2938
2939 #[derive(Clone, Debug)]
2956 pub struct Insert(RequestBuilder<crate::model::SqlInstancesInsertRequest>);
2957
2958 impl Insert {
2959 pub(crate) fn new(
2960 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2961 ) -> Self {
2962 Self(RequestBuilder::new(stub))
2963 }
2964
2965 pub fn with_request<V: Into<crate::model::SqlInstancesInsertRequest>>(
2967 mut self,
2968 v: V,
2969 ) -> Self {
2970 self.0.request = v.into();
2971 self
2972 }
2973
2974 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2976 self.0.options = v.into();
2977 self
2978 }
2979
2980 pub async fn send(self) -> Result<crate::model::Operation> {
2982 (*self.0.stub)
2983 .insert(self.0.request, self.0.options)
2984 .await
2985 .map(crate::Response::into_body)
2986 }
2987
2988 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2990 self.0.request.project = v.into();
2991 self
2992 }
2993
2994 pub fn set_body<T>(mut self, v: T) -> Self
2996 where
2997 T: std::convert::Into<crate::model::DatabaseInstance>,
2998 {
2999 self.0.request.body = std::option::Option::Some(v.into());
3000 self
3001 }
3002
3003 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3005 where
3006 T: std::convert::Into<crate::model::DatabaseInstance>,
3007 {
3008 self.0.request.body = v.map(|x| x.into());
3009 self
3010 }
3011 }
3012
3013 #[doc(hidden)]
3014 impl crate::RequestBuilder for Insert {
3015 fn request_options(&mut self) -> &mut crate::RequestOptions {
3016 &mut self.0.options
3017 }
3018 }
3019
3020 #[derive(Clone, Debug)]
3041 pub struct List(RequestBuilder<crate::model::SqlInstancesListRequest>);
3042
3043 impl List {
3044 pub(crate) fn new(
3045 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3046 ) -> Self {
3047 Self(RequestBuilder::new(stub))
3048 }
3049
3050 pub fn with_request<V: Into<crate::model::SqlInstancesListRequest>>(
3052 mut self,
3053 v: V,
3054 ) -> Self {
3055 self.0.request = v.into();
3056 self
3057 }
3058
3059 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3061 self.0.options = v.into();
3062 self
3063 }
3064
3065 pub async fn send(self) -> Result<crate::model::InstancesListResponse> {
3067 (*self.0.stub)
3068 .list(self.0.request, self.0.options)
3069 .await
3070 .map(crate::Response::into_body)
3071 }
3072
3073 pub fn by_page(
3075 self,
3076 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::InstancesListResponse, crate::Error>
3077 {
3078 use std::clone::Clone;
3079 let token = self.0.request.page_token.clone();
3080 let execute = move |token: String| {
3081 let mut builder = self.clone();
3082 builder.0.request = builder.0.request.set_page_token(token);
3083 builder.send()
3084 };
3085 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3086 }
3087
3088 pub fn by_item(
3090 self,
3091 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3092 crate::model::InstancesListResponse,
3093 crate::Error,
3094 > {
3095 use google_cloud_gax::paginator::Paginator;
3096 self.by_page().items()
3097 }
3098
3099 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3101 self.0.request.filter = v.into();
3102 self
3103 }
3104
3105 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
3107 self.0.request.max_results = v.into();
3108 self
3109 }
3110
3111 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3113 self.0.request.page_token = v.into();
3114 self
3115 }
3116
3117 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3119 self.0.request.project = v.into();
3120 self
3121 }
3122 }
3123
3124 #[doc(hidden)]
3125 impl crate::RequestBuilder for List {
3126 fn request_options(&mut self) -> &mut crate::RequestOptions {
3127 &mut self.0.options
3128 }
3129 }
3130
3131 #[derive(Clone, Debug)]
3148 pub struct ListServerCas(RequestBuilder<crate::model::SqlInstancesListServerCasRequest>);
3149
3150 impl ListServerCas {
3151 pub(crate) fn new(
3152 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3153 ) -> Self {
3154 Self(RequestBuilder::new(stub))
3155 }
3156
3157 pub fn with_request<V: Into<crate::model::SqlInstancesListServerCasRequest>>(
3159 mut self,
3160 v: V,
3161 ) -> Self {
3162 self.0.request = v.into();
3163 self
3164 }
3165
3166 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3168 self.0.options = v.into();
3169 self
3170 }
3171
3172 pub async fn send(self) -> Result<crate::model::InstancesListServerCasResponse> {
3174 (*self.0.stub)
3175 .list_server_cas(self.0.request, self.0.options)
3176 .await
3177 .map(crate::Response::into_body)
3178 }
3179
3180 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3182 self.0.request.instance = v.into();
3183 self
3184 }
3185
3186 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3188 self.0.request.project = v.into();
3189 self
3190 }
3191 }
3192
3193 #[doc(hidden)]
3194 impl crate::RequestBuilder for ListServerCas {
3195 fn request_options(&mut self) -> &mut crate::RequestOptions {
3196 &mut self.0.options
3197 }
3198 }
3199
3200 #[derive(Clone, Debug)]
3217 pub struct ListServerCertificates(
3218 RequestBuilder<crate::model::SqlInstancesListServerCertificatesRequest>,
3219 );
3220
3221 impl ListServerCertificates {
3222 pub(crate) fn new(
3223 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3224 ) -> Self {
3225 Self(RequestBuilder::new(stub))
3226 }
3227
3228 pub fn with_request<V: Into<crate::model::SqlInstancesListServerCertificatesRequest>>(
3230 mut self,
3231 v: V,
3232 ) -> Self {
3233 self.0.request = v.into();
3234 self
3235 }
3236
3237 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3239 self.0.options = v.into();
3240 self
3241 }
3242
3243 pub async fn send(self) -> Result<crate::model::InstancesListServerCertificatesResponse> {
3245 (*self.0.stub)
3246 .list_server_certificates(self.0.request, self.0.options)
3247 .await
3248 .map(crate::Response::into_body)
3249 }
3250
3251 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 {
3263 self.0.request.project = v.into();
3264 self
3265 }
3266 }
3267
3268 #[doc(hidden)]
3269 impl crate::RequestBuilder for ListServerCertificates {
3270 fn request_options(&mut self) -> &mut crate::RequestOptions {
3271 &mut self.0.options
3272 }
3273 }
3274
3275 #[derive(Clone, Debug)]
3292 pub struct ListEntraIdCertificates(
3293 RequestBuilder<crate::model::SqlInstancesListEntraIdCertificatesRequest>,
3294 );
3295
3296 impl ListEntraIdCertificates {
3297 pub(crate) fn new(
3298 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3299 ) -> Self {
3300 Self(RequestBuilder::new(stub))
3301 }
3302
3303 pub fn with_request<V: Into<crate::model::SqlInstancesListEntraIdCertificatesRequest>>(
3305 mut self,
3306 v: V,
3307 ) -> Self {
3308 self.0.request = v.into();
3309 self
3310 }
3311
3312 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3314 self.0.options = v.into();
3315 self
3316 }
3317
3318 pub async fn send(self) -> Result<crate::model::InstancesListEntraIdCertificatesResponse> {
3320 (*self.0.stub)
3321 .list_entra_id_certificates(self.0.request, self.0.options)
3322 .await
3323 .map(crate::Response::into_body)
3324 }
3325
3326 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3330 self.0.request.instance = v.into();
3331 self
3332 }
3333
3334 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3338 self.0.request.project = v.into();
3339 self
3340 }
3341 }
3342
3343 #[doc(hidden)]
3344 impl crate::RequestBuilder for ListEntraIdCertificates {
3345 fn request_options(&mut self) -> &mut crate::RequestOptions {
3346 &mut self.0.options
3347 }
3348 }
3349
3350 #[derive(Clone, Debug)]
3367 pub struct Patch(RequestBuilder<crate::model::SqlInstancesPatchRequest>);
3368
3369 impl Patch {
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::SqlInstancesPatchRequest>>(
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::Operation> {
3393 (*self.0.stub)
3394 .patch(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 {
3401 self.0.request.instance = v.into();
3402 self
3403 }
3404
3405 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3407 self.0.request.project = v.into();
3408 self
3409 }
3410
3411 pub fn set_body<T>(mut self, v: T) -> Self
3413 where
3414 T: std::convert::Into<crate::model::DatabaseInstance>,
3415 {
3416 self.0.request.body = std::option::Option::Some(v.into());
3417 self
3418 }
3419
3420 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3422 where
3423 T: std::convert::Into<crate::model::DatabaseInstance>,
3424 {
3425 self.0.request.body = v.map(|x| x.into());
3426 self
3427 }
3428 }
3429
3430 #[doc(hidden)]
3431 impl crate::RequestBuilder for Patch {
3432 fn request_options(&mut self) -> &mut crate::RequestOptions {
3433 &mut self.0.options
3434 }
3435 }
3436
3437 #[derive(Clone, Debug)]
3454 pub struct PromoteReplica(RequestBuilder<crate::model::SqlInstancesPromoteReplicaRequest>);
3455
3456 impl PromoteReplica {
3457 pub(crate) fn new(
3458 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3459 ) -> Self {
3460 Self(RequestBuilder::new(stub))
3461 }
3462
3463 pub fn with_request<V: Into<crate::model::SqlInstancesPromoteReplicaRequest>>(
3465 mut self,
3466 v: V,
3467 ) -> Self {
3468 self.0.request = v.into();
3469 self
3470 }
3471
3472 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3474 self.0.options = v.into();
3475 self
3476 }
3477
3478 pub async fn send(self) -> Result<crate::model::Operation> {
3480 (*self.0.stub)
3481 .promote_replica(self.0.request, self.0.options)
3482 .await
3483 .map(crate::Response::into_body)
3484 }
3485
3486 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3488 self.0.request.instance = v.into();
3489 self
3490 }
3491
3492 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3494 self.0.request.project = v.into();
3495 self
3496 }
3497
3498 pub fn set_failover<T: Into<bool>>(mut self, v: T) -> Self {
3500 self.0.request.failover = v.into();
3501 self
3502 }
3503 }
3504
3505 #[doc(hidden)]
3506 impl crate::RequestBuilder for PromoteReplica {
3507 fn request_options(&mut self) -> &mut crate::RequestOptions {
3508 &mut self.0.options
3509 }
3510 }
3511
3512 #[derive(Clone, Debug)]
3529 pub struct Switchover(RequestBuilder<crate::model::SqlInstancesSwitchoverRequest>);
3530
3531 impl Switchover {
3532 pub(crate) fn new(
3533 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3534 ) -> Self {
3535 Self(RequestBuilder::new(stub))
3536 }
3537
3538 pub fn with_request<V: Into<crate::model::SqlInstancesSwitchoverRequest>>(
3540 mut self,
3541 v: V,
3542 ) -> Self {
3543 self.0.request = v.into();
3544 self
3545 }
3546
3547 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3549 self.0.options = v.into();
3550 self
3551 }
3552
3553 pub async fn send(self) -> Result<crate::model::Operation> {
3555 (*self.0.stub)
3556 .switchover(self.0.request, self.0.options)
3557 .await
3558 .map(crate::Response::into_body)
3559 }
3560
3561 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3563 self.0.request.instance = v.into();
3564 self
3565 }
3566
3567 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3569 self.0.request.project = v.into();
3570 self
3571 }
3572
3573 pub fn set_db_timeout<T>(mut self, v: T) -> Self
3575 where
3576 T: std::convert::Into<wkt::Duration>,
3577 {
3578 self.0.request.db_timeout = std::option::Option::Some(v.into());
3579 self
3580 }
3581
3582 pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
3584 where
3585 T: std::convert::Into<wkt::Duration>,
3586 {
3587 self.0.request.db_timeout = v.map(|x| x.into());
3588 self
3589 }
3590 }
3591
3592 #[doc(hidden)]
3593 impl crate::RequestBuilder for Switchover {
3594 fn request_options(&mut self) -> &mut crate::RequestOptions {
3595 &mut self.0.options
3596 }
3597 }
3598
3599 #[derive(Clone, Debug)]
3616 pub struct ResetSslConfig(RequestBuilder<crate::model::SqlInstancesResetSslConfigRequest>);
3617
3618 impl ResetSslConfig {
3619 pub(crate) fn new(
3620 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3621 ) -> Self {
3622 Self(RequestBuilder::new(stub))
3623 }
3624
3625 pub fn with_request<V: Into<crate::model::SqlInstancesResetSslConfigRequest>>(
3627 mut self,
3628 v: V,
3629 ) -> Self {
3630 self.0.request = v.into();
3631 self
3632 }
3633
3634 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3636 self.0.options = v.into();
3637 self
3638 }
3639
3640 pub async fn send(self) -> Result<crate::model::Operation> {
3642 (*self.0.stub)
3643 .reset_ssl_config(self.0.request, self.0.options)
3644 .await
3645 .map(crate::Response::into_body)
3646 }
3647
3648 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3650 self.0.request.instance = v.into();
3651 self
3652 }
3653
3654 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3656 self.0.request.project = v.into();
3657 self
3658 }
3659
3660 pub fn set_mode<
3662 T: Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
3663 >(
3664 mut self,
3665 v: T,
3666 ) -> Self {
3667 self.0.request.mode = v.into();
3668 self
3669 }
3670 }
3671
3672 #[doc(hidden)]
3673 impl crate::RequestBuilder for ResetSslConfig {
3674 fn request_options(&mut self) -> &mut crate::RequestOptions {
3675 &mut self.0.options
3676 }
3677 }
3678
3679 #[derive(Clone, Debug)]
3696 pub struct Restart(RequestBuilder<crate::model::SqlInstancesRestartRequest>);
3697
3698 impl Restart {
3699 pub(crate) fn new(
3700 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3701 ) -> Self {
3702 Self(RequestBuilder::new(stub))
3703 }
3704
3705 pub fn with_request<V: Into<crate::model::SqlInstancesRestartRequest>>(
3707 mut self,
3708 v: V,
3709 ) -> Self {
3710 self.0.request = v.into();
3711 self
3712 }
3713
3714 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3716 self.0.options = v.into();
3717 self
3718 }
3719
3720 pub async fn send(self) -> Result<crate::model::Operation> {
3722 (*self.0.stub)
3723 .restart(self.0.request, self.0.options)
3724 .await
3725 .map(crate::Response::into_body)
3726 }
3727
3728 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3730 self.0.request.instance = v.into();
3731 self
3732 }
3733
3734 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3736 self.0.request.project = v.into();
3737 self
3738 }
3739 }
3740
3741 #[doc(hidden)]
3742 impl crate::RequestBuilder for Restart {
3743 fn request_options(&mut self) -> &mut crate::RequestOptions {
3744 &mut self.0.options
3745 }
3746 }
3747
3748 #[derive(Clone, Debug)]
3765 pub struct RestoreBackup(RequestBuilder<crate::model::SqlInstancesRestoreBackupRequest>);
3766
3767 impl RestoreBackup {
3768 pub(crate) fn new(
3769 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3770 ) -> Self {
3771 Self(RequestBuilder::new(stub))
3772 }
3773
3774 pub fn with_request<V: Into<crate::model::SqlInstancesRestoreBackupRequest>>(
3776 mut self,
3777 v: V,
3778 ) -> Self {
3779 self.0.request = v.into();
3780 self
3781 }
3782
3783 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3785 self.0.options = v.into();
3786 self
3787 }
3788
3789 pub async fn send(self) -> Result<crate::model::Operation> {
3791 (*self.0.stub)
3792 .restore_backup(self.0.request, self.0.options)
3793 .await
3794 .map(crate::Response::into_body)
3795 }
3796
3797 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3799 self.0.request.instance = v.into();
3800 self
3801 }
3802
3803 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3805 self.0.request.project = v.into();
3806 self
3807 }
3808
3809 pub fn set_body<T>(mut self, v: T) -> Self
3811 where
3812 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
3813 {
3814 self.0.request.body = std::option::Option::Some(v.into());
3815 self
3816 }
3817
3818 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3820 where
3821 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
3822 {
3823 self.0.request.body = v.map(|x| x.into());
3824 self
3825 }
3826 }
3827
3828 #[doc(hidden)]
3829 impl crate::RequestBuilder for RestoreBackup {
3830 fn request_options(&mut self) -> &mut crate::RequestOptions {
3831 &mut self.0.options
3832 }
3833 }
3834
3835 #[derive(Clone, Debug)]
3852 pub struct RotateServerCa(RequestBuilder<crate::model::SqlInstancesRotateServerCaRequest>);
3853
3854 impl RotateServerCa {
3855 pub(crate) fn new(
3856 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3857 ) -> Self {
3858 Self(RequestBuilder::new(stub))
3859 }
3860
3861 pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCaRequest>>(
3863 mut self,
3864 v: V,
3865 ) -> Self {
3866 self.0.request = v.into();
3867 self
3868 }
3869
3870 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3872 self.0.options = v.into();
3873 self
3874 }
3875
3876 pub async fn send(self) -> Result<crate::model::Operation> {
3878 (*self.0.stub)
3879 .rotate_server_ca(self.0.request, self.0.options)
3880 .await
3881 .map(crate::Response::into_body)
3882 }
3883
3884 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3886 self.0.request.instance = v.into();
3887 self
3888 }
3889
3890 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3892 self.0.request.project = v.into();
3893 self
3894 }
3895
3896 pub fn set_body<T>(mut self, v: T) -> Self
3898 where
3899 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
3900 {
3901 self.0.request.body = std::option::Option::Some(v.into());
3902 self
3903 }
3904
3905 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3907 where
3908 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
3909 {
3910 self.0.request.body = v.map(|x| x.into());
3911 self
3912 }
3913 }
3914
3915 #[doc(hidden)]
3916 impl crate::RequestBuilder for RotateServerCa {
3917 fn request_options(&mut self) -> &mut crate::RequestOptions {
3918 &mut self.0.options
3919 }
3920 }
3921
3922 #[derive(Clone, Debug)]
3939 pub struct RotateServerCertificate(
3940 RequestBuilder<crate::model::SqlInstancesRotateServerCertificateRequest>,
3941 );
3942
3943 impl RotateServerCertificate {
3944 pub(crate) fn new(
3945 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3946 ) -> Self {
3947 Self(RequestBuilder::new(stub))
3948 }
3949
3950 pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCertificateRequest>>(
3952 mut self,
3953 v: V,
3954 ) -> Self {
3955 self.0.request = v.into();
3956 self
3957 }
3958
3959 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3961 self.0.options = v.into();
3962 self
3963 }
3964
3965 pub async fn send(self) -> Result<crate::model::Operation> {
3967 (*self.0.stub)
3968 .rotate_server_certificate(self.0.request, self.0.options)
3969 .await
3970 .map(crate::Response::into_body)
3971 }
3972
3973 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3977 self.0.request.instance = v.into();
3978 self
3979 }
3980
3981 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3985 self.0.request.project = v.into();
3986 self
3987 }
3988
3989 pub fn set_body<T>(mut self, v: T) -> Self
3991 where
3992 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
3993 {
3994 self.0.request.body = std::option::Option::Some(v.into());
3995 self
3996 }
3997
3998 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4000 where
4001 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
4002 {
4003 self.0.request.body = v.map(|x| x.into());
4004 self
4005 }
4006 }
4007
4008 #[doc(hidden)]
4009 impl crate::RequestBuilder for RotateServerCertificate {
4010 fn request_options(&mut self) -> &mut crate::RequestOptions {
4011 &mut self.0.options
4012 }
4013 }
4014
4015 #[derive(Clone, Debug)]
4032 pub struct RotateEntraIdCertificate(
4033 RequestBuilder<crate::model::SqlInstancesRotateEntraIdCertificateRequest>,
4034 );
4035
4036 impl RotateEntraIdCertificate {
4037 pub(crate) fn new(
4038 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4039 ) -> Self {
4040 Self(RequestBuilder::new(stub))
4041 }
4042
4043 pub fn with_request<V: Into<crate::model::SqlInstancesRotateEntraIdCertificateRequest>>(
4045 mut self,
4046 v: V,
4047 ) -> Self {
4048 self.0.request = v.into();
4049 self
4050 }
4051
4052 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4054 self.0.options = v.into();
4055 self
4056 }
4057
4058 pub async fn send(self) -> Result<crate::model::Operation> {
4060 (*self.0.stub)
4061 .rotate_entra_id_certificate(self.0.request, self.0.options)
4062 .await
4063 .map(crate::Response::into_body)
4064 }
4065
4066 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4070 self.0.request.instance = v.into();
4071 self
4072 }
4073
4074 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4078 self.0.request.project = v.into();
4079 self
4080 }
4081
4082 pub fn set_body<T>(mut self, v: T) -> Self
4084 where
4085 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
4086 {
4087 self.0.request.body = std::option::Option::Some(v.into());
4088 self
4089 }
4090
4091 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4093 where
4094 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
4095 {
4096 self.0.request.body = v.map(|x| x.into());
4097 self
4098 }
4099 }
4100
4101 #[doc(hidden)]
4102 impl crate::RequestBuilder for RotateEntraIdCertificate {
4103 fn request_options(&mut self) -> &mut crate::RequestOptions {
4104 &mut self.0.options
4105 }
4106 }
4107
4108 #[derive(Clone, Debug)]
4125 pub struct StartReplica(RequestBuilder<crate::model::SqlInstancesStartReplicaRequest>);
4126
4127 impl StartReplica {
4128 pub(crate) fn new(
4129 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4130 ) -> Self {
4131 Self(RequestBuilder::new(stub))
4132 }
4133
4134 pub fn with_request<V: Into<crate::model::SqlInstancesStartReplicaRequest>>(
4136 mut self,
4137 v: V,
4138 ) -> Self {
4139 self.0.request = v.into();
4140 self
4141 }
4142
4143 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4145 self.0.options = v.into();
4146 self
4147 }
4148
4149 pub async fn send(self) -> Result<crate::model::Operation> {
4151 (*self.0.stub)
4152 .start_replica(self.0.request, self.0.options)
4153 .await
4154 .map(crate::Response::into_body)
4155 }
4156
4157 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4159 self.0.request.instance = v.into();
4160 self
4161 }
4162
4163 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4165 self.0.request.project = v.into();
4166 self
4167 }
4168 }
4169
4170 #[doc(hidden)]
4171 impl crate::RequestBuilder for StartReplica {
4172 fn request_options(&mut self) -> &mut crate::RequestOptions {
4173 &mut self.0.options
4174 }
4175 }
4176
4177 #[derive(Clone, Debug)]
4194 pub struct StopReplica(RequestBuilder<crate::model::SqlInstancesStopReplicaRequest>);
4195
4196 impl StopReplica {
4197 pub(crate) fn new(
4198 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4199 ) -> Self {
4200 Self(RequestBuilder::new(stub))
4201 }
4202
4203 pub fn with_request<V: Into<crate::model::SqlInstancesStopReplicaRequest>>(
4205 mut self,
4206 v: V,
4207 ) -> Self {
4208 self.0.request = v.into();
4209 self
4210 }
4211
4212 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4214 self.0.options = v.into();
4215 self
4216 }
4217
4218 pub async fn send(self) -> Result<crate::model::Operation> {
4220 (*self.0.stub)
4221 .stop_replica(self.0.request, self.0.options)
4222 .await
4223 .map(crate::Response::into_body)
4224 }
4225
4226 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4228 self.0.request.instance = v.into();
4229 self
4230 }
4231
4232 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4234 self.0.request.project = v.into();
4235 self
4236 }
4237 }
4238
4239 #[doc(hidden)]
4240 impl crate::RequestBuilder for StopReplica {
4241 fn request_options(&mut self) -> &mut crate::RequestOptions {
4242 &mut self.0.options
4243 }
4244 }
4245
4246 #[derive(Clone, Debug)]
4263 pub struct TruncateLog(RequestBuilder<crate::model::SqlInstancesTruncateLogRequest>);
4264
4265 impl TruncateLog {
4266 pub(crate) fn new(
4267 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4268 ) -> Self {
4269 Self(RequestBuilder::new(stub))
4270 }
4271
4272 pub fn with_request<V: Into<crate::model::SqlInstancesTruncateLogRequest>>(
4274 mut self,
4275 v: V,
4276 ) -> Self {
4277 self.0.request = v.into();
4278 self
4279 }
4280
4281 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4283 self.0.options = v.into();
4284 self
4285 }
4286
4287 pub async fn send(self) -> Result<crate::model::Operation> {
4289 (*self.0.stub)
4290 .truncate_log(self.0.request, self.0.options)
4291 .await
4292 .map(crate::Response::into_body)
4293 }
4294
4295 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4297 self.0.request.instance = v.into();
4298 self
4299 }
4300
4301 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4303 self.0.request.project = v.into();
4304 self
4305 }
4306
4307 pub fn set_body<T>(mut self, v: T) -> Self
4309 where
4310 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
4311 {
4312 self.0.request.body = std::option::Option::Some(v.into());
4313 self
4314 }
4315
4316 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4318 where
4319 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
4320 {
4321 self.0.request.body = v.map(|x| x.into());
4322 self
4323 }
4324 }
4325
4326 #[doc(hidden)]
4327 impl crate::RequestBuilder for TruncateLog {
4328 fn request_options(&mut self) -> &mut crate::RequestOptions {
4329 &mut self.0.options
4330 }
4331 }
4332
4333 #[derive(Clone, Debug)]
4350 pub struct Update(RequestBuilder<crate::model::SqlInstancesUpdateRequest>);
4351
4352 impl Update {
4353 pub(crate) fn new(
4354 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4355 ) -> Self {
4356 Self(RequestBuilder::new(stub))
4357 }
4358
4359 pub fn with_request<V: Into<crate::model::SqlInstancesUpdateRequest>>(
4361 mut self,
4362 v: V,
4363 ) -> Self {
4364 self.0.request = v.into();
4365 self
4366 }
4367
4368 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4370 self.0.options = v.into();
4371 self
4372 }
4373
4374 pub async fn send(self) -> Result<crate::model::Operation> {
4376 (*self.0.stub)
4377 .update(self.0.request, self.0.options)
4378 .await
4379 .map(crate::Response::into_body)
4380 }
4381
4382 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4384 self.0.request.instance = v.into();
4385 self
4386 }
4387
4388 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4390 self.0.request.project = v.into();
4391 self
4392 }
4393
4394 pub fn set_body<T>(mut self, v: T) -> Self
4396 where
4397 T: std::convert::Into<crate::model::DatabaseInstance>,
4398 {
4399 self.0.request.body = std::option::Option::Some(v.into());
4400 self
4401 }
4402
4403 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4405 where
4406 T: std::convert::Into<crate::model::DatabaseInstance>,
4407 {
4408 self.0.request.body = v.map(|x| x.into());
4409 self
4410 }
4411 }
4412
4413 #[doc(hidden)]
4414 impl crate::RequestBuilder for Update {
4415 fn request_options(&mut self) -> &mut crate::RequestOptions {
4416 &mut self.0.options
4417 }
4418 }
4419
4420 #[derive(Clone, Debug)]
4437 pub struct CreateEphemeral(
4438 RequestBuilder<crate::model::SqlInstancesCreateEphemeralCertRequest>,
4439 );
4440
4441 impl CreateEphemeral {
4442 pub(crate) fn new(
4443 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4444 ) -> Self {
4445 Self(RequestBuilder::new(stub))
4446 }
4447
4448 pub fn with_request<V: Into<crate::model::SqlInstancesCreateEphemeralCertRequest>>(
4450 mut self,
4451 v: V,
4452 ) -> Self {
4453 self.0.request = v.into();
4454 self
4455 }
4456
4457 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4459 self.0.options = v.into();
4460 self
4461 }
4462
4463 pub async fn send(self) -> Result<crate::model::SslCert> {
4465 (*self.0.stub)
4466 .create_ephemeral(self.0.request, self.0.options)
4467 .await
4468 .map(crate::Response::into_body)
4469 }
4470
4471 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4473 self.0.request.instance = v.into();
4474 self
4475 }
4476
4477 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4479 self.0.request.project = v.into();
4480 self
4481 }
4482
4483 pub fn set_body<T>(mut self, v: T) -> Self
4485 where
4486 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
4487 {
4488 self.0.request.body = std::option::Option::Some(v.into());
4489 self
4490 }
4491
4492 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4494 where
4495 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
4496 {
4497 self.0.request.body = v.map(|x| x.into());
4498 self
4499 }
4500 }
4501
4502 #[doc(hidden)]
4503 impl crate::RequestBuilder for CreateEphemeral {
4504 fn request_options(&mut self) -> &mut crate::RequestOptions {
4505 &mut self.0.options
4506 }
4507 }
4508
4509 #[derive(Clone, Debug)]
4526 pub struct RescheduleMaintenance(
4527 RequestBuilder<crate::model::SqlInstancesRescheduleMaintenanceRequest>,
4528 );
4529
4530 impl RescheduleMaintenance {
4531 pub(crate) fn new(
4532 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4533 ) -> Self {
4534 Self(RequestBuilder::new(stub))
4535 }
4536
4537 pub fn with_request<V: Into<crate::model::SqlInstancesRescheduleMaintenanceRequest>>(
4539 mut self,
4540 v: V,
4541 ) -> Self {
4542 self.0.request = v.into();
4543 self
4544 }
4545
4546 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4548 self.0.options = v.into();
4549 self
4550 }
4551
4552 pub async fn send(self) -> Result<crate::model::Operation> {
4554 (*self.0.stub)
4555 .reschedule_maintenance(self.0.request, self.0.options)
4556 .await
4557 .map(crate::Response::into_body)
4558 }
4559
4560 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4562 self.0.request.instance = v.into();
4563 self
4564 }
4565
4566 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4568 self.0.request.project = v.into();
4569 self
4570 }
4571
4572 pub fn set_body<T>(mut self, v: T) -> Self
4574 where
4575 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4576 {
4577 self.0.request.body = std::option::Option::Some(v.into());
4578 self
4579 }
4580
4581 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4583 where
4584 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4585 {
4586 self.0.request.body = v.map(|x| x.into());
4587 self
4588 }
4589 }
4590
4591 #[doc(hidden)]
4592 impl crate::RequestBuilder for RescheduleMaintenance {
4593 fn request_options(&mut self) -> &mut crate::RequestOptions {
4594 &mut self.0.options
4595 }
4596 }
4597
4598 #[derive(Clone, Debug)]
4615 pub struct VerifyExternalSyncSettings(
4616 RequestBuilder<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
4617 );
4618
4619 impl VerifyExternalSyncSettings {
4620 pub(crate) fn new(
4621 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4622 ) -> Self {
4623 Self(RequestBuilder::new(stub))
4624 }
4625
4626 pub fn with_request<
4628 V: Into<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
4629 >(
4630 mut self,
4631 v: V,
4632 ) -> Self {
4633 self.0.request = v.into();
4634 self
4635 }
4636
4637 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4639 self.0.options = v.into();
4640 self
4641 }
4642
4643 pub async fn send(
4645 self,
4646 ) -> Result<crate::model::SqlInstancesVerifyExternalSyncSettingsResponse> {
4647 (*self.0.stub)
4648 .verify_external_sync_settings(self.0.request, self.0.options)
4649 .await
4650 .map(crate::Response::into_body)
4651 }
4652
4653 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4655 self.0.request.instance = v.into();
4656 self
4657 }
4658
4659 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4661 self.0.request.project = v.into();
4662 self
4663 }
4664
4665 pub fn set_verify_connection_only<T: Into<bool>>(mut self, v: T) -> Self {
4667 self.0.request.verify_connection_only = v.into();
4668 self
4669 }
4670
4671 pub fn set_sync_mode<
4673 T: Into<
4674 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
4675 >,
4676 >(
4677 mut self,
4678 v: T,
4679 ) -> Self {
4680 self.0.request.sync_mode = v.into();
4681 self
4682 }
4683
4684 pub fn set_verify_replication_only<T: Into<bool>>(mut self, v: T) -> Self {
4686 self.0.request.verify_replication_only = v.into();
4687 self
4688 }
4689
4690 pub fn set_migration_type<
4692 T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
4693 >(
4694 mut self,
4695 v: T,
4696 ) -> Self {
4697 self.0.request.migration_type = v.into();
4698 self
4699 }
4700
4701 pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
4703 mut self,
4704 v: T,
4705 ) -> Self {
4706 self.0.request.sync_parallel_level = v.into();
4707 self
4708 }
4709
4710 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
4712 where
4713 T: std::iter::IntoIterator<Item = V>,
4714 V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
4715 {
4716 use std::iter::Iterator;
4717 self.0.request.selected_objects = v.into_iter().map(|i| i.into()).collect();
4718 self
4719 }
4720
4721 pub fn set_sync_config<
4726 T: Into<
4727 Option<
4728 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
4729 >,
4730 >,
4731 >(
4732 mut self,
4733 v: T,
4734 ) -> Self {
4735 self.0.request.sync_config = v.into();
4736 self
4737 }
4738
4739 pub fn set_mysql_sync_config<
4745 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
4746 >(
4747 mut self,
4748 v: T,
4749 ) -> Self {
4750 self.0.request = self.0.request.set_mysql_sync_config(v);
4751 self
4752 }
4753 }
4754
4755 #[doc(hidden)]
4756 impl crate::RequestBuilder for VerifyExternalSyncSettings {
4757 fn request_options(&mut self) -> &mut crate::RequestOptions {
4758 &mut self.0.options
4759 }
4760 }
4761
4762 #[derive(Clone, Debug)]
4779 pub struct StartExternalSync(
4780 RequestBuilder<crate::model::SqlInstancesStartExternalSyncRequest>,
4781 );
4782
4783 impl StartExternalSync {
4784 pub(crate) fn new(
4785 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4786 ) -> Self {
4787 Self(RequestBuilder::new(stub))
4788 }
4789
4790 pub fn with_request<V: Into<crate::model::SqlInstancesStartExternalSyncRequest>>(
4792 mut self,
4793 v: V,
4794 ) -> Self {
4795 self.0.request = v.into();
4796 self
4797 }
4798
4799 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4801 self.0.options = v.into();
4802 self
4803 }
4804
4805 pub async fn send(self) -> Result<crate::model::Operation> {
4807 (*self.0.stub)
4808 .start_external_sync(self.0.request, self.0.options)
4809 .await
4810 .map(crate::Response::into_body)
4811 }
4812
4813 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4815 self.0.request.instance = v.into();
4816 self
4817 }
4818
4819 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4821 self.0.request.project = v.into();
4822 self
4823 }
4824
4825 pub fn set_sync_mode<
4827 T: Into<
4828 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
4829 >,
4830 >(
4831 mut self,
4832 v: T,
4833 ) -> Self {
4834 self.0.request.sync_mode = v.into();
4835 self
4836 }
4837
4838 pub fn set_skip_verification<T: Into<bool>>(mut self, v: T) -> Self {
4840 self.0.request.skip_verification = v.into();
4841 self
4842 }
4843
4844 pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
4846 mut self,
4847 v: T,
4848 ) -> Self {
4849 self.0.request.sync_parallel_level = v.into();
4850 self
4851 }
4852
4853 pub fn set_migration_type<
4855 T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
4856 >(
4857 mut self,
4858 v: T,
4859 ) -> Self {
4860 self.0.request.migration_type = v.into();
4861 self
4862 }
4863
4864 pub fn set_replica_overwrite_enabled<T: Into<bool>>(mut self, v: T) -> Self {
4866 self.0.request.replica_overwrite_enabled = v.into();
4867 self
4868 }
4869
4870 pub fn set_sync_config<
4875 T: Into<Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>>,
4876 >(
4877 mut self,
4878 v: T,
4879 ) -> Self {
4880 self.0.request.sync_config = v.into();
4881 self
4882 }
4883
4884 pub fn set_mysql_sync_config<
4890 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
4891 >(
4892 mut self,
4893 v: T,
4894 ) -> Self {
4895 self.0.request = self.0.request.set_mysql_sync_config(v);
4896 self
4897 }
4898 }
4899
4900 #[doc(hidden)]
4901 impl crate::RequestBuilder for StartExternalSync {
4902 fn request_options(&mut self) -> &mut crate::RequestOptions {
4903 &mut self.0.options
4904 }
4905 }
4906
4907 #[derive(Clone, Debug)]
4924 pub struct PerformDiskShrink(
4925 RequestBuilder<crate::model::SqlInstancesPerformDiskShrinkRequest>,
4926 );
4927
4928 impl PerformDiskShrink {
4929 pub(crate) fn new(
4930 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4931 ) -> Self {
4932 Self(RequestBuilder::new(stub))
4933 }
4934
4935 pub fn with_request<V: Into<crate::model::SqlInstancesPerformDiskShrinkRequest>>(
4937 mut self,
4938 v: V,
4939 ) -> Self {
4940 self.0.request = v.into();
4941 self
4942 }
4943
4944 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4946 self.0.options = v.into();
4947 self
4948 }
4949
4950 pub async fn send(self) -> Result<crate::model::Operation> {
4952 (*self.0.stub)
4953 .perform_disk_shrink(self.0.request, self.0.options)
4954 .await
4955 .map(crate::Response::into_body)
4956 }
4957
4958 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4960 self.0.request.instance = v.into();
4961 self
4962 }
4963
4964 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4966 self.0.request.project = v.into();
4967 self
4968 }
4969
4970 pub fn set_body<T>(mut self, v: T) -> Self
4972 where
4973 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
4974 {
4975 self.0.request.body = std::option::Option::Some(v.into());
4976 self
4977 }
4978
4979 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4981 where
4982 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
4983 {
4984 self.0.request.body = v.map(|x| x.into());
4985 self
4986 }
4987 }
4988
4989 #[doc(hidden)]
4990 impl crate::RequestBuilder for PerformDiskShrink {
4991 fn request_options(&mut self) -> &mut crate::RequestOptions {
4992 &mut self.0.options
4993 }
4994 }
4995
4996 #[derive(Clone, Debug)]
5013 pub struct GetDiskShrinkConfig(
5014 RequestBuilder<crate::model::SqlInstancesGetDiskShrinkConfigRequest>,
5015 );
5016
5017 impl GetDiskShrinkConfig {
5018 pub(crate) fn new(
5019 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5020 ) -> Self {
5021 Self(RequestBuilder::new(stub))
5022 }
5023
5024 pub fn with_request<V: Into<crate::model::SqlInstancesGetDiskShrinkConfigRequest>>(
5026 mut self,
5027 v: V,
5028 ) -> Self {
5029 self.0.request = v.into();
5030 self
5031 }
5032
5033 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5035 self.0.options = v.into();
5036 self
5037 }
5038
5039 pub async fn send(self) -> Result<crate::model::SqlInstancesGetDiskShrinkConfigResponse> {
5041 (*self.0.stub)
5042 .get_disk_shrink_config(self.0.request, self.0.options)
5043 .await
5044 .map(crate::Response::into_body)
5045 }
5046
5047 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5049 self.0.request.instance = v.into();
5050 self
5051 }
5052
5053 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5055 self.0.request.project = v.into();
5056 self
5057 }
5058 }
5059
5060 #[doc(hidden)]
5061 impl crate::RequestBuilder for GetDiskShrinkConfig {
5062 fn request_options(&mut self) -> &mut crate::RequestOptions {
5063 &mut self.0.options
5064 }
5065 }
5066
5067 #[derive(Clone, Debug)]
5084 pub struct ResetReplicaSize(RequestBuilder<crate::model::SqlInstancesResetReplicaSizeRequest>);
5085
5086 impl ResetReplicaSize {
5087 pub(crate) fn new(
5088 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5089 ) -> Self {
5090 Self(RequestBuilder::new(stub))
5091 }
5092
5093 pub fn with_request<V: Into<crate::model::SqlInstancesResetReplicaSizeRequest>>(
5095 mut self,
5096 v: V,
5097 ) -> Self {
5098 self.0.request = v.into();
5099 self
5100 }
5101
5102 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5104 self.0.options = v.into();
5105 self
5106 }
5107
5108 pub async fn send(self) -> Result<crate::model::Operation> {
5110 (*self.0.stub)
5111 .reset_replica_size(self.0.request, self.0.options)
5112 .await
5113 .map(crate::Response::into_body)
5114 }
5115
5116 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5118 self.0.request.instance = v.into();
5119 self
5120 }
5121
5122 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5124 self.0.request.project = v.into();
5125 self
5126 }
5127 }
5128
5129 #[doc(hidden)]
5130 impl crate::RequestBuilder for ResetReplicaSize {
5131 fn request_options(&mut self) -> &mut crate::RequestOptions {
5132 &mut self.0.options
5133 }
5134 }
5135
5136 #[derive(Clone, Debug)]
5153 pub struct GetLatestRecoveryTime(
5154 RequestBuilder<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>,
5155 );
5156
5157 impl GetLatestRecoveryTime {
5158 pub(crate) fn new(
5159 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5160 ) -> Self {
5161 Self(RequestBuilder::new(stub))
5162 }
5163
5164 pub fn with_request<V: Into<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>>(
5166 mut self,
5167 v: V,
5168 ) -> Self {
5169 self.0.request = v.into();
5170 self
5171 }
5172
5173 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5175 self.0.options = v.into();
5176 self
5177 }
5178
5179 pub async fn send(self) -> Result<crate::model::SqlInstancesGetLatestRecoveryTimeResponse> {
5181 (*self.0.stub)
5182 .get_latest_recovery_time(self.0.request, self.0.options)
5183 .await
5184 .map(crate::Response::into_body)
5185 }
5186
5187 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5189 self.0.request.instance = v.into();
5190 self
5191 }
5192
5193 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5195 self.0.request.project = v.into();
5196 self
5197 }
5198
5199 pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
5201 where
5202 T: std::convert::Into<wkt::Timestamp>,
5203 {
5204 self.0.request.source_instance_deletion_time = std::option::Option::Some(v.into());
5205 self
5206 }
5207
5208 pub fn set_or_clear_source_instance_deletion_time<T>(
5210 mut self,
5211 v: std::option::Option<T>,
5212 ) -> Self
5213 where
5214 T: std::convert::Into<wkt::Timestamp>,
5215 {
5216 self.0.request.source_instance_deletion_time = v.map(|x| x.into());
5217 self
5218 }
5219 }
5220
5221 #[doc(hidden)]
5222 impl crate::RequestBuilder for GetLatestRecoveryTime {
5223 fn request_options(&mut self) -> &mut crate::RequestOptions {
5224 &mut self.0.options
5225 }
5226 }
5227
5228 #[derive(Clone, Debug)]
5245 pub struct ExecuteSql(RequestBuilder<crate::model::SqlInstancesExecuteSqlRequest>);
5246
5247 impl ExecuteSql {
5248 pub(crate) fn new(
5249 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5250 ) -> Self {
5251 Self(RequestBuilder::new(stub))
5252 }
5253
5254 pub fn with_request<V: Into<crate::model::SqlInstancesExecuteSqlRequest>>(
5256 mut self,
5257 v: V,
5258 ) -> Self {
5259 self.0.request = v.into();
5260 self
5261 }
5262
5263 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5265 self.0.options = v.into();
5266 self
5267 }
5268
5269 pub async fn send(self) -> Result<crate::model::SqlInstancesExecuteSqlResponse> {
5271 (*self.0.stub)
5272 .execute_sql(self.0.request, self.0.options)
5273 .await
5274 .map(crate::Response::into_body)
5275 }
5276
5277 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5281 self.0.request.instance = v.into();
5282 self
5283 }
5284
5285 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5289 self.0.request.project = v.into();
5290 self
5291 }
5292
5293 pub fn set_body<T>(mut self, v: T) -> Self
5295 where
5296 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
5297 {
5298 self.0.request.body = std::option::Option::Some(v.into());
5299 self
5300 }
5301
5302 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5304 where
5305 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
5306 {
5307 self.0.request.body = v.map(|x| x.into());
5308 self
5309 }
5310 }
5311
5312 #[doc(hidden)]
5313 impl crate::RequestBuilder for ExecuteSql {
5314 fn request_options(&mut self) -> &mut crate::RequestOptions {
5315 &mut self.0.options
5316 }
5317 }
5318
5319 #[derive(Clone, Debug)]
5336 pub struct AcquireSsrsLease(RequestBuilder<crate::model::SqlInstancesAcquireSsrsLeaseRequest>);
5337
5338 impl AcquireSsrsLease {
5339 pub(crate) fn new(
5340 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5341 ) -> Self {
5342 Self(RequestBuilder::new(stub))
5343 }
5344
5345 pub fn with_request<V: Into<crate::model::SqlInstancesAcquireSsrsLeaseRequest>>(
5347 mut self,
5348 v: V,
5349 ) -> Self {
5350 self.0.request = v.into();
5351 self
5352 }
5353
5354 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5356 self.0.options = v.into();
5357 self
5358 }
5359
5360 pub async fn send(self) -> Result<crate::model::SqlInstancesAcquireSsrsLeaseResponse> {
5362 (*self.0.stub)
5363 .acquire_ssrs_lease(self.0.request, self.0.options)
5364 .await
5365 .map(crate::Response::into_body)
5366 }
5367
5368 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5372 self.0.request.instance = v.into();
5373 self
5374 }
5375
5376 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5380 self.0.request.project = v.into();
5381 self
5382 }
5383
5384 pub fn set_body<T>(mut self, v: T) -> Self
5388 where
5389 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
5390 {
5391 self.0.request.body = std::option::Option::Some(v.into());
5392 self
5393 }
5394
5395 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5399 where
5400 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
5401 {
5402 self.0.request.body = v.map(|x| x.into());
5403 self
5404 }
5405 }
5406
5407 #[doc(hidden)]
5408 impl crate::RequestBuilder for AcquireSsrsLease {
5409 fn request_options(&mut self) -> &mut crate::RequestOptions {
5410 &mut self.0.options
5411 }
5412 }
5413
5414 #[derive(Clone, Debug)]
5431 pub struct ReleaseSsrsLease(RequestBuilder<crate::model::SqlInstancesReleaseSsrsLeaseRequest>);
5432
5433 impl ReleaseSsrsLease {
5434 pub(crate) fn new(
5435 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5436 ) -> Self {
5437 Self(RequestBuilder::new(stub))
5438 }
5439
5440 pub fn with_request<V: Into<crate::model::SqlInstancesReleaseSsrsLeaseRequest>>(
5442 mut self,
5443 v: V,
5444 ) -> Self {
5445 self.0.request = v.into();
5446 self
5447 }
5448
5449 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5451 self.0.options = v.into();
5452 self
5453 }
5454
5455 pub async fn send(self) -> Result<crate::model::SqlInstancesReleaseSsrsLeaseResponse> {
5457 (*self.0.stub)
5458 .release_ssrs_lease(self.0.request, self.0.options)
5459 .await
5460 .map(crate::Response::into_body)
5461 }
5462
5463 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5467 self.0.request.instance = v.into();
5468 self
5469 }
5470
5471 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5475 self.0.request.project = v.into();
5476 self
5477 }
5478 }
5479
5480 #[doc(hidden)]
5481 impl crate::RequestBuilder for ReleaseSsrsLease {
5482 fn request_options(&mut self) -> &mut crate::RequestOptions {
5483 &mut self.0.options
5484 }
5485 }
5486
5487 #[derive(Clone, Debug)]
5504 pub struct PreCheckMajorVersionUpgrade(
5505 RequestBuilder<crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest>,
5506 );
5507
5508 impl PreCheckMajorVersionUpgrade {
5509 pub(crate) fn new(
5510 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5511 ) -> Self {
5512 Self(RequestBuilder::new(stub))
5513 }
5514
5515 pub fn with_request<
5517 V: Into<crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest>,
5518 >(
5519 mut self,
5520 v: V,
5521 ) -> Self {
5522 self.0.request = v.into();
5523 self
5524 }
5525
5526 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5528 self.0.options = v.into();
5529 self
5530 }
5531
5532 pub async fn send(self) -> Result<crate::model::Operation> {
5534 (*self.0.stub)
5535 .pre_check_major_version_upgrade(self.0.request, self.0.options)
5536 .await
5537 .map(crate::Response::into_body)
5538 }
5539
5540 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5544 self.0.request.instance = v.into();
5545 self
5546 }
5547
5548 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5552 self.0.request.project = v.into();
5553 self
5554 }
5555
5556 pub fn set_body<T>(mut self, v: T) -> Self
5560 where
5561 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
5562 {
5563 self.0.request.body = std::option::Option::Some(v.into());
5564 self
5565 }
5566
5567 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5571 where
5572 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
5573 {
5574 self.0.request.body = v.map(|x| x.into());
5575 self
5576 }
5577 }
5578
5579 #[doc(hidden)]
5580 impl crate::RequestBuilder for PreCheckMajorVersionUpgrade {
5581 fn request_options(&mut self) -> &mut crate::RequestOptions {
5582 &mut self.0.options
5583 }
5584 }
5585
5586 #[derive(Clone, Debug)]
5603 pub struct PointInTimeRestore(
5604 RequestBuilder<crate::model::SqlInstancesPointInTimeRestoreRequest>,
5605 );
5606
5607 impl PointInTimeRestore {
5608 pub(crate) fn new(
5609 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5610 ) -> Self {
5611 Self(RequestBuilder::new(stub))
5612 }
5613
5614 pub fn with_request<V: Into<crate::model::SqlInstancesPointInTimeRestoreRequest>>(
5616 mut self,
5617 v: V,
5618 ) -> Self {
5619 self.0.request = v.into();
5620 self
5621 }
5622
5623 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5625 self.0.options = v.into();
5626 self
5627 }
5628
5629 pub async fn send(self) -> Result<crate::model::Operation> {
5631 (*self.0.stub)
5632 .point_in_time_restore(self.0.request, self.0.options)
5633 .await
5634 .map(crate::Response::into_body)
5635 }
5636
5637 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5641 self.0.request.parent = v.into();
5642 self
5643 }
5644
5645 pub fn set_context<T>(mut self, v: T) -> Self
5649 where
5650 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
5651 {
5652 self.0.request.context = std::option::Option::Some(v.into());
5653 self
5654 }
5655
5656 pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
5660 where
5661 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
5662 {
5663 self.0.request.context = v.map(|x| x.into());
5664 self
5665 }
5666 }
5667
5668 #[doc(hidden)]
5669 impl crate::RequestBuilder for PointInTimeRestore {
5670 fn request_options(&mut self) -> &mut crate::RequestOptions {
5671 &mut self.0.options
5672 }
5673 }
5674}
5675
5676pub mod sql_operations_service {
5678 use crate::Result;
5679
5680 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5694
5695 pub(crate) mod client {
5696 use super::super::super::client::SqlOperationsService;
5697 pub struct Factory;
5698 impl crate::ClientFactory for Factory {
5699 type Client = SqlOperationsService;
5700 type Credentials = gaxi::options::Credentials;
5701 async fn build(
5702 self,
5703 config: gaxi::options::ClientConfig,
5704 ) -> crate::ClientBuilderResult<Self::Client> {
5705 Self::Client::new(config).await
5706 }
5707 }
5708 }
5709
5710 #[derive(Clone, Debug)]
5712 pub(crate) struct RequestBuilder<R: std::default::Default> {
5713 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5714 request: R,
5715 options: crate::RequestOptions,
5716 }
5717
5718 impl<R> RequestBuilder<R>
5719 where
5720 R: std::default::Default,
5721 {
5722 pub(crate) fn new(
5723 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5724 ) -> Self {
5725 Self {
5726 stub,
5727 request: R::default(),
5728 options: crate::RequestOptions::default(),
5729 }
5730 }
5731 }
5732
5733 #[derive(Clone, Debug)]
5750 pub struct Get(RequestBuilder<crate::model::SqlOperationsGetRequest>);
5751
5752 impl Get {
5753 pub(crate) fn new(
5754 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5755 ) -> Self {
5756 Self(RequestBuilder::new(stub))
5757 }
5758
5759 pub fn with_request<V: Into<crate::model::SqlOperationsGetRequest>>(
5761 mut self,
5762 v: V,
5763 ) -> Self {
5764 self.0.request = v.into();
5765 self
5766 }
5767
5768 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5770 self.0.options = v.into();
5771 self
5772 }
5773
5774 pub async fn send(self) -> Result<crate::model::Operation> {
5776 (*self.0.stub)
5777 .get(self.0.request, self.0.options)
5778 .await
5779 .map(crate::Response::into_body)
5780 }
5781
5782 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
5786 self.0.request.operation = v.into();
5787 self
5788 }
5789
5790 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5794 self.0.request.project = v.into();
5795 self
5796 }
5797 }
5798
5799 #[doc(hidden)]
5800 impl crate::RequestBuilder for Get {
5801 fn request_options(&mut self) -> &mut crate::RequestOptions {
5802 &mut self.0.options
5803 }
5804 }
5805
5806 #[derive(Clone, Debug)]
5827 pub struct List(RequestBuilder<crate::model::SqlOperationsListRequest>);
5828
5829 impl List {
5830 pub(crate) fn new(
5831 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5832 ) -> Self {
5833 Self(RequestBuilder::new(stub))
5834 }
5835
5836 pub fn with_request<V: Into<crate::model::SqlOperationsListRequest>>(
5838 mut self,
5839 v: V,
5840 ) -> Self {
5841 self.0.request = v.into();
5842 self
5843 }
5844
5845 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5847 self.0.options = v.into();
5848 self
5849 }
5850
5851 pub async fn send(self) -> Result<crate::model::OperationsListResponse> {
5853 (*self.0.stub)
5854 .list(self.0.request, self.0.options)
5855 .await
5856 .map(crate::Response::into_body)
5857 }
5858
5859 pub fn by_page(
5861 self,
5862 ) -> impl google_cloud_gax::paginator::Paginator<
5863 crate::model::OperationsListResponse,
5864 crate::Error,
5865 > {
5866 use std::clone::Clone;
5867 let token = self.0.request.page_token.clone();
5868 let execute = move |token: String| {
5869 let mut builder = self.clone();
5870 builder.0.request = builder.0.request.set_page_token(token);
5871 builder.send()
5872 };
5873 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5874 }
5875
5876 pub fn by_item(
5878 self,
5879 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5880 crate::model::OperationsListResponse,
5881 crate::Error,
5882 > {
5883 use google_cloud_gax::paginator::Paginator;
5884 self.by_page().items()
5885 }
5886
5887 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5889 self.0.request.instance = v.into();
5890 self
5891 }
5892
5893 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
5895 self.0.request.max_results = v.into();
5896 self
5897 }
5898
5899 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5901 self.0.request.page_token = v.into();
5902 self
5903 }
5904
5905 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5907 self.0.request.project = v.into();
5908 self
5909 }
5910 }
5911
5912 #[doc(hidden)]
5913 impl crate::RequestBuilder for List {
5914 fn request_options(&mut self) -> &mut crate::RequestOptions {
5915 &mut self.0.options
5916 }
5917 }
5918
5919 #[derive(Clone, Debug)]
5936 pub struct Cancel(RequestBuilder<crate::model::SqlOperationsCancelRequest>);
5937
5938 impl Cancel {
5939 pub(crate) fn new(
5940 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5941 ) -> Self {
5942 Self(RequestBuilder::new(stub))
5943 }
5944
5945 pub fn with_request<V: Into<crate::model::SqlOperationsCancelRequest>>(
5947 mut self,
5948 v: V,
5949 ) -> Self {
5950 self.0.request = v.into();
5951 self
5952 }
5953
5954 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5956 self.0.options = v.into();
5957 self
5958 }
5959
5960 pub async fn send(self) -> Result<()> {
5962 (*self.0.stub)
5963 .cancel(self.0.request, self.0.options)
5964 .await
5965 .map(crate::Response::into_body)
5966 }
5967
5968 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
5970 self.0.request.operation = v.into();
5971 self
5972 }
5973
5974 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5976 self.0.request.project = v.into();
5977 self
5978 }
5979 }
5980
5981 #[doc(hidden)]
5982 impl crate::RequestBuilder for Cancel {
5983 fn request_options(&mut self) -> &mut crate::RequestOptions {
5984 &mut self.0.options
5985 }
5986 }
5987}
5988
5989pub mod sql_ssl_certs_service {
5991 use crate::Result;
5992
5993 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6007
6008 pub(crate) mod client {
6009 use super::super::super::client::SqlSslCertsService;
6010 pub struct Factory;
6011 impl crate::ClientFactory for Factory {
6012 type Client = SqlSslCertsService;
6013 type Credentials = gaxi::options::Credentials;
6014 async fn build(
6015 self,
6016 config: gaxi::options::ClientConfig,
6017 ) -> crate::ClientBuilderResult<Self::Client> {
6018 Self::Client::new(config).await
6019 }
6020 }
6021 }
6022
6023 #[derive(Clone, Debug)]
6025 pub(crate) struct RequestBuilder<R: std::default::Default> {
6026 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6027 request: R,
6028 options: crate::RequestOptions,
6029 }
6030
6031 impl<R> RequestBuilder<R>
6032 where
6033 R: std::default::Default,
6034 {
6035 pub(crate) fn new(
6036 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6037 ) -> Self {
6038 Self {
6039 stub,
6040 request: R::default(),
6041 options: crate::RequestOptions::default(),
6042 }
6043 }
6044 }
6045
6046 #[derive(Clone, Debug)]
6063 pub struct Delete(RequestBuilder<crate::model::SqlSslCertsDeleteRequest>);
6064
6065 impl Delete {
6066 pub(crate) fn new(
6067 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6068 ) -> Self {
6069 Self(RequestBuilder::new(stub))
6070 }
6071
6072 pub fn with_request<V: Into<crate::model::SqlSslCertsDeleteRequest>>(
6074 mut self,
6075 v: V,
6076 ) -> Self {
6077 self.0.request = v.into();
6078 self
6079 }
6080
6081 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6083 self.0.options = v.into();
6084 self
6085 }
6086
6087 pub async fn send(self) -> Result<crate::model::Operation> {
6089 (*self.0.stub)
6090 .delete(self.0.request, self.0.options)
6091 .await
6092 .map(crate::Response::into_body)
6093 }
6094
6095 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6097 self.0.request.instance = v.into();
6098 self
6099 }
6100
6101 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6103 self.0.request.project = v.into();
6104 self
6105 }
6106
6107 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6109 self.0.request.sha1_fingerprint = v.into();
6110 self
6111 }
6112 }
6113
6114 #[doc(hidden)]
6115 impl crate::RequestBuilder for Delete {
6116 fn request_options(&mut self) -> &mut crate::RequestOptions {
6117 &mut self.0.options
6118 }
6119 }
6120
6121 #[derive(Clone, Debug)]
6138 pub struct Get(RequestBuilder<crate::model::SqlSslCertsGetRequest>);
6139
6140 impl Get {
6141 pub(crate) fn new(
6142 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6143 ) -> Self {
6144 Self(RequestBuilder::new(stub))
6145 }
6146
6147 pub fn with_request<V: Into<crate::model::SqlSslCertsGetRequest>>(mut self, v: V) -> Self {
6149 self.0.request = v.into();
6150 self
6151 }
6152
6153 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6155 self.0.options = v.into();
6156 self
6157 }
6158
6159 pub async fn send(self) -> Result<crate::model::SslCert> {
6161 (*self.0.stub)
6162 .get(self.0.request, self.0.options)
6163 .await
6164 .map(crate::Response::into_body)
6165 }
6166
6167 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6169 self.0.request.instance = v.into();
6170 self
6171 }
6172
6173 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6175 self.0.request.project = v.into();
6176 self
6177 }
6178
6179 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6181 self.0.request.sha1_fingerprint = v.into();
6182 self
6183 }
6184 }
6185
6186 #[doc(hidden)]
6187 impl crate::RequestBuilder for Get {
6188 fn request_options(&mut self) -> &mut crate::RequestOptions {
6189 &mut self.0.options
6190 }
6191 }
6192
6193 #[derive(Clone, Debug)]
6210 pub struct Insert(RequestBuilder<crate::model::SqlSslCertsInsertRequest>);
6211
6212 impl Insert {
6213 pub(crate) fn new(
6214 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6215 ) -> Self {
6216 Self(RequestBuilder::new(stub))
6217 }
6218
6219 pub fn with_request<V: Into<crate::model::SqlSslCertsInsertRequest>>(
6221 mut self,
6222 v: V,
6223 ) -> Self {
6224 self.0.request = v.into();
6225 self
6226 }
6227
6228 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6230 self.0.options = v.into();
6231 self
6232 }
6233
6234 pub async fn send(self) -> Result<crate::model::SslCertsInsertResponse> {
6236 (*self.0.stub)
6237 .insert(self.0.request, self.0.options)
6238 .await
6239 .map(crate::Response::into_body)
6240 }
6241
6242 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6244 self.0.request.instance = v.into();
6245 self
6246 }
6247
6248 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6250 self.0.request.project = v.into();
6251 self
6252 }
6253
6254 pub fn set_body<T>(mut self, v: T) -> Self
6256 where
6257 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6258 {
6259 self.0.request.body = std::option::Option::Some(v.into());
6260 self
6261 }
6262
6263 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6265 where
6266 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6267 {
6268 self.0.request.body = v.map(|x| x.into());
6269 self
6270 }
6271 }
6272
6273 #[doc(hidden)]
6274 impl crate::RequestBuilder for Insert {
6275 fn request_options(&mut self) -> &mut crate::RequestOptions {
6276 &mut self.0.options
6277 }
6278 }
6279
6280 #[derive(Clone, Debug)]
6297 pub struct List(RequestBuilder<crate::model::SqlSslCertsListRequest>);
6298
6299 impl List {
6300 pub(crate) fn new(
6301 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6302 ) -> Self {
6303 Self(RequestBuilder::new(stub))
6304 }
6305
6306 pub fn with_request<V: Into<crate::model::SqlSslCertsListRequest>>(mut self, v: V) -> Self {
6308 self.0.request = v.into();
6309 self
6310 }
6311
6312 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6314 self.0.options = v.into();
6315 self
6316 }
6317
6318 pub async fn send(self) -> Result<crate::model::SslCertsListResponse> {
6320 (*self.0.stub)
6321 .list(self.0.request, self.0.options)
6322 .await
6323 .map(crate::Response::into_body)
6324 }
6325
6326 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6328 self.0.request.instance = v.into();
6329 self
6330 }
6331
6332 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6334 self.0.request.project = v.into();
6335 self
6336 }
6337 }
6338
6339 #[doc(hidden)]
6340 impl crate::RequestBuilder for List {
6341 fn request_options(&mut self) -> &mut crate::RequestOptions {
6342 &mut self.0.options
6343 }
6344 }
6345}
6346
6347pub mod sql_tiers_service {
6349 use crate::Result;
6350
6351 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6365
6366 pub(crate) mod client {
6367 use super::super::super::client::SqlTiersService;
6368 pub struct Factory;
6369 impl crate::ClientFactory for Factory {
6370 type Client = SqlTiersService;
6371 type Credentials = gaxi::options::Credentials;
6372 async fn build(
6373 self,
6374 config: gaxi::options::ClientConfig,
6375 ) -> crate::ClientBuilderResult<Self::Client> {
6376 Self::Client::new(config).await
6377 }
6378 }
6379 }
6380
6381 #[derive(Clone, Debug)]
6383 pub(crate) struct RequestBuilder<R: std::default::Default> {
6384 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6385 request: R,
6386 options: crate::RequestOptions,
6387 }
6388
6389 impl<R> RequestBuilder<R>
6390 where
6391 R: std::default::Default,
6392 {
6393 pub(crate) fn new(
6394 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6395 ) -> Self {
6396 Self {
6397 stub,
6398 request: R::default(),
6399 options: crate::RequestOptions::default(),
6400 }
6401 }
6402 }
6403
6404 #[derive(Clone, Debug)]
6421 pub struct List(RequestBuilder<crate::model::SqlTiersListRequest>);
6422
6423 impl List {
6424 pub(crate) fn new(
6425 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6426 ) -> Self {
6427 Self(RequestBuilder::new(stub))
6428 }
6429
6430 pub fn with_request<V: Into<crate::model::SqlTiersListRequest>>(mut self, v: V) -> Self {
6432 self.0.request = v.into();
6433 self
6434 }
6435
6436 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6438 self.0.options = v.into();
6439 self
6440 }
6441
6442 pub async fn send(self) -> Result<crate::model::TiersListResponse> {
6444 (*self.0.stub)
6445 .list(self.0.request, self.0.options)
6446 .await
6447 .map(crate::Response::into_body)
6448 }
6449
6450 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6452 self.0.request.project = v.into();
6453 self
6454 }
6455 }
6456
6457 #[doc(hidden)]
6458 impl crate::RequestBuilder for List {
6459 fn request_options(&mut self) -> &mut crate::RequestOptions {
6460 &mut self.0.options
6461 }
6462 }
6463}
6464
6465pub mod sql_users_service {
6467 use crate::Result;
6468
6469 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6483
6484 pub(crate) mod client {
6485 use super::super::super::client::SqlUsersService;
6486 pub struct Factory;
6487 impl crate::ClientFactory for Factory {
6488 type Client = SqlUsersService;
6489 type Credentials = gaxi::options::Credentials;
6490 async fn build(
6491 self,
6492 config: gaxi::options::ClientConfig,
6493 ) -> crate::ClientBuilderResult<Self::Client> {
6494 Self::Client::new(config).await
6495 }
6496 }
6497 }
6498
6499 #[derive(Clone, Debug)]
6501 pub(crate) struct RequestBuilder<R: std::default::Default> {
6502 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6503 request: R,
6504 options: crate::RequestOptions,
6505 }
6506
6507 impl<R> RequestBuilder<R>
6508 where
6509 R: std::default::Default,
6510 {
6511 pub(crate) fn new(
6512 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6513 ) -> Self {
6514 Self {
6515 stub,
6516 request: R::default(),
6517 options: crate::RequestOptions::default(),
6518 }
6519 }
6520 }
6521
6522 #[derive(Clone, Debug)]
6539 pub struct Delete(RequestBuilder<crate::model::SqlUsersDeleteRequest>);
6540
6541 impl Delete {
6542 pub(crate) fn new(
6543 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6544 ) -> Self {
6545 Self(RequestBuilder::new(stub))
6546 }
6547
6548 pub fn with_request<V: Into<crate::model::SqlUsersDeleteRequest>>(mut self, v: V) -> Self {
6550 self.0.request = v.into();
6551 self
6552 }
6553
6554 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6556 self.0.options = v.into();
6557 self
6558 }
6559
6560 pub async fn send(self) -> Result<crate::model::Operation> {
6562 (*self.0.stub)
6563 .delete(self.0.request, self.0.options)
6564 .await
6565 .map(crate::Response::into_body)
6566 }
6567
6568 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6570 self.0.request.host = v.into();
6571 self
6572 }
6573
6574 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6576 self.0.request.instance = v.into();
6577 self
6578 }
6579
6580 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6582 self.0.request.name = v.into();
6583 self
6584 }
6585
6586 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6588 self.0.request.project = v.into();
6589 self
6590 }
6591 }
6592
6593 #[doc(hidden)]
6594 impl crate::RequestBuilder for Delete {
6595 fn request_options(&mut self) -> &mut crate::RequestOptions {
6596 &mut self.0.options
6597 }
6598 }
6599
6600 #[derive(Clone, Debug)]
6617 pub struct Get(RequestBuilder<crate::model::SqlUsersGetRequest>);
6618
6619 impl Get {
6620 pub(crate) fn new(
6621 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6622 ) -> Self {
6623 Self(RequestBuilder::new(stub))
6624 }
6625
6626 pub fn with_request<V: Into<crate::model::SqlUsersGetRequest>>(mut self, v: V) -> Self {
6628 self.0.request = v.into();
6629 self
6630 }
6631
6632 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6634 self.0.options = v.into();
6635 self
6636 }
6637
6638 pub async fn send(self) -> Result<crate::model::User> {
6640 (*self.0.stub)
6641 .get(self.0.request, self.0.options)
6642 .await
6643 .map(crate::Response::into_body)
6644 }
6645
6646 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6648 self.0.request.instance = v.into();
6649 self
6650 }
6651
6652 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6654 self.0.request.name = v.into();
6655 self
6656 }
6657
6658 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6660 self.0.request.project = v.into();
6661 self
6662 }
6663
6664 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6666 self.0.request.host = v.into();
6667 self
6668 }
6669 }
6670
6671 #[doc(hidden)]
6672 impl crate::RequestBuilder for Get {
6673 fn request_options(&mut self) -> &mut crate::RequestOptions {
6674 &mut self.0.options
6675 }
6676 }
6677
6678 #[derive(Clone, Debug)]
6695 pub struct Insert(RequestBuilder<crate::model::SqlUsersInsertRequest>);
6696
6697 impl Insert {
6698 pub(crate) fn new(
6699 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6700 ) -> Self {
6701 Self(RequestBuilder::new(stub))
6702 }
6703
6704 pub fn with_request<V: Into<crate::model::SqlUsersInsertRequest>>(mut self, v: V) -> Self {
6706 self.0.request = v.into();
6707 self
6708 }
6709
6710 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6712 self.0.options = v.into();
6713 self
6714 }
6715
6716 pub async fn send(self) -> Result<crate::model::Operation> {
6718 (*self.0.stub)
6719 .insert(self.0.request, self.0.options)
6720 .await
6721 .map(crate::Response::into_body)
6722 }
6723
6724 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6726 self.0.request.instance = v.into();
6727 self
6728 }
6729
6730 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6732 self.0.request.project = v.into();
6733 self
6734 }
6735
6736 pub fn set_body<T>(mut self, v: T) -> Self
6738 where
6739 T: std::convert::Into<crate::model::User>,
6740 {
6741 self.0.request.body = std::option::Option::Some(v.into());
6742 self
6743 }
6744
6745 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6747 where
6748 T: std::convert::Into<crate::model::User>,
6749 {
6750 self.0.request.body = v.map(|x| x.into());
6751 self
6752 }
6753 }
6754
6755 #[doc(hidden)]
6756 impl crate::RequestBuilder for Insert {
6757 fn request_options(&mut self) -> &mut crate::RequestOptions {
6758 &mut self.0.options
6759 }
6760 }
6761
6762 #[derive(Clone, Debug)]
6779 pub struct List(RequestBuilder<crate::model::SqlUsersListRequest>);
6780
6781 impl List {
6782 pub(crate) fn new(
6783 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6784 ) -> Self {
6785 Self(RequestBuilder::new(stub))
6786 }
6787
6788 pub fn with_request<V: Into<crate::model::SqlUsersListRequest>>(mut self, v: V) -> Self {
6790 self.0.request = v.into();
6791 self
6792 }
6793
6794 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6796 self.0.options = v.into();
6797 self
6798 }
6799
6800 pub async fn send(self) -> Result<crate::model::UsersListResponse> {
6802 (*self.0.stub)
6803 .list(self.0.request, self.0.options)
6804 .await
6805 .map(crate::Response::into_body)
6806 }
6807
6808 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6810 self.0.request.instance = v.into();
6811 self
6812 }
6813
6814 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6816 self.0.request.project = v.into();
6817 self
6818 }
6819 }
6820
6821 #[doc(hidden)]
6822 impl crate::RequestBuilder for List {
6823 fn request_options(&mut self) -> &mut crate::RequestOptions {
6824 &mut self.0.options
6825 }
6826 }
6827
6828 #[derive(Clone, Debug)]
6845 pub struct Update(RequestBuilder<crate::model::SqlUsersUpdateRequest>);
6846
6847 impl Update {
6848 pub(crate) fn new(
6849 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6850 ) -> Self {
6851 Self(RequestBuilder::new(stub))
6852 }
6853
6854 pub fn with_request<V: Into<crate::model::SqlUsersUpdateRequest>>(mut self, v: V) -> Self {
6856 self.0.request = v.into();
6857 self
6858 }
6859
6860 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6862 self.0.options = v.into();
6863 self
6864 }
6865
6866 pub async fn send(self) -> Result<crate::model::Operation> {
6868 (*self.0.stub)
6869 .update(self.0.request, self.0.options)
6870 .await
6871 .map(crate::Response::into_body)
6872 }
6873
6874 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6876 self.0.request.host = v.into();
6877 self
6878 }
6879
6880 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6882 self.0.request.instance = v.into();
6883 self
6884 }
6885
6886 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6888 self.0.request.name = v.into();
6889 self
6890 }
6891
6892 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6894 self.0.request.project = v.into();
6895 self
6896 }
6897
6898 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
6900 where
6901 T: std::iter::IntoIterator<Item = V>,
6902 V: std::convert::Into<std::string::String>,
6903 {
6904 use std::iter::Iterator;
6905 self.0.request.database_roles = v.into_iter().map(|i| i.into()).collect();
6906 self
6907 }
6908
6909 pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
6911 where
6912 T: std::convert::Into<bool>,
6913 {
6914 self.0.request.revoke_existing_roles = std::option::Option::Some(v.into());
6915 self
6916 }
6917
6918 pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
6920 where
6921 T: std::convert::Into<bool>,
6922 {
6923 self.0.request.revoke_existing_roles = v.map(|x| x.into());
6924 self
6925 }
6926
6927 pub fn set_body<T>(mut self, v: T) -> Self
6929 where
6930 T: std::convert::Into<crate::model::User>,
6931 {
6932 self.0.request.body = std::option::Option::Some(v.into());
6933 self
6934 }
6935
6936 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6938 where
6939 T: std::convert::Into<crate::model::User>,
6940 {
6941 self.0.request.body = v.map(|x| x.into());
6942 self
6943 }
6944 }
6945
6946 #[doc(hidden)]
6947 impl crate::RequestBuilder for Update {
6948 fn request_options(&mut self) -> &mut crate::RequestOptions {
6949 &mut self.0.options
6950 }
6951 }
6952}