1pub mod sql_backup_runs_service {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::SqlBackupRunsService;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = SqlBackupRunsService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
91 pub struct Delete(RequestBuilder<crate::model::SqlBackupRunsDeleteRequest>);
92
93 impl Delete {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::SqlBackupRunsDeleteRequest>>(
102 mut self,
103 v: V,
104 ) -> Self {
105 self.0.request = v.into();
106 self
107 }
108
109 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 pub async fn send(self) -> Result<crate::model::Operation> {
117 (*self.0.stub)
118 .delete(self.0.request, self.0.options)
119 .await
120 .map(gax::response::Response::into_body)
121 }
122
123 pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
125 self.0.request.id = v.into();
126 self
127 }
128
129 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
131 self.0.request.instance = v.into();
132 self
133 }
134
135 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
137 self.0.request.project = v.into();
138 self
139 }
140 }
141
142 #[doc(hidden)]
143 impl gax::options::internal::RequestBuilder for Delete {
144 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
145 &mut self.0.options
146 }
147 }
148
149 #[derive(Clone, Debug)]
166 pub struct Get(RequestBuilder<crate::model::SqlBackupRunsGetRequest>);
167
168 impl Get {
169 pub(crate) fn new(
170 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
171 ) -> Self {
172 Self(RequestBuilder::new(stub))
173 }
174
175 pub fn with_request<V: Into<crate::model::SqlBackupRunsGetRequest>>(
177 mut self,
178 v: V,
179 ) -> Self {
180 self.0.request = v.into();
181 self
182 }
183
184 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
186 self.0.options = v.into();
187 self
188 }
189
190 pub async fn send(self) -> Result<crate::model::BackupRun> {
192 (*self.0.stub)
193 .get(self.0.request, self.0.options)
194 .await
195 .map(gax::response::Response::into_body)
196 }
197
198 pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
200 self.0.request.id = v.into();
201 self
202 }
203
204 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
206 self.0.request.instance = v.into();
207 self
208 }
209
210 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
212 self.0.request.project = v.into();
213 self
214 }
215 }
216
217 #[doc(hidden)]
218 impl gax::options::internal::RequestBuilder for Get {
219 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
220 &mut self.0.options
221 }
222 }
223
224 #[derive(Clone, Debug)]
241 pub struct Insert(RequestBuilder<crate::model::SqlBackupRunsInsertRequest>);
242
243 impl Insert {
244 pub(crate) fn new(
245 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
246 ) -> Self {
247 Self(RequestBuilder::new(stub))
248 }
249
250 pub fn with_request<V: Into<crate::model::SqlBackupRunsInsertRequest>>(
252 mut self,
253 v: V,
254 ) -> Self {
255 self.0.request = v.into();
256 self
257 }
258
259 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
261 self.0.options = v.into();
262 self
263 }
264
265 pub async fn send(self) -> Result<crate::model::Operation> {
267 (*self.0.stub)
268 .insert(self.0.request, self.0.options)
269 .await
270 .map(gax::response::Response::into_body)
271 }
272
273 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
275 self.0.request.instance = v.into();
276 self
277 }
278
279 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
281 self.0.request.project = v.into();
282 self
283 }
284
285 pub fn set_body<T>(mut self, v: T) -> Self
287 where
288 T: std::convert::Into<crate::model::BackupRun>,
289 {
290 self.0.request.body = std::option::Option::Some(v.into());
291 self
292 }
293
294 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
296 where
297 T: std::convert::Into<crate::model::BackupRun>,
298 {
299 self.0.request.body = v.map(|x| x.into());
300 self
301 }
302 }
303
304 #[doc(hidden)]
305 impl gax::options::internal::RequestBuilder for Insert {
306 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
307 &mut self.0.options
308 }
309 }
310
311 #[derive(Clone, Debug)]
332 pub struct List(RequestBuilder<crate::model::SqlBackupRunsListRequest>);
333
334 impl List {
335 pub(crate) fn new(
336 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
337 ) -> Self {
338 Self(RequestBuilder::new(stub))
339 }
340
341 pub fn with_request<V: Into<crate::model::SqlBackupRunsListRequest>>(
343 mut self,
344 v: V,
345 ) -> Self {
346 self.0.request = v.into();
347 self
348 }
349
350 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
352 self.0.options = v.into();
353 self
354 }
355
356 pub async fn send(self) -> Result<crate::model::BackupRunsListResponse> {
358 (*self.0.stub)
359 .list(self.0.request, self.0.options)
360 .await
361 .map(gax::response::Response::into_body)
362 }
363
364 pub fn by_page(
366 self,
367 ) -> impl gax::paginator::Paginator<crate::model::BackupRunsListResponse, gax::error::Error>
368 {
369 use std::clone::Clone;
370 let token = self.0.request.page_token.clone();
371 let execute = move |token: String| {
372 let mut builder = self.clone();
373 builder.0.request = builder.0.request.set_page_token(token);
374 builder.send()
375 };
376 gax::paginator::internal::new_paginator(token, execute)
377 }
378
379 pub fn by_item(
381 self,
382 ) -> impl gax::paginator::ItemPaginator<crate::model::BackupRunsListResponse, gax::error::Error>
383 {
384 use gax::paginator::Paginator;
385 self.by_page().items()
386 }
387
388 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
390 self.0.request.instance = v.into();
391 self
392 }
393
394 pub fn set_max_results<T: Into<i32>>(mut self, v: T) -> Self {
396 self.0.request.max_results = v.into();
397 self
398 }
399
400 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
402 self.0.request.page_token = v.into();
403 self
404 }
405
406 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
408 self.0.request.project = v.into();
409 self
410 }
411 }
412
413 #[doc(hidden)]
414 impl gax::options::internal::RequestBuilder for List {
415 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
416 &mut self.0.options
417 }
418 }
419}
420
421pub mod sql_backups_service {
422 use crate::Result;
423
424 pub type ClientBuilder =
438 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
439
440 pub(crate) mod client {
441 use super::super::super::client::SqlBackupsService;
442 pub struct Factory;
443 impl gax::client_builder::internal::ClientFactory for Factory {
444 type Client = SqlBackupsService;
445 type Credentials = gaxi::options::Credentials;
446 async fn build(
447 self,
448 config: gaxi::options::ClientConfig,
449 ) -> gax::client_builder::Result<Self::Client> {
450 Self::Client::new(config).await
451 }
452 }
453 }
454
455 #[derive(Clone, Debug)]
457 pub(crate) struct RequestBuilder<R: std::default::Default> {
458 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
459 request: R,
460 options: gax::options::RequestOptions,
461 }
462
463 impl<R> RequestBuilder<R>
464 where
465 R: std::default::Default,
466 {
467 pub(crate) fn new(
468 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
469 ) -> Self {
470 Self {
471 stub,
472 request: R::default(),
473 options: gax::options::RequestOptions::default(),
474 }
475 }
476 }
477
478 #[derive(Clone, Debug)]
495 pub struct CreateBackup(RequestBuilder<crate::model::CreateBackupRequest>);
496
497 impl CreateBackup {
498 pub(crate) fn new(
499 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
500 ) -> Self {
501 Self(RequestBuilder::new(stub))
502 }
503
504 pub fn with_request<V: Into<crate::model::CreateBackupRequest>>(mut self, v: V) -> Self {
506 self.0.request = v.into();
507 self
508 }
509
510 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
512 self.0.options = v.into();
513 self
514 }
515
516 pub async fn send(self) -> Result<crate::model::Operation> {
518 (*self.0.stub)
519 .create_backup(self.0.request, self.0.options)
520 .await
521 .map(gax::response::Response::into_body)
522 }
523
524 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
528 self.0.request.parent = v.into();
529 self
530 }
531
532 pub fn set_backup<T>(mut self, v: T) -> Self
536 where
537 T: std::convert::Into<crate::model::Backup>,
538 {
539 self.0.request.backup = std::option::Option::Some(v.into());
540 self
541 }
542
543 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
547 where
548 T: std::convert::Into<crate::model::Backup>,
549 {
550 self.0.request.backup = v.map(|x| x.into());
551 self
552 }
553 }
554
555 #[doc(hidden)]
556 impl gax::options::internal::RequestBuilder for CreateBackup {
557 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
558 &mut self.0.options
559 }
560 }
561
562 #[derive(Clone, Debug)]
579 pub struct GetBackup(RequestBuilder<crate::model::GetBackupRequest>);
580
581 impl GetBackup {
582 pub(crate) fn new(
583 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
584 ) -> Self {
585 Self(RequestBuilder::new(stub))
586 }
587
588 pub fn with_request<V: Into<crate::model::GetBackupRequest>>(mut self, v: V) -> Self {
590 self.0.request = v.into();
591 self
592 }
593
594 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
596 self.0.options = v.into();
597 self
598 }
599
600 pub async fn send(self) -> Result<crate::model::Backup> {
602 (*self.0.stub)
603 .get_backup(self.0.request, self.0.options)
604 .await
605 .map(gax::response::Response::into_body)
606 }
607
608 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
612 self.0.request.name = v.into();
613 self
614 }
615 }
616
617 #[doc(hidden)]
618 impl gax::options::internal::RequestBuilder for GetBackup {
619 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
620 &mut self.0.options
621 }
622 }
623
624 #[derive(Clone, Debug)]
645 pub struct ListBackups(RequestBuilder<crate::model::ListBackupsRequest>);
646
647 impl ListBackups {
648 pub(crate) fn new(
649 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
650 ) -> Self {
651 Self(RequestBuilder::new(stub))
652 }
653
654 pub fn with_request<V: Into<crate::model::ListBackupsRequest>>(mut self, v: V) -> Self {
656 self.0.request = v.into();
657 self
658 }
659
660 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
662 self.0.options = v.into();
663 self
664 }
665
666 pub async fn send(self) -> Result<crate::model::ListBackupsResponse> {
668 (*self.0.stub)
669 .list_backups(self.0.request, self.0.options)
670 .await
671 .map(gax::response::Response::into_body)
672 }
673
674 pub fn by_page(
676 self,
677 ) -> impl gax::paginator::Paginator<crate::model::ListBackupsResponse, gax::error::Error>
678 {
679 use std::clone::Clone;
680 let token = self.0.request.page_token.clone();
681 let execute = move |token: String| {
682 let mut builder = self.clone();
683 builder.0.request = builder.0.request.set_page_token(token);
684 builder.send()
685 };
686 gax::paginator::internal::new_paginator(token, execute)
687 }
688
689 pub fn by_item(
691 self,
692 ) -> impl gax::paginator::ItemPaginator<crate::model::ListBackupsResponse, gax::error::Error>
693 {
694 use gax::paginator::Paginator;
695 self.by_page().items()
696 }
697
698 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
702 self.0.request.parent = v.into();
703 self
704 }
705
706 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
708 self.0.request.page_size = v.into();
709 self
710 }
711
712 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
714 self.0.request.page_token = v.into();
715 self
716 }
717
718 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
720 self.0.request.filter = v.into();
721 self
722 }
723 }
724
725 #[doc(hidden)]
726 impl gax::options::internal::RequestBuilder for ListBackups {
727 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
728 &mut self.0.options
729 }
730 }
731
732 #[derive(Clone, Debug)]
749 pub struct UpdateBackup(RequestBuilder<crate::model::UpdateBackupRequest>);
750
751 impl UpdateBackup {
752 pub(crate) fn new(
753 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
754 ) -> Self {
755 Self(RequestBuilder::new(stub))
756 }
757
758 pub fn with_request<V: Into<crate::model::UpdateBackupRequest>>(mut self, v: V) -> Self {
760 self.0.request = v.into();
761 self
762 }
763
764 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
766 self.0.options = v.into();
767 self
768 }
769
770 pub async fn send(self) -> Result<crate::model::Operation> {
772 (*self.0.stub)
773 .update_backup(self.0.request, self.0.options)
774 .await
775 .map(gax::response::Response::into_body)
776 }
777
778 pub fn set_backup<T>(mut self, v: T) -> Self
782 where
783 T: std::convert::Into<crate::model::Backup>,
784 {
785 self.0.request.backup = std::option::Option::Some(v.into());
786 self
787 }
788
789 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
793 where
794 T: std::convert::Into<crate::model::Backup>,
795 {
796 self.0.request.backup = v.map(|x| x.into());
797 self
798 }
799
800 pub fn set_update_mask<T>(mut self, v: T) -> Self
802 where
803 T: std::convert::Into<wkt::FieldMask>,
804 {
805 self.0.request.update_mask = std::option::Option::Some(v.into());
806 self
807 }
808
809 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
811 where
812 T: std::convert::Into<wkt::FieldMask>,
813 {
814 self.0.request.update_mask = v.map(|x| x.into());
815 self
816 }
817 }
818
819 #[doc(hidden)]
820 impl gax::options::internal::RequestBuilder for UpdateBackup {
821 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
822 &mut self.0.options
823 }
824 }
825
826 #[derive(Clone, Debug)]
843 pub struct DeleteBackup(RequestBuilder<crate::model::DeleteBackupRequest>);
844
845 impl DeleteBackup {
846 pub(crate) fn new(
847 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
848 ) -> Self {
849 Self(RequestBuilder::new(stub))
850 }
851
852 pub fn with_request<V: Into<crate::model::DeleteBackupRequest>>(mut self, v: V) -> Self {
854 self.0.request = v.into();
855 self
856 }
857
858 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
860 self.0.options = v.into();
861 self
862 }
863
864 pub async fn send(self) -> Result<crate::model::Operation> {
866 (*self.0.stub)
867 .delete_backup(self.0.request, self.0.options)
868 .await
869 .map(gax::response::Response::into_body)
870 }
871
872 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
876 self.0.request.name = v.into();
877 self
878 }
879 }
880
881 #[doc(hidden)]
882 impl gax::options::internal::RequestBuilder for DeleteBackup {
883 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
884 &mut self.0.options
885 }
886 }
887}
888
889pub mod sql_connect_service {
890 use crate::Result;
891
892 pub type ClientBuilder =
906 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
907
908 pub(crate) mod client {
909 use super::super::super::client::SqlConnectService;
910 pub struct Factory;
911 impl gax::client_builder::internal::ClientFactory for Factory {
912 type Client = SqlConnectService;
913 type Credentials = gaxi::options::Credentials;
914 async fn build(
915 self,
916 config: gaxi::options::ClientConfig,
917 ) -> gax::client_builder::Result<Self::Client> {
918 Self::Client::new(config).await
919 }
920 }
921 }
922
923 #[derive(Clone, Debug)]
925 pub(crate) struct RequestBuilder<R: std::default::Default> {
926 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
927 request: R,
928 options: gax::options::RequestOptions,
929 }
930
931 impl<R> RequestBuilder<R>
932 where
933 R: std::default::Default,
934 {
935 pub(crate) fn new(
936 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
937 ) -> Self {
938 Self {
939 stub,
940 request: R::default(),
941 options: gax::options::RequestOptions::default(),
942 }
943 }
944 }
945
946 #[derive(Clone, Debug)]
963 pub struct GetConnectSettings(RequestBuilder<crate::model::GetConnectSettingsRequest>);
964
965 impl GetConnectSettings {
966 pub(crate) fn new(
967 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
968 ) -> Self {
969 Self(RequestBuilder::new(stub))
970 }
971
972 pub fn with_request<V: Into<crate::model::GetConnectSettingsRequest>>(
974 mut self,
975 v: V,
976 ) -> Self {
977 self.0.request = v.into();
978 self
979 }
980
981 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
983 self.0.options = v.into();
984 self
985 }
986
987 pub async fn send(self) -> Result<crate::model::ConnectSettings> {
989 (*self.0.stub)
990 .get_connect_settings(self.0.request, self.0.options)
991 .await
992 .map(gax::response::Response::into_body)
993 }
994
995 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
997 self.0.request.instance = v.into();
998 self
999 }
1000
1001 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1003 self.0.request.project = v.into();
1004 self
1005 }
1006
1007 pub fn set_read_time<T>(mut self, v: T) -> Self
1009 where
1010 T: std::convert::Into<wkt::Timestamp>,
1011 {
1012 self.0.request.read_time = std::option::Option::Some(v.into());
1013 self
1014 }
1015
1016 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1018 where
1019 T: std::convert::Into<wkt::Timestamp>,
1020 {
1021 self.0.request.read_time = v.map(|x| x.into());
1022 self
1023 }
1024 }
1025
1026 #[doc(hidden)]
1027 impl gax::options::internal::RequestBuilder for GetConnectSettings {
1028 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1029 &mut self.0.options
1030 }
1031 }
1032
1033 #[derive(Clone, Debug)]
1050 pub struct GenerateEphemeralCert(RequestBuilder<crate::model::GenerateEphemeralCertRequest>);
1051
1052 impl GenerateEphemeralCert {
1053 pub(crate) fn new(
1054 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
1055 ) -> Self {
1056 Self(RequestBuilder::new(stub))
1057 }
1058
1059 pub fn with_request<V: Into<crate::model::GenerateEphemeralCertRequest>>(
1061 mut self,
1062 v: V,
1063 ) -> Self {
1064 self.0.request = v.into();
1065 self
1066 }
1067
1068 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1070 self.0.options = v.into();
1071 self
1072 }
1073
1074 pub async fn send(self) -> Result<crate::model::GenerateEphemeralCertResponse> {
1076 (*self.0.stub)
1077 .generate_ephemeral_cert(self.0.request, self.0.options)
1078 .await
1079 .map(gax::response::Response::into_body)
1080 }
1081
1082 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1084 self.0.request.instance = v.into();
1085 self
1086 }
1087
1088 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1090 self.0.request.project = v.into();
1091 self
1092 }
1093
1094 pub fn set_public_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1096 self.0.request.public_key = v.into();
1097 self
1098 }
1099
1100 pub fn set_access_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1102 self.0.request.access_token = v.into();
1103 self
1104 }
1105
1106 pub fn set_read_time<T>(mut self, v: T) -> Self
1108 where
1109 T: std::convert::Into<wkt::Timestamp>,
1110 {
1111 self.0.request.read_time = std::option::Option::Some(v.into());
1112 self
1113 }
1114
1115 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1117 where
1118 T: std::convert::Into<wkt::Timestamp>,
1119 {
1120 self.0.request.read_time = v.map(|x| x.into());
1121 self
1122 }
1123
1124 pub fn set_valid_duration<T>(mut self, v: T) -> Self
1126 where
1127 T: std::convert::Into<wkt::Duration>,
1128 {
1129 self.0.request.valid_duration = std::option::Option::Some(v.into());
1130 self
1131 }
1132
1133 pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
1135 where
1136 T: std::convert::Into<wkt::Duration>,
1137 {
1138 self.0.request.valid_duration = v.map(|x| x.into());
1139 self
1140 }
1141 }
1142
1143 #[doc(hidden)]
1144 impl gax::options::internal::RequestBuilder for GenerateEphemeralCert {
1145 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1146 &mut self.0.options
1147 }
1148 }
1149}
1150
1151pub mod sql_databases_service {
1152 use crate::Result;
1153
1154 pub type ClientBuilder =
1168 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1169
1170 pub(crate) mod client {
1171 use super::super::super::client::SqlDatabasesService;
1172 pub struct Factory;
1173 impl gax::client_builder::internal::ClientFactory for Factory {
1174 type Client = SqlDatabasesService;
1175 type Credentials = gaxi::options::Credentials;
1176 async fn build(
1177 self,
1178 config: gaxi::options::ClientConfig,
1179 ) -> gax::client_builder::Result<Self::Client> {
1180 Self::Client::new(config).await
1181 }
1182 }
1183 }
1184
1185 #[derive(Clone, Debug)]
1187 pub(crate) struct RequestBuilder<R: std::default::Default> {
1188 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1189 request: R,
1190 options: gax::options::RequestOptions,
1191 }
1192
1193 impl<R> RequestBuilder<R>
1194 where
1195 R: std::default::Default,
1196 {
1197 pub(crate) fn new(
1198 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1199 ) -> Self {
1200 Self {
1201 stub,
1202 request: R::default(),
1203 options: gax::options::RequestOptions::default(),
1204 }
1205 }
1206 }
1207
1208 #[derive(Clone, Debug)]
1225 pub struct Delete(RequestBuilder<crate::model::SqlDatabasesDeleteRequest>);
1226
1227 impl Delete {
1228 pub(crate) fn new(
1229 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1230 ) -> Self {
1231 Self(RequestBuilder::new(stub))
1232 }
1233
1234 pub fn with_request<V: Into<crate::model::SqlDatabasesDeleteRequest>>(
1236 mut self,
1237 v: V,
1238 ) -> Self {
1239 self.0.request = v.into();
1240 self
1241 }
1242
1243 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1245 self.0.options = v.into();
1246 self
1247 }
1248
1249 pub async fn send(self) -> Result<crate::model::Operation> {
1251 (*self.0.stub)
1252 .delete(self.0.request, self.0.options)
1253 .await
1254 .map(gax::response::Response::into_body)
1255 }
1256
1257 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1259 self.0.request.database = v.into();
1260 self
1261 }
1262
1263 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1265 self.0.request.instance = v.into();
1266 self
1267 }
1268
1269 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1271 self.0.request.project = v.into();
1272 self
1273 }
1274 }
1275
1276 #[doc(hidden)]
1277 impl gax::options::internal::RequestBuilder for Delete {
1278 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1279 &mut self.0.options
1280 }
1281 }
1282
1283 #[derive(Clone, Debug)]
1300 pub struct Get(RequestBuilder<crate::model::SqlDatabasesGetRequest>);
1301
1302 impl Get {
1303 pub(crate) fn new(
1304 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1305 ) -> Self {
1306 Self(RequestBuilder::new(stub))
1307 }
1308
1309 pub fn with_request<V: Into<crate::model::SqlDatabasesGetRequest>>(mut self, v: V) -> Self {
1311 self.0.request = v.into();
1312 self
1313 }
1314
1315 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1317 self.0.options = v.into();
1318 self
1319 }
1320
1321 pub async fn send(self) -> Result<crate::model::Database> {
1323 (*self.0.stub)
1324 .get(self.0.request, self.0.options)
1325 .await
1326 .map(gax::response::Response::into_body)
1327 }
1328
1329 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1331 self.0.request.database = v.into();
1332 self
1333 }
1334
1335 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1337 self.0.request.instance = v.into();
1338 self
1339 }
1340
1341 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1343 self.0.request.project = v.into();
1344 self
1345 }
1346 }
1347
1348 #[doc(hidden)]
1349 impl gax::options::internal::RequestBuilder for Get {
1350 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1351 &mut self.0.options
1352 }
1353 }
1354
1355 #[derive(Clone, Debug)]
1372 pub struct Insert(RequestBuilder<crate::model::SqlDatabasesInsertRequest>);
1373
1374 impl Insert {
1375 pub(crate) fn new(
1376 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1377 ) -> Self {
1378 Self(RequestBuilder::new(stub))
1379 }
1380
1381 pub fn with_request<V: Into<crate::model::SqlDatabasesInsertRequest>>(
1383 mut self,
1384 v: V,
1385 ) -> Self {
1386 self.0.request = v.into();
1387 self
1388 }
1389
1390 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1392 self.0.options = v.into();
1393 self
1394 }
1395
1396 pub async fn send(self) -> Result<crate::model::Operation> {
1398 (*self.0.stub)
1399 .insert(self.0.request, self.0.options)
1400 .await
1401 .map(gax::response::Response::into_body)
1402 }
1403
1404 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1406 self.0.request.instance = v.into();
1407 self
1408 }
1409
1410 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1412 self.0.request.project = v.into();
1413 self
1414 }
1415
1416 pub fn set_body<T>(mut self, v: T) -> Self
1418 where
1419 T: std::convert::Into<crate::model::Database>,
1420 {
1421 self.0.request.body = std::option::Option::Some(v.into());
1422 self
1423 }
1424
1425 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1427 where
1428 T: std::convert::Into<crate::model::Database>,
1429 {
1430 self.0.request.body = v.map(|x| x.into());
1431 self
1432 }
1433 }
1434
1435 #[doc(hidden)]
1436 impl gax::options::internal::RequestBuilder for Insert {
1437 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1438 &mut self.0.options
1439 }
1440 }
1441
1442 #[derive(Clone, Debug)]
1459 pub struct List(RequestBuilder<crate::model::SqlDatabasesListRequest>);
1460
1461 impl List {
1462 pub(crate) fn new(
1463 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1464 ) -> Self {
1465 Self(RequestBuilder::new(stub))
1466 }
1467
1468 pub fn with_request<V: Into<crate::model::SqlDatabasesListRequest>>(
1470 mut self,
1471 v: V,
1472 ) -> Self {
1473 self.0.request = v.into();
1474 self
1475 }
1476
1477 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1479 self.0.options = v.into();
1480 self
1481 }
1482
1483 pub async fn send(self) -> Result<crate::model::DatabasesListResponse> {
1485 (*self.0.stub)
1486 .list(self.0.request, self.0.options)
1487 .await
1488 .map(gax::response::Response::into_body)
1489 }
1490
1491 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1493 self.0.request.instance = v.into();
1494 self
1495 }
1496
1497 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1499 self.0.request.project = v.into();
1500 self
1501 }
1502 }
1503
1504 #[doc(hidden)]
1505 impl gax::options::internal::RequestBuilder for List {
1506 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1507 &mut self.0.options
1508 }
1509 }
1510
1511 #[derive(Clone, Debug)]
1528 pub struct Patch(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1529
1530 impl Patch {
1531 pub(crate) fn new(
1532 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1533 ) -> Self {
1534 Self(RequestBuilder::new(stub))
1535 }
1536
1537 pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1539 mut self,
1540 v: V,
1541 ) -> Self {
1542 self.0.request = v.into();
1543 self
1544 }
1545
1546 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1548 self.0.options = v.into();
1549 self
1550 }
1551
1552 pub async fn send(self) -> Result<crate::model::Operation> {
1554 (*self.0.stub)
1555 .patch(self.0.request, self.0.options)
1556 .await
1557 .map(gax::response::Response::into_body)
1558 }
1559
1560 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1562 self.0.request.database = v.into();
1563 self
1564 }
1565
1566 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1568 self.0.request.instance = v.into();
1569 self
1570 }
1571
1572 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1574 self.0.request.project = v.into();
1575 self
1576 }
1577
1578 pub fn set_body<T>(mut self, v: T) -> Self
1580 where
1581 T: std::convert::Into<crate::model::Database>,
1582 {
1583 self.0.request.body = std::option::Option::Some(v.into());
1584 self
1585 }
1586
1587 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1589 where
1590 T: std::convert::Into<crate::model::Database>,
1591 {
1592 self.0.request.body = v.map(|x| x.into());
1593 self
1594 }
1595 }
1596
1597 #[doc(hidden)]
1598 impl gax::options::internal::RequestBuilder for Patch {
1599 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1600 &mut self.0.options
1601 }
1602 }
1603
1604 #[derive(Clone, Debug)]
1621 pub struct Update(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1622
1623 impl Update {
1624 pub(crate) fn new(
1625 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1626 ) -> Self {
1627 Self(RequestBuilder::new(stub))
1628 }
1629
1630 pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1632 mut self,
1633 v: V,
1634 ) -> Self {
1635 self.0.request = v.into();
1636 self
1637 }
1638
1639 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1641 self.0.options = v.into();
1642 self
1643 }
1644
1645 pub async fn send(self) -> Result<crate::model::Operation> {
1647 (*self.0.stub)
1648 .update(self.0.request, self.0.options)
1649 .await
1650 .map(gax::response::Response::into_body)
1651 }
1652
1653 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1655 self.0.request.database = v.into();
1656 self
1657 }
1658
1659 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1661 self.0.request.instance = v.into();
1662 self
1663 }
1664
1665 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1667 self.0.request.project = v.into();
1668 self
1669 }
1670
1671 pub fn set_body<T>(mut self, v: T) -> Self
1673 where
1674 T: std::convert::Into<crate::model::Database>,
1675 {
1676 self.0.request.body = std::option::Option::Some(v.into());
1677 self
1678 }
1679
1680 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1682 where
1683 T: std::convert::Into<crate::model::Database>,
1684 {
1685 self.0.request.body = v.map(|x| x.into());
1686 self
1687 }
1688 }
1689
1690 #[doc(hidden)]
1691 impl gax::options::internal::RequestBuilder for Update {
1692 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1693 &mut self.0.options
1694 }
1695 }
1696}
1697
1698pub mod sql_flags_service {
1699 use crate::Result;
1700
1701 pub type ClientBuilder =
1715 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1716
1717 pub(crate) mod client {
1718 use super::super::super::client::SqlFlagsService;
1719 pub struct Factory;
1720 impl gax::client_builder::internal::ClientFactory for Factory {
1721 type Client = SqlFlagsService;
1722 type Credentials = gaxi::options::Credentials;
1723 async fn build(
1724 self,
1725 config: gaxi::options::ClientConfig,
1726 ) -> gax::client_builder::Result<Self::Client> {
1727 Self::Client::new(config).await
1728 }
1729 }
1730 }
1731
1732 #[derive(Clone, Debug)]
1734 pub(crate) struct RequestBuilder<R: std::default::Default> {
1735 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1736 request: R,
1737 options: gax::options::RequestOptions,
1738 }
1739
1740 impl<R> RequestBuilder<R>
1741 where
1742 R: std::default::Default,
1743 {
1744 pub(crate) fn new(
1745 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1746 ) -> Self {
1747 Self {
1748 stub,
1749 request: R::default(),
1750 options: gax::options::RequestOptions::default(),
1751 }
1752 }
1753 }
1754
1755 #[derive(Clone, Debug)]
1772 pub struct List(RequestBuilder<crate::model::SqlFlagsListRequest>);
1773
1774 impl List {
1775 pub(crate) fn new(
1776 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1777 ) -> Self {
1778 Self(RequestBuilder::new(stub))
1779 }
1780
1781 pub fn with_request<V: Into<crate::model::SqlFlagsListRequest>>(mut self, v: V) -> Self {
1783 self.0.request = v.into();
1784 self
1785 }
1786
1787 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1789 self.0.options = v.into();
1790 self
1791 }
1792
1793 pub async fn send(self) -> Result<crate::model::FlagsListResponse> {
1795 (*self.0.stub)
1796 .list(self.0.request, self.0.options)
1797 .await
1798 .map(gax::response::Response::into_body)
1799 }
1800
1801 pub fn set_database_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
1803 self.0.request.database_version = v.into();
1804 self
1805 }
1806
1807 pub fn set_flag_scope<T>(mut self, v: T) -> Self
1809 where
1810 T: std::convert::Into<crate::model::SqlFlagScope>,
1811 {
1812 self.0.request.flag_scope = std::option::Option::Some(v.into());
1813 self
1814 }
1815
1816 pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
1818 where
1819 T: std::convert::Into<crate::model::SqlFlagScope>,
1820 {
1821 self.0.request.flag_scope = v.map(|x| x.into());
1822 self
1823 }
1824 }
1825
1826 #[doc(hidden)]
1827 impl gax::options::internal::RequestBuilder for List {
1828 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1829 &mut self.0.options
1830 }
1831 }
1832}
1833
1834pub mod sql_instances_service {
1835 use crate::Result;
1836
1837 pub type ClientBuilder =
1851 gax::client_builder::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 gax::client_builder::internal::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 ) -> gax::client_builder::Result<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: gax::options::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: gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for AddServerCa {
1955 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for AddServerCertificate {
2026 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for AddEntraIdCertificate {
2101 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for Clone {
2196 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for Delete {
2328 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for DemoteMaster {
2415 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for Demote {
2510 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for Export {
2597 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for Failover {
2684 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for Reencrypt {
2771 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for Get {
2841 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for Import {
2928 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for Insert {
3009 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::Response::into_body)
3065 }
3066
3067 pub fn by_page(
3069 self,
3070 ) -> impl gax::paginator::Paginator<crate::model::InstancesListResponse, gax::error::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 gax::paginator::internal::new_paginator(token, execute)
3080 }
3081
3082 pub fn by_item(
3084 self,
3085 ) -> impl gax::paginator::ItemPaginator<crate::model::InstancesListResponse, gax::error::Error>
3086 {
3087 use gax::paginator::Paginator;
3088 self.by_page().items()
3089 }
3090
3091 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3093 self.0.request.filter = v.into();
3094 self
3095 }
3096
3097 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
3099 self.0.request.max_results = v.into();
3100 self
3101 }
3102
3103 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3105 self.0.request.page_token = v.into();
3106 self
3107 }
3108
3109 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3111 self.0.request.project = v.into();
3112 self
3113 }
3114 }
3115
3116 #[doc(hidden)]
3117 impl gax::options::internal::RequestBuilder for List {
3118 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3119 &mut self.0.options
3120 }
3121 }
3122
3123 #[derive(Clone, Debug)]
3140 pub struct ListServerCas(RequestBuilder<crate::model::SqlInstancesListServerCasRequest>);
3141
3142 impl ListServerCas {
3143 pub(crate) fn new(
3144 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3145 ) -> Self {
3146 Self(RequestBuilder::new(stub))
3147 }
3148
3149 pub fn with_request<V: Into<crate::model::SqlInstancesListServerCasRequest>>(
3151 mut self,
3152 v: V,
3153 ) -> Self {
3154 self.0.request = v.into();
3155 self
3156 }
3157
3158 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3160 self.0.options = v.into();
3161 self
3162 }
3163
3164 pub async fn send(self) -> Result<crate::model::InstancesListServerCasResponse> {
3166 (*self.0.stub)
3167 .list_server_cas(self.0.request, self.0.options)
3168 .await
3169 .map(gax::response::Response::into_body)
3170 }
3171
3172 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3174 self.0.request.instance = v.into();
3175 self
3176 }
3177
3178 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3180 self.0.request.project = v.into();
3181 self
3182 }
3183 }
3184
3185 #[doc(hidden)]
3186 impl gax::options::internal::RequestBuilder for ListServerCas {
3187 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3188 &mut self.0.options
3189 }
3190 }
3191
3192 #[derive(Clone, Debug)]
3209 pub struct ListServerCertificates(
3210 RequestBuilder<crate::model::SqlInstancesListServerCertificatesRequest>,
3211 );
3212
3213 impl ListServerCertificates {
3214 pub(crate) fn new(
3215 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3216 ) -> Self {
3217 Self(RequestBuilder::new(stub))
3218 }
3219
3220 pub fn with_request<V: Into<crate::model::SqlInstancesListServerCertificatesRequest>>(
3222 mut self,
3223 v: V,
3224 ) -> Self {
3225 self.0.request = v.into();
3226 self
3227 }
3228
3229 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3231 self.0.options = v.into();
3232 self
3233 }
3234
3235 pub async fn send(self) -> Result<crate::model::InstancesListServerCertificatesResponse> {
3237 (*self.0.stub)
3238 .list_server_certificates(self.0.request, self.0.options)
3239 .await
3240 .map(gax::response::Response::into_body)
3241 }
3242
3243 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3247 self.0.request.instance = v.into();
3248 self
3249 }
3250
3251 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3255 self.0.request.project = v.into();
3256 self
3257 }
3258 }
3259
3260 #[doc(hidden)]
3261 impl gax::options::internal::RequestBuilder for ListServerCertificates {
3262 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3263 &mut self.0.options
3264 }
3265 }
3266
3267 #[derive(Clone, Debug)]
3284 pub struct ListEntraIdCertificates(
3285 RequestBuilder<crate::model::SqlInstancesListEntraIdCertificatesRequest>,
3286 );
3287
3288 impl ListEntraIdCertificates {
3289 pub(crate) fn new(
3290 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3291 ) -> Self {
3292 Self(RequestBuilder::new(stub))
3293 }
3294
3295 pub fn with_request<V: Into<crate::model::SqlInstancesListEntraIdCertificatesRequest>>(
3297 mut self,
3298 v: V,
3299 ) -> Self {
3300 self.0.request = v.into();
3301 self
3302 }
3303
3304 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3306 self.0.options = v.into();
3307 self
3308 }
3309
3310 pub async fn send(self) -> Result<crate::model::InstancesListEntraIdCertificatesResponse> {
3312 (*self.0.stub)
3313 .list_entra_id_certificates(self.0.request, self.0.options)
3314 .await
3315 .map(gax::response::Response::into_body)
3316 }
3317
3318 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3322 self.0.request.instance = v.into();
3323 self
3324 }
3325
3326 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3330 self.0.request.project = v.into();
3331 self
3332 }
3333 }
3334
3335 #[doc(hidden)]
3336 impl gax::options::internal::RequestBuilder for ListEntraIdCertificates {
3337 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3338 &mut self.0.options
3339 }
3340 }
3341
3342 #[derive(Clone, Debug)]
3359 pub struct Patch(RequestBuilder<crate::model::SqlInstancesPatchRequest>);
3360
3361 impl Patch {
3362 pub(crate) fn new(
3363 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3364 ) -> Self {
3365 Self(RequestBuilder::new(stub))
3366 }
3367
3368 pub fn with_request<V: Into<crate::model::SqlInstancesPatchRequest>>(
3370 mut self,
3371 v: V,
3372 ) -> Self {
3373 self.0.request = v.into();
3374 self
3375 }
3376
3377 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3379 self.0.options = v.into();
3380 self
3381 }
3382
3383 pub async fn send(self) -> Result<crate::model::Operation> {
3385 (*self.0.stub)
3386 .patch(self.0.request, self.0.options)
3387 .await
3388 .map(gax::response::Response::into_body)
3389 }
3390
3391 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3393 self.0.request.instance = v.into();
3394 self
3395 }
3396
3397 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3399 self.0.request.project = v.into();
3400 self
3401 }
3402
3403 pub fn set_body<T>(mut self, v: T) -> Self
3405 where
3406 T: std::convert::Into<crate::model::DatabaseInstance>,
3407 {
3408 self.0.request.body = std::option::Option::Some(v.into());
3409 self
3410 }
3411
3412 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3414 where
3415 T: std::convert::Into<crate::model::DatabaseInstance>,
3416 {
3417 self.0.request.body = v.map(|x| x.into());
3418 self
3419 }
3420 }
3421
3422 #[doc(hidden)]
3423 impl gax::options::internal::RequestBuilder for Patch {
3424 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3425 &mut self.0.options
3426 }
3427 }
3428
3429 #[derive(Clone, Debug)]
3446 pub struct PromoteReplica(RequestBuilder<crate::model::SqlInstancesPromoteReplicaRequest>);
3447
3448 impl PromoteReplica {
3449 pub(crate) fn new(
3450 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3451 ) -> Self {
3452 Self(RequestBuilder::new(stub))
3453 }
3454
3455 pub fn with_request<V: Into<crate::model::SqlInstancesPromoteReplicaRequest>>(
3457 mut self,
3458 v: V,
3459 ) -> Self {
3460 self.0.request = v.into();
3461 self
3462 }
3463
3464 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3466 self.0.options = v.into();
3467 self
3468 }
3469
3470 pub async fn send(self) -> Result<crate::model::Operation> {
3472 (*self.0.stub)
3473 .promote_replica(self.0.request, self.0.options)
3474 .await
3475 .map(gax::response::Response::into_body)
3476 }
3477
3478 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3480 self.0.request.instance = v.into();
3481 self
3482 }
3483
3484 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3486 self.0.request.project = v.into();
3487 self
3488 }
3489
3490 pub fn set_failover<T: Into<bool>>(mut self, v: T) -> Self {
3492 self.0.request.failover = v.into();
3493 self
3494 }
3495 }
3496
3497 #[doc(hidden)]
3498 impl gax::options::internal::RequestBuilder for PromoteReplica {
3499 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3500 &mut self.0.options
3501 }
3502 }
3503
3504 #[derive(Clone, Debug)]
3521 pub struct Switchover(RequestBuilder<crate::model::SqlInstancesSwitchoverRequest>);
3522
3523 impl Switchover {
3524 pub(crate) fn new(
3525 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3526 ) -> Self {
3527 Self(RequestBuilder::new(stub))
3528 }
3529
3530 pub fn with_request<V: Into<crate::model::SqlInstancesSwitchoverRequest>>(
3532 mut self,
3533 v: V,
3534 ) -> Self {
3535 self.0.request = v.into();
3536 self
3537 }
3538
3539 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3541 self.0.options = v.into();
3542 self
3543 }
3544
3545 pub async fn send(self) -> Result<crate::model::Operation> {
3547 (*self.0.stub)
3548 .switchover(self.0.request, self.0.options)
3549 .await
3550 .map(gax::response::Response::into_body)
3551 }
3552
3553 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3555 self.0.request.instance = v.into();
3556 self
3557 }
3558
3559 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3561 self.0.request.project = v.into();
3562 self
3563 }
3564
3565 pub fn set_db_timeout<T>(mut self, v: T) -> Self
3567 where
3568 T: std::convert::Into<wkt::Duration>,
3569 {
3570 self.0.request.db_timeout = std::option::Option::Some(v.into());
3571 self
3572 }
3573
3574 pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
3576 where
3577 T: std::convert::Into<wkt::Duration>,
3578 {
3579 self.0.request.db_timeout = v.map(|x| x.into());
3580 self
3581 }
3582 }
3583
3584 #[doc(hidden)]
3585 impl gax::options::internal::RequestBuilder for Switchover {
3586 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3587 &mut self.0.options
3588 }
3589 }
3590
3591 #[derive(Clone, Debug)]
3608 pub struct ResetSslConfig(RequestBuilder<crate::model::SqlInstancesResetSslConfigRequest>);
3609
3610 impl ResetSslConfig {
3611 pub(crate) fn new(
3612 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3613 ) -> Self {
3614 Self(RequestBuilder::new(stub))
3615 }
3616
3617 pub fn with_request<V: Into<crate::model::SqlInstancesResetSslConfigRequest>>(
3619 mut self,
3620 v: V,
3621 ) -> Self {
3622 self.0.request = v.into();
3623 self
3624 }
3625
3626 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3628 self.0.options = v.into();
3629 self
3630 }
3631
3632 pub async fn send(self) -> Result<crate::model::Operation> {
3634 (*self.0.stub)
3635 .reset_ssl_config(self.0.request, self.0.options)
3636 .await
3637 .map(gax::response::Response::into_body)
3638 }
3639
3640 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3642 self.0.request.instance = v.into();
3643 self
3644 }
3645
3646 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3648 self.0.request.project = v.into();
3649 self
3650 }
3651
3652 pub fn set_mode<
3654 T: Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
3655 >(
3656 mut self,
3657 v: T,
3658 ) -> Self {
3659 self.0.request.mode = v.into();
3660 self
3661 }
3662 }
3663
3664 #[doc(hidden)]
3665 impl gax::options::internal::RequestBuilder for ResetSslConfig {
3666 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3667 &mut self.0.options
3668 }
3669 }
3670
3671 #[derive(Clone, Debug)]
3688 pub struct Restart(RequestBuilder<crate::model::SqlInstancesRestartRequest>);
3689
3690 impl Restart {
3691 pub(crate) fn new(
3692 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3693 ) -> Self {
3694 Self(RequestBuilder::new(stub))
3695 }
3696
3697 pub fn with_request<V: Into<crate::model::SqlInstancesRestartRequest>>(
3699 mut self,
3700 v: V,
3701 ) -> Self {
3702 self.0.request = v.into();
3703 self
3704 }
3705
3706 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3708 self.0.options = v.into();
3709 self
3710 }
3711
3712 pub async fn send(self) -> Result<crate::model::Operation> {
3714 (*self.0.stub)
3715 .restart(self.0.request, self.0.options)
3716 .await
3717 .map(gax::response::Response::into_body)
3718 }
3719
3720 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3722 self.0.request.instance = v.into();
3723 self
3724 }
3725
3726 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3728 self.0.request.project = v.into();
3729 self
3730 }
3731 }
3732
3733 #[doc(hidden)]
3734 impl gax::options::internal::RequestBuilder for Restart {
3735 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3736 &mut self.0.options
3737 }
3738 }
3739
3740 #[derive(Clone, Debug)]
3757 pub struct RestoreBackup(RequestBuilder<crate::model::SqlInstancesRestoreBackupRequest>);
3758
3759 impl RestoreBackup {
3760 pub(crate) fn new(
3761 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3762 ) -> Self {
3763 Self(RequestBuilder::new(stub))
3764 }
3765
3766 pub fn with_request<V: Into<crate::model::SqlInstancesRestoreBackupRequest>>(
3768 mut self,
3769 v: V,
3770 ) -> Self {
3771 self.0.request = v.into();
3772 self
3773 }
3774
3775 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3777 self.0.options = v.into();
3778 self
3779 }
3780
3781 pub async fn send(self) -> Result<crate::model::Operation> {
3783 (*self.0.stub)
3784 .restore_backup(self.0.request, self.0.options)
3785 .await
3786 .map(gax::response::Response::into_body)
3787 }
3788
3789 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3791 self.0.request.instance = v.into();
3792 self
3793 }
3794
3795 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3797 self.0.request.project = v.into();
3798 self
3799 }
3800
3801 pub fn set_body<T>(mut self, v: T) -> Self
3803 where
3804 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
3805 {
3806 self.0.request.body = std::option::Option::Some(v.into());
3807 self
3808 }
3809
3810 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3812 where
3813 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
3814 {
3815 self.0.request.body = v.map(|x| x.into());
3816 self
3817 }
3818 }
3819
3820 #[doc(hidden)]
3821 impl gax::options::internal::RequestBuilder for RestoreBackup {
3822 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3823 &mut self.0.options
3824 }
3825 }
3826
3827 #[derive(Clone, Debug)]
3844 pub struct RotateServerCa(RequestBuilder<crate::model::SqlInstancesRotateServerCaRequest>);
3845
3846 impl RotateServerCa {
3847 pub(crate) fn new(
3848 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3849 ) -> Self {
3850 Self(RequestBuilder::new(stub))
3851 }
3852
3853 pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCaRequest>>(
3855 mut self,
3856 v: V,
3857 ) -> Self {
3858 self.0.request = v.into();
3859 self
3860 }
3861
3862 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3864 self.0.options = v.into();
3865 self
3866 }
3867
3868 pub async fn send(self) -> Result<crate::model::Operation> {
3870 (*self.0.stub)
3871 .rotate_server_ca(self.0.request, self.0.options)
3872 .await
3873 .map(gax::response::Response::into_body)
3874 }
3875
3876 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3878 self.0.request.instance = v.into();
3879 self
3880 }
3881
3882 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3884 self.0.request.project = v.into();
3885 self
3886 }
3887
3888 pub fn set_body<T>(mut self, v: T) -> Self
3890 where
3891 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
3892 {
3893 self.0.request.body = std::option::Option::Some(v.into());
3894 self
3895 }
3896
3897 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3899 where
3900 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
3901 {
3902 self.0.request.body = v.map(|x| x.into());
3903 self
3904 }
3905 }
3906
3907 #[doc(hidden)]
3908 impl gax::options::internal::RequestBuilder for RotateServerCa {
3909 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3910 &mut self.0.options
3911 }
3912 }
3913
3914 #[derive(Clone, Debug)]
3931 pub struct RotateServerCertificate(
3932 RequestBuilder<crate::model::SqlInstancesRotateServerCertificateRequest>,
3933 );
3934
3935 impl RotateServerCertificate {
3936 pub(crate) fn new(
3937 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3938 ) -> Self {
3939 Self(RequestBuilder::new(stub))
3940 }
3941
3942 pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCertificateRequest>>(
3944 mut self,
3945 v: V,
3946 ) -> Self {
3947 self.0.request = v.into();
3948 self
3949 }
3950
3951 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3953 self.0.options = v.into();
3954 self
3955 }
3956
3957 pub async fn send(self) -> Result<crate::model::Operation> {
3959 (*self.0.stub)
3960 .rotate_server_certificate(self.0.request, self.0.options)
3961 .await
3962 .map(gax::response::Response::into_body)
3963 }
3964
3965 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3969 self.0.request.instance = v.into();
3970 self
3971 }
3972
3973 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3977 self.0.request.project = v.into();
3978 self
3979 }
3980
3981 pub fn set_body<T>(mut self, v: T) -> Self
3983 where
3984 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
3985 {
3986 self.0.request.body = std::option::Option::Some(v.into());
3987 self
3988 }
3989
3990 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3992 where
3993 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
3994 {
3995 self.0.request.body = v.map(|x| x.into());
3996 self
3997 }
3998 }
3999
4000 #[doc(hidden)]
4001 impl gax::options::internal::RequestBuilder for RotateServerCertificate {
4002 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4003 &mut self.0.options
4004 }
4005 }
4006
4007 #[derive(Clone, Debug)]
4024 pub struct RotateEntraIdCertificate(
4025 RequestBuilder<crate::model::SqlInstancesRotateEntraIdCertificateRequest>,
4026 );
4027
4028 impl RotateEntraIdCertificate {
4029 pub(crate) fn new(
4030 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4031 ) -> Self {
4032 Self(RequestBuilder::new(stub))
4033 }
4034
4035 pub fn with_request<V: Into<crate::model::SqlInstancesRotateEntraIdCertificateRequest>>(
4037 mut self,
4038 v: V,
4039 ) -> Self {
4040 self.0.request = v.into();
4041 self
4042 }
4043
4044 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4046 self.0.options = v.into();
4047 self
4048 }
4049
4050 pub async fn send(self) -> Result<crate::model::Operation> {
4052 (*self.0.stub)
4053 .rotate_entra_id_certificate(self.0.request, self.0.options)
4054 .await
4055 .map(gax::response::Response::into_body)
4056 }
4057
4058 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4062 self.0.request.instance = v.into();
4063 self
4064 }
4065
4066 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4070 self.0.request.project = v.into();
4071 self
4072 }
4073
4074 pub fn set_body<T>(mut self, v: T) -> Self
4076 where
4077 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
4078 {
4079 self.0.request.body = std::option::Option::Some(v.into());
4080 self
4081 }
4082
4083 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4085 where
4086 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
4087 {
4088 self.0.request.body = v.map(|x| x.into());
4089 self
4090 }
4091 }
4092
4093 #[doc(hidden)]
4094 impl gax::options::internal::RequestBuilder for RotateEntraIdCertificate {
4095 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4096 &mut self.0.options
4097 }
4098 }
4099
4100 #[derive(Clone, Debug)]
4117 pub struct StartReplica(RequestBuilder<crate::model::SqlInstancesStartReplicaRequest>);
4118
4119 impl StartReplica {
4120 pub(crate) fn new(
4121 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4122 ) -> Self {
4123 Self(RequestBuilder::new(stub))
4124 }
4125
4126 pub fn with_request<V: Into<crate::model::SqlInstancesStartReplicaRequest>>(
4128 mut self,
4129 v: V,
4130 ) -> Self {
4131 self.0.request = v.into();
4132 self
4133 }
4134
4135 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4137 self.0.options = v.into();
4138 self
4139 }
4140
4141 pub async fn send(self) -> Result<crate::model::Operation> {
4143 (*self.0.stub)
4144 .start_replica(self.0.request, self.0.options)
4145 .await
4146 .map(gax::response::Response::into_body)
4147 }
4148
4149 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4151 self.0.request.instance = v.into();
4152 self
4153 }
4154
4155 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4157 self.0.request.project = v.into();
4158 self
4159 }
4160 }
4161
4162 #[doc(hidden)]
4163 impl gax::options::internal::RequestBuilder for StartReplica {
4164 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4165 &mut self.0.options
4166 }
4167 }
4168
4169 #[derive(Clone, Debug)]
4186 pub struct StopReplica(RequestBuilder<crate::model::SqlInstancesStopReplicaRequest>);
4187
4188 impl StopReplica {
4189 pub(crate) fn new(
4190 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4191 ) -> Self {
4192 Self(RequestBuilder::new(stub))
4193 }
4194
4195 pub fn with_request<V: Into<crate::model::SqlInstancesStopReplicaRequest>>(
4197 mut self,
4198 v: V,
4199 ) -> Self {
4200 self.0.request = v.into();
4201 self
4202 }
4203
4204 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4206 self.0.options = v.into();
4207 self
4208 }
4209
4210 pub async fn send(self) -> Result<crate::model::Operation> {
4212 (*self.0.stub)
4213 .stop_replica(self.0.request, self.0.options)
4214 .await
4215 .map(gax::response::Response::into_body)
4216 }
4217
4218 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4220 self.0.request.instance = v.into();
4221 self
4222 }
4223
4224 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4226 self.0.request.project = v.into();
4227 self
4228 }
4229 }
4230
4231 #[doc(hidden)]
4232 impl gax::options::internal::RequestBuilder for StopReplica {
4233 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4234 &mut self.0.options
4235 }
4236 }
4237
4238 #[derive(Clone, Debug)]
4255 pub struct TruncateLog(RequestBuilder<crate::model::SqlInstancesTruncateLogRequest>);
4256
4257 impl TruncateLog {
4258 pub(crate) fn new(
4259 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4260 ) -> Self {
4261 Self(RequestBuilder::new(stub))
4262 }
4263
4264 pub fn with_request<V: Into<crate::model::SqlInstancesTruncateLogRequest>>(
4266 mut self,
4267 v: V,
4268 ) -> Self {
4269 self.0.request = v.into();
4270 self
4271 }
4272
4273 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4275 self.0.options = v.into();
4276 self
4277 }
4278
4279 pub async fn send(self) -> Result<crate::model::Operation> {
4281 (*self.0.stub)
4282 .truncate_log(self.0.request, self.0.options)
4283 .await
4284 .map(gax::response::Response::into_body)
4285 }
4286
4287 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4289 self.0.request.instance = v.into();
4290 self
4291 }
4292
4293 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4295 self.0.request.project = v.into();
4296 self
4297 }
4298
4299 pub fn set_body<T>(mut self, v: T) -> Self
4301 where
4302 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
4303 {
4304 self.0.request.body = std::option::Option::Some(v.into());
4305 self
4306 }
4307
4308 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4310 where
4311 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
4312 {
4313 self.0.request.body = v.map(|x| x.into());
4314 self
4315 }
4316 }
4317
4318 #[doc(hidden)]
4319 impl gax::options::internal::RequestBuilder for TruncateLog {
4320 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4321 &mut self.0.options
4322 }
4323 }
4324
4325 #[derive(Clone, Debug)]
4342 pub struct Update(RequestBuilder<crate::model::SqlInstancesUpdateRequest>);
4343
4344 impl Update {
4345 pub(crate) fn new(
4346 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4347 ) -> Self {
4348 Self(RequestBuilder::new(stub))
4349 }
4350
4351 pub fn with_request<V: Into<crate::model::SqlInstancesUpdateRequest>>(
4353 mut self,
4354 v: V,
4355 ) -> Self {
4356 self.0.request = v.into();
4357 self
4358 }
4359
4360 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4362 self.0.options = v.into();
4363 self
4364 }
4365
4366 pub async fn send(self) -> Result<crate::model::Operation> {
4368 (*self.0.stub)
4369 .update(self.0.request, self.0.options)
4370 .await
4371 .map(gax::response::Response::into_body)
4372 }
4373
4374 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4376 self.0.request.instance = v.into();
4377 self
4378 }
4379
4380 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4382 self.0.request.project = v.into();
4383 self
4384 }
4385
4386 pub fn set_body<T>(mut self, v: T) -> Self
4388 where
4389 T: std::convert::Into<crate::model::DatabaseInstance>,
4390 {
4391 self.0.request.body = std::option::Option::Some(v.into());
4392 self
4393 }
4394
4395 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4397 where
4398 T: std::convert::Into<crate::model::DatabaseInstance>,
4399 {
4400 self.0.request.body = v.map(|x| x.into());
4401 self
4402 }
4403 }
4404
4405 #[doc(hidden)]
4406 impl gax::options::internal::RequestBuilder for Update {
4407 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4408 &mut self.0.options
4409 }
4410 }
4411
4412 #[derive(Clone, Debug)]
4429 pub struct CreateEphemeral(
4430 RequestBuilder<crate::model::SqlInstancesCreateEphemeralCertRequest>,
4431 );
4432
4433 impl CreateEphemeral {
4434 pub(crate) fn new(
4435 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4436 ) -> Self {
4437 Self(RequestBuilder::new(stub))
4438 }
4439
4440 pub fn with_request<V: Into<crate::model::SqlInstancesCreateEphemeralCertRequest>>(
4442 mut self,
4443 v: V,
4444 ) -> Self {
4445 self.0.request = v.into();
4446 self
4447 }
4448
4449 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4451 self.0.options = v.into();
4452 self
4453 }
4454
4455 pub async fn send(self) -> Result<crate::model::SslCert> {
4457 (*self.0.stub)
4458 .create_ephemeral(self.0.request, self.0.options)
4459 .await
4460 .map(gax::response::Response::into_body)
4461 }
4462
4463 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4465 self.0.request.instance = v.into();
4466 self
4467 }
4468
4469 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4471 self.0.request.project = v.into();
4472 self
4473 }
4474
4475 pub fn set_body<T>(mut self, v: T) -> Self
4477 where
4478 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
4479 {
4480 self.0.request.body = std::option::Option::Some(v.into());
4481 self
4482 }
4483
4484 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4486 where
4487 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
4488 {
4489 self.0.request.body = v.map(|x| x.into());
4490 self
4491 }
4492 }
4493
4494 #[doc(hidden)]
4495 impl gax::options::internal::RequestBuilder for CreateEphemeral {
4496 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4497 &mut self.0.options
4498 }
4499 }
4500
4501 #[derive(Clone, Debug)]
4518 pub struct RescheduleMaintenance(
4519 RequestBuilder<crate::model::SqlInstancesRescheduleMaintenanceRequest>,
4520 );
4521
4522 impl RescheduleMaintenance {
4523 pub(crate) fn new(
4524 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4525 ) -> Self {
4526 Self(RequestBuilder::new(stub))
4527 }
4528
4529 pub fn with_request<V: Into<crate::model::SqlInstancesRescheduleMaintenanceRequest>>(
4531 mut self,
4532 v: V,
4533 ) -> Self {
4534 self.0.request = v.into();
4535 self
4536 }
4537
4538 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4540 self.0.options = v.into();
4541 self
4542 }
4543
4544 pub async fn send(self) -> Result<crate::model::Operation> {
4546 (*self.0.stub)
4547 .reschedule_maintenance(self.0.request, self.0.options)
4548 .await
4549 .map(gax::response::Response::into_body)
4550 }
4551
4552 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4554 self.0.request.instance = v.into();
4555 self
4556 }
4557
4558 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4560 self.0.request.project = v.into();
4561 self
4562 }
4563
4564 pub fn set_body<T>(mut self, v: T) -> Self
4566 where
4567 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4568 {
4569 self.0.request.body = std::option::Option::Some(v.into());
4570 self
4571 }
4572
4573 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4575 where
4576 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4577 {
4578 self.0.request.body = v.map(|x| x.into());
4579 self
4580 }
4581 }
4582
4583 #[doc(hidden)]
4584 impl gax::options::internal::RequestBuilder for RescheduleMaintenance {
4585 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4586 &mut self.0.options
4587 }
4588 }
4589
4590 #[derive(Clone, Debug)]
4607 pub struct VerifyExternalSyncSettings(
4608 RequestBuilder<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
4609 );
4610
4611 impl VerifyExternalSyncSettings {
4612 pub(crate) fn new(
4613 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4614 ) -> Self {
4615 Self(RequestBuilder::new(stub))
4616 }
4617
4618 pub fn with_request<
4620 V: Into<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
4621 >(
4622 mut self,
4623 v: V,
4624 ) -> Self {
4625 self.0.request = v.into();
4626 self
4627 }
4628
4629 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4631 self.0.options = v.into();
4632 self
4633 }
4634
4635 pub async fn send(
4637 self,
4638 ) -> Result<crate::model::SqlInstancesVerifyExternalSyncSettingsResponse> {
4639 (*self.0.stub)
4640 .verify_external_sync_settings(self.0.request, self.0.options)
4641 .await
4642 .map(gax::response::Response::into_body)
4643 }
4644
4645 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4647 self.0.request.instance = v.into();
4648 self
4649 }
4650
4651 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4653 self.0.request.project = v.into();
4654 self
4655 }
4656
4657 pub fn set_verify_connection_only<T: Into<bool>>(mut self, v: T) -> Self {
4659 self.0.request.verify_connection_only = v.into();
4660 self
4661 }
4662
4663 pub fn set_sync_mode<
4665 T: Into<
4666 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
4667 >,
4668 >(
4669 mut self,
4670 v: T,
4671 ) -> Self {
4672 self.0.request.sync_mode = v.into();
4673 self
4674 }
4675
4676 pub fn set_verify_replication_only<T: Into<bool>>(mut self, v: T) -> Self {
4678 self.0.request.verify_replication_only = v.into();
4679 self
4680 }
4681
4682 pub fn set_migration_type<
4684 T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
4685 >(
4686 mut self,
4687 v: T,
4688 ) -> Self {
4689 self.0.request.migration_type = v.into();
4690 self
4691 }
4692
4693 pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
4695 mut self,
4696 v: T,
4697 ) -> Self {
4698 self.0.request.sync_parallel_level = v.into();
4699 self
4700 }
4701
4702 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
4704 where
4705 T: std::iter::IntoIterator<Item = V>,
4706 V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
4707 {
4708 use std::iter::Iterator;
4709 self.0.request.selected_objects = v.into_iter().map(|i| i.into()).collect();
4710 self
4711 }
4712
4713 pub fn set_sync_config<
4718 T: Into<
4719 Option<
4720 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
4721 >,
4722 >,
4723 >(
4724 mut self,
4725 v: T,
4726 ) -> Self {
4727 self.0.request.sync_config = v.into();
4728 self
4729 }
4730
4731 pub fn set_mysql_sync_config<
4737 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
4738 >(
4739 mut self,
4740 v: T,
4741 ) -> Self {
4742 self.0.request = self.0.request.set_mysql_sync_config(v);
4743 self
4744 }
4745 }
4746
4747 #[doc(hidden)]
4748 impl gax::options::internal::RequestBuilder for VerifyExternalSyncSettings {
4749 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4750 &mut self.0.options
4751 }
4752 }
4753
4754 #[derive(Clone, Debug)]
4771 pub struct StartExternalSync(
4772 RequestBuilder<crate::model::SqlInstancesStartExternalSyncRequest>,
4773 );
4774
4775 impl StartExternalSync {
4776 pub(crate) fn new(
4777 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4778 ) -> Self {
4779 Self(RequestBuilder::new(stub))
4780 }
4781
4782 pub fn with_request<V: Into<crate::model::SqlInstancesStartExternalSyncRequest>>(
4784 mut self,
4785 v: V,
4786 ) -> Self {
4787 self.0.request = v.into();
4788 self
4789 }
4790
4791 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4793 self.0.options = v.into();
4794 self
4795 }
4796
4797 pub async fn send(self) -> Result<crate::model::Operation> {
4799 (*self.0.stub)
4800 .start_external_sync(self.0.request, self.0.options)
4801 .await
4802 .map(gax::response::Response::into_body)
4803 }
4804
4805 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4807 self.0.request.instance = v.into();
4808 self
4809 }
4810
4811 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4813 self.0.request.project = v.into();
4814 self
4815 }
4816
4817 pub fn set_sync_mode<
4819 T: Into<
4820 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
4821 >,
4822 >(
4823 mut self,
4824 v: T,
4825 ) -> Self {
4826 self.0.request.sync_mode = v.into();
4827 self
4828 }
4829
4830 pub fn set_skip_verification<T: Into<bool>>(mut self, v: T) -> Self {
4832 self.0.request.skip_verification = v.into();
4833 self
4834 }
4835
4836 pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
4838 mut self,
4839 v: T,
4840 ) -> Self {
4841 self.0.request.sync_parallel_level = v.into();
4842 self
4843 }
4844
4845 pub fn set_migration_type<
4847 T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
4848 >(
4849 mut self,
4850 v: T,
4851 ) -> Self {
4852 self.0.request.migration_type = v.into();
4853 self
4854 }
4855
4856 pub fn set_replica_overwrite_enabled<T: Into<bool>>(mut self, v: T) -> Self {
4858 self.0.request.replica_overwrite_enabled = v.into();
4859 self
4860 }
4861
4862 pub fn set_sync_config<
4867 T: Into<Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>>,
4868 >(
4869 mut self,
4870 v: T,
4871 ) -> Self {
4872 self.0.request.sync_config = v.into();
4873 self
4874 }
4875
4876 pub fn set_mysql_sync_config<
4882 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
4883 >(
4884 mut self,
4885 v: T,
4886 ) -> Self {
4887 self.0.request = self.0.request.set_mysql_sync_config(v);
4888 self
4889 }
4890 }
4891
4892 #[doc(hidden)]
4893 impl gax::options::internal::RequestBuilder for StartExternalSync {
4894 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4895 &mut self.0.options
4896 }
4897 }
4898
4899 #[derive(Clone, Debug)]
4916 pub struct PerformDiskShrink(
4917 RequestBuilder<crate::model::SqlInstancesPerformDiskShrinkRequest>,
4918 );
4919
4920 impl PerformDiskShrink {
4921 pub(crate) fn new(
4922 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4923 ) -> Self {
4924 Self(RequestBuilder::new(stub))
4925 }
4926
4927 pub fn with_request<V: Into<crate::model::SqlInstancesPerformDiskShrinkRequest>>(
4929 mut self,
4930 v: V,
4931 ) -> Self {
4932 self.0.request = v.into();
4933 self
4934 }
4935
4936 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4938 self.0.options = v.into();
4939 self
4940 }
4941
4942 pub async fn send(self) -> Result<crate::model::Operation> {
4944 (*self.0.stub)
4945 .perform_disk_shrink(self.0.request, self.0.options)
4946 .await
4947 .map(gax::response::Response::into_body)
4948 }
4949
4950 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4952 self.0.request.instance = v.into();
4953 self
4954 }
4955
4956 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4958 self.0.request.project = v.into();
4959 self
4960 }
4961
4962 pub fn set_body<T>(mut self, v: T) -> Self
4964 where
4965 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
4966 {
4967 self.0.request.body = std::option::Option::Some(v.into());
4968 self
4969 }
4970
4971 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4973 where
4974 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
4975 {
4976 self.0.request.body = v.map(|x| x.into());
4977 self
4978 }
4979 }
4980
4981 #[doc(hidden)]
4982 impl gax::options::internal::RequestBuilder for PerformDiskShrink {
4983 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4984 &mut self.0.options
4985 }
4986 }
4987
4988 #[derive(Clone, Debug)]
5005 pub struct GetDiskShrinkConfig(
5006 RequestBuilder<crate::model::SqlInstancesGetDiskShrinkConfigRequest>,
5007 );
5008
5009 impl GetDiskShrinkConfig {
5010 pub(crate) fn new(
5011 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5012 ) -> Self {
5013 Self(RequestBuilder::new(stub))
5014 }
5015
5016 pub fn with_request<V: Into<crate::model::SqlInstancesGetDiskShrinkConfigRequest>>(
5018 mut self,
5019 v: V,
5020 ) -> Self {
5021 self.0.request = v.into();
5022 self
5023 }
5024
5025 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5027 self.0.options = v.into();
5028 self
5029 }
5030
5031 pub async fn send(self) -> Result<crate::model::SqlInstancesGetDiskShrinkConfigResponse> {
5033 (*self.0.stub)
5034 .get_disk_shrink_config(self.0.request, self.0.options)
5035 .await
5036 .map(gax::response::Response::into_body)
5037 }
5038
5039 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5041 self.0.request.instance = v.into();
5042 self
5043 }
5044
5045 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5047 self.0.request.project = v.into();
5048 self
5049 }
5050 }
5051
5052 #[doc(hidden)]
5053 impl gax::options::internal::RequestBuilder for GetDiskShrinkConfig {
5054 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5055 &mut self.0.options
5056 }
5057 }
5058
5059 #[derive(Clone, Debug)]
5076 pub struct ResetReplicaSize(RequestBuilder<crate::model::SqlInstancesResetReplicaSizeRequest>);
5077
5078 impl ResetReplicaSize {
5079 pub(crate) fn new(
5080 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5081 ) -> Self {
5082 Self(RequestBuilder::new(stub))
5083 }
5084
5085 pub fn with_request<V: Into<crate::model::SqlInstancesResetReplicaSizeRequest>>(
5087 mut self,
5088 v: V,
5089 ) -> Self {
5090 self.0.request = v.into();
5091 self
5092 }
5093
5094 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5096 self.0.options = v.into();
5097 self
5098 }
5099
5100 pub async fn send(self) -> Result<crate::model::Operation> {
5102 (*self.0.stub)
5103 .reset_replica_size(self.0.request, self.0.options)
5104 .await
5105 .map(gax::response::Response::into_body)
5106 }
5107
5108 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5110 self.0.request.instance = v.into();
5111 self
5112 }
5113
5114 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5116 self.0.request.project = v.into();
5117 self
5118 }
5119 }
5120
5121 #[doc(hidden)]
5122 impl gax::options::internal::RequestBuilder for ResetReplicaSize {
5123 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5124 &mut self.0.options
5125 }
5126 }
5127
5128 #[derive(Clone, Debug)]
5145 pub struct GetLatestRecoveryTime(
5146 RequestBuilder<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>,
5147 );
5148
5149 impl GetLatestRecoveryTime {
5150 pub(crate) fn new(
5151 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5152 ) -> Self {
5153 Self(RequestBuilder::new(stub))
5154 }
5155
5156 pub fn with_request<V: Into<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>>(
5158 mut self,
5159 v: V,
5160 ) -> Self {
5161 self.0.request = v.into();
5162 self
5163 }
5164
5165 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5167 self.0.options = v.into();
5168 self
5169 }
5170
5171 pub async fn send(self) -> Result<crate::model::SqlInstancesGetLatestRecoveryTimeResponse> {
5173 (*self.0.stub)
5174 .get_latest_recovery_time(self.0.request, self.0.options)
5175 .await
5176 .map(gax::response::Response::into_body)
5177 }
5178
5179 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5181 self.0.request.instance = v.into();
5182 self
5183 }
5184
5185 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5187 self.0.request.project = v.into();
5188 self
5189 }
5190
5191 pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
5193 where
5194 T: std::convert::Into<wkt::Timestamp>,
5195 {
5196 self.0.request.source_instance_deletion_time = std::option::Option::Some(v.into());
5197 self
5198 }
5199
5200 pub fn set_or_clear_source_instance_deletion_time<T>(
5202 mut self,
5203 v: std::option::Option<T>,
5204 ) -> Self
5205 where
5206 T: std::convert::Into<wkt::Timestamp>,
5207 {
5208 self.0.request.source_instance_deletion_time = v.map(|x| x.into());
5209 self
5210 }
5211 }
5212
5213 #[doc(hidden)]
5214 impl gax::options::internal::RequestBuilder for GetLatestRecoveryTime {
5215 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5216 &mut self.0.options
5217 }
5218 }
5219
5220 #[derive(Clone, Debug)]
5237 pub struct ExecuteSql(RequestBuilder<crate::model::SqlInstancesExecuteSqlRequest>);
5238
5239 impl ExecuteSql {
5240 pub(crate) fn new(
5241 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5242 ) -> Self {
5243 Self(RequestBuilder::new(stub))
5244 }
5245
5246 pub fn with_request<V: Into<crate::model::SqlInstancesExecuteSqlRequest>>(
5248 mut self,
5249 v: V,
5250 ) -> Self {
5251 self.0.request = v.into();
5252 self
5253 }
5254
5255 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5257 self.0.options = v.into();
5258 self
5259 }
5260
5261 pub async fn send(self) -> Result<crate::model::SqlInstancesExecuteSqlResponse> {
5263 (*self.0.stub)
5264 .execute_sql(self.0.request, self.0.options)
5265 .await
5266 .map(gax::response::Response::into_body)
5267 }
5268
5269 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5273 self.0.request.instance = v.into();
5274 self
5275 }
5276
5277 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5281 self.0.request.project = v.into();
5282 self
5283 }
5284
5285 pub fn set_body<T>(mut self, v: T) -> Self
5287 where
5288 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
5289 {
5290 self.0.request.body = std::option::Option::Some(v.into());
5291 self
5292 }
5293
5294 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5296 where
5297 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
5298 {
5299 self.0.request.body = v.map(|x| x.into());
5300 self
5301 }
5302 }
5303
5304 #[doc(hidden)]
5305 impl gax::options::internal::RequestBuilder for ExecuteSql {
5306 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5307 &mut self.0.options
5308 }
5309 }
5310
5311 #[derive(Clone, Debug)]
5328 pub struct AcquireSsrsLease(RequestBuilder<crate::model::SqlInstancesAcquireSsrsLeaseRequest>);
5329
5330 impl AcquireSsrsLease {
5331 pub(crate) fn new(
5332 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5333 ) -> Self {
5334 Self(RequestBuilder::new(stub))
5335 }
5336
5337 pub fn with_request<V: Into<crate::model::SqlInstancesAcquireSsrsLeaseRequest>>(
5339 mut self,
5340 v: V,
5341 ) -> Self {
5342 self.0.request = v.into();
5343 self
5344 }
5345
5346 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5348 self.0.options = v.into();
5349 self
5350 }
5351
5352 pub async fn send(self) -> Result<crate::model::SqlInstancesAcquireSsrsLeaseResponse> {
5354 (*self.0.stub)
5355 .acquire_ssrs_lease(self.0.request, self.0.options)
5356 .await
5357 .map(gax::response::Response::into_body)
5358 }
5359
5360 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5364 self.0.request.instance = v.into();
5365 self
5366 }
5367
5368 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5372 self.0.request.project = v.into();
5373 self
5374 }
5375
5376 pub fn set_body<T>(mut self, v: T) -> Self
5380 where
5381 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
5382 {
5383 self.0.request.body = std::option::Option::Some(v.into());
5384 self
5385 }
5386
5387 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5391 where
5392 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
5393 {
5394 self.0.request.body = v.map(|x| x.into());
5395 self
5396 }
5397 }
5398
5399 #[doc(hidden)]
5400 impl gax::options::internal::RequestBuilder for AcquireSsrsLease {
5401 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5402 &mut self.0.options
5403 }
5404 }
5405
5406 #[derive(Clone, Debug)]
5423 pub struct ReleaseSsrsLease(RequestBuilder<crate::model::SqlInstancesReleaseSsrsLeaseRequest>);
5424
5425 impl ReleaseSsrsLease {
5426 pub(crate) fn new(
5427 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5428 ) -> Self {
5429 Self(RequestBuilder::new(stub))
5430 }
5431
5432 pub fn with_request<V: Into<crate::model::SqlInstancesReleaseSsrsLeaseRequest>>(
5434 mut self,
5435 v: V,
5436 ) -> Self {
5437 self.0.request = v.into();
5438 self
5439 }
5440
5441 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5443 self.0.options = v.into();
5444 self
5445 }
5446
5447 pub async fn send(self) -> Result<crate::model::SqlInstancesReleaseSsrsLeaseResponse> {
5449 (*self.0.stub)
5450 .release_ssrs_lease(self.0.request, self.0.options)
5451 .await
5452 .map(gax::response::Response::into_body)
5453 }
5454
5455 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5459 self.0.request.instance = v.into();
5460 self
5461 }
5462
5463 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5467 self.0.request.project = v.into();
5468 self
5469 }
5470 }
5471
5472 #[doc(hidden)]
5473 impl gax::options::internal::RequestBuilder for ReleaseSsrsLease {
5474 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5475 &mut self.0.options
5476 }
5477 }
5478
5479 #[derive(Clone, Debug)]
5496 pub struct PreCheckMajorVersionUpgrade(
5497 RequestBuilder<crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest>,
5498 );
5499
5500 impl PreCheckMajorVersionUpgrade {
5501 pub(crate) fn new(
5502 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5503 ) -> Self {
5504 Self(RequestBuilder::new(stub))
5505 }
5506
5507 pub fn with_request<
5509 V: Into<crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest>,
5510 >(
5511 mut self,
5512 v: V,
5513 ) -> Self {
5514 self.0.request = v.into();
5515 self
5516 }
5517
5518 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5520 self.0.options = v.into();
5521 self
5522 }
5523
5524 pub async fn send(self) -> Result<crate::model::Operation> {
5526 (*self.0.stub)
5527 .pre_check_major_version_upgrade(self.0.request, self.0.options)
5528 .await
5529 .map(gax::response::Response::into_body)
5530 }
5531
5532 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5536 self.0.request.instance = v.into();
5537 self
5538 }
5539
5540 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5544 self.0.request.project = v.into();
5545 self
5546 }
5547
5548 pub fn set_body<T>(mut self, v: T) -> Self
5552 where
5553 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
5554 {
5555 self.0.request.body = std::option::Option::Some(v.into());
5556 self
5557 }
5558
5559 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5563 where
5564 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
5565 {
5566 self.0.request.body = v.map(|x| x.into());
5567 self
5568 }
5569 }
5570
5571 #[doc(hidden)]
5572 impl gax::options::internal::RequestBuilder for PreCheckMajorVersionUpgrade {
5573 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5574 &mut self.0.options
5575 }
5576 }
5577
5578 #[derive(Clone, Debug)]
5595 pub struct PointInTimeRestore(
5596 RequestBuilder<crate::model::SqlInstancesPointInTimeRestoreRequest>,
5597 );
5598
5599 impl PointInTimeRestore {
5600 pub(crate) fn new(
5601 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5602 ) -> Self {
5603 Self(RequestBuilder::new(stub))
5604 }
5605
5606 pub fn with_request<V: Into<crate::model::SqlInstancesPointInTimeRestoreRequest>>(
5608 mut self,
5609 v: V,
5610 ) -> Self {
5611 self.0.request = v.into();
5612 self
5613 }
5614
5615 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5617 self.0.options = v.into();
5618 self
5619 }
5620
5621 pub async fn send(self) -> Result<crate::model::Operation> {
5623 (*self.0.stub)
5624 .point_in_time_restore(self.0.request, self.0.options)
5625 .await
5626 .map(gax::response::Response::into_body)
5627 }
5628
5629 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5633 self.0.request.parent = v.into();
5634 self
5635 }
5636
5637 pub fn set_context<T>(mut self, v: T) -> Self
5641 where
5642 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
5643 {
5644 self.0.request.context = std::option::Option::Some(v.into());
5645 self
5646 }
5647
5648 pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
5652 where
5653 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
5654 {
5655 self.0.request.context = v.map(|x| x.into());
5656 self
5657 }
5658 }
5659
5660 #[doc(hidden)]
5661 impl gax::options::internal::RequestBuilder for PointInTimeRestore {
5662 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5663 &mut self.0.options
5664 }
5665 }
5666}
5667
5668pub mod sql_operations_service {
5669 use crate::Result;
5670
5671 pub type ClientBuilder =
5685 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5686
5687 pub(crate) mod client {
5688 use super::super::super::client::SqlOperationsService;
5689 pub struct Factory;
5690 impl gax::client_builder::internal::ClientFactory for Factory {
5691 type Client = SqlOperationsService;
5692 type Credentials = gaxi::options::Credentials;
5693 async fn build(
5694 self,
5695 config: gaxi::options::ClientConfig,
5696 ) -> gax::client_builder::Result<Self::Client> {
5697 Self::Client::new(config).await
5698 }
5699 }
5700 }
5701
5702 #[derive(Clone, Debug)]
5704 pub(crate) struct RequestBuilder<R: std::default::Default> {
5705 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5706 request: R,
5707 options: gax::options::RequestOptions,
5708 }
5709
5710 impl<R> RequestBuilder<R>
5711 where
5712 R: std::default::Default,
5713 {
5714 pub(crate) fn new(
5715 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5716 ) -> Self {
5717 Self {
5718 stub,
5719 request: R::default(),
5720 options: gax::options::RequestOptions::default(),
5721 }
5722 }
5723 }
5724
5725 #[derive(Clone, Debug)]
5742 pub struct Get(RequestBuilder<crate::model::SqlOperationsGetRequest>);
5743
5744 impl Get {
5745 pub(crate) fn new(
5746 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5747 ) -> Self {
5748 Self(RequestBuilder::new(stub))
5749 }
5750
5751 pub fn with_request<V: Into<crate::model::SqlOperationsGetRequest>>(
5753 mut self,
5754 v: V,
5755 ) -> Self {
5756 self.0.request = v.into();
5757 self
5758 }
5759
5760 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5762 self.0.options = v.into();
5763 self
5764 }
5765
5766 pub async fn send(self) -> Result<crate::model::Operation> {
5768 (*self.0.stub)
5769 .get(self.0.request, self.0.options)
5770 .await
5771 .map(gax::response::Response::into_body)
5772 }
5773
5774 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
5778 self.0.request.operation = v.into();
5779 self
5780 }
5781
5782 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5786 self.0.request.project = v.into();
5787 self
5788 }
5789 }
5790
5791 #[doc(hidden)]
5792 impl gax::options::internal::RequestBuilder for Get {
5793 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5794 &mut self.0.options
5795 }
5796 }
5797
5798 #[derive(Clone, Debug)]
5819 pub struct List(RequestBuilder<crate::model::SqlOperationsListRequest>);
5820
5821 impl List {
5822 pub(crate) fn new(
5823 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5824 ) -> Self {
5825 Self(RequestBuilder::new(stub))
5826 }
5827
5828 pub fn with_request<V: Into<crate::model::SqlOperationsListRequest>>(
5830 mut self,
5831 v: V,
5832 ) -> Self {
5833 self.0.request = v.into();
5834 self
5835 }
5836
5837 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5839 self.0.options = v.into();
5840 self
5841 }
5842
5843 pub async fn send(self) -> Result<crate::model::OperationsListResponse> {
5845 (*self.0.stub)
5846 .list(self.0.request, self.0.options)
5847 .await
5848 .map(gax::response::Response::into_body)
5849 }
5850
5851 pub fn by_page(
5853 self,
5854 ) -> impl gax::paginator::Paginator<crate::model::OperationsListResponse, gax::error::Error>
5855 {
5856 use std::clone::Clone;
5857 let token = self.0.request.page_token.clone();
5858 let execute = move |token: String| {
5859 let mut builder = self.clone();
5860 builder.0.request = builder.0.request.set_page_token(token);
5861 builder.send()
5862 };
5863 gax::paginator::internal::new_paginator(token, execute)
5864 }
5865
5866 pub fn by_item(
5868 self,
5869 ) -> impl gax::paginator::ItemPaginator<crate::model::OperationsListResponse, gax::error::Error>
5870 {
5871 use gax::paginator::Paginator;
5872 self.by_page().items()
5873 }
5874
5875 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5877 self.0.request.instance = v.into();
5878 self
5879 }
5880
5881 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
5883 self.0.request.max_results = v.into();
5884 self
5885 }
5886
5887 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5889 self.0.request.page_token = v.into();
5890 self
5891 }
5892
5893 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5895 self.0.request.project = v.into();
5896 self
5897 }
5898 }
5899
5900 #[doc(hidden)]
5901 impl gax::options::internal::RequestBuilder for List {
5902 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5903 &mut self.0.options
5904 }
5905 }
5906
5907 #[derive(Clone, Debug)]
5924 pub struct Cancel(RequestBuilder<crate::model::SqlOperationsCancelRequest>);
5925
5926 impl Cancel {
5927 pub(crate) fn new(
5928 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5929 ) -> Self {
5930 Self(RequestBuilder::new(stub))
5931 }
5932
5933 pub fn with_request<V: Into<crate::model::SqlOperationsCancelRequest>>(
5935 mut self,
5936 v: V,
5937 ) -> Self {
5938 self.0.request = v.into();
5939 self
5940 }
5941
5942 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5944 self.0.options = v.into();
5945 self
5946 }
5947
5948 pub async fn send(self) -> Result<()> {
5950 (*self.0.stub)
5951 .cancel(self.0.request, self.0.options)
5952 .await
5953 .map(gax::response::Response::into_body)
5954 }
5955
5956 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
5958 self.0.request.operation = v.into();
5959 self
5960 }
5961
5962 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5964 self.0.request.project = v.into();
5965 self
5966 }
5967 }
5968
5969 #[doc(hidden)]
5970 impl gax::options::internal::RequestBuilder for Cancel {
5971 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5972 &mut self.0.options
5973 }
5974 }
5975}
5976
5977pub mod sql_ssl_certs_service {
5978 use crate::Result;
5979
5980 pub type ClientBuilder =
5994 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5995
5996 pub(crate) mod client {
5997 use super::super::super::client::SqlSslCertsService;
5998 pub struct Factory;
5999 impl gax::client_builder::internal::ClientFactory for Factory {
6000 type Client = SqlSslCertsService;
6001 type Credentials = gaxi::options::Credentials;
6002 async fn build(
6003 self,
6004 config: gaxi::options::ClientConfig,
6005 ) -> gax::client_builder::Result<Self::Client> {
6006 Self::Client::new(config).await
6007 }
6008 }
6009 }
6010
6011 #[derive(Clone, Debug)]
6013 pub(crate) struct RequestBuilder<R: std::default::Default> {
6014 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6015 request: R,
6016 options: gax::options::RequestOptions,
6017 }
6018
6019 impl<R> RequestBuilder<R>
6020 where
6021 R: std::default::Default,
6022 {
6023 pub(crate) fn new(
6024 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6025 ) -> Self {
6026 Self {
6027 stub,
6028 request: R::default(),
6029 options: gax::options::RequestOptions::default(),
6030 }
6031 }
6032 }
6033
6034 #[derive(Clone, Debug)]
6051 pub struct Delete(RequestBuilder<crate::model::SqlSslCertsDeleteRequest>);
6052
6053 impl Delete {
6054 pub(crate) fn new(
6055 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6056 ) -> Self {
6057 Self(RequestBuilder::new(stub))
6058 }
6059
6060 pub fn with_request<V: Into<crate::model::SqlSslCertsDeleteRequest>>(
6062 mut self,
6063 v: V,
6064 ) -> Self {
6065 self.0.request = v.into();
6066 self
6067 }
6068
6069 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6071 self.0.options = v.into();
6072 self
6073 }
6074
6075 pub async fn send(self) -> Result<crate::model::Operation> {
6077 (*self.0.stub)
6078 .delete(self.0.request, self.0.options)
6079 .await
6080 .map(gax::response::Response::into_body)
6081 }
6082
6083 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6085 self.0.request.instance = v.into();
6086 self
6087 }
6088
6089 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6091 self.0.request.project = v.into();
6092 self
6093 }
6094
6095 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6097 self.0.request.sha1_fingerprint = v.into();
6098 self
6099 }
6100 }
6101
6102 #[doc(hidden)]
6103 impl gax::options::internal::RequestBuilder for Delete {
6104 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6105 &mut self.0.options
6106 }
6107 }
6108
6109 #[derive(Clone, Debug)]
6126 pub struct Get(RequestBuilder<crate::model::SqlSslCertsGetRequest>);
6127
6128 impl Get {
6129 pub(crate) fn new(
6130 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6131 ) -> Self {
6132 Self(RequestBuilder::new(stub))
6133 }
6134
6135 pub fn with_request<V: Into<crate::model::SqlSslCertsGetRequest>>(mut self, v: V) -> Self {
6137 self.0.request = v.into();
6138 self
6139 }
6140
6141 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6143 self.0.options = v.into();
6144 self
6145 }
6146
6147 pub async fn send(self) -> Result<crate::model::SslCert> {
6149 (*self.0.stub)
6150 .get(self.0.request, self.0.options)
6151 .await
6152 .map(gax::response::Response::into_body)
6153 }
6154
6155 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6157 self.0.request.instance = v.into();
6158 self
6159 }
6160
6161 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6163 self.0.request.project = v.into();
6164 self
6165 }
6166
6167 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6169 self.0.request.sha1_fingerprint = v.into();
6170 self
6171 }
6172 }
6173
6174 #[doc(hidden)]
6175 impl gax::options::internal::RequestBuilder for Get {
6176 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6177 &mut self.0.options
6178 }
6179 }
6180
6181 #[derive(Clone, Debug)]
6198 pub struct Insert(RequestBuilder<crate::model::SqlSslCertsInsertRequest>);
6199
6200 impl Insert {
6201 pub(crate) fn new(
6202 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6203 ) -> Self {
6204 Self(RequestBuilder::new(stub))
6205 }
6206
6207 pub fn with_request<V: Into<crate::model::SqlSslCertsInsertRequest>>(
6209 mut self,
6210 v: V,
6211 ) -> Self {
6212 self.0.request = v.into();
6213 self
6214 }
6215
6216 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6218 self.0.options = v.into();
6219 self
6220 }
6221
6222 pub async fn send(self) -> Result<crate::model::SslCertsInsertResponse> {
6224 (*self.0.stub)
6225 .insert(self.0.request, self.0.options)
6226 .await
6227 .map(gax::response::Response::into_body)
6228 }
6229
6230 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6232 self.0.request.instance = v.into();
6233 self
6234 }
6235
6236 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6238 self.0.request.project = v.into();
6239 self
6240 }
6241
6242 pub fn set_body<T>(mut self, v: T) -> Self
6244 where
6245 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6246 {
6247 self.0.request.body = std::option::Option::Some(v.into());
6248 self
6249 }
6250
6251 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6253 where
6254 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6255 {
6256 self.0.request.body = v.map(|x| x.into());
6257 self
6258 }
6259 }
6260
6261 #[doc(hidden)]
6262 impl gax::options::internal::RequestBuilder for Insert {
6263 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6264 &mut self.0.options
6265 }
6266 }
6267
6268 #[derive(Clone, Debug)]
6285 pub struct List(RequestBuilder<crate::model::SqlSslCertsListRequest>);
6286
6287 impl List {
6288 pub(crate) fn new(
6289 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6290 ) -> Self {
6291 Self(RequestBuilder::new(stub))
6292 }
6293
6294 pub fn with_request<V: Into<crate::model::SqlSslCertsListRequest>>(mut self, v: V) -> Self {
6296 self.0.request = v.into();
6297 self
6298 }
6299
6300 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6302 self.0.options = v.into();
6303 self
6304 }
6305
6306 pub async fn send(self) -> Result<crate::model::SslCertsListResponse> {
6308 (*self.0.stub)
6309 .list(self.0.request, self.0.options)
6310 .await
6311 .map(gax::response::Response::into_body)
6312 }
6313
6314 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6316 self.0.request.instance = v.into();
6317 self
6318 }
6319
6320 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6322 self.0.request.project = v.into();
6323 self
6324 }
6325 }
6326
6327 #[doc(hidden)]
6328 impl gax::options::internal::RequestBuilder for List {
6329 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6330 &mut self.0.options
6331 }
6332 }
6333}
6334
6335pub mod sql_tiers_service {
6336 use crate::Result;
6337
6338 pub type ClientBuilder =
6352 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6353
6354 pub(crate) mod client {
6355 use super::super::super::client::SqlTiersService;
6356 pub struct Factory;
6357 impl gax::client_builder::internal::ClientFactory for Factory {
6358 type Client = SqlTiersService;
6359 type Credentials = gaxi::options::Credentials;
6360 async fn build(
6361 self,
6362 config: gaxi::options::ClientConfig,
6363 ) -> gax::client_builder::Result<Self::Client> {
6364 Self::Client::new(config).await
6365 }
6366 }
6367 }
6368
6369 #[derive(Clone, Debug)]
6371 pub(crate) struct RequestBuilder<R: std::default::Default> {
6372 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6373 request: R,
6374 options: gax::options::RequestOptions,
6375 }
6376
6377 impl<R> RequestBuilder<R>
6378 where
6379 R: std::default::Default,
6380 {
6381 pub(crate) fn new(
6382 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6383 ) -> Self {
6384 Self {
6385 stub,
6386 request: R::default(),
6387 options: gax::options::RequestOptions::default(),
6388 }
6389 }
6390 }
6391
6392 #[derive(Clone, Debug)]
6409 pub struct List(RequestBuilder<crate::model::SqlTiersListRequest>);
6410
6411 impl List {
6412 pub(crate) fn new(
6413 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6414 ) -> Self {
6415 Self(RequestBuilder::new(stub))
6416 }
6417
6418 pub fn with_request<V: Into<crate::model::SqlTiersListRequest>>(mut self, v: V) -> Self {
6420 self.0.request = v.into();
6421 self
6422 }
6423
6424 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6426 self.0.options = v.into();
6427 self
6428 }
6429
6430 pub async fn send(self) -> Result<crate::model::TiersListResponse> {
6432 (*self.0.stub)
6433 .list(self.0.request, self.0.options)
6434 .await
6435 .map(gax::response::Response::into_body)
6436 }
6437
6438 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6440 self.0.request.project = v.into();
6441 self
6442 }
6443 }
6444
6445 #[doc(hidden)]
6446 impl gax::options::internal::RequestBuilder for List {
6447 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6448 &mut self.0.options
6449 }
6450 }
6451}
6452
6453pub mod sql_users_service {
6454 use crate::Result;
6455
6456 pub type ClientBuilder =
6470 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6471
6472 pub(crate) mod client {
6473 use super::super::super::client::SqlUsersService;
6474 pub struct Factory;
6475 impl gax::client_builder::internal::ClientFactory for Factory {
6476 type Client = SqlUsersService;
6477 type Credentials = gaxi::options::Credentials;
6478 async fn build(
6479 self,
6480 config: gaxi::options::ClientConfig,
6481 ) -> gax::client_builder::Result<Self::Client> {
6482 Self::Client::new(config).await
6483 }
6484 }
6485 }
6486
6487 #[derive(Clone, Debug)]
6489 pub(crate) struct RequestBuilder<R: std::default::Default> {
6490 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6491 request: R,
6492 options: gax::options::RequestOptions,
6493 }
6494
6495 impl<R> RequestBuilder<R>
6496 where
6497 R: std::default::Default,
6498 {
6499 pub(crate) fn new(
6500 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6501 ) -> Self {
6502 Self {
6503 stub,
6504 request: R::default(),
6505 options: gax::options::RequestOptions::default(),
6506 }
6507 }
6508 }
6509
6510 #[derive(Clone, Debug)]
6527 pub struct Delete(RequestBuilder<crate::model::SqlUsersDeleteRequest>);
6528
6529 impl Delete {
6530 pub(crate) fn new(
6531 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6532 ) -> Self {
6533 Self(RequestBuilder::new(stub))
6534 }
6535
6536 pub fn with_request<V: Into<crate::model::SqlUsersDeleteRequest>>(mut self, v: V) -> Self {
6538 self.0.request = v.into();
6539 self
6540 }
6541
6542 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6544 self.0.options = v.into();
6545 self
6546 }
6547
6548 pub async fn send(self) -> Result<crate::model::Operation> {
6550 (*self.0.stub)
6551 .delete(self.0.request, self.0.options)
6552 .await
6553 .map(gax::response::Response::into_body)
6554 }
6555
6556 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6558 self.0.request.host = v.into();
6559 self
6560 }
6561
6562 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6564 self.0.request.instance = v.into();
6565 self
6566 }
6567
6568 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6570 self.0.request.name = v.into();
6571 self
6572 }
6573
6574 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6576 self.0.request.project = v.into();
6577 self
6578 }
6579 }
6580
6581 #[doc(hidden)]
6582 impl gax::options::internal::RequestBuilder for Delete {
6583 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6584 &mut self.0.options
6585 }
6586 }
6587
6588 #[derive(Clone, Debug)]
6605 pub struct Get(RequestBuilder<crate::model::SqlUsersGetRequest>);
6606
6607 impl Get {
6608 pub(crate) fn new(
6609 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6610 ) -> Self {
6611 Self(RequestBuilder::new(stub))
6612 }
6613
6614 pub fn with_request<V: Into<crate::model::SqlUsersGetRequest>>(mut self, v: V) -> Self {
6616 self.0.request = v.into();
6617 self
6618 }
6619
6620 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6622 self.0.options = v.into();
6623 self
6624 }
6625
6626 pub async fn send(self) -> Result<crate::model::User> {
6628 (*self.0.stub)
6629 .get(self.0.request, self.0.options)
6630 .await
6631 .map(gax::response::Response::into_body)
6632 }
6633
6634 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6636 self.0.request.instance = v.into();
6637 self
6638 }
6639
6640 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6642 self.0.request.name = v.into();
6643 self
6644 }
6645
6646 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6648 self.0.request.project = v.into();
6649 self
6650 }
6651
6652 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6654 self.0.request.host = v.into();
6655 self
6656 }
6657 }
6658
6659 #[doc(hidden)]
6660 impl gax::options::internal::RequestBuilder for Get {
6661 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6662 &mut self.0.options
6663 }
6664 }
6665
6666 #[derive(Clone, Debug)]
6683 pub struct Insert(RequestBuilder<crate::model::SqlUsersInsertRequest>);
6684
6685 impl Insert {
6686 pub(crate) fn new(
6687 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6688 ) -> Self {
6689 Self(RequestBuilder::new(stub))
6690 }
6691
6692 pub fn with_request<V: Into<crate::model::SqlUsersInsertRequest>>(mut self, v: V) -> Self {
6694 self.0.request = v.into();
6695 self
6696 }
6697
6698 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6700 self.0.options = v.into();
6701 self
6702 }
6703
6704 pub async fn send(self) -> Result<crate::model::Operation> {
6706 (*self.0.stub)
6707 .insert(self.0.request, self.0.options)
6708 .await
6709 .map(gax::response::Response::into_body)
6710 }
6711
6712 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6714 self.0.request.instance = v.into();
6715 self
6716 }
6717
6718 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6720 self.0.request.project = v.into();
6721 self
6722 }
6723
6724 pub fn set_body<T>(mut self, v: T) -> Self
6726 where
6727 T: std::convert::Into<crate::model::User>,
6728 {
6729 self.0.request.body = std::option::Option::Some(v.into());
6730 self
6731 }
6732
6733 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6735 where
6736 T: std::convert::Into<crate::model::User>,
6737 {
6738 self.0.request.body = v.map(|x| x.into());
6739 self
6740 }
6741 }
6742
6743 #[doc(hidden)]
6744 impl gax::options::internal::RequestBuilder for Insert {
6745 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6746 &mut self.0.options
6747 }
6748 }
6749
6750 #[derive(Clone, Debug)]
6767 pub struct List(RequestBuilder<crate::model::SqlUsersListRequest>);
6768
6769 impl List {
6770 pub(crate) fn new(
6771 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6772 ) -> Self {
6773 Self(RequestBuilder::new(stub))
6774 }
6775
6776 pub fn with_request<V: Into<crate::model::SqlUsersListRequest>>(mut self, v: V) -> Self {
6778 self.0.request = v.into();
6779 self
6780 }
6781
6782 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6784 self.0.options = v.into();
6785 self
6786 }
6787
6788 pub async fn send(self) -> Result<crate::model::UsersListResponse> {
6790 (*self.0.stub)
6791 .list(self.0.request, self.0.options)
6792 .await
6793 .map(gax::response::Response::into_body)
6794 }
6795
6796 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6798 self.0.request.instance = v.into();
6799 self
6800 }
6801
6802 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6804 self.0.request.project = v.into();
6805 self
6806 }
6807 }
6808
6809 #[doc(hidden)]
6810 impl gax::options::internal::RequestBuilder for List {
6811 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6812 &mut self.0.options
6813 }
6814 }
6815
6816 #[derive(Clone, Debug)]
6833 pub struct Update(RequestBuilder<crate::model::SqlUsersUpdateRequest>);
6834
6835 impl Update {
6836 pub(crate) fn new(
6837 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6838 ) -> Self {
6839 Self(RequestBuilder::new(stub))
6840 }
6841
6842 pub fn with_request<V: Into<crate::model::SqlUsersUpdateRequest>>(mut self, v: V) -> Self {
6844 self.0.request = v.into();
6845 self
6846 }
6847
6848 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6850 self.0.options = v.into();
6851 self
6852 }
6853
6854 pub async fn send(self) -> Result<crate::model::Operation> {
6856 (*self.0.stub)
6857 .update(self.0.request, self.0.options)
6858 .await
6859 .map(gax::response::Response::into_body)
6860 }
6861
6862 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6864 self.0.request.host = v.into();
6865 self
6866 }
6867
6868 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6870 self.0.request.instance = v.into();
6871 self
6872 }
6873
6874 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6876 self.0.request.name = v.into();
6877 self
6878 }
6879
6880 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6882 self.0.request.project = v.into();
6883 self
6884 }
6885
6886 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
6888 where
6889 T: std::iter::IntoIterator<Item = V>,
6890 V: std::convert::Into<std::string::String>,
6891 {
6892 use std::iter::Iterator;
6893 self.0.request.database_roles = v.into_iter().map(|i| i.into()).collect();
6894 self
6895 }
6896
6897 pub fn set_body<T>(mut self, v: T) -> Self
6899 where
6900 T: std::convert::Into<crate::model::User>,
6901 {
6902 self.0.request.body = std::option::Option::Some(v.into());
6903 self
6904 }
6905
6906 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6908 where
6909 T: std::convert::Into<crate::model::User>,
6910 {
6911 self.0.request.body = v.map(|x| x.into());
6912 self
6913 }
6914 }
6915
6916 #[doc(hidden)]
6917 impl gax::options::internal::RequestBuilder for Update {
6918 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6919 &mut self.0.options
6920 }
6921 }
6922}