1pub mod sql_backup_runs_service {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::SqlBackupRunsService;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = SqlBackupRunsService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
91 pub struct Delete(RequestBuilder<crate::model::SqlBackupRunsDeleteRequest>);
92
93 impl Delete {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::SqlBackupRunsDeleteRequest>>(
102 mut self,
103 v: V,
104 ) -> Self {
105 self.0.request = v.into();
106 self
107 }
108
109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 pub async fn send(self) -> Result<crate::model::Operation> {
117 (*self.0.stub)
118 .delete(self.0.request, self.0.options)
119 .await
120 .map(crate::Response::into_body)
121 }
122
123 pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
125 self.0.request.id = v.into();
126 self
127 }
128
129 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
131 self.0.request.instance = v.into();
132 self
133 }
134
135 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
137 self.0.request.project = v.into();
138 self
139 }
140 }
141
142 #[doc(hidden)]
143 impl crate::RequestBuilder for Delete {
144 fn request_options(&mut self) -> &mut crate::RequestOptions {
145 &mut self.0.options
146 }
147 }
148
149 #[derive(Clone, Debug)]
166 pub struct Get(RequestBuilder<crate::model::SqlBackupRunsGetRequest>);
167
168 impl Get {
169 pub(crate) fn new(
170 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
171 ) -> Self {
172 Self(RequestBuilder::new(stub))
173 }
174
175 pub fn with_request<V: Into<crate::model::SqlBackupRunsGetRequest>>(
177 mut self,
178 v: V,
179 ) -> Self {
180 self.0.request = v.into();
181 self
182 }
183
184 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
186 self.0.options = v.into();
187 self
188 }
189
190 pub async fn send(self) -> Result<crate::model::BackupRun> {
192 (*self.0.stub)
193 .get(self.0.request, self.0.options)
194 .await
195 .map(crate::Response::into_body)
196 }
197
198 pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
200 self.0.request.id = v.into();
201 self
202 }
203
204 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
206 self.0.request.instance = v.into();
207 self
208 }
209
210 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
212 self.0.request.project = v.into();
213 self
214 }
215 }
216
217 #[doc(hidden)]
218 impl crate::RequestBuilder for Get {
219 fn request_options(&mut self) -> &mut crate::RequestOptions {
220 &mut self.0.options
221 }
222 }
223
224 #[derive(Clone, Debug)]
241 pub struct Insert(RequestBuilder<crate::model::SqlBackupRunsInsertRequest>);
242
243 impl Insert {
244 pub(crate) fn new(
245 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
246 ) -> Self {
247 Self(RequestBuilder::new(stub))
248 }
249
250 pub fn with_request<V: Into<crate::model::SqlBackupRunsInsertRequest>>(
252 mut self,
253 v: V,
254 ) -> Self {
255 self.0.request = v.into();
256 self
257 }
258
259 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
261 self.0.options = v.into();
262 self
263 }
264
265 pub async fn send(self) -> Result<crate::model::Operation> {
267 (*self.0.stub)
268 .insert(self.0.request, self.0.options)
269 .await
270 .map(crate::Response::into_body)
271 }
272
273 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
275 self.0.request.instance = v.into();
276 self
277 }
278
279 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
281 self.0.request.project = v.into();
282 self
283 }
284
285 pub fn set_body<T>(mut self, v: T) -> Self
287 where
288 T: std::convert::Into<crate::model::BackupRun>,
289 {
290 self.0.request.body = std::option::Option::Some(v.into());
291 self
292 }
293
294 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
296 where
297 T: std::convert::Into<crate::model::BackupRun>,
298 {
299 self.0.request.body = v.map(|x| x.into());
300 self
301 }
302 }
303
304 #[doc(hidden)]
305 impl crate::RequestBuilder for Insert {
306 fn request_options(&mut self) -> &mut crate::RequestOptions {
307 &mut self.0.options
308 }
309 }
310
311 #[derive(Clone, Debug)]
332 pub struct List(RequestBuilder<crate::model::SqlBackupRunsListRequest>);
333
334 impl List {
335 pub(crate) fn new(
336 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
337 ) -> Self {
338 Self(RequestBuilder::new(stub))
339 }
340
341 pub fn with_request<V: Into<crate::model::SqlBackupRunsListRequest>>(
343 mut self,
344 v: V,
345 ) -> Self {
346 self.0.request = v.into();
347 self
348 }
349
350 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
352 self.0.options = v.into();
353 self
354 }
355
356 pub async fn send(self) -> Result<crate::model::BackupRunsListResponse> {
358 (*self.0.stub)
359 .list(self.0.request, self.0.options)
360 .await
361 .map(crate::Response::into_body)
362 }
363
364 pub fn by_page(
366 self,
367 ) -> impl google_cloud_gax::paginator::Paginator<
368 crate::model::BackupRunsListResponse,
369 crate::Error,
370 > {
371 use std::clone::Clone;
372 let token = self.0.request.page_token.clone();
373 let execute = move |token: String| {
374 let mut builder = self.clone();
375 builder.0.request = builder.0.request.set_page_token(token);
376 builder.send()
377 };
378 google_cloud_gax::paginator::internal::new_paginator(token, execute)
379 }
380
381 pub fn by_item(
383 self,
384 ) -> impl google_cloud_gax::paginator::ItemPaginator<
385 crate::model::BackupRunsListResponse,
386 crate::Error,
387 > {
388 use google_cloud_gax::paginator::Paginator;
389 self.by_page().items()
390 }
391
392 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
394 self.0.request.instance = v.into();
395 self
396 }
397
398 pub fn set_max_results<T: Into<i32>>(mut self, v: T) -> Self {
400 self.0.request.max_results = v.into();
401 self
402 }
403
404 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
406 self.0.request.page_token = v.into();
407 self
408 }
409
410 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
412 self.0.request.project = v.into();
413 self
414 }
415 }
416
417 #[doc(hidden)]
418 impl crate::RequestBuilder for List {
419 fn request_options(&mut self) -> &mut crate::RequestOptions {
420 &mut self.0.options
421 }
422 }
423}
424
425pub mod sql_backups_service {
427 use crate::Result;
428
429 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
443
444 pub(crate) mod client {
445 use super::super::super::client::SqlBackupsService;
446 pub struct Factory;
447 impl crate::ClientFactory for Factory {
448 type Client = SqlBackupsService;
449 type Credentials = gaxi::options::Credentials;
450 async fn build(
451 self,
452 config: gaxi::options::ClientConfig,
453 ) -> crate::ClientBuilderResult<Self::Client> {
454 Self::Client::new(config).await
455 }
456 }
457 }
458
459 #[derive(Clone, Debug)]
461 pub(crate) struct RequestBuilder<R: std::default::Default> {
462 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
463 request: R,
464 options: crate::RequestOptions,
465 }
466
467 impl<R> RequestBuilder<R>
468 where
469 R: std::default::Default,
470 {
471 pub(crate) fn new(
472 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
473 ) -> Self {
474 Self {
475 stub,
476 request: R::default(),
477 options: crate::RequestOptions::default(),
478 }
479 }
480 }
481
482 #[derive(Clone, Debug)]
499 pub struct CreateBackup(RequestBuilder<crate::model::CreateBackupRequest>);
500
501 impl CreateBackup {
502 pub(crate) fn new(
503 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
504 ) -> Self {
505 Self(RequestBuilder::new(stub))
506 }
507
508 pub fn with_request<V: Into<crate::model::CreateBackupRequest>>(mut self, v: V) -> Self {
510 self.0.request = v.into();
511 self
512 }
513
514 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
516 self.0.options = v.into();
517 self
518 }
519
520 pub async fn send(self) -> Result<crate::model::Operation> {
522 (*self.0.stub)
523 .create_backup(self.0.request, self.0.options)
524 .await
525 .map(crate::Response::into_body)
526 }
527
528 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
532 self.0.request.parent = v.into();
533 self
534 }
535
536 pub fn set_backup<T>(mut self, v: T) -> Self
540 where
541 T: std::convert::Into<crate::model::Backup>,
542 {
543 self.0.request.backup = std::option::Option::Some(v.into());
544 self
545 }
546
547 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
551 where
552 T: std::convert::Into<crate::model::Backup>,
553 {
554 self.0.request.backup = v.map(|x| x.into());
555 self
556 }
557 }
558
559 #[doc(hidden)]
560 impl crate::RequestBuilder for CreateBackup {
561 fn request_options(&mut self) -> &mut crate::RequestOptions {
562 &mut self.0.options
563 }
564 }
565
566 #[derive(Clone, Debug)]
583 pub struct GetBackup(RequestBuilder<crate::model::GetBackupRequest>);
584
585 impl GetBackup {
586 pub(crate) fn new(
587 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
588 ) -> Self {
589 Self(RequestBuilder::new(stub))
590 }
591
592 pub fn with_request<V: Into<crate::model::GetBackupRequest>>(mut self, v: V) -> Self {
594 self.0.request = v.into();
595 self
596 }
597
598 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
600 self.0.options = v.into();
601 self
602 }
603
604 pub async fn send(self) -> Result<crate::model::Backup> {
606 (*self.0.stub)
607 .get_backup(self.0.request, self.0.options)
608 .await
609 .map(crate::Response::into_body)
610 }
611
612 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
616 self.0.request.name = v.into();
617 self
618 }
619 }
620
621 #[doc(hidden)]
622 impl crate::RequestBuilder for GetBackup {
623 fn request_options(&mut self) -> &mut crate::RequestOptions {
624 &mut self.0.options
625 }
626 }
627
628 #[derive(Clone, Debug)]
649 pub struct ListBackups(RequestBuilder<crate::model::ListBackupsRequest>);
650
651 impl ListBackups {
652 pub(crate) fn new(
653 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
654 ) -> Self {
655 Self(RequestBuilder::new(stub))
656 }
657
658 pub fn with_request<V: Into<crate::model::ListBackupsRequest>>(mut self, v: V) -> Self {
660 self.0.request = v.into();
661 self
662 }
663
664 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
666 self.0.options = v.into();
667 self
668 }
669
670 pub async fn send(self) -> Result<crate::model::ListBackupsResponse> {
672 (*self.0.stub)
673 .list_backups(self.0.request, self.0.options)
674 .await
675 .map(crate::Response::into_body)
676 }
677
678 pub fn by_page(
680 self,
681 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListBackupsResponse, crate::Error>
682 {
683 use std::clone::Clone;
684 let token = self.0.request.page_token.clone();
685 let execute = move |token: String| {
686 let mut builder = self.clone();
687 builder.0.request = builder.0.request.set_page_token(token);
688 builder.send()
689 };
690 google_cloud_gax::paginator::internal::new_paginator(token, execute)
691 }
692
693 pub fn by_item(
695 self,
696 ) -> impl google_cloud_gax::paginator::ItemPaginator<
697 crate::model::ListBackupsResponse,
698 crate::Error,
699 > {
700 use google_cloud_gax::paginator::Paginator;
701 self.by_page().items()
702 }
703
704 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
708 self.0.request.parent = v.into();
709 self
710 }
711
712 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
714 self.0.request.page_size = v.into();
715 self
716 }
717
718 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
720 self.0.request.page_token = v.into();
721 self
722 }
723
724 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
726 self.0.request.filter = v.into();
727 self
728 }
729 }
730
731 #[doc(hidden)]
732 impl crate::RequestBuilder for ListBackups {
733 fn request_options(&mut self) -> &mut crate::RequestOptions {
734 &mut self.0.options
735 }
736 }
737
738 #[derive(Clone, Debug)]
755 pub struct UpdateBackup(RequestBuilder<crate::model::UpdateBackupRequest>);
756
757 impl UpdateBackup {
758 pub(crate) fn new(
759 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
760 ) -> Self {
761 Self(RequestBuilder::new(stub))
762 }
763
764 pub fn with_request<V: Into<crate::model::UpdateBackupRequest>>(mut self, v: V) -> Self {
766 self.0.request = v.into();
767 self
768 }
769
770 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
772 self.0.options = v.into();
773 self
774 }
775
776 pub async fn send(self) -> Result<crate::model::Operation> {
778 (*self.0.stub)
779 .update_backup(self.0.request, self.0.options)
780 .await
781 .map(crate::Response::into_body)
782 }
783
784 pub fn set_backup<T>(mut self, v: T) -> Self
788 where
789 T: std::convert::Into<crate::model::Backup>,
790 {
791 self.0.request.backup = std::option::Option::Some(v.into());
792 self
793 }
794
795 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
799 where
800 T: std::convert::Into<crate::model::Backup>,
801 {
802 self.0.request.backup = v.map(|x| x.into());
803 self
804 }
805
806 pub fn set_update_mask<T>(mut self, v: T) -> Self
808 where
809 T: std::convert::Into<wkt::FieldMask>,
810 {
811 self.0.request.update_mask = std::option::Option::Some(v.into());
812 self
813 }
814
815 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
817 where
818 T: std::convert::Into<wkt::FieldMask>,
819 {
820 self.0.request.update_mask = v.map(|x| x.into());
821 self
822 }
823 }
824
825 #[doc(hidden)]
826 impl crate::RequestBuilder for UpdateBackup {
827 fn request_options(&mut self) -> &mut crate::RequestOptions {
828 &mut self.0.options
829 }
830 }
831
832 #[derive(Clone, Debug)]
849 pub struct DeleteBackup(RequestBuilder<crate::model::DeleteBackupRequest>);
850
851 impl DeleteBackup {
852 pub(crate) fn new(
853 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
854 ) -> Self {
855 Self(RequestBuilder::new(stub))
856 }
857
858 pub fn with_request<V: Into<crate::model::DeleteBackupRequest>>(mut self, v: V) -> Self {
860 self.0.request = v.into();
861 self
862 }
863
864 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
866 self.0.options = v.into();
867 self
868 }
869
870 pub async fn send(self) -> Result<crate::model::Operation> {
872 (*self.0.stub)
873 .delete_backup(self.0.request, self.0.options)
874 .await
875 .map(crate::Response::into_body)
876 }
877
878 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
882 self.0.request.name = v.into();
883 self
884 }
885 }
886
887 #[doc(hidden)]
888 impl crate::RequestBuilder for DeleteBackup {
889 fn request_options(&mut self) -> &mut crate::RequestOptions {
890 &mut self.0.options
891 }
892 }
893}
894
895pub mod sql_connect_service {
897 use crate::Result;
898
899 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
913
914 pub(crate) mod client {
915 use super::super::super::client::SqlConnectService;
916 pub struct Factory;
917 impl crate::ClientFactory for Factory {
918 type Client = SqlConnectService;
919 type Credentials = gaxi::options::Credentials;
920 async fn build(
921 self,
922 config: gaxi::options::ClientConfig,
923 ) -> crate::ClientBuilderResult<Self::Client> {
924 Self::Client::new(config).await
925 }
926 }
927 }
928
929 #[derive(Clone, Debug)]
931 pub(crate) struct RequestBuilder<R: std::default::Default> {
932 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
933 request: R,
934 options: crate::RequestOptions,
935 }
936
937 impl<R> RequestBuilder<R>
938 where
939 R: std::default::Default,
940 {
941 pub(crate) fn new(
942 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
943 ) -> Self {
944 Self {
945 stub,
946 request: R::default(),
947 options: crate::RequestOptions::default(),
948 }
949 }
950 }
951
952 #[derive(Clone, Debug)]
969 pub struct GetConnectSettings(RequestBuilder<crate::model::GetConnectSettingsRequest>);
970
971 impl GetConnectSettings {
972 pub(crate) fn new(
973 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
974 ) -> Self {
975 Self(RequestBuilder::new(stub))
976 }
977
978 pub fn with_request<V: Into<crate::model::GetConnectSettingsRequest>>(
980 mut self,
981 v: V,
982 ) -> Self {
983 self.0.request = v.into();
984 self
985 }
986
987 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
989 self.0.options = v.into();
990 self
991 }
992
993 pub async fn send(self) -> Result<crate::model::ConnectSettings> {
995 (*self.0.stub)
996 .get_connect_settings(self.0.request, self.0.options)
997 .await
998 .map(crate::Response::into_body)
999 }
1000
1001 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1003 self.0.request.instance = v.into();
1004 self
1005 }
1006
1007 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1009 self.0.request.project = v.into();
1010 self
1011 }
1012
1013 pub fn set_read_time<T>(mut self, v: T) -> Self
1015 where
1016 T: std::convert::Into<wkt::Timestamp>,
1017 {
1018 self.0.request.read_time = std::option::Option::Some(v.into());
1019 self
1020 }
1021
1022 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1024 where
1025 T: std::convert::Into<wkt::Timestamp>,
1026 {
1027 self.0.request.read_time = v.map(|x| x.into());
1028 self
1029 }
1030 }
1031
1032 #[doc(hidden)]
1033 impl crate::RequestBuilder for GetConnectSettings {
1034 fn request_options(&mut self) -> &mut crate::RequestOptions {
1035 &mut self.0.options
1036 }
1037 }
1038
1039 #[derive(Clone, Debug)]
1056 pub struct ResolveConnectSettings(RequestBuilder<crate::model::ResolveConnectSettingsRequest>);
1057
1058 impl ResolveConnectSettings {
1059 pub(crate) fn new(
1060 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
1061 ) -> Self {
1062 Self(RequestBuilder::new(stub))
1063 }
1064
1065 pub fn with_request<V: Into<crate::model::ResolveConnectSettingsRequest>>(
1067 mut self,
1068 v: V,
1069 ) -> Self {
1070 self.0.request = v.into();
1071 self
1072 }
1073
1074 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1076 self.0.options = v.into();
1077 self
1078 }
1079
1080 pub async fn send(self) -> Result<crate::model::ConnectSettings> {
1082 (*self.0.stub)
1083 .resolve_connect_settings(self.0.request, self.0.options)
1084 .await
1085 .map(crate::Response::into_body)
1086 }
1087
1088 pub fn set_dns_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1092 self.0.request.dns_name = v.into();
1093 self
1094 }
1095
1096 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1100 self.0.request.location = v.into();
1101 self
1102 }
1103 }
1104
1105 #[doc(hidden)]
1106 impl crate::RequestBuilder for ResolveConnectSettings {
1107 fn request_options(&mut self) -> &mut crate::RequestOptions {
1108 &mut self.0.options
1109 }
1110 }
1111
1112 #[derive(Clone, Debug)]
1129 pub struct GenerateEphemeralCert(RequestBuilder<crate::model::GenerateEphemeralCertRequest>);
1130
1131 impl GenerateEphemeralCert {
1132 pub(crate) fn new(
1133 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
1134 ) -> Self {
1135 Self(RequestBuilder::new(stub))
1136 }
1137
1138 pub fn with_request<V: Into<crate::model::GenerateEphemeralCertRequest>>(
1140 mut self,
1141 v: V,
1142 ) -> Self {
1143 self.0.request = v.into();
1144 self
1145 }
1146
1147 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1149 self.0.options = v.into();
1150 self
1151 }
1152
1153 pub async fn send(self) -> Result<crate::model::GenerateEphemeralCertResponse> {
1155 (*self.0.stub)
1156 .generate_ephemeral_cert(self.0.request, self.0.options)
1157 .await
1158 .map(crate::Response::into_body)
1159 }
1160
1161 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1163 self.0.request.instance = v.into();
1164 self
1165 }
1166
1167 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1169 self.0.request.project = v.into();
1170 self
1171 }
1172
1173 pub fn set_public_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1175 self.0.request.public_key = v.into();
1176 self
1177 }
1178
1179 pub fn set_access_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1181 self.0.request.access_token = v.into();
1182 self
1183 }
1184
1185 pub fn set_read_time<T>(mut self, v: T) -> Self
1187 where
1188 T: std::convert::Into<wkt::Timestamp>,
1189 {
1190 self.0.request.read_time = std::option::Option::Some(v.into());
1191 self
1192 }
1193
1194 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1196 where
1197 T: std::convert::Into<wkt::Timestamp>,
1198 {
1199 self.0.request.read_time = v.map(|x| x.into());
1200 self
1201 }
1202
1203 pub fn set_valid_duration<T>(mut self, v: T) -> Self
1205 where
1206 T: std::convert::Into<wkt::Duration>,
1207 {
1208 self.0.request.valid_duration = std::option::Option::Some(v.into());
1209 self
1210 }
1211
1212 pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
1214 where
1215 T: std::convert::Into<wkt::Duration>,
1216 {
1217 self.0.request.valid_duration = v.map(|x| x.into());
1218 self
1219 }
1220 }
1221
1222 #[doc(hidden)]
1223 impl crate::RequestBuilder for GenerateEphemeralCert {
1224 fn request_options(&mut self) -> &mut crate::RequestOptions {
1225 &mut self.0.options
1226 }
1227 }
1228}
1229
1230pub mod sql_databases_service {
1232 use crate::Result;
1233
1234 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1248
1249 pub(crate) mod client {
1250 use super::super::super::client::SqlDatabasesService;
1251 pub struct Factory;
1252 impl crate::ClientFactory for Factory {
1253 type Client = SqlDatabasesService;
1254 type Credentials = gaxi::options::Credentials;
1255 async fn build(
1256 self,
1257 config: gaxi::options::ClientConfig,
1258 ) -> crate::ClientBuilderResult<Self::Client> {
1259 Self::Client::new(config).await
1260 }
1261 }
1262 }
1263
1264 #[derive(Clone, Debug)]
1266 pub(crate) struct RequestBuilder<R: std::default::Default> {
1267 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1268 request: R,
1269 options: crate::RequestOptions,
1270 }
1271
1272 impl<R> RequestBuilder<R>
1273 where
1274 R: std::default::Default,
1275 {
1276 pub(crate) fn new(
1277 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1278 ) -> Self {
1279 Self {
1280 stub,
1281 request: R::default(),
1282 options: crate::RequestOptions::default(),
1283 }
1284 }
1285 }
1286
1287 #[derive(Clone, Debug)]
1304 pub struct Delete(RequestBuilder<crate::model::SqlDatabasesDeleteRequest>);
1305
1306 impl Delete {
1307 pub(crate) fn new(
1308 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1309 ) -> Self {
1310 Self(RequestBuilder::new(stub))
1311 }
1312
1313 pub fn with_request<V: Into<crate::model::SqlDatabasesDeleteRequest>>(
1315 mut self,
1316 v: V,
1317 ) -> Self {
1318 self.0.request = v.into();
1319 self
1320 }
1321
1322 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1324 self.0.options = v.into();
1325 self
1326 }
1327
1328 pub async fn send(self) -> Result<crate::model::Operation> {
1330 (*self.0.stub)
1331 .delete(self.0.request, self.0.options)
1332 .await
1333 .map(crate::Response::into_body)
1334 }
1335
1336 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1338 self.0.request.database = v.into();
1339 self
1340 }
1341
1342 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1344 self.0.request.instance = v.into();
1345 self
1346 }
1347
1348 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1350 self.0.request.project = v.into();
1351 self
1352 }
1353
1354 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1356 self.0.request.location = v.into();
1357 self
1358 }
1359 }
1360
1361 #[doc(hidden)]
1362 impl crate::RequestBuilder for Delete {
1363 fn request_options(&mut self) -> &mut crate::RequestOptions {
1364 &mut self.0.options
1365 }
1366 }
1367
1368 #[derive(Clone, Debug)]
1385 pub struct Get(RequestBuilder<crate::model::SqlDatabasesGetRequest>);
1386
1387 impl Get {
1388 pub(crate) fn new(
1389 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1390 ) -> Self {
1391 Self(RequestBuilder::new(stub))
1392 }
1393
1394 pub fn with_request<V: Into<crate::model::SqlDatabasesGetRequest>>(mut self, v: V) -> Self {
1396 self.0.request = v.into();
1397 self
1398 }
1399
1400 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1402 self.0.options = v.into();
1403 self
1404 }
1405
1406 pub async fn send(self) -> Result<crate::model::Database> {
1408 (*self.0.stub)
1409 .get(self.0.request, self.0.options)
1410 .await
1411 .map(crate::Response::into_body)
1412 }
1413
1414 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1416 self.0.request.database = v.into();
1417 self
1418 }
1419
1420 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1422 self.0.request.instance = v.into();
1423 self
1424 }
1425
1426 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1428 self.0.request.project = v.into();
1429 self
1430 }
1431
1432 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1434 self.0.request.location = v.into();
1435 self
1436 }
1437 }
1438
1439 #[doc(hidden)]
1440 impl crate::RequestBuilder for Get {
1441 fn request_options(&mut self) -> &mut crate::RequestOptions {
1442 &mut self.0.options
1443 }
1444 }
1445
1446 #[derive(Clone, Debug)]
1463 pub struct Insert(RequestBuilder<crate::model::SqlDatabasesInsertRequest>);
1464
1465 impl Insert {
1466 pub(crate) fn new(
1467 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1468 ) -> Self {
1469 Self(RequestBuilder::new(stub))
1470 }
1471
1472 pub fn with_request<V: Into<crate::model::SqlDatabasesInsertRequest>>(
1474 mut self,
1475 v: V,
1476 ) -> Self {
1477 self.0.request = v.into();
1478 self
1479 }
1480
1481 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1483 self.0.options = v.into();
1484 self
1485 }
1486
1487 pub async fn send(self) -> Result<crate::model::Operation> {
1489 (*self.0.stub)
1490 .insert(self.0.request, self.0.options)
1491 .await
1492 .map(crate::Response::into_body)
1493 }
1494
1495 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1497 self.0.request.instance = v.into();
1498 self
1499 }
1500
1501 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1503 self.0.request.project = v.into();
1504 self
1505 }
1506
1507 pub fn set_body<T>(mut self, v: T) -> Self
1509 where
1510 T: std::convert::Into<crate::model::Database>,
1511 {
1512 self.0.request.body = std::option::Option::Some(v.into());
1513 self
1514 }
1515
1516 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1518 where
1519 T: std::convert::Into<crate::model::Database>,
1520 {
1521 self.0.request.body = v.map(|x| x.into());
1522 self
1523 }
1524
1525 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1527 self.0.request.location = v.into();
1528 self
1529 }
1530 }
1531
1532 #[doc(hidden)]
1533 impl crate::RequestBuilder for Insert {
1534 fn request_options(&mut self) -> &mut crate::RequestOptions {
1535 &mut self.0.options
1536 }
1537 }
1538
1539 #[derive(Clone, Debug)]
1556 pub struct List(RequestBuilder<crate::model::SqlDatabasesListRequest>);
1557
1558 impl List {
1559 pub(crate) fn new(
1560 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1561 ) -> Self {
1562 Self(RequestBuilder::new(stub))
1563 }
1564
1565 pub fn with_request<V: Into<crate::model::SqlDatabasesListRequest>>(
1567 mut self,
1568 v: V,
1569 ) -> Self {
1570 self.0.request = v.into();
1571 self
1572 }
1573
1574 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1576 self.0.options = v.into();
1577 self
1578 }
1579
1580 pub async fn send(self) -> Result<crate::model::DatabasesListResponse> {
1582 (*self.0.stub)
1583 .list(self.0.request, self.0.options)
1584 .await
1585 .map(crate::Response::into_body)
1586 }
1587
1588 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1590 self.0.request.instance = v.into();
1591 self
1592 }
1593
1594 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1596 self.0.request.project = v.into();
1597 self
1598 }
1599
1600 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1602 self.0.request.location = v.into();
1603 self
1604 }
1605 }
1606
1607 #[doc(hidden)]
1608 impl crate::RequestBuilder for List {
1609 fn request_options(&mut self) -> &mut crate::RequestOptions {
1610 &mut self.0.options
1611 }
1612 }
1613
1614 #[derive(Clone, Debug)]
1631 pub struct Patch(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1632
1633 impl Patch {
1634 pub(crate) fn new(
1635 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1636 ) -> Self {
1637 Self(RequestBuilder::new(stub))
1638 }
1639
1640 pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1642 mut self,
1643 v: V,
1644 ) -> Self {
1645 self.0.request = v.into();
1646 self
1647 }
1648
1649 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1651 self.0.options = v.into();
1652 self
1653 }
1654
1655 pub async fn send(self) -> Result<crate::model::Operation> {
1657 (*self.0.stub)
1658 .patch(self.0.request, self.0.options)
1659 .await
1660 .map(crate::Response::into_body)
1661 }
1662
1663 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1665 self.0.request.database = v.into();
1666 self
1667 }
1668
1669 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1671 self.0.request.instance = v.into();
1672 self
1673 }
1674
1675 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1677 self.0.request.project = v.into();
1678 self
1679 }
1680
1681 pub fn set_body<T>(mut self, v: T) -> Self
1683 where
1684 T: std::convert::Into<crate::model::Database>,
1685 {
1686 self.0.request.body = std::option::Option::Some(v.into());
1687 self
1688 }
1689
1690 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1692 where
1693 T: std::convert::Into<crate::model::Database>,
1694 {
1695 self.0.request.body = v.map(|x| x.into());
1696 self
1697 }
1698
1699 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1701 self.0.request.location = v.into();
1702 self
1703 }
1704 }
1705
1706 #[doc(hidden)]
1707 impl crate::RequestBuilder for Patch {
1708 fn request_options(&mut self) -> &mut crate::RequestOptions {
1709 &mut self.0.options
1710 }
1711 }
1712
1713 #[derive(Clone, Debug)]
1730 pub struct Update(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1731
1732 impl Update {
1733 pub(crate) fn new(
1734 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1735 ) -> Self {
1736 Self(RequestBuilder::new(stub))
1737 }
1738
1739 pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1741 mut self,
1742 v: V,
1743 ) -> Self {
1744 self.0.request = v.into();
1745 self
1746 }
1747
1748 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1750 self.0.options = v.into();
1751 self
1752 }
1753
1754 pub async fn send(self) -> Result<crate::model::Operation> {
1756 (*self.0.stub)
1757 .update(self.0.request, self.0.options)
1758 .await
1759 .map(crate::Response::into_body)
1760 }
1761
1762 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1764 self.0.request.database = v.into();
1765 self
1766 }
1767
1768 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1770 self.0.request.instance = v.into();
1771 self
1772 }
1773
1774 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1776 self.0.request.project = v.into();
1777 self
1778 }
1779
1780 pub fn set_body<T>(mut self, v: T) -> Self
1782 where
1783 T: std::convert::Into<crate::model::Database>,
1784 {
1785 self.0.request.body = std::option::Option::Some(v.into());
1786 self
1787 }
1788
1789 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1791 where
1792 T: std::convert::Into<crate::model::Database>,
1793 {
1794 self.0.request.body = v.map(|x| x.into());
1795 self
1796 }
1797
1798 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1800 self.0.request.location = v.into();
1801 self
1802 }
1803 }
1804
1805 #[doc(hidden)]
1806 impl crate::RequestBuilder for Update {
1807 fn request_options(&mut self) -> &mut crate::RequestOptions {
1808 &mut self.0.options
1809 }
1810 }
1811}
1812
1813pub mod sql_flags_service {
1815 use crate::Result;
1816
1817 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1831
1832 pub(crate) mod client {
1833 use super::super::super::client::SqlFlagsService;
1834 pub struct Factory;
1835 impl crate::ClientFactory for Factory {
1836 type Client = SqlFlagsService;
1837 type Credentials = gaxi::options::Credentials;
1838 async fn build(
1839 self,
1840 config: gaxi::options::ClientConfig,
1841 ) -> crate::ClientBuilderResult<Self::Client> {
1842 Self::Client::new(config).await
1843 }
1844 }
1845 }
1846
1847 #[derive(Clone, Debug)]
1849 pub(crate) struct RequestBuilder<R: std::default::Default> {
1850 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1851 request: R,
1852 options: crate::RequestOptions,
1853 }
1854
1855 impl<R> RequestBuilder<R>
1856 where
1857 R: std::default::Default,
1858 {
1859 pub(crate) fn new(
1860 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1861 ) -> Self {
1862 Self {
1863 stub,
1864 request: R::default(),
1865 options: crate::RequestOptions::default(),
1866 }
1867 }
1868 }
1869
1870 #[derive(Clone, Debug)]
1887 pub struct List(RequestBuilder<crate::model::SqlFlagsListRequest>);
1888
1889 impl List {
1890 pub(crate) fn new(
1891 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1892 ) -> Self {
1893 Self(RequestBuilder::new(stub))
1894 }
1895
1896 pub fn with_request<V: Into<crate::model::SqlFlagsListRequest>>(mut self, v: V) -> Self {
1898 self.0.request = v.into();
1899 self
1900 }
1901
1902 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1904 self.0.options = v.into();
1905 self
1906 }
1907
1908 pub async fn send(self) -> Result<crate::model::FlagsListResponse> {
1910 (*self.0.stub)
1911 .list(self.0.request, self.0.options)
1912 .await
1913 .map(crate::Response::into_body)
1914 }
1915
1916 pub fn set_database_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
1918 self.0.request.database_version = v.into();
1919 self
1920 }
1921
1922 pub fn set_flag_scope<T>(mut self, v: T) -> Self
1924 where
1925 T: std::convert::Into<crate::model::SqlFlagScope>,
1926 {
1927 self.0.request.flag_scope = std::option::Option::Some(v.into());
1928 self
1929 }
1930
1931 pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
1933 where
1934 T: std::convert::Into<crate::model::SqlFlagScope>,
1935 {
1936 self.0.request.flag_scope = v.map(|x| x.into());
1937 self
1938 }
1939 }
1940
1941 #[doc(hidden)]
1942 impl crate::RequestBuilder for List {
1943 fn request_options(&mut self) -> &mut crate::RequestOptions {
1944 &mut self.0.options
1945 }
1946 }
1947}
1948
1949pub mod sql_instances_service {
1951 use crate::Result;
1952
1953 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1967
1968 pub(crate) mod client {
1969 use super::super::super::client::SqlInstancesService;
1970 pub struct Factory;
1971 impl crate::ClientFactory for Factory {
1972 type Client = SqlInstancesService;
1973 type Credentials = gaxi::options::Credentials;
1974 async fn build(
1975 self,
1976 config: gaxi::options::ClientConfig,
1977 ) -> crate::ClientBuilderResult<Self::Client> {
1978 Self::Client::new(config).await
1979 }
1980 }
1981 }
1982
1983 #[derive(Clone, Debug)]
1985 pub(crate) struct RequestBuilder<R: std::default::Default> {
1986 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1987 request: R,
1988 options: crate::RequestOptions,
1989 }
1990
1991 impl<R> RequestBuilder<R>
1992 where
1993 R: std::default::Default,
1994 {
1995 pub(crate) fn new(
1996 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1997 ) -> Self {
1998 Self {
1999 stub,
2000 request: R::default(),
2001 options: crate::RequestOptions::default(),
2002 }
2003 }
2004 }
2005
2006 #[derive(Clone, Debug)]
2023 pub struct AddServerCa(RequestBuilder<crate::model::SqlInstancesAddServerCaRequest>);
2024
2025 impl AddServerCa {
2026 pub(crate) fn new(
2027 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2028 ) -> Self {
2029 Self(RequestBuilder::new(stub))
2030 }
2031
2032 pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCaRequest>>(
2034 mut self,
2035 v: V,
2036 ) -> Self {
2037 self.0.request = v.into();
2038 self
2039 }
2040
2041 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2043 self.0.options = v.into();
2044 self
2045 }
2046
2047 pub async fn send(self) -> Result<crate::model::Operation> {
2049 (*self.0.stub)
2050 .add_server_ca(self.0.request, self.0.options)
2051 .await
2052 .map(crate::Response::into_body)
2053 }
2054
2055 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2057 self.0.request.instance = v.into();
2058 self
2059 }
2060
2061 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2063 self.0.request.project = v.into();
2064 self
2065 }
2066
2067 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2069 self.0.request.location = v.into();
2070 self
2071 }
2072 }
2073
2074 #[doc(hidden)]
2075 impl crate::RequestBuilder for AddServerCa {
2076 fn request_options(&mut self) -> &mut crate::RequestOptions {
2077 &mut self.0.options
2078 }
2079 }
2080
2081 #[derive(Clone, Debug)]
2098 pub struct AddServerCertificate(
2099 RequestBuilder<crate::model::SqlInstancesAddServerCertificateRequest>,
2100 );
2101
2102 impl AddServerCertificate {
2103 pub(crate) fn new(
2104 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2105 ) -> Self {
2106 Self(RequestBuilder::new(stub))
2107 }
2108
2109 pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCertificateRequest>>(
2111 mut self,
2112 v: V,
2113 ) -> Self {
2114 self.0.request = v.into();
2115 self
2116 }
2117
2118 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2120 self.0.options = v.into();
2121 self
2122 }
2123
2124 pub async fn send(self) -> Result<crate::model::Operation> {
2126 (*self.0.stub)
2127 .add_server_certificate(self.0.request, self.0.options)
2128 .await
2129 .map(crate::Response::into_body)
2130 }
2131
2132 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2134 self.0.request.instance = v.into();
2135 self
2136 }
2137
2138 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2140 self.0.request.project = v.into();
2141 self
2142 }
2143
2144 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2146 self.0.request.location = v.into();
2147 self
2148 }
2149 }
2150
2151 #[doc(hidden)]
2152 impl crate::RequestBuilder for AddServerCertificate {
2153 fn request_options(&mut self) -> &mut crate::RequestOptions {
2154 &mut self.0.options
2155 }
2156 }
2157
2158 #[derive(Clone, Debug)]
2175 pub struct AddEntraIdCertificate(
2176 RequestBuilder<crate::model::SqlInstancesAddEntraIdCertificateRequest>,
2177 );
2178
2179 impl AddEntraIdCertificate {
2180 pub(crate) fn new(
2181 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2182 ) -> Self {
2183 Self(RequestBuilder::new(stub))
2184 }
2185
2186 pub fn with_request<V: Into<crate::model::SqlInstancesAddEntraIdCertificateRequest>>(
2188 mut self,
2189 v: V,
2190 ) -> Self {
2191 self.0.request = v.into();
2192 self
2193 }
2194
2195 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2197 self.0.options = v.into();
2198 self
2199 }
2200
2201 pub async fn send(self) -> Result<crate::model::Operation> {
2203 (*self.0.stub)
2204 .add_entra_id_certificate(self.0.request, self.0.options)
2205 .await
2206 .map(crate::Response::into_body)
2207 }
2208
2209 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2213 self.0.request.instance = v.into();
2214 self
2215 }
2216
2217 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2221 self.0.request.project = v.into();
2222 self
2223 }
2224
2225 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2227 self.0.request.location = v.into();
2228 self
2229 }
2230 }
2231
2232 #[doc(hidden)]
2233 impl crate::RequestBuilder for AddEntraIdCertificate {
2234 fn request_options(&mut self) -> &mut crate::RequestOptions {
2235 &mut self.0.options
2236 }
2237 }
2238
2239 #[derive(Clone, Debug)]
2256 pub struct Clone(RequestBuilder<crate::model::SqlInstancesCloneRequest>);
2257
2258 impl Clone {
2259 pub(crate) fn new(
2260 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2261 ) -> Self {
2262 Self(RequestBuilder::new(stub))
2263 }
2264
2265 pub fn with_request<V: Into<crate::model::SqlInstancesCloneRequest>>(
2267 mut self,
2268 v: V,
2269 ) -> Self {
2270 self.0.request = v.into();
2271 self
2272 }
2273
2274 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2276 self.0.options = v.into();
2277 self
2278 }
2279
2280 pub async fn send(self) -> Result<crate::model::Operation> {
2282 (*self.0.stub)
2283 .clone(self.0.request, self.0.options)
2284 .await
2285 .map(crate::Response::into_body)
2286 }
2287
2288 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2292 self.0.request.instance = v.into();
2293 self
2294 }
2295
2296 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2300 self.0.request.project = v.into();
2301 self
2302 }
2303
2304 pub fn set_body<T>(mut self, v: T) -> Self
2308 where
2309 T: std::convert::Into<crate::model::InstancesCloneRequest>,
2310 {
2311 self.0.request.body = std::option::Option::Some(v.into());
2312 self
2313 }
2314
2315 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2319 where
2320 T: std::convert::Into<crate::model::InstancesCloneRequest>,
2321 {
2322 self.0.request.body = v.map(|x| x.into());
2323 self
2324 }
2325
2326 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2328 self.0.request.location = v.into();
2329 self
2330 }
2331 }
2332
2333 #[doc(hidden)]
2334 impl crate::RequestBuilder for Clone {
2335 fn request_options(&mut self) -> &mut crate::RequestOptions {
2336 &mut self.0.options
2337 }
2338 }
2339
2340 #[derive(Clone, Debug)]
2357 pub struct Delete(RequestBuilder<crate::model::SqlInstancesDeleteRequest>);
2358
2359 impl Delete {
2360 pub(crate) fn new(
2361 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2362 ) -> Self {
2363 Self(RequestBuilder::new(stub))
2364 }
2365
2366 pub fn with_request<V: Into<crate::model::SqlInstancesDeleteRequest>>(
2368 mut self,
2369 v: V,
2370 ) -> Self {
2371 self.0.request = v.into();
2372 self
2373 }
2374
2375 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2377 self.0.options = v.into();
2378 self
2379 }
2380
2381 pub async fn send(self) -> Result<crate::model::Operation> {
2383 (*self.0.stub)
2384 .delete(self.0.request, self.0.options)
2385 .await
2386 .map(crate::Response::into_body)
2387 }
2388
2389 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2391 self.0.request.instance = v.into();
2392 self
2393 }
2394
2395 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2397 self.0.request.project = v.into();
2398 self
2399 }
2400
2401 pub fn set_enable_final_backup<T>(mut self, v: T) -> Self
2403 where
2404 T: std::convert::Into<bool>,
2405 {
2406 self.0.request.enable_final_backup = std::option::Option::Some(v.into());
2407 self
2408 }
2409
2410 pub fn set_or_clear_enable_final_backup<T>(mut self, v: std::option::Option<T>) -> Self
2412 where
2413 T: std::convert::Into<bool>,
2414 {
2415 self.0.request.enable_final_backup = v.map(|x| x.into());
2416 self
2417 }
2418
2419 pub fn set_final_backup_description<T: Into<std::string::String>>(mut self, v: T) -> Self {
2421 self.0.request.final_backup_description = v.into();
2422 self
2423 }
2424
2425 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2427 self.0.request.location = v.into();
2428 self
2429 }
2430
2431 pub fn set_expiration<
2436 T: Into<Option<crate::model::sql_instances_delete_request::Expiration>>,
2437 >(
2438 mut self,
2439 v: T,
2440 ) -> Self {
2441 self.0.request.expiration = v.into();
2442 self
2443 }
2444
2445 pub fn set_final_backup_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2451 self.0.request = self.0.request.set_final_backup_ttl_days(v);
2452 self
2453 }
2454
2455 pub fn set_final_backup_expiry_time<
2461 T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>,
2462 >(
2463 mut self,
2464 v: T,
2465 ) -> Self {
2466 self.0.request = self.0.request.set_final_backup_expiry_time(v);
2467 self
2468 }
2469 }
2470
2471 #[doc(hidden)]
2472 impl crate::RequestBuilder for Delete {
2473 fn request_options(&mut self) -> &mut crate::RequestOptions {
2474 &mut self.0.options
2475 }
2476 }
2477
2478 #[derive(Clone, Debug)]
2495 pub struct DemoteMaster(RequestBuilder<crate::model::SqlInstancesDemoteMasterRequest>);
2496
2497 impl DemoteMaster {
2498 pub(crate) fn new(
2499 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2500 ) -> Self {
2501 Self(RequestBuilder::new(stub))
2502 }
2503
2504 pub fn with_request<V: Into<crate::model::SqlInstancesDemoteMasterRequest>>(
2506 mut self,
2507 v: V,
2508 ) -> Self {
2509 self.0.request = v.into();
2510 self
2511 }
2512
2513 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2515 self.0.options = v.into();
2516 self
2517 }
2518
2519 pub async fn send(self) -> Result<crate::model::Operation> {
2521 (*self.0.stub)
2522 .demote_master(self.0.request, self.0.options)
2523 .await
2524 .map(crate::Response::into_body)
2525 }
2526
2527 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2529 self.0.request.instance = v.into();
2530 self
2531 }
2532
2533 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2535 self.0.request.project = v.into();
2536 self
2537 }
2538
2539 pub fn set_body<T>(mut self, v: T) -> Self
2541 where
2542 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
2543 {
2544 self.0.request.body = std::option::Option::Some(v.into());
2545 self
2546 }
2547
2548 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2550 where
2551 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
2552 {
2553 self.0.request.body = v.map(|x| x.into());
2554 self
2555 }
2556
2557 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2559 self.0.request.location = v.into();
2560 self
2561 }
2562 }
2563
2564 #[doc(hidden)]
2565 impl crate::RequestBuilder for DemoteMaster {
2566 fn request_options(&mut self) -> &mut crate::RequestOptions {
2567 &mut self.0.options
2568 }
2569 }
2570
2571 #[derive(Clone, Debug)]
2588 pub struct Demote(RequestBuilder<crate::model::SqlInstancesDemoteRequest>);
2589
2590 impl Demote {
2591 pub(crate) fn new(
2592 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2593 ) -> Self {
2594 Self(RequestBuilder::new(stub))
2595 }
2596
2597 pub fn with_request<V: Into<crate::model::SqlInstancesDemoteRequest>>(
2599 mut self,
2600 v: V,
2601 ) -> Self {
2602 self.0.request = v.into();
2603 self
2604 }
2605
2606 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2608 self.0.options = v.into();
2609 self
2610 }
2611
2612 pub async fn send(self) -> Result<crate::model::Operation> {
2614 (*self.0.stub)
2615 .demote(self.0.request, self.0.options)
2616 .await
2617 .map(crate::Response::into_body)
2618 }
2619
2620 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2624 self.0.request.instance = v.into();
2625 self
2626 }
2627
2628 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2632 self.0.request.project = v.into();
2633 self
2634 }
2635
2636 pub fn set_body<T>(mut self, v: T) -> Self
2640 where
2641 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
2642 {
2643 self.0.request.body = std::option::Option::Some(v.into());
2644 self
2645 }
2646
2647 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2651 where
2652 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
2653 {
2654 self.0.request.body = v.map(|x| x.into());
2655 self
2656 }
2657
2658 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2660 self.0.request.location = v.into();
2661 self
2662 }
2663 }
2664
2665 #[doc(hidden)]
2666 impl crate::RequestBuilder for Demote {
2667 fn request_options(&mut self) -> &mut crate::RequestOptions {
2668 &mut self.0.options
2669 }
2670 }
2671
2672 #[derive(Clone, Debug)]
2689 pub struct Export(RequestBuilder<crate::model::SqlInstancesExportRequest>);
2690
2691 impl Export {
2692 pub(crate) fn new(
2693 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2694 ) -> Self {
2695 Self(RequestBuilder::new(stub))
2696 }
2697
2698 pub fn with_request<V: Into<crate::model::SqlInstancesExportRequest>>(
2700 mut self,
2701 v: V,
2702 ) -> Self {
2703 self.0.request = v.into();
2704 self
2705 }
2706
2707 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2709 self.0.options = v.into();
2710 self
2711 }
2712
2713 pub async fn send(self) -> Result<crate::model::Operation> {
2715 (*self.0.stub)
2716 .export(self.0.request, self.0.options)
2717 .await
2718 .map(crate::Response::into_body)
2719 }
2720
2721 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2723 self.0.request.instance = v.into();
2724 self
2725 }
2726
2727 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2729 self.0.request.project = v.into();
2730 self
2731 }
2732
2733 pub fn set_body<T>(mut self, v: T) -> Self
2735 where
2736 T: std::convert::Into<crate::model::InstancesExportRequest>,
2737 {
2738 self.0.request.body = std::option::Option::Some(v.into());
2739 self
2740 }
2741
2742 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2744 where
2745 T: std::convert::Into<crate::model::InstancesExportRequest>,
2746 {
2747 self.0.request.body = v.map(|x| x.into());
2748 self
2749 }
2750
2751 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2753 self.0.request.location = v.into();
2754 self
2755 }
2756 }
2757
2758 #[doc(hidden)]
2759 impl crate::RequestBuilder for Export {
2760 fn request_options(&mut self) -> &mut crate::RequestOptions {
2761 &mut self.0.options
2762 }
2763 }
2764
2765 #[derive(Clone, Debug)]
2782 pub struct Failover(RequestBuilder<crate::model::SqlInstancesFailoverRequest>);
2783
2784 impl Failover {
2785 pub(crate) fn new(
2786 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2787 ) -> Self {
2788 Self(RequestBuilder::new(stub))
2789 }
2790
2791 pub fn with_request<V: Into<crate::model::SqlInstancesFailoverRequest>>(
2793 mut self,
2794 v: V,
2795 ) -> Self {
2796 self.0.request = v.into();
2797 self
2798 }
2799
2800 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2802 self.0.options = v.into();
2803 self
2804 }
2805
2806 pub async fn send(self) -> Result<crate::model::Operation> {
2808 (*self.0.stub)
2809 .failover(self.0.request, self.0.options)
2810 .await
2811 .map(crate::Response::into_body)
2812 }
2813
2814 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2816 self.0.request.instance = v.into();
2817 self
2818 }
2819
2820 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2822 self.0.request.project = v.into();
2823 self
2824 }
2825
2826 pub fn set_body<T>(mut self, v: T) -> Self
2828 where
2829 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
2830 {
2831 self.0.request.body = std::option::Option::Some(v.into());
2832 self
2833 }
2834
2835 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2837 where
2838 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
2839 {
2840 self.0.request.body = v.map(|x| x.into());
2841 self
2842 }
2843
2844 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2846 self.0.request.location = v.into();
2847 self
2848 }
2849 }
2850
2851 #[doc(hidden)]
2852 impl crate::RequestBuilder for Failover {
2853 fn request_options(&mut self) -> &mut crate::RequestOptions {
2854 &mut self.0.options
2855 }
2856 }
2857
2858 #[derive(Clone, Debug)]
2875 pub struct Reencrypt(RequestBuilder<crate::model::SqlInstancesReencryptRequest>);
2876
2877 impl Reencrypt {
2878 pub(crate) fn new(
2879 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2880 ) -> Self {
2881 Self(RequestBuilder::new(stub))
2882 }
2883
2884 pub fn with_request<V: Into<crate::model::SqlInstancesReencryptRequest>>(
2886 mut self,
2887 v: V,
2888 ) -> Self {
2889 self.0.request = v.into();
2890 self
2891 }
2892
2893 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2895 self.0.options = v.into();
2896 self
2897 }
2898
2899 pub async fn send(self) -> Result<crate::model::Operation> {
2901 (*self.0.stub)
2902 .reencrypt(self.0.request, self.0.options)
2903 .await
2904 .map(crate::Response::into_body)
2905 }
2906
2907 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2909 self.0.request.instance = v.into();
2910 self
2911 }
2912
2913 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2915 self.0.request.project = v.into();
2916 self
2917 }
2918
2919 pub fn set_body<T>(mut self, v: T) -> Self
2921 where
2922 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2923 {
2924 self.0.request.body = std::option::Option::Some(v.into());
2925 self
2926 }
2927
2928 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2930 where
2931 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2932 {
2933 self.0.request.body = v.map(|x| x.into());
2934 self
2935 }
2936
2937 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2939 self.0.request.location = v.into();
2940 self
2941 }
2942 }
2943
2944 #[doc(hidden)]
2945 impl crate::RequestBuilder for Reencrypt {
2946 fn request_options(&mut self) -> &mut crate::RequestOptions {
2947 &mut self.0.options
2948 }
2949 }
2950
2951 #[derive(Clone, Debug)]
2968 pub struct Get(RequestBuilder<crate::model::SqlInstancesGetRequest>);
2969
2970 impl Get {
2971 pub(crate) fn new(
2972 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2973 ) -> Self {
2974 Self(RequestBuilder::new(stub))
2975 }
2976
2977 pub fn with_request<V: Into<crate::model::SqlInstancesGetRequest>>(mut self, v: V) -> Self {
2979 self.0.request = v.into();
2980 self
2981 }
2982
2983 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2985 self.0.options = v.into();
2986 self
2987 }
2988
2989 pub async fn send(self) -> Result<crate::model::DatabaseInstance> {
2991 (*self.0.stub)
2992 .get(self.0.request, self.0.options)
2993 .await
2994 .map(crate::Response::into_body)
2995 }
2996
2997 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3001 self.0.request.instance = v.into();
3002 self
3003 }
3004
3005 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3009 self.0.request.project = v.into();
3010 self
3011 }
3012
3013 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3015 self.0.request.location = v.into();
3016 self
3017 }
3018 }
3019
3020 #[doc(hidden)]
3021 impl crate::RequestBuilder for Get {
3022 fn request_options(&mut self) -> &mut crate::RequestOptions {
3023 &mut self.0.options
3024 }
3025 }
3026
3027 #[derive(Clone, Debug)]
3044 pub struct Import(RequestBuilder<crate::model::SqlInstancesImportRequest>);
3045
3046 impl Import {
3047 pub(crate) fn new(
3048 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3049 ) -> Self {
3050 Self(RequestBuilder::new(stub))
3051 }
3052
3053 pub fn with_request<V: Into<crate::model::SqlInstancesImportRequest>>(
3055 mut self,
3056 v: V,
3057 ) -> Self {
3058 self.0.request = v.into();
3059 self
3060 }
3061
3062 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3064 self.0.options = v.into();
3065 self
3066 }
3067
3068 pub async fn send(self) -> Result<crate::model::Operation> {
3070 (*self.0.stub)
3071 .import(self.0.request, self.0.options)
3072 .await
3073 .map(crate::Response::into_body)
3074 }
3075
3076 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3078 self.0.request.instance = v.into();
3079 self
3080 }
3081
3082 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3084 self.0.request.project = v.into();
3085 self
3086 }
3087
3088 pub fn set_body<T>(mut self, v: T) -> Self
3090 where
3091 T: std::convert::Into<crate::model::InstancesImportRequest>,
3092 {
3093 self.0.request.body = std::option::Option::Some(v.into());
3094 self
3095 }
3096
3097 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3099 where
3100 T: std::convert::Into<crate::model::InstancesImportRequest>,
3101 {
3102 self.0.request.body = v.map(|x| x.into());
3103 self
3104 }
3105
3106 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3108 self.0.request.location = v.into();
3109 self
3110 }
3111 }
3112
3113 #[doc(hidden)]
3114 impl crate::RequestBuilder for Import {
3115 fn request_options(&mut self) -> &mut crate::RequestOptions {
3116 &mut self.0.options
3117 }
3118 }
3119
3120 #[derive(Clone, Debug)]
3137 pub struct Insert(RequestBuilder<crate::model::SqlInstancesInsertRequest>);
3138
3139 impl Insert {
3140 pub(crate) fn new(
3141 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3142 ) -> Self {
3143 Self(RequestBuilder::new(stub))
3144 }
3145
3146 pub fn with_request<V: Into<crate::model::SqlInstancesInsertRequest>>(
3148 mut self,
3149 v: V,
3150 ) -> Self {
3151 self.0.request = v.into();
3152 self
3153 }
3154
3155 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3157 self.0.options = v.into();
3158 self
3159 }
3160
3161 pub async fn send(self) -> Result<crate::model::Operation> {
3163 (*self.0.stub)
3164 .insert(self.0.request, self.0.options)
3165 .await
3166 .map(crate::Response::into_body)
3167 }
3168
3169 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3171 self.0.request.project = v.into();
3172 self
3173 }
3174
3175 pub fn set_body<T>(mut self, v: T) -> Self
3177 where
3178 T: std::convert::Into<crate::model::DatabaseInstance>,
3179 {
3180 self.0.request.body = std::option::Option::Some(v.into());
3181 self
3182 }
3183
3184 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3186 where
3187 T: std::convert::Into<crate::model::DatabaseInstance>,
3188 {
3189 self.0.request.body = v.map(|x| x.into());
3190 self
3191 }
3192
3193 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3195 self.0.request.location = v.into();
3196 self
3197 }
3198 }
3199
3200 #[doc(hidden)]
3201 impl crate::RequestBuilder for Insert {
3202 fn request_options(&mut self) -> &mut crate::RequestOptions {
3203 &mut self.0.options
3204 }
3205 }
3206
3207 #[derive(Clone, Debug)]
3228 pub struct List(RequestBuilder<crate::model::SqlInstancesListRequest>);
3229
3230 impl List {
3231 pub(crate) fn new(
3232 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3233 ) -> Self {
3234 Self(RequestBuilder::new(stub))
3235 }
3236
3237 pub fn with_request<V: Into<crate::model::SqlInstancesListRequest>>(
3239 mut self,
3240 v: V,
3241 ) -> Self {
3242 self.0.request = v.into();
3243 self
3244 }
3245
3246 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3248 self.0.options = v.into();
3249 self
3250 }
3251
3252 pub async fn send(self) -> Result<crate::model::InstancesListResponse> {
3254 (*self.0.stub)
3255 .list(self.0.request, self.0.options)
3256 .await
3257 .map(crate::Response::into_body)
3258 }
3259
3260 pub fn by_page(
3262 self,
3263 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::InstancesListResponse, crate::Error>
3264 {
3265 use std::clone::Clone;
3266 let token = self.0.request.page_token.clone();
3267 let execute = move |token: String| {
3268 let mut builder = self.clone();
3269 builder.0.request = builder.0.request.set_page_token(token);
3270 builder.send()
3271 };
3272 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3273 }
3274
3275 pub fn by_item(
3277 self,
3278 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3279 crate::model::InstancesListResponse,
3280 crate::Error,
3281 > {
3282 use google_cloud_gax::paginator::Paginator;
3283 self.by_page().items()
3284 }
3285
3286 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3288 self.0.request.filter = v.into();
3289 self
3290 }
3291
3292 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
3294 self.0.request.max_results = v.into();
3295 self
3296 }
3297
3298 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3300 self.0.request.page_token = v.into();
3301 self
3302 }
3303
3304 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3306 self.0.request.project = v.into();
3307 self
3308 }
3309
3310 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3312 self.0.request.location = v.into();
3313 self
3314 }
3315 }
3316
3317 #[doc(hidden)]
3318 impl crate::RequestBuilder for List {
3319 fn request_options(&mut self) -> &mut crate::RequestOptions {
3320 &mut self.0.options
3321 }
3322 }
3323
3324 #[derive(Clone, Debug)]
3341 pub struct ListServerCas(RequestBuilder<crate::model::SqlInstancesListServerCasRequest>);
3342
3343 impl ListServerCas {
3344 pub(crate) fn new(
3345 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3346 ) -> Self {
3347 Self(RequestBuilder::new(stub))
3348 }
3349
3350 pub fn with_request<V: Into<crate::model::SqlInstancesListServerCasRequest>>(
3352 mut self,
3353 v: V,
3354 ) -> Self {
3355 self.0.request = v.into();
3356 self
3357 }
3358
3359 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3361 self.0.options = v.into();
3362 self
3363 }
3364
3365 pub async fn send(self) -> Result<crate::model::InstancesListServerCasResponse> {
3367 (*self.0.stub)
3368 .list_server_cas(self.0.request, self.0.options)
3369 .await
3370 .map(crate::Response::into_body)
3371 }
3372
3373 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3375 self.0.request.instance = v.into();
3376 self
3377 }
3378
3379 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3381 self.0.request.project = v.into();
3382 self
3383 }
3384
3385 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3387 self.0.request.location = v.into();
3388 self
3389 }
3390 }
3391
3392 #[doc(hidden)]
3393 impl crate::RequestBuilder for ListServerCas {
3394 fn request_options(&mut self) -> &mut crate::RequestOptions {
3395 &mut self.0.options
3396 }
3397 }
3398
3399 #[derive(Clone, Debug)]
3416 pub struct ListServerCertificates(
3417 RequestBuilder<crate::model::SqlInstancesListServerCertificatesRequest>,
3418 );
3419
3420 impl ListServerCertificates {
3421 pub(crate) fn new(
3422 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3423 ) -> Self {
3424 Self(RequestBuilder::new(stub))
3425 }
3426
3427 pub fn with_request<V: Into<crate::model::SqlInstancesListServerCertificatesRequest>>(
3429 mut self,
3430 v: V,
3431 ) -> Self {
3432 self.0.request = v.into();
3433 self
3434 }
3435
3436 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3438 self.0.options = v.into();
3439 self
3440 }
3441
3442 pub async fn send(self) -> Result<crate::model::InstancesListServerCertificatesResponse> {
3444 (*self.0.stub)
3445 .list_server_certificates(self.0.request, self.0.options)
3446 .await
3447 .map(crate::Response::into_body)
3448 }
3449
3450 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3454 self.0.request.instance = v.into();
3455 self
3456 }
3457
3458 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3462 self.0.request.project = v.into();
3463 self
3464 }
3465
3466 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3468 self.0.request.location = v.into();
3469 self
3470 }
3471 }
3472
3473 #[doc(hidden)]
3474 impl crate::RequestBuilder for ListServerCertificates {
3475 fn request_options(&mut self) -> &mut crate::RequestOptions {
3476 &mut self.0.options
3477 }
3478 }
3479
3480 #[derive(Clone, Debug)]
3497 pub struct ListEntraIdCertificates(
3498 RequestBuilder<crate::model::SqlInstancesListEntraIdCertificatesRequest>,
3499 );
3500
3501 impl ListEntraIdCertificates {
3502 pub(crate) fn new(
3503 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3504 ) -> Self {
3505 Self(RequestBuilder::new(stub))
3506 }
3507
3508 pub fn with_request<V: Into<crate::model::SqlInstancesListEntraIdCertificatesRequest>>(
3510 mut self,
3511 v: V,
3512 ) -> Self {
3513 self.0.request = v.into();
3514 self
3515 }
3516
3517 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3519 self.0.options = v.into();
3520 self
3521 }
3522
3523 pub async fn send(self) -> Result<crate::model::InstancesListEntraIdCertificatesResponse> {
3525 (*self.0.stub)
3526 .list_entra_id_certificates(self.0.request, self.0.options)
3527 .await
3528 .map(crate::Response::into_body)
3529 }
3530
3531 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3535 self.0.request.instance = v.into();
3536 self
3537 }
3538
3539 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3543 self.0.request.project = v.into();
3544 self
3545 }
3546
3547 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3549 self.0.request.location = v.into();
3550 self
3551 }
3552 }
3553
3554 #[doc(hidden)]
3555 impl crate::RequestBuilder for ListEntraIdCertificates {
3556 fn request_options(&mut self) -> &mut crate::RequestOptions {
3557 &mut self.0.options
3558 }
3559 }
3560
3561 #[derive(Clone, Debug)]
3578 pub struct Patch(RequestBuilder<crate::model::SqlInstancesPatchRequest>);
3579
3580 impl Patch {
3581 pub(crate) fn new(
3582 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3583 ) -> Self {
3584 Self(RequestBuilder::new(stub))
3585 }
3586
3587 pub fn with_request<V: Into<crate::model::SqlInstancesPatchRequest>>(
3589 mut self,
3590 v: V,
3591 ) -> Self {
3592 self.0.request = v.into();
3593 self
3594 }
3595
3596 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3598 self.0.options = v.into();
3599 self
3600 }
3601
3602 pub async fn send(self) -> Result<crate::model::Operation> {
3604 (*self.0.stub)
3605 .patch(self.0.request, self.0.options)
3606 .await
3607 .map(crate::Response::into_body)
3608 }
3609
3610 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3612 self.0.request.instance = v.into();
3613 self
3614 }
3615
3616 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3618 self.0.request.project = v.into();
3619 self
3620 }
3621
3622 pub fn set_reconcile_psc_networking<T>(mut self, v: T) -> Self
3624 where
3625 T: std::convert::Into<bool>,
3626 {
3627 self.0.request.reconcile_psc_networking = std::option::Option::Some(v.into());
3628 self
3629 }
3630
3631 pub fn set_or_clear_reconcile_psc_networking<T>(mut self, v: std::option::Option<T>) -> Self
3633 where
3634 T: std::convert::Into<bool>,
3635 {
3636 self.0.request.reconcile_psc_networking = v.map(|x| x.into());
3637 self
3638 }
3639
3640 pub fn set_reconcile_psc_networking_force<T>(mut self, v: T) -> Self
3642 where
3643 T: std::convert::Into<bool>,
3644 {
3645 self.0.request.reconcile_psc_networking_force = std::option::Option::Some(v.into());
3646 self
3647 }
3648
3649 pub fn set_or_clear_reconcile_psc_networking_force<T>(
3651 mut self,
3652 v: std::option::Option<T>,
3653 ) -> Self
3654 where
3655 T: std::convert::Into<bool>,
3656 {
3657 self.0.request.reconcile_psc_networking_force = v.map(|x| x.into());
3658 self
3659 }
3660
3661 pub fn set_body<T>(mut self, v: T) -> Self
3663 where
3664 T: std::convert::Into<crate::model::DatabaseInstance>,
3665 {
3666 self.0.request.body = std::option::Option::Some(v.into());
3667 self
3668 }
3669
3670 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3672 where
3673 T: std::convert::Into<crate::model::DatabaseInstance>,
3674 {
3675 self.0.request.body = v.map(|x| x.into());
3676 self
3677 }
3678
3679 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3681 self.0.request.location = v.into();
3682 self
3683 }
3684 }
3685
3686 #[doc(hidden)]
3687 impl crate::RequestBuilder for Patch {
3688 fn request_options(&mut self) -> &mut crate::RequestOptions {
3689 &mut self.0.options
3690 }
3691 }
3692
3693 #[derive(Clone, Debug)]
3710 pub struct PromoteReplica(RequestBuilder<crate::model::SqlInstancesPromoteReplicaRequest>);
3711
3712 impl PromoteReplica {
3713 pub(crate) fn new(
3714 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3715 ) -> Self {
3716 Self(RequestBuilder::new(stub))
3717 }
3718
3719 pub fn with_request<V: Into<crate::model::SqlInstancesPromoteReplicaRequest>>(
3721 mut self,
3722 v: V,
3723 ) -> Self {
3724 self.0.request = v.into();
3725 self
3726 }
3727
3728 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3730 self.0.options = v.into();
3731 self
3732 }
3733
3734 pub async fn send(self) -> Result<crate::model::Operation> {
3736 (*self.0.stub)
3737 .promote_replica(self.0.request, self.0.options)
3738 .await
3739 .map(crate::Response::into_body)
3740 }
3741
3742 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3744 self.0.request.instance = v.into();
3745 self
3746 }
3747
3748 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3750 self.0.request.project = v.into();
3751 self
3752 }
3753
3754 pub fn set_failover<T: Into<bool>>(mut self, v: T) -> Self {
3756 self.0.request.failover = v.into();
3757 self
3758 }
3759
3760 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3762 self.0.request.location = v.into();
3763 self
3764 }
3765 }
3766
3767 #[doc(hidden)]
3768 impl crate::RequestBuilder for PromoteReplica {
3769 fn request_options(&mut self) -> &mut crate::RequestOptions {
3770 &mut self.0.options
3771 }
3772 }
3773
3774 #[derive(Clone, Debug)]
3791 pub struct Switchover(RequestBuilder<crate::model::SqlInstancesSwitchoverRequest>);
3792
3793 impl Switchover {
3794 pub(crate) fn new(
3795 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3796 ) -> Self {
3797 Self(RequestBuilder::new(stub))
3798 }
3799
3800 pub fn with_request<V: Into<crate::model::SqlInstancesSwitchoverRequest>>(
3802 mut self,
3803 v: V,
3804 ) -> Self {
3805 self.0.request = v.into();
3806 self
3807 }
3808
3809 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3811 self.0.options = v.into();
3812 self
3813 }
3814
3815 pub async fn send(self) -> Result<crate::model::Operation> {
3817 (*self.0.stub)
3818 .switchover(self.0.request, self.0.options)
3819 .await
3820 .map(crate::Response::into_body)
3821 }
3822
3823 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3825 self.0.request.instance = v.into();
3826 self
3827 }
3828
3829 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3831 self.0.request.project = v.into();
3832 self
3833 }
3834
3835 pub fn set_db_timeout<T>(mut self, v: T) -> Self
3837 where
3838 T: std::convert::Into<wkt::Duration>,
3839 {
3840 self.0.request.db_timeout = std::option::Option::Some(v.into());
3841 self
3842 }
3843
3844 pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
3846 where
3847 T: std::convert::Into<wkt::Duration>,
3848 {
3849 self.0.request.db_timeout = v.map(|x| x.into());
3850 self
3851 }
3852
3853 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3855 self.0.request.location = v.into();
3856 self
3857 }
3858 }
3859
3860 #[doc(hidden)]
3861 impl crate::RequestBuilder for Switchover {
3862 fn request_options(&mut self) -> &mut crate::RequestOptions {
3863 &mut self.0.options
3864 }
3865 }
3866
3867 #[derive(Clone, Debug)]
3884 pub struct ResetSslConfig(RequestBuilder<crate::model::SqlInstancesResetSslConfigRequest>);
3885
3886 impl ResetSslConfig {
3887 pub(crate) fn new(
3888 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3889 ) -> Self {
3890 Self(RequestBuilder::new(stub))
3891 }
3892
3893 pub fn with_request<V: Into<crate::model::SqlInstancesResetSslConfigRequest>>(
3895 mut self,
3896 v: V,
3897 ) -> Self {
3898 self.0.request = v.into();
3899 self
3900 }
3901
3902 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3904 self.0.options = v.into();
3905 self
3906 }
3907
3908 pub async fn send(self) -> Result<crate::model::Operation> {
3910 (*self.0.stub)
3911 .reset_ssl_config(self.0.request, self.0.options)
3912 .await
3913 .map(crate::Response::into_body)
3914 }
3915
3916 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3918 self.0.request.instance = v.into();
3919 self
3920 }
3921
3922 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3924 self.0.request.project = v.into();
3925 self
3926 }
3927
3928 pub fn set_mode<
3930 T: Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
3931 >(
3932 mut self,
3933 v: T,
3934 ) -> Self {
3935 self.0.request.mode = v.into();
3936 self
3937 }
3938
3939 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3941 self.0.request.location = v.into();
3942 self
3943 }
3944 }
3945
3946 #[doc(hidden)]
3947 impl crate::RequestBuilder for ResetSslConfig {
3948 fn request_options(&mut self) -> &mut crate::RequestOptions {
3949 &mut self.0.options
3950 }
3951 }
3952
3953 #[derive(Clone, Debug)]
3970 pub struct Restart(RequestBuilder<crate::model::SqlInstancesRestartRequest>);
3971
3972 impl Restart {
3973 pub(crate) fn new(
3974 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3975 ) -> Self {
3976 Self(RequestBuilder::new(stub))
3977 }
3978
3979 pub fn with_request<V: Into<crate::model::SqlInstancesRestartRequest>>(
3981 mut self,
3982 v: V,
3983 ) -> Self {
3984 self.0.request = v.into();
3985 self
3986 }
3987
3988 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3990 self.0.options = v.into();
3991 self
3992 }
3993
3994 pub async fn send(self) -> Result<crate::model::Operation> {
3996 (*self.0.stub)
3997 .restart(self.0.request, self.0.options)
3998 .await
3999 .map(crate::Response::into_body)
4000 }
4001
4002 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4004 self.0.request.instance = v.into();
4005 self
4006 }
4007
4008 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4010 self.0.request.project = v.into();
4011 self
4012 }
4013
4014 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4016 self.0.request.location = v.into();
4017 self
4018 }
4019 }
4020
4021 #[doc(hidden)]
4022 impl crate::RequestBuilder for Restart {
4023 fn request_options(&mut self) -> &mut crate::RequestOptions {
4024 &mut self.0.options
4025 }
4026 }
4027
4028 #[derive(Clone, Debug)]
4045 pub struct RestoreBackup(RequestBuilder<crate::model::SqlInstancesRestoreBackupRequest>);
4046
4047 impl RestoreBackup {
4048 pub(crate) fn new(
4049 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4050 ) -> Self {
4051 Self(RequestBuilder::new(stub))
4052 }
4053
4054 pub fn with_request<V: Into<crate::model::SqlInstancesRestoreBackupRequest>>(
4056 mut self,
4057 v: V,
4058 ) -> Self {
4059 self.0.request = v.into();
4060 self
4061 }
4062
4063 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4065 self.0.options = v.into();
4066 self
4067 }
4068
4069 pub async fn send(self) -> Result<crate::model::Operation> {
4071 (*self.0.stub)
4072 .restore_backup(self.0.request, self.0.options)
4073 .await
4074 .map(crate::Response::into_body)
4075 }
4076
4077 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4079 self.0.request.instance = v.into();
4080 self
4081 }
4082
4083 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4085 self.0.request.project = v.into();
4086 self
4087 }
4088
4089 pub fn set_body<T>(mut self, v: T) -> Self
4091 where
4092 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
4093 {
4094 self.0.request.body = std::option::Option::Some(v.into());
4095 self
4096 }
4097
4098 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4100 where
4101 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
4102 {
4103 self.0.request.body = v.map(|x| x.into());
4104 self
4105 }
4106
4107 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4109 self.0.request.location = v.into();
4110 self
4111 }
4112 }
4113
4114 #[doc(hidden)]
4115 impl crate::RequestBuilder for RestoreBackup {
4116 fn request_options(&mut self) -> &mut crate::RequestOptions {
4117 &mut self.0.options
4118 }
4119 }
4120
4121 #[derive(Clone, Debug)]
4138 pub struct RotateServerCa(RequestBuilder<crate::model::SqlInstancesRotateServerCaRequest>);
4139
4140 impl RotateServerCa {
4141 pub(crate) fn new(
4142 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4143 ) -> Self {
4144 Self(RequestBuilder::new(stub))
4145 }
4146
4147 pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCaRequest>>(
4149 mut self,
4150 v: V,
4151 ) -> Self {
4152 self.0.request = v.into();
4153 self
4154 }
4155
4156 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4158 self.0.options = v.into();
4159 self
4160 }
4161
4162 pub async fn send(self) -> Result<crate::model::Operation> {
4164 (*self.0.stub)
4165 .rotate_server_ca(self.0.request, self.0.options)
4166 .await
4167 .map(crate::Response::into_body)
4168 }
4169
4170 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4172 self.0.request.instance = v.into();
4173 self
4174 }
4175
4176 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4178 self.0.request.project = v.into();
4179 self
4180 }
4181
4182 pub fn set_body<T>(mut self, v: T) -> Self
4184 where
4185 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
4186 {
4187 self.0.request.body = std::option::Option::Some(v.into());
4188 self
4189 }
4190
4191 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4193 where
4194 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
4195 {
4196 self.0.request.body = v.map(|x| x.into());
4197 self
4198 }
4199
4200 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4202 self.0.request.location = v.into();
4203 self
4204 }
4205 }
4206
4207 #[doc(hidden)]
4208 impl crate::RequestBuilder for RotateServerCa {
4209 fn request_options(&mut self) -> &mut crate::RequestOptions {
4210 &mut self.0.options
4211 }
4212 }
4213
4214 #[derive(Clone, Debug)]
4231 pub struct RotateServerCertificate(
4232 RequestBuilder<crate::model::SqlInstancesRotateServerCertificateRequest>,
4233 );
4234
4235 impl RotateServerCertificate {
4236 pub(crate) fn new(
4237 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4238 ) -> Self {
4239 Self(RequestBuilder::new(stub))
4240 }
4241
4242 pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCertificateRequest>>(
4244 mut self,
4245 v: V,
4246 ) -> Self {
4247 self.0.request = v.into();
4248 self
4249 }
4250
4251 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4253 self.0.options = v.into();
4254 self
4255 }
4256
4257 pub async fn send(self) -> Result<crate::model::Operation> {
4259 (*self.0.stub)
4260 .rotate_server_certificate(self.0.request, self.0.options)
4261 .await
4262 .map(crate::Response::into_body)
4263 }
4264
4265 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4269 self.0.request.instance = v.into();
4270 self
4271 }
4272
4273 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4277 self.0.request.project = v.into();
4278 self
4279 }
4280
4281 pub fn set_body<T>(mut self, v: T) -> Self
4283 where
4284 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
4285 {
4286 self.0.request.body = std::option::Option::Some(v.into());
4287 self
4288 }
4289
4290 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4292 where
4293 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
4294 {
4295 self.0.request.body = v.map(|x| x.into());
4296 self
4297 }
4298
4299 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4301 self.0.request.location = v.into();
4302 self
4303 }
4304 }
4305
4306 #[doc(hidden)]
4307 impl crate::RequestBuilder for RotateServerCertificate {
4308 fn request_options(&mut self) -> &mut crate::RequestOptions {
4309 &mut self.0.options
4310 }
4311 }
4312
4313 #[derive(Clone, Debug)]
4330 pub struct RotateEntraIdCertificate(
4331 RequestBuilder<crate::model::SqlInstancesRotateEntraIdCertificateRequest>,
4332 );
4333
4334 impl RotateEntraIdCertificate {
4335 pub(crate) fn new(
4336 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4337 ) -> Self {
4338 Self(RequestBuilder::new(stub))
4339 }
4340
4341 pub fn with_request<V: Into<crate::model::SqlInstancesRotateEntraIdCertificateRequest>>(
4343 mut self,
4344 v: V,
4345 ) -> Self {
4346 self.0.request = v.into();
4347 self
4348 }
4349
4350 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4352 self.0.options = v.into();
4353 self
4354 }
4355
4356 pub async fn send(self) -> Result<crate::model::Operation> {
4358 (*self.0.stub)
4359 .rotate_entra_id_certificate(self.0.request, self.0.options)
4360 .await
4361 .map(crate::Response::into_body)
4362 }
4363
4364 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4368 self.0.request.instance = v.into();
4369 self
4370 }
4371
4372 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4376 self.0.request.project = v.into();
4377 self
4378 }
4379
4380 pub fn set_body<T>(mut self, v: T) -> Self
4382 where
4383 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
4384 {
4385 self.0.request.body = std::option::Option::Some(v.into());
4386 self
4387 }
4388
4389 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4391 where
4392 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
4393 {
4394 self.0.request.body = v.map(|x| x.into());
4395 self
4396 }
4397
4398 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4400 self.0.request.location = v.into();
4401 self
4402 }
4403 }
4404
4405 #[doc(hidden)]
4406 impl crate::RequestBuilder for RotateEntraIdCertificate {
4407 fn request_options(&mut self) -> &mut crate::RequestOptions {
4408 &mut self.0.options
4409 }
4410 }
4411
4412 #[derive(Clone, Debug)]
4429 pub struct StartReplica(RequestBuilder<crate::model::SqlInstancesStartReplicaRequest>);
4430
4431 impl StartReplica {
4432 pub(crate) fn new(
4433 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4434 ) -> Self {
4435 Self(RequestBuilder::new(stub))
4436 }
4437
4438 pub fn with_request<V: Into<crate::model::SqlInstancesStartReplicaRequest>>(
4440 mut self,
4441 v: V,
4442 ) -> Self {
4443 self.0.request = v.into();
4444 self
4445 }
4446
4447 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4449 self.0.options = v.into();
4450 self
4451 }
4452
4453 pub async fn send(self) -> Result<crate::model::Operation> {
4455 (*self.0.stub)
4456 .start_replica(self.0.request, self.0.options)
4457 .await
4458 .map(crate::Response::into_body)
4459 }
4460
4461 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4463 self.0.request.instance = v.into();
4464 self
4465 }
4466
4467 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4469 self.0.request.project = v.into();
4470 self
4471 }
4472
4473 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4475 self.0.request.location = v.into();
4476 self
4477 }
4478 }
4479
4480 #[doc(hidden)]
4481 impl crate::RequestBuilder for StartReplica {
4482 fn request_options(&mut self) -> &mut crate::RequestOptions {
4483 &mut self.0.options
4484 }
4485 }
4486
4487 #[derive(Clone, Debug)]
4504 pub struct StopReplica(RequestBuilder<crate::model::SqlInstancesStopReplicaRequest>);
4505
4506 impl StopReplica {
4507 pub(crate) fn new(
4508 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4509 ) -> Self {
4510 Self(RequestBuilder::new(stub))
4511 }
4512
4513 pub fn with_request<V: Into<crate::model::SqlInstancesStopReplicaRequest>>(
4515 mut self,
4516 v: V,
4517 ) -> Self {
4518 self.0.request = v.into();
4519 self
4520 }
4521
4522 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4524 self.0.options = v.into();
4525 self
4526 }
4527
4528 pub async fn send(self) -> Result<crate::model::Operation> {
4530 (*self.0.stub)
4531 .stop_replica(self.0.request, self.0.options)
4532 .await
4533 .map(crate::Response::into_body)
4534 }
4535
4536 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4538 self.0.request.instance = v.into();
4539 self
4540 }
4541
4542 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4544 self.0.request.project = v.into();
4545 self
4546 }
4547
4548 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4550 self.0.request.location = v.into();
4551 self
4552 }
4553 }
4554
4555 #[doc(hidden)]
4556 impl crate::RequestBuilder for StopReplica {
4557 fn request_options(&mut self) -> &mut crate::RequestOptions {
4558 &mut self.0.options
4559 }
4560 }
4561
4562 #[derive(Clone, Debug)]
4579 pub struct TruncateLog(RequestBuilder<crate::model::SqlInstancesTruncateLogRequest>);
4580
4581 impl TruncateLog {
4582 pub(crate) fn new(
4583 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4584 ) -> Self {
4585 Self(RequestBuilder::new(stub))
4586 }
4587
4588 pub fn with_request<V: Into<crate::model::SqlInstancesTruncateLogRequest>>(
4590 mut self,
4591 v: V,
4592 ) -> Self {
4593 self.0.request = v.into();
4594 self
4595 }
4596
4597 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4599 self.0.options = v.into();
4600 self
4601 }
4602
4603 pub async fn send(self) -> Result<crate::model::Operation> {
4605 (*self.0.stub)
4606 .truncate_log(self.0.request, self.0.options)
4607 .await
4608 .map(crate::Response::into_body)
4609 }
4610
4611 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4613 self.0.request.instance = v.into();
4614 self
4615 }
4616
4617 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4619 self.0.request.project = v.into();
4620 self
4621 }
4622
4623 pub fn set_body<T>(mut self, v: T) -> Self
4625 where
4626 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
4627 {
4628 self.0.request.body = std::option::Option::Some(v.into());
4629 self
4630 }
4631
4632 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4634 where
4635 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
4636 {
4637 self.0.request.body = v.map(|x| x.into());
4638 self
4639 }
4640
4641 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4643 self.0.request.location = v.into();
4644 self
4645 }
4646 }
4647
4648 #[doc(hidden)]
4649 impl crate::RequestBuilder for TruncateLog {
4650 fn request_options(&mut self) -> &mut crate::RequestOptions {
4651 &mut self.0.options
4652 }
4653 }
4654
4655 #[derive(Clone, Debug)]
4672 pub struct Update(RequestBuilder<crate::model::SqlInstancesUpdateRequest>);
4673
4674 impl Update {
4675 pub(crate) fn new(
4676 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4677 ) -> Self {
4678 Self(RequestBuilder::new(stub))
4679 }
4680
4681 pub fn with_request<V: Into<crate::model::SqlInstancesUpdateRequest>>(
4683 mut self,
4684 v: V,
4685 ) -> Self {
4686 self.0.request = v.into();
4687 self
4688 }
4689
4690 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4692 self.0.options = v.into();
4693 self
4694 }
4695
4696 pub async fn send(self) -> Result<crate::model::Operation> {
4698 (*self.0.stub)
4699 .update(self.0.request, self.0.options)
4700 .await
4701 .map(crate::Response::into_body)
4702 }
4703
4704 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4706 self.0.request.instance = v.into();
4707 self
4708 }
4709
4710 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4712 self.0.request.project = v.into();
4713 self
4714 }
4715
4716 pub fn set_body<T>(mut self, v: T) -> Self
4718 where
4719 T: std::convert::Into<crate::model::DatabaseInstance>,
4720 {
4721 self.0.request.body = std::option::Option::Some(v.into());
4722 self
4723 }
4724
4725 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4727 where
4728 T: std::convert::Into<crate::model::DatabaseInstance>,
4729 {
4730 self.0.request.body = v.map(|x| x.into());
4731 self
4732 }
4733
4734 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4736 self.0.request.location = v.into();
4737 self
4738 }
4739 }
4740
4741 #[doc(hidden)]
4742 impl crate::RequestBuilder for Update {
4743 fn request_options(&mut self) -> &mut crate::RequestOptions {
4744 &mut self.0.options
4745 }
4746 }
4747
4748 #[derive(Clone, Debug)]
4765 pub struct CreateEphemeral(
4766 RequestBuilder<crate::model::SqlInstancesCreateEphemeralCertRequest>,
4767 );
4768
4769 impl CreateEphemeral {
4770 pub(crate) fn new(
4771 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4772 ) -> Self {
4773 Self(RequestBuilder::new(stub))
4774 }
4775
4776 pub fn with_request<V: Into<crate::model::SqlInstancesCreateEphemeralCertRequest>>(
4778 mut self,
4779 v: V,
4780 ) -> Self {
4781 self.0.request = v.into();
4782 self
4783 }
4784
4785 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4787 self.0.options = v.into();
4788 self
4789 }
4790
4791 pub async fn send(self) -> Result<crate::model::SslCert> {
4793 (*self.0.stub)
4794 .create_ephemeral(self.0.request, self.0.options)
4795 .await
4796 .map(crate::Response::into_body)
4797 }
4798
4799 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4801 self.0.request.instance = v.into();
4802 self
4803 }
4804
4805 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4807 self.0.request.project = v.into();
4808 self
4809 }
4810
4811 pub fn set_body<T>(mut self, v: T) -> Self
4813 where
4814 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
4815 {
4816 self.0.request.body = std::option::Option::Some(v.into());
4817 self
4818 }
4819
4820 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4822 where
4823 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
4824 {
4825 self.0.request.body = v.map(|x| x.into());
4826 self
4827 }
4828
4829 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4831 self.0.request.location = v.into();
4832 self
4833 }
4834 }
4835
4836 #[doc(hidden)]
4837 impl crate::RequestBuilder for CreateEphemeral {
4838 fn request_options(&mut self) -> &mut crate::RequestOptions {
4839 &mut self.0.options
4840 }
4841 }
4842
4843 #[derive(Clone, Debug)]
4860 pub struct RescheduleMaintenance(
4861 RequestBuilder<crate::model::SqlInstancesRescheduleMaintenanceRequest>,
4862 );
4863
4864 impl RescheduleMaintenance {
4865 pub(crate) fn new(
4866 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4867 ) -> Self {
4868 Self(RequestBuilder::new(stub))
4869 }
4870
4871 pub fn with_request<V: Into<crate::model::SqlInstancesRescheduleMaintenanceRequest>>(
4873 mut self,
4874 v: V,
4875 ) -> Self {
4876 self.0.request = v.into();
4877 self
4878 }
4879
4880 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4882 self.0.options = v.into();
4883 self
4884 }
4885
4886 pub async fn send(self) -> Result<crate::model::Operation> {
4888 (*self.0.stub)
4889 .reschedule_maintenance(self.0.request, self.0.options)
4890 .await
4891 .map(crate::Response::into_body)
4892 }
4893
4894 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4896 self.0.request.instance = v.into();
4897 self
4898 }
4899
4900 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4902 self.0.request.project = v.into();
4903 self
4904 }
4905
4906 pub fn set_body<T>(mut self, v: T) -> Self
4908 where
4909 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4910 {
4911 self.0.request.body = std::option::Option::Some(v.into());
4912 self
4913 }
4914
4915 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4917 where
4918 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4919 {
4920 self.0.request.body = v.map(|x| x.into());
4921 self
4922 }
4923
4924 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4926 self.0.request.location = v.into();
4927 self
4928 }
4929 }
4930
4931 #[doc(hidden)]
4932 impl crate::RequestBuilder for RescheduleMaintenance {
4933 fn request_options(&mut self) -> &mut crate::RequestOptions {
4934 &mut self.0.options
4935 }
4936 }
4937
4938 #[derive(Clone, Debug)]
4955 pub struct VerifyExternalSyncSettings(
4956 RequestBuilder<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
4957 );
4958
4959 impl VerifyExternalSyncSettings {
4960 pub(crate) fn new(
4961 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4962 ) -> Self {
4963 Self(RequestBuilder::new(stub))
4964 }
4965
4966 pub fn with_request<
4968 V: Into<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
4969 >(
4970 mut self,
4971 v: V,
4972 ) -> Self {
4973 self.0.request = v.into();
4974 self
4975 }
4976
4977 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4979 self.0.options = v.into();
4980 self
4981 }
4982
4983 pub async fn send(
4985 self,
4986 ) -> Result<crate::model::SqlInstancesVerifyExternalSyncSettingsResponse> {
4987 (*self.0.stub)
4988 .verify_external_sync_settings(self.0.request, self.0.options)
4989 .await
4990 .map(crate::Response::into_body)
4991 }
4992
4993 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4995 self.0.request.instance = v.into();
4996 self
4997 }
4998
4999 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5001 self.0.request.project = v.into();
5002 self
5003 }
5004
5005 pub fn set_verify_connection_only<T: Into<bool>>(mut self, v: T) -> Self {
5007 self.0.request.verify_connection_only = v.into();
5008 self
5009 }
5010
5011 pub fn set_sync_mode<
5013 T: Into<
5014 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
5015 >,
5016 >(
5017 mut self,
5018 v: T,
5019 ) -> Self {
5020 self.0.request.sync_mode = v.into();
5021 self
5022 }
5023
5024 pub fn set_verify_replication_only<T: Into<bool>>(mut self, v: T) -> Self {
5026 self.0.request.verify_replication_only = v.into();
5027 self
5028 }
5029
5030 pub fn set_migration_type<
5032 T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
5033 >(
5034 mut self,
5035 v: T,
5036 ) -> Self {
5037 self.0.request.migration_type = v.into();
5038 self
5039 }
5040
5041 pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
5043 mut self,
5044 v: T,
5045 ) -> Self {
5046 self.0.request.sync_parallel_level = v.into();
5047 self
5048 }
5049
5050 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
5052 where
5053 T: std::iter::IntoIterator<Item = V>,
5054 V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
5055 {
5056 use std::iter::Iterator;
5057 self.0.request.selected_objects = v.into_iter().map(|i| i.into()).collect();
5058 self
5059 }
5060
5061 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5063 self.0.request.location = v.into();
5064 self
5065 }
5066
5067 pub fn set_sync_config<
5072 T: Into<
5073 Option<
5074 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
5075 >,
5076 >,
5077 >(
5078 mut self,
5079 v: T,
5080 ) -> Self {
5081 self.0.request.sync_config = v.into();
5082 self
5083 }
5084
5085 pub fn set_mysql_sync_config<
5091 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
5092 >(
5093 mut self,
5094 v: T,
5095 ) -> Self {
5096 self.0.request = self.0.request.set_mysql_sync_config(v);
5097 self
5098 }
5099 }
5100
5101 #[doc(hidden)]
5102 impl crate::RequestBuilder for VerifyExternalSyncSettings {
5103 fn request_options(&mut self) -> &mut crate::RequestOptions {
5104 &mut self.0.options
5105 }
5106 }
5107
5108 #[derive(Clone, Debug)]
5125 pub struct StartExternalSync(
5126 RequestBuilder<crate::model::SqlInstancesStartExternalSyncRequest>,
5127 );
5128
5129 impl StartExternalSync {
5130 pub(crate) fn new(
5131 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5132 ) -> Self {
5133 Self(RequestBuilder::new(stub))
5134 }
5135
5136 pub fn with_request<V: Into<crate::model::SqlInstancesStartExternalSyncRequest>>(
5138 mut self,
5139 v: V,
5140 ) -> Self {
5141 self.0.request = v.into();
5142 self
5143 }
5144
5145 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5147 self.0.options = v.into();
5148 self
5149 }
5150
5151 pub async fn send(self) -> Result<crate::model::Operation> {
5153 (*self.0.stub)
5154 .start_external_sync(self.0.request, self.0.options)
5155 .await
5156 .map(crate::Response::into_body)
5157 }
5158
5159 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5161 self.0.request.instance = v.into();
5162 self
5163 }
5164
5165 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5167 self.0.request.project = v.into();
5168 self
5169 }
5170
5171 pub fn set_sync_mode<
5173 T: Into<
5174 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
5175 >,
5176 >(
5177 mut self,
5178 v: T,
5179 ) -> Self {
5180 self.0.request.sync_mode = v.into();
5181 self
5182 }
5183
5184 pub fn set_skip_verification<T: Into<bool>>(mut self, v: T) -> Self {
5186 self.0.request.skip_verification = v.into();
5187 self
5188 }
5189
5190 pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
5192 mut self,
5193 v: T,
5194 ) -> Self {
5195 self.0.request.sync_parallel_level = v.into();
5196 self
5197 }
5198
5199 pub fn set_migration_type<
5201 T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
5202 >(
5203 mut self,
5204 v: T,
5205 ) -> Self {
5206 self.0.request.migration_type = v.into();
5207 self
5208 }
5209
5210 pub fn set_replica_overwrite_enabled<T: Into<bool>>(mut self, v: T) -> Self {
5212 self.0.request.replica_overwrite_enabled = v.into();
5213 self
5214 }
5215
5216 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5218 self.0.request.location = v.into();
5219 self
5220 }
5221
5222 pub fn set_sync_config<
5227 T: Into<Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>>,
5228 >(
5229 mut self,
5230 v: T,
5231 ) -> Self {
5232 self.0.request.sync_config = v.into();
5233 self
5234 }
5235
5236 pub fn set_mysql_sync_config<
5242 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
5243 >(
5244 mut self,
5245 v: T,
5246 ) -> Self {
5247 self.0.request = self.0.request.set_mysql_sync_config(v);
5248 self
5249 }
5250 }
5251
5252 #[doc(hidden)]
5253 impl crate::RequestBuilder for StartExternalSync {
5254 fn request_options(&mut self) -> &mut crate::RequestOptions {
5255 &mut self.0.options
5256 }
5257 }
5258
5259 #[derive(Clone, Debug)]
5276 pub struct PerformDiskShrink(
5277 RequestBuilder<crate::model::SqlInstancesPerformDiskShrinkRequest>,
5278 );
5279
5280 impl PerformDiskShrink {
5281 pub(crate) fn new(
5282 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5283 ) -> Self {
5284 Self(RequestBuilder::new(stub))
5285 }
5286
5287 pub fn with_request<V: Into<crate::model::SqlInstancesPerformDiskShrinkRequest>>(
5289 mut self,
5290 v: V,
5291 ) -> Self {
5292 self.0.request = v.into();
5293 self
5294 }
5295
5296 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5298 self.0.options = v.into();
5299 self
5300 }
5301
5302 pub async fn send(self) -> Result<crate::model::Operation> {
5304 (*self.0.stub)
5305 .perform_disk_shrink(self.0.request, self.0.options)
5306 .await
5307 .map(crate::Response::into_body)
5308 }
5309
5310 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5312 self.0.request.instance = v.into();
5313 self
5314 }
5315
5316 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5318 self.0.request.project = v.into();
5319 self
5320 }
5321
5322 pub fn set_body<T>(mut self, v: T) -> Self
5324 where
5325 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
5326 {
5327 self.0.request.body = std::option::Option::Some(v.into());
5328 self
5329 }
5330
5331 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5333 where
5334 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
5335 {
5336 self.0.request.body = v.map(|x| x.into());
5337 self
5338 }
5339
5340 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5342 self.0.request.location = v.into();
5343 self
5344 }
5345 }
5346
5347 #[doc(hidden)]
5348 impl crate::RequestBuilder for PerformDiskShrink {
5349 fn request_options(&mut self) -> &mut crate::RequestOptions {
5350 &mut self.0.options
5351 }
5352 }
5353
5354 #[derive(Clone, Debug)]
5371 pub struct GetDiskShrinkConfig(
5372 RequestBuilder<crate::model::SqlInstancesGetDiskShrinkConfigRequest>,
5373 );
5374
5375 impl GetDiskShrinkConfig {
5376 pub(crate) fn new(
5377 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5378 ) -> Self {
5379 Self(RequestBuilder::new(stub))
5380 }
5381
5382 pub fn with_request<V: Into<crate::model::SqlInstancesGetDiskShrinkConfigRequest>>(
5384 mut self,
5385 v: V,
5386 ) -> Self {
5387 self.0.request = v.into();
5388 self
5389 }
5390
5391 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5393 self.0.options = v.into();
5394 self
5395 }
5396
5397 pub async fn send(self) -> Result<crate::model::SqlInstancesGetDiskShrinkConfigResponse> {
5399 (*self.0.stub)
5400 .get_disk_shrink_config(self.0.request, self.0.options)
5401 .await
5402 .map(crate::Response::into_body)
5403 }
5404
5405 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5407 self.0.request.instance = v.into();
5408 self
5409 }
5410
5411 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5413 self.0.request.project = v.into();
5414 self
5415 }
5416
5417 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5419 self.0.request.location = v.into();
5420 self
5421 }
5422 }
5423
5424 #[doc(hidden)]
5425 impl crate::RequestBuilder for GetDiskShrinkConfig {
5426 fn request_options(&mut self) -> &mut crate::RequestOptions {
5427 &mut self.0.options
5428 }
5429 }
5430
5431 #[derive(Clone, Debug)]
5448 pub struct ResetReplicaSize(RequestBuilder<crate::model::SqlInstancesResetReplicaSizeRequest>);
5449
5450 impl ResetReplicaSize {
5451 pub(crate) fn new(
5452 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5453 ) -> Self {
5454 Self(RequestBuilder::new(stub))
5455 }
5456
5457 pub fn with_request<V: Into<crate::model::SqlInstancesResetReplicaSizeRequest>>(
5459 mut self,
5460 v: V,
5461 ) -> Self {
5462 self.0.request = v.into();
5463 self
5464 }
5465
5466 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5468 self.0.options = v.into();
5469 self
5470 }
5471
5472 pub async fn send(self) -> Result<crate::model::Operation> {
5474 (*self.0.stub)
5475 .reset_replica_size(self.0.request, self.0.options)
5476 .await
5477 .map(crate::Response::into_body)
5478 }
5479
5480 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5482 self.0.request.instance = v.into();
5483 self
5484 }
5485
5486 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5488 self.0.request.project = v.into();
5489 self
5490 }
5491
5492 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5494 self.0.request.location = v.into();
5495 self
5496 }
5497 }
5498
5499 #[doc(hidden)]
5500 impl crate::RequestBuilder for ResetReplicaSize {
5501 fn request_options(&mut self) -> &mut crate::RequestOptions {
5502 &mut self.0.options
5503 }
5504 }
5505
5506 #[derive(Clone, Debug)]
5523 pub struct GetLatestRecoveryTime(
5524 RequestBuilder<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>,
5525 );
5526
5527 impl GetLatestRecoveryTime {
5528 pub(crate) fn new(
5529 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5530 ) -> Self {
5531 Self(RequestBuilder::new(stub))
5532 }
5533
5534 pub fn with_request<V: Into<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>>(
5536 mut self,
5537 v: V,
5538 ) -> Self {
5539 self.0.request = v.into();
5540 self
5541 }
5542
5543 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5545 self.0.options = v.into();
5546 self
5547 }
5548
5549 pub async fn send(self) -> Result<crate::model::SqlInstancesGetLatestRecoveryTimeResponse> {
5551 (*self.0.stub)
5552 .get_latest_recovery_time(self.0.request, self.0.options)
5553 .await
5554 .map(crate::Response::into_body)
5555 }
5556
5557 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5559 self.0.request.instance = v.into();
5560 self
5561 }
5562
5563 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5565 self.0.request.project = v.into();
5566 self
5567 }
5568
5569 pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
5571 where
5572 T: std::convert::Into<wkt::Timestamp>,
5573 {
5574 self.0.request.source_instance_deletion_time = std::option::Option::Some(v.into());
5575 self
5576 }
5577
5578 pub fn set_or_clear_source_instance_deletion_time<T>(
5580 mut self,
5581 v: std::option::Option<T>,
5582 ) -> Self
5583 where
5584 T: std::convert::Into<wkt::Timestamp>,
5585 {
5586 self.0.request.source_instance_deletion_time = v.map(|x| x.into());
5587 self
5588 }
5589
5590 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5592 self.0.request.location = v.into();
5593 self
5594 }
5595 }
5596
5597 #[doc(hidden)]
5598 impl crate::RequestBuilder for GetLatestRecoveryTime {
5599 fn request_options(&mut self) -> &mut crate::RequestOptions {
5600 &mut self.0.options
5601 }
5602 }
5603
5604 #[derive(Clone, Debug)]
5621 pub struct ExecuteSql(RequestBuilder<crate::model::SqlInstancesExecuteSqlRequest>);
5622
5623 impl ExecuteSql {
5624 pub(crate) fn new(
5625 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5626 ) -> Self {
5627 Self(RequestBuilder::new(stub))
5628 }
5629
5630 pub fn with_request<V: Into<crate::model::SqlInstancesExecuteSqlRequest>>(
5632 mut self,
5633 v: V,
5634 ) -> Self {
5635 self.0.request = v.into();
5636 self
5637 }
5638
5639 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5641 self.0.options = v.into();
5642 self
5643 }
5644
5645 pub async fn send(self) -> Result<crate::model::SqlInstancesExecuteSqlResponse> {
5647 (*self.0.stub)
5648 .execute_sql(self.0.request, self.0.options)
5649 .await
5650 .map(crate::Response::into_body)
5651 }
5652
5653 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5657 self.0.request.instance = v.into();
5658 self
5659 }
5660
5661 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5665 self.0.request.project = v.into();
5666 self
5667 }
5668
5669 pub fn set_body<T>(mut self, v: T) -> Self
5671 where
5672 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
5673 {
5674 self.0.request.body = std::option::Option::Some(v.into());
5675 self
5676 }
5677
5678 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5680 where
5681 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
5682 {
5683 self.0.request.body = v.map(|x| x.into());
5684 self
5685 }
5686
5687 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5689 self.0.request.location = v.into();
5690 self
5691 }
5692 }
5693
5694 #[doc(hidden)]
5695 impl crate::RequestBuilder for ExecuteSql {
5696 fn request_options(&mut self) -> &mut crate::RequestOptions {
5697 &mut self.0.options
5698 }
5699 }
5700
5701 #[derive(Clone, Debug)]
5718 pub struct AcquireSsrsLease(RequestBuilder<crate::model::SqlInstancesAcquireSsrsLeaseRequest>);
5719
5720 impl AcquireSsrsLease {
5721 pub(crate) fn new(
5722 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5723 ) -> Self {
5724 Self(RequestBuilder::new(stub))
5725 }
5726
5727 pub fn with_request<V: Into<crate::model::SqlInstancesAcquireSsrsLeaseRequest>>(
5729 mut self,
5730 v: V,
5731 ) -> Self {
5732 self.0.request = v.into();
5733 self
5734 }
5735
5736 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5738 self.0.options = v.into();
5739 self
5740 }
5741
5742 pub async fn send(self) -> Result<crate::model::SqlInstancesAcquireSsrsLeaseResponse> {
5744 (*self.0.stub)
5745 .acquire_ssrs_lease(self.0.request, self.0.options)
5746 .await
5747 .map(crate::Response::into_body)
5748 }
5749
5750 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5754 self.0.request.instance = v.into();
5755 self
5756 }
5757
5758 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5762 self.0.request.project = v.into();
5763 self
5764 }
5765
5766 pub fn set_body<T>(mut self, v: T) -> Self
5770 where
5771 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
5772 {
5773 self.0.request.body = std::option::Option::Some(v.into());
5774 self
5775 }
5776
5777 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5781 where
5782 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
5783 {
5784 self.0.request.body = v.map(|x| x.into());
5785 self
5786 }
5787
5788 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5790 self.0.request.location = v.into();
5791 self
5792 }
5793 }
5794
5795 #[doc(hidden)]
5796 impl crate::RequestBuilder for AcquireSsrsLease {
5797 fn request_options(&mut self) -> &mut crate::RequestOptions {
5798 &mut self.0.options
5799 }
5800 }
5801
5802 #[derive(Clone, Debug)]
5819 pub struct ReleaseSsrsLease(RequestBuilder<crate::model::SqlInstancesReleaseSsrsLeaseRequest>);
5820
5821 impl ReleaseSsrsLease {
5822 pub(crate) fn new(
5823 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5824 ) -> Self {
5825 Self(RequestBuilder::new(stub))
5826 }
5827
5828 pub fn with_request<V: Into<crate::model::SqlInstancesReleaseSsrsLeaseRequest>>(
5830 mut self,
5831 v: V,
5832 ) -> Self {
5833 self.0.request = v.into();
5834 self
5835 }
5836
5837 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5839 self.0.options = v.into();
5840 self
5841 }
5842
5843 pub async fn send(self) -> Result<crate::model::SqlInstancesReleaseSsrsLeaseResponse> {
5845 (*self.0.stub)
5846 .release_ssrs_lease(self.0.request, self.0.options)
5847 .await
5848 .map(crate::Response::into_body)
5849 }
5850
5851 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5855 self.0.request.instance = v.into();
5856 self
5857 }
5858
5859 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5863 self.0.request.project = v.into();
5864 self
5865 }
5866
5867 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5869 self.0.request.location = v.into();
5870 self
5871 }
5872 }
5873
5874 #[doc(hidden)]
5875 impl crate::RequestBuilder for ReleaseSsrsLease {
5876 fn request_options(&mut self) -> &mut crate::RequestOptions {
5877 &mut self.0.options
5878 }
5879 }
5880
5881 #[derive(Clone, Debug)]
5898 pub struct PreCheckMajorVersionUpgrade(
5899 RequestBuilder<crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest>,
5900 );
5901
5902 impl PreCheckMajorVersionUpgrade {
5903 pub(crate) fn new(
5904 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5905 ) -> Self {
5906 Self(RequestBuilder::new(stub))
5907 }
5908
5909 pub fn with_request<
5911 V: Into<crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest>,
5912 >(
5913 mut self,
5914 v: V,
5915 ) -> Self {
5916 self.0.request = v.into();
5917 self
5918 }
5919
5920 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5922 self.0.options = v.into();
5923 self
5924 }
5925
5926 pub async fn send(self) -> Result<crate::model::Operation> {
5928 (*self.0.stub)
5929 .pre_check_major_version_upgrade(self.0.request, self.0.options)
5930 .await
5931 .map(crate::Response::into_body)
5932 }
5933
5934 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5938 self.0.request.instance = v.into();
5939 self
5940 }
5941
5942 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5946 self.0.request.project = v.into();
5947 self
5948 }
5949
5950 pub fn set_body<T>(mut self, v: T) -> Self
5954 where
5955 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
5956 {
5957 self.0.request.body = std::option::Option::Some(v.into());
5958 self
5959 }
5960
5961 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5965 where
5966 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
5967 {
5968 self.0.request.body = v.map(|x| x.into());
5969 self
5970 }
5971
5972 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5974 self.0.request.location = v.into();
5975 self
5976 }
5977 }
5978
5979 #[doc(hidden)]
5980 impl crate::RequestBuilder for PreCheckMajorVersionUpgrade {
5981 fn request_options(&mut self) -> &mut crate::RequestOptions {
5982 &mut self.0.options
5983 }
5984 }
5985
5986 #[derive(Clone, Debug)]
6003 pub struct PointInTimeRestore(
6004 RequestBuilder<crate::model::SqlInstancesPointInTimeRestoreRequest>,
6005 );
6006
6007 impl PointInTimeRestore {
6008 pub(crate) fn new(
6009 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
6010 ) -> Self {
6011 Self(RequestBuilder::new(stub))
6012 }
6013
6014 pub fn with_request<V: Into<crate::model::SqlInstancesPointInTimeRestoreRequest>>(
6016 mut self,
6017 v: V,
6018 ) -> Self {
6019 self.0.request = v.into();
6020 self
6021 }
6022
6023 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6025 self.0.options = v.into();
6026 self
6027 }
6028
6029 pub async fn send(self) -> Result<crate::model::Operation> {
6031 (*self.0.stub)
6032 .point_in_time_restore(self.0.request, self.0.options)
6033 .await
6034 .map(crate::Response::into_body)
6035 }
6036
6037 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6041 self.0.request.parent = v.into();
6042 self
6043 }
6044
6045 pub fn set_context<T>(mut self, v: T) -> Self
6049 where
6050 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
6051 {
6052 self.0.request.context = std::option::Option::Some(v.into());
6053 self
6054 }
6055
6056 pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
6060 where
6061 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
6062 {
6063 self.0.request.context = v.map(|x| x.into());
6064 self
6065 }
6066 }
6067
6068 #[doc(hidden)]
6069 impl crate::RequestBuilder for PointInTimeRestore {
6070 fn request_options(&mut self) -> &mut crate::RequestOptions {
6071 &mut self.0.options
6072 }
6073 }
6074}
6075
6076pub mod sql_operations_service {
6078 use crate::Result;
6079
6080 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6094
6095 pub(crate) mod client {
6096 use super::super::super::client::SqlOperationsService;
6097 pub struct Factory;
6098 impl crate::ClientFactory for Factory {
6099 type Client = SqlOperationsService;
6100 type Credentials = gaxi::options::Credentials;
6101 async fn build(
6102 self,
6103 config: gaxi::options::ClientConfig,
6104 ) -> crate::ClientBuilderResult<Self::Client> {
6105 Self::Client::new(config).await
6106 }
6107 }
6108 }
6109
6110 #[derive(Clone, Debug)]
6112 pub(crate) struct RequestBuilder<R: std::default::Default> {
6113 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
6114 request: R,
6115 options: crate::RequestOptions,
6116 }
6117
6118 impl<R> RequestBuilder<R>
6119 where
6120 R: std::default::Default,
6121 {
6122 pub(crate) fn new(
6123 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
6124 ) -> Self {
6125 Self {
6126 stub,
6127 request: R::default(),
6128 options: crate::RequestOptions::default(),
6129 }
6130 }
6131 }
6132
6133 #[derive(Clone, Debug)]
6150 pub struct Get(RequestBuilder<crate::model::SqlOperationsGetRequest>);
6151
6152 impl Get {
6153 pub(crate) fn new(
6154 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
6155 ) -> Self {
6156 Self(RequestBuilder::new(stub))
6157 }
6158
6159 pub fn with_request<V: Into<crate::model::SqlOperationsGetRequest>>(
6161 mut self,
6162 v: V,
6163 ) -> Self {
6164 self.0.request = v.into();
6165 self
6166 }
6167
6168 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6170 self.0.options = v.into();
6171 self
6172 }
6173
6174 pub async fn send(self) -> Result<crate::model::Operation> {
6176 (*self.0.stub)
6177 .get(self.0.request, self.0.options)
6178 .await
6179 .map(crate::Response::into_body)
6180 }
6181
6182 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
6186 self.0.request.operation = v.into();
6187 self
6188 }
6189
6190 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6194 self.0.request.project = v.into();
6195 self
6196 }
6197
6198 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6200 self.0.request.location = v.into();
6201 self
6202 }
6203 }
6204
6205 #[doc(hidden)]
6206 impl crate::RequestBuilder for Get {
6207 fn request_options(&mut self) -> &mut crate::RequestOptions {
6208 &mut self.0.options
6209 }
6210 }
6211
6212 #[derive(Clone, Debug)]
6233 pub struct List(RequestBuilder<crate::model::SqlOperationsListRequest>);
6234
6235 impl List {
6236 pub(crate) fn new(
6237 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
6238 ) -> Self {
6239 Self(RequestBuilder::new(stub))
6240 }
6241
6242 pub fn with_request<V: Into<crate::model::SqlOperationsListRequest>>(
6244 mut self,
6245 v: V,
6246 ) -> Self {
6247 self.0.request = v.into();
6248 self
6249 }
6250
6251 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6253 self.0.options = v.into();
6254 self
6255 }
6256
6257 pub async fn send(self) -> Result<crate::model::OperationsListResponse> {
6259 (*self.0.stub)
6260 .list(self.0.request, self.0.options)
6261 .await
6262 .map(crate::Response::into_body)
6263 }
6264
6265 pub fn by_page(
6267 self,
6268 ) -> impl google_cloud_gax::paginator::Paginator<
6269 crate::model::OperationsListResponse,
6270 crate::Error,
6271 > {
6272 use std::clone::Clone;
6273 let token = self.0.request.page_token.clone();
6274 let execute = move |token: String| {
6275 let mut builder = self.clone();
6276 builder.0.request = builder.0.request.set_page_token(token);
6277 builder.send()
6278 };
6279 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6280 }
6281
6282 pub fn by_item(
6284 self,
6285 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6286 crate::model::OperationsListResponse,
6287 crate::Error,
6288 > {
6289 use google_cloud_gax::paginator::Paginator;
6290 self.by_page().items()
6291 }
6292
6293 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6295 self.0.request.instance = v.into();
6296 self
6297 }
6298
6299 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
6301 self.0.request.max_results = v.into();
6302 self
6303 }
6304
6305 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6307 self.0.request.page_token = v.into();
6308 self
6309 }
6310
6311 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6313 self.0.request.project = v.into();
6314 self
6315 }
6316
6317 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6319 self.0.request.location = v.into();
6320 self
6321 }
6322 }
6323
6324 #[doc(hidden)]
6325 impl crate::RequestBuilder for List {
6326 fn request_options(&mut self) -> &mut crate::RequestOptions {
6327 &mut self.0.options
6328 }
6329 }
6330
6331 #[derive(Clone, Debug)]
6348 pub struct Cancel(RequestBuilder<crate::model::SqlOperationsCancelRequest>);
6349
6350 impl Cancel {
6351 pub(crate) fn new(
6352 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
6353 ) -> Self {
6354 Self(RequestBuilder::new(stub))
6355 }
6356
6357 pub fn with_request<V: Into<crate::model::SqlOperationsCancelRequest>>(
6359 mut self,
6360 v: V,
6361 ) -> Self {
6362 self.0.request = v.into();
6363 self
6364 }
6365
6366 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6368 self.0.options = v.into();
6369 self
6370 }
6371
6372 pub async fn send(self) -> Result<()> {
6374 (*self.0.stub)
6375 .cancel(self.0.request, self.0.options)
6376 .await
6377 .map(crate::Response::into_body)
6378 }
6379
6380 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
6382 self.0.request.operation = v.into();
6383 self
6384 }
6385
6386 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6388 self.0.request.project = v.into();
6389 self
6390 }
6391
6392 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6394 self.0.request.location = v.into();
6395 self
6396 }
6397 }
6398
6399 #[doc(hidden)]
6400 impl crate::RequestBuilder for Cancel {
6401 fn request_options(&mut self) -> &mut crate::RequestOptions {
6402 &mut self.0.options
6403 }
6404 }
6405}
6406
6407pub mod sql_ssl_certs_service {
6409 use crate::Result;
6410
6411 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6425
6426 pub(crate) mod client {
6427 use super::super::super::client::SqlSslCertsService;
6428 pub struct Factory;
6429 impl crate::ClientFactory for Factory {
6430 type Client = SqlSslCertsService;
6431 type Credentials = gaxi::options::Credentials;
6432 async fn build(
6433 self,
6434 config: gaxi::options::ClientConfig,
6435 ) -> crate::ClientBuilderResult<Self::Client> {
6436 Self::Client::new(config).await
6437 }
6438 }
6439 }
6440
6441 #[derive(Clone, Debug)]
6443 pub(crate) struct RequestBuilder<R: std::default::Default> {
6444 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6445 request: R,
6446 options: crate::RequestOptions,
6447 }
6448
6449 impl<R> RequestBuilder<R>
6450 where
6451 R: std::default::Default,
6452 {
6453 pub(crate) fn new(
6454 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6455 ) -> Self {
6456 Self {
6457 stub,
6458 request: R::default(),
6459 options: crate::RequestOptions::default(),
6460 }
6461 }
6462 }
6463
6464 #[derive(Clone, Debug)]
6481 pub struct Delete(RequestBuilder<crate::model::SqlSslCertsDeleteRequest>);
6482
6483 impl Delete {
6484 pub(crate) fn new(
6485 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6486 ) -> Self {
6487 Self(RequestBuilder::new(stub))
6488 }
6489
6490 pub fn with_request<V: Into<crate::model::SqlSslCertsDeleteRequest>>(
6492 mut self,
6493 v: V,
6494 ) -> Self {
6495 self.0.request = v.into();
6496 self
6497 }
6498
6499 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6501 self.0.options = v.into();
6502 self
6503 }
6504
6505 pub async fn send(self) -> Result<crate::model::Operation> {
6507 (*self.0.stub)
6508 .delete(self.0.request, self.0.options)
6509 .await
6510 .map(crate::Response::into_body)
6511 }
6512
6513 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6515 self.0.request.instance = v.into();
6516 self
6517 }
6518
6519 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6521 self.0.request.project = v.into();
6522 self
6523 }
6524
6525 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6527 self.0.request.sha1_fingerprint = v.into();
6528 self
6529 }
6530 }
6531
6532 #[doc(hidden)]
6533 impl crate::RequestBuilder for Delete {
6534 fn request_options(&mut self) -> &mut crate::RequestOptions {
6535 &mut self.0.options
6536 }
6537 }
6538
6539 #[derive(Clone, Debug)]
6556 pub struct Get(RequestBuilder<crate::model::SqlSslCertsGetRequest>);
6557
6558 impl Get {
6559 pub(crate) fn new(
6560 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6561 ) -> Self {
6562 Self(RequestBuilder::new(stub))
6563 }
6564
6565 pub fn with_request<V: Into<crate::model::SqlSslCertsGetRequest>>(mut self, v: V) -> Self {
6567 self.0.request = v.into();
6568 self
6569 }
6570
6571 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6573 self.0.options = v.into();
6574 self
6575 }
6576
6577 pub async fn send(self) -> Result<crate::model::SslCert> {
6579 (*self.0.stub)
6580 .get(self.0.request, self.0.options)
6581 .await
6582 .map(crate::Response::into_body)
6583 }
6584
6585 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6587 self.0.request.instance = v.into();
6588 self
6589 }
6590
6591 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6593 self.0.request.project = v.into();
6594 self
6595 }
6596
6597 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6599 self.0.request.sha1_fingerprint = v.into();
6600 self
6601 }
6602 }
6603
6604 #[doc(hidden)]
6605 impl crate::RequestBuilder for Get {
6606 fn request_options(&mut self) -> &mut crate::RequestOptions {
6607 &mut self.0.options
6608 }
6609 }
6610
6611 #[derive(Clone, Debug)]
6628 pub struct Insert(RequestBuilder<crate::model::SqlSslCertsInsertRequest>);
6629
6630 impl Insert {
6631 pub(crate) fn new(
6632 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6633 ) -> Self {
6634 Self(RequestBuilder::new(stub))
6635 }
6636
6637 pub fn with_request<V: Into<crate::model::SqlSslCertsInsertRequest>>(
6639 mut self,
6640 v: V,
6641 ) -> Self {
6642 self.0.request = v.into();
6643 self
6644 }
6645
6646 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6648 self.0.options = v.into();
6649 self
6650 }
6651
6652 pub async fn send(self) -> Result<crate::model::SslCertsInsertResponse> {
6654 (*self.0.stub)
6655 .insert(self.0.request, self.0.options)
6656 .await
6657 .map(crate::Response::into_body)
6658 }
6659
6660 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6662 self.0.request.instance = v.into();
6663 self
6664 }
6665
6666 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6668 self.0.request.project = v.into();
6669 self
6670 }
6671
6672 pub fn set_body<T>(mut self, v: T) -> Self
6674 where
6675 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6676 {
6677 self.0.request.body = std::option::Option::Some(v.into());
6678 self
6679 }
6680
6681 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6683 where
6684 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6685 {
6686 self.0.request.body = v.map(|x| x.into());
6687 self
6688 }
6689 }
6690
6691 #[doc(hidden)]
6692 impl crate::RequestBuilder for Insert {
6693 fn request_options(&mut self) -> &mut crate::RequestOptions {
6694 &mut self.0.options
6695 }
6696 }
6697
6698 #[derive(Clone, Debug)]
6715 pub struct List(RequestBuilder<crate::model::SqlSslCertsListRequest>);
6716
6717 impl List {
6718 pub(crate) fn new(
6719 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6720 ) -> Self {
6721 Self(RequestBuilder::new(stub))
6722 }
6723
6724 pub fn with_request<V: Into<crate::model::SqlSslCertsListRequest>>(mut self, v: V) -> Self {
6726 self.0.request = v.into();
6727 self
6728 }
6729
6730 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6732 self.0.options = v.into();
6733 self
6734 }
6735
6736 pub async fn send(self) -> Result<crate::model::SslCertsListResponse> {
6738 (*self.0.stub)
6739 .list(self.0.request, self.0.options)
6740 .await
6741 .map(crate::Response::into_body)
6742 }
6743
6744 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6746 self.0.request.instance = v.into();
6747 self
6748 }
6749
6750 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6752 self.0.request.project = v.into();
6753 self
6754 }
6755 }
6756
6757 #[doc(hidden)]
6758 impl crate::RequestBuilder for List {
6759 fn request_options(&mut self) -> &mut crate::RequestOptions {
6760 &mut self.0.options
6761 }
6762 }
6763}
6764
6765pub mod sql_tiers_service {
6767 use crate::Result;
6768
6769 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6783
6784 pub(crate) mod client {
6785 use super::super::super::client::SqlTiersService;
6786 pub struct Factory;
6787 impl crate::ClientFactory for Factory {
6788 type Client = SqlTiersService;
6789 type Credentials = gaxi::options::Credentials;
6790 async fn build(
6791 self,
6792 config: gaxi::options::ClientConfig,
6793 ) -> crate::ClientBuilderResult<Self::Client> {
6794 Self::Client::new(config).await
6795 }
6796 }
6797 }
6798
6799 #[derive(Clone, Debug)]
6801 pub(crate) struct RequestBuilder<R: std::default::Default> {
6802 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6803 request: R,
6804 options: crate::RequestOptions,
6805 }
6806
6807 impl<R> RequestBuilder<R>
6808 where
6809 R: std::default::Default,
6810 {
6811 pub(crate) fn new(
6812 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6813 ) -> Self {
6814 Self {
6815 stub,
6816 request: R::default(),
6817 options: crate::RequestOptions::default(),
6818 }
6819 }
6820 }
6821
6822 #[derive(Clone, Debug)]
6839 pub struct List(RequestBuilder<crate::model::SqlTiersListRequest>);
6840
6841 impl List {
6842 pub(crate) fn new(
6843 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6844 ) -> Self {
6845 Self(RequestBuilder::new(stub))
6846 }
6847
6848 pub fn with_request<V: Into<crate::model::SqlTiersListRequest>>(mut self, v: V) -> Self {
6850 self.0.request = v.into();
6851 self
6852 }
6853
6854 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6856 self.0.options = v.into();
6857 self
6858 }
6859
6860 pub async fn send(self) -> Result<crate::model::TiersListResponse> {
6862 (*self.0.stub)
6863 .list(self.0.request, self.0.options)
6864 .await
6865 .map(crate::Response::into_body)
6866 }
6867
6868 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6870 self.0.request.project = v.into();
6871 self
6872 }
6873 }
6874
6875 #[doc(hidden)]
6876 impl crate::RequestBuilder for List {
6877 fn request_options(&mut self) -> &mut crate::RequestOptions {
6878 &mut self.0.options
6879 }
6880 }
6881}
6882
6883pub mod sql_users_service {
6885 use crate::Result;
6886
6887 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6901
6902 pub(crate) mod client {
6903 use super::super::super::client::SqlUsersService;
6904 pub struct Factory;
6905 impl crate::ClientFactory for Factory {
6906 type Client = SqlUsersService;
6907 type Credentials = gaxi::options::Credentials;
6908 async fn build(
6909 self,
6910 config: gaxi::options::ClientConfig,
6911 ) -> crate::ClientBuilderResult<Self::Client> {
6912 Self::Client::new(config).await
6913 }
6914 }
6915 }
6916
6917 #[derive(Clone, Debug)]
6919 pub(crate) struct RequestBuilder<R: std::default::Default> {
6920 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6921 request: R,
6922 options: crate::RequestOptions,
6923 }
6924
6925 impl<R> RequestBuilder<R>
6926 where
6927 R: std::default::Default,
6928 {
6929 pub(crate) fn new(
6930 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6931 ) -> Self {
6932 Self {
6933 stub,
6934 request: R::default(),
6935 options: crate::RequestOptions::default(),
6936 }
6937 }
6938 }
6939
6940 #[derive(Clone, Debug)]
6957 pub struct Delete(RequestBuilder<crate::model::SqlUsersDeleteRequest>);
6958
6959 impl Delete {
6960 pub(crate) fn new(
6961 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6962 ) -> Self {
6963 Self(RequestBuilder::new(stub))
6964 }
6965
6966 pub fn with_request<V: Into<crate::model::SqlUsersDeleteRequest>>(mut self, v: V) -> Self {
6968 self.0.request = v.into();
6969 self
6970 }
6971
6972 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6974 self.0.options = v.into();
6975 self
6976 }
6977
6978 pub async fn send(self) -> Result<crate::model::Operation> {
6980 (*self.0.stub)
6981 .delete(self.0.request, self.0.options)
6982 .await
6983 .map(crate::Response::into_body)
6984 }
6985
6986 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6988 self.0.request.host = v.into();
6989 self
6990 }
6991
6992 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6994 self.0.request.instance = v.into();
6995 self
6996 }
6997
6998 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7000 self.0.request.name = v.into();
7001 self
7002 }
7003
7004 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7006 self.0.request.project = v.into();
7007 self
7008 }
7009
7010 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
7012 self.0.request.location = v.into();
7013 self
7014 }
7015 }
7016
7017 #[doc(hidden)]
7018 impl crate::RequestBuilder for Delete {
7019 fn request_options(&mut self) -> &mut crate::RequestOptions {
7020 &mut self.0.options
7021 }
7022 }
7023
7024 #[derive(Clone, Debug)]
7041 pub struct Get(RequestBuilder<crate::model::SqlUsersGetRequest>);
7042
7043 impl Get {
7044 pub(crate) fn new(
7045 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
7046 ) -> Self {
7047 Self(RequestBuilder::new(stub))
7048 }
7049
7050 pub fn with_request<V: Into<crate::model::SqlUsersGetRequest>>(mut self, v: V) -> Self {
7052 self.0.request = v.into();
7053 self
7054 }
7055
7056 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7058 self.0.options = v.into();
7059 self
7060 }
7061
7062 pub async fn send(self) -> Result<crate::model::User> {
7064 (*self.0.stub)
7065 .get(self.0.request, self.0.options)
7066 .await
7067 .map(crate::Response::into_body)
7068 }
7069
7070 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7072 self.0.request.instance = v.into();
7073 self
7074 }
7075
7076 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7078 self.0.request.name = v.into();
7079 self
7080 }
7081
7082 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7084 self.0.request.project = v.into();
7085 self
7086 }
7087
7088 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
7090 self.0.request.host = v.into();
7091 self
7092 }
7093
7094 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
7096 self.0.request.location = v.into();
7097 self
7098 }
7099 }
7100
7101 #[doc(hidden)]
7102 impl crate::RequestBuilder for Get {
7103 fn request_options(&mut self) -> &mut crate::RequestOptions {
7104 &mut self.0.options
7105 }
7106 }
7107
7108 #[derive(Clone, Debug)]
7125 pub struct Insert(RequestBuilder<crate::model::SqlUsersInsertRequest>);
7126
7127 impl Insert {
7128 pub(crate) fn new(
7129 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
7130 ) -> Self {
7131 Self(RequestBuilder::new(stub))
7132 }
7133
7134 pub fn with_request<V: Into<crate::model::SqlUsersInsertRequest>>(mut self, v: V) -> Self {
7136 self.0.request = v.into();
7137 self
7138 }
7139
7140 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7142 self.0.options = v.into();
7143 self
7144 }
7145
7146 pub async fn send(self) -> Result<crate::model::Operation> {
7148 (*self.0.stub)
7149 .insert(self.0.request, self.0.options)
7150 .await
7151 .map(crate::Response::into_body)
7152 }
7153
7154 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7156 self.0.request.instance = v.into();
7157 self
7158 }
7159
7160 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7162 self.0.request.project = v.into();
7163 self
7164 }
7165
7166 pub fn set_body<T>(mut self, v: T) -> Self
7168 where
7169 T: std::convert::Into<crate::model::User>,
7170 {
7171 self.0.request.body = std::option::Option::Some(v.into());
7172 self
7173 }
7174
7175 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7177 where
7178 T: std::convert::Into<crate::model::User>,
7179 {
7180 self.0.request.body = v.map(|x| x.into());
7181 self
7182 }
7183
7184 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
7186 self.0.request.location = v.into();
7187 self
7188 }
7189 }
7190
7191 #[doc(hidden)]
7192 impl crate::RequestBuilder for Insert {
7193 fn request_options(&mut self) -> &mut crate::RequestOptions {
7194 &mut self.0.options
7195 }
7196 }
7197
7198 #[derive(Clone, Debug)]
7215 pub struct List(RequestBuilder<crate::model::SqlUsersListRequest>);
7216
7217 impl List {
7218 pub(crate) fn new(
7219 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
7220 ) -> Self {
7221 Self(RequestBuilder::new(stub))
7222 }
7223
7224 pub fn with_request<V: Into<crate::model::SqlUsersListRequest>>(mut self, v: V) -> Self {
7226 self.0.request = v.into();
7227 self
7228 }
7229
7230 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7232 self.0.options = v.into();
7233 self
7234 }
7235
7236 pub async fn send(self) -> Result<crate::model::UsersListResponse> {
7238 (*self.0.stub)
7239 .list(self.0.request, self.0.options)
7240 .await
7241 .map(crate::Response::into_body)
7242 }
7243
7244 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7246 self.0.request.instance = v.into();
7247 self
7248 }
7249
7250 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7252 self.0.request.project = v.into();
7253 self
7254 }
7255
7256 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
7258 self.0.request.location = v.into();
7259 self
7260 }
7261 }
7262
7263 #[doc(hidden)]
7264 impl crate::RequestBuilder for List {
7265 fn request_options(&mut self) -> &mut crate::RequestOptions {
7266 &mut self.0.options
7267 }
7268 }
7269
7270 #[derive(Clone, Debug)]
7287 pub struct Update(RequestBuilder<crate::model::SqlUsersUpdateRequest>);
7288
7289 impl Update {
7290 pub(crate) fn new(
7291 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
7292 ) -> Self {
7293 Self(RequestBuilder::new(stub))
7294 }
7295
7296 pub fn with_request<V: Into<crate::model::SqlUsersUpdateRequest>>(mut self, v: V) -> Self {
7298 self.0.request = v.into();
7299 self
7300 }
7301
7302 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7304 self.0.options = v.into();
7305 self
7306 }
7307
7308 pub async fn send(self) -> Result<crate::model::Operation> {
7310 (*self.0.stub)
7311 .update(self.0.request, self.0.options)
7312 .await
7313 .map(crate::Response::into_body)
7314 }
7315
7316 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
7318 self.0.request.host = v.into();
7319 self
7320 }
7321
7322 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7324 self.0.request.instance = v.into();
7325 self
7326 }
7327
7328 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7330 self.0.request.name = v.into();
7331 self
7332 }
7333
7334 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7336 self.0.request.project = v.into();
7337 self
7338 }
7339
7340 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
7342 where
7343 T: std::iter::IntoIterator<Item = V>,
7344 V: std::convert::Into<std::string::String>,
7345 {
7346 use std::iter::Iterator;
7347 self.0.request.database_roles = v.into_iter().map(|i| i.into()).collect();
7348 self
7349 }
7350
7351 pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
7353 where
7354 T: std::convert::Into<bool>,
7355 {
7356 self.0.request.revoke_existing_roles = std::option::Option::Some(v.into());
7357 self
7358 }
7359
7360 pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
7362 where
7363 T: std::convert::Into<bool>,
7364 {
7365 self.0.request.revoke_existing_roles = v.map(|x| x.into());
7366 self
7367 }
7368
7369 pub fn set_server_roles<T, V>(mut self, v: T) -> Self
7371 where
7372 T: std::iter::IntoIterator<Item = V>,
7373 V: std::convert::Into<std::string::String>,
7374 {
7375 use std::iter::Iterator;
7376 self.0.request.server_roles = v.into_iter().map(|i| i.into()).collect();
7377 self
7378 }
7379
7380 pub fn set_revoke_existing_server_roles<T>(mut self, v: T) -> Self
7382 where
7383 T: std::convert::Into<bool>,
7384 {
7385 self.0.request.revoke_existing_server_roles = std::option::Option::Some(v.into());
7386 self
7387 }
7388
7389 pub fn set_or_clear_revoke_existing_server_roles<T>(
7391 mut self,
7392 v: std::option::Option<T>,
7393 ) -> Self
7394 where
7395 T: std::convert::Into<bool>,
7396 {
7397 self.0.request.revoke_existing_server_roles = v.map(|x| x.into());
7398 self
7399 }
7400
7401 pub fn set_body<T>(mut self, v: T) -> Self
7403 where
7404 T: std::convert::Into<crate::model::User>,
7405 {
7406 self.0.request.body = std::option::Option::Some(v.into());
7407 self
7408 }
7409
7410 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7412 where
7413 T: std::convert::Into<crate::model::User>,
7414 {
7415 self.0.request.body = v.map(|x| x.into());
7416 self
7417 }
7418
7419 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
7421 self.0.request.location = v.into();
7422 self
7423 }
7424 }
7425
7426 #[doc(hidden)]
7427 impl crate::RequestBuilder for Update {
7428 fn request_options(&mut self) -> &mut crate::RequestOptions {
7429 &mut self.0.options
7430 }
7431 }
7432}