1pub mod sql_backup_runs_service {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::SqlBackupRunsService;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = SqlBackupRunsService;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
90 pub struct Delete(RequestBuilder<crate::model::SqlBackupRunsDeleteRequest>);
91
92 impl Delete {
93 pub(crate) fn new(
94 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
95 ) -> Self {
96 Self(RequestBuilder::new(stub))
97 }
98
99 pub fn with_request<V: Into<crate::model::SqlBackupRunsDeleteRequest>>(
101 mut self,
102 v: V,
103 ) -> Self {
104 self.0.request = v.into();
105 self
106 }
107
108 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
110 self.0.options = v.into();
111 self
112 }
113
114 pub async fn send(self) -> Result<crate::model::Operation> {
116 (*self.0.stub)
117 .delete(self.0.request, self.0.options)
118 .await
119 .map(crate::Response::into_body)
120 }
121
122 pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
124 self.0.request.id = v.into();
125 self
126 }
127
128 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
130 self.0.request.instance = v.into();
131 self
132 }
133
134 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
136 self.0.request.project = v.into();
137 self
138 }
139 }
140
141 #[doc(hidden)]
142 impl crate::RequestBuilder for Delete {
143 fn request_options(&mut self) -> &mut crate::RequestOptions {
144 &mut self.0.options
145 }
146 }
147
148 #[derive(Clone, Debug)]
165 pub struct Get(RequestBuilder<crate::model::SqlBackupRunsGetRequest>);
166
167 impl Get {
168 pub(crate) fn new(
169 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
170 ) -> Self {
171 Self(RequestBuilder::new(stub))
172 }
173
174 pub fn with_request<V: Into<crate::model::SqlBackupRunsGetRequest>>(
176 mut self,
177 v: V,
178 ) -> Self {
179 self.0.request = v.into();
180 self
181 }
182
183 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
185 self.0.options = v.into();
186 self
187 }
188
189 pub async fn send(self) -> Result<crate::model::BackupRun> {
191 (*self.0.stub)
192 .get(self.0.request, self.0.options)
193 .await
194 .map(crate::Response::into_body)
195 }
196
197 pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
199 self.0.request.id = v.into();
200 self
201 }
202
203 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
205 self.0.request.instance = v.into();
206 self
207 }
208
209 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
211 self.0.request.project = v.into();
212 self
213 }
214 }
215
216 #[doc(hidden)]
217 impl crate::RequestBuilder for Get {
218 fn request_options(&mut self) -> &mut crate::RequestOptions {
219 &mut self.0.options
220 }
221 }
222
223 #[derive(Clone, Debug)]
240 pub struct Insert(RequestBuilder<crate::model::SqlBackupRunsInsertRequest>);
241
242 impl Insert {
243 pub(crate) fn new(
244 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
245 ) -> Self {
246 Self(RequestBuilder::new(stub))
247 }
248
249 pub fn with_request<V: Into<crate::model::SqlBackupRunsInsertRequest>>(
251 mut self,
252 v: V,
253 ) -> Self {
254 self.0.request = v.into();
255 self
256 }
257
258 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
260 self.0.options = v.into();
261 self
262 }
263
264 pub async fn send(self) -> Result<crate::model::Operation> {
266 (*self.0.stub)
267 .insert(self.0.request, self.0.options)
268 .await
269 .map(crate::Response::into_body)
270 }
271
272 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
274 self.0.request.instance = v.into();
275 self
276 }
277
278 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
280 self.0.request.project = v.into();
281 self
282 }
283
284 pub fn set_body<T>(mut self, v: T) -> Self
286 where
287 T: std::convert::Into<crate::model::BackupRun>,
288 {
289 self.0.request.body = std::option::Option::Some(v.into());
290 self
291 }
292
293 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
295 where
296 T: std::convert::Into<crate::model::BackupRun>,
297 {
298 self.0.request.body = v.map(|x| x.into());
299 self
300 }
301 }
302
303 #[doc(hidden)]
304 impl crate::RequestBuilder for Insert {
305 fn request_options(&mut self) -> &mut crate::RequestOptions {
306 &mut self.0.options
307 }
308 }
309
310 #[derive(Clone, Debug)]
331 pub struct List(RequestBuilder<crate::model::SqlBackupRunsListRequest>);
332
333 impl List {
334 pub(crate) fn new(
335 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
336 ) -> Self {
337 Self(RequestBuilder::new(stub))
338 }
339
340 pub fn with_request<V: Into<crate::model::SqlBackupRunsListRequest>>(
342 mut self,
343 v: V,
344 ) -> Self {
345 self.0.request = v.into();
346 self
347 }
348
349 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
351 self.0.options = v.into();
352 self
353 }
354
355 pub async fn send(self) -> Result<crate::model::BackupRunsListResponse> {
357 (*self.0.stub)
358 .list(self.0.request, self.0.options)
359 .await
360 .map(crate::Response::into_body)
361 }
362
363 pub fn by_page(
365 self,
366 ) -> impl google_cloud_gax::paginator::Paginator<
367 crate::model::BackupRunsListResponse,
368 crate::Error,
369 > {
370 use std::clone::Clone;
371 let token = self.0.request.page_token.clone();
372 let execute = move |token: String| {
373 let mut builder = self.clone();
374 builder.0.request = builder.0.request.set_page_token(token);
375 builder.send()
376 };
377 google_cloud_gax::paginator::internal::new_paginator(token, execute)
378 }
379
380 pub fn by_item(
382 self,
383 ) -> impl google_cloud_gax::paginator::ItemPaginator<
384 crate::model::BackupRunsListResponse,
385 crate::Error,
386 > {
387 use google_cloud_gax::paginator::Paginator;
388 self.by_page().items()
389 }
390
391 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
393 self.0.request.instance = v.into();
394 self
395 }
396
397 pub fn set_max_results<T: Into<i32>>(mut self, v: T) -> Self {
399 self.0.request.max_results = v.into();
400 self
401 }
402
403 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
405 self.0.request.page_token = v.into();
406 self
407 }
408
409 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
411 self.0.request.project = v.into();
412 self
413 }
414 }
415
416 #[doc(hidden)]
417 impl crate::RequestBuilder for List {
418 fn request_options(&mut self) -> &mut crate::RequestOptions {
419 &mut self.0.options
420 }
421 }
422}
423
424pub mod sql_backups_service {
425 use crate::Result;
426
427 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
441
442 pub(crate) mod client {
443 use super::super::super::client::SqlBackupsService;
444 pub struct Factory;
445 impl crate::ClientFactory for Factory {
446 type Client = SqlBackupsService;
447 type Credentials = gaxi::options::Credentials;
448 async fn build(
449 self,
450 config: gaxi::options::ClientConfig,
451 ) -> crate::ClientBuilderResult<Self::Client> {
452 Self::Client::new(config).await
453 }
454 }
455 }
456
457 #[derive(Clone, Debug)]
459 pub(crate) struct RequestBuilder<R: std::default::Default> {
460 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
461 request: R,
462 options: crate::RequestOptions,
463 }
464
465 impl<R> RequestBuilder<R>
466 where
467 R: std::default::Default,
468 {
469 pub(crate) fn new(
470 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
471 ) -> Self {
472 Self {
473 stub,
474 request: R::default(),
475 options: crate::RequestOptions::default(),
476 }
477 }
478 }
479
480 #[derive(Clone, Debug)]
497 pub struct CreateBackup(RequestBuilder<crate::model::CreateBackupRequest>);
498
499 impl CreateBackup {
500 pub(crate) fn new(
501 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
502 ) -> Self {
503 Self(RequestBuilder::new(stub))
504 }
505
506 pub fn with_request<V: Into<crate::model::CreateBackupRequest>>(mut self, v: V) -> Self {
508 self.0.request = v.into();
509 self
510 }
511
512 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
514 self.0.options = v.into();
515 self
516 }
517
518 pub async fn send(self) -> Result<crate::model::Operation> {
520 (*self.0.stub)
521 .create_backup(self.0.request, self.0.options)
522 .await
523 .map(crate::Response::into_body)
524 }
525
526 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
530 self.0.request.parent = v.into();
531 self
532 }
533
534 pub fn set_backup<T>(mut self, v: T) -> Self
538 where
539 T: std::convert::Into<crate::model::Backup>,
540 {
541 self.0.request.backup = std::option::Option::Some(v.into());
542 self
543 }
544
545 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
549 where
550 T: std::convert::Into<crate::model::Backup>,
551 {
552 self.0.request.backup = v.map(|x| x.into());
553 self
554 }
555 }
556
557 #[doc(hidden)]
558 impl crate::RequestBuilder for CreateBackup {
559 fn request_options(&mut self) -> &mut crate::RequestOptions {
560 &mut self.0.options
561 }
562 }
563
564 #[derive(Clone, Debug)]
581 pub struct GetBackup(RequestBuilder<crate::model::GetBackupRequest>);
582
583 impl GetBackup {
584 pub(crate) fn new(
585 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
586 ) -> Self {
587 Self(RequestBuilder::new(stub))
588 }
589
590 pub fn with_request<V: Into<crate::model::GetBackupRequest>>(mut self, v: V) -> Self {
592 self.0.request = v.into();
593 self
594 }
595
596 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
598 self.0.options = v.into();
599 self
600 }
601
602 pub async fn send(self) -> Result<crate::model::Backup> {
604 (*self.0.stub)
605 .get_backup(self.0.request, self.0.options)
606 .await
607 .map(crate::Response::into_body)
608 }
609
610 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
614 self.0.request.name = v.into();
615 self
616 }
617 }
618
619 #[doc(hidden)]
620 impl crate::RequestBuilder for GetBackup {
621 fn request_options(&mut self) -> &mut crate::RequestOptions {
622 &mut self.0.options
623 }
624 }
625
626 #[derive(Clone, Debug)]
647 pub struct ListBackups(RequestBuilder<crate::model::ListBackupsRequest>);
648
649 impl ListBackups {
650 pub(crate) fn new(
651 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
652 ) -> Self {
653 Self(RequestBuilder::new(stub))
654 }
655
656 pub fn with_request<V: Into<crate::model::ListBackupsRequest>>(mut self, v: V) -> Self {
658 self.0.request = v.into();
659 self
660 }
661
662 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
664 self.0.options = v.into();
665 self
666 }
667
668 pub async fn send(self) -> Result<crate::model::ListBackupsResponse> {
670 (*self.0.stub)
671 .list_backups(self.0.request, self.0.options)
672 .await
673 .map(crate::Response::into_body)
674 }
675
676 pub fn by_page(
678 self,
679 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListBackupsResponse, crate::Error>
680 {
681 use std::clone::Clone;
682 let token = self.0.request.page_token.clone();
683 let execute = move |token: String| {
684 let mut builder = self.clone();
685 builder.0.request = builder.0.request.set_page_token(token);
686 builder.send()
687 };
688 google_cloud_gax::paginator::internal::new_paginator(token, execute)
689 }
690
691 pub fn by_item(
693 self,
694 ) -> impl google_cloud_gax::paginator::ItemPaginator<
695 crate::model::ListBackupsResponse,
696 crate::Error,
697 > {
698 use google_cloud_gax::paginator::Paginator;
699 self.by_page().items()
700 }
701
702 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
706 self.0.request.parent = v.into();
707 self
708 }
709
710 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
712 self.0.request.page_size = v.into();
713 self
714 }
715
716 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
718 self.0.request.page_token = v.into();
719 self
720 }
721
722 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
724 self.0.request.filter = v.into();
725 self
726 }
727 }
728
729 #[doc(hidden)]
730 impl crate::RequestBuilder for ListBackups {
731 fn request_options(&mut self) -> &mut crate::RequestOptions {
732 &mut self.0.options
733 }
734 }
735
736 #[derive(Clone, Debug)]
753 pub struct UpdateBackup(RequestBuilder<crate::model::UpdateBackupRequest>);
754
755 impl UpdateBackup {
756 pub(crate) fn new(
757 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
758 ) -> Self {
759 Self(RequestBuilder::new(stub))
760 }
761
762 pub fn with_request<V: Into<crate::model::UpdateBackupRequest>>(mut self, v: V) -> Self {
764 self.0.request = v.into();
765 self
766 }
767
768 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
770 self.0.options = v.into();
771 self
772 }
773
774 pub async fn send(self) -> Result<crate::model::Operation> {
776 (*self.0.stub)
777 .update_backup(self.0.request, self.0.options)
778 .await
779 .map(crate::Response::into_body)
780 }
781
782 pub fn set_backup<T>(mut self, v: T) -> Self
786 where
787 T: std::convert::Into<crate::model::Backup>,
788 {
789 self.0.request.backup = std::option::Option::Some(v.into());
790 self
791 }
792
793 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
797 where
798 T: std::convert::Into<crate::model::Backup>,
799 {
800 self.0.request.backup = v.map(|x| x.into());
801 self
802 }
803
804 pub fn set_update_mask<T>(mut self, v: T) -> Self
806 where
807 T: std::convert::Into<wkt::FieldMask>,
808 {
809 self.0.request.update_mask = std::option::Option::Some(v.into());
810 self
811 }
812
813 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
815 where
816 T: std::convert::Into<wkt::FieldMask>,
817 {
818 self.0.request.update_mask = v.map(|x| x.into());
819 self
820 }
821 }
822
823 #[doc(hidden)]
824 impl crate::RequestBuilder for UpdateBackup {
825 fn request_options(&mut self) -> &mut crate::RequestOptions {
826 &mut self.0.options
827 }
828 }
829
830 #[derive(Clone, Debug)]
847 pub struct DeleteBackup(RequestBuilder<crate::model::DeleteBackupRequest>);
848
849 impl DeleteBackup {
850 pub(crate) fn new(
851 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
852 ) -> Self {
853 Self(RequestBuilder::new(stub))
854 }
855
856 pub fn with_request<V: Into<crate::model::DeleteBackupRequest>>(mut self, v: V) -> Self {
858 self.0.request = v.into();
859 self
860 }
861
862 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
864 self.0.options = v.into();
865 self
866 }
867
868 pub async fn send(self) -> Result<crate::model::Operation> {
870 (*self.0.stub)
871 .delete_backup(self.0.request, self.0.options)
872 .await
873 .map(crate::Response::into_body)
874 }
875
876 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
880 self.0.request.name = v.into();
881 self
882 }
883 }
884
885 #[doc(hidden)]
886 impl crate::RequestBuilder for DeleteBackup {
887 fn request_options(&mut self) -> &mut crate::RequestOptions {
888 &mut self.0.options
889 }
890 }
891}
892
893pub mod sql_connect_service {
894 use crate::Result;
895
896 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
910
911 pub(crate) mod client {
912 use super::super::super::client::SqlConnectService;
913 pub struct Factory;
914 impl crate::ClientFactory for Factory {
915 type Client = SqlConnectService;
916 type Credentials = gaxi::options::Credentials;
917 async fn build(
918 self,
919 config: gaxi::options::ClientConfig,
920 ) -> crate::ClientBuilderResult<Self::Client> {
921 Self::Client::new(config).await
922 }
923 }
924 }
925
926 #[derive(Clone, Debug)]
928 pub(crate) struct RequestBuilder<R: std::default::Default> {
929 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
930 request: R,
931 options: crate::RequestOptions,
932 }
933
934 impl<R> RequestBuilder<R>
935 where
936 R: std::default::Default,
937 {
938 pub(crate) fn new(
939 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
940 ) -> Self {
941 Self {
942 stub,
943 request: R::default(),
944 options: crate::RequestOptions::default(),
945 }
946 }
947 }
948
949 #[derive(Clone, Debug)]
966 pub struct GetConnectSettings(RequestBuilder<crate::model::GetConnectSettingsRequest>);
967
968 impl GetConnectSettings {
969 pub(crate) fn new(
970 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
971 ) -> Self {
972 Self(RequestBuilder::new(stub))
973 }
974
975 pub fn with_request<V: Into<crate::model::GetConnectSettingsRequest>>(
977 mut self,
978 v: V,
979 ) -> Self {
980 self.0.request = v.into();
981 self
982 }
983
984 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
986 self.0.options = v.into();
987 self
988 }
989
990 pub async fn send(self) -> Result<crate::model::ConnectSettings> {
992 (*self.0.stub)
993 .get_connect_settings(self.0.request, self.0.options)
994 .await
995 .map(crate::Response::into_body)
996 }
997
998 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1000 self.0.request.instance = v.into();
1001 self
1002 }
1003
1004 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1006 self.0.request.project = v.into();
1007 self
1008 }
1009
1010 pub fn set_read_time<T>(mut self, v: T) -> Self
1012 where
1013 T: std::convert::Into<wkt::Timestamp>,
1014 {
1015 self.0.request.read_time = std::option::Option::Some(v.into());
1016 self
1017 }
1018
1019 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1021 where
1022 T: std::convert::Into<wkt::Timestamp>,
1023 {
1024 self.0.request.read_time = v.map(|x| x.into());
1025 self
1026 }
1027 }
1028
1029 #[doc(hidden)]
1030 impl crate::RequestBuilder for GetConnectSettings {
1031 fn request_options(&mut self) -> &mut crate::RequestOptions {
1032 &mut self.0.options
1033 }
1034 }
1035
1036 #[derive(Clone, Debug)]
1053 pub struct GenerateEphemeralCert(RequestBuilder<crate::model::GenerateEphemeralCertRequest>);
1054
1055 impl GenerateEphemeralCert {
1056 pub(crate) fn new(
1057 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
1058 ) -> Self {
1059 Self(RequestBuilder::new(stub))
1060 }
1061
1062 pub fn with_request<V: Into<crate::model::GenerateEphemeralCertRequest>>(
1064 mut self,
1065 v: V,
1066 ) -> Self {
1067 self.0.request = v.into();
1068 self
1069 }
1070
1071 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1073 self.0.options = v.into();
1074 self
1075 }
1076
1077 pub async fn send(self) -> Result<crate::model::GenerateEphemeralCertResponse> {
1079 (*self.0.stub)
1080 .generate_ephemeral_cert(self.0.request, self.0.options)
1081 .await
1082 .map(crate::Response::into_body)
1083 }
1084
1085 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1087 self.0.request.instance = v.into();
1088 self
1089 }
1090
1091 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1093 self.0.request.project = v.into();
1094 self
1095 }
1096
1097 pub fn set_public_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1099 self.0.request.public_key = v.into();
1100 self
1101 }
1102
1103 pub fn set_access_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1105 self.0.request.access_token = v.into();
1106 self
1107 }
1108
1109 pub fn set_read_time<T>(mut self, v: T) -> Self
1111 where
1112 T: std::convert::Into<wkt::Timestamp>,
1113 {
1114 self.0.request.read_time = std::option::Option::Some(v.into());
1115 self
1116 }
1117
1118 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1120 where
1121 T: std::convert::Into<wkt::Timestamp>,
1122 {
1123 self.0.request.read_time = v.map(|x| x.into());
1124 self
1125 }
1126
1127 pub fn set_valid_duration<T>(mut self, v: T) -> Self
1129 where
1130 T: std::convert::Into<wkt::Duration>,
1131 {
1132 self.0.request.valid_duration = std::option::Option::Some(v.into());
1133 self
1134 }
1135
1136 pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
1138 where
1139 T: std::convert::Into<wkt::Duration>,
1140 {
1141 self.0.request.valid_duration = v.map(|x| x.into());
1142 self
1143 }
1144 }
1145
1146 #[doc(hidden)]
1147 impl crate::RequestBuilder for GenerateEphemeralCert {
1148 fn request_options(&mut self) -> &mut crate::RequestOptions {
1149 &mut self.0.options
1150 }
1151 }
1152}
1153
1154pub mod sql_databases_service {
1155 use crate::Result;
1156
1157 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1171
1172 pub(crate) mod client {
1173 use super::super::super::client::SqlDatabasesService;
1174 pub struct Factory;
1175 impl crate::ClientFactory for Factory {
1176 type Client = SqlDatabasesService;
1177 type Credentials = gaxi::options::Credentials;
1178 async fn build(
1179 self,
1180 config: gaxi::options::ClientConfig,
1181 ) -> crate::ClientBuilderResult<Self::Client> {
1182 Self::Client::new(config).await
1183 }
1184 }
1185 }
1186
1187 #[derive(Clone, Debug)]
1189 pub(crate) struct RequestBuilder<R: std::default::Default> {
1190 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1191 request: R,
1192 options: crate::RequestOptions,
1193 }
1194
1195 impl<R> RequestBuilder<R>
1196 where
1197 R: std::default::Default,
1198 {
1199 pub(crate) fn new(
1200 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1201 ) -> Self {
1202 Self {
1203 stub,
1204 request: R::default(),
1205 options: crate::RequestOptions::default(),
1206 }
1207 }
1208 }
1209
1210 #[derive(Clone, Debug)]
1227 pub struct Delete(RequestBuilder<crate::model::SqlDatabasesDeleteRequest>);
1228
1229 impl Delete {
1230 pub(crate) fn new(
1231 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1232 ) -> Self {
1233 Self(RequestBuilder::new(stub))
1234 }
1235
1236 pub fn with_request<V: Into<crate::model::SqlDatabasesDeleteRequest>>(
1238 mut self,
1239 v: V,
1240 ) -> Self {
1241 self.0.request = v.into();
1242 self
1243 }
1244
1245 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1247 self.0.options = v.into();
1248 self
1249 }
1250
1251 pub async fn send(self) -> Result<crate::model::Operation> {
1253 (*self.0.stub)
1254 .delete(self.0.request, self.0.options)
1255 .await
1256 .map(crate::Response::into_body)
1257 }
1258
1259 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1261 self.0.request.database = v.into();
1262 self
1263 }
1264
1265 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1267 self.0.request.instance = v.into();
1268 self
1269 }
1270
1271 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1273 self.0.request.project = v.into();
1274 self
1275 }
1276 }
1277
1278 #[doc(hidden)]
1279 impl crate::RequestBuilder for Delete {
1280 fn request_options(&mut self) -> &mut crate::RequestOptions {
1281 &mut self.0.options
1282 }
1283 }
1284
1285 #[derive(Clone, Debug)]
1302 pub struct Get(RequestBuilder<crate::model::SqlDatabasesGetRequest>);
1303
1304 impl Get {
1305 pub(crate) fn new(
1306 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1307 ) -> Self {
1308 Self(RequestBuilder::new(stub))
1309 }
1310
1311 pub fn with_request<V: Into<crate::model::SqlDatabasesGetRequest>>(mut self, v: V) -> Self {
1313 self.0.request = v.into();
1314 self
1315 }
1316
1317 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1319 self.0.options = v.into();
1320 self
1321 }
1322
1323 pub async fn send(self) -> Result<crate::model::Database> {
1325 (*self.0.stub)
1326 .get(self.0.request, self.0.options)
1327 .await
1328 .map(crate::Response::into_body)
1329 }
1330
1331 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1333 self.0.request.database = v.into();
1334 self
1335 }
1336
1337 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1339 self.0.request.instance = v.into();
1340 self
1341 }
1342
1343 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1345 self.0.request.project = v.into();
1346 self
1347 }
1348 }
1349
1350 #[doc(hidden)]
1351 impl crate::RequestBuilder for Get {
1352 fn request_options(&mut self) -> &mut crate::RequestOptions {
1353 &mut self.0.options
1354 }
1355 }
1356
1357 #[derive(Clone, Debug)]
1374 pub struct Insert(RequestBuilder<crate::model::SqlDatabasesInsertRequest>);
1375
1376 impl Insert {
1377 pub(crate) fn new(
1378 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1379 ) -> Self {
1380 Self(RequestBuilder::new(stub))
1381 }
1382
1383 pub fn with_request<V: Into<crate::model::SqlDatabasesInsertRequest>>(
1385 mut self,
1386 v: V,
1387 ) -> Self {
1388 self.0.request = v.into();
1389 self
1390 }
1391
1392 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1394 self.0.options = v.into();
1395 self
1396 }
1397
1398 pub async fn send(self) -> Result<crate::model::Operation> {
1400 (*self.0.stub)
1401 .insert(self.0.request, self.0.options)
1402 .await
1403 .map(crate::Response::into_body)
1404 }
1405
1406 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1408 self.0.request.instance = v.into();
1409 self
1410 }
1411
1412 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1414 self.0.request.project = v.into();
1415 self
1416 }
1417
1418 pub fn set_body<T>(mut self, v: T) -> Self
1420 where
1421 T: std::convert::Into<crate::model::Database>,
1422 {
1423 self.0.request.body = std::option::Option::Some(v.into());
1424 self
1425 }
1426
1427 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1429 where
1430 T: std::convert::Into<crate::model::Database>,
1431 {
1432 self.0.request.body = v.map(|x| x.into());
1433 self
1434 }
1435 }
1436
1437 #[doc(hidden)]
1438 impl crate::RequestBuilder for Insert {
1439 fn request_options(&mut self) -> &mut crate::RequestOptions {
1440 &mut self.0.options
1441 }
1442 }
1443
1444 #[derive(Clone, Debug)]
1461 pub struct List(RequestBuilder<crate::model::SqlDatabasesListRequest>);
1462
1463 impl List {
1464 pub(crate) fn new(
1465 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1466 ) -> Self {
1467 Self(RequestBuilder::new(stub))
1468 }
1469
1470 pub fn with_request<V: Into<crate::model::SqlDatabasesListRequest>>(
1472 mut self,
1473 v: V,
1474 ) -> Self {
1475 self.0.request = v.into();
1476 self
1477 }
1478
1479 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1481 self.0.options = v.into();
1482 self
1483 }
1484
1485 pub async fn send(self) -> Result<crate::model::DatabasesListResponse> {
1487 (*self.0.stub)
1488 .list(self.0.request, self.0.options)
1489 .await
1490 .map(crate::Response::into_body)
1491 }
1492
1493 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1495 self.0.request.instance = v.into();
1496 self
1497 }
1498
1499 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1501 self.0.request.project = v.into();
1502 self
1503 }
1504 }
1505
1506 #[doc(hidden)]
1507 impl crate::RequestBuilder for List {
1508 fn request_options(&mut self) -> &mut crate::RequestOptions {
1509 &mut self.0.options
1510 }
1511 }
1512
1513 #[derive(Clone, Debug)]
1530 pub struct Patch(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1531
1532 impl Patch {
1533 pub(crate) fn new(
1534 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1535 ) -> Self {
1536 Self(RequestBuilder::new(stub))
1537 }
1538
1539 pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1541 mut self,
1542 v: V,
1543 ) -> Self {
1544 self.0.request = v.into();
1545 self
1546 }
1547
1548 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1550 self.0.options = v.into();
1551 self
1552 }
1553
1554 pub async fn send(self) -> Result<crate::model::Operation> {
1556 (*self.0.stub)
1557 .patch(self.0.request, self.0.options)
1558 .await
1559 .map(crate::Response::into_body)
1560 }
1561
1562 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1564 self.0.request.database = v.into();
1565 self
1566 }
1567
1568 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1570 self.0.request.instance = v.into();
1571 self
1572 }
1573
1574 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1576 self.0.request.project = v.into();
1577 self
1578 }
1579
1580 pub fn set_body<T>(mut self, v: T) -> Self
1582 where
1583 T: std::convert::Into<crate::model::Database>,
1584 {
1585 self.0.request.body = std::option::Option::Some(v.into());
1586 self
1587 }
1588
1589 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1591 where
1592 T: std::convert::Into<crate::model::Database>,
1593 {
1594 self.0.request.body = v.map(|x| x.into());
1595 self
1596 }
1597 }
1598
1599 #[doc(hidden)]
1600 impl crate::RequestBuilder for Patch {
1601 fn request_options(&mut self) -> &mut crate::RequestOptions {
1602 &mut self.0.options
1603 }
1604 }
1605
1606 #[derive(Clone, Debug)]
1623 pub struct Update(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1624
1625 impl Update {
1626 pub(crate) fn new(
1627 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1628 ) -> Self {
1629 Self(RequestBuilder::new(stub))
1630 }
1631
1632 pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1634 mut self,
1635 v: V,
1636 ) -> Self {
1637 self.0.request = v.into();
1638 self
1639 }
1640
1641 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1643 self.0.options = v.into();
1644 self
1645 }
1646
1647 pub async fn send(self) -> Result<crate::model::Operation> {
1649 (*self.0.stub)
1650 .update(self.0.request, self.0.options)
1651 .await
1652 .map(crate::Response::into_body)
1653 }
1654
1655 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1657 self.0.request.database = v.into();
1658 self
1659 }
1660
1661 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1663 self.0.request.instance = v.into();
1664 self
1665 }
1666
1667 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1669 self.0.request.project = v.into();
1670 self
1671 }
1672
1673 pub fn set_body<T>(mut self, v: T) -> Self
1675 where
1676 T: std::convert::Into<crate::model::Database>,
1677 {
1678 self.0.request.body = std::option::Option::Some(v.into());
1679 self
1680 }
1681
1682 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1684 where
1685 T: std::convert::Into<crate::model::Database>,
1686 {
1687 self.0.request.body = v.map(|x| x.into());
1688 self
1689 }
1690 }
1691
1692 #[doc(hidden)]
1693 impl crate::RequestBuilder for Update {
1694 fn request_options(&mut self) -> &mut crate::RequestOptions {
1695 &mut self.0.options
1696 }
1697 }
1698}
1699
1700pub mod sql_flags_service {
1701 use crate::Result;
1702
1703 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1717
1718 pub(crate) mod client {
1719 use super::super::super::client::SqlFlagsService;
1720 pub struct Factory;
1721 impl crate::ClientFactory for Factory {
1722 type Client = SqlFlagsService;
1723 type Credentials = gaxi::options::Credentials;
1724 async fn build(
1725 self,
1726 config: gaxi::options::ClientConfig,
1727 ) -> crate::ClientBuilderResult<Self::Client> {
1728 Self::Client::new(config).await
1729 }
1730 }
1731 }
1732
1733 #[derive(Clone, Debug)]
1735 pub(crate) struct RequestBuilder<R: std::default::Default> {
1736 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1737 request: R,
1738 options: crate::RequestOptions,
1739 }
1740
1741 impl<R> RequestBuilder<R>
1742 where
1743 R: std::default::Default,
1744 {
1745 pub(crate) fn new(
1746 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1747 ) -> Self {
1748 Self {
1749 stub,
1750 request: R::default(),
1751 options: crate::RequestOptions::default(),
1752 }
1753 }
1754 }
1755
1756 #[derive(Clone, Debug)]
1773 pub struct List(RequestBuilder<crate::model::SqlFlagsListRequest>);
1774
1775 impl List {
1776 pub(crate) fn new(
1777 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1778 ) -> Self {
1779 Self(RequestBuilder::new(stub))
1780 }
1781
1782 pub fn with_request<V: Into<crate::model::SqlFlagsListRequest>>(mut self, v: V) -> Self {
1784 self.0.request = v.into();
1785 self
1786 }
1787
1788 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1790 self.0.options = v.into();
1791 self
1792 }
1793
1794 pub async fn send(self) -> Result<crate::model::FlagsListResponse> {
1796 (*self.0.stub)
1797 .list(self.0.request, self.0.options)
1798 .await
1799 .map(crate::Response::into_body)
1800 }
1801
1802 pub fn set_database_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
1804 self.0.request.database_version = v.into();
1805 self
1806 }
1807
1808 pub fn set_flag_scope<T>(mut self, v: T) -> Self
1810 where
1811 T: std::convert::Into<crate::model::SqlFlagScope>,
1812 {
1813 self.0.request.flag_scope = std::option::Option::Some(v.into());
1814 self
1815 }
1816
1817 pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
1819 where
1820 T: std::convert::Into<crate::model::SqlFlagScope>,
1821 {
1822 self.0.request.flag_scope = v.map(|x| x.into());
1823 self
1824 }
1825 }
1826
1827 #[doc(hidden)]
1828 impl crate::RequestBuilder for List {
1829 fn request_options(&mut self) -> &mut crate::RequestOptions {
1830 &mut self.0.options
1831 }
1832 }
1833}
1834
1835pub mod sql_instances_service {
1836 use crate::Result;
1837
1838 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1852
1853 pub(crate) mod client {
1854 use super::super::super::client::SqlInstancesService;
1855 pub struct Factory;
1856 impl crate::ClientFactory for Factory {
1857 type Client = SqlInstancesService;
1858 type Credentials = gaxi::options::Credentials;
1859 async fn build(
1860 self,
1861 config: gaxi::options::ClientConfig,
1862 ) -> crate::ClientBuilderResult<Self::Client> {
1863 Self::Client::new(config).await
1864 }
1865 }
1866 }
1867
1868 #[derive(Clone, Debug)]
1870 pub(crate) struct RequestBuilder<R: std::default::Default> {
1871 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1872 request: R,
1873 options: crate::RequestOptions,
1874 }
1875
1876 impl<R> RequestBuilder<R>
1877 where
1878 R: std::default::Default,
1879 {
1880 pub(crate) fn new(
1881 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1882 ) -> Self {
1883 Self {
1884 stub,
1885 request: R::default(),
1886 options: crate::RequestOptions::default(),
1887 }
1888 }
1889 }
1890
1891 #[derive(Clone, Debug)]
1908 pub struct AddServerCa(RequestBuilder<crate::model::SqlInstancesAddServerCaRequest>);
1909
1910 impl AddServerCa {
1911 pub(crate) fn new(
1912 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1913 ) -> Self {
1914 Self(RequestBuilder::new(stub))
1915 }
1916
1917 pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCaRequest>>(
1919 mut self,
1920 v: V,
1921 ) -> Self {
1922 self.0.request = v.into();
1923 self
1924 }
1925
1926 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1928 self.0.options = v.into();
1929 self
1930 }
1931
1932 pub async fn send(self) -> Result<crate::model::Operation> {
1934 (*self.0.stub)
1935 .add_server_ca(self.0.request, self.0.options)
1936 .await
1937 .map(crate::Response::into_body)
1938 }
1939
1940 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1942 self.0.request.instance = v.into();
1943 self
1944 }
1945
1946 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1948 self.0.request.project = v.into();
1949 self
1950 }
1951 }
1952
1953 #[doc(hidden)]
1954 impl crate::RequestBuilder for AddServerCa {
1955 fn request_options(&mut self) -> &mut crate::RequestOptions {
1956 &mut self.0.options
1957 }
1958 }
1959
1960 #[derive(Clone, Debug)]
1977 pub struct AddServerCertificate(
1978 RequestBuilder<crate::model::SqlInstancesAddServerCertificateRequest>,
1979 );
1980
1981 impl AddServerCertificate {
1982 pub(crate) fn new(
1983 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1984 ) -> Self {
1985 Self(RequestBuilder::new(stub))
1986 }
1987
1988 pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCertificateRequest>>(
1990 mut self,
1991 v: V,
1992 ) -> Self {
1993 self.0.request = v.into();
1994 self
1995 }
1996
1997 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1999 self.0.options = v.into();
2000 self
2001 }
2002
2003 pub async fn send(self) -> Result<crate::model::Operation> {
2005 (*self.0.stub)
2006 .add_server_certificate(self.0.request, self.0.options)
2007 .await
2008 .map(crate::Response::into_body)
2009 }
2010
2011 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2013 self.0.request.instance = v.into();
2014 self
2015 }
2016
2017 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2019 self.0.request.project = v.into();
2020 self
2021 }
2022 }
2023
2024 #[doc(hidden)]
2025 impl crate::RequestBuilder for AddServerCertificate {
2026 fn request_options(&mut self) -> &mut crate::RequestOptions {
2027 &mut self.0.options
2028 }
2029 }
2030
2031 #[derive(Clone, Debug)]
2048 pub struct AddEntraIdCertificate(
2049 RequestBuilder<crate::model::SqlInstancesAddEntraIdCertificateRequest>,
2050 );
2051
2052 impl AddEntraIdCertificate {
2053 pub(crate) fn new(
2054 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2055 ) -> Self {
2056 Self(RequestBuilder::new(stub))
2057 }
2058
2059 pub fn with_request<V: Into<crate::model::SqlInstancesAddEntraIdCertificateRequest>>(
2061 mut self,
2062 v: V,
2063 ) -> Self {
2064 self.0.request = v.into();
2065 self
2066 }
2067
2068 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2070 self.0.options = v.into();
2071 self
2072 }
2073
2074 pub async fn send(self) -> Result<crate::model::Operation> {
2076 (*self.0.stub)
2077 .add_entra_id_certificate(self.0.request, self.0.options)
2078 .await
2079 .map(crate::Response::into_body)
2080 }
2081
2082 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2086 self.0.request.instance = v.into();
2087 self
2088 }
2089
2090 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2094 self.0.request.project = v.into();
2095 self
2096 }
2097 }
2098
2099 #[doc(hidden)]
2100 impl crate::RequestBuilder for AddEntraIdCertificate {
2101 fn request_options(&mut self) -> &mut crate::RequestOptions {
2102 &mut self.0.options
2103 }
2104 }
2105
2106 #[derive(Clone, Debug)]
2123 pub struct Clone(RequestBuilder<crate::model::SqlInstancesCloneRequest>);
2124
2125 impl Clone {
2126 pub(crate) fn new(
2127 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2128 ) -> Self {
2129 Self(RequestBuilder::new(stub))
2130 }
2131
2132 pub fn with_request<V: Into<crate::model::SqlInstancesCloneRequest>>(
2134 mut self,
2135 v: V,
2136 ) -> Self {
2137 self.0.request = v.into();
2138 self
2139 }
2140
2141 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2143 self.0.options = v.into();
2144 self
2145 }
2146
2147 pub async fn send(self) -> Result<crate::model::Operation> {
2149 (*self.0.stub)
2150 .clone(self.0.request, self.0.options)
2151 .await
2152 .map(crate::Response::into_body)
2153 }
2154
2155 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2159 self.0.request.instance = v.into();
2160 self
2161 }
2162
2163 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2167 self.0.request.project = v.into();
2168 self
2169 }
2170
2171 pub fn set_body<T>(mut self, v: T) -> Self
2175 where
2176 T: std::convert::Into<crate::model::InstancesCloneRequest>,
2177 {
2178 self.0.request.body = std::option::Option::Some(v.into());
2179 self
2180 }
2181
2182 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2186 where
2187 T: std::convert::Into<crate::model::InstancesCloneRequest>,
2188 {
2189 self.0.request.body = v.map(|x| x.into());
2190 self
2191 }
2192 }
2193
2194 #[doc(hidden)]
2195 impl crate::RequestBuilder for Clone {
2196 fn request_options(&mut self) -> &mut crate::RequestOptions {
2197 &mut self.0.options
2198 }
2199 }
2200
2201 #[derive(Clone, Debug)]
2218 pub struct Delete(RequestBuilder<crate::model::SqlInstancesDeleteRequest>);
2219
2220 impl Delete {
2221 pub(crate) fn new(
2222 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2223 ) -> Self {
2224 Self(RequestBuilder::new(stub))
2225 }
2226
2227 pub fn with_request<V: Into<crate::model::SqlInstancesDeleteRequest>>(
2229 mut self,
2230 v: V,
2231 ) -> Self {
2232 self.0.request = v.into();
2233 self
2234 }
2235
2236 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2238 self.0.options = v.into();
2239 self
2240 }
2241
2242 pub async fn send(self) -> Result<crate::model::Operation> {
2244 (*self.0.stub)
2245 .delete(self.0.request, self.0.options)
2246 .await
2247 .map(crate::Response::into_body)
2248 }
2249
2250 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2252 self.0.request.instance = v.into();
2253 self
2254 }
2255
2256 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2258 self.0.request.project = v.into();
2259 self
2260 }
2261
2262 pub fn set_enable_final_backup<T>(mut self, v: T) -> Self
2264 where
2265 T: std::convert::Into<bool>,
2266 {
2267 self.0.request.enable_final_backup = std::option::Option::Some(v.into());
2268 self
2269 }
2270
2271 pub fn set_or_clear_enable_final_backup<T>(mut self, v: std::option::Option<T>) -> Self
2273 where
2274 T: std::convert::Into<bool>,
2275 {
2276 self.0.request.enable_final_backup = v.map(|x| x.into());
2277 self
2278 }
2279
2280 pub fn set_final_backup_description<T: Into<std::string::String>>(mut self, v: T) -> Self {
2282 self.0.request.final_backup_description = v.into();
2283 self
2284 }
2285
2286 pub fn set_expiration<
2291 T: Into<Option<crate::model::sql_instances_delete_request::Expiration>>,
2292 >(
2293 mut self,
2294 v: T,
2295 ) -> Self {
2296 self.0.request.expiration = v.into();
2297 self
2298 }
2299
2300 pub fn set_final_backup_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2306 self.0.request = self.0.request.set_final_backup_ttl_days(v);
2307 self
2308 }
2309
2310 pub fn set_final_backup_expiry_time<
2316 T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>,
2317 >(
2318 mut self,
2319 v: T,
2320 ) -> Self {
2321 self.0.request = self.0.request.set_final_backup_expiry_time(v);
2322 self
2323 }
2324 }
2325
2326 #[doc(hidden)]
2327 impl crate::RequestBuilder for Delete {
2328 fn request_options(&mut self) -> &mut crate::RequestOptions {
2329 &mut self.0.options
2330 }
2331 }
2332
2333 #[derive(Clone, Debug)]
2350 pub struct DemoteMaster(RequestBuilder<crate::model::SqlInstancesDemoteMasterRequest>);
2351
2352 impl DemoteMaster {
2353 pub(crate) fn new(
2354 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2355 ) -> Self {
2356 Self(RequestBuilder::new(stub))
2357 }
2358
2359 pub fn with_request<V: Into<crate::model::SqlInstancesDemoteMasterRequest>>(
2361 mut self,
2362 v: V,
2363 ) -> Self {
2364 self.0.request = v.into();
2365 self
2366 }
2367
2368 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2370 self.0.options = v.into();
2371 self
2372 }
2373
2374 pub async fn send(self) -> Result<crate::model::Operation> {
2376 (*self.0.stub)
2377 .demote_master(self.0.request, self.0.options)
2378 .await
2379 .map(crate::Response::into_body)
2380 }
2381
2382 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2384 self.0.request.instance = v.into();
2385 self
2386 }
2387
2388 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2390 self.0.request.project = v.into();
2391 self
2392 }
2393
2394 pub fn set_body<T>(mut self, v: T) -> Self
2396 where
2397 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
2398 {
2399 self.0.request.body = std::option::Option::Some(v.into());
2400 self
2401 }
2402
2403 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2405 where
2406 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
2407 {
2408 self.0.request.body = v.map(|x| x.into());
2409 self
2410 }
2411 }
2412
2413 #[doc(hidden)]
2414 impl crate::RequestBuilder for DemoteMaster {
2415 fn request_options(&mut self) -> &mut crate::RequestOptions {
2416 &mut self.0.options
2417 }
2418 }
2419
2420 #[derive(Clone, Debug)]
2437 pub struct Demote(RequestBuilder<crate::model::SqlInstancesDemoteRequest>);
2438
2439 impl Demote {
2440 pub(crate) fn new(
2441 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2442 ) -> Self {
2443 Self(RequestBuilder::new(stub))
2444 }
2445
2446 pub fn with_request<V: Into<crate::model::SqlInstancesDemoteRequest>>(
2448 mut self,
2449 v: V,
2450 ) -> Self {
2451 self.0.request = v.into();
2452 self
2453 }
2454
2455 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2457 self.0.options = v.into();
2458 self
2459 }
2460
2461 pub async fn send(self) -> Result<crate::model::Operation> {
2463 (*self.0.stub)
2464 .demote(self.0.request, self.0.options)
2465 .await
2466 .map(crate::Response::into_body)
2467 }
2468
2469 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2473 self.0.request.instance = v.into();
2474 self
2475 }
2476
2477 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2481 self.0.request.project = v.into();
2482 self
2483 }
2484
2485 pub fn set_body<T>(mut self, v: T) -> Self
2489 where
2490 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
2491 {
2492 self.0.request.body = std::option::Option::Some(v.into());
2493 self
2494 }
2495
2496 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2500 where
2501 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
2502 {
2503 self.0.request.body = v.map(|x| x.into());
2504 self
2505 }
2506 }
2507
2508 #[doc(hidden)]
2509 impl crate::RequestBuilder for Demote {
2510 fn request_options(&mut self) -> &mut crate::RequestOptions {
2511 &mut self.0.options
2512 }
2513 }
2514
2515 #[derive(Clone, Debug)]
2532 pub struct Export(RequestBuilder<crate::model::SqlInstancesExportRequest>);
2533
2534 impl Export {
2535 pub(crate) fn new(
2536 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2537 ) -> Self {
2538 Self(RequestBuilder::new(stub))
2539 }
2540
2541 pub fn with_request<V: Into<crate::model::SqlInstancesExportRequest>>(
2543 mut self,
2544 v: V,
2545 ) -> Self {
2546 self.0.request = v.into();
2547 self
2548 }
2549
2550 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2552 self.0.options = v.into();
2553 self
2554 }
2555
2556 pub async fn send(self) -> Result<crate::model::Operation> {
2558 (*self.0.stub)
2559 .export(self.0.request, self.0.options)
2560 .await
2561 .map(crate::Response::into_body)
2562 }
2563
2564 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2566 self.0.request.instance = v.into();
2567 self
2568 }
2569
2570 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2572 self.0.request.project = v.into();
2573 self
2574 }
2575
2576 pub fn set_body<T>(mut self, v: T) -> Self
2578 where
2579 T: std::convert::Into<crate::model::InstancesExportRequest>,
2580 {
2581 self.0.request.body = std::option::Option::Some(v.into());
2582 self
2583 }
2584
2585 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2587 where
2588 T: std::convert::Into<crate::model::InstancesExportRequest>,
2589 {
2590 self.0.request.body = v.map(|x| x.into());
2591 self
2592 }
2593 }
2594
2595 #[doc(hidden)]
2596 impl crate::RequestBuilder for Export {
2597 fn request_options(&mut self) -> &mut crate::RequestOptions {
2598 &mut self.0.options
2599 }
2600 }
2601
2602 #[derive(Clone, Debug)]
2619 pub struct Failover(RequestBuilder<crate::model::SqlInstancesFailoverRequest>);
2620
2621 impl Failover {
2622 pub(crate) fn new(
2623 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2624 ) -> Self {
2625 Self(RequestBuilder::new(stub))
2626 }
2627
2628 pub fn with_request<V: Into<crate::model::SqlInstancesFailoverRequest>>(
2630 mut self,
2631 v: V,
2632 ) -> Self {
2633 self.0.request = v.into();
2634 self
2635 }
2636
2637 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2639 self.0.options = v.into();
2640 self
2641 }
2642
2643 pub async fn send(self) -> Result<crate::model::Operation> {
2645 (*self.0.stub)
2646 .failover(self.0.request, self.0.options)
2647 .await
2648 .map(crate::Response::into_body)
2649 }
2650
2651 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2653 self.0.request.instance = v.into();
2654 self
2655 }
2656
2657 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2659 self.0.request.project = v.into();
2660 self
2661 }
2662
2663 pub fn set_body<T>(mut self, v: T) -> Self
2665 where
2666 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
2667 {
2668 self.0.request.body = std::option::Option::Some(v.into());
2669 self
2670 }
2671
2672 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2674 where
2675 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
2676 {
2677 self.0.request.body = v.map(|x| x.into());
2678 self
2679 }
2680 }
2681
2682 #[doc(hidden)]
2683 impl crate::RequestBuilder for Failover {
2684 fn request_options(&mut self) -> &mut crate::RequestOptions {
2685 &mut self.0.options
2686 }
2687 }
2688
2689 #[derive(Clone, Debug)]
2706 pub struct Reencrypt(RequestBuilder<crate::model::SqlInstancesReencryptRequest>);
2707
2708 impl Reencrypt {
2709 pub(crate) fn new(
2710 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2711 ) -> Self {
2712 Self(RequestBuilder::new(stub))
2713 }
2714
2715 pub fn with_request<V: Into<crate::model::SqlInstancesReencryptRequest>>(
2717 mut self,
2718 v: V,
2719 ) -> Self {
2720 self.0.request = v.into();
2721 self
2722 }
2723
2724 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2726 self.0.options = v.into();
2727 self
2728 }
2729
2730 pub async fn send(self) -> Result<crate::model::Operation> {
2732 (*self.0.stub)
2733 .reencrypt(self.0.request, self.0.options)
2734 .await
2735 .map(crate::Response::into_body)
2736 }
2737
2738 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2740 self.0.request.instance = v.into();
2741 self
2742 }
2743
2744 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2746 self.0.request.project = v.into();
2747 self
2748 }
2749
2750 pub fn set_body<T>(mut self, v: T) -> Self
2752 where
2753 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2754 {
2755 self.0.request.body = std::option::Option::Some(v.into());
2756 self
2757 }
2758
2759 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2761 where
2762 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2763 {
2764 self.0.request.body = v.map(|x| x.into());
2765 self
2766 }
2767 }
2768
2769 #[doc(hidden)]
2770 impl crate::RequestBuilder for Reencrypt {
2771 fn request_options(&mut self) -> &mut crate::RequestOptions {
2772 &mut self.0.options
2773 }
2774 }
2775
2776 #[derive(Clone, Debug)]
2793 pub struct Get(RequestBuilder<crate::model::SqlInstancesGetRequest>);
2794
2795 impl Get {
2796 pub(crate) fn new(
2797 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2798 ) -> Self {
2799 Self(RequestBuilder::new(stub))
2800 }
2801
2802 pub fn with_request<V: Into<crate::model::SqlInstancesGetRequest>>(mut self, v: V) -> Self {
2804 self.0.request = v.into();
2805 self
2806 }
2807
2808 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2810 self.0.options = v.into();
2811 self
2812 }
2813
2814 pub async fn send(self) -> Result<crate::model::DatabaseInstance> {
2816 (*self.0.stub)
2817 .get(self.0.request, self.0.options)
2818 .await
2819 .map(crate::Response::into_body)
2820 }
2821
2822 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2826 self.0.request.instance = v.into();
2827 self
2828 }
2829
2830 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2834 self.0.request.project = v.into();
2835 self
2836 }
2837 }
2838
2839 #[doc(hidden)]
2840 impl crate::RequestBuilder for Get {
2841 fn request_options(&mut self) -> &mut crate::RequestOptions {
2842 &mut self.0.options
2843 }
2844 }
2845
2846 #[derive(Clone, Debug)]
2863 pub struct Import(RequestBuilder<crate::model::SqlInstancesImportRequest>);
2864
2865 impl Import {
2866 pub(crate) fn new(
2867 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2868 ) -> Self {
2869 Self(RequestBuilder::new(stub))
2870 }
2871
2872 pub fn with_request<V: Into<crate::model::SqlInstancesImportRequest>>(
2874 mut self,
2875 v: V,
2876 ) -> Self {
2877 self.0.request = v.into();
2878 self
2879 }
2880
2881 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2883 self.0.options = v.into();
2884 self
2885 }
2886
2887 pub async fn send(self) -> Result<crate::model::Operation> {
2889 (*self.0.stub)
2890 .import(self.0.request, self.0.options)
2891 .await
2892 .map(crate::Response::into_body)
2893 }
2894
2895 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2897 self.0.request.instance = v.into();
2898 self
2899 }
2900
2901 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2903 self.0.request.project = v.into();
2904 self
2905 }
2906
2907 pub fn set_body<T>(mut self, v: T) -> Self
2909 where
2910 T: std::convert::Into<crate::model::InstancesImportRequest>,
2911 {
2912 self.0.request.body = std::option::Option::Some(v.into());
2913 self
2914 }
2915
2916 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2918 where
2919 T: std::convert::Into<crate::model::InstancesImportRequest>,
2920 {
2921 self.0.request.body = v.map(|x| x.into());
2922 self
2923 }
2924 }
2925
2926 #[doc(hidden)]
2927 impl crate::RequestBuilder for Import {
2928 fn request_options(&mut self) -> &mut crate::RequestOptions {
2929 &mut self.0.options
2930 }
2931 }
2932
2933 #[derive(Clone, Debug)]
2950 pub struct Insert(RequestBuilder<crate::model::SqlInstancesInsertRequest>);
2951
2952 impl Insert {
2953 pub(crate) fn new(
2954 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2955 ) -> Self {
2956 Self(RequestBuilder::new(stub))
2957 }
2958
2959 pub fn with_request<V: Into<crate::model::SqlInstancesInsertRequest>>(
2961 mut self,
2962 v: V,
2963 ) -> Self {
2964 self.0.request = v.into();
2965 self
2966 }
2967
2968 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2970 self.0.options = v.into();
2971 self
2972 }
2973
2974 pub async fn send(self) -> Result<crate::model::Operation> {
2976 (*self.0.stub)
2977 .insert(self.0.request, self.0.options)
2978 .await
2979 .map(crate::Response::into_body)
2980 }
2981
2982 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2984 self.0.request.project = v.into();
2985 self
2986 }
2987
2988 pub fn set_body<T>(mut self, v: T) -> Self
2990 where
2991 T: std::convert::Into<crate::model::DatabaseInstance>,
2992 {
2993 self.0.request.body = std::option::Option::Some(v.into());
2994 self
2995 }
2996
2997 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2999 where
3000 T: std::convert::Into<crate::model::DatabaseInstance>,
3001 {
3002 self.0.request.body = v.map(|x| x.into());
3003 self
3004 }
3005 }
3006
3007 #[doc(hidden)]
3008 impl crate::RequestBuilder for Insert {
3009 fn request_options(&mut self) -> &mut crate::RequestOptions {
3010 &mut self.0.options
3011 }
3012 }
3013
3014 #[derive(Clone, Debug)]
3035 pub struct List(RequestBuilder<crate::model::SqlInstancesListRequest>);
3036
3037 impl List {
3038 pub(crate) fn new(
3039 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3040 ) -> Self {
3041 Self(RequestBuilder::new(stub))
3042 }
3043
3044 pub fn with_request<V: Into<crate::model::SqlInstancesListRequest>>(
3046 mut self,
3047 v: V,
3048 ) -> Self {
3049 self.0.request = v.into();
3050 self
3051 }
3052
3053 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3055 self.0.options = v.into();
3056 self
3057 }
3058
3059 pub async fn send(self) -> Result<crate::model::InstancesListResponse> {
3061 (*self.0.stub)
3062 .list(self.0.request, self.0.options)
3063 .await
3064 .map(crate::Response::into_body)
3065 }
3066
3067 pub fn by_page(
3069 self,
3070 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::InstancesListResponse, crate::Error>
3071 {
3072 use std::clone::Clone;
3073 let token = self.0.request.page_token.clone();
3074 let execute = move |token: String| {
3075 let mut builder = self.clone();
3076 builder.0.request = builder.0.request.set_page_token(token);
3077 builder.send()
3078 };
3079 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3080 }
3081
3082 pub fn by_item(
3084 self,
3085 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3086 crate::model::InstancesListResponse,
3087 crate::Error,
3088 > {
3089 use google_cloud_gax::paginator::Paginator;
3090 self.by_page().items()
3091 }
3092
3093 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3095 self.0.request.filter = v.into();
3096 self
3097 }
3098
3099 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
3101 self.0.request.max_results = v.into();
3102 self
3103 }
3104
3105 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3107 self.0.request.page_token = v.into();
3108 self
3109 }
3110
3111 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3113 self.0.request.project = v.into();
3114 self
3115 }
3116 }
3117
3118 #[doc(hidden)]
3119 impl crate::RequestBuilder for List {
3120 fn request_options(&mut self) -> &mut crate::RequestOptions {
3121 &mut self.0.options
3122 }
3123 }
3124
3125 #[derive(Clone, Debug)]
3142 pub struct ListServerCas(RequestBuilder<crate::model::SqlInstancesListServerCasRequest>);
3143
3144 impl ListServerCas {
3145 pub(crate) fn new(
3146 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3147 ) -> Self {
3148 Self(RequestBuilder::new(stub))
3149 }
3150
3151 pub fn with_request<V: Into<crate::model::SqlInstancesListServerCasRequest>>(
3153 mut self,
3154 v: V,
3155 ) -> Self {
3156 self.0.request = v.into();
3157 self
3158 }
3159
3160 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3162 self.0.options = v.into();
3163 self
3164 }
3165
3166 pub async fn send(self) -> Result<crate::model::InstancesListServerCasResponse> {
3168 (*self.0.stub)
3169 .list_server_cas(self.0.request, self.0.options)
3170 .await
3171 .map(crate::Response::into_body)
3172 }
3173
3174 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3176 self.0.request.instance = v.into();
3177 self
3178 }
3179
3180 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3182 self.0.request.project = v.into();
3183 self
3184 }
3185 }
3186
3187 #[doc(hidden)]
3188 impl crate::RequestBuilder for ListServerCas {
3189 fn request_options(&mut self) -> &mut crate::RequestOptions {
3190 &mut self.0.options
3191 }
3192 }
3193
3194 #[derive(Clone, Debug)]
3211 pub struct ListServerCertificates(
3212 RequestBuilder<crate::model::SqlInstancesListServerCertificatesRequest>,
3213 );
3214
3215 impl ListServerCertificates {
3216 pub(crate) fn new(
3217 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3218 ) -> Self {
3219 Self(RequestBuilder::new(stub))
3220 }
3221
3222 pub fn with_request<V: Into<crate::model::SqlInstancesListServerCertificatesRequest>>(
3224 mut self,
3225 v: V,
3226 ) -> Self {
3227 self.0.request = v.into();
3228 self
3229 }
3230
3231 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3233 self.0.options = v.into();
3234 self
3235 }
3236
3237 pub async fn send(self) -> Result<crate::model::InstancesListServerCertificatesResponse> {
3239 (*self.0.stub)
3240 .list_server_certificates(self.0.request, self.0.options)
3241 .await
3242 .map(crate::Response::into_body)
3243 }
3244
3245 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3249 self.0.request.instance = v.into();
3250 self
3251 }
3252
3253 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3257 self.0.request.project = v.into();
3258 self
3259 }
3260 }
3261
3262 #[doc(hidden)]
3263 impl crate::RequestBuilder for ListServerCertificates {
3264 fn request_options(&mut self) -> &mut crate::RequestOptions {
3265 &mut self.0.options
3266 }
3267 }
3268
3269 #[derive(Clone, Debug)]
3286 pub struct ListEntraIdCertificates(
3287 RequestBuilder<crate::model::SqlInstancesListEntraIdCertificatesRequest>,
3288 );
3289
3290 impl ListEntraIdCertificates {
3291 pub(crate) fn new(
3292 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3293 ) -> Self {
3294 Self(RequestBuilder::new(stub))
3295 }
3296
3297 pub fn with_request<V: Into<crate::model::SqlInstancesListEntraIdCertificatesRequest>>(
3299 mut self,
3300 v: V,
3301 ) -> Self {
3302 self.0.request = v.into();
3303 self
3304 }
3305
3306 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3308 self.0.options = v.into();
3309 self
3310 }
3311
3312 pub async fn send(self) -> Result<crate::model::InstancesListEntraIdCertificatesResponse> {
3314 (*self.0.stub)
3315 .list_entra_id_certificates(self.0.request, self.0.options)
3316 .await
3317 .map(crate::Response::into_body)
3318 }
3319
3320 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3324 self.0.request.instance = v.into();
3325 self
3326 }
3327
3328 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3332 self.0.request.project = v.into();
3333 self
3334 }
3335 }
3336
3337 #[doc(hidden)]
3338 impl crate::RequestBuilder for ListEntraIdCertificates {
3339 fn request_options(&mut self) -> &mut crate::RequestOptions {
3340 &mut self.0.options
3341 }
3342 }
3343
3344 #[derive(Clone, Debug)]
3361 pub struct Patch(RequestBuilder<crate::model::SqlInstancesPatchRequest>);
3362
3363 impl Patch {
3364 pub(crate) fn new(
3365 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3366 ) -> Self {
3367 Self(RequestBuilder::new(stub))
3368 }
3369
3370 pub fn with_request<V: Into<crate::model::SqlInstancesPatchRequest>>(
3372 mut self,
3373 v: V,
3374 ) -> Self {
3375 self.0.request = v.into();
3376 self
3377 }
3378
3379 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3381 self.0.options = v.into();
3382 self
3383 }
3384
3385 pub async fn send(self) -> Result<crate::model::Operation> {
3387 (*self.0.stub)
3388 .patch(self.0.request, self.0.options)
3389 .await
3390 .map(crate::Response::into_body)
3391 }
3392
3393 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3395 self.0.request.instance = v.into();
3396 self
3397 }
3398
3399 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3401 self.0.request.project = v.into();
3402 self
3403 }
3404
3405 pub fn set_body<T>(mut self, v: T) -> Self
3407 where
3408 T: std::convert::Into<crate::model::DatabaseInstance>,
3409 {
3410 self.0.request.body = std::option::Option::Some(v.into());
3411 self
3412 }
3413
3414 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3416 where
3417 T: std::convert::Into<crate::model::DatabaseInstance>,
3418 {
3419 self.0.request.body = v.map(|x| x.into());
3420 self
3421 }
3422 }
3423
3424 #[doc(hidden)]
3425 impl crate::RequestBuilder for Patch {
3426 fn request_options(&mut self) -> &mut crate::RequestOptions {
3427 &mut self.0.options
3428 }
3429 }
3430
3431 #[derive(Clone, Debug)]
3448 pub struct PromoteReplica(RequestBuilder<crate::model::SqlInstancesPromoteReplicaRequest>);
3449
3450 impl PromoteReplica {
3451 pub(crate) fn new(
3452 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3453 ) -> Self {
3454 Self(RequestBuilder::new(stub))
3455 }
3456
3457 pub fn with_request<V: Into<crate::model::SqlInstancesPromoteReplicaRequest>>(
3459 mut self,
3460 v: V,
3461 ) -> Self {
3462 self.0.request = v.into();
3463 self
3464 }
3465
3466 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3468 self.0.options = v.into();
3469 self
3470 }
3471
3472 pub async fn send(self) -> Result<crate::model::Operation> {
3474 (*self.0.stub)
3475 .promote_replica(self.0.request, self.0.options)
3476 .await
3477 .map(crate::Response::into_body)
3478 }
3479
3480 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3482 self.0.request.instance = v.into();
3483 self
3484 }
3485
3486 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3488 self.0.request.project = v.into();
3489 self
3490 }
3491
3492 pub fn set_failover<T: Into<bool>>(mut self, v: T) -> Self {
3494 self.0.request.failover = v.into();
3495 self
3496 }
3497 }
3498
3499 #[doc(hidden)]
3500 impl crate::RequestBuilder for PromoteReplica {
3501 fn request_options(&mut self) -> &mut crate::RequestOptions {
3502 &mut self.0.options
3503 }
3504 }
3505
3506 #[derive(Clone, Debug)]
3523 pub struct Switchover(RequestBuilder<crate::model::SqlInstancesSwitchoverRequest>);
3524
3525 impl Switchover {
3526 pub(crate) fn new(
3527 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3528 ) -> Self {
3529 Self(RequestBuilder::new(stub))
3530 }
3531
3532 pub fn with_request<V: Into<crate::model::SqlInstancesSwitchoverRequest>>(
3534 mut self,
3535 v: V,
3536 ) -> Self {
3537 self.0.request = v.into();
3538 self
3539 }
3540
3541 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3543 self.0.options = v.into();
3544 self
3545 }
3546
3547 pub async fn send(self) -> Result<crate::model::Operation> {
3549 (*self.0.stub)
3550 .switchover(self.0.request, self.0.options)
3551 .await
3552 .map(crate::Response::into_body)
3553 }
3554
3555 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3557 self.0.request.instance = v.into();
3558 self
3559 }
3560
3561 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3563 self.0.request.project = v.into();
3564 self
3565 }
3566
3567 pub fn set_db_timeout<T>(mut self, v: T) -> Self
3569 where
3570 T: std::convert::Into<wkt::Duration>,
3571 {
3572 self.0.request.db_timeout = std::option::Option::Some(v.into());
3573 self
3574 }
3575
3576 pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
3578 where
3579 T: std::convert::Into<wkt::Duration>,
3580 {
3581 self.0.request.db_timeout = v.map(|x| x.into());
3582 self
3583 }
3584 }
3585
3586 #[doc(hidden)]
3587 impl crate::RequestBuilder for Switchover {
3588 fn request_options(&mut self) -> &mut crate::RequestOptions {
3589 &mut self.0.options
3590 }
3591 }
3592
3593 #[derive(Clone, Debug)]
3610 pub struct ResetSslConfig(RequestBuilder<crate::model::SqlInstancesResetSslConfigRequest>);
3611
3612 impl ResetSslConfig {
3613 pub(crate) fn new(
3614 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3615 ) -> Self {
3616 Self(RequestBuilder::new(stub))
3617 }
3618
3619 pub fn with_request<V: Into<crate::model::SqlInstancesResetSslConfigRequest>>(
3621 mut self,
3622 v: V,
3623 ) -> Self {
3624 self.0.request = v.into();
3625 self
3626 }
3627
3628 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3630 self.0.options = v.into();
3631 self
3632 }
3633
3634 pub async fn send(self) -> Result<crate::model::Operation> {
3636 (*self.0.stub)
3637 .reset_ssl_config(self.0.request, self.0.options)
3638 .await
3639 .map(crate::Response::into_body)
3640 }
3641
3642 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3644 self.0.request.instance = v.into();
3645 self
3646 }
3647
3648 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3650 self.0.request.project = v.into();
3651 self
3652 }
3653
3654 pub fn set_mode<
3656 T: Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
3657 >(
3658 mut self,
3659 v: T,
3660 ) -> Self {
3661 self.0.request.mode = v.into();
3662 self
3663 }
3664 }
3665
3666 #[doc(hidden)]
3667 impl crate::RequestBuilder for ResetSslConfig {
3668 fn request_options(&mut self) -> &mut crate::RequestOptions {
3669 &mut self.0.options
3670 }
3671 }
3672
3673 #[derive(Clone, Debug)]
3690 pub struct Restart(RequestBuilder<crate::model::SqlInstancesRestartRequest>);
3691
3692 impl Restart {
3693 pub(crate) fn new(
3694 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3695 ) -> Self {
3696 Self(RequestBuilder::new(stub))
3697 }
3698
3699 pub fn with_request<V: Into<crate::model::SqlInstancesRestartRequest>>(
3701 mut self,
3702 v: V,
3703 ) -> Self {
3704 self.0.request = v.into();
3705 self
3706 }
3707
3708 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3710 self.0.options = v.into();
3711 self
3712 }
3713
3714 pub async fn send(self) -> Result<crate::model::Operation> {
3716 (*self.0.stub)
3717 .restart(self.0.request, self.0.options)
3718 .await
3719 .map(crate::Response::into_body)
3720 }
3721
3722 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3724 self.0.request.instance = v.into();
3725 self
3726 }
3727
3728 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3730 self.0.request.project = v.into();
3731 self
3732 }
3733 }
3734
3735 #[doc(hidden)]
3736 impl crate::RequestBuilder for Restart {
3737 fn request_options(&mut self) -> &mut crate::RequestOptions {
3738 &mut self.0.options
3739 }
3740 }
3741
3742 #[derive(Clone, Debug)]
3759 pub struct RestoreBackup(RequestBuilder<crate::model::SqlInstancesRestoreBackupRequest>);
3760
3761 impl RestoreBackup {
3762 pub(crate) fn new(
3763 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3764 ) -> Self {
3765 Self(RequestBuilder::new(stub))
3766 }
3767
3768 pub fn with_request<V: Into<crate::model::SqlInstancesRestoreBackupRequest>>(
3770 mut self,
3771 v: V,
3772 ) -> Self {
3773 self.0.request = v.into();
3774 self
3775 }
3776
3777 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3779 self.0.options = v.into();
3780 self
3781 }
3782
3783 pub async fn send(self) -> Result<crate::model::Operation> {
3785 (*self.0.stub)
3786 .restore_backup(self.0.request, self.0.options)
3787 .await
3788 .map(crate::Response::into_body)
3789 }
3790
3791 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3793 self.0.request.instance = v.into();
3794 self
3795 }
3796
3797 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3799 self.0.request.project = v.into();
3800 self
3801 }
3802
3803 pub fn set_body<T>(mut self, v: T) -> Self
3805 where
3806 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
3807 {
3808 self.0.request.body = std::option::Option::Some(v.into());
3809 self
3810 }
3811
3812 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3814 where
3815 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
3816 {
3817 self.0.request.body = v.map(|x| x.into());
3818 self
3819 }
3820 }
3821
3822 #[doc(hidden)]
3823 impl crate::RequestBuilder for RestoreBackup {
3824 fn request_options(&mut self) -> &mut crate::RequestOptions {
3825 &mut self.0.options
3826 }
3827 }
3828
3829 #[derive(Clone, Debug)]
3846 pub struct RotateServerCa(RequestBuilder<crate::model::SqlInstancesRotateServerCaRequest>);
3847
3848 impl RotateServerCa {
3849 pub(crate) fn new(
3850 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3851 ) -> Self {
3852 Self(RequestBuilder::new(stub))
3853 }
3854
3855 pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCaRequest>>(
3857 mut self,
3858 v: V,
3859 ) -> Self {
3860 self.0.request = v.into();
3861 self
3862 }
3863
3864 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3866 self.0.options = v.into();
3867 self
3868 }
3869
3870 pub async fn send(self) -> Result<crate::model::Operation> {
3872 (*self.0.stub)
3873 .rotate_server_ca(self.0.request, self.0.options)
3874 .await
3875 .map(crate::Response::into_body)
3876 }
3877
3878 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3880 self.0.request.instance = v.into();
3881 self
3882 }
3883
3884 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3886 self.0.request.project = v.into();
3887 self
3888 }
3889
3890 pub fn set_body<T>(mut self, v: T) -> Self
3892 where
3893 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
3894 {
3895 self.0.request.body = std::option::Option::Some(v.into());
3896 self
3897 }
3898
3899 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3901 where
3902 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
3903 {
3904 self.0.request.body = v.map(|x| x.into());
3905 self
3906 }
3907 }
3908
3909 #[doc(hidden)]
3910 impl crate::RequestBuilder for RotateServerCa {
3911 fn request_options(&mut self) -> &mut crate::RequestOptions {
3912 &mut self.0.options
3913 }
3914 }
3915
3916 #[derive(Clone, Debug)]
3933 pub struct RotateServerCertificate(
3934 RequestBuilder<crate::model::SqlInstancesRotateServerCertificateRequest>,
3935 );
3936
3937 impl RotateServerCertificate {
3938 pub(crate) fn new(
3939 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3940 ) -> Self {
3941 Self(RequestBuilder::new(stub))
3942 }
3943
3944 pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCertificateRequest>>(
3946 mut self,
3947 v: V,
3948 ) -> Self {
3949 self.0.request = v.into();
3950 self
3951 }
3952
3953 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3955 self.0.options = v.into();
3956 self
3957 }
3958
3959 pub async fn send(self) -> Result<crate::model::Operation> {
3961 (*self.0.stub)
3962 .rotate_server_certificate(self.0.request, self.0.options)
3963 .await
3964 .map(crate::Response::into_body)
3965 }
3966
3967 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3971 self.0.request.instance = v.into();
3972 self
3973 }
3974
3975 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3979 self.0.request.project = v.into();
3980 self
3981 }
3982
3983 pub fn set_body<T>(mut self, v: T) -> Self
3985 where
3986 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
3987 {
3988 self.0.request.body = std::option::Option::Some(v.into());
3989 self
3990 }
3991
3992 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3994 where
3995 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
3996 {
3997 self.0.request.body = v.map(|x| x.into());
3998 self
3999 }
4000 }
4001
4002 #[doc(hidden)]
4003 impl crate::RequestBuilder for RotateServerCertificate {
4004 fn request_options(&mut self) -> &mut crate::RequestOptions {
4005 &mut self.0.options
4006 }
4007 }
4008
4009 #[derive(Clone, Debug)]
4026 pub struct RotateEntraIdCertificate(
4027 RequestBuilder<crate::model::SqlInstancesRotateEntraIdCertificateRequest>,
4028 );
4029
4030 impl RotateEntraIdCertificate {
4031 pub(crate) fn new(
4032 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4033 ) -> Self {
4034 Self(RequestBuilder::new(stub))
4035 }
4036
4037 pub fn with_request<V: Into<crate::model::SqlInstancesRotateEntraIdCertificateRequest>>(
4039 mut self,
4040 v: V,
4041 ) -> Self {
4042 self.0.request = v.into();
4043 self
4044 }
4045
4046 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4048 self.0.options = v.into();
4049 self
4050 }
4051
4052 pub async fn send(self) -> Result<crate::model::Operation> {
4054 (*self.0.stub)
4055 .rotate_entra_id_certificate(self.0.request, self.0.options)
4056 .await
4057 .map(crate::Response::into_body)
4058 }
4059
4060 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4064 self.0.request.instance = v.into();
4065 self
4066 }
4067
4068 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4072 self.0.request.project = v.into();
4073 self
4074 }
4075
4076 pub fn set_body<T>(mut self, v: T) -> Self
4078 where
4079 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
4080 {
4081 self.0.request.body = std::option::Option::Some(v.into());
4082 self
4083 }
4084
4085 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4087 where
4088 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
4089 {
4090 self.0.request.body = v.map(|x| x.into());
4091 self
4092 }
4093 }
4094
4095 #[doc(hidden)]
4096 impl crate::RequestBuilder for RotateEntraIdCertificate {
4097 fn request_options(&mut self) -> &mut crate::RequestOptions {
4098 &mut self.0.options
4099 }
4100 }
4101
4102 #[derive(Clone, Debug)]
4119 pub struct StartReplica(RequestBuilder<crate::model::SqlInstancesStartReplicaRequest>);
4120
4121 impl StartReplica {
4122 pub(crate) fn new(
4123 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4124 ) -> Self {
4125 Self(RequestBuilder::new(stub))
4126 }
4127
4128 pub fn with_request<V: Into<crate::model::SqlInstancesStartReplicaRequest>>(
4130 mut self,
4131 v: V,
4132 ) -> Self {
4133 self.0.request = v.into();
4134 self
4135 }
4136
4137 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4139 self.0.options = v.into();
4140 self
4141 }
4142
4143 pub async fn send(self) -> Result<crate::model::Operation> {
4145 (*self.0.stub)
4146 .start_replica(self.0.request, self.0.options)
4147 .await
4148 .map(crate::Response::into_body)
4149 }
4150
4151 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4153 self.0.request.instance = v.into();
4154 self
4155 }
4156
4157 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4159 self.0.request.project = v.into();
4160 self
4161 }
4162 }
4163
4164 #[doc(hidden)]
4165 impl crate::RequestBuilder for StartReplica {
4166 fn request_options(&mut self) -> &mut crate::RequestOptions {
4167 &mut self.0.options
4168 }
4169 }
4170
4171 #[derive(Clone, Debug)]
4188 pub struct StopReplica(RequestBuilder<crate::model::SqlInstancesStopReplicaRequest>);
4189
4190 impl StopReplica {
4191 pub(crate) fn new(
4192 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4193 ) -> Self {
4194 Self(RequestBuilder::new(stub))
4195 }
4196
4197 pub fn with_request<V: Into<crate::model::SqlInstancesStopReplicaRequest>>(
4199 mut self,
4200 v: V,
4201 ) -> Self {
4202 self.0.request = v.into();
4203 self
4204 }
4205
4206 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4208 self.0.options = v.into();
4209 self
4210 }
4211
4212 pub async fn send(self) -> Result<crate::model::Operation> {
4214 (*self.0.stub)
4215 .stop_replica(self.0.request, self.0.options)
4216 .await
4217 .map(crate::Response::into_body)
4218 }
4219
4220 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4222 self.0.request.instance = v.into();
4223 self
4224 }
4225
4226 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4228 self.0.request.project = v.into();
4229 self
4230 }
4231 }
4232
4233 #[doc(hidden)]
4234 impl crate::RequestBuilder for StopReplica {
4235 fn request_options(&mut self) -> &mut crate::RequestOptions {
4236 &mut self.0.options
4237 }
4238 }
4239
4240 #[derive(Clone, Debug)]
4257 pub struct TruncateLog(RequestBuilder<crate::model::SqlInstancesTruncateLogRequest>);
4258
4259 impl TruncateLog {
4260 pub(crate) fn new(
4261 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4262 ) -> Self {
4263 Self(RequestBuilder::new(stub))
4264 }
4265
4266 pub fn with_request<V: Into<crate::model::SqlInstancesTruncateLogRequest>>(
4268 mut self,
4269 v: V,
4270 ) -> Self {
4271 self.0.request = v.into();
4272 self
4273 }
4274
4275 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4277 self.0.options = v.into();
4278 self
4279 }
4280
4281 pub async fn send(self) -> Result<crate::model::Operation> {
4283 (*self.0.stub)
4284 .truncate_log(self.0.request, self.0.options)
4285 .await
4286 .map(crate::Response::into_body)
4287 }
4288
4289 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4291 self.0.request.instance = v.into();
4292 self
4293 }
4294
4295 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4297 self.0.request.project = v.into();
4298 self
4299 }
4300
4301 pub fn set_body<T>(mut self, v: T) -> Self
4303 where
4304 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
4305 {
4306 self.0.request.body = std::option::Option::Some(v.into());
4307 self
4308 }
4309
4310 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4312 where
4313 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
4314 {
4315 self.0.request.body = v.map(|x| x.into());
4316 self
4317 }
4318 }
4319
4320 #[doc(hidden)]
4321 impl crate::RequestBuilder for TruncateLog {
4322 fn request_options(&mut self) -> &mut crate::RequestOptions {
4323 &mut self.0.options
4324 }
4325 }
4326
4327 #[derive(Clone, Debug)]
4344 pub struct Update(RequestBuilder<crate::model::SqlInstancesUpdateRequest>);
4345
4346 impl Update {
4347 pub(crate) fn new(
4348 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4349 ) -> Self {
4350 Self(RequestBuilder::new(stub))
4351 }
4352
4353 pub fn with_request<V: Into<crate::model::SqlInstancesUpdateRequest>>(
4355 mut self,
4356 v: V,
4357 ) -> Self {
4358 self.0.request = v.into();
4359 self
4360 }
4361
4362 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4364 self.0.options = v.into();
4365 self
4366 }
4367
4368 pub async fn send(self) -> Result<crate::model::Operation> {
4370 (*self.0.stub)
4371 .update(self.0.request, self.0.options)
4372 .await
4373 .map(crate::Response::into_body)
4374 }
4375
4376 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4378 self.0.request.instance = v.into();
4379 self
4380 }
4381
4382 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4384 self.0.request.project = v.into();
4385 self
4386 }
4387
4388 pub fn set_body<T>(mut self, v: T) -> Self
4390 where
4391 T: std::convert::Into<crate::model::DatabaseInstance>,
4392 {
4393 self.0.request.body = std::option::Option::Some(v.into());
4394 self
4395 }
4396
4397 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4399 where
4400 T: std::convert::Into<crate::model::DatabaseInstance>,
4401 {
4402 self.0.request.body = v.map(|x| x.into());
4403 self
4404 }
4405 }
4406
4407 #[doc(hidden)]
4408 impl crate::RequestBuilder for Update {
4409 fn request_options(&mut self) -> &mut crate::RequestOptions {
4410 &mut self.0.options
4411 }
4412 }
4413
4414 #[derive(Clone, Debug)]
4431 pub struct CreateEphemeral(
4432 RequestBuilder<crate::model::SqlInstancesCreateEphemeralCertRequest>,
4433 );
4434
4435 impl CreateEphemeral {
4436 pub(crate) fn new(
4437 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4438 ) -> Self {
4439 Self(RequestBuilder::new(stub))
4440 }
4441
4442 pub fn with_request<V: Into<crate::model::SqlInstancesCreateEphemeralCertRequest>>(
4444 mut self,
4445 v: V,
4446 ) -> Self {
4447 self.0.request = v.into();
4448 self
4449 }
4450
4451 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4453 self.0.options = v.into();
4454 self
4455 }
4456
4457 pub async fn send(self) -> Result<crate::model::SslCert> {
4459 (*self.0.stub)
4460 .create_ephemeral(self.0.request, self.0.options)
4461 .await
4462 .map(crate::Response::into_body)
4463 }
4464
4465 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4467 self.0.request.instance = v.into();
4468 self
4469 }
4470
4471 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4473 self.0.request.project = v.into();
4474 self
4475 }
4476
4477 pub fn set_body<T>(mut self, v: T) -> Self
4479 where
4480 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
4481 {
4482 self.0.request.body = std::option::Option::Some(v.into());
4483 self
4484 }
4485
4486 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4488 where
4489 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
4490 {
4491 self.0.request.body = v.map(|x| x.into());
4492 self
4493 }
4494 }
4495
4496 #[doc(hidden)]
4497 impl crate::RequestBuilder for CreateEphemeral {
4498 fn request_options(&mut self) -> &mut crate::RequestOptions {
4499 &mut self.0.options
4500 }
4501 }
4502
4503 #[derive(Clone, Debug)]
4520 pub struct RescheduleMaintenance(
4521 RequestBuilder<crate::model::SqlInstancesRescheduleMaintenanceRequest>,
4522 );
4523
4524 impl RescheduleMaintenance {
4525 pub(crate) fn new(
4526 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4527 ) -> Self {
4528 Self(RequestBuilder::new(stub))
4529 }
4530
4531 pub fn with_request<V: Into<crate::model::SqlInstancesRescheduleMaintenanceRequest>>(
4533 mut self,
4534 v: V,
4535 ) -> Self {
4536 self.0.request = v.into();
4537 self
4538 }
4539
4540 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4542 self.0.options = v.into();
4543 self
4544 }
4545
4546 pub async fn send(self) -> Result<crate::model::Operation> {
4548 (*self.0.stub)
4549 .reschedule_maintenance(self.0.request, self.0.options)
4550 .await
4551 .map(crate::Response::into_body)
4552 }
4553
4554 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4556 self.0.request.instance = v.into();
4557 self
4558 }
4559
4560 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4562 self.0.request.project = v.into();
4563 self
4564 }
4565
4566 pub fn set_body<T>(mut self, v: T) -> Self
4568 where
4569 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4570 {
4571 self.0.request.body = std::option::Option::Some(v.into());
4572 self
4573 }
4574
4575 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4577 where
4578 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4579 {
4580 self.0.request.body = v.map(|x| x.into());
4581 self
4582 }
4583 }
4584
4585 #[doc(hidden)]
4586 impl crate::RequestBuilder for RescheduleMaintenance {
4587 fn request_options(&mut self) -> &mut crate::RequestOptions {
4588 &mut self.0.options
4589 }
4590 }
4591
4592 #[derive(Clone, Debug)]
4609 pub struct VerifyExternalSyncSettings(
4610 RequestBuilder<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
4611 );
4612
4613 impl VerifyExternalSyncSettings {
4614 pub(crate) fn new(
4615 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4616 ) -> Self {
4617 Self(RequestBuilder::new(stub))
4618 }
4619
4620 pub fn with_request<
4622 V: Into<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
4623 >(
4624 mut self,
4625 v: V,
4626 ) -> Self {
4627 self.0.request = v.into();
4628 self
4629 }
4630
4631 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4633 self.0.options = v.into();
4634 self
4635 }
4636
4637 pub async fn send(
4639 self,
4640 ) -> Result<crate::model::SqlInstancesVerifyExternalSyncSettingsResponse> {
4641 (*self.0.stub)
4642 .verify_external_sync_settings(self.0.request, self.0.options)
4643 .await
4644 .map(crate::Response::into_body)
4645 }
4646
4647 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4649 self.0.request.instance = v.into();
4650 self
4651 }
4652
4653 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4655 self.0.request.project = v.into();
4656 self
4657 }
4658
4659 pub fn set_verify_connection_only<T: Into<bool>>(mut self, v: T) -> Self {
4661 self.0.request.verify_connection_only = v.into();
4662 self
4663 }
4664
4665 pub fn set_sync_mode<
4667 T: Into<
4668 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
4669 >,
4670 >(
4671 mut self,
4672 v: T,
4673 ) -> Self {
4674 self.0.request.sync_mode = v.into();
4675 self
4676 }
4677
4678 pub fn set_verify_replication_only<T: Into<bool>>(mut self, v: T) -> Self {
4680 self.0.request.verify_replication_only = v.into();
4681 self
4682 }
4683
4684 pub fn set_migration_type<
4686 T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
4687 >(
4688 mut self,
4689 v: T,
4690 ) -> Self {
4691 self.0.request.migration_type = v.into();
4692 self
4693 }
4694
4695 pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
4697 mut self,
4698 v: T,
4699 ) -> Self {
4700 self.0.request.sync_parallel_level = v.into();
4701 self
4702 }
4703
4704 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
4706 where
4707 T: std::iter::IntoIterator<Item = V>,
4708 V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
4709 {
4710 use std::iter::Iterator;
4711 self.0.request.selected_objects = v.into_iter().map(|i| i.into()).collect();
4712 self
4713 }
4714
4715 pub fn set_sync_config<
4720 T: Into<
4721 Option<
4722 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
4723 >,
4724 >,
4725 >(
4726 mut self,
4727 v: T,
4728 ) -> Self {
4729 self.0.request.sync_config = v.into();
4730 self
4731 }
4732
4733 pub fn set_mysql_sync_config<
4739 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
4740 >(
4741 mut self,
4742 v: T,
4743 ) -> Self {
4744 self.0.request = self.0.request.set_mysql_sync_config(v);
4745 self
4746 }
4747 }
4748
4749 #[doc(hidden)]
4750 impl crate::RequestBuilder for VerifyExternalSyncSettings {
4751 fn request_options(&mut self) -> &mut crate::RequestOptions {
4752 &mut self.0.options
4753 }
4754 }
4755
4756 #[derive(Clone, Debug)]
4773 pub struct StartExternalSync(
4774 RequestBuilder<crate::model::SqlInstancesStartExternalSyncRequest>,
4775 );
4776
4777 impl StartExternalSync {
4778 pub(crate) fn new(
4779 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4780 ) -> Self {
4781 Self(RequestBuilder::new(stub))
4782 }
4783
4784 pub fn with_request<V: Into<crate::model::SqlInstancesStartExternalSyncRequest>>(
4786 mut self,
4787 v: V,
4788 ) -> Self {
4789 self.0.request = v.into();
4790 self
4791 }
4792
4793 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4795 self.0.options = v.into();
4796 self
4797 }
4798
4799 pub async fn send(self) -> Result<crate::model::Operation> {
4801 (*self.0.stub)
4802 .start_external_sync(self.0.request, self.0.options)
4803 .await
4804 .map(crate::Response::into_body)
4805 }
4806
4807 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4809 self.0.request.instance = v.into();
4810 self
4811 }
4812
4813 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4815 self.0.request.project = v.into();
4816 self
4817 }
4818
4819 pub fn set_sync_mode<
4821 T: Into<
4822 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
4823 >,
4824 >(
4825 mut self,
4826 v: T,
4827 ) -> Self {
4828 self.0.request.sync_mode = v.into();
4829 self
4830 }
4831
4832 pub fn set_skip_verification<T: Into<bool>>(mut self, v: T) -> Self {
4834 self.0.request.skip_verification = v.into();
4835 self
4836 }
4837
4838 pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
4840 mut self,
4841 v: T,
4842 ) -> Self {
4843 self.0.request.sync_parallel_level = v.into();
4844 self
4845 }
4846
4847 pub fn set_migration_type<
4849 T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
4850 >(
4851 mut self,
4852 v: T,
4853 ) -> Self {
4854 self.0.request.migration_type = v.into();
4855 self
4856 }
4857
4858 pub fn set_replica_overwrite_enabled<T: Into<bool>>(mut self, v: T) -> Self {
4860 self.0.request.replica_overwrite_enabled = v.into();
4861 self
4862 }
4863
4864 pub fn set_sync_config<
4869 T: Into<Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>>,
4870 >(
4871 mut self,
4872 v: T,
4873 ) -> Self {
4874 self.0.request.sync_config = v.into();
4875 self
4876 }
4877
4878 pub fn set_mysql_sync_config<
4884 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
4885 >(
4886 mut self,
4887 v: T,
4888 ) -> Self {
4889 self.0.request = self.0.request.set_mysql_sync_config(v);
4890 self
4891 }
4892 }
4893
4894 #[doc(hidden)]
4895 impl crate::RequestBuilder for StartExternalSync {
4896 fn request_options(&mut self) -> &mut crate::RequestOptions {
4897 &mut self.0.options
4898 }
4899 }
4900
4901 #[derive(Clone, Debug)]
4918 pub struct PerformDiskShrink(
4919 RequestBuilder<crate::model::SqlInstancesPerformDiskShrinkRequest>,
4920 );
4921
4922 impl PerformDiskShrink {
4923 pub(crate) fn new(
4924 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4925 ) -> Self {
4926 Self(RequestBuilder::new(stub))
4927 }
4928
4929 pub fn with_request<V: Into<crate::model::SqlInstancesPerformDiskShrinkRequest>>(
4931 mut self,
4932 v: V,
4933 ) -> Self {
4934 self.0.request = v.into();
4935 self
4936 }
4937
4938 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4940 self.0.options = v.into();
4941 self
4942 }
4943
4944 pub async fn send(self) -> Result<crate::model::Operation> {
4946 (*self.0.stub)
4947 .perform_disk_shrink(self.0.request, self.0.options)
4948 .await
4949 .map(crate::Response::into_body)
4950 }
4951
4952 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4954 self.0.request.instance = v.into();
4955 self
4956 }
4957
4958 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4960 self.0.request.project = v.into();
4961 self
4962 }
4963
4964 pub fn set_body<T>(mut self, v: T) -> Self
4966 where
4967 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
4968 {
4969 self.0.request.body = std::option::Option::Some(v.into());
4970 self
4971 }
4972
4973 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4975 where
4976 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
4977 {
4978 self.0.request.body = v.map(|x| x.into());
4979 self
4980 }
4981 }
4982
4983 #[doc(hidden)]
4984 impl crate::RequestBuilder for PerformDiskShrink {
4985 fn request_options(&mut self) -> &mut crate::RequestOptions {
4986 &mut self.0.options
4987 }
4988 }
4989
4990 #[derive(Clone, Debug)]
5007 pub struct GetDiskShrinkConfig(
5008 RequestBuilder<crate::model::SqlInstancesGetDiskShrinkConfigRequest>,
5009 );
5010
5011 impl GetDiskShrinkConfig {
5012 pub(crate) fn new(
5013 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5014 ) -> Self {
5015 Self(RequestBuilder::new(stub))
5016 }
5017
5018 pub fn with_request<V: Into<crate::model::SqlInstancesGetDiskShrinkConfigRequest>>(
5020 mut self,
5021 v: V,
5022 ) -> Self {
5023 self.0.request = v.into();
5024 self
5025 }
5026
5027 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5029 self.0.options = v.into();
5030 self
5031 }
5032
5033 pub async fn send(self) -> Result<crate::model::SqlInstancesGetDiskShrinkConfigResponse> {
5035 (*self.0.stub)
5036 .get_disk_shrink_config(self.0.request, self.0.options)
5037 .await
5038 .map(crate::Response::into_body)
5039 }
5040
5041 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5043 self.0.request.instance = v.into();
5044 self
5045 }
5046
5047 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5049 self.0.request.project = v.into();
5050 self
5051 }
5052 }
5053
5054 #[doc(hidden)]
5055 impl crate::RequestBuilder for GetDiskShrinkConfig {
5056 fn request_options(&mut self) -> &mut crate::RequestOptions {
5057 &mut self.0.options
5058 }
5059 }
5060
5061 #[derive(Clone, Debug)]
5078 pub struct ResetReplicaSize(RequestBuilder<crate::model::SqlInstancesResetReplicaSizeRequest>);
5079
5080 impl ResetReplicaSize {
5081 pub(crate) fn new(
5082 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5083 ) -> Self {
5084 Self(RequestBuilder::new(stub))
5085 }
5086
5087 pub fn with_request<V: Into<crate::model::SqlInstancesResetReplicaSizeRequest>>(
5089 mut self,
5090 v: V,
5091 ) -> Self {
5092 self.0.request = v.into();
5093 self
5094 }
5095
5096 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5098 self.0.options = v.into();
5099 self
5100 }
5101
5102 pub async fn send(self) -> Result<crate::model::Operation> {
5104 (*self.0.stub)
5105 .reset_replica_size(self.0.request, self.0.options)
5106 .await
5107 .map(crate::Response::into_body)
5108 }
5109
5110 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5112 self.0.request.instance = v.into();
5113 self
5114 }
5115
5116 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5118 self.0.request.project = v.into();
5119 self
5120 }
5121 }
5122
5123 #[doc(hidden)]
5124 impl crate::RequestBuilder for ResetReplicaSize {
5125 fn request_options(&mut self) -> &mut crate::RequestOptions {
5126 &mut self.0.options
5127 }
5128 }
5129
5130 #[derive(Clone, Debug)]
5147 pub struct GetLatestRecoveryTime(
5148 RequestBuilder<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>,
5149 );
5150
5151 impl GetLatestRecoveryTime {
5152 pub(crate) fn new(
5153 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5154 ) -> Self {
5155 Self(RequestBuilder::new(stub))
5156 }
5157
5158 pub fn with_request<V: Into<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>>(
5160 mut self,
5161 v: V,
5162 ) -> Self {
5163 self.0.request = v.into();
5164 self
5165 }
5166
5167 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5169 self.0.options = v.into();
5170 self
5171 }
5172
5173 pub async fn send(self) -> Result<crate::model::SqlInstancesGetLatestRecoveryTimeResponse> {
5175 (*self.0.stub)
5176 .get_latest_recovery_time(self.0.request, self.0.options)
5177 .await
5178 .map(crate::Response::into_body)
5179 }
5180
5181 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5183 self.0.request.instance = v.into();
5184 self
5185 }
5186
5187 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5189 self.0.request.project = v.into();
5190 self
5191 }
5192
5193 pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
5195 where
5196 T: std::convert::Into<wkt::Timestamp>,
5197 {
5198 self.0.request.source_instance_deletion_time = std::option::Option::Some(v.into());
5199 self
5200 }
5201
5202 pub fn set_or_clear_source_instance_deletion_time<T>(
5204 mut self,
5205 v: std::option::Option<T>,
5206 ) -> Self
5207 where
5208 T: std::convert::Into<wkt::Timestamp>,
5209 {
5210 self.0.request.source_instance_deletion_time = v.map(|x| x.into());
5211 self
5212 }
5213 }
5214
5215 #[doc(hidden)]
5216 impl crate::RequestBuilder for GetLatestRecoveryTime {
5217 fn request_options(&mut self) -> &mut crate::RequestOptions {
5218 &mut self.0.options
5219 }
5220 }
5221
5222 #[derive(Clone, Debug)]
5239 pub struct ExecuteSql(RequestBuilder<crate::model::SqlInstancesExecuteSqlRequest>);
5240
5241 impl ExecuteSql {
5242 pub(crate) fn new(
5243 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5244 ) -> Self {
5245 Self(RequestBuilder::new(stub))
5246 }
5247
5248 pub fn with_request<V: Into<crate::model::SqlInstancesExecuteSqlRequest>>(
5250 mut self,
5251 v: V,
5252 ) -> Self {
5253 self.0.request = v.into();
5254 self
5255 }
5256
5257 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5259 self.0.options = v.into();
5260 self
5261 }
5262
5263 pub async fn send(self) -> Result<crate::model::SqlInstancesExecuteSqlResponse> {
5265 (*self.0.stub)
5266 .execute_sql(self.0.request, self.0.options)
5267 .await
5268 .map(crate::Response::into_body)
5269 }
5270
5271 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5275 self.0.request.instance = v.into();
5276 self
5277 }
5278
5279 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5283 self.0.request.project = v.into();
5284 self
5285 }
5286
5287 pub fn set_body<T>(mut self, v: T) -> Self
5289 where
5290 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
5291 {
5292 self.0.request.body = std::option::Option::Some(v.into());
5293 self
5294 }
5295
5296 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5298 where
5299 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
5300 {
5301 self.0.request.body = v.map(|x| x.into());
5302 self
5303 }
5304 }
5305
5306 #[doc(hidden)]
5307 impl crate::RequestBuilder for ExecuteSql {
5308 fn request_options(&mut self) -> &mut crate::RequestOptions {
5309 &mut self.0.options
5310 }
5311 }
5312
5313 #[derive(Clone, Debug)]
5330 pub struct AcquireSsrsLease(RequestBuilder<crate::model::SqlInstancesAcquireSsrsLeaseRequest>);
5331
5332 impl AcquireSsrsLease {
5333 pub(crate) fn new(
5334 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5335 ) -> Self {
5336 Self(RequestBuilder::new(stub))
5337 }
5338
5339 pub fn with_request<V: Into<crate::model::SqlInstancesAcquireSsrsLeaseRequest>>(
5341 mut self,
5342 v: V,
5343 ) -> Self {
5344 self.0.request = v.into();
5345 self
5346 }
5347
5348 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5350 self.0.options = v.into();
5351 self
5352 }
5353
5354 pub async fn send(self) -> Result<crate::model::SqlInstancesAcquireSsrsLeaseResponse> {
5356 (*self.0.stub)
5357 .acquire_ssrs_lease(self.0.request, self.0.options)
5358 .await
5359 .map(crate::Response::into_body)
5360 }
5361
5362 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5366 self.0.request.instance = v.into();
5367 self
5368 }
5369
5370 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5374 self.0.request.project = v.into();
5375 self
5376 }
5377
5378 pub fn set_body<T>(mut self, v: T) -> Self
5382 where
5383 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
5384 {
5385 self.0.request.body = std::option::Option::Some(v.into());
5386 self
5387 }
5388
5389 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5393 where
5394 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
5395 {
5396 self.0.request.body = v.map(|x| x.into());
5397 self
5398 }
5399 }
5400
5401 #[doc(hidden)]
5402 impl crate::RequestBuilder for AcquireSsrsLease {
5403 fn request_options(&mut self) -> &mut crate::RequestOptions {
5404 &mut self.0.options
5405 }
5406 }
5407
5408 #[derive(Clone, Debug)]
5425 pub struct ReleaseSsrsLease(RequestBuilder<crate::model::SqlInstancesReleaseSsrsLeaseRequest>);
5426
5427 impl ReleaseSsrsLease {
5428 pub(crate) fn new(
5429 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5430 ) -> Self {
5431 Self(RequestBuilder::new(stub))
5432 }
5433
5434 pub fn with_request<V: Into<crate::model::SqlInstancesReleaseSsrsLeaseRequest>>(
5436 mut self,
5437 v: V,
5438 ) -> Self {
5439 self.0.request = v.into();
5440 self
5441 }
5442
5443 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5445 self.0.options = v.into();
5446 self
5447 }
5448
5449 pub async fn send(self) -> Result<crate::model::SqlInstancesReleaseSsrsLeaseResponse> {
5451 (*self.0.stub)
5452 .release_ssrs_lease(self.0.request, self.0.options)
5453 .await
5454 .map(crate::Response::into_body)
5455 }
5456
5457 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5461 self.0.request.instance = v.into();
5462 self
5463 }
5464
5465 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5469 self.0.request.project = v.into();
5470 self
5471 }
5472 }
5473
5474 #[doc(hidden)]
5475 impl crate::RequestBuilder for ReleaseSsrsLease {
5476 fn request_options(&mut self) -> &mut crate::RequestOptions {
5477 &mut self.0.options
5478 }
5479 }
5480
5481 #[derive(Clone, Debug)]
5498 pub struct PreCheckMajorVersionUpgrade(
5499 RequestBuilder<crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest>,
5500 );
5501
5502 impl PreCheckMajorVersionUpgrade {
5503 pub(crate) fn new(
5504 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5505 ) -> Self {
5506 Self(RequestBuilder::new(stub))
5507 }
5508
5509 pub fn with_request<
5511 V: Into<crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest>,
5512 >(
5513 mut self,
5514 v: V,
5515 ) -> Self {
5516 self.0.request = v.into();
5517 self
5518 }
5519
5520 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5522 self.0.options = v.into();
5523 self
5524 }
5525
5526 pub async fn send(self) -> Result<crate::model::Operation> {
5528 (*self.0.stub)
5529 .pre_check_major_version_upgrade(self.0.request, self.0.options)
5530 .await
5531 .map(crate::Response::into_body)
5532 }
5533
5534 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5538 self.0.request.instance = v.into();
5539 self
5540 }
5541
5542 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5546 self.0.request.project = v.into();
5547 self
5548 }
5549
5550 pub fn set_body<T>(mut self, v: T) -> Self
5554 where
5555 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
5556 {
5557 self.0.request.body = std::option::Option::Some(v.into());
5558 self
5559 }
5560
5561 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5565 where
5566 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
5567 {
5568 self.0.request.body = v.map(|x| x.into());
5569 self
5570 }
5571 }
5572
5573 #[doc(hidden)]
5574 impl crate::RequestBuilder for PreCheckMajorVersionUpgrade {
5575 fn request_options(&mut self) -> &mut crate::RequestOptions {
5576 &mut self.0.options
5577 }
5578 }
5579
5580 #[derive(Clone, Debug)]
5597 pub struct PointInTimeRestore(
5598 RequestBuilder<crate::model::SqlInstancesPointInTimeRestoreRequest>,
5599 );
5600
5601 impl PointInTimeRestore {
5602 pub(crate) fn new(
5603 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5604 ) -> Self {
5605 Self(RequestBuilder::new(stub))
5606 }
5607
5608 pub fn with_request<V: Into<crate::model::SqlInstancesPointInTimeRestoreRequest>>(
5610 mut self,
5611 v: V,
5612 ) -> Self {
5613 self.0.request = v.into();
5614 self
5615 }
5616
5617 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5619 self.0.options = v.into();
5620 self
5621 }
5622
5623 pub async fn send(self) -> Result<crate::model::Operation> {
5625 (*self.0.stub)
5626 .point_in_time_restore(self.0.request, self.0.options)
5627 .await
5628 .map(crate::Response::into_body)
5629 }
5630
5631 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5635 self.0.request.parent = v.into();
5636 self
5637 }
5638
5639 pub fn set_context<T>(mut self, v: T) -> Self
5643 where
5644 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
5645 {
5646 self.0.request.context = std::option::Option::Some(v.into());
5647 self
5648 }
5649
5650 pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
5654 where
5655 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
5656 {
5657 self.0.request.context = v.map(|x| x.into());
5658 self
5659 }
5660 }
5661
5662 #[doc(hidden)]
5663 impl crate::RequestBuilder for PointInTimeRestore {
5664 fn request_options(&mut self) -> &mut crate::RequestOptions {
5665 &mut self.0.options
5666 }
5667 }
5668}
5669
5670pub mod sql_operations_service {
5671 use crate::Result;
5672
5673 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5687
5688 pub(crate) mod client {
5689 use super::super::super::client::SqlOperationsService;
5690 pub struct Factory;
5691 impl crate::ClientFactory for Factory {
5692 type Client = SqlOperationsService;
5693 type Credentials = gaxi::options::Credentials;
5694 async fn build(
5695 self,
5696 config: gaxi::options::ClientConfig,
5697 ) -> crate::ClientBuilderResult<Self::Client> {
5698 Self::Client::new(config).await
5699 }
5700 }
5701 }
5702
5703 #[derive(Clone, Debug)]
5705 pub(crate) struct RequestBuilder<R: std::default::Default> {
5706 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5707 request: R,
5708 options: crate::RequestOptions,
5709 }
5710
5711 impl<R> RequestBuilder<R>
5712 where
5713 R: std::default::Default,
5714 {
5715 pub(crate) fn new(
5716 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5717 ) -> Self {
5718 Self {
5719 stub,
5720 request: R::default(),
5721 options: crate::RequestOptions::default(),
5722 }
5723 }
5724 }
5725
5726 #[derive(Clone, Debug)]
5743 pub struct Get(RequestBuilder<crate::model::SqlOperationsGetRequest>);
5744
5745 impl Get {
5746 pub(crate) fn new(
5747 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5748 ) -> Self {
5749 Self(RequestBuilder::new(stub))
5750 }
5751
5752 pub fn with_request<V: Into<crate::model::SqlOperationsGetRequest>>(
5754 mut self,
5755 v: V,
5756 ) -> Self {
5757 self.0.request = v.into();
5758 self
5759 }
5760
5761 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5763 self.0.options = v.into();
5764 self
5765 }
5766
5767 pub async fn send(self) -> Result<crate::model::Operation> {
5769 (*self.0.stub)
5770 .get(self.0.request, self.0.options)
5771 .await
5772 .map(crate::Response::into_body)
5773 }
5774
5775 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
5779 self.0.request.operation = v.into();
5780 self
5781 }
5782
5783 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5787 self.0.request.project = v.into();
5788 self
5789 }
5790 }
5791
5792 #[doc(hidden)]
5793 impl crate::RequestBuilder for Get {
5794 fn request_options(&mut self) -> &mut crate::RequestOptions {
5795 &mut self.0.options
5796 }
5797 }
5798
5799 #[derive(Clone, Debug)]
5820 pub struct List(RequestBuilder<crate::model::SqlOperationsListRequest>);
5821
5822 impl List {
5823 pub(crate) fn new(
5824 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5825 ) -> Self {
5826 Self(RequestBuilder::new(stub))
5827 }
5828
5829 pub fn with_request<V: Into<crate::model::SqlOperationsListRequest>>(
5831 mut self,
5832 v: V,
5833 ) -> Self {
5834 self.0.request = v.into();
5835 self
5836 }
5837
5838 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5840 self.0.options = v.into();
5841 self
5842 }
5843
5844 pub async fn send(self) -> Result<crate::model::OperationsListResponse> {
5846 (*self.0.stub)
5847 .list(self.0.request, self.0.options)
5848 .await
5849 .map(crate::Response::into_body)
5850 }
5851
5852 pub fn by_page(
5854 self,
5855 ) -> impl google_cloud_gax::paginator::Paginator<
5856 crate::model::OperationsListResponse,
5857 crate::Error,
5858 > {
5859 use std::clone::Clone;
5860 let token = self.0.request.page_token.clone();
5861 let execute = move |token: String| {
5862 let mut builder = self.clone();
5863 builder.0.request = builder.0.request.set_page_token(token);
5864 builder.send()
5865 };
5866 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5867 }
5868
5869 pub fn by_item(
5871 self,
5872 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5873 crate::model::OperationsListResponse,
5874 crate::Error,
5875 > {
5876 use google_cloud_gax::paginator::Paginator;
5877 self.by_page().items()
5878 }
5879
5880 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5882 self.0.request.instance = v.into();
5883 self
5884 }
5885
5886 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
5888 self.0.request.max_results = v.into();
5889 self
5890 }
5891
5892 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5894 self.0.request.page_token = v.into();
5895 self
5896 }
5897
5898 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5900 self.0.request.project = v.into();
5901 self
5902 }
5903 }
5904
5905 #[doc(hidden)]
5906 impl crate::RequestBuilder for List {
5907 fn request_options(&mut self) -> &mut crate::RequestOptions {
5908 &mut self.0.options
5909 }
5910 }
5911
5912 #[derive(Clone, Debug)]
5929 pub struct Cancel(RequestBuilder<crate::model::SqlOperationsCancelRequest>);
5930
5931 impl Cancel {
5932 pub(crate) fn new(
5933 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5934 ) -> Self {
5935 Self(RequestBuilder::new(stub))
5936 }
5937
5938 pub fn with_request<V: Into<crate::model::SqlOperationsCancelRequest>>(
5940 mut self,
5941 v: V,
5942 ) -> Self {
5943 self.0.request = v.into();
5944 self
5945 }
5946
5947 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5949 self.0.options = v.into();
5950 self
5951 }
5952
5953 pub async fn send(self) -> Result<()> {
5955 (*self.0.stub)
5956 .cancel(self.0.request, self.0.options)
5957 .await
5958 .map(crate::Response::into_body)
5959 }
5960
5961 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
5963 self.0.request.operation = v.into();
5964 self
5965 }
5966
5967 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5969 self.0.request.project = v.into();
5970 self
5971 }
5972 }
5973
5974 #[doc(hidden)]
5975 impl crate::RequestBuilder for Cancel {
5976 fn request_options(&mut self) -> &mut crate::RequestOptions {
5977 &mut self.0.options
5978 }
5979 }
5980}
5981
5982pub mod sql_ssl_certs_service {
5983 use crate::Result;
5984
5985 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5999
6000 pub(crate) mod client {
6001 use super::super::super::client::SqlSslCertsService;
6002 pub struct Factory;
6003 impl crate::ClientFactory for Factory {
6004 type Client = SqlSslCertsService;
6005 type Credentials = gaxi::options::Credentials;
6006 async fn build(
6007 self,
6008 config: gaxi::options::ClientConfig,
6009 ) -> crate::ClientBuilderResult<Self::Client> {
6010 Self::Client::new(config).await
6011 }
6012 }
6013 }
6014
6015 #[derive(Clone, Debug)]
6017 pub(crate) struct RequestBuilder<R: std::default::Default> {
6018 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6019 request: R,
6020 options: crate::RequestOptions,
6021 }
6022
6023 impl<R> RequestBuilder<R>
6024 where
6025 R: std::default::Default,
6026 {
6027 pub(crate) fn new(
6028 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6029 ) -> Self {
6030 Self {
6031 stub,
6032 request: R::default(),
6033 options: crate::RequestOptions::default(),
6034 }
6035 }
6036 }
6037
6038 #[derive(Clone, Debug)]
6055 pub struct Delete(RequestBuilder<crate::model::SqlSslCertsDeleteRequest>);
6056
6057 impl Delete {
6058 pub(crate) fn new(
6059 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6060 ) -> Self {
6061 Self(RequestBuilder::new(stub))
6062 }
6063
6064 pub fn with_request<V: Into<crate::model::SqlSslCertsDeleteRequest>>(
6066 mut self,
6067 v: V,
6068 ) -> Self {
6069 self.0.request = v.into();
6070 self
6071 }
6072
6073 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6075 self.0.options = v.into();
6076 self
6077 }
6078
6079 pub async fn send(self) -> Result<crate::model::Operation> {
6081 (*self.0.stub)
6082 .delete(self.0.request, self.0.options)
6083 .await
6084 .map(crate::Response::into_body)
6085 }
6086
6087 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6089 self.0.request.instance = v.into();
6090 self
6091 }
6092
6093 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6095 self.0.request.project = v.into();
6096 self
6097 }
6098
6099 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6101 self.0.request.sha1_fingerprint = v.into();
6102 self
6103 }
6104 }
6105
6106 #[doc(hidden)]
6107 impl crate::RequestBuilder for Delete {
6108 fn request_options(&mut self) -> &mut crate::RequestOptions {
6109 &mut self.0.options
6110 }
6111 }
6112
6113 #[derive(Clone, Debug)]
6130 pub struct Get(RequestBuilder<crate::model::SqlSslCertsGetRequest>);
6131
6132 impl Get {
6133 pub(crate) fn new(
6134 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6135 ) -> Self {
6136 Self(RequestBuilder::new(stub))
6137 }
6138
6139 pub fn with_request<V: Into<crate::model::SqlSslCertsGetRequest>>(mut self, v: V) -> Self {
6141 self.0.request = v.into();
6142 self
6143 }
6144
6145 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6147 self.0.options = v.into();
6148 self
6149 }
6150
6151 pub async fn send(self) -> Result<crate::model::SslCert> {
6153 (*self.0.stub)
6154 .get(self.0.request, self.0.options)
6155 .await
6156 .map(crate::Response::into_body)
6157 }
6158
6159 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6161 self.0.request.instance = v.into();
6162 self
6163 }
6164
6165 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6167 self.0.request.project = v.into();
6168 self
6169 }
6170
6171 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6173 self.0.request.sha1_fingerprint = v.into();
6174 self
6175 }
6176 }
6177
6178 #[doc(hidden)]
6179 impl crate::RequestBuilder for Get {
6180 fn request_options(&mut self) -> &mut crate::RequestOptions {
6181 &mut self.0.options
6182 }
6183 }
6184
6185 #[derive(Clone, Debug)]
6202 pub struct Insert(RequestBuilder<crate::model::SqlSslCertsInsertRequest>);
6203
6204 impl Insert {
6205 pub(crate) fn new(
6206 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6207 ) -> Self {
6208 Self(RequestBuilder::new(stub))
6209 }
6210
6211 pub fn with_request<V: Into<crate::model::SqlSslCertsInsertRequest>>(
6213 mut self,
6214 v: V,
6215 ) -> Self {
6216 self.0.request = v.into();
6217 self
6218 }
6219
6220 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6222 self.0.options = v.into();
6223 self
6224 }
6225
6226 pub async fn send(self) -> Result<crate::model::SslCertsInsertResponse> {
6228 (*self.0.stub)
6229 .insert(self.0.request, self.0.options)
6230 .await
6231 .map(crate::Response::into_body)
6232 }
6233
6234 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6236 self.0.request.instance = v.into();
6237 self
6238 }
6239
6240 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6242 self.0.request.project = v.into();
6243 self
6244 }
6245
6246 pub fn set_body<T>(mut self, v: T) -> Self
6248 where
6249 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6250 {
6251 self.0.request.body = std::option::Option::Some(v.into());
6252 self
6253 }
6254
6255 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6257 where
6258 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6259 {
6260 self.0.request.body = v.map(|x| x.into());
6261 self
6262 }
6263 }
6264
6265 #[doc(hidden)]
6266 impl crate::RequestBuilder for Insert {
6267 fn request_options(&mut self) -> &mut crate::RequestOptions {
6268 &mut self.0.options
6269 }
6270 }
6271
6272 #[derive(Clone, Debug)]
6289 pub struct List(RequestBuilder<crate::model::SqlSslCertsListRequest>);
6290
6291 impl List {
6292 pub(crate) fn new(
6293 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6294 ) -> Self {
6295 Self(RequestBuilder::new(stub))
6296 }
6297
6298 pub fn with_request<V: Into<crate::model::SqlSslCertsListRequest>>(mut self, v: V) -> Self {
6300 self.0.request = v.into();
6301 self
6302 }
6303
6304 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6306 self.0.options = v.into();
6307 self
6308 }
6309
6310 pub async fn send(self) -> Result<crate::model::SslCertsListResponse> {
6312 (*self.0.stub)
6313 .list(self.0.request, self.0.options)
6314 .await
6315 .map(crate::Response::into_body)
6316 }
6317
6318 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6320 self.0.request.instance = v.into();
6321 self
6322 }
6323
6324 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6326 self.0.request.project = v.into();
6327 self
6328 }
6329 }
6330
6331 #[doc(hidden)]
6332 impl crate::RequestBuilder for List {
6333 fn request_options(&mut self) -> &mut crate::RequestOptions {
6334 &mut self.0.options
6335 }
6336 }
6337}
6338
6339pub mod sql_tiers_service {
6340 use crate::Result;
6341
6342 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6356
6357 pub(crate) mod client {
6358 use super::super::super::client::SqlTiersService;
6359 pub struct Factory;
6360 impl crate::ClientFactory for Factory {
6361 type Client = SqlTiersService;
6362 type Credentials = gaxi::options::Credentials;
6363 async fn build(
6364 self,
6365 config: gaxi::options::ClientConfig,
6366 ) -> crate::ClientBuilderResult<Self::Client> {
6367 Self::Client::new(config).await
6368 }
6369 }
6370 }
6371
6372 #[derive(Clone, Debug)]
6374 pub(crate) struct RequestBuilder<R: std::default::Default> {
6375 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6376 request: R,
6377 options: crate::RequestOptions,
6378 }
6379
6380 impl<R> RequestBuilder<R>
6381 where
6382 R: std::default::Default,
6383 {
6384 pub(crate) fn new(
6385 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6386 ) -> Self {
6387 Self {
6388 stub,
6389 request: R::default(),
6390 options: crate::RequestOptions::default(),
6391 }
6392 }
6393 }
6394
6395 #[derive(Clone, Debug)]
6412 pub struct List(RequestBuilder<crate::model::SqlTiersListRequest>);
6413
6414 impl List {
6415 pub(crate) fn new(
6416 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6417 ) -> Self {
6418 Self(RequestBuilder::new(stub))
6419 }
6420
6421 pub fn with_request<V: Into<crate::model::SqlTiersListRequest>>(mut self, v: V) -> Self {
6423 self.0.request = v.into();
6424 self
6425 }
6426
6427 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6429 self.0.options = v.into();
6430 self
6431 }
6432
6433 pub async fn send(self) -> Result<crate::model::TiersListResponse> {
6435 (*self.0.stub)
6436 .list(self.0.request, self.0.options)
6437 .await
6438 .map(crate::Response::into_body)
6439 }
6440
6441 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6443 self.0.request.project = v.into();
6444 self
6445 }
6446 }
6447
6448 #[doc(hidden)]
6449 impl crate::RequestBuilder for List {
6450 fn request_options(&mut self) -> &mut crate::RequestOptions {
6451 &mut self.0.options
6452 }
6453 }
6454}
6455
6456pub mod sql_users_service {
6457 use crate::Result;
6458
6459 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6473
6474 pub(crate) mod client {
6475 use super::super::super::client::SqlUsersService;
6476 pub struct Factory;
6477 impl crate::ClientFactory for Factory {
6478 type Client = SqlUsersService;
6479 type Credentials = gaxi::options::Credentials;
6480 async fn build(
6481 self,
6482 config: gaxi::options::ClientConfig,
6483 ) -> crate::ClientBuilderResult<Self::Client> {
6484 Self::Client::new(config).await
6485 }
6486 }
6487 }
6488
6489 #[derive(Clone, Debug)]
6491 pub(crate) struct RequestBuilder<R: std::default::Default> {
6492 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6493 request: R,
6494 options: crate::RequestOptions,
6495 }
6496
6497 impl<R> RequestBuilder<R>
6498 where
6499 R: std::default::Default,
6500 {
6501 pub(crate) fn new(
6502 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6503 ) -> Self {
6504 Self {
6505 stub,
6506 request: R::default(),
6507 options: crate::RequestOptions::default(),
6508 }
6509 }
6510 }
6511
6512 #[derive(Clone, Debug)]
6529 pub struct Delete(RequestBuilder<crate::model::SqlUsersDeleteRequest>);
6530
6531 impl Delete {
6532 pub(crate) fn new(
6533 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6534 ) -> Self {
6535 Self(RequestBuilder::new(stub))
6536 }
6537
6538 pub fn with_request<V: Into<crate::model::SqlUsersDeleteRequest>>(mut self, v: V) -> Self {
6540 self.0.request = v.into();
6541 self
6542 }
6543
6544 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6546 self.0.options = v.into();
6547 self
6548 }
6549
6550 pub async fn send(self) -> Result<crate::model::Operation> {
6552 (*self.0.stub)
6553 .delete(self.0.request, self.0.options)
6554 .await
6555 .map(crate::Response::into_body)
6556 }
6557
6558 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6560 self.0.request.host = v.into();
6561 self
6562 }
6563
6564 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6566 self.0.request.instance = v.into();
6567 self
6568 }
6569
6570 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6572 self.0.request.name = v.into();
6573 self
6574 }
6575
6576 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6578 self.0.request.project = v.into();
6579 self
6580 }
6581 }
6582
6583 #[doc(hidden)]
6584 impl crate::RequestBuilder for Delete {
6585 fn request_options(&mut self) -> &mut crate::RequestOptions {
6586 &mut self.0.options
6587 }
6588 }
6589
6590 #[derive(Clone, Debug)]
6607 pub struct Get(RequestBuilder<crate::model::SqlUsersGetRequest>);
6608
6609 impl Get {
6610 pub(crate) fn new(
6611 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6612 ) -> Self {
6613 Self(RequestBuilder::new(stub))
6614 }
6615
6616 pub fn with_request<V: Into<crate::model::SqlUsersGetRequest>>(mut self, v: V) -> Self {
6618 self.0.request = v.into();
6619 self
6620 }
6621
6622 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6624 self.0.options = v.into();
6625 self
6626 }
6627
6628 pub async fn send(self) -> Result<crate::model::User> {
6630 (*self.0.stub)
6631 .get(self.0.request, self.0.options)
6632 .await
6633 .map(crate::Response::into_body)
6634 }
6635
6636 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6638 self.0.request.instance = v.into();
6639 self
6640 }
6641
6642 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6644 self.0.request.name = v.into();
6645 self
6646 }
6647
6648 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6650 self.0.request.project = v.into();
6651 self
6652 }
6653
6654 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6656 self.0.request.host = v.into();
6657 self
6658 }
6659 }
6660
6661 #[doc(hidden)]
6662 impl crate::RequestBuilder for Get {
6663 fn request_options(&mut self) -> &mut crate::RequestOptions {
6664 &mut self.0.options
6665 }
6666 }
6667
6668 #[derive(Clone, Debug)]
6685 pub struct Insert(RequestBuilder<crate::model::SqlUsersInsertRequest>);
6686
6687 impl Insert {
6688 pub(crate) fn new(
6689 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6690 ) -> Self {
6691 Self(RequestBuilder::new(stub))
6692 }
6693
6694 pub fn with_request<V: Into<crate::model::SqlUsersInsertRequest>>(mut self, v: V) -> Self {
6696 self.0.request = v.into();
6697 self
6698 }
6699
6700 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6702 self.0.options = v.into();
6703 self
6704 }
6705
6706 pub async fn send(self) -> Result<crate::model::Operation> {
6708 (*self.0.stub)
6709 .insert(self.0.request, self.0.options)
6710 .await
6711 .map(crate::Response::into_body)
6712 }
6713
6714 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6716 self.0.request.instance = v.into();
6717 self
6718 }
6719
6720 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6722 self.0.request.project = v.into();
6723 self
6724 }
6725
6726 pub fn set_body<T>(mut self, v: T) -> Self
6728 where
6729 T: std::convert::Into<crate::model::User>,
6730 {
6731 self.0.request.body = std::option::Option::Some(v.into());
6732 self
6733 }
6734
6735 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6737 where
6738 T: std::convert::Into<crate::model::User>,
6739 {
6740 self.0.request.body = v.map(|x| x.into());
6741 self
6742 }
6743 }
6744
6745 #[doc(hidden)]
6746 impl crate::RequestBuilder for Insert {
6747 fn request_options(&mut self) -> &mut crate::RequestOptions {
6748 &mut self.0.options
6749 }
6750 }
6751
6752 #[derive(Clone, Debug)]
6769 pub struct List(RequestBuilder<crate::model::SqlUsersListRequest>);
6770
6771 impl List {
6772 pub(crate) fn new(
6773 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6774 ) -> Self {
6775 Self(RequestBuilder::new(stub))
6776 }
6777
6778 pub fn with_request<V: Into<crate::model::SqlUsersListRequest>>(mut self, v: V) -> Self {
6780 self.0.request = v.into();
6781 self
6782 }
6783
6784 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6786 self.0.options = v.into();
6787 self
6788 }
6789
6790 pub async fn send(self) -> Result<crate::model::UsersListResponse> {
6792 (*self.0.stub)
6793 .list(self.0.request, self.0.options)
6794 .await
6795 .map(crate::Response::into_body)
6796 }
6797
6798 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6800 self.0.request.instance = v.into();
6801 self
6802 }
6803
6804 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6806 self.0.request.project = v.into();
6807 self
6808 }
6809 }
6810
6811 #[doc(hidden)]
6812 impl crate::RequestBuilder for List {
6813 fn request_options(&mut self) -> &mut crate::RequestOptions {
6814 &mut self.0.options
6815 }
6816 }
6817
6818 #[derive(Clone, Debug)]
6835 pub struct Update(RequestBuilder<crate::model::SqlUsersUpdateRequest>);
6836
6837 impl Update {
6838 pub(crate) fn new(
6839 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6840 ) -> Self {
6841 Self(RequestBuilder::new(stub))
6842 }
6843
6844 pub fn with_request<V: Into<crate::model::SqlUsersUpdateRequest>>(mut self, v: V) -> Self {
6846 self.0.request = v.into();
6847 self
6848 }
6849
6850 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6852 self.0.options = v.into();
6853 self
6854 }
6855
6856 pub async fn send(self) -> Result<crate::model::Operation> {
6858 (*self.0.stub)
6859 .update(self.0.request, self.0.options)
6860 .await
6861 .map(crate::Response::into_body)
6862 }
6863
6864 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6866 self.0.request.host = v.into();
6867 self
6868 }
6869
6870 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6872 self.0.request.instance = v.into();
6873 self
6874 }
6875
6876 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6878 self.0.request.name = v.into();
6879 self
6880 }
6881
6882 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6884 self.0.request.project = v.into();
6885 self
6886 }
6887
6888 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
6890 where
6891 T: std::iter::IntoIterator<Item = V>,
6892 V: std::convert::Into<std::string::String>,
6893 {
6894 use std::iter::Iterator;
6895 self.0.request.database_roles = v.into_iter().map(|i| i.into()).collect();
6896 self
6897 }
6898
6899 pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
6901 where
6902 T: std::convert::Into<bool>,
6903 {
6904 self.0.request.revoke_existing_roles = std::option::Option::Some(v.into());
6905 self
6906 }
6907
6908 pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
6910 where
6911 T: std::convert::Into<bool>,
6912 {
6913 self.0.request.revoke_existing_roles = v.map(|x| x.into());
6914 self
6915 }
6916
6917 pub fn set_body<T>(mut self, v: T) -> Self
6919 where
6920 T: std::convert::Into<crate::model::User>,
6921 {
6922 self.0.request.body = std::option::Option::Some(v.into());
6923 self
6924 }
6925
6926 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6928 where
6929 T: std::convert::Into<crate::model::User>,
6930 {
6931 self.0.request.body = v.map(|x| x.into());
6932 self
6933 }
6934 }
6935
6936 #[doc(hidden)]
6937 impl crate::RequestBuilder for Update {
6938 fn request_options(&mut self) -> &mut crate::RequestOptions {
6939 &mut self.0.options
6940 }
6941 }
6942}