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)]
92 pub struct Delete(RequestBuilder<crate::model::SqlBackupRunsDeleteRequest>);
93
94 impl Delete {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 pub fn with_request<V: Into<crate::model::SqlBackupRunsDeleteRequest>>(
103 mut self,
104 v: V,
105 ) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<crate::model::Operation> {
118 (*self.0.stub)
119 .delete(self.0.request, self.0.options)
120 .await
121 .map(gax::response::Response::into_body)
122 }
123
124 pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
126 self.0.request.id = v.into();
127 self
128 }
129
130 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
132 self.0.request.instance = v.into();
133 self
134 }
135
136 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
138 self.0.request.project = v.into();
139 self
140 }
141 }
142
143 #[doc(hidden)]
144 impl gax::options::internal::RequestBuilder for Delete {
145 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
146 &mut self.0.options
147 }
148 }
149
150 #[derive(Clone, Debug)]
168 pub struct Get(RequestBuilder<crate::model::SqlBackupRunsGetRequest>);
169
170 impl Get {
171 pub(crate) fn new(
172 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
173 ) -> Self {
174 Self(RequestBuilder::new(stub))
175 }
176
177 pub fn with_request<V: Into<crate::model::SqlBackupRunsGetRequest>>(
179 mut self,
180 v: V,
181 ) -> Self {
182 self.0.request = v.into();
183 self
184 }
185
186 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
188 self.0.options = v.into();
189 self
190 }
191
192 pub async fn send(self) -> Result<crate::model::BackupRun> {
194 (*self.0.stub)
195 .get(self.0.request, self.0.options)
196 .await
197 .map(gax::response::Response::into_body)
198 }
199
200 pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
202 self.0.request.id = v.into();
203 self
204 }
205
206 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
208 self.0.request.instance = v.into();
209 self
210 }
211
212 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
214 self.0.request.project = v.into();
215 self
216 }
217 }
218
219 #[doc(hidden)]
220 impl gax::options::internal::RequestBuilder for Get {
221 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
222 &mut self.0.options
223 }
224 }
225
226 #[derive(Clone, Debug)]
244 pub struct Insert(RequestBuilder<crate::model::SqlBackupRunsInsertRequest>);
245
246 impl Insert {
247 pub(crate) fn new(
248 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
249 ) -> Self {
250 Self(RequestBuilder::new(stub))
251 }
252
253 pub fn with_request<V: Into<crate::model::SqlBackupRunsInsertRequest>>(
255 mut self,
256 v: V,
257 ) -> Self {
258 self.0.request = v.into();
259 self
260 }
261
262 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
264 self.0.options = v.into();
265 self
266 }
267
268 pub async fn send(self) -> Result<crate::model::Operation> {
270 (*self.0.stub)
271 .insert(self.0.request, self.0.options)
272 .await
273 .map(gax::response::Response::into_body)
274 }
275
276 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
278 self.0.request.instance = v.into();
279 self
280 }
281
282 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
284 self.0.request.project = v.into();
285 self
286 }
287
288 pub fn set_body<T>(mut self, v: T) -> Self
290 where
291 T: std::convert::Into<crate::model::BackupRun>,
292 {
293 self.0.request.body = std::option::Option::Some(v.into());
294 self
295 }
296
297 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
299 where
300 T: std::convert::Into<crate::model::BackupRun>,
301 {
302 self.0.request.body = v.map(|x| x.into());
303 self
304 }
305 }
306
307 #[doc(hidden)]
308 impl gax::options::internal::RequestBuilder for Insert {
309 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
310 &mut self.0.options
311 }
312 }
313
314 #[derive(Clone, Debug)]
336 pub struct List(RequestBuilder<crate::model::SqlBackupRunsListRequest>);
337
338 impl List {
339 pub(crate) fn new(
340 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
341 ) -> Self {
342 Self(RequestBuilder::new(stub))
343 }
344
345 pub fn with_request<V: Into<crate::model::SqlBackupRunsListRequest>>(
347 mut self,
348 v: V,
349 ) -> Self {
350 self.0.request = v.into();
351 self
352 }
353
354 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
356 self.0.options = v.into();
357 self
358 }
359
360 pub async fn send(self) -> Result<crate::model::BackupRunsListResponse> {
362 (*self.0.stub)
363 .list(self.0.request, self.0.options)
364 .await
365 .map(gax::response::Response::into_body)
366 }
367
368 pub fn by_page(
370 self,
371 ) -> impl gax::paginator::Paginator<crate::model::BackupRunsListResponse, gax::error::Error>
372 {
373 use std::clone::Clone;
374 let token = self.0.request.page_token.clone();
375 let execute = move |token: String| {
376 let mut builder = self.clone();
377 builder.0.request = builder.0.request.set_page_token(token);
378 builder.send()
379 };
380 gax::paginator::internal::new_paginator(token, execute)
381 }
382
383 pub fn by_item(
385 self,
386 ) -> impl gax::paginator::ItemPaginator<crate::model::BackupRunsListResponse, gax::error::Error>
387 {
388 use gax::paginator::Paginator;
389 self.by_page().items()
390 }
391
392 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
394 self.0.request.instance = v.into();
395 self
396 }
397
398 pub fn set_max_results<T: Into<i32>>(mut self, v: T) -> Self {
400 self.0.request.max_results = v.into();
401 self
402 }
403
404 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
406 self.0.request.page_token = v.into();
407 self
408 }
409
410 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
412 self.0.request.project = v.into();
413 self
414 }
415 }
416
417 #[doc(hidden)]
418 impl gax::options::internal::RequestBuilder for List {
419 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
420 &mut self.0.options
421 }
422 }
423}
424
425pub mod sql_connect_service {
426 use crate::Result;
427
428 pub type ClientBuilder =
442 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
443
444 pub(crate) mod client {
445 use super::super::super::client::SqlConnectService;
446 pub struct Factory;
447 impl gax::client_builder::internal::ClientFactory for Factory {
448 type Client = SqlConnectService;
449 type Credentials = gaxi::options::Credentials;
450 async fn build(
451 self,
452 config: gaxi::options::ClientConfig,
453 ) -> gax::client_builder::Result<Self::Client> {
454 Self::Client::new(config).await
455 }
456 }
457 }
458
459 #[derive(Clone, Debug)]
461 pub(crate) struct RequestBuilder<R: std::default::Default> {
462 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
463 request: R,
464 options: gax::options::RequestOptions,
465 }
466
467 impl<R> RequestBuilder<R>
468 where
469 R: std::default::Default,
470 {
471 pub(crate) fn new(
472 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
473 ) -> Self {
474 Self {
475 stub,
476 request: R::default(),
477 options: gax::options::RequestOptions::default(),
478 }
479 }
480 }
481
482 #[derive(Clone, Debug)]
500 pub struct GetConnectSettings(RequestBuilder<crate::model::GetConnectSettingsRequest>);
501
502 impl GetConnectSettings {
503 pub(crate) fn new(
504 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
505 ) -> Self {
506 Self(RequestBuilder::new(stub))
507 }
508
509 pub fn with_request<V: Into<crate::model::GetConnectSettingsRequest>>(
511 mut self,
512 v: V,
513 ) -> Self {
514 self.0.request = v.into();
515 self
516 }
517
518 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
520 self.0.options = v.into();
521 self
522 }
523
524 pub async fn send(self) -> Result<crate::model::ConnectSettings> {
526 (*self.0.stub)
527 .get_connect_settings(self.0.request, self.0.options)
528 .await
529 .map(gax::response::Response::into_body)
530 }
531
532 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
534 self.0.request.instance = v.into();
535 self
536 }
537
538 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
540 self.0.request.project = v.into();
541 self
542 }
543
544 pub fn set_read_time<T>(mut self, v: T) -> Self
546 where
547 T: std::convert::Into<wkt::Timestamp>,
548 {
549 self.0.request.read_time = std::option::Option::Some(v.into());
550 self
551 }
552
553 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
555 where
556 T: std::convert::Into<wkt::Timestamp>,
557 {
558 self.0.request.read_time = v.map(|x| x.into());
559 self
560 }
561 }
562
563 #[doc(hidden)]
564 impl gax::options::internal::RequestBuilder for GetConnectSettings {
565 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
566 &mut self.0.options
567 }
568 }
569
570 #[derive(Clone, Debug)]
588 pub struct GenerateEphemeralCert(RequestBuilder<crate::model::GenerateEphemeralCertRequest>);
589
590 impl GenerateEphemeralCert {
591 pub(crate) fn new(
592 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
593 ) -> Self {
594 Self(RequestBuilder::new(stub))
595 }
596
597 pub fn with_request<V: Into<crate::model::GenerateEphemeralCertRequest>>(
599 mut self,
600 v: V,
601 ) -> Self {
602 self.0.request = v.into();
603 self
604 }
605
606 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
608 self.0.options = v.into();
609 self
610 }
611
612 pub async fn send(self) -> Result<crate::model::GenerateEphemeralCertResponse> {
614 (*self.0.stub)
615 .generate_ephemeral_cert(self.0.request, self.0.options)
616 .await
617 .map(gax::response::Response::into_body)
618 }
619
620 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
622 self.0.request.instance = v.into();
623 self
624 }
625
626 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
628 self.0.request.project = v.into();
629 self
630 }
631
632 pub fn set_public_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
634 self.0.request.public_key = v.into();
635 self
636 }
637
638 pub fn set_access_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
640 self.0.request.access_token = v.into();
641 self
642 }
643
644 pub fn set_read_time<T>(mut self, v: T) -> Self
646 where
647 T: std::convert::Into<wkt::Timestamp>,
648 {
649 self.0.request.read_time = std::option::Option::Some(v.into());
650 self
651 }
652
653 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
655 where
656 T: std::convert::Into<wkt::Timestamp>,
657 {
658 self.0.request.read_time = v.map(|x| x.into());
659 self
660 }
661
662 pub fn set_valid_duration<T>(mut self, v: T) -> Self
664 where
665 T: std::convert::Into<wkt::Duration>,
666 {
667 self.0.request.valid_duration = std::option::Option::Some(v.into());
668 self
669 }
670
671 pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
673 where
674 T: std::convert::Into<wkt::Duration>,
675 {
676 self.0.request.valid_duration = v.map(|x| x.into());
677 self
678 }
679 }
680
681 #[doc(hidden)]
682 impl gax::options::internal::RequestBuilder for GenerateEphemeralCert {
683 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
684 &mut self.0.options
685 }
686 }
687}
688
689pub mod sql_databases_service {
690 use crate::Result;
691
692 pub type ClientBuilder =
706 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
707
708 pub(crate) mod client {
709 use super::super::super::client::SqlDatabasesService;
710 pub struct Factory;
711 impl gax::client_builder::internal::ClientFactory for Factory {
712 type Client = SqlDatabasesService;
713 type Credentials = gaxi::options::Credentials;
714 async fn build(
715 self,
716 config: gaxi::options::ClientConfig,
717 ) -> gax::client_builder::Result<Self::Client> {
718 Self::Client::new(config).await
719 }
720 }
721 }
722
723 #[derive(Clone, Debug)]
725 pub(crate) struct RequestBuilder<R: std::default::Default> {
726 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
727 request: R,
728 options: gax::options::RequestOptions,
729 }
730
731 impl<R> RequestBuilder<R>
732 where
733 R: std::default::Default,
734 {
735 pub(crate) fn new(
736 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
737 ) -> Self {
738 Self {
739 stub,
740 request: R::default(),
741 options: gax::options::RequestOptions::default(),
742 }
743 }
744 }
745
746 #[derive(Clone, Debug)]
764 pub struct Delete(RequestBuilder<crate::model::SqlDatabasesDeleteRequest>);
765
766 impl Delete {
767 pub(crate) fn new(
768 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
769 ) -> Self {
770 Self(RequestBuilder::new(stub))
771 }
772
773 pub fn with_request<V: Into<crate::model::SqlDatabasesDeleteRequest>>(
775 mut self,
776 v: V,
777 ) -> Self {
778 self.0.request = v.into();
779 self
780 }
781
782 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
784 self.0.options = v.into();
785 self
786 }
787
788 pub async fn send(self) -> Result<crate::model::Operation> {
790 (*self.0.stub)
791 .delete(self.0.request, self.0.options)
792 .await
793 .map(gax::response::Response::into_body)
794 }
795
796 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
798 self.0.request.database = v.into();
799 self
800 }
801
802 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
804 self.0.request.instance = v.into();
805 self
806 }
807
808 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
810 self.0.request.project = v.into();
811 self
812 }
813 }
814
815 #[doc(hidden)]
816 impl gax::options::internal::RequestBuilder for Delete {
817 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
818 &mut self.0.options
819 }
820 }
821
822 #[derive(Clone, Debug)]
840 pub struct Get(RequestBuilder<crate::model::SqlDatabasesGetRequest>);
841
842 impl Get {
843 pub(crate) fn new(
844 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
845 ) -> Self {
846 Self(RequestBuilder::new(stub))
847 }
848
849 pub fn with_request<V: Into<crate::model::SqlDatabasesGetRequest>>(mut self, v: V) -> Self {
851 self.0.request = v.into();
852 self
853 }
854
855 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
857 self.0.options = v.into();
858 self
859 }
860
861 pub async fn send(self) -> Result<crate::model::Database> {
863 (*self.0.stub)
864 .get(self.0.request, self.0.options)
865 .await
866 .map(gax::response::Response::into_body)
867 }
868
869 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
871 self.0.request.database = v.into();
872 self
873 }
874
875 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
877 self.0.request.instance = v.into();
878 self
879 }
880
881 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
883 self.0.request.project = v.into();
884 self
885 }
886 }
887
888 #[doc(hidden)]
889 impl gax::options::internal::RequestBuilder for Get {
890 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
891 &mut self.0.options
892 }
893 }
894
895 #[derive(Clone, Debug)]
913 pub struct Insert(RequestBuilder<crate::model::SqlDatabasesInsertRequest>);
914
915 impl Insert {
916 pub(crate) fn new(
917 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
918 ) -> Self {
919 Self(RequestBuilder::new(stub))
920 }
921
922 pub fn with_request<V: Into<crate::model::SqlDatabasesInsertRequest>>(
924 mut self,
925 v: V,
926 ) -> Self {
927 self.0.request = v.into();
928 self
929 }
930
931 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
933 self.0.options = v.into();
934 self
935 }
936
937 pub async fn send(self) -> Result<crate::model::Operation> {
939 (*self.0.stub)
940 .insert(self.0.request, self.0.options)
941 .await
942 .map(gax::response::Response::into_body)
943 }
944
945 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
947 self.0.request.instance = v.into();
948 self
949 }
950
951 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
953 self.0.request.project = v.into();
954 self
955 }
956
957 pub fn set_body<T>(mut self, v: T) -> Self
959 where
960 T: std::convert::Into<crate::model::Database>,
961 {
962 self.0.request.body = std::option::Option::Some(v.into());
963 self
964 }
965
966 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
968 where
969 T: std::convert::Into<crate::model::Database>,
970 {
971 self.0.request.body = v.map(|x| x.into());
972 self
973 }
974 }
975
976 #[doc(hidden)]
977 impl gax::options::internal::RequestBuilder for Insert {
978 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
979 &mut self.0.options
980 }
981 }
982
983 #[derive(Clone, Debug)]
1001 pub struct List(RequestBuilder<crate::model::SqlDatabasesListRequest>);
1002
1003 impl List {
1004 pub(crate) fn new(
1005 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1006 ) -> Self {
1007 Self(RequestBuilder::new(stub))
1008 }
1009
1010 pub fn with_request<V: Into<crate::model::SqlDatabasesListRequest>>(
1012 mut self,
1013 v: V,
1014 ) -> Self {
1015 self.0.request = v.into();
1016 self
1017 }
1018
1019 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1021 self.0.options = v.into();
1022 self
1023 }
1024
1025 pub async fn send(self) -> Result<crate::model::DatabasesListResponse> {
1027 (*self.0.stub)
1028 .list(self.0.request, self.0.options)
1029 .await
1030 .map(gax::response::Response::into_body)
1031 }
1032
1033 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1035 self.0.request.instance = v.into();
1036 self
1037 }
1038
1039 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1041 self.0.request.project = v.into();
1042 self
1043 }
1044 }
1045
1046 #[doc(hidden)]
1047 impl gax::options::internal::RequestBuilder for List {
1048 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1049 &mut self.0.options
1050 }
1051 }
1052
1053 #[derive(Clone, Debug)]
1071 pub struct Patch(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1072
1073 impl Patch {
1074 pub(crate) fn new(
1075 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1076 ) -> Self {
1077 Self(RequestBuilder::new(stub))
1078 }
1079
1080 pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1082 mut self,
1083 v: V,
1084 ) -> Self {
1085 self.0.request = v.into();
1086 self
1087 }
1088
1089 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1091 self.0.options = v.into();
1092 self
1093 }
1094
1095 pub async fn send(self) -> Result<crate::model::Operation> {
1097 (*self.0.stub)
1098 .patch(self.0.request, self.0.options)
1099 .await
1100 .map(gax::response::Response::into_body)
1101 }
1102
1103 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1105 self.0.request.database = v.into();
1106 self
1107 }
1108
1109 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1111 self.0.request.instance = v.into();
1112 self
1113 }
1114
1115 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1117 self.0.request.project = v.into();
1118 self
1119 }
1120
1121 pub fn set_body<T>(mut self, v: T) -> Self
1123 where
1124 T: std::convert::Into<crate::model::Database>,
1125 {
1126 self.0.request.body = std::option::Option::Some(v.into());
1127 self
1128 }
1129
1130 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1132 where
1133 T: std::convert::Into<crate::model::Database>,
1134 {
1135 self.0.request.body = v.map(|x| x.into());
1136 self
1137 }
1138 }
1139
1140 #[doc(hidden)]
1141 impl gax::options::internal::RequestBuilder for Patch {
1142 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1143 &mut self.0.options
1144 }
1145 }
1146
1147 #[derive(Clone, Debug)]
1165 pub struct Update(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1166
1167 impl Update {
1168 pub(crate) fn new(
1169 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1170 ) -> Self {
1171 Self(RequestBuilder::new(stub))
1172 }
1173
1174 pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1176 mut self,
1177 v: V,
1178 ) -> Self {
1179 self.0.request = v.into();
1180 self
1181 }
1182
1183 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1185 self.0.options = v.into();
1186 self
1187 }
1188
1189 pub async fn send(self) -> Result<crate::model::Operation> {
1191 (*self.0.stub)
1192 .update(self.0.request, self.0.options)
1193 .await
1194 .map(gax::response::Response::into_body)
1195 }
1196
1197 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1199 self.0.request.database = v.into();
1200 self
1201 }
1202
1203 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1205 self.0.request.instance = v.into();
1206 self
1207 }
1208
1209 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1211 self.0.request.project = v.into();
1212 self
1213 }
1214
1215 pub fn set_body<T>(mut self, v: T) -> Self
1217 where
1218 T: std::convert::Into<crate::model::Database>,
1219 {
1220 self.0.request.body = std::option::Option::Some(v.into());
1221 self
1222 }
1223
1224 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1226 where
1227 T: std::convert::Into<crate::model::Database>,
1228 {
1229 self.0.request.body = v.map(|x| x.into());
1230 self
1231 }
1232 }
1233
1234 #[doc(hidden)]
1235 impl gax::options::internal::RequestBuilder for Update {
1236 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1237 &mut self.0.options
1238 }
1239 }
1240}
1241
1242pub mod sql_flags_service {
1243 use crate::Result;
1244
1245 pub type ClientBuilder =
1259 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1260
1261 pub(crate) mod client {
1262 use super::super::super::client::SqlFlagsService;
1263 pub struct Factory;
1264 impl gax::client_builder::internal::ClientFactory for Factory {
1265 type Client = SqlFlagsService;
1266 type Credentials = gaxi::options::Credentials;
1267 async fn build(
1268 self,
1269 config: gaxi::options::ClientConfig,
1270 ) -> gax::client_builder::Result<Self::Client> {
1271 Self::Client::new(config).await
1272 }
1273 }
1274 }
1275
1276 #[derive(Clone, Debug)]
1278 pub(crate) struct RequestBuilder<R: std::default::Default> {
1279 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1280 request: R,
1281 options: gax::options::RequestOptions,
1282 }
1283
1284 impl<R> RequestBuilder<R>
1285 where
1286 R: std::default::Default,
1287 {
1288 pub(crate) fn new(
1289 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1290 ) -> Self {
1291 Self {
1292 stub,
1293 request: R::default(),
1294 options: gax::options::RequestOptions::default(),
1295 }
1296 }
1297 }
1298
1299 #[derive(Clone, Debug)]
1317 pub struct List(RequestBuilder<crate::model::SqlFlagsListRequest>);
1318
1319 impl List {
1320 pub(crate) fn new(
1321 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1322 ) -> Self {
1323 Self(RequestBuilder::new(stub))
1324 }
1325
1326 pub fn with_request<V: Into<crate::model::SqlFlagsListRequest>>(mut self, v: V) -> Self {
1328 self.0.request = v.into();
1329 self
1330 }
1331
1332 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1334 self.0.options = v.into();
1335 self
1336 }
1337
1338 pub async fn send(self) -> Result<crate::model::FlagsListResponse> {
1340 (*self.0.stub)
1341 .list(self.0.request, self.0.options)
1342 .await
1343 .map(gax::response::Response::into_body)
1344 }
1345
1346 pub fn set_database_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
1348 self.0.request.database_version = v.into();
1349 self
1350 }
1351 }
1352
1353 #[doc(hidden)]
1354 impl gax::options::internal::RequestBuilder for List {
1355 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1356 &mut self.0.options
1357 }
1358 }
1359}
1360
1361pub mod sql_instances_service {
1362 use crate::Result;
1363
1364 pub type ClientBuilder =
1378 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1379
1380 pub(crate) mod client {
1381 use super::super::super::client::SqlInstancesService;
1382 pub struct Factory;
1383 impl gax::client_builder::internal::ClientFactory for Factory {
1384 type Client = SqlInstancesService;
1385 type Credentials = gaxi::options::Credentials;
1386 async fn build(
1387 self,
1388 config: gaxi::options::ClientConfig,
1389 ) -> gax::client_builder::Result<Self::Client> {
1390 Self::Client::new(config).await
1391 }
1392 }
1393 }
1394
1395 #[derive(Clone, Debug)]
1397 pub(crate) struct RequestBuilder<R: std::default::Default> {
1398 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1399 request: R,
1400 options: gax::options::RequestOptions,
1401 }
1402
1403 impl<R> RequestBuilder<R>
1404 where
1405 R: std::default::Default,
1406 {
1407 pub(crate) fn new(
1408 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1409 ) -> Self {
1410 Self {
1411 stub,
1412 request: R::default(),
1413 options: gax::options::RequestOptions::default(),
1414 }
1415 }
1416 }
1417
1418 #[derive(Clone, Debug)]
1436 pub struct AddServerCa(RequestBuilder<crate::model::SqlInstancesAddServerCaRequest>);
1437
1438 impl AddServerCa {
1439 pub(crate) fn new(
1440 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1441 ) -> Self {
1442 Self(RequestBuilder::new(stub))
1443 }
1444
1445 pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCaRequest>>(
1447 mut self,
1448 v: V,
1449 ) -> Self {
1450 self.0.request = v.into();
1451 self
1452 }
1453
1454 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1456 self.0.options = v.into();
1457 self
1458 }
1459
1460 pub async fn send(self) -> Result<crate::model::Operation> {
1462 (*self.0.stub)
1463 .add_server_ca(self.0.request, self.0.options)
1464 .await
1465 .map(gax::response::Response::into_body)
1466 }
1467
1468 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1470 self.0.request.instance = v.into();
1471 self
1472 }
1473
1474 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1476 self.0.request.project = v.into();
1477 self
1478 }
1479 }
1480
1481 #[doc(hidden)]
1482 impl gax::options::internal::RequestBuilder for AddServerCa {
1483 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1484 &mut self.0.options
1485 }
1486 }
1487
1488 #[derive(Clone, Debug)]
1506 pub struct Clone(RequestBuilder<crate::model::SqlInstancesCloneRequest>);
1507
1508 impl Clone {
1509 pub(crate) fn new(
1510 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1511 ) -> Self {
1512 Self(RequestBuilder::new(stub))
1513 }
1514
1515 pub fn with_request<V: Into<crate::model::SqlInstancesCloneRequest>>(
1517 mut self,
1518 v: V,
1519 ) -> Self {
1520 self.0.request = v.into();
1521 self
1522 }
1523
1524 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1526 self.0.options = v.into();
1527 self
1528 }
1529
1530 pub async fn send(self) -> Result<crate::model::Operation> {
1532 (*self.0.stub)
1533 .clone(self.0.request, self.0.options)
1534 .await
1535 .map(gax::response::Response::into_body)
1536 }
1537
1538 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1540 self.0.request.instance = v.into();
1541 self
1542 }
1543
1544 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1546 self.0.request.project = v.into();
1547 self
1548 }
1549
1550 pub fn set_body<T>(mut self, v: T) -> Self
1552 where
1553 T: std::convert::Into<crate::model::InstancesCloneRequest>,
1554 {
1555 self.0.request.body = std::option::Option::Some(v.into());
1556 self
1557 }
1558
1559 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1561 where
1562 T: std::convert::Into<crate::model::InstancesCloneRequest>,
1563 {
1564 self.0.request.body = v.map(|x| x.into());
1565 self
1566 }
1567 }
1568
1569 #[doc(hidden)]
1570 impl gax::options::internal::RequestBuilder for Clone {
1571 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1572 &mut self.0.options
1573 }
1574 }
1575
1576 #[derive(Clone, Debug)]
1594 pub struct Delete(RequestBuilder<crate::model::SqlInstancesDeleteRequest>);
1595
1596 impl Delete {
1597 pub(crate) fn new(
1598 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1599 ) -> Self {
1600 Self(RequestBuilder::new(stub))
1601 }
1602
1603 pub fn with_request<V: Into<crate::model::SqlInstancesDeleteRequest>>(
1605 mut self,
1606 v: V,
1607 ) -> Self {
1608 self.0.request = v.into();
1609 self
1610 }
1611
1612 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1614 self.0.options = v.into();
1615 self
1616 }
1617
1618 pub async fn send(self) -> Result<crate::model::Operation> {
1620 (*self.0.stub)
1621 .delete(self.0.request, self.0.options)
1622 .await
1623 .map(gax::response::Response::into_body)
1624 }
1625
1626 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1628 self.0.request.instance = v.into();
1629 self
1630 }
1631
1632 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1634 self.0.request.project = v.into();
1635 self
1636 }
1637 }
1638
1639 #[doc(hidden)]
1640 impl gax::options::internal::RequestBuilder for Delete {
1641 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1642 &mut self.0.options
1643 }
1644 }
1645
1646 #[derive(Clone, Debug)]
1664 pub struct DemoteMaster(RequestBuilder<crate::model::SqlInstancesDemoteMasterRequest>);
1665
1666 impl DemoteMaster {
1667 pub(crate) fn new(
1668 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1669 ) -> Self {
1670 Self(RequestBuilder::new(stub))
1671 }
1672
1673 pub fn with_request<V: Into<crate::model::SqlInstancesDemoteMasterRequest>>(
1675 mut self,
1676 v: V,
1677 ) -> Self {
1678 self.0.request = v.into();
1679 self
1680 }
1681
1682 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1684 self.0.options = v.into();
1685 self
1686 }
1687
1688 pub async fn send(self) -> Result<crate::model::Operation> {
1690 (*self.0.stub)
1691 .demote_master(self.0.request, self.0.options)
1692 .await
1693 .map(gax::response::Response::into_body)
1694 }
1695
1696 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1698 self.0.request.instance = v.into();
1699 self
1700 }
1701
1702 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1704 self.0.request.project = v.into();
1705 self
1706 }
1707
1708 pub fn set_body<T>(mut self, v: T) -> Self
1710 where
1711 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
1712 {
1713 self.0.request.body = std::option::Option::Some(v.into());
1714 self
1715 }
1716
1717 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1719 where
1720 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
1721 {
1722 self.0.request.body = v.map(|x| x.into());
1723 self
1724 }
1725 }
1726
1727 #[doc(hidden)]
1728 impl gax::options::internal::RequestBuilder for DemoteMaster {
1729 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1730 &mut self.0.options
1731 }
1732 }
1733
1734 #[derive(Clone, Debug)]
1752 pub struct Demote(RequestBuilder<crate::model::SqlInstancesDemoteRequest>);
1753
1754 impl Demote {
1755 pub(crate) fn new(
1756 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1757 ) -> Self {
1758 Self(RequestBuilder::new(stub))
1759 }
1760
1761 pub fn with_request<V: Into<crate::model::SqlInstancesDemoteRequest>>(
1763 mut self,
1764 v: V,
1765 ) -> Self {
1766 self.0.request = v.into();
1767 self
1768 }
1769
1770 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1772 self.0.options = v.into();
1773 self
1774 }
1775
1776 pub async fn send(self) -> Result<crate::model::Operation> {
1778 (*self.0.stub)
1779 .demote(self.0.request, self.0.options)
1780 .await
1781 .map(gax::response::Response::into_body)
1782 }
1783
1784 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1788 self.0.request.instance = v.into();
1789 self
1790 }
1791
1792 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1796 self.0.request.project = v.into();
1797 self
1798 }
1799
1800 pub fn set_body<T>(mut self, v: T) -> Self
1804 where
1805 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
1806 {
1807 self.0.request.body = std::option::Option::Some(v.into());
1808 self
1809 }
1810
1811 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1815 where
1816 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
1817 {
1818 self.0.request.body = v.map(|x| x.into());
1819 self
1820 }
1821 }
1822
1823 #[doc(hidden)]
1824 impl gax::options::internal::RequestBuilder for Demote {
1825 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1826 &mut self.0.options
1827 }
1828 }
1829
1830 #[derive(Clone, Debug)]
1848 pub struct Export(RequestBuilder<crate::model::SqlInstancesExportRequest>);
1849
1850 impl Export {
1851 pub(crate) fn new(
1852 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1853 ) -> Self {
1854 Self(RequestBuilder::new(stub))
1855 }
1856
1857 pub fn with_request<V: Into<crate::model::SqlInstancesExportRequest>>(
1859 mut self,
1860 v: V,
1861 ) -> Self {
1862 self.0.request = v.into();
1863 self
1864 }
1865
1866 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1868 self.0.options = v.into();
1869 self
1870 }
1871
1872 pub async fn send(self) -> Result<crate::model::Operation> {
1874 (*self.0.stub)
1875 .export(self.0.request, self.0.options)
1876 .await
1877 .map(gax::response::Response::into_body)
1878 }
1879
1880 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1882 self.0.request.instance = v.into();
1883 self
1884 }
1885
1886 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1888 self.0.request.project = v.into();
1889 self
1890 }
1891
1892 pub fn set_body<T>(mut self, v: T) -> Self
1894 where
1895 T: std::convert::Into<crate::model::InstancesExportRequest>,
1896 {
1897 self.0.request.body = std::option::Option::Some(v.into());
1898 self
1899 }
1900
1901 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1903 where
1904 T: std::convert::Into<crate::model::InstancesExportRequest>,
1905 {
1906 self.0.request.body = v.map(|x| x.into());
1907 self
1908 }
1909 }
1910
1911 #[doc(hidden)]
1912 impl gax::options::internal::RequestBuilder for Export {
1913 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1914 &mut self.0.options
1915 }
1916 }
1917
1918 #[derive(Clone, Debug)]
1936 pub struct Failover(RequestBuilder<crate::model::SqlInstancesFailoverRequest>);
1937
1938 impl Failover {
1939 pub(crate) fn new(
1940 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1941 ) -> Self {
1942 Self(RequestBuilder::new(stub))
1943 }
1944
1945 pub fn with_request<V: Into<crate::model::SqlInstancesFailoverRequest>>(
1947 mut self,
1948 v: V,
1949 ) -> Self {
1950 self.0.request = v.into();
1951 self
1952 }
1953
1954 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1956 self.0.options = v.into();
1957 self
1958 }
1959
1960 pub async fn send(self) -> Result<crate::model::Operation> {
1962 (*self.0.stub)
1963 .failover(self.0.request, self.0.options)
1964 .await
1965 .map(gax::response::Response::into_body)
1966 }
1967
1968 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1970 self.0.request.instance = v.into();
1971 self
1972 }
1973
1974 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1976 self.0.request.project = v.into();
1977 self
1978 }
1979
1980 pub fn set_body<T>(mut self, v: T) -> Self
1982 where
1983 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
1984 {
1985 self.0.request.body = std::option::Option::Some(v.into());
1986 self
1987 }
1988
1989 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1991 where
1992 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
1993 {
1994 self.0.request.body = v.map(|x| x.into());
1995 self
1996 }
1997 }
1998
1999 #[doc(hidden)]
2000 impl gax::options::internal::RequestBuilder for Failover {
2001 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2002 &mut self.0.options
2003 }
2004 }
2005
2006 #[derive(Clone, Debug)]
2024 pub struct Reencrypt(RequestBuilder<crate::model::SqlInstancesReencryptRequest>);
2025
2026 impl Reencrypt {
2027 pub(crate) fn new(
2028 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2029 ) -> Self {
2030 Self(RequestBuilder::new(stub))
2031 }
2032
2033 pub fn with_request<V: Into<crate::model::SqlInstancesReencryptRequest>>(
2035 mut self,
2036 v: V,
2037 ) -> Self {
2038 self.0.request = v.into();
2039 self
2040 }
2041
2042 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2044 self.0.options = v.into();
2045 self
2046 }
2047
2048 pub async fn send(self) -> Result<crate::model::Operation> {
2050 (*self.0.stub)
2051 .reencrypt(self.0.request, self.0.options)
2052 .await
2053 .map(gax::response::Response::into_body)
2054 }
2055
2056 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2058 self.0.request.instance = v.into();
2059 self
2060 }
2061
2062 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2064 self.0.request.project = v.into();
2065 self
2066 }
2067
2068 pub fn set_body<T>(mut self, v: T) -> Self
2070 where
2071 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2072 {
2073 self.0.request.body = std::option::Option::Some(v.into());
2074 self
2075 }
2076
2077 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2079 where
2080 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2081 {
2082 self.0.request.body = v.map(|x| x.into());
2083 self
2084 }
2085 }
2086
2087 #[doc(hidden)]
2088 impl gax::options::internal::RequestBuilder for Reencrypt {
2089 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2090 &mut self.0.options
2091 }
2092 }
2093
2094 #[derive(Clone, Debug)]
2112 pub struct Get(RequestBuilder<crate::model::SqlInstancesGetRequest>);
2113
2114 impl Get {
2115 pub(crate) fn new(
2116 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2117 ) -> Self {
2118 Self(RequestBuilder::new(stub))
2119 }
2120
2121 pub fn with_request<V: Into<crate::model::SqlInstancesGetRequest>>(mut self, v: V) -> Self {
2123 self.0.request = v.into();
2124 self
2125 }
2126
2127 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2129 self.0.options = v.into();
2130 self
2131 }
2132
2133 pub async fn send(self) -> Result<crate::model::DatabaseInstance> {
2135 (*self.0.stub)
2136 .get(self.0.request, self.0.options)
2137 .await
2138 .map(gax::response::Response::into_body)
2139 }
2140
2141 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2143 self.0.request.instance = v.into();
2144 self
2145 }
2146
2147 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2149 self.0.request.project = v.into();
2150 self
2151 }
2152 }
2153
2154 #[doc(hidden)]
2155 impl gax::options::internal::RequestBuilder for Get {
2156 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2157 &mut self.0.options
2158 }
2159 }
2160
2161 #[derive(Clone, Debug)]
2179 pub struct Import(RequestBuilder<crate::model::SqlInstancesImportRequest>);
2180
2181 impl Import {
2182 pub(crate) fn new(
2183 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2184 ) -> Self {
2185 Self(RequestBuilder::new(stub))
2186 }
2187
2188 pub fn with_request<V: Into<crate::model::SqlInstancesImportRequest>>(
2190 mut self,
2191 v: V,
2192 ) -> Self {
2193 self.0.request = v.into();
2194 self
2195 }
2196
2197 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2199 self.0.options = v.into();
2200 self
2201 }
2202
2203 pub async fn send(self) -> Result<crate::model::Operation> {
2205 (*self.0.stub)
2206 .import(self.0.request, self.0.options)
2207 .await
2208 .map(gax::response::Response::into_body)
2209 }
2210
2211 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2213 self.0.request.instance = v.into();
2214 self
2215 }
2216
2217 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2219 self.0.request.project = v.into();
2220 self
2221 }
2222
2223 pub fn set_body<T>(mut self, v: T) -> Self
2225 where
2226 T: std::convert::Into<crate::model::InstancesImportRequest>,
2227 {
2228 self.0.request.body = std::option::Option::Some(v.into());
2229 self
2230 }
2231
2232 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2234 where
2235 T: std::convert::Into<crate::model::InstancesImportRequest>,
2236 {
2237 self.0.request.body = v.map(|x| x.into());
2238 self
2239 }
2240 }
2241
2242 #[doc(hidden)]
2243 impl gax::options::internal::RequestBuilder for Import {
2244 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2245 &mut self.0.options
2246 }
2247 }
2248
2249 #[derive(Clone, Debug)]
2267 pub struct Insert(RequestBuilder<crate::model::SqlInstancesInsertRequest>);
2268
2269 impl Insert {
2270 pub(crate) fn new(
2271 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2272 ) -> Self {
2273 Self(RequestBuilder::new(stub))
2274 }
2275
2276 pub fn with_request<V: Into<crate::model::SqlInstancesInsertRequest>>(
2278 mut self,
2279 v: V,
2280 ) -> Self {
2281 self.0.request = v.into();
2282 self
2283 }
2284
2285 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2287 self.0.options = v.into();
2288 self
2289 }
2290
2291 pub async fn send(self) -> Result<crate::model::Operation> {
2293 (*self.0.stub)
2294 .insert(self.0.request, self.0.options)
2295 .await
2296 .map(gax::response::Response::into_body)
2297 }
2298
2299 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2301 self.0.request.project = v.into();
2302 self
2303 }
2304
2305 pub fn set_body<T>(mut self, v: T) -> Self
2307 where
2308 T: std::convert::Into<crate::model::DatabaseInstance>,
2309 {
2310 self.0.request.body = std::option::Option::Some(v.into());
2311 self
2312 }
2313
2314 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2316 where
2317 T: std::convert::Into<crate::model::DatabaseInstance>,
2318 {
2319 self.0.request.body = v.map(|x| x.into());
2320 self
2321 }
2322 }
2323
2324 #[doc(hidden)]
2325 impl gax::options::internal::RequestBuilder for Insert {
2326 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2327 &mut self.0.options
2328 }
2329 }
2330
2331 #[derive(Clone, Debug)]
2353 pub struct List(RequestBuilder<crate::model::SqlInstancesListRequest>);
2354
2355 impl List {
2356 pub(crate) fn new(
2357 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2358 ) -> Self {
2359 Self(RequestBuilder::new(stub))
2360 }
2361
2362 pub fn with_request<V: Into<crate::model::SqlInstancesListRequest>>(
2364 mut self,
2365 v: V,
2366 ) -> Self {
2367 self.0.request = v.into();
2368 self
2369 }
2370
2371 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2373 self.0.options = v.into();
2374 self
2375 }
2376
2377 pub async fn send(self) -> Result<crate::model::InstancesListResponse> {
2379 (*self.0.stub)
2380 .list(self.0.request, self.0.options)
2381 .await
2382 .map(gax::response::Response::into_body)
2383 }
2384
2385 pub fn by_page(
2387 self,
2388 ) -> impl gax::paginator::Paginator<crate::model::InstancesListResponse, gax::error::Error>
2389 {
2390 use std::clone::Clone;
2391 let token = self.0.request.page_token.clone();
2392 let execute = move |token: String| {
2393 let mut builder = self.clone();
2394 builder.0.request = builder.0.request.set_page_token(token);
2395 builder.send()
2396 };
2397 gax::paginator::internal::new_paginator(token, execute)
2398 }
2399
2400 pub fn by_item(
2402 self,
2403 ) -> impl gax::paginator::ItemPaginator<crate::model::InstancesListResponse, gax::error::Error>
2404 {
2405 use gax::paginator::Paginator;
2406 self.by_page().items()
2407 }
2408
2409 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2411 self.0.request.filter = v.into();
2412 self
2413 }
2414
2415 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
2417 self.0.request.max_results = v.into();
2418 self
2419 }
2420
2421 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2423 self.0.request.page_token = v.into();
2424 self
2425 }
2426
2427 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2429 self.0.request.project = v.into();
2430 self
2431 }
2432 }
2433
2434 #[doc(hidden)]
2435 impl gax::options::internal::RequestBuilder for List {
2436 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2437 &mut self.0.options
2438 }
2439 }
2440
2441 #[derive(Clone, Debug)]
2459 pub struct ListServerCas(RequestBuilder<crate::model::SqlInstancesListServerCasRequest>);
2460
2461 impl ListServerCas {
2462 pub(crate) fn new(
2463 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2464 ) -> Self {
2465 Self(RequestBuilder::new(stub))
2466 }
2467
2468 pub fn with_request<V: Into<crate::model::SqlInstancesListServerCasRequest>>(
2470 mut self,
2471 v: V,
2472 ) -> Self {
2473 self.0.request = v.into();
2474 self
2475 }
2476
2477 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2479 self.0.options = v.into();
2480 self
2481 }
2482
2483 pub async fn send(self) -> Result<crate::model::InstancesListServerCasResponse> {
2485 (*self.0.stub)
2486 .list_server_cas(self.0.request, self.0.options)
2487 .await
2488 .map(gax::response::Response::into_body)
2489 }
2490
2491 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2493 self.0.request.instance = v.into();
2494 self
2495 }
2496
2497 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2499 self.0.request.project = v.into();
2500 self
2501 }
2502 }
2503
2504 #[doc(hidden)]
2505 impl gax::options::internal::RequestBuilder for ListServerCas {
2506 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2507 &mut self.0.options
2508 }
2509 }
2510
2511 #[derive(Clone, Debug)]
2529 pub struct Patch(RequestBuilder<crate::model::SqlInstancesPatchRequest>);
2530
2531 impl Patch {
2532 pub(crate) fn new(
2533 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2534 ) -> Self {
2535 Self(RequestBuilder::new(stub))
2536 }
2537
2538 pub fn with_request<V: Into<crate::model::SqlInstancesPatchRequest>>(
2540 mut self,
2541 v: V,
2542 ) -> Self {
2543 self.0.request = v.into();
2544 self
2545 }
2546
2547 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2549 self.0.options = v.into();
2550 self
2551 }
2552
2553 pub async fn send(self) -> Result<crate::model::Operation> {
2555 (*self.0.stub)
2556 .patch(self.0.request, self.0.options)
2557 .await
2558 .map(gax::response::Response::into_body)
2559 }
2560
2561 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2563 self.0.request.instance = v.into();
2564 self
2565 }
2566
2567 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2569 self.0.request.project = v.into();
2570 self
2571 }
2572
2573 pub fn set_body<T>(mut self, v: T) -> Self
2575 where
2576 T: std::convert::Into<crate::model::DatabaseInstance>,
2577 {
2578 self.0.request.body = std::option::Option::Some(v.into());
2579 self
2580 }
2581
2582 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2584 where
2585 T: std::convert::Into<crate::model::DatabaseInstance>,
2586 {
2587 self.0.request.body = v.map(|x| x.into());
2588 self
2589 }
2590 }
2591
2592 #[doc(hidden)]
2593 impl gax::options::internal::RequestBuilder for Patch {
2594 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2595 &mut self.0.options
2596 }
2597 }
2598
2599 #[derive(Clone, Debug)]
2617 pub struct PromoteReplica(RequestBuilder<crate::model::SqlInstancesPromoteReplicaRequest>);
2618
2619 impl PromoteReplica {
2620 pub(crate) fn new(
2621 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2622 ) -> Self {
2623 Self(RequestBuilder::new(stub))
2624 }
2625
2626 pub fn with_request<V: Into<crate::model::SqlInstancesPromoteReplicaRequest>>(
2628 mut self,
2629 v: V,
2630 ) -> Self {
2631 self.0.request = v.into();
2632 self
2633 }
2634
2635 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2637 self.0.options = v.into();
2638 self
2639 }
2640
2641 pub async fn send(self) -> Result<crate::model::Operation> {
2643 (*self.0.stub)
2644 .promote_replica(self.0.request, self.0.options)
2645 .await
2646 .map(gax::response::Response::into_body)
2647 }
2648
2649 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2651 self.0.request.instance = v.into();
2652 self
2653 }
2654
2655 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2657 self.0.request.project = v.into();
2658 self
2659 }
2660
2661 pub fn set_failover<T: Into<bool>>(mut self, v: T) -> Self {
2663 self.0.request.failover = v.into();
2664 self
2665 }
2666 }
2667
2668 #[doc(hidden)]
2669 impl gax::options::internal::RequestBuilder for PromoteReplica {
2670 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2671 &mut self.0.options
2672 }
2673 }
2674
2675 #[derive(Clone, Debug)]
2693 pub struct Switchover(RequestBuilder<crate::model::SqlInstancesSwitchoverRequest>);
2694
2695 impl Switchover {
2696 pub(crate) fn new(
2697 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2698 ) -> Self {
2699 Self(RequestBuilder::new(stub))
2700 }
2701
2702 pub fn with_request<V: Into<crate::model::SqlInstancesSwitchoverRequest>>(
2704 mut self,
2705 v: V,
2706 ) -> Self {
2707 self.0.request = v.into();
2708 self
2709 }
2710
2711 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2713 self.0.options = v.into();
2714 self
2715 }
2716
2717 pub async fn send(self) -> Result<crate::model::Operation> {
2719 (*self.0.stub)
2720 .switchover(self.0.request, self.0.options)
2721 .await
2722 .map(gax::response::Response::into_body)
2723 }
2724
2725 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2727 self.0.request.instance = v.into();
2728 self
2729 }
2730
2731 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2733 self.0.request.project = v.into();
2734 self
2735 }
2736
2737 pub fn set_db_timeout<T>(mut self, v: T) -> Self
2739 where
2740 T: std::convert::Into<wkt::Duration>,
2741 {
2742 self.0.request.db_timeout = std::option::Option::Some(v.into());
2743 self
2744 }
2745
2746 pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
2748 where
2749 T: std::convert::Into<wkt::Duration>,
2750 {
2751 self.0.request.db_timeout = v.map(|x| x.into());
2752 self
2753 }
2754 }
2755
2756 #[doc(hidden)]
2757 impl gax::options::internal::RequestBuilder for Switchover {
2758 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2759 &mut self.0.options
2760 }
2761 }
2762
2763 #[derive(Clone, Debug)]
2781 pub struct ResetSslConfig(RequestBuilder<crate::model::SqlInstancesResetSslConfigRequest>);
2782
2783 impl ResetSslConfig {
2784 pub(crate) fn new(
2785 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2786 ) -> Self {
2787 Self(RequestBuilder::new(stub))
2788 }
2789
2790 pub fn with_request<V: Into<crate::model::SqlInstancesResetSslConfigRequest>>(
2792 mut self,
2793 v: V,
2794 ) -> Self {
2795 self.0.request = v.into();
2796 self
2797 }
2798
2799 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2801 self.0.options = v.into();
2802 self
2803 }
2804
2805 pub async fn send(self) -> Result<crate::model::Operation> {
2807 (*self.0.stub)
2808 .reset_ssl_config(self.0.request, self.0.options)
2809 .await
2810 .map(gax::response::Response::into_body)
2811 }
2812
2813 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2815 self.0.request.instance = v.into();
2816 self
2817 }
2818
2819 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2821 self.0.request.project = v.into();
2822 self
2823 }
2824 }
2825
2826 #[doc(hidden)]
2827 impl gax::options::internal::RequestBuilder for ResetSslConfig {
2828 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2829 &mut self.0.options
2830 }
2831 }
2832
2833 #[derive(Clone, Debug)]
2851 pub struct Restart(RequestBuilder<crate::model::SqlInstancesRestartRequest>);
2852
2853 impl Restart {
2854 pub(crate) fn new(
2855 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2856 ) -> Self {
2857 Self(RequestBuilder::new(stub))
2858 }
2859
2860 pub fn with_request<V: Into<crate::model::SqlInstancesRestartRequest>>(
2862 mut self,
2863 v: V,
2864 ) -> Self {
2865 self.0.request = v.into();
2866 self
2867 }
2868
2869 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2871 self.0.options = v.into();
2872 self
2873 }
2874
2875 pub async fn send(self) -> Result<crate::model::Operation> {
2877 (*self.0.stub)
2878 .restart(self.0.request, self.0.options)
2879 .await
2880 .map(gax::response::Response::into_body)
2881 }
2882
2883 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2885 self.0.request.instance = v.into();
2886 self
2887 }
2888
2889 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2891 self.0.request.project = v.into();
2892 self
2893 }
2894 }
2895
2896 #[doc(hidden)]
2897 impl gax::options::internal::RequestBuilder for Restart {
2898 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2899 &mut self.0.options
2900 }
2901 }
2902
2903 #[derive(Clone, Debug)]
2921 pub struct RestoreBackup(RequestBuilder<crate::model::SqlInstancesRestoreBackupRequest>);
2922
2923 impl RestoreBackup {
2924 pub(crate) fn new(
2925 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2926 ) -> Self {
2927 Self(RequestBuilder::new(stub))
2928 }
2929
2930 pub fn with_request<V: Into<crate::model::SqlInstancesRestoreBackupRequest>>(
2932 mut self,
2933 v: V,
2934 ) -> Self {
2935 self.0.request = v.into();
2936 self
2937 }
2938
2939 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2941 self.0.options = v.into();
2942 self
2943 }
2944
2945 pub async fn send(self) -> Result<crate::model::Operation> {
2947 (*self.0.stub)
2948 .restore_backup(self.0.request, self.0.options)
2949 .await
2950 .map(gax::response::Response::into_body)
2951 }
2952
2953 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2955 self.0.request.instance = v.into();
2956 self
2957 }
2958
2959 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2961 self.0.request.project = v.into();
2962 self
2963 }
2964
2965 pub fn set_body<T>(mut self, v: T) -> Self
2967 where
2968 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
2969 {
2970 self.0.request.body = std::option::Option::Some(v.into());
2971 self
2972 }
2973
2974 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2976 where
2977 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
2978 {
2979 self.0.request.body = v.map(|x| x.into());
2980 self
2981 }
2982 }
2983
2984 #[doc(hidden)]
2985 impl gax::options::internal::RequestBuilder for RestoreBackup {
2986 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2987 &mut self.0.options
2988 }
2989 }
2990
2991 #[derive(Clone, Debug)]
3009 pub struct RotateServerCa(RequestBuilder<crate::model::SqlInstancesRotateServerCaRequest>);
3010
3011 impl RotateServerCa {
3012 pub(crate) fn new(
3013 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3014 ) -> Self {
3015 Self(RequestBuilder::new(stub))
3016 }
3017
3018 pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCaRequest>>(
3020 mut self,
3021 v: V,
3022 ) -> Self {
3023 self.0.request = v.into();
3024 self
3025 }
3026
3027 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3029 self.0.options = v.into();
3030 self
3031 }
3032
3033 pub async fn send(self) -> Result<crate::model::Operation> {
3035 (*self.0.stub)
3036 .rotate_server_ca(self.0.request, self.0.options)
3037 .await
3038 .map(gax::response::Response::into_body)
3039 }
3040
3041 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3043 self.0.request.instance = v.into();
3044 self
3045 }
3046
3047 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3049 self.0.request.project = v.into();
3050 self
3051 }
3052
3053 pub fn set_body<T>(mut self, v: T) -> Self
3055 where
3056 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
3057 {
3058 self.0.request.body = std::option::Option::Some(v.into());
3059 self
3060 }
3061
3062 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3064 where
3065 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
3066 {
3067 self.0.request.body = v.map(|x| x.into());
3068 self
3069 }
3070 }
3071
3072 #[doc(hidden)]
3073 impl gax::options::internal::RequestBuilder for RotateServerCa {
3074 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3075 &mut self.0.options
3076 }
3077 }
3078
3079 #[derive(Clone, Debug)]
3097 pub struct StartReplica(RequestBuilder<crate::model::SqlInstancesStartReplicaRequest>);
3098
3099 impl StartReplica {
3100 pub(crate) fn new(
3101 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3102 ) -> Self {
3103 Self(RequestBuilder::new(stub))
3104 }
3105
3106 pub fn with_request<V: Into<crate::model::SqlInstancesStartReplicaRequest>>(
3108 mut self,
3109 v: V,
3110 ) -> Self {
3111 self.0.request = v.into();
3112 self
3113 }
3114
3115 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3117 self.0.options = v.into();
3118 self
3119 }
3120
3121 pub async fn send(self) -> Result<crate::model::Operation> {
3123 (*self.0.stub)
3124 .start_replica(self.0.request, self.0.options)
3125 .await
3126 .map(gax::response::Response::into_body)
3127 }
3128
3129 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3131 self.0.request.instance = v.into();
3132 self
3133 }
3134
3135 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3137 self.0.request.project = v.into();
3138 self
3139 }
3140 }
3141
3142 #[doc(hidden)]
3143 impl gax::options::internal::RequestBuilder for StartReplica {
3144 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3145 &mut self.0.options
3146 }
3147 }
3148
3149 #[derive(Clone, Debug)]
3167 pub struct StopReplica(RequestBuilder<crate::model::SqlInstancesStopReplicaRequest>);
3168
3169 impl StopReplica {
3170 pub(crate) fn new(
3171 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3172 ) -> Self {
3173 Self(RequestBuilder::new(stub))
3174 }
3175
3176 pub fn with_request<V: Into<crate::model::SqlInstancesStopReplicaRequest>>(
3178 mut self,
3179 v: V,
3180 ) -> Self {
3181 self.0.request = v.into();
3182 self
3183 }
3184
3185 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3187 self.0.options = v.into();
3188 self
3189 }
3190
3191 pub async fn send(self) -> Result<crate::model::Operation> {
3193 (*self.0.stub)
3194 .stop_replica(self.0.request, self.0.options)
3195 .await
3196 .map(gax::response::Response::into_body)
3197 }
3198
3199 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3201 self.0.request.instance = v.into();
3202 self
3203 }
3204
3205 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3207 self.0.request.project = v.into();
3208 self
3209 }
3210 }
3211
3212 #[doc(hidden)]
3213 impl gax::options::internal::RequestBuilder for StopReplica {
3214 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3215 &mut self.0.options
3216 }
3217 }
3218
3219 #[derive(Clone, Debug)]
3237 pub struct TruncateLog(RequestBuilder<crate::model::SqlInstancesTruncateLogRequest>);
3238
3239 impl TruncateLog {
3240 pub(crate) fn new(
3241 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3242 ) -> Self {
3243 Self(RequestBuilder::new(stub))
3244 }
3245
3246 pub fn with_request<V: Into<crate::model::SqlInstancesTruncateLogRequest>>(
3248 mut self,
3249 v: V,
3250 ) -> Self {
3251 self.0.request = v.into();
3252 self
3253 }
3254
3255 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3257 self.0.options = v.into();
3258 self
3259 }
3260
3261 pub async fn send(self) -> Result<crate::model::Operation> {
3263 (*self.0.stub)
3264 .truncate_log(self.0.request, self.0.options)
3265 .await
3266 .map(gax::response::Response::into_body)
3267 }
3268
3269 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3271 self.0.request.instance = v.into();
3272 self
3273 }
3274
3275 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3277 self.0.request.project = v.into();
3278 self
3279 }
3280
3281 pub fn set_body<T>(mut self, v: T) -> Self
3283 where
3284 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
3285 {
3286 self.0.request.body = std::option::Option::Some(v.into());
3287 self
3288 }
3289
3290 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3292 where
3293 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
3294 {
3295 self.0.request.body = v.map(|x| x.into());
3296 self
3297 }
3298 }
3299
3300 #[doc(hidden)]
3301 impl gax::options::internal::RequestBuilder for TruncateLog {
3302 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3303 &mut self.0.options
3304 }
3305 }
3306
3307 #[derive(Clone, Debug)]
3325 pub struct Update(RequestBuilder<crate::model::SqlInstancesUpdateRequest>);
3326
3327 impl Update {
3328 pub(crate) fn new(
3329 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3330 ) -> Self {
3331 Self(RequestBuilder::new(stub))
3332 }
3333
3334 pub fn with_request<V: Into<crate::model::SqlInstancesUpdateRequest>>(
3336 mut self,
3337 v: V,
3338 ) -> Self {
3339 self.0.request = v.into();
3340 self
3341 }
3342
3343 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3345 self.0.options = v.into();
3346 self
3347 }
3348
3349 pub async fn send(self) -> Result<crate::model::Operation> {
3351 (*self.0.stub)
3352 .update(self.0.request, self.0.options)
3353 .await
3354 .map(gax::response::Response::into_body)
3355 }
3356
3357 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3359 self.0.request.instance = v.into();
3360 self
3361 }
3362
3363 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3365 self.0.request.project = v.into();
3366 self
3367 }
3368
3369 pub fn set_body<T>(mut self, v: T) -> Self
3371 where
3372 T: std::convert::Into<crate::model::DatabaseInstance>,
3373 {
3374 self.0.request.body = std::option::Option::Some(v.into());
3375 self
3376 }
3377
3378 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3380 where
3381 T: std::convert::Into<crate::model::DatabaseInstance>,
3382 {
3383 self.0.request.body = v.map(|x| x.into());
3384 self
3385 }
3386 }
3387
3388 #[doc(hidden)]
3389 impl gax::options::internal::RequestBuilder for Update {
3390 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3391 &mut self.0.options
3392 }
3393 }
3394
3395 #[derive(Clone, Debug)]
3413 pub struct CreateEphemeral(
3414 RequestBuilder<crate::model::SqlInstancesCreateEphemeralCertRequest>,
3415 );
3416
3417 impl CreateEphemeral {
3418 pub(crate) fn new(
3419 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3420 ) -> Self {
3421 Self(RequestBuilder::new(stub))
3422 }
3423
3424 pub fn with_request<V: Into<crate::model::SqlInstancesCreateEphemeralCertRequest>>(
3426 mut self,
3427 v: V,
3428 ) -> Self {
3429 self.0.request = v.into();
3430 self
3431 }
3432
3433 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3435 self.0.options = v.into();
3436 self
3437 }
3438
3439 pub async fn send(self) -> Result<crate::model::SslCert> {
3441 (*self.0.stub)
3442 .create_ephemeral(self.0.request, self.0.options)
3443 .await
3444 .map(gax::response::Response::into_body)
3445 }
3446
3447 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3449 self.0.request.instance = v.into();
3450 self
3451 }
3452
3453 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3455 self.0.request.project = v.into();
3456 self
3457 }
3458
3459 pub fn set_body<T>(mut self, v: T) -> Self
3461 where
3462 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
3463 {
3464 self.0.request.body = std::option::Option::Some(v.into());
3465 self
3466 }
3467
3468 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3470 where
3471 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
3472 {
3473 self.0.request.body = v.map(|x| x.into());
3474 self
3475 }
3476 }
3477
3478 #[doc(hidden)]
3479 impl gax::options::internal::RequestBuilder for CreateEphemeral {
3480 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3481 &mut self.0.options
3482 }
3483 }
3484
3485 #[derive(Clone, Debug)]
3503 pub struct RescheduleMaintenance(
3504 RequestBuilder<crate::model::SqlInstancesRescheduleMaintenanceRequest>,
3505 );
3506
3507 impl RescheduleMaintenance {
3508 pub(crate) fn new(
3509 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3510 ) -> Self {
3511 Self(RequestBuilder::new(stub))
3512 }
3513
3514 pub fn with_request<V: Into<crate::model::SqlInstancesRescheduleMaintenanceRequest>>(
3516 mut self,
3517 v: V,
3518 ) -> Self {
3519 self.0.request = v.into();
3520 self
3521 }
3522
3523 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3525 self.0.options = v.into();
3526 self
3527 }
3528
3529 pub async fn send(self) -> Result<crate::model::Operation> {
3531 (*self.0.stub)
3532 .reschedule_maintenance(self.0.request, self.0.options)
3533 .await
3534 .map(gax::response::Response::into_body)
3535 }
3536
3537 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3539 self.0.request.instance = v.into();
3540 self
3541 }
3542
3543 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3545 self.0.request.project = v.into();
3546 self
3547 }
3548
3549 pub fn set_body<T>(mut self, v: T) -> Self
3551 where
3552 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
3553 {
3554 self.0.request.body = std::option::Option::Some(v.into());
3555 self
3556 }
3557
3558 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3560 where
3561 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
3562 {
3563 self.0.request.body = v.map(|x| x.into());
3564 self
3565 }
3566 }
3567
3568 #[doc(hidden)]
3569 impl gax::options::internal::RequestBuilder for RescheduleMaintenance {
3570 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3571 &mut self.0.options
3572 }
3573 }
3574
3575 #[derive(Clone, Debug)]
3593 pub struct VerifyExternalSyncSettings(
3594 RequestBuilder<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
3595 );
3596
3597 impl VerifyExternalSyncSettings {
3598 pub(crate) fn new(
3599 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3600 ) -> Self {
3601 Self(RequestBuilder::new(stub))
3602 }
3603
3604 pub fn with_request<
3606 V: Into<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
3607 >(
3608 mut self,
3609 v: V,
3610 ) -> Self {
3611 self.0.request = v.into();
3612 self
3613 }
3614
3615 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3617 self.0.options = v.into();
3618 self
3619 }
3620
3621 pub async fn send(
3623 self,
3624 ) -> Result<crate::model::SqlInstancesVerifyExternalSyncSettingsResponse> {
3625 (*self.0.stub)
3626 .verify_external_sync_settings(self.0.request, self.0.options)
3627 .await
3628 .map(gax::response::Response::into_body)
3629 }
3630
3631 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3633 self.0.request.instance = v.into();
3634 self
3635 }
3636
3637 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3639 self.0.request.project = v.into();
3640 self
3641 }
3642
3643 pub fn set_verify_connection_only<T: Into<bool>>(mut self, v: T) -> Self {
3645 self.0.request.verify_connection_only = v.into();
3646 self
3647 }
3648
3649 pub fn set_sync_mode<
3651 T: Into<
3652 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3653 >,
3654 >(
3655 mut self,
3656 v: T,
3657 ) -> Self {
3658 self.0.request.sync_mode = v.into();
3659 self
3660 }
3661
3662 pub fn set_verify_replication_only<T: Into<bool>>(mut self, v: T) -> Self {
3664 self.0.request.verify_replication_only = v.into();
3665 self
3666 }
3667
3668 pub fn set_migration_type<
3670 T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
3671 >(
3672 mut self,
3673 v: T,
3674 ) -> Self {
3675 self.0.request.migration_type = v.into();
3676 self
3677 }
3678
3679 pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
3681 mut self,
3682 v: T,
3683 ) -> Self {
3684 self.0.request.sync_parallel_level = v.into();
3685 self
3686 }
3687
3688 pub fn set_sync_config<
3693 T: Into<
3694 Option<
3695 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
3696 >,
3697 >,
3698 >(
3699 mut self,
3700 v: T,
3701 ) -> Self {
3702 self.0.request.sync_config = v.into();
3703 self
3704 }
3705
3706 pub fn set_mysql_sync_config<
3712 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
3713 >(
3714 mut self,
3715 v: T,
3716 ) -> Self {
3717 self.0.request = self.0.request.set_mysql_sync_config(v);
3718 self
3719 }
3720 }
3721
3722 #[doc(hidden)]
3723 impl gax::options::internal::RequestBuilder for VerifyExternalSyncSettings {
3724 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3725 &mut self.0.options
3726 }
3727 }
3728
3729 #[derive(Clone, Debug)]
3747 pub struct StartExternalSync(
3748 RequestBuilder<crate::model::SqlInstancesStartExternalSyncRequest>,
3749 );
3750
3751 impl StartExternalSync {
3752 pub(crate) fn new(
3753 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3754 ) -> Self {
3755 Self(RequestBuilder::new(stub))
3756 }
3757
3758 pub fn with_request<V: Into<crate::model::SqlInstancesStartExternalSyncRequest>>(
3760 mut self,
3761 v: V,
3762 ) -> Self {
3763 self.0.request = v.into();
3764 self
3765 }
3766
3767 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3769 self.0.options = v.into();
3770 self
3771 }
3772
3773 pub async fn send(self) -> Result<crate::model::Operation> {
3775 (*self.0.stub)
3776 .start_external_sync(self.0.request, self.0.options)
3777 .await
3778 .map(gax::response::Response::into_body)
3779 }
3780
3781 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3783 self.0.request.instance = v.into();
3784 self
3785 }
3786
3787 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3789 self.0.request.project = v.into();
3790 self
3791 }
3792
3793 pub fn set_sync_mode<
3795 T: Into<
3796 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3797 >,
3798 >(
3799 mut self,
3800 v: T,
3801 ) -> Self {
3802 self.0.request.sync_mode = v.into();
3803 self
3804 }
3805
3806 pub fn set_skip_verification<T: Into<bool>>(mut self, v: T) -> Self {
3808 self.0.request.skip_verification = v.into();
3809 self
3810 }
3811
3812 pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
3814 mut self,
3815 v: T,
3816 ) -> Self {
3817 self.0.request.sync_parallel_level = v.into();
3818 self
3819 }
3820
3821 pub fn set_migration_type<
3823 T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
3824 >(
3825 mut self,
3826 v: T,
3827 ) -> Self {
3828 self.0.request.migration_type = v.into();
3829 self
3830 }
3831
3832 pub fn set_sync_config<
3837 T: Into<Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>>,
3838 >(
3839 mut self,
3840 v: T,
3841 ) -> Self {
3842 self.0.request.sync_config = v.into();
3843 self
3844 }
3845
3846 pub fn set_mysql_sync_config<
3852 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
3853 >(
3854 mut self,
3855 v: T,
3856 ) -> Self {
3857 self.0.request = self.0.request.set_mysql_sync_config(v);
3858 self
3859 }
3860 }
3861
3862 #[doc(hidden)]
3863 impl gax::options::internal::RequestBuilder for StartExternalSync {
3864 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3865 &mut self.0.options
3866 }
3867 }
3868
3869 #[derive(Clone, Debug)]
3887 pub struct PerformDiskShrink(
3888 RequestBuilder<crate::model::SqlInstancesPerformDiskShrinkRequest>,
3889 );
3890
3891 impl PerformDiskShrink {
3892 pub(crate) fn new(
3893 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3894 ) -> Self {
3895 Self(RequestBuilder::new(stub))
3896 }
3897
3898 pub fn with_request<V: Into<crate::model::SqlInstancesPerformDiskShrinkRequest>>(
3900 mut self,
3901 v: V,
3902 ) -> Self {
3903 self.0.request = v.into();
3904 self
3905 }
3906
3907 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3909 self.0.options = v.into();
3910 self
3911 }
3912
3913 pub async fn send(self) -> Result<crate::model::Operation> {
3915 (*self.0.stub)
3916 .perform_disk_shrink(self.0.request, self.0.options)
3917 .await
3918 .map(gax::response::Response::into_body)
3919 }
3920
3921 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3923 self.0.request.instance = v.into();
3924 self
3925 }
3926
3927 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3929 self.0.request.project = v.into();
3930 self
3931 }
3932
3933 pub fn set_body<T>(mut self, v: T) -> Self
3935 where
3936 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
3937 {
3938 self.0.request.body = std::option::Option::Some(v.into());
3939 self
3940 }
3941
3942 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3944 where
3945 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
3946 {
3947 self.0.request.body = v.map(|x| x.into());
3948 self
3949 }
3950 }
3951
3952 #[doc(hidden)]
3953 impl gax::options::internal::RequestBuilder for PerformDiskShrink {
3954 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3955 &mut self.0.options
3956 }
3957 }
3958
3959 #[derive(Clone, Debug)]
3977 pub struct GetDiskShrinkConfig(
3978 RequestBuilder<crate::model::SqlInstancesGetDiskShrinkConfigRequest>,
3979 );
3980
3981 impl GetDiskShrinkConfig {
3982 pub(crate) fn new(
3983 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3984 ) -> Self {
3985 Self(RequestBuilder::new(stub))
3986 }
3987
3988 pub fn with_request<V: Into<crate::model::SqlInstancesGetDiskShrinkConfigRequest>>(
3990 mut self,
3991 v: V,
3992 ) -> Self {
3993 self.0.request = v.into();
3994 self
3995 }
3996
3997 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3999 self.0.options = v.into();
4000 self
4001 }
4002
4003 pub async fn send(self) -> Result<crate::model::SqlInstancesGetDiskShrinkConfigResponse> {
4005 (*self.0.stub)
4006 .get_disk_shrink_config(self.0.request, self.0.options)
4007 .await
4008 .map(gax::response::Response::into_body)
4009 }
4010
4011 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4013 self.0.request.instance = v.into();
4014 self
4015 }
4016
4017 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4019 self.0.request.project = v.into();
4020 self
4021 }
4022 }
4023
4024 #[doc(hidden)]
4025 impl gax::options::internal::RequestBuilder for GetDiskShrinkConfig {
4026 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4027 &mut self.0.options
4028 }
4029 }
4030
4031 #[derive(Clone, Debug)]
4049 pub struct ResetReplicaSize(RequestBuilder<crate::model::SqlInstancesResetReplicaSizeRequest>);
4050
4051 impl ResetReplicaSize {
4052 pub(crate) fn new(
4053 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4054 ) -> Self {
4055 Self(RequestBuilder::new(stub))
4056 }
4057
4058 pub fn with_request<V: Into<crate::model::SqlInstancesResetReplicaSizeRequest>>(
4060 mut self,
4061 v: V,
4062 ) -> Self {
4063 self.0.request = v.into();
4064 self
4065 }
4066
4067 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4069 self.0.options = v.into();
4070 self
4071 }
4072
4073 pub async fn send(self) -> Result<crate::model::Operation> {
4075 (*self.0.stub)
4076 .reset_replica_size(self.0.request, self.0.options)
4077 .await
4078 .map(gax::response::Response::into_body)
4079 }
4080
4081 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4083 self.0.request.instance = v.into();
4084 self
4085 }
4086
4087 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4089 self.0.request.project = v.into();
4090 self
4091 }
4092 }
4093
4094 #[doc(hidden)]
4095 impl gax::options::internal::RequestBuilder for ResetReplicaSize {
4096 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4097 &mut self.0.options
4098 }
4099 }
4100
4101 #[derive(Clone, Debug)]
4119 pub struct GetLatestRecoveryTime(
4120 RequestBuilder<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>,
4121 );
4122
4123 impl GetLatestRecoveryTime {
4124 pub(crate) fn new(
4125 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4126 ) -> Self {
4127 Self(RequestBuilder::new(stub))
4128 }
4129
4130 pub fn with_request<V: Into<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>>(
4132 mut self,
4133 v: V,
4134 ) -> Self {
4135 self.0.request = v.into();
4136 self
4137 }
4138
4139 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4141 self.0.options = v.into();
4142 self
4143 }
4144
4145 pub async fn send(self) -> Result<crate::model::SqlInstancesGetLatestRecoveryTimeResponse> {
4147 (*self.0.stub)
4148 .get_latest_recovery_time(self.0.request, self.0.options)
4149 .await
4150 .map(gax::response::Response::into_body)
4151 }
4152
4153 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4155 self.0.request.instance = v.into();
4156 self
4157 }
4158
4159 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4161 self.0.request.project = v.into();
4162 self
4163 }
4164 }
4165
4166 #[doc(hidden)]
4167 impl gax::options::internal::RequestBuilder for GetLatestRecoveryTime {
4168 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4169 &mut self.0.options
4170 }
4171 }
4172
4173 #[derive(Clone, Debug)]
4191 pub struct AcquireSsrsLease(RequestBuilder<crate::model::SqlInstancesAcquireSsrsLeaseRequest>);
4192
4193 impl AcquireSsrsLease {
4194 pub(crate) fn new(
4195 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4196 ) -> Self {
4197 Self(RequestBuilder::new(stub))
4198 }
4199
4200 pub fn with_request<V: Into<crate::model::SqlInstancesAcquireSsrsLeaseRequest>>(
4202 mut self,
4203 v: V,
4204 ) -> Self {
4205 self.0.request = v.into();
4206 self
4207 }
4208
4209 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4211 self.0.options = v.into();
4212 self
4213 }
4214
4215 pub async fn send(self) -> Result<crate::model::SqlInstancesAcquireSsrsLeaseResponse> {
4217 (*self.0.stub)
4218 .acquire_ssrs_lease(self.0.request, self.0.options)
4219 .await
4220 .map(gax::response::Response::into_body)
4221 }
4222
4223 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4227 self.0.request.instance = v.into();
4228 self
4229 }
4230
4231 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4235 self.0.request.project = v.into();
4236 self
4237 }
4238
4239 pub fn set_body<T>(mut self, v: T) -> Self
4243 where
4244 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
4245 {
4246 self.0.request.body = std::option::Option::Some(v.into());
4247 self
4248 }
4249
4250 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4254 where
4255 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
4256 {
4257 self.0.request.body = v.map(|x| x.into());
4258 self
4259 }
4260 }
4261
4262 #[doc(hidden)]
4263 impl gax::options::internal::RequestBuilder for AcquireSsrsLease {
4264 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4265 &mut self.0.options
4266 }
4267 }
4268
4269 #[derive(Clone, Debug)]
4287 pub struct ReleaseSsrsLease(RequestBuilder<crate::model::SqlInstancesReleaseSsrsLeaseRequest>);
4288
4289 impl ReleaseSsrsLease {
4290 pub(crate) fn new(
4291 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4292 ) -> Self {
4293 Self(RequestBuilder::new(stub))
4294 }
4295
4296 pub fn with_request<V: Into<crate::model::SqlInstancesReleaseSsrsLeaseRequest>>(
4298 mut self,
4299 v: V,
4300 ) -> Self {
4301 self.0.request = v.into();
4302 self
4303 }
4304
4305 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4307 self.0.options = v.into();
4308 self
4309 }
4310
4311 pub async fn send(self) -> Result<crate::model::SqlInstancesReleaseSsrsLeaseResponse> {
4313 (*self.0.stub)
4314 .release_ssrs_lease(self.0.request, self.0.options)
4315 .await
4316 .map(gax::response::Response::into_body)
4317 }
4318
4319 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4323 self.0.request.instance = v.into();
4324 self
4325 }
4326
4327 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4331 self.0.request.project = v.into();
4332 self
4333 }
4334 }
4335
4336 #[doc(hidden)]
4337 impl gax::options::internal::RequestBuilder for ReleaseSsrsLease {
4338 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4339 &mut self.0.options
4340 }
4341 }
4342}
4343
4344pub mod sql_operations_service {
4345 use crate::Result;
4346
4347 pub type ClientBuilder =
4361 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4362
4363 pub(crate) mod client {
4364 use super::super::super::client::SqlOperationsService;
4365 pub struct Factory;
4366 impl gax::client_builder::internal::ClientFactory for Factory {
4367 type Client = SqlOperationsService;
4368 type Credentials = gaxi::options::Credentials;
4369 async fn build(
4370 self,
4371 config: gaxi::options::ClientConfig,
4372 ) -> gax::client_builder::Result<Self::Client> {
4373 Self::Client::new(config).await
4374 }
4375 }
4376 }
4377
4378 #[derive(Clone, Debug)]
4380 pub(crate) struct RequestBuilder<R: std::default::Default> {
4381 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
4382 request: R,
4383 options: gax::options::RequestOptions,
4384 }
4385
4386 impl<R> RequestBuilder<R>
4387 where
4388 R: std::default::Default,
4389 {
4390 pub(crate) fn new(
4391 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
4392 ) -> Self {
4393 Self {
4394 stub,
4395 request: R::default(),
4396 options: gax::options::RequestOptions::default(),
4397 }
4398 }
4399 }
4400
4401 #[derive(Clone, Debug)]
4419 pub struct Get(RequestBuilder<crate::model::SqlOperationsGetRequest>);
4420
4421 impl Get {
4422 pub(crate) fn new(
4423 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
4424 ) -> Self {
4425 Self(RequestBuilder::new(stub))
4426 }
4427
4428 pub fn with_request<V: Into<crate::model::SqlOperationsGetRequest>>(
4430 mut self,
4431 v: V,
4432 ) -> Self {
4433 self.0.request = v.into();
4434 self
4435 }
4436
4437 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4439 self.0.options = v.into();
4440 self
4441 }
4442
4443 pub async fn send(self) -> Result<crate::model::Operation> {
4445 (*self.0.stub)
4446 .get(self.0.request, self.0.options)
4447 .await
4448 .map(gax::response::Response::into_body)
4449 }
4450
4451 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4453 self.0.request.operation = v.into();
4454 self
4455 }
4456
4457 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4459 self.0.request.project = v.into();
4460 self
4461 }
4462 }
4463
4464 #[doc(hidden)]
4465 impl gax::options::internal::RequestBuilder for Get {
4466 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4467 &mut self.0.options
4468 }
4469 }
4470
4471 #[derive(Clone, Debug)]
4493 pub struct List(RequestBuilder<crate::model::SqlOperationsListRequest>);
4494
4495 impl List {
4496 pub(crate) fn new(
4497 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
4498 ) -> Self {
4499 Self(RequestBuilder::new(stub))
4500 }
4501
4502 pub fn with_request<V: Into<crate::model::SqlOperationsListRequest>>(
4504 mut self,
4505 v: V,
4506 ) -> Self {
4507 self.0.request = v.into();
4508 self
4509 }
4510
4511 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4513 self.0.options = v.into();
4514 self
4515 }
4516
4517 pub async fn send(self) -> Result<crate::model::OperationsListResponse> {
4519 (*self.0.stub)
4520 .list(self.0.request, self.0.options)
4521 .await
4522 .map(gax::response::Response::into_body)
4523 }
4524
4525 pub fn by_page(
4527 self,
4528 ) -> impl gax::paginator::Paginator<crate::model::OperationsListResponse, gax::error::Error>
4529 {
4530 use std::clone::Clone;
4531 let token = self.0.request.page_token.clone();
4532 let execute = move |token: String| {
4533 let mut builder = self.clone();
4534 builder.0.request = builder.0.request.set_page_token(token);
4535 builder.send()
4536 };
4537 gax::paginator::internal::new_paginator(token, execute)
4538 }
4539
4540 pub fn by_item(
4542 self,
4543 ) -> impl gax::paginator::ItemPaginator<crate::model::OperationsListResponse, gax::error::Error>
4544 {
4545 use gax::paginator::Paginator;
4546 self.by_page().items()
4547 }
4548
4549 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4551 self.0.request.instance = v.into();
4552 self
4553 }
4554
4555 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
4557 self.0.request.max_results = v.into();
4558 self
4559 }
4560
4561 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4563 self.0.request.page_token = v.into();
4564 self
4565 }
4566
4567 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4569 self.0.request.project = v.into();
4570 self
4571 }
4572 }
4573
4574 #[doc(hidden)]
4575 impl gax::options::internal::RequestBuilder for List {
4576 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4577 &mut self.0.options
4578 }
4579 }
4580
4581 #[derive(Clone, Debug)]
4599 pub struct Cancel(RequestBuilder<crate::model::SqlOperationsCancelRequest>);
4600
4601 impl Cancel {
4602 pub(crate) fn new(
4603 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
4604 ) -> Self {
4605 Self(RequestBuilder::new(stub))
4606 }
4607
4608 pub fn with_request<V: Into<crate::model::SqlOperationsCancelRequest>>(
4610 mut self,
4611 v: V,
4612 ) -> Self {
4613 self.0.request = v.into();
4614 self
4615 }
4616
4617 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4619 self.0.options = v.into();
4620 self
4621 }
4622
4623 pub async fn send(self) -> Result<()> {
4625 (*self.0.stub)
4626 .cancel(self.0.request, self.0.options)
4627 .await
4628 .map(gax::response::Response::into_body)
4629 }
4630
4631 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4633 self.0.request.operation = v.into();
4634 self
4635 }
4636
4637 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4639 self.0.request.project = v.into();
4640 self
4641 }
4642 }
4643
4644 #[doc(hidden)]
4645 impl gax::options::internal::RequestBuilder for Cancel {
4646 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4647 &mut self.0.options
4648 }
4649 }
4650}
4651
4652pub mod sql_ssl_certs_service {
4653 use crate::Result;
4654
4655 pub type ClientBuilder =
4669 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4670
4671 pub(crate) mod client {
4672 use super::super::super::client::SqlSslCertsService;
4673 pub struct Factory;
4674 impl gax::client_builder::internal::ClientFactory for Factory {
4675 type Client = SqlSslCertsService;
4676 type Credentials = gaxi::options::Credentials;
4677 async fn build(
4678 self,
4679 config: gaxi::options::ClientConfig,
4680 ) -> gax::client_builder::Result<Self::Client> {
4681 Self::Client::new(config).await
4682 }
4683 }
4684 }
4685
4686 #[derive(Clone, Debug)]
4688 pub(crate) struct RequestBuilder<R: std::default::Default> {
4689 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
4690 request: R,
4691 options: gax::options::RequestOptions,
4692 }
4693
4694 impl<R> RequestBuilder<R>
4695 where
4696 R: std::default::Default,
4697 {
4698 pub(crate) fn new(
4699 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
4700 ) -> Self {
4701 Self {
4702 stub,
4703 request: R::default(),
4704 options: gax::options::RequestOptions::default(),
4705 }
4706 }
4707 }
4708
4709 #[derive(Clone, Debug)]
4727 pub struct Delete(RequestBuilder<crate::model::SqlSslCertsDeleteRequest>);
4728
4729 impl Delete {
4730 pub(crate) fn new(
4731 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
4732 ) -> Self {
4733 Self(RequestBuilder::new(stub))
4734 }
4735
4736 pub fn with_request<V: Into<crate::model::SqlSslCertsDeleteRequest>>(
4738 mut self,
4739 v: V,
4740 ) -> Self {
4741 self.0.request = v.into();
4742 self
4743 }
4744
4745 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4747 self.0.options = v.into();
4748 self
4749 }
4750
4751 pub async fn send(self) -> Result<crate::model::Operation> {
4753 (*self.0.stub)
4754 .delete(self.0.request, self.0.options)
4755 .await
4756 .map(gax::response::Response::into_body)
4757 }
4758
4759 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4761 self.0.request.instance = v.into();
4762 self
4763 }
4764
4765 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4767 self.0.request.project = v.into();
4768 self
4769 }
4770
4771 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
4773 self.0.request.sha1_fingerprint = v.into();
4774 self
4775 }
4776 }
4777
4778 #[doc(hidden)]
4779 impl gax::options::internal::RequestBuilder for Delete {
4780 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4781 &mut self.0.options
4782 }
4783 }
4784
4785 #[derive(Clone, Debug)]
4803 pub struct Get(RequestBuilder<crate::model::SqlSslCertsGetRequest>);
4804
4805 impl Get {
4806 pub(crate) fn new(
4807 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
4808 ) -> Self {
4809 Self(RequestBuilder::new(stub))
4810 }
4811
4812 pub fn with_request<V: Into<crate::model::SqlSslCertsGetRequest>>(mut self, v: V) -> Self {
4814 self.0.request = v.into();
4815 self
4816 }
4817
4818 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4820 self.0.options = v.into();
4821 self
4822 }
4823
4824 pub async fn send(self) -> Result<crate::model::SslCert> {
4826 (*self.0.stub)
4827 .get(self.0.request, self.0.options)
4828 .await
4829 .map(gax::response::Response::into_body)
4830 }
4831
4832 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4834 self.0.request.instance = v.into();
4835 self
4836 }
4837
4838 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4840 self.0.request.project = v.into();
4841 self
4842 }
4843
4844 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
4846 self.0.request.sha1_fingerprint = v.into();
4847 self
4848 }
4849 }
4850
4851 #[doc(hidden)]
4852 impl gax::options::internal::RequestBuilder for Get {
4853 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4854 &mut self.0.options
4855 }
4856 }
4857
4858 #[derive(Clone, Debug)]
4876 pub struct Insert(RequestBuilder<crate::model::SqlSslCertsInsertRequest>);
4877
4878 impl Insert {
4879 pub(crate) fn new(
4880 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
4881 ) -> Self {
4882 Self(RequestBuilder::new(stub))
4883 }
4884
4885 pub fn with_request<V: Into<crate::model::SqlSslCertsInsertRequest>>(
4887 mut self,
4888 v: V,
4889 ) -> Self {
4890 self.0.request = v.into();
4891 self
4892 }
4893
4894 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4896 self.0.options = v.into();
4897 self
4898 }
4899
4900 pub async fn send(self) -> Result<crate::model::SslCertsInsertResponse> {
4902 (*self.0.stub)
4903 .insert(self.0.request, self.0.options)
4904 .await
4905 .map(gax::response::Response::into_body)
4906 }
4907
4908 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4910 self.0.request.instance = v.into();
4911 self
4912 }
4913
4914 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4916 self.0.request.project = v.into();
4917 self
4918 }
4919
4920 pub fn set_body<T>(mut self, v: T) -> Self
4922 where
4923 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
4924 {
4925 self.0.request.body = std::option::Option::Some(v.into());
4926 self
4927 }
4928
4929 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4931 where
4932 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
4933 {
4934 self.0.request.body = v.map(|x| x.into());
4935 self
4936 }
4937 }
4938
4939 #[doc(hidden)]
4940 impl gax::options::internal::RequestBuilder for Insert {
4941 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4942 &mut self.0.options
4943 }
4944 }
4945
4946 #[derive(Clone, Debug)]
4964 pub struct List(RequestBuilder<crate::model::SqlSslCertsListRequest>);
4965
4966 impl List {
4967 pub(crate) fn new(
4968 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
4969 ) -> Self {
4970 Self(RequestBuilder::new(stub))
4971 }
4972
4973 pub fn with_request<V: Into<crate::model::SqlSslCertsListRequest>>(mut self, v: V) -> Self {
4975 self.0.request = v.into();
4976 self
4977 }
4978
4979 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4981 self.0.options = v.into();
4982 self
4983 }
4984
4985 pub async fn send(self) -> Result<crate::model::SslCertsListResponse> {
4987 (*self.0.stub)
4988 .list(self.0.request, self.0.options)
4989 .await
4990 .map(gax::response::Response::into_body)
4991 }
4992
4993 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4995 self.0.request.instance = v.into();
4996 self
4997 }
4998
4999 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5001 self.0.request.project = v.into();
5002 self
5003 }
5004 }
5005
5006 #[doc(hidden)]
5007 impl gax::options::internal::RequestBuilder for List {
5008 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5009 &mut self.0.options
5010 }
5011 }
5012}
5013
5014pub mod sql_tiers_service {
5015 use crate::Result;
5016
5017 pub type ClientBuilder =
5031 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5032
5033 pub(crate) mod client {
5034 use super::super::super::client::SqlTiersService;
5035 pub struct Factory;
5036 impl gax::client_builder::internal::ClientFactory for Factory {
5037 type Client = SqlTiersService;
5038 type Credentials = gaxi::options::Credentials;
5039 async fn build(
5040 self,
5041 config: gaxi::options::ClientConfig,
5042 ) -> gax::client_builder::Result<Self::Client> {
5043 Self::Client::new(config).await
5044 }
5045 }
5046 }
5047
5048 #[derive(Clone, Debug)]
5050 pub(crate) struct RequestBuilder<R: std::default::Default> {
5051 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
5052 request: R,
5053 options: gax::options::RequestOptions,
5054 }
5055
5056 impl<R> RequestBuilder<R>
5057 where
5058 R: std::default::Default,
5059 {
5060 pub(crate) fn new(
5061 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
5062 ) -> Self {
5063 Self {
5064 stub,
5065 request: R::default(),
5066 options: gax::options::RequestOptions::default(),
5067 }
5068 }
5069 }
5070
5071 #[derive(Clone, Debug)]
5089 pub struct List(RequestBuilder<crate::model::SqlTiersListRequest>);
5090
5091 impl List {
5092 pub(crate) fn new(
5093 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
5094 ) -> Self {
5095 Self(RequestBuilder::new(stub))
5096 }
5097
5098 pub fn with_request<V: Into<crate::model::SqlTiersListRequest>>(mut self, v: V) -> Self {
5100 self.0.request = v.into();
5101 self
5102 }
5103
5104 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5106 self.0.options = v.into();
5107 self
5108 }
5109
5110 pub async fn send(self) -> Result<crate::model::TiersListResponse> {
5112 (*self.0.stub)
5113 .list(self.0.request, self.0.options)
5114 .await
5115 .map(gax::response::Response::into_body)
5116 }
5117
5118 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5120 self.0.request.project = v.into();
5121 self
5122 }
5123 }
5124
5125 #[doc(hidden)]
5126 impl gax::options::internal::RequestBuilder for List {
5127 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5128 &mut self.0.options
5129 }
5130 }
5131}
5132
5133pub mod sql_users_service {
5134 use crate::Result;
5135
5136 pub type ClientBuilder =
5150 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5151
5152 pub(crate) mod client {
5153 use super::super::super::client::SqlUsersService;
5154 pub struct Factory;
5155 impl gax::client_builder::internal::ClientFactory for Factory {
5156 type Client = SqlUsersService;
5157 type Credentials = gaxi::options::Credentials;
5158 async fn build(
5159 self,
5160 config: gaxi::options::ClientConfig,
5161 ) -> gax::client_builder::Result<Self::Client> {
5162 Self::Client::new(config).await
5163 }
5164 }
5165 }
5166
5167 #[derive(Clone, Debug)]
5169 pub(crate) struct RequestBuilder<R: std::default::Default> {
5170 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
5171 request: R,
5172 options: gax::options::RequestOptions,
5173 }
5174
5175 impl<R> RequestBuilder<R>
5176 where
5177 R: std::default::Default,
5178 {
5179 pub(crate) fn new(
5180 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
5181 ) -> Self {
5182 Self {
5183 stub,
5184 request: R::default(),
5185 options: gax::options::RequestOptions::default(),
5186 }
5187 }
5188 }
5189
5190 #[derive(Clone, Debug)]
5208 pub struct Delete(RequestBuilder<crate::model::SqlUsersDeleteRequest>);
5209
5210 impl Delete {
5211 pub(crate) fn new(
5212 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
5213 ) -> Self {
5214 Self(RequestBuilder::new(stub))
5215 }
5216
5217 pub fn with_request<V: Into<crate::model::SqlUsersDeleteRequest>>(mut self, v: V) -> Self {
5219 self.0.request = v.into();
5220 self
5221 }
5222
5223 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5225 self.0.options = v.into();
5226 self
5227 }
5228
5229 pub async fn send(self) -> Result<crate::model::Operation> {
5231 (*self.0.stub)
5232 .delete(self.0.request, self.0.options)
5233 .await
5234 .map(gax::response::Response::into_body)
5235 }
5236
5237 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
5239 self.0.request.host = v.into();
5240 self
5241 }
5242
5243 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5245 self.0.request.instance = v.into();
5246 self
5247 }
5248
5249 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5251 self.0.request.name = v.into();
5252 self
5253 }
5254
5255 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5257 self.0.request.project = v.into();
5258 self
5259 }
5260 }
5261
5262 #[doc(hidden)]
5263 impl gax::options::internal::RequestBuilder for Delete {
5264 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5265 &mut self.0.options
5266 }
5267 }
5268
5269 #[derive(Clone, Debug)]
5287 pub struct Get(RequestBuilder<crate::model::SqlUsersGetRequest>);
5288
5289 impl Get {
5290 pub(crate) fn new(
5291 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
5292 ) -> Self {
5293 Self(RequestBuilder::new(stub))
5294 }
5295
5296 pub fn with_request<V: Into<crate::model::SqlUsersGetRequest>>(mut self, v: V) -> Self {
5298 self.0.request = v.into();
5299 self
5300 }
5301
5302 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5304 self.0.options = v.into();
5305 self
5306 }
5307
5308 pub async fn send(self) -> Result<crate::model::User> {
5310 (*self.0.stub)
5311 .get(self.0.request, self.0.options)
5312 .await
5313 .map(gax::response::Response::into_body)
5314 }
5315
5316 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5318 self.0.request.instance = v.into();
5319 self
5320 }
5321
5322 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5324 self.0.request.name = v.into();
5325 self
5326 }
5327
5328 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5330 self.0.request.project = v.into();
5331 self
5332 }
5333
5334 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
5336 self.0.request.host = v.into();
5337 self
5338 }
5339 }
5340
5341 #[doc(hidden)]
5342 impl gax::options::internal::RequestBuilder for Get {
5343 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5344 &mut self.0.options
5345 }
5346 }
5347
5348 #[derive(Clone, Debug)]
5366 pub struct Insert(RequestBuilder<crate::model::SqlUsersInsertRequest>);
5367
5368 impl Insert {
5369 pub(crate) fn new(
5370 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
5371 ) -> Self {
5372 Self(RequestBuilder::new(stub))
5373 }
5374
5375 pub fn with_request<V: Into<crate::model::SqlUsersInsertRequest>>(mut self, v: V) -> Self {
5377 self.0.request = v.into();
5378 self
5379 }
5380
5381 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5383 self.0.options = v.into();
5384 self
5385 }
5386
5387 pub async fn send(self) -> Result<crate::model::Operation> {
5389 (*self.0.stub)
5390 .insert(self.0.request, self.0.options)
5391 .await
5392 .map(gax::response::Response::into_body)
5393 }
5394
5395 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5397 self.0.request.instance = v.into();
5398 self
5399 }
5400
5401 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5403 self.0.request.project = v.into();
5404 self
5405 }
5406
5407 pub fn set_body<T>(mut self, v: T) -> Self
5409 where
5410 T: std::convert::Into<crate::model::User>,
5411 {
5412 self.0.request.body = std::option::Option::Some(v.into());
5413 self
5414 }
5415
5416 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5418 where
5419 T: std::convert::Into<crate::model::User>,
5420 {
5421 self.0.request.body = v.map(|x| x.into());
5422 self
5423 }
5424 }
5425
5426 #[doc(hidden)]
5427 impl gax::options::internal::RequestBuilder for Insert {
5428 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5429 &mut self.0.options
5430 }
5431 }
5432
5433 #[derive(Clone, Debug)]
5451 pub struct List(RequestBuilder<crate::model::SqlUsersListRequest>);
5452
5453 impl List {
5454 pub(crate) fn new(
5455 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
5456 ) -> Self {
5457 Self(RequestBuilder::new(stub))
5458 }
5459
5460 pub fn with_request<V: Into<crate::model::SqlUsersListRequest>>(mut self, v: V) -> Self {
5462 self.0.request = v.into();
5463 self
5464 }
5465
5466 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5468 self.0.options = v.into();
5469 self
5470 }
5471
5472 pub async fn send(self) -> Result<crate::model::UsersListResponse> {
5474 (*self.0.stub)
5475 .list(self.0.request, self.0.options)
5476 .await
5477 .map(gax::response::Response::into_body)
5478 }
5479
5480 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5482 self.0.request.instance = v.into();
5483 self
5484 }
5485
5486 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5488 self.0.request.project = v.into();
5489 self
5490 }
5491 }
5492
5493 #[doc(hidden)]
5494 impl gax::options::internal::RequestBuilder for List {
5495 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5496 &mut self.0.options
5497 }
5498 }
5499
5500 #[derive(Clone, Debug)]
5518 pub struct Update(RequestBuilder<crate::model::SqlUsersUpdateRequest>);
5519
5520 impl Update {
5521 pub(crate) fn new(
5522 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
5523 ) -> Self {
5524 Self(RequestBuilder::new(stub))
5525 }
5526
5527 pub fn with_request<V: Into<crate::model::SqlUsersUpdateRequest>>(mut self, v: V) -> Self {
5529 self.0.request = v.into();
5530 self
5531 }
5532
5533 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5535 self.0.options = v.into();
5536 self
5537 }
5538
5539 pub async fn send(self) -> Result<crate::model::Operation> {
5541 (*self.0.stub)
5542 .update(self.0.request, self.0.options)
5543 .await
5544 .map(gax::response::Response::into_body)
5545 }
5546
5547 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
5549 self.0.request.host = v.into();
5550 self
5551 }
5552
5553 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5555 self.0.request.instance = v.into();
5556 self
5557 }
5558
5559 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5561 self.0.request.name = v.into();
5562 self
5563 }
5564
5565 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5567 self.0.request.project = v.into();
5568 self
5569 }
5570
5571 pub fn set_body<T>(mut self, v: T) -> Self
5573 where
5574 T: std::convert::Into<crate::model::User>,
5575 {
5576 self.0.request.body = std::option::Option::Some(v.into());
5577 self
5578 }
5579
5580 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5582 where
5583 T: std::convert::Into<crate::model::User>,
5584 {
5585 self.0.request.body = v.map(|x| x.into());
5586 self
5587 }
5588 }
5589
5590 #[doc(hidden)]
5591 impl gax::options::internal::RequestBuilder for Update {
5592 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5593 &mut self.0.options
5594 }
5595 }
5596}