1pub mod sql_backup_runs_service {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::SqlBackupRunsService;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = SqlBackupRunsService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
91 pub struct Delete(RequestBuilder<crate::model::SqlBackupRunsDeleteRequest>);
92
93 impl Delete {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::SqlBackupRunsDeleteRequest>>(
102 mut self,
103 v: V,
104 ) -> Self {
105 self.0.request = v.into();
106 self
107 }
108
109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 pub async fn send(self) -> Result<crate::model::Operation> {
117 (*self.0.stub)
118 .delete(self.0.request, self.0.options)
119 .await
120 .map(crate::Response::into_body)
121 }
122
123 pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
125 self.0.request.id = v.into();
126 self
127 }
128
129 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
131 self.0.request.instance = v.into();
132 self
133 }
134
135 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
137 self.0.request.project = v.into();
138 self
139 }
140 }
141
142 #[doc(hidden)]
143 impl crate::RequestBuilder for Delete {
144 fn request_options(&mut self) -> &mut crate::RequestOptions {
145 &mut self.0.options
146 }
147 }
148
149 #[derive(Clone, Debug)]
166 pub struct Get(RequestBuilder<crate::model::SqlBackupRunsGetRequest>);
167
168 impl Get {
169 pub(crate) fn new(
170 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
171 ) -> Self {
172 Self(RequestBuilder::new(stub))
173 }
174
175 pub fn with_request<V: Into<crate::model::SqlBackupRunsGetRequest>>(
177 mut self,
178 v: V,
179 ) -> Self {
180 self.0.request = v.into();
181 self
182 }
183
184 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
186 self.0.options = v.into();
187 self
188 }
189
190 pub async fn send(self) -> Result<crate::model::BackupRun> {
192 (*self.0.stub)
193 .get(self.0.request, self.0.options)
194 .await
195 .map(crate::Response::into_body)
196 }
197
198 pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
200 self.0.request.id = v.into();
201 self
202 }
203
204 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
206 self.0.request.instance = v.into();
207 self
208 }
209
210 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
212 self.0.request.project = v.into();
213 self
214 }
215 }
216
217 #[doc(hidden)]
218 impl crate::RequestBuilder for Get {
219 fn request_options(&mut self) -> &mut crate::RequestOptions {
220 &mut self.0.options
221 }
222 }
223
224 #[derive(Clone, Debug)]
241 pub struct Insert(RequestBuilder<crate::model::SqlBackupRunsInsertRequest>);
242
243 impl Insert {
244 pub(crate) fn new(
245 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
246 ) -> Self {
247 Self(RequestBuilder::new(stub))
248 }
249
250 pub fn with_request<V: Into<crate::model::SqlBackupRunsInsertRequest>>(
252 mut self,
253 v: V,
254 ) -> Self {
255 self.0.request = v.into();
256 self
257 }
258
259 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
261 self.0.options = v.into();
262 self
263 }
264
265 pub async fn send(self) -> Result<crate::model::Operation> {
267 (*self.0.stub)
268 .insert(self.0.request, self.0.options)
269 .await
270 .map(crate::Response::into_body)
271 }
272
273 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
275 self.0.request.instance = v.into();
276 self
277 }
278
279 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
281 self.0.request.project = v.into();
282 self
283 }
284
285 pub fn set_body<T>(mut self, v: T) -> Self
287 where
288 T: std::convert::Into<crate::model::BackupRun>,
289 {
290 self.0.request.body = std::option::Option::Some(v.into());
291 self
292 }
293
294 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
296 where
297 T: std::convert::Into<crate::model::BackupRun>,
298 {
299 self.0.request.body = v.map(|x| x.into());
300 self
301 }
302 }
303
304 #[doc(hidden)]
305 impl crate::RequestBuilder for Insert {
306 fn request_options(&mut self) -> &mut crate::RequestOptions {
307 &mut self.0.options
308 }
309 }
310
311 #[derive(Clone, Debug)]
332 pub struct List(RequestBuilder<crate::model::SqlBackupRunsListRequest>);
333
334 impl List {
335 pub(crate) fn new(
336 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
337 ) -> Self {
338 Self(RequestBuilder::new(stub))
339 }
340
341 pub fn with_request<V: Into<crate::model::SqlBackupRunsListRequest>>(
343 mut self,
344 v: V,
345 ) -> Self {
346 self.0.request = v.into();
347 self
348 }
349
350 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
352 self.0.options = v.into();
353 self
354 }
355
356 pub async fn send(self) -> Result<crate::model::BackupRunsListResponse> {
358 (*self.0.stub)
359 .list(self.0.request, self.0.options)
360 .await
361 .map(crate::Response::into_body)
362 }
363
364 pub fn by_page(
366 self,
367 ) -> impl google_cloud_gax::paginator::Paginator<
368 crate::model::BackupRunsListResponse,
369 crate::Error,
370 > {
371 use std::clone::Clone;
372 let token = self.0.request.page_token.clone();
373 let execute = move |token: String| {
374 let mut builder = self.clone();
375 builder.0.request = builder.0.request.set_page_token(token);
376 builder.send()
377 };
378 google_cloud_gax::paginator::internal::new_paginator(token, execute)
379 }
380
381 pub fn by_item(
383 self,
384 ) -> impl google_cloud_gax::paginator::ItemPaginator<
385 crate::model::BackupRunsListResponse,
386 crate::Error,
387 > {
388 use google_cloud_gax::paginator::Paginator;
389 self.by_page().items()
390 }
391
392 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
394 self.0.request.instance = v.into();
395 self
396 }
397
398 pub fn set_max_results<T: Into<i32>>(mut self, v: T) -> Self {
400 self.0.request.max_results = v.into();
401 self
402 }
403
404 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
406 self.0.request.page_token = v.into();
407 self
408 }
409
410 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
412 self.0.request.project = v.into();
413 self
414 }
415 }
416
417 #[doc(hidden)]
418 impl crate::RequestBuilder for List {
419 fn request_options(&mut self) -> &mut crate::RequestOptions {
420 &mut self.0.options
421 }
422 }
423}
424
425pub mod sql_backups_service {
427 use crate::Result;
428
429 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
443
444 pub(crate) mod client {
445 use super::super::super::client::SqlBackupsService;
446 pub struct Factory;
447 impl crate::ClientFactory for Factory {
448 type Client = SqlBackupsService;
449 type Credentials = gaxi::options::Credentials;
450 async fn build(
451 self,
452 config: gaxi::options::ClientConfig,
453 ) -> crate::ClientBuilderResult<Self::Client> {
454 Self::Client::new(config).await
455 }
456 }
457 }
458
459 #[derive(Clone, Debug)]
461 pub(crate) struct RequestBuilder<R: std::default::Default> {
462 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
463 request: R,
464 options: crate::RequestOptions,
465 }
466
467 impl<R> RequestBuilder<R>
468 where
469 R: std::default::Default,
470 {
471 pub(crate) fn new(
472 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
473 ) -> Self {
474 Self {
475 stub,
476 request: R::default(),
477 options: crate::RequestOptions::default(),
478 }
479 }
480 }
481
482 #[derive(Clone, Debug)]
499 pub struct CreateBackup(RequestBuilder<crate::model::CreateBackupRequest>);
500
501 impl CreateBackup {
502 pub(crate) fn new(
503 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
504 ) -> Self {
505 Self(RequestBuilder::new(stub))
506 }
507
508 pub fn with_request<V: Into<crate::model::CreateBackupRequest>>(mut self, v: V) -> Self {
510 self.0.request = v.into();
511 self
512 }
513
514 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
516 self.0.options = v.into();
517 self
518 }
519
520 pub async fn send(self) -> Result<crate::model::Operation> {
522 (*self.0.stub)
523 .create_backup(self.0.request, self.0.options)
524 .await
525 .map(crate::Response::into_body)
526 }
527
528 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
532 self.0.request.parent = v.into();
533 self
534 }
535
536 pub fn set_backup<T>(mut self, v: T) -> Self
540 where
541 T: std::convert::Into<crate::model::Backup>,
542 {
543 self.0.request.backup = std::option::Option::Some(v.into());
544 self
545 }
546
547 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
551 where
552 T: std::convert::Into<crate::model::Backup>,
553 {
554 self.0.request.backup = v.map(|x| x.into());
555 self
556 }
557 }
558
559 #[doc(hidden)]
560 impl crate::RequestBuilder for CreateBackup {
561 fn request_options(&mut self) -> &mut crate::RequestOptions {
562 &mut self.0.options
563 }
564 }
565
566 #[derive(Clone, Debug)]
583 pub struct GetBackup(RequestBuilder<crate::model::GetBackupRequest>);
584
585 impl GetBackup {
586 pub(crate) fn new(
587 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
588 ) -> Self {
589 Self(RequestBuilder::new(stub))
590 }
591
592 pub fn with_request<V: Into<crate::model::GetBackupRequest>>(mut self, v: V) -> Self {
594 self.0.request = v.into();
595 self
596 }
597
598 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
600 self.0.options = v.into();
601 self
602 }
603
604 pub async fn send(self) -> Result<crate::model::Backup> {
606 (*self.0.stub)
607 .get_backup(self.0.request, self.0.options)
608 .await
609 .map(crate::Response::into_body)
610 }
611
612 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
616 self.0.request.name = v.into();
617 self
618 }
619 }
620
621 #[doc(hidden)]
622 impl crate::RequestBuilder for GetBackup {
623 fn request_options(&mut self) -> &mut crate::RequestOptions {
624 &mut self.0.options
625 }
626 }
627
628 #[derive(Clone, Debug)]
649 pub struct ListBackups(RequestBuilder<crate::model::ListBackupsRequest>);
650
651 impl ListBackups {
652 pub(crate) fn new(
653 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
654 ) -> Self {
655 Self(RequestBuilder::new(stub))
656 }
657
658 pub fn with_request<V: Into<crate::model::ListBackupsRequest>>(mut self, v: V) -> Self {
660 self.0.request = v.into();
661 self
662 }
663
664 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
666 self.0.options = v.into();
667 self
668 }
669
670 pub async fn send(self) -> Result<crate::model::ListBackupsResponse> {
672 (*self.0.stub)
673 .list_backups(self.0.request, self.0.options)
674 .await
675 .map(crate::Response::into_body)
676 }
677
678 pub fn by_page(
680 self,
681 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListBackupsResponse, crate::Error>
682 {
683 use std::clone::Clone;
684 let token = self.0.request.page_token.clone();
685 let execute = move |token: String| {
686 let mut builder = self.clone();
687 builder.0.request = builder.0.request.set_page_token(token);
688 builder.send()
689 };
690 google_cloud_gax::paginator::internal::new_paginator(token, execute)
691 }
692
693 pub fn by_item(
695 self,
696 ) -> impl google_cloud_gax::paginator::ItemPaginator<
697 crate::model::ListBackupsResponse,
698 crate::Error,
699 > {
700 use google_cloud_gax::paginator::Paginator;
701 self.by_page().items()
702 }
703
704 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
708 self.0.request.parent = v.into();
709 self
710 }
711
712 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
714 self.0.request.page_size = v.into();
715 self
716 }
717
718 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
720 self.0.request.page_token = v.into();
721 self
722 }
723
724 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
726 self.0.request.filter = v.into();
727 self
728 }
729 }
730
731 #[doc(hidden)]
732 impl crate::RequestBuilder for ListBackups {
733 fn request_options(&mut self) -> &mut crate::RequestOptions {
734 &mut self.0.options
735 }
736 }
737
738 #[derive(Clone, Debug)]
755 pub struct UpdateBackup(RequestBuilder<crate::model::UpdateBackupRequest>);
756
757 impl UpdateBackup {
758 pub(crate) fn new(
759 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
760 ) -> Self {
761 Self(RequestBuilder::new(stub))
762 }
763
764 pub fn with_request<V: Into<crate::model::UpdateBackupRequest>>(mut self, v: V) -> Self {
766 self.0.request = v.into();
767 self
768 }
769
770 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
772 self.0.options = v.into();
773 self
774 }
775
776 pub async fn send(self) -> Result<crate::model::Operation> {
778 (*self.0.stub)
779 .update_backup(self.0.request, self.0.options)
780 .await
781 .map(crate::Response::into_body)
782 }
783
784 pub fn set_backup<T>(mut self, v: T) -> Self
788 where
789 T: std::convert::Into<crate::model::Backup>,
790 {
791 self.0.request.backup = std::option::Option::Some(v.into());
792 self
793 }
794
795 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
799 where
800 T: std::convert::Into<crate::model::Backup>,
801 {
802 self.0.request.backup = v.map(|x| x.into());
803 self
804 }
805
806 pub fn set_update_mask<T>(mut self, v: T) -> Self
808 where
809 T: std::convert::Into<wkt::FieldMask>,
810 {
811 self.0.request.update_mask = std::option::Option::Some(v.into());
812 self
813 }
814
815 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
817 where
818 T: std::convert::Into<wkt::FieldMask>,
819 {
820 self.0.request.update_mask = v.map(|x| x.into());
821 self
822 }
823 }
824
825 #[doc(hidden)]
826 impl crate::RequestBuilder for UpdateBackup {
827 fn request_options(&mut self) -> &mut crate::RequestOptions {
828 &mut self.0.options
829 }
830 }
831
832 #[derive(Clone, Debug)]
849 pub struct DeleteBackup(RequestBuilder<crate::model::DeleteBackupRequest>);
850
851 impl DeleteBackup {
852 pub(crate) fn new(
853 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupsService>,
854 ) -> Self {
855 Self(RequestBuilder::new(stub))
856 }
857
858 pub fn with_request<V: Into<crate::model::DeleteBackupRequest>>(mut self, v: V) -> Self {
860 self.0.request = v.into();
861 self
862 }
863
864 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
866 self.0.options = v.into();
867 self
868 }
869
870 pub async fn send(self) -> Result<crate::model::Operation> {
872 (*self.0.stub)
873 .delete_backup(self.0.request, self.0.options)
874 .await
875 .map(crate::Response::into_body)
876 }
877
878 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
882 self.0.request.name = v.into();
883 self
884 }
885 }
886
887 #[doc(hidden)]
888 impl crate::RequestBuilder for DeleteBackup {
889 fn request_options(&mut self) -> &mut crate::RequestOptions {
890 &mut self.0.options
891 }
892 }
893}
894
895pub mod blue_green_deployments_service {
897 use crate::Result;
898
899 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
913
914 pub(crate) mod client {
915 use super::super::super::client::BlueGreenDeploymentsService;
916 pub struct Factory;
917 impl crate::ClientFactory for Factory {
918 type Client = BlueGreenDeploymentsService;
919 type Credentials = gaxi::options::Credentials;
920 async fn build(
921 self,
922 config: gaxi::options::ClientConfig,
923 ) -> crate::ClientBuilderResult<Self::Client> {
924 Self::Client::new(config).await
925 }
926 }
927 }
928
929 #[derive(Clone, Debug)]
931 pub(crate) struct RequestBuilder<R: std::default::Default> {
932 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlueGreenDeploymentsService>,
933 request: R,
934 options: crate::RequestOptions,
935 }
936
937 impl<R> RequestBuilder<R>
938 where
939 R: std::default::Default,
940 {
941 pub(crate) fn new(
942 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlueGreenDeploymentsService>,
943 ) -> Self {
944 Self {
945 stub,
946 request: R::default(),
947 options: crate::RequestOptions::default(),
948 }
949 }
950 }
951
952 #[derive(Clone, Debug)]
969 pub struct CreateBlueGreenDeployment(
970 RequestBuilder<crate::model::CreateBlueGreenDeploymentRequest>,
971 );
972
973 impl CreateBlueGreenDeployment {
974 pub(crate) fn new(
975 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlueGreenDeploymentsService>,
976 ) -> Self {
977 Self(RequestBuilder::new(stub))
978 }
979
980 pub fn with_request<V: Into<crate::model::CreateBlueGreenDeploymentRequest>>(
982 mut self,
983 v: V,
984 ) -> Self {
985 self.0.request = v.into();
986 self
987 }
988
989 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
991 self.0.options = v.into();
992 self
993 }
994
995 pub async fn send(self) -> Result<crate::model::Operation> {
997 (*self.0.stub)
998 .create_blue_green_deployment(self.0.request, self.0.options)
999 .await
1000 .map(crate::Response::into_body)
1001 }
1002
1003 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1007 self.0.request.parent = v.into();
1008 self
1009 }
1010
1011 pub fn set_blue_green_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1015 self.0.request.blue_green_deployment_id = v.into();
1016 self
1017 }
1018
1019 pub fn set_blue_green_deployment<T>(mut self, v: T) -> Self
1023 where
1024 T: std::convert::Into<crate::model::BlueGreenDeployment>,
1025 {
1026 self.0.request.blue_green_deployment = std::option::Option::Some(v.into());
1027 self
1028 }
1029
1030 pub fn set_or_clear_blue_green_deployment<T>(mut self, v: std::option::Option<T>) -> Self
1034 where
1035 T: std::convert::Into<crate::model::BlueGreenDeployment>,
1036 {
1037 self.0.request.blue_green_deployment = v.map(|x| x.into());
1038 self
1039 }
1040 }
1041
1042 #[doc(hidden)]
1043 impl crate::RequestBuilder for CreateBlueGreenDeployment {
1044 fn request_options(&mut self) -> &mut crate::RequestOptions {
1045 &mut self.0.options
1046 }
1047 }
1048
1049 #[derive(Clone, Debug)]
1066 pub struct GetBlueGreenDeployment(RequestBuilder<crate::model::GetBlueGreenDeploymentRequest>);
1067
1068 impl GetBlueGreenDeployment {
1069 pub(crate) fn new(
1070 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlueGreenDeploymentsService>,
1071 ) -> Self {
1072 Self(RequestBuilder::new(stub))
1073 }
1074
1075 pub fn with_request<V: Into<crate::model::GetBlueGreenDeploymentRequest>>(
1077 mut self,
1078 v: V,
1079 ) -> Self {
1080 self.0.request = v.into();
1081 self
1082 }
1083
1084 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1086 self.0.options = v.into();
1087 self
1088 }
1089
1090 pub async fn send(self) -> Result<crate::model::BlueGreenDeployment> {
1092 (*self.0.stub)
1093 .get_blue_green_deployment(self.0.request, self.0.options)
1094 .await
1095 .map(crate::Response::into_body)
1096 }
1097
1098 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1102 self.0.request.name = v.into();
1103 self
1104 }
1105
1106 pub fn set_view<
1108 T: Into<crate::model::get_blue_green_deployment_request::BlueGreenDeploymentView>,
1109 >(
1110 mut self,
1111 v: T,
1112 ) -> Self {
1113 self.0.request.view = v.into();
1114 self
1115 }
1116 }
1117
1118 #[doc(hidden)]
1119 impl crate::RequestBuilder for GetBlueGreenDeployment {
1120 fn request_options(&mut self) -> &mut crate::RequestOptions {
1121 &mut self.0.options
1122 }
1123 }
1124
1125 #[derive(Clone, Debug)]
1142 pub struct SwitchoverBlueGreenDeployment(
1143 RequestBuilder<crate::model::SwitchoverBlueGreenDeploymentRequest>,
1144 );
1145
1146 impl SwitchoverBlueGreenDeployment {
1147 pub(crate) fn new(
1148 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlueGreenDeploymentsService>,
1149 ) -> Self {
1150 Self(RequestBuilder::new(stub))
1151 }
1152
1153 pub fn with_request<V: Into<crate::model::SwitchoverBlueGreenDeploymentRequest>>(
1155 mut self,
1156 v: V,
1157 ) -> Self {
1158 self.0.request = v.into();
1159 self
1160 }
1161
1162 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1164 self.0.options = v.into();
1165 self
1166 }
1167
1168 pub async fn send(self) -> Result<crate::model::Operation> {
1170 (*self.0.stub)
1171 .switchover_blue_green_deployment(self.0.request, self.0.options)
1172 .await
1173 .map(crate::Response::into_body)
1174 }
1175
1176 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1180 self.0.request.name = v.into();
1181 self
1182 }
1183 }
1184
1185 #[doc(hidden)]
1186 impl crate::RequestBuilder for SwitchoverBlueGreenDeployment {
1187 fn request_options(&mut self) -> &mut crate::RequestOptions {
1188 &mut self.0.options
1189 }
1190 }
1191
1192 #[derive(Clone, Debug)]
1213 pub struct ListBlueGreenDeployments(
1214 RequestBuilder<crate::model::ListBlueGreenDeploymentsRequest>,
1215 );
1216
1217 impl ListBlueGreenDeployments {
1218 pub(crate) fn new(
1219 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlueGreenDeploymentsService>,
1220 ) -> Self {
1221 Self(RequestBuilder::new(stub))
1222 }
1223
1224 pub fn with_request<V: Into<crate::model::ListBlueGreenDeploymentsRequest>>(
1226 mut self,
1227 v: V,
1228 ) -> Self {
1229 self.0.request = v.into();
1230 self
1231 }
1232
1233 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1235 self.0.options = v.into();
1236 self
1237 }
1238
1239 pub async fn send(self) -> Result<crate::model::ListBlueGreenDeploymentsResponse> {
1241 (*self.0.stub)
1242 .list_blue_green_deployments(self.0.request, self.0.options)
1243 .await
1244 .map(crate::Response::into_body)
1245 }
1246
1247 pub fn by_page(
1249 self,
1250 ) -> impl google_cloud_gax::paginator::Paginator<
1251 crate::model::ListBlueGreenDeploymentsResponse,
1252 crate::Error,
1253 > {
1254 use std::clone::Clone;
1255 let token = self.0.request.page_token.clone();
1256 let execute = move |token: String| {
1257 let mut builder = self.clone();
1258 builder.0.request = builder.0.request.set_page_token(token);
1259 builder.send()
1260 };
1261 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1262 }
1263
1264 pub fn by_item(
1266 self,
1267 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1268 crate::model::ListBlueGreenDeploymentsResponse,
1269 crate::Error,
1270 > {
1271 use google_cloud_gax::paginator::Paginator;
1272 self.by_page().items()
1273 }
1274
1275 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1279 self.0.request.parent = v.into();
1280 self
1281 }
1282
1283 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1285 self.0.request.page_size = v.into();
1286 self
1287 }
1288
1289 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1291 self.0.request.page_token = v.into();
1292 self
1293 }
1294
1295 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1297 self.0.request.filter = v.into();
1298 self
1299 }
1300
1301 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1303 self.0.request.order_by = v.into();
1304 self
1305 }
1306 }
1307
1308 #[doc(hidden)]
1309 impl crate::RequestBuilder for ListBlueGreenDeployments {
1310 fn request_options(&mut self) -> &mut crate::RequestOptions {
1311 &mut self.0.options
1312 }
1313 }
1314
1315 #[derive(Clone, Debug)]
1332 pub struct DeleteBlueGreenDeployment(
1333 RequestBuilder<crate::model::DeleteBlueGreenDeploymentRequest>,
1334 );
1335
1336 impl DeleteBlueGreenDeployment {
1337 pub(crate) fn new(
1338 stub: std::sync::Arc<dyn super::super::stub::dynamic::BlueGreenDeploymentsService>,
1339 ) -> Self {
1340 Self(RequestBuilder::new(stub))
1341 }
1342
1343 pub fn with_request<V: Into<crate::model::DeleteBlueGreenDeploymentRequest>>(
1345 mut self,
1346 v: V,
1347 ) -> Self {
1348 self.0.request = v.into();
1349 self
1350 }
1351
1352 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1354 self.0.options = v.into();
1355 self
1356 }
1357
1358 pub async fn send(self) -> Result<crate::model::Operation> {
1360 (*self.0.stub)
1361 .delete_blue_green_deployment(self.0.request, self.0.options)
1362 .await
1363 .map(crate::Response::into_body)
1364 }
1365
1366 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1370 self.0.request.name = v.into();
1371 self
1372 }
1373
1374 pub fn set_delete_old_source<T: Into<bool>>(mut self, v: T) -> Self {
1376 self.0.request.delete_old_source = v.into();
1377 self
1378 }
1379 }
1380
1381 #[doc(hidden)]
1382 impl crate::RequestBuilder for DeleteBlueGreenDeployment {
1383 fn request_options(&mut self) -> &mut crate::RequestOptions {
1384 &mut self.0.options
1385 }
1386 }
1387}
1388
1389pub mod sql_connect_service {
1391 use crate::Result;
1392
1393 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1407
1408 pub(crate) mod client {
1409 use super::super::super::client::SqlConnectService;
1410 pub struct Factory;
1411 impl crate::ClientFactory for Factory {
1412 type Client = SqlConnectService;
1413 type Credentials = gaxi::options::Credentials;
1414 async fn build(
1415 self,
1416 config: gaxi::options::ClientConfig,
1417 ) -> crate::ClientBuilderResult<Self::Client> {
1418 Self::Client::new(config).await
1419 }
1420 }
1421 }
1422
1423 #[derive(Clone, Debug)]
1425 pub(crate) struct RequestBuilder<R: std::default::Default> {
1426 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
1427 request: R,
1428 options: crate::RequestOptions,
1429 }
1430
1431 impl<R> RequestBuilder<R>
1432 where
1433 R: std::default::Default,
1434 {
1435 pub(crate) fn new(
1436 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
1437 ) -> Self {
1438 Self {
1439 stub,
1440 request: R::default(),
1441 options: crate::RequestOptions::default(),
1442 }
1443 }
1444 }
1445
1446 #[derive(Clone, Debug)]
1463 pub struct GetConnectSettings(RequestBuilder<crate::model::GetConnectSettingsRequest>);
1464
1465 impl GetConnectSettings {
1466 pub(crate) fn new(
1467 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
1468 ) -> Self {
1469 Self(RequestBuilder::new(stub))
1470 }
1471
1472 pub fn with_request<V: Into<crate::model::GetConnectSettingsRequest>>(
1474 mut self,
1475 v: V,
1476 ) -> Self {
1477 self.0.request = v.into();
1478 self
1479 }
1480
1481 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1483 self.0.options = v.into();
1484 self
1485 }
1486
1487 pub async fn send(self) -> Result<crate::model::ConnectSettings> {
1489 (*self.0.stub)
1490 .get_connect_settings(self.0.request, self.0.options)
1491 .await
1492 .map(crate::Response::into_body)
1493 }
1494
1495 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1497 self.0.request.instance = v.into();
1498 self
1499 }
1500
1501 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1503 self.0.request.project = v.into();
1504 self
1505 }
1506
1507 pub fn set_read_time<T>(mut self, v: T) -> Self
1509 where
1510 T: std::convert::Into<wkt::Timestamp>,
1511 {
1512 self.0.request.read_time = std::option::Option::Some(v.into());
1513 self
1514 }
1515
1516 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1518 where
1519 T: std::convert::Into<wkt::Timestamp>,
1520 {
1521 self.0.request.read_time = v.map(|x| x.into());
1522 self
1523 }
1524 }
1525
1526 #[doc(hidden)]
1527 impl crate::RequestBuilder for GetConnectSettings {
1528 fn request_options(&mut self) -> &mut crate::RequestOptions {
1529 &mut self.0.options
1530 }
1531 }
1532
1533 #[derive(Clone, Debug)]
1550 pub struct ResolveConnectSettings(RequestBuilder<crate::model::ResolveConnectSettingsRequest>);
1551
1552 impl ResolveConnectSettings {
1553 pub(crate) fn new(
1554 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
1555 ) -> Self {
1556 Self(RequestBuilder::new(stub))
1557 }
1558
1559 pub fn with_request<V: Into<crate::model::ResolveConnectSettingsRequest>>(
1561 mut self,
1562 v: V,
1563 ) -> Self {
1564 self.0.request = v.into();
1565 self
1566 }
1567
1568 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1570 self.0.options = v.into();
1571 self
1572 }
1573
1574 pub async fn send(self) -> Result<crate::model::ConnectSettings> {
1576 (*self.0.stub)
1577 .resolve_connect_settings(self.0.request, self.0.options)
1578 .await
1579 .map(crate::Response::into_body)
1580 }
1581
1582 pub fn set_dns_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1586 self.0.request.dns_name = v.into();
1587 self
1588 }
1589
1590 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1594 self.0.request.location = v.into();
1595 self
1596 }
1597 }
1598
1599 #[doc(hidden)]
1600 impl crate::RequestBuilder for ResolveConnectSettings {
1601 fn request_options(&mut self) -> &mut crate::RequestOptions {
1602 &mut self.0.options
1603 }
1604 }
1605
1606 #[derive(Clone, Debug)]
1623 pub struct GenerateEphemeralCert(RequestBuilder<crate::model::GenerateEphemeralCertRequest>);
1624
1625 impl GenerateEphemeralCert {
1626 pub(crate) fn new(
1627 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
1628 ) -> Self {
1629 Self(RequestBuilder::new(stub))
1630 }
1631
1632 pub fn with_request<V: Into<crate::model::GenerateEphemeralCertRequest>>(
1634 mut self,
1635 v: V,
1636 ) -> Self {
1637 self.0.request = v.into();
1638 self
1639 }
1640
1641 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1643 self.0.options = v.into();
1644 self
1645 }
1646
1647 pub async fn send(self) -> Result<crate::model::GenerateEphemeralCertResponse> {
1649 (*self.0.stub)
1650 .generate_ephemeral_cert(self.0.request, self.0.options)
1651 .await
1652 .map(crate::Response::into_body)
1653 }
1654
1655 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1657 self.0.request.instance = v.into();
1658 self
1659 }
1660
1661 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1663 self.0.request.project = v.into();
1664 self
1665 }
1666
1667 pub fn set_public_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1669 self.0.request.public_key = v.into();
1670 self
1671 }
1672
1673 pub fn set_access_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1675 self.0.request.access_token = v.into();
1676 self
1677 }
1678
1679 pub fn set_read_time<T>(mut self, v: T) -> Self
1681 where
1682 T: std::convert::Into<wkt::Timestamp>,
1683 {
1684 self.0.request.read_time = std::option::Option::Some(v.into());
1685 self
1686 }
1687
1688 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1690 where
1691 T: std::convert::Into<wkt::Timestamp>,
1692 {
1693 self.0.request.read_time = v.map(|x| x.into());
1694 self
1695 }
1696
1697 pub fn set_valid_duration<T>(mut self, v: T) -> Self
1699 where
1700 T: std::convert::Into<wkt::Duration>,
1701 {
1702 self.0.request.valid_duration = std::option::Option::Some(v.into());
1703 self
1704 }
1705
1706 pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
1708 where
1709 T: std::convert::Into<wkt::Duration>,
1710 {
1711 self.0.request.valid_duration = v.map(|x| x.into());
1712 self
1713 }
1714 }
1715
1716 #[doc(hidden)]
1717 impl crate::RequestBuilder for GenerateEphemeralCert {
1718 fn request_options(&mut self) -> &mut crate::RequestOptions {
1719 &mut self.0.options
1720 }
1721 }
1722}
1723
1724pub mod sql_databases_service {
1726 use crate::Result;
1727
1728 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1742
1743 pub(crate) mod client {
1744 use super::super::super::client::SqlDatabasesService;
1745 pub struct Factory;
1746 impl crate::ClientFactory for Factory {
1747 type Client = SqlDatabasesService;
1748 type Credentials = gaxi::options::Credentials;
1749 async fn build(
1750 self,
1751 config: gaxi::options::ClientConfig,
1752 ) -> crate::ClientBuilderResult<Self::Client> {
1753 Self::Client::new(config).await
1754 }
1755 }
1756 }
1757
1758 #[derive(Clone, Debug)]
1760 pub(crate) struct RequestBuilder<R: std::default::Default> {
1761 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1762 request: R,
1763 options: crate::RequestOptions,
1764 }
1765
1766 impl<R> RequestBuilder<R>
1767 where
1768 R: std::default::Default,
1769 {
1770 pub(crate) fn new(
1771 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1772 ) -> Self {
1773 Self {
1774 stub,
1775 request: R::default(),
1776 options: crate::RequestOptions::default(),
1777 }
1778 }
1779 }
1780
1781 #[derive(Clone, Debug)]
1798 pub struct Delete(RequestBuilder<crate::model::SqlDatabasesDeleteRequest>);
1799
1800 impl Delete {
1801 pub(crate) fn new(
1802 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1803 ) -> Self {
1804 Self(RequestBuilder::new(stub))
1805 }
1806
1807 pub fn with_request<V: Into<crate::model::SqlDatabasesDeleteRequest>>(
1809 mut self,
1810 v: V,
1811 ) -> Self {
1812 self.0.request = v.into();
1813 self
1814 }
1815
1816 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1818 self.0.options = v.into();
1819 self
1820 }
1821
1822 pub async fn send(self) -> Result<crate::model::Operation> {
1824 (*self.0.stub)
1825 .delete(self.0.request, self.0.options)
1826 .await
1827 .map(crate::Response::into_body)
1828 }
1829
1830 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1832 self.0.request.database = v.into();
1833 self
1834 }
1835
1836 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1838 self.0.request.instance = v.into();
1839 self
1840 }
1841
1842 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1844 self.0.request.project = v.into();
1845 self
1846 }
1847
1848 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1850 self.0.request.location = v.into();
1851 self
1852 }
1853 }
1854
1855 #[doc(hidden)]
1856 impl crate::RequestBuilder for Delete {
1857 fn request_options(&mut self) -> &mut crate::RequestOptions {
1858 &mut self.0.options
1859 }
1860 }
1861
1862 #[derive(Clone, Debug)]
1879 pub struct Get(RequestBuilder<crate::model::SqlDatabasesGetRequest>);
1880
1881 impl Get {
1882 pub(crate) fn new(
1883 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1884 ) -> Self {
1885 Self(RequestBuilder::new(stub))
1886 }
1887
1888 pub fn with_request<V: Into<crate::model::SqlDatabasesGetRequest>>(mut self, v: V) -> Self {
1890 self.0.request = v.into();
1891 self
1892 }
1893
1894 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1896 self.0.options = v.into();
1897 self
1898 }
1899
1900 pub async fn send(self) -> Result<crate::model::Database> {
1902 (*self.0.stub)
1903 .get(self.0.request, self.0.options)
1904 .await
1905 .map(crate::Response::into_body)
1906 }
1907
1908 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1910 self.0.request.database = v.into();
1911 self
1912 }
1913
1914 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1916 self.0.request.instance = v.into();
1917 self
1918 }
1919
1920 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1922 self.0.request.project = v.into();
1923 self
1924 }
1925
1926 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1928 self.0.request.location = v.into();
1929 self
1930 }
1931 }
1932
1933 #[doc(hidden)]
1934 impl crate::RequestBuilder for Get {
1935 fn request_options(&mut self) -> &mut crate::RequestOptions {
1936 &mut self.0.options
1937 }
1938 }
1939
1940 #[derive(Clone, Debug)]
1957 pub struct Insert(RequestBuilder<crate::model::SqlDatabasesInsertRequest>);
1958
1959 impl Insert {
1960 pub(crate) fn new(
1961 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1962 ) -> Self {
1963 Self(RequestBuilder::new(stub))
1964 }
1965
1966 pub fn with_request<V: Into<crate::model::SqlDatabasesInsertRequest>>(
1968 mut self,
1969 v: V,
1970 ) -> Self {
1971 self.0.request = v.into();
1972 self
1973 }
1974
1975 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1977 self.0.options = v.into();
1978 self
1979 }
1980
1981 pub async fn send(self) -> Result<crate::model::Operation> {
1983 (*self.0.stub)
1984 .insert(self.0.request, self.0.options)
1985 .await
1986 .map(crate::Response::into_body)
1987 }
1988
1989 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1991 self.0.request.instance = v.into();
1992 self
1993 }
1994
1995 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1997 self.0.request.project = v.into();
1998 self
1999 }
2000
2001 pub fn set_body<T>(mut self, v: T) -> Self
2003 where
2004 T: std::convert::Into<crate::model::Database>,
2005 {
2006 self.0.request.body = std::option::Option::Some(v.into());
2007 self
2008 }
2009
2010 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2012 where
2013 T: std::convert::Into<crate::model::Database>,
2014 {
2015 self.0.request.body = v.map(|x| x.into());
2016 self
2017 }
2018
2019 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2021 self.0.request.location = v.into();
2022 self
2023 }
2024 }
2025
2026 #[doc(hidden)]
2027 impl crate::RequestBuilder for Insert {
2028 fn request_options(&mut self) -> &mut crate::RequestOptions {
2029 &mut self.0.options
2030 }
2031 }
2032
2033 #[derive(Clone, Debug)]
2050 pub struct List(RequestBuilder<crate::model::SqlDatabasesListRequest>);
2051
2052 impl List {
2053 pub(crate) fn new(
2054 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
2055 ) -> Self {
2056 Self(RequestBuilder::new(stub))
2057 }
2058
2059 pub fn with_request<V: Into<crate::model::SqlDatabasesListRequest>>(
2061 mut self,
2062 v: V,
2063 ) -> Self {
2064 self.0.request = v.into();
2065 self
2066 }
2067
2068 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2070 self.0.options = v.into();
2071 self
2072 }
2073
2074 pub async fn send(self) -> Result<crate::model::DatabasesListResponse> {
2076 (*self.0.stub)
2077 .list(self.0.request, self.0.options)
2078 .await
2079 .map(crate::Response::into_body)
2080 }
2081
2082 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2084 self.0.request.instance = v.into();
2085 self
2086 }
2087
2088 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2090 self.0.request.project = v.into();
2091 self
2092 }
2093
2094 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2096 self.0.request.location = v.into();
2097 self
2098 }
2099 }
2100
2101 #[doc(hidden)]
2102 impl crate::RequestBuilder for List {
2103 fn request_options(&mut self) -> &mut crate::RequestOptions {
2104 &mut self.0.options
2105 }
2106 }
2107
2108 #[derive(Clone, Debug)]
2125 pub struct Patch(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
2126
2127 impl Patch {
2128 pub(crate) fn new(
2129 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
2130 ) -> Self {
2131 Self(RequestBuilder::new(stub))
2132 }
2133
2134 pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
2136 mut self,
2137 v: V,
2138 ) -> Self {
2139 self.0.request = v.into();
2140 self
2141 }
2142
2143 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2145 self.0.options = v.into();
2146 self
2147 }
2148
2149 pub async fn send(self) -> Result<crate::model::Operation> {
2151 (*self.0.stub)
2152 .patch(self.0.request, self.0.options)
2153 .await
2154 .map(crate::Response::into_body)
2155 }
2156
2157 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
2159 self.0.request.database = v.into();
2160 self
2161 }
2162
2163 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2165 self.0.request.instance = v.into();
2166 self
2167 }
2168
2169 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2171 self.0.request.project = v.into();
2172 self
2173 }
2174
2175 pub fn set_body<T>(mut self, v: T) -> Self
2177 where
2178 T: std::convert::Into<crate::model::Database>,
2179 {
2180 self.0.request.body = std::option::Option::Some(v.into());
2181 self
2182 }
2183
2184 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2186 where
2187 T: std::convert::Into<crate::model::Database>,
2188 {
2189 self.0.request.body = v.map(|x| x.into());
2190 self
2191 }
2192
2193 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2195 self.0.request.location = v.into();
2196 self
2197 }
2198 }
2199
2200 #[doc(hidden)]
2201 impl crate::RequestBuilder for Patch {
2202 fn request_options(&mut self) -> &mut crate::RequestOptions {
2203 &mut self.0.options
2204 }
2205 }
2206
2207 #[derive(Clone, Debug)]
2224 pub struct Update(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
2225
2226 impl Update {
2227 pub(crate) fn new(
2228 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
2229 ) -> Self {
2230 Self(RequestBuilder::new(stub))
2231 }
2232
2233 pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
2235 mut self,
2236 v: V,
2237 ) -> Self {
2238 self.0.request = v.into();
2239 self
2240 }
2241
2242 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2244 self.0.options = v.into();
2245 self
2246 }
2247
2248 pub async fn send(self) -> Result<crate::model::Operation> {
2250 (*self.0.stub)
2251 .update(self.0.request, self.0.options)
2252 .await
2253 .map(crate::Response::into_body)
2254 }
2255
2256 pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
2258 self.0.request.database = v.into();
2259 self
2260 }
2261
2262 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2264 self.0.request.instance = v.into();
2265 self
2266 }
2267
2268 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2270 self.0.request.project = v.into();
2271 self
2272 }
2273
2274 pub fn set_body<T>(mut self, v: T) -> Self
2276 where
2277 T: std::convert::Into<crate::model::Database>,
2278 {
2279 self.0.request.body = std::option::Option::Some(v.into());
2280 self
2281 }
2282
2283 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2285 where
2286 T: std::convert::Into<crate::model::Database>,
2287 {
2288 self.0.request.body = v.map(|x| x.into());
2289 self
2290 }
2291
2292 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2294 self.0.request.location = v.into();
2295 self
2296 }
2297 }
2298
2299 #[doc(hidden)]
2300 impl crate::RequestBuilder for Update {
2301 fn request_options(&mut self) -> &mut crate::RequestOptions {
2302 &mut self.0.options
2303 }
2304 }
2305}
2306
2307pub mod sql_flags_service {
2309 use crate::Result;
2310
2311 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2325
2326 pub(crate) mod client {
2327 use super::super::super::client::SqlFlagsService;
2328 pub struct Factory;
2329 impl crate::ClientFactory for Factory {
2330 type Client = SqlFlagsService;
2331 type Credentials = gaxi::options::Credentials;
2332 async fn build(
2333 self,
2334 config: gaxi::options::ClientConfig,
2335 ) -> crate::ClientBuilderResult<Self::Client> {
2336 Self::Client::new(config).await
2337 }
2338 }
2339 }
2340
2341 #[derive(Clone, Debug)]
2343 pub(crate) struct RequestBuilder<R: std::default::Default> {
2344 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
2345 request: R,
2346 options: crate::RequestOptions,
2347 }
2348
2349 impl<R> RequestBuilder<R>
2350 where
2351 R: std::default::Default,
2352 {
2353 pub(crate) fn new(
2354 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
2355 ) -> Self {
2356 Self {
2357 stub,
2358 request: R::default(),
2359 options: crate::RequestOptions::default(),
2360 }
2361 }
2362 }
2363
2364 #[derive(Clone, Debug)]
2381 pub struct List(RequestBuilder<crate::model::SqlFlagsListRequest>);
2382
2383 impl List {
2384 pub(crate) fn new(
2385 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
2386 ) -> Self {
2387 Self(RequestBuilder::new(stub))
2388 }
2389
2390 pub fn with_request<V: Into<crate::model::SqlFlagsListRequest>>(mut self, v: V) -> Self {
2392 self.0.request = v.into();
2393 self
2394 }
2395
2396 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2398 self.0.options = v.into();
2399 self
2400 }
2401
2402 pub async fn send(self) -> Result<crate::model::FlagsListResponse> {
2404 (*self.0.stub)
2405 .list(self.0.request, self.0.options)
2406 .await
2407 .map(crate::Response::into_body)
2408 }
2409
2410 pub fn set_database_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
2412 self.0.request.database_version = v.into();
2413 self
2414 }
2415
2416 pub fn set_flag_scope<T>(mut self, v: T) -> Self
2418 where
2419 T: std::convert::Into<crate::model::SqlFlagScope>,
2420 {
2421 self.0.request.flag_scope = std::option::Option::Some(v.into());
2422 self
2423 }
2424
2425 pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
2427 where
2428 T: std::convert::Into<crate::model::SqlFlagScope>,
2429 {
2430 self.0.request.flag_scope = v.map(|x| x.into());
2431 self
2432 }
2433 }
2434
2435 #[doc(hidden)]
2436 impl crate::RequestBuilder for List {
2437 fn request_options(&mut self) -> &mut crate::RequestOptions {
2438 &mut self.0.options
2439 }
2440 }
2441}
2442
2443pub mod sql_instances_service {
2445 use crate::Result;
2446
2447 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2461
2462 pub(crate) mod client {
2463 use super::super::super::client::SqlInstancesService;
2464 pub struct Factory;
2465 impl crate::ClientFactory for Factory {
2466 type Client = SqlInstancesService;
2467 type Credentials = gaxi::options::Credentials;
2468 async fn build(
2469 self,
2470 config: gaxi::options::ClientConfig,
2471 ) -> crate::ClientBuilderResult<Self::Client> {
2472 Self::Client::new(config).await
2473 }
2474 }
2475 }
2476
2477 #[derive(Clone, Debug)]
2479 pub(crate) struct RequestBuilder<R: std::default::Default> {
2480 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2481 request: R,
2482 options: crate::RequestOptions,
2483 }
2484
2485 impl<R> RequestBuilder<R>
2486 where
2487 R: std::default::Default,
2488 {
2489 pub(crate) fn new(
2490 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2491 ) -> Self {
2492 Self {
2493 stub,
2494 request: R::default(),
2495 options: crate::RequestOptions::default(),
2496 }
2497 }
2498 }
2499
2500 #[derive(Clone, Debug)]
2517 pub struct AddServerCa(RequestBuilder<crate::model::SqlInstancesAddServerCaRequest>);
2518
2519 impl AddServerCa {
2520 pub(crate) fn new(
2521 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2522 ) -> Self {
2523 Self(RequestBuilder::new(stub))
2524 }
2525
2526 pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCaRequest>>(
2528 mut self,
2529 v: V,
2530 ) -> Self {
2531 self.0.request = v.into();
2532 self
2533 }
2534
2535 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2537 self.0.options = v.into();
2538 self
2539 }
2540
2541 pub async fn send(self) -> Result<crate::model::Operation> {
2543 (*self.0.stub)
2544 .add_server_ca(self.0.request, self.0.options)
2545 .await
2546 .map(crate::Response::into_body)
2547 }
2548
2549 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2551 self.0.request.instance = v.into();
2552 self
2553 }
2554
2555 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2557 self.0.request.project = v.into();
2558 self
2559 }
2560
2561 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2563 self.0.request.location = v.into();
2564 self
2565 }
2566 }
2567
2568 #[doc(hidden)]
2569 impl crate::RequestBuilder for AddServerCa {
2570 fn request_options(&mut self) -> &mut crate::RequestOptions {
2571 &mut self.0.options
2572 }
2573 }
2574
2575 #[derive(Clone, Debug)]
2592 pub struct AddServerCertificate(
2593 RequestBuilder<crate::model::SqlInstancesAddServerCertificateRequest>,
2594 );
2595
2596 impl AddServerCertificate {
2597 pub(crate) fn new(
2598 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2599 ) -> Self {
2600 Self(RequestBuilder::new(stub))
2601 }
2602
2603 pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCertificateRequest>>(
2605 mut self,
2606 v: V,
2607 ) -> Self {
2608 self.0.request = v.into();
2609 self
2610 }
2611
2612 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2614 self.0.options = v.into();
2615 self
2616 }
2617
2618 pub async fn send(self) -> Result<crate::model::Operation> {
2620 (*self.0.stub)
2621 .add_server_certificate(self.0.request, self.0.options)
2622 .await
2623 .map(crate::Response::into_body)
2624 }
2625
2626 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2628 self.0.request.instance = v.into();
2629 self
2630 }
2631
2632 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2634 self.0.request.project = v.into();
2635 self
2636 }
2637
2638 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2640 self.0.request.location = v.into();
2641 self
2642 }
2643 }
2644
2645 #[doc(hidden)]
2646 impl crate::RequestBuilder for AddServerCertificate {
2647 fn request_options(&mut self) -> &mut crate::RequestOptions {
2648 &mut self.0.options
2649 }
2650 }
2651
2652 #[derive(Clone, Debug)]
2669 pub struct AddEntraIdCertificate(
2670 RequestBuilder<crate::model::SqlInstancesAddEntraIdCertificateRequest>,
2671 );
2672
2673 impl AddEntraIdCertificate {
2674 pub(crate) fn new(
2675 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2676 ) -> Self {
2677 Self(RequestBuilder::new(stub))
2678 }
2679
2680 pub fn with_request<V: Into<crate::model::SqlInstancesAddEntraIdCertificateRequest>>(
2682 mut self,
2683 v: V,
2684 ) -> Self {
2685 self.0.request = v.into();
2686 self
2687 }
2688
2689 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2691 self.0.options = v.into();
2692 self
2693 }
2694
2695 pub async fn send(self) -> Result<crate::model::Operation> {
2697 (*self.0.stub)
2698 .add_entra_id_certificate(self.0.request, self.0.options)
2699 .await
2700 .map(crate::Response::into_body)
2701 }
2702
2703 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2707 self.0.request.instance = v.into();
2708 self
2709 }
2710
2711 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2715 self.0.request.project = v.into();
2716 self
2717 }
2718
2719 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2721 self.0.request.location = v.into();
2722 self
2723 }
2724 }
2725
2726 #[doc(hidden)]
2727 impl crate::RequestBuilder for AddEntraIdCertificate {
2728 fn request_options(&mut self) -> &mut crate::RequestOptions {
2729 &mut self.0.options
2730 }
2731 }
2732
2733 #[derive(Clone, Debug)]
2750 pub struct Clone(RequestBuilder<crate::model::SqlInstancesCloneRequest>);
2751
2752 impl Clone {
2753 pub(crate) fn new(
2754 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2755 ) -> Self {
2756 Self(RequestBuilder::new(stub))
2757 }
2758
2759 pub fn with_request<V: Into<crate::model::SqlInstancesCloneRequest>>(
2761 mut self,
2762 v: V,
2763 ) -> Self {
2764 self.0.request = v.into();
2765 self
2766 }
2767
2768 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2770 self.0.options = v.into();
2771 self
2772 }
2773
2774 pub async fn send(self) -> Result<crate::model::Operation> {
2776 (*self.0.stub)
2777 .clone(self.0.request, self.0.options)
2778 .await
2779 .map(crate::Response::into_body)
2780 }
2781
2782 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2786 self.0.request.instance = v.into();
2787 self
2788 }
2789
2790 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2794 self.0.request.project = v.into();
2795 self
2796 }
2797
2798 pub fn set_body<T>(mut self, v: T) -> Self
2802 where
2803 T: std::convert::Into<crate::model::InstancesCloneRequest>,
2804 {
2805 self.0.request.body = std::option::Option::Some(v.into());
2806 self
2807 }
2808
2809 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2813 where
2814 T: std::convert::Into<crate::model::InstancesCloneRequest>,
2815 {
2816 self.0.request.body = v.map(|x| x.into());
2817 self
2818 }
2819
2820 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2822 self.0.request.location = v.into();
2823 self
2824 }
2825 }
2826
2827 #[doc(hidden)]
2828 impl crate::RequestBuilder for Clone {
2829 fn request_options(&mut self) -> &mut crate::RequestOptions {
2830 &mut self.0.options
2831 }
2832 }
2833
2834 #[derive(Clone, Debug)]
2851 pub struct Delete(RequestBuilder<crate::model::SqlInstancesDeleteRequest>);
2852
2853 impl Delete {
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::SqlInstancesDeleteRequest>>(
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<crate::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 .delete(self.0.request, self.0.options)
2879 .await
2880 .map(crate::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 pub fn set_enable_final_backup<T>(mut self, v: T) -> Self
2897 where
2898 T: std::convert::Into<bool>,
2899 {
2900 self.0.request.enable_final_backup = std::option::Option::Some(v.into());
2901 self
2902 }
2903
2904 pub fn set_or_clear_enable_final_backup<T>(mut self, v: std::option::Option<T>) -> Self
2906 where
2907 T: std::convert::Into<bool>,
2908 {
2909 self.0.request.enable_final_backup = v.map(|x| x.into());
2910 self
2911 }
2912
2913 pub fn set_final_backup_description<T: Into<std::string::String>>(mut self, v: T) -> Self {
2915 self.0.request.final_backup_description = v.into();
2916 self
2917 }
2918
2919 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2921 self.0.request.location = v.into();
2922 self
2923 }
2924
2925 pub fn set_expiration<
2930 T: Into<Option<crate::model::sql_instances_delete_request::Expiration>>,
2931 >(
2932 mut self,
2933 v: T,
2934 ) -> Self {
2935 self.0.request.expiration = v.into();
2936 self
2937 }
2938
2939 pub fn set_final_backup_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2945 self.0.request = self.0.request.set_final_backup_ttl_days(v);
2946 self
2947 }
2948
2949 pub fn set_final_backup_expiry_time<
2955 T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>,
2956 >(
2957 mut self,
2958 v: T,
2959 ) -> Self {
2960 self.0.request = self.0.request.set_final_backup_expiry_time(v);
2961 self
2962 }
2963 }
2964
2965 #[doc(hidden)]
2966 impl crate::RequestBuilder for Delete {
2967 fn request_options(&mut self) -> &mut crate::RequestOptions {
2968 &mut self.0.options
2969 }
2970 }
2971
2972 #[derive(Clone, Debug)]
2989 pub struct DemoteMaster(RequestBuilder<crate::model::SqlInstancesDemoteMasterRequest>);
2990
2991 impl DemoteMaster {
2992 pub(crate) fn new(
2993 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2994 ) -> Self {
2995 Self(RequestBuilder::new(stub))
2996 }
2997
2998 pub fn with_request<V: Into<crate::model::SqlInstancesDemoteMasterRequest>>(
3000 mut self,
3001 v: V,
3002 ) -> Self {
3003 self.0.request = v.into();
3004 self
3005 }
3006
3007 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3009 self.0.options = v.into();
3010 self
3011 }
3012
3013 pub async fn send(self) -> Result<crate::model::Operation> {
3015 (*self.0.stub)
3016 .demote_master(self.0.request, self.0.options)
3017 .await
3018 .map(crate::Response::into_body)
3019 }
3020
3021 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3023 self.0.request.instance = v.into();
3024 self
3025 }
3026
3027 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3029 self.0.request.project = v.into();
3030 self
3031 }
3032
3033 pub fn set_body<T>(mut self, v: T) -> Self
3035 where
3036 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
3037 {
3038 self.0.request.body = std::option::Option::Some(v.into());
3039 self
3040 }
3041
3042 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3044 where
3045 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
3046 {
3047 self.0.request.body = v.map(|x| x.into());
3048 self
3049 }
3050
3051 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3053 self.0.request.location = v.into();
3054 self
3055 }
3056 }
3057
3058 #[doc(hidden)]
3059 impl crate::RequestBuilder for DemoteMaster {
3060 fn request_options(&mut self) -> &mut crate::RequestOptions {
3061 &mut self.0.options
3062 }
3063 }
3064
3065 #[derive(Clone, Debug)]
3082 pub struct Demote(RequestBuilder<crate::model::SqlInstancesDemoteRequest>);
3083
3084 impl Demote {
3085 pub(crate) fn new(
3086 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3087 ) -> Self {
3088 Self(RequestBuilder::new(stub))
3089 }
3090
3091 pub fn with_request<V: Into<crate::model::SqlInstancesDemoteRequest>>(
3093 mut self,
3094 v: V,
3095 ) -> Self {
3096 self.0.request = v.into();
3097 self
3098 }
3099
3100 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3102 self.0.options = v.into();
3103 self
3104 }
3105
3106 pub async fn send(self) -> Result<crate::model::Operation> {
3108 (*self.0.stub)
3109 .demote(self.0.request, self.0.options)
3110 .await
3111 .map(crate::Response::into_body)
3112 }
3113
3114 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3118 self.0.request.instance = v.into();
3119 self
3120 }
3121
3122 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3126 self.0.request.project = v.into();
3127 self
3128 }
3129
3130 pub fn set_body<T>(mut self, v: T) -> Self
3134 where
3135 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
3136 {
3137 self.0.request.body = std::option::Option::Some(v.into());
3138 self
3139 }
3140
3141 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3145 where
3146 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
3147 {
3148 self.0.request.body = v.map(|x| x.into());
3149 self
3150 }
3151
3152 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3154 self.0.request.location = v.into();
3155 self
3156 }
3157 }
3158
3159 #[doc(hidden)]
3160 impl crate::RequestBuilder for Demote {
3161 fn request_options(&mut self) -> &mut crate::RequestOptions {
3162 &mut self.0.options
3163 }
3164 }
3165
3166 #[derive(Clone, Debug)]
3183 pub struct Export(RequestBuilder<crate::model::SqlInstancesExportRequest>);
3184
3185 impl Export {
3186 pub(crate) fn new(
3187 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3188 ) -> Self {
3189 Self(RequestBuilder::new(stub))
3190 }
3191
3192 pub fn with_request<V: Into<crate::model::SqlInstancesExportRequest>>(
3194 mut self,
3195 v: V,
3196 ) -> Self {
3197 self.0.request = v.into();
3198 self
3199 }
3200
3201 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3203 self.0.options = v.into();
3204 self
3205 }
3206
3207 pub async fn send(self) -> Result<crate::model::Operation> {
3209 (*self.0.stub)
3210 .export(self.0.request, self.0.options)
3211 .await
3212 .map(crate::Response::into_body)
3213 }
3214
3215 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3217 self.0.request.instance = v.into();
3218 self
3219 }
3220
3221 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3223 self.0.request.project = v.into();
3224 self
3225 }
3226
3227 pub fn set_body<T>(mut self, v: T) -> Self
3229 where
3230 T: std::convert::Into<crate::model::InstancesExportRequest>,
3231 {
3232 self.0.request.body = std::option::Option::Some(v.into());
3233 self
3234 }
3235
3236 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3238 where
3239 T: std::convert::Into<crate::model::InstancesExportRequest>,
3240 {
3241 self.0.request.body = v.map(|x| x.into());
3242 self
3243 }
3244
3245 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3247 self.0.request.location = v.into();
3248 self
3249 }
3250 }
3251
3252 #[doc(hidden)]
3253 impl crate::RequestBuilder for Export {
3254 fn request_options(&mut self) -> &mut crate::RequestOptions {
3255 &mut self.0.options
3256 }
3257 }
3258
3259 #[derive(Clone, Debug)]
3276 pub struct Failover(RequestBuilder<crate::model::SqlInstancesFailoverRequest>);
3277
3278 impl Failover {
3279 pub(crate) fn new(
3280 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3281 ) -> Self {
3282 Self(RequestBuilder::new(stub))
3283 }
3284
3285 pub fn with_request<V: Into<crate::model::SqlInstancesFailoverRequest>>(
3287 mut self,
3288 v: V,
3289 ) -> Self {
3290 self.0.request = v.into();
3291 self
3292 }
3293
3294 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3296 self.0.options = v.into();
3297 self
3298 }
3299
3300 pub async fn send(self) -> Result<crate::model::Operation> {
3302 (*self.0.stub)
3303 .failover(self.0.request, self.0.options)
3304 .await
3305 .map(crate::Response::into_body)
3306 }
3307
3308 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3310 self.0.request.instance = v.into();
3311 self
3312 }
3313
3314 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3316 self.0.request.project = v.into();
3317 self
3318 }
3319
3320 pub fn set_body<T>(mut self, v: T) -> Self
3322 where
3323 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
3324 {
3325 self.0.request.body = std::option::Option::Some(v.into());
3326 self
3327 }
3328
3329 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3331 where
3332 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
3333 {
3334 self.0.request.body = v.map(|x| x.into());
3335 self
3336 }
3337
3338 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3340 self.0.request.location = v.into();
3341 self
3342 }
3343 }
3344
3345 #[doc(hidden)]
3346 impl crate::RequestBuilder for Failover {
3347 fn request_options(&mut self) -> &mut crate::RequestOptions {
3348 &mut self.0.options
3349 }
3350 }
3351
3352 #[derive(Clone, Debug)]
3369 pub struct Reencrypt(RequestBuilder<crate::model::SqlInstancesReencryptRequest>);
3370
3371 impl Reencrypt {
3372 pub(crate) fn new(
3373 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3374 ) -> Self {
3375 Self(RequestBuilder::new(stub))
3376 }
3377
3378 pub fn with_request<V: Into<crate::model::SqlInstancesReencryptRequest>>(
3380 mut self,
3381 v: V,
3382 ) -> Self {
3383 self.0.request = v.into();
3384 self
3385 }
3386
3387 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3389 self.0.options = v.into();
3390 self
3391 }
3392
3393 pub async fn send(self) -> Result<crate::model::Operation> {
3395 (*self.0.stub)
3396 .reencrypt(self.0.request, self.0.options)
3397 .await
3398 .map(crate::Response::into_body)
3399 }
3400
3401 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3403 self.0.request.instance = v.into();
3404 self
3405 }
3406
3407 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3409 self.0.request.project = v.into();
3410 self
3411 }
3412
3413 pub fn set_body<T>(mut self, v: T) -> Self
3415 where
3416 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
3417 {
3418 self.0.request.body = std::option::Option::Some(v.into());
3419 self
3420 }
3421
3422 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3424 where
3425 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
3426 {
3427 self.0.request.body = v.map(|x| x.into());
3428 self
3429 }
3430
3431 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3433 self.0.request.location = v.into();
3434 self
3435 }
3436 }
3437
3438 #[doc(hidden)]
3439 impl crate::RequestBuilder for Reencrypt {
3440 fn request_options(&mut self) -> &mut crate::RequestOptions {
3441 &mut self.0.options
3442 }
3443 }
3444
3445 #[derive(Clone, Debug)]
3462 pub struct Get(RequestBuilder<crate::model::SqlInstancesGetRequest>);
3463
3464 impl Get {
3465 pub(crate) fn new(
3466 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3467 ) -> Self {
3468 Self(RequestBuilder::new(stub))
3469 }
3470
3471 pub fn with_request<V: Into<crate::model::SqlInstancesGetRequest>>(mut self, v: V) -> Self {
3473 self.0.request = v.into();
3474 self
3475 }
3476
3477 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3479 self.0.options = v.into();
3480 self
3481 }
3482
3483 pub async fn send(self) -> Result<crate::model::DatabaseInstance> {
3485 (*self.0.stub)
3486 .get(self.0.request, self.0.options)
3487 .await
3488 .map(crate::Response::into_body)
3489 }
3490
3491 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3495 self.0.request.instance = v.into();
3496 self
3497 }
3498
3499 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3503 self.0.request.project = v.into();
3504 self
3505 }
3506
3507 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3509 self.0.request.location = v.into();
3510 self
3511 }
3512 }
3513
3514 #[doc(hidden)]
3515 impl crate::RequestBuilder for Get {
3516 fn request_options(&mut self) -> &mut crate::RequestOptions {
3517 &mut self.0.options
3518 }
3519 }
3520
3521 #[derive(Clone, Debug)]
3538 pub struct Import(RequestBuilder<crate::model::SqlInstancesImportRequest>);
3539
3540 impl Import {
3541 pub(crate) fn new(
3542 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3543 ) -> Self {
3544 Self(RequestBuilder::new(stub))
3545 }
3546
3547 pub fn with_request<V: Into<crate::model::SqlInstancesImportRequest>>(
3549 mut self,
3550 v: V,
3551 ) -> Self {
3552 self.0.request = v.into();
3553 self
3554 }
3555
3556 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3558 self.0.options = v.into();
3559 self
3560 }
3561
3562 pub async fn send(self) -> Result<crate::model::Operation> {
3564 (*self.0.stub)
3565 .import(self.0.request, self.0.options)
3566 .await
3567 .map(crate::Response::into_body)
3568 }
3569
3570 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3572 self.0.request.instance = v.into();
3573 self
3574 }
3575
3576 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3578 self.0.request.project = v.into();
3579 self
3580 }
3581
3582 pub fn set_body<T>(mut self, v: T) -> Self
3584 where
3585 T: std::convert::Into<crate::model::InstancesImportRequest>,
3586 {
3587 self.0.request.body = std::option::Option::Some(v.into());
3588 self
3589 }
3590
3591 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3593 where
3594 T: std::convert::Into<crate::model::InstancesImportRequest>,
3595 {
3596 self.0.request.body = v.map(|x| x.into());
3597 self
3598 }
3599
3600 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3602 self.0.request.location = v.into();
3603 self
3604 }
3605 }
3606
3607 #[doc(hidden)]
3608 impl crate::RequestBuilder for Import {
3609 fn request_options(&mut self) -> &mut crate::RequestOptions {
3610 &mut self.0.options
3611 }
3612 }
3613
3614 #[derive(Clone, Debug)]
3631 pub struct Insert(RequestBuilder<crate::model::SqlInstancesInsertRequest>);
3632
3633 impl Insert {
3634 pub(crate) fn new(
3635 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3636 ) -> Self {
3637 Self(RequestBuilder::new(stub))
3638 }
3639
3640 pub fn with_request<V: Into<crate::model::SqlInstancesInsertRequest>>(
3642 mut self,
3643 v: V,
3644 ) -> Self {
3645 self.0.request = v.into();
3646 self
3647 }
3648
3649 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3651 self.0.options = v.into();
3652 self
3653 }
3654
3655 pub async fn send(self) -> Result<crate::model::Operation> {
3657 (*self.0.stub)
3658 .insert(self.0.request, self.0.options)
3659 .await
3660 .map(crate::Response::into_body)
3661 }
3662
3663 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3665 self.0.request.project = v.into();
3666 self
3667 }
3668
3669 pub fn set_body<T>(mut self, v: T) -> Self
3671 where
3672 T: std::convert::Into<crate::model::DatabaseInstance>,
3673 {
3674 self.0.request.body = std::option::Option::Some(v.into());
3675 self
3676 }
3677
3678 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3680 where
3681 T: std::convert::Into<crate::model::DatabaseInstance>,
3682 {
3683 self.0.request.body = v.map(|x| x.into());
3684 self
3685 }
3686
3687 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3689 self.0.request.location = v.into();
3690 self
3691 }
3692 }
3693
3694 #[doc(hidden)]
3695 impl crate::RequestBuilder for Insert {
3696 fn request_options(&mut self) -> &mut crate::RequestOptions {
3697 &mut self.0.options
3698 }
3699 }
3700
3701 #[derive(Clone, Debug)]
3722 pub struct List(RequestBuilder<crate::model::SqlInstancesListRequest>);
3723
3724 impl List {
3725 pub(crate) fn new(
3726 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3727 ) -> Self {
3728 Self(RequestBuilder::new(stub))
3729 }
3730
3731 pub fn with_request<V: Into<crate::model::SqlInstancesListRequest>>(
3733 mut self,
3734 v: V,
3735 ) -> Self {
3736 self.0.request = v.into();
3737 self
3738 }
3739
3740 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3742 self.0.options = v.into();
3743 self
3744 }
3745
3746 pub async fn send(self) -> Result<crate::model::InstancesListResponse> {
3748 (*self.0.stub)
3749 .list(self.0.request, self.0.options)
3750 .await
3751 .map(crate::Response::into_body)
3752 }
3753
3754 pub fn by_page(
3756 self,
3757 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::InstancesListResponse, crate::Error>
3758 {
3759 use std::clone::Clone;
3760 let token = self.0.request.page_token.clone();
3761 let execute = move |token: String| {
3762 let mut builder = self.clone();
3763 builder.0.request = builder.0.request.set_page_token(token);
3764 builder.send()
3765 };
3766 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3767 }
3768
3769 pub fn by_item(
3771 self,
3772 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3773 crate::model::InstancesListResponse,
3774 crate::Error,
3775 > {
3776 use google_cloud_gax::paginator::Paginator;
3777 self.by_page().items()
3778 }
3779
3780 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3782 self.0.request.filter = v.into();
3783 self
3784 }
3785
3786 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
3788 self.0.request.max_results = v.into();
3789 self
3790 }
3791
3792 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3794 self.0.request.page_token = v.into();
3795 self
3796 }
3797
3798 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3800 self.0.request.project = v.into();
3801 self
3802 }
3803
3804 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3806 self.0.request.location = v.into();
3807 self
3808 }
3809 }
3810
3811 #[doc(hidden)]
3812 impl crate::RequestBuilder for List {
3813 fn request_options(&mut self) -> &mut crate::RequestOptions {
3814 &mut self.0.options
3815 }
3816 }
3817
3818 #[derive(Clone, Debug)]
3835 pub struct ListServerCas(RequestBuilder<crate::model::SqlInstancesListServerCasRequest>);
3836
3837 impl ListServerCas {
3838 pub(crate) fn new(
3839 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3840 ) -> Self {
3841 Self(RequestBuilder::new(stub))
3842 }
3843
3844 pub fn with_request<V: Into<crate::model::SqlInstancesListServerCasRequest>>(
3846 mut self,
3847 v: V,
3848 ) -> Self {
3849 self.0.request = v.into();
3850 self
3851 }
3852
3853 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3855 self.0.options = v.into();
3856 self
3857 }
3858
3859 pub async fn send(self) -> Result<crate::model::InstancesListServerCasResponse> {
3861 (*self.0.stub)
3862 .list_server_cas(self.0.request, self.0.options)
3863 .await
3864 .map(crate::Response::into_body)
3865 }
3866
3867 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3869 self.0.request.instance = v.into();
3870 self
3871 }
3872
3873 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3875 self.0.request.project = v.into();
3876 self
3877 }
3878
3879 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3881 self.0.request.location = v.into();
3882 self
3883 }
3884 }
3885
3886 #[doc(hidden)]
3887 impl crate::RequestBuilder for ListServerCas {
3888 fn request_options(&mut self) -> &mut crate::RequestOptions {
3889 &mut self.0.options
3890 }
3891 }
3892
3893 #[derive(Clone, Debug)]
3910 pub struct ListServerCertificates(
3911 RequestBuilder<crate::model::SqlInstancesListServerCertificatesRequest>,
3912 );
3913
3914 impl ListServerCertificates {
3915 pub(crate) fn new(
3916 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3917 ) -> Self {
3918 Self(RequestBuilder::new(stub))
3919 }
3920
3921 pub fn with_request<V: Into<crate::model::SqlInstancesListServerCertificatesRequest>>(
3923 mut self,
3924 v: V,
3925 ) -> Self {
3926 self.0.request = v.into();
3927 self
3928 }
3929
3930 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3932 self.0.options = v.into();
3933 self
3934 }
3935
3936 pub async fn send(self) -> Result<crate::model::InstancesListServerCertificatesResponse> {
3938 (*self.0.stub)
3939 .list_server_certificates(self.0.request, self.0.options)
3940 .await
3941 .map(crate::Response::into_body)
3942 }
3943
3944 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3948 self.0.request.instance = v.into();
3949 self
3950 }
3951
3952 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3956 self.0.request.project = v.into();
3957 self
3958 }
3959
3960 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
3962 self.0.request.location = v.into();
3963 self
3964 }
3965 }
3966
3967 #[doc(hidden)]
3968 impl crate::RequestBuilder for ListServerCertificates {
3969 fn request_options(&mut self) -> &mut crate::RequestOptions {
3970 &mut self.0.options
3971 }
3972 }
3973
3974 #[derive(Clone, Debug)]
3991 pub struct ListEntraIdCertificates(
3992 RequestBuilder<crate::model::SqlInstancesListEntraIdCertificatesRequest>,
3993 );
3994
3995 impl ListEntraIdCertificates {
3996 pub(crate) fn new(
3997 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3998 ) -> Self {
3999 Self(RequestBuilder::new(stub))
4000 }
4001
4002 pub fn with_request<V: Into<crate::model::SqlInstancesListEntraIdCertificatesRequest>>(
4004 mut self,
4005 v: V,
4006 ) -> Self {
4007 self.0.request = v.into();
4008 self
4009 }
4010
4011 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4013 self.0.options = v.into();
4014 self
4015 }
4016
4017 pub async fn send(self) -> Result<crate::model::InstancesListEntraIdCertificatesResponse> {
4019 (*self.0.stub)
4020 .list_entra_id_certificates(self.0.request, self.0.options)
4021 .await
4022 .map(crate::Response::into_body)
4023 }
4024
4025 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4029 self.0.request.instance = v.into();
4030 self
4031 }
4032
4033 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4037 self.0.request.project = v.into();
4038 self
4039 }
4040
4041 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4043 self.0.request.location = v.into();
4044 self
4045 }
4046 }
4047
4048 #[doc(hidden)]
4049 impl crate::RequestBuilder for ListEntraIdCertificates {
4050 fn request_options(&mut self) -> &mut crate::RequestOptions {
4051 &mut self.0.options
4052 }
4053 }
4054
4055 #[derive(Clone, Debug)]
4072 pub struct Patch(RequestBuilder<crate::model::SqlInstancesPatchRequest>);
4073
4074 impl Patch {
4075 pub(crate) fn new(
4076 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4077 ) -> Self {
4078 Self(RequestBuilder::new(stub))
4079 }
4080
4081 pub fn with_request<V: Into<crate::model::SqlInstancesPatchRequest>>(
4083 mut self,
4084 v: V,
4085 ) -> Self {
4086 self.0.request = v.into();
4087 self
4088 }
4089
4090 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4092 self.0.options = v.into();
4093 self
4094 }
4095
4096 pub async fn send(self) -> Result<crate::model::Operation> {
4098 (*self.0.stub)
4099 .patch(self.0.request, self.0.options)
4100 .await
4101 .map(crate::Response::into_body)
4102 }
4103
4104 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4106 self.0.request.instance = v.into();
4107 self
4108 }
4109
4110 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4112 self.0.request.project = v.into();
4113 self
4114 }
4115
4116 pub fn set_reconcile_psc_networking<T>(mut self, v: T) -> Self
4118 where
4119 T: std::convert::Into<bool>,
4120 {
4121 self.0.request.reconcile_psc_networking = std::option::Option::Some(v.into());
4122 self
4123 }
4124
4125 pub fn set_or_clear_reconcile_psc_networking<T>(mut self, v: std::option::Option<T>) -> Self
4127 where
4128 T: std::convert::Into<bool>,
4129 {
4130 self.0.request.reconcile_psc_networking = v.map(|x| x.into());
4131 self
4132 }
4133
4134 pub fn set_reconcile_psc_networking_force<T>(mut self, v: T) -> Self
4136 where
4137 T: std::convert::Into<bool>,
4138 {
4139 self.0.request.reconcile_psc_networking_force = std::option::Option::Some(v.into());
4140 self
4141 }
4142
4143 pub fn set_or_clear_reconcile_psc_networking_force<T>(
4145 mut self,
4146 v: std::option::Option<T>,
4147 ) -> Self
4148 where
4149 T: std::convert::Into<bool>,
4150 {
4151 self.0.request.reconcile_psc_networking_force = v.map(|x| x.into());
4152 self
4153 }
4154
4155 pub fn set_body<T>(mut self, v: T) -> Self
4157 where
4158 T: std::convert::Into<crate::model::DatabaseInstance>,
4159 {
4160 self.0.request.body = std::option::Option::Some(v.into());
4161 self
4162 }
4163
4164 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4166 where
4167 T: std::convert::Into<crate::model::DatabaseInstance>,
4168 {
4169 self.0.request.body = v.map(|x| x.into());
4170 self
4171 }
4172
4173 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4175 self.0.request.location = v.into();
4176 self
4177 }
4178 }
4179
4180 #[doc(hidden)]
4181 impl crate::RequestBuilder for Patch {
4182 fn request_options(&mut self) -> &mut crate::RequestOptions {
4183 &mut self.0.options
4184 }
4185 }
4186
4187 #[derive(Clone, Debug)]
4204 pub struct PromoteReplica(RequestBuilder<crate::model::SqlInstancesPromoteReplicaRequest>);
4205
4206 impl PromoteReplica {
4207 pub(crate) fn new(
4208 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4209 ) -> Self {
4210 Self(RequestBuilder::new(stub))
4211 }
4212
4213 pub fn with_request<V: Into<crate::model::SqlInstancesPromoteReplicaRequest>>(
4215 mut self,
4216 v: V,
4217 ) -> Self {
4218 self.0.request = v.into();
4219 self
4220 }
4221
4222 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4224 self.0.options = v.into();
4225 self
4226 }
4227
4228 pub async fn send(self) -> Result<crate::model::Operation> {
4230 (*self.0.stub)
4231 .promote_replica(self.0.request, self.0.options)
4232 .await
4233 .map(crate::Response::into_body)
4234 }
4235
4236 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4238 self.0.request.instance = v.into();
4239 self
4240 }
4241
4242 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4244 self.0.request.project = v.into();
4245 self
4246 }
4247
4248 pub fn set_failover<T: Into<bool>>(mut self, v: T) -> Self {
4250 self.0.request.failover = v.into();
4251 self
4252 }
4253
4254 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4256 self.0.request.location = v.into();
4257 self
4258 }
4259 }
4260
4261 #[doc(hidden)]
4262 impl crate::RequestBuilder for PromoteReplica {
4263 fn request_options(&mut self) -> &mut crate::RequestOptions {
4264 &mut self.0.options
4265 }
4266 }
4267
4268 #[derive(Clone, Debug)]
4285 pub struct Switchover(RequestBuilder<crate::model::SqlInstancesSwitchoverRequest>);
4286
4287 impl Switchover {
4288 pub(crate) fn new(
4289 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4290 ) -> Self {
4291 Self(RequestBuilder::new(stub))
4292 }
4293
4294 pub fn with_request<V: Into<crate::model::SqlInstancesSwitchoverRequest>>(
4296 mut self,
4297 v: V,
4298 ) -> Self {
4299 self.0.request = v.into();
4300 self
4301 }
4302
4303 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4305 self.0.options = v.into();
4306 self
4307 }
4308
4309 pub async fn send(self) -> Result<crate::model::Operation> {
4311 (*self.0.stub)
4312 .switchover(self.0.request, self.0.options)
4313 .await
4314 .map(crate::Response::into_body)
4315 }
4316
4317 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4319 self.0.request.instance = v.into();
4320 self
4321 }
4322
4323 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4325 self.0.request.project = v.into();
4326 self
4327 }
4328
4329 pub fn set_db_timeout<T>(mut self, v: T) -> Self
4331 where
4332 T: std::convert::Into<wkt::Duration>,
4333 {
4334 self.0.request.db_timeout = std::option::Option::Some(v.into());
4335 self
4336 }
4337
4338 pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
4340 where
4341 T: std::convert::Into<wkt::Duration>,
4342 {
4343 self.0.request.db_timeout = v.map(|x| x.into());
4344 self
4345 }
4346
4347 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4349 self.0.request.location = v.into();
4350 self
4351 }
4352 }
4353
4354 #[doc(hidden)]
4355 impl crate::RequestBuilder for Switchover {
4356 fn request_options(&mut self) -> &mut crate::RequestOptions {
4357 &mut self.0.options
4358 }
4359 }
4360
4361 #[derive(Clone, Debug)]
4378 pub struct ResetSslConfig(RequestBuilder<crate::model::SqlInstancesResetSslConfigRequest>);
4379
4380 impl ResetSslConfig {
4381 pub(crate) fn new(
4382 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4383 ) -> Self {
4384 Self(RequestBuilder::new(stub))
4385 }
4386
4387 pub fn with_request<V: Into<crate::model::SqlInstancesResetSslConfigRequest>>(
4389 mut self,
4390 v: V,
4391 ) -> Self {
4392 self.0.request = v.into();
4393 self
4394 }
4395
4396 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4398 self.0.options = v.into();
4399 self
4400 }
4401
4402 pub async fn send(self) -> Result<crate::model::Operation> {
4404 (*self.0.stub)
4405 .reset_ssl_config(self.0.request, self.0.options)
4406 .await
4407 .map(crate::Response::into_body)
4408 }
4409
4410 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4412 self.0.request.instance = v.into();
4413 self
4414 }
4415
4416 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4418 self.0.request.project = v.into();
4419 self
4420 }
4421
4422 pub fn set_mode<
4424 T: Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
4425 >(
4426 mut self,
4427 v: T,
4428 ) -> Self {
4429 self.0.request.mode = v.into();
4430 self
4431 }
4432
4433 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4435 self.0.request.location = v.into();
4436 self
4437 }
4438 }
4439
4440 #[doc(hidden)]
4441 impl crate::RequestBuilder for ResetSslConfig {
4442 fn request_options(&mut self) -> &mut crate::RequestOptions {
4443 &mut self.0.options
4444 }
4445 }
4446
4447 #[derive(Clone, Debug)]
4464 pub struct Restart(RequestBuilder<crate::model::SqlInstancesRestartRequest>);
4465
4466 impl Restart {
4467 pub(crate) fn new(
4468 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4469 ) -> Self {
4470 Self(RequestBuilder::new(stub))
4471 }
4472
4473 pub fn with_request<V: Into<crate::model::SqlInstancesRestartRequest>>(
4475 mut self,
4476 v: V,
4477 ) -> Self {
4478 self.0.request = v.into();
4479 self
4480 }
4481
4482 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4484 self.0.options = v.into();
4485 self
4486 }
4487
4488 pub async fn send(self) -> Result<crate::model::Operation> {
4490 (*self.0.stub)
4491 .restart(self.0.request, self.0.options)
4492 .await
4493 .map(crate::Response::into_body)
4494 }
4495
4496 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4498 self.0.request.instance = v.into();
4499 self
4500 }
4501
4502 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4504 self.0.request.project = v.into();
4505 self
4506 }
4507
4508 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4510 self.0.request.location = v.into();
4511 self
4512 }
4513 }
4514
4515 #[doc(hidden)]
4516 impl crate::RequestBuilder for Restart {
4517 fn request_options(&mut self) -> &mut crate::RequestOptions {
4518 &mut self.0.options
4519 }
4520 }
4521
4522 #[derive(Clone, Debug)]
4539 pub struct RestoreBackup(RequestBuilder<crate::model::SqlInstancesRestoreBackupRequest>);
4540
4541 impl RestoreBackup {
4542 pub(crate) fn new(
4543 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4544 ) -> Self {
4545 Self(RequestBuilder::new(stub))
4546 }
4547
4548 pub fn with_request<V: Into<crate::model::SqlInstancesRestoreBackupRequest>>(
4550 mut self,
4551 v: V,
4552 ) -> Self {
4553 self.0.request = v.into();
4554 self
4555 }
4556
4557 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4559 self.0.options = v.into();
4560 self
4561 }
4562
4563 pub async fn send(self) -> Result<crate::model::Operation> {
4565 (*self.0.stub)
4566 .restore_backup(self.0.request, self.0.options)
4567 .await
4568 .map(crate::Response::into_body)
4569 }
4570
4571 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4573 self.0.request.instance = v.into();
4574 self
4575 }
4576
4577 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4579 self.0.request.project = v.into();
4580 self
4581 }
4582
4583 pub fn set_body<T>(mut self, v: T) -> Self
4585 where
4586 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
4587 {
4588 self.0.request.body = std::option::Option::Some(v.into());
4589 self
4590 }
4591
4592 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4594 where
4595 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
4596 {
4597 self.0.request.body = v.map(|x| x.into());
4598 self
4599 }
4600
4601 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4603 self.0.request.location = v.into();
4604 self
4605 }
4606 }
4607
4608 #[doc(hidden)]
4609 impl crate::RequestBuilder for RestoreBackup {
4610 fn request_options(&mut self) -> &mut crate::RequestOptions {
4611 &mut self.0.options
4612 }
4613 }
4614
4615 #[derive(Clone, Debug)]
4632 pub struct RotateServerCa(RequestBuilder<crate::model::SqlInstancesRotateServerCaRequest>);
4633
4634 impl RotateServerCa {
4635 pub(crate) fn new(
4636 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4637 ) -> Self {
4638 Self(RequestBuilder::new(stub))
4639 }
4640
4641 pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCaRequest>>(
4643 mut self,
4644 v: V,
4645 ) -> Self {
4646 self.0.request = v.into();
4647 self
4648 }
4649
4650 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4652 self.0.options = v.into();
4653 self
4654 }
4655
4656 pub async fn send(self) -> Result<crate::model::Operation> {
4658 (*self.0.stub)
4659 .rotate_server_ca(self.0.request, self.0.options)
4660 .await
4661 .map(crate::Response::into_body)
4662 }
4663
4664 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4666 self.0.request.instance = v.into();
4667 self
4668 }
4669
4670 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4672 self.0.request.project = v.into();
4673 self
4674 }
4675
4676 pub fn set_body<T>(mut self, v: T) -> Self
4678 where
4679 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
4680 {
4681 self.0.request.body = std::option::Option::Some(v.into());
4682 self
4683 }
4684
4685 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4687 where
4688 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
4689 {
4690 self.0.request.body = v.map(|x| x.into());
4691 self
4692 }
4693
4694 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4696 self.0.request.location = v.into();
4697 self
4698 }
4699 }
4700
4701 #[doc(hidden)]
4702 impl crate::RequestBuilder for RotateServerCa {
4703 fn request_options(&mut self) -> &mut crate::RequestOptions {
4704 &mut self.0.options
4705 }
4706 }
4707
4708 #[derive(Clone, Debug)]
4725 pub struct RotateServerCertificate(
4726 RequestBuilder<crate::model::SqlInstancesRotateServerCertificateRequest>,
4727 );
4728
4729 impl RotateServerCertificate {
4730 pub(crate) fn new(
4731 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4732 ) -> Self {
4733 Self(RequestBuilder::new(stub))
4734 }
4735
4736 pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCertificateRequest>>(
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<crate::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 .rotate_server_certificate(self.0.request, self.0.options)
4755 .await
4756 .map(crate::Response::into_body)
4757 }
4758
4759 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4763 self.0.request.instance = v.into();
4764 self
4765 }
4766
4767 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4771 self.0.request.project = v.into();
4772 self
4773 }
4774
4775 pub fn set_body<T>(mut self, v: T) -> Self
4777 where
4778 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
4779 {
4780 self.0.request.body = std::option::Option::Some(v.into());
4781 self
4782 }
4783
4784 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4786 where
4787 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
4788 {
4789 self.0.request.body = v.map(|x| x.into());
4790 self
4791 }
4792
4793 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4795 self.0.request.location = v.into();
4796 self
4797 }
4798 }
4799
4800 #[doc(hidden)]
4801 impl crate::RequestBuilder for RotateServerCertificate {
4802 fn request_options(&mut self) -> &mut crate::RequestOptions {
4803 &mut self.0.options
4804 }
4805 }
4806
4807 #[derive(Clone, Debug)]
4824 pub struct RotateEntraIdCertificate(
4825 RequestBuilder<crate::model::SqlInstancesRotateEntraIdCertificateRequest>,
4826 );
4827
4828 impl RotateEntraIdCertificate {
4829 pub(crate) fn new(
4830 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4831 ) -> Self {
4832 Self(RequestBuilder::new(stub))
4833 }
4834
4835 pub fn with_request<V: Into<crate::model::SqlInstancesRotateEntraIdCertificateRequest>>(
4837 mut self,
4838 v: V,
4839 ) -> Self {
4840 self.0.request = v.into();
4841 self
4842 }
4843
4844 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4846 self.0.options = v.into();
4847 self
4848 }
4849
4850 pub async fn send(self) -> Result<crate::model::Operation> {
4852 (*self.0.stub)
4853 .rotate_entra_id_certificate(self.0.request, self.0.options)
4854 .await
4855 .map(crate::Response::into_body)
4856 }
4857
4858 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4862 self.0.request.instance = v.into();
4863 self
4864 }
4865
4866 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4870 self.0.request.project = v.into();
4871 self
4872 }
4873
4874 pub fn set_body<T>(mut self, v: T) -> Self
4876 where
4877 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
4878 {
4879 self.0.request.body = std::option::Option::Some(v.into());
4880 self
4881 }
4882
4883 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4885 where
4886 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
4887 {
4888 self.0.request.body = v.map(|x| x.into());
4889 self
4890 }
4891
4892 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4894 self.0.request.location = v.into();
4895 self
4896 }
4897 }
4898
4899 #[doc(hidden)]
4900 impl crate::RequestBuilder for RotateEntraIdCertificate {
4901 fn request_options(&mut self) -> &mut crate::RequestOptions {
4902 &mut self.0.options
4903 }
4904 }
4905
4906 #[derive(Clone, Debug)]
4923 pub struct StartReplica(RequestBuilder<crate::model::SqlInstancesStartReplicaRequest>);
4924
4925 impl StartReplica {
4926 pub(crate) fn new(
4927 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4928 ) -> Self {
4929 Self(RequestBuilder::new(stub))
4930 }
4931
4932 pub fn with_request<V: Into<crate::model::SqlInstancesStartReplicaRequest>>(
4934 mut self,
4935 v: V,
4936 ) -> Self {
4937 self.0.request = v.into();
4938 self
4939 }
4940
4941 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4943 self.0.options = v.into();
4944 self
4945 }
4946
4947 pub async fn send(self) -> Result<crate::model::Operation> {
4949 (*self.0.stub)
4950 .start_replica(self.0.request, self.0.options)
4951 .await
4952 .map(crate::Response::into_body)
4953 }
4954
4955 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4957 self.0.request.instance = v.into();
4958 self
4959 }
4960
4961 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4963 self.0.request.project = v.into();
4964 self
4965 }
4966
4967 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
4969 self.0.request.location = v.into();
4970 self
4971 }
4972 }
4973
4974 #[doc(hidden)]
4975 impl crate::RequestBuilder for StartReplica {
4976 fn request_options(&mut self) -> &mut crate::RequestOptions {
4977 &mut self.0.options
4978 }
4979 }
4980
4981 #[derive(Clone, Debug)]
4998 pub struct StopReplica(RequestBuilder<crate::model::SqlInstancesStopReplicaRequest>);
4999
5000 impl StopReplica {
5001 pub(crate) fn new(
5002 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5003 ) -> Self {
5004 Self(RequestBuilder::new(stub))
5005 }
5006
5007 pub fn with_request<V: Into<crate::model::SqlInstancesStopReplicaRequest>>(
5009 mut self,
5010 v: V,
5011 ) -> Self {
5012 self.0.request = v.into();
5013 self
5014 }
5015
5016 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5018 self.0.options = v.into();
5019 self
5020 }
5021
5022 pub async fn send(self) -> Result<crate::model::Operation> {
5024 (*self.0.stub)
5025 .stop_replica(self.0.request, self.0.options)
5026 .await
5027 .map(crate::Response::into_body)
5028 }
5029
5030 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5032 self.0.request.instance = v.into();
5033 self
5034 }
5035
5036 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5038 self.0.request.project = v.into();
5039 self
5040 }
5041
5042 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5044 self.0.request.location = v.into();
5045 self
5046 }
5047 }
5048
5049 #[doc(hidden)]
5050 impl crate::RequestBuilder for StopReplica {
5051 fn request_options(&mut self) -> &mut crate::RequestOptions {
5052 &mut self.0.options
5053 }
5054 }
5055
5056 #[derive(Clone, Debug)]
5073 pub struct TruncateLog(RequestBuilder<crate::model::SqlInstancesTruncateLogRequest>);
5074
5075 impl TruncateLog {
5076 pub(crate) fn new(
5077 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5078 ) -> Self {
5079 Self(RequestBuilder::new(stub))
5080 }
5081
5082 pub fn with_request<V: Into<crate::model::SqlInstancesTruncateLogRequest>>(
5084 mut self,
5085 v: V,
5086 ) -> Self {
5087 self.0.request = v.into();
5088 self
5089 }
5090
5091 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5093 self.0.options = v.into();
5094 self
5095 }
5096
5097 pub async fn send(self) -> Result<crate::model::Operation> {
5099 (*self.0.stub)
5100 .truncate_log(self.0.request, self.0.options)
5101 .await
5102 .map(crate::Response::into_body)
5103 }
5104
5105 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5107 self.0.request.instance = v.into();
5108 self
5109 }
5110
5111 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5113 self.0.request.project = v.into();
5114 self
5115 }
5116
5117 pub fn set_body<T>(mut self, v: T) -> Self
5119 where
5120 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
5121 {
5122 self.0.request.body = std::option::Option::Some(v.into());
5123 self
5124 }
5125
5126 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5128 where
5129 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
5130 {
5131 self.0.request.body = v.map(|x| x.into());
5132 self
5133 }
5134
5135 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5137 self.0.request.location = v.into();
5138 self
5139 }
5140 }
5141
5142 #[doc(hidden)]
5143 impl crate::RequestBuilder for TruncateLog {
5144 fn request_options(&mut self) -> &mut crate::RequestOptions {
5145 &mut self.0.options
5146 }
5147 }
5148
5149 #[derive(Clone, Debug)]
5166 pub struct Update(RequestBuilder<crate::model::SqlInstancesUpdateRequest>);
5167
5168 impl Update {
5169 pub(crate) fn new(
5170 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5171 ) -> Self {
5172 Self(RequestBuilder::new(stub))
5173 }
5174
5175 pub fn with_request<V: Into<crate::model::SqlInstancesUpdateRequest>>(
5177 mut self,
5178 v: V,
5179 ) -> Self {
5180 self.0.request = v.into();
5181 self
5182 }
5183
5184 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5186 self.0.options = v.into();
5187 self
5188 }
5189
5190 pub async fn send(self) -> Result<crate::model::Operation> {
5192 (*self.0.stub)
5193 .update(self.0.request, self.0.options)
5194 .await
5195 .map(crate::Response::into_body)
5196 }
5197
5198 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5200 self.0.request.instance = v.into();
5201 self
5202 }
5203
5204 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5206 self.0.request.project = v.into();
5207 self
5208 }
5209
5210 pub fn set_body<T>(mut self, v: T) -> Self
5212 where
5213 T: std::convert::Into<crate::model::DatabaseInstance>,
5214 {
5215 self.0.request.body = std::option::Option::Some(v.into());
5216 self
5217 }
5218
5219 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5221 where
5222 T: std::convert::Into<crate::model::DatabaseInstance>,
5223 {
5224 self.0.request.body = v.map(|x| x.into());
5225 self
5226 }
5227
5228 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5230 self.0.request.location = v.into();
5231 self
5232 }
5233 }
5234
5235 #[doc(hidden)]
5236 impl crate::RequestBuilder for Update {
5237 fn request_options(&mut self) -> &mut crate::RequestOptions {
5238 &mut self.0.options
5239 }
5240 }
5241
5242 #[derive(Clone, Debug)]
5259 pub struct CreateEphemeral(
5260 RequestBuilder<crate::model::SqlInstancesCreateEphemeralCertRequest>,
5261 );
5262
5263 impl CreateEphemeral {
5264 pub(crate) fn new(
5265 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5266 ) -> Self {
5267 Self(RequestBuilder::new(stub))
5268 }
5269
5270 pub fn with_request<V: Into<crate::model::SqlInstancesCreateEphemeralCertRequest>>(
5272 mut self,
5273 v: V,
5274 ) -> Self {
5275 self.0.request = v.into();
5276 self
5277 }
5278
5279 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5281 self.0.options = v.into();
5282 self
5283 }
5284
5285 pub async fn send(self) -> Result<crate::model::SslCert> {
5287 (*self.0.stub)
5288 .create_ephemeral(self.0.request, self.0.options)
5289 .await
5290 .map(crate::Response::into_body)
5291 }
5292
5293 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5295 self.0.request.instance = v.into();
5296 self
5297 }
5298
5299 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5301 self.0.request.project = v.into();
5302 self
5303 }
5304
5305 pub fn set_body<T>(mut self, v: T) -> Self
5307 where
5308 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
5309 {
5310 self.0.request.body = std::option::Option::Some(v.into());
5311 self
5312 }
5313
5314 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5316 where
5317 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
5318 {
5319 self.0.request.body = v.map(|x| x.into());
5320 self
5321 }
5322
5323 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5325 self.0.request.location = v.into();
5326 self
5327 }
5328 }
5329
5330 #[doc(hidden)]
5331 impl crate::RequestBuilder for CreateEphemeral {
5332 fn request_options(&mut self) -> &mut crate::RequestOptions {
5333 &mut self.0.options
5334 }
5335 }
5336
5337 #[derive(Clone, Debug)]
5354 pub struct RescheduleMaintenance(
5355 RequestBuilder<crate::model::SqlInstancesRescheduleMaintenanceRequest>,
5356 );
5357
5358 impl RescheduleMaintenance {
5359 pub(crate) fn new(
5360 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5361 ) -> Self {
5362 Self(RequestBuilder::new(stub))
5363 }
5364
5365 pub fn with_request<V: Into<crate::model::SqlInstancesRescheduleMaintenanceRequest>>(
5367 mut self,
5368 v: V,
5369 ) -> Self {
5370 self.0.request = v.into();
5371 self
5372 }
5373
5374 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5376 self.0.options = v.into();
5377 self
5378 }
5379
5380 pub async fn send(self) -> Result<crate::model::Operation> {
5382 (*self.0.stub)
5383 .reschedule_maintenance(self.0.request, self.0.options)
5384 .await
5385 .map(crate::Response::into_body)
5386 }
5387
5388 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5390 self.0.request.instance = v.into();
5391 self
5392 }
5393
5394 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5396 self.0.request.project = v.into();
5397 self
5398 }
5399
5400 pub fn set_body<T>(mut self, v: T) -> Self
5402 where
5403 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
5404 {
5405 self.0.request.body = std::option::Option::Some(v.into());
5406 self
5407 }
5408
5409 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5411 where
5412 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
5413 {
5414 self.0.request.body = v.map(|x| x.into());
5415 self
5416 }
5417
5418 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5420 self.0.request.location = v.into();
5421 self
5422 }
5423 }
5424
5425 #[doc(hidden)]
5426 impl crate::RequestBuilder for RescheduleMaintenance {
5427 fn request_options(&mut self) -> &mut crate::RequestOptions {
5428 &mut self.0.options
5429 }
5430 }
5431
5432 #[derive(Clone, Debug)]
5449 pub struct VerifyExternalSyncSettings(
5450 RequestBuilder<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
5451 );
5452
5453 impl VerifyExternalSyncSettings {
5454 pub(crate) fn new(
5455 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5456 ) -> Self {
5457 Self(RequestBuilder::new(stub))
5458 }
5459
5460 pub fn with_request<
5462 V: Into<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
5463 >(
5464 mut self,
5465 v: V,
5466 ) -> Self {
5467 self.0.request = v.into();
5468 self
5469 }
5470
5471 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5473 self.0.options = v.into();
5474 self
5475 }
5476
5477 pub async fn send(
5479 self,
5480 ) -> Result<crate::model::SqlInstancesVerifyExternalSyncSettingsResponse> {
5481 (*self.0.stub)
5482 .verify_external_sync_settings(self.0.request, self.0.options)
5483 .await
5484 .map(crate::Response::into_body)
5485 }
5486
5487 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5489 self.0.request.instance = v.into();
5490 self
5491 }
5492
5493 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5495 self.0.request.project = v.into();
5496 self
5497 }
5498
5499 pub fn set_verify_connection_only<T: Into<bool>>(mut self, v: T) -> Self {
5501 self.0.request.verify_connection_only = v.into();
5502 self
5503 }
5504
5505 pub fn set_sync_mode<
5507 T: Into<
5508 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
5509 >,
5510 >(
5511 mut self,
5512 v: T,
5513 ) -> Self {
5514 self.0.request.sync_mode = v.into();
5515 self
5516 }
5517
5518 pub fn set_verify_replication_only<T: Into<bool>>(mut self, v: T) -> Self {
5520 self.0.request.verify_replication_only = v.into();
5521 self
5522 }
5523
5524 pub fn set_migration_type<
5526 T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
5527 >(
5528 mut self,
5529 v: T,
5530 ) -> Self {
5531 self.0.request.migration_type = v.into();
5532 self
5533 }
5534
5535 pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
5537 mut self,
5538 v: T,
5539 ) -> Self {
5540 self.0.request.sync_parallel_level = v.into();
5541 self
5542 }
5543
5544 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
5546 where
5547 T: std::iter::IntoIterator<Item = V>,
5548 V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
5549 {
5550 use std::iter::Iterator;
5551 self.0.request.selected_objects = v.into_iter().map(|i| i.into()).collect();
5552 self
5553 }
5554
5555 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5557 self.0.request.location = v.into();
5558 self
5559 }
5560
5561 pub fn set_sync_config<
5566 T: Into<
5567 Option<
5568 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
5569 >,
5570 >,
5571 >(
5572 mut self,
5573 v: T,
5574 ) -> Self {
5575 self.0.request.sync_config = v.into();
5576 self
5577 }
5578
5579 pub fn set_mysql_sync_config<
5585 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
5586 >(
5587 mut self,
5588 v: T,
5589 ) -> Self {
5590 self.0.request = self.0.request.set_mysql_sync_config(v);
5591 self
5592 }
5593 }
5594
5595 #[doc(hidden)]
5596 impl crate::RequestBuilder for VerifyExternalSyncSettings {
5597 fn request_options(&mut self) -> &mut crate::RequestOptions {
5598 &mut self.0.options
5599 }
5600 }
5601
5602 #[derive(Clone, Debug)]
5619 pub struct StartExternalSync(
5620 RequestBuilder<crate::model::SqlInstancesStartExternalSyncRequest>,
5621 );
5622
5623 impl StartExternalSync {
5624 pub(crate) fn new(
5625 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5626 ) -> Self {
5627 Self(RequestBuilder::new(stub))
5628 }
5629
5630 pub fn with_request<V: Into<crate::model::SqlInstancesStartExternalSyncRequest>>(
5632 mut self,
5633 v: V,
5634 ) -> Self {
5635 self.0.request = v.into();
5636 self
5637 }
5638
5639 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5641 self.0.options = v.into();
5642 self
5643 }
5644
5645 pub async fn send(self) -> Result<crate::model::Operation> {
5647 (*self.0.stub)
5648 .start_external_sync(self.0.request, self.0.options)
5649 .await
5650 .map(crate::Response::into_body)
5651 }
5652
5653 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5655 self.0.request.instance = v.into();
5656 self
5657 }
5658
5659 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5661 self.0.request.project = v.into();
5662 self
5663 }
5664
5665 pub fn set_sync_mode<
5667 T: Into<
5668 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
5669 >,
5670 >(
5671 mut self,
5672 v: T,
5673 ) -> Self {
5674 self.0.request.sync_mode = v.into();
5675 self
5676 }
5677
5678 pub fn set_skip_verification<T: Into<bool>>(mut self, v: T) -> Self {
5680 self.0.request.skip_verification = v.into();
5681 self
5682 }
5683
5684 pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
5686 mut self,
5687 v: T,
5688 ) -> Self {
5689 self.0.request.sync_parallel_level = v.into();
5690 self
5691 }
5692
5693 pub fn set_migration_type<
5695 T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
5696 >(
5697 mut self,
5698 v: T,
5699 ) -> Self {
5700 self.0.request.migration_type = v.into();
5701 self
5702 }
5703
5704 pub fn set_replica_overwrite_enabled<T: Into<bool>>(mut self, v: T) -> Self {
5706 self.0.request.replica_overwrite_enabled = v.into();
5707 self
5708 }
5709
5710 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5712 self.0.request.location = v.into();
5713 self
5714 }
5715
5716 pub fn set_sync_config<
5721 T: Into<Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>>,
5722 >(
5723 mut self,
5724 v: T,
5725 ) -> Self {
5726 self.0.request.sync_config = v.into();
5727 self
5728 }
5729
5730 pub fn set_mysql_sync_config<
5736 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
5737 >(
5738 mut self,
5739 v: T,
5740 ) -> Self {
5741 self.0.request = self.0.request.set_mysql_sync_config(v);
5742 self
5743 }
5744 }
5745
5746 #[doc(hidden)]
5747 impl crate::RequestBuilder for StartExternalSync {
5748 fn request_options(&mut self) -> &mut crate::RequestOptions {
5749 &mut self.0.options
5750 }
5751 }
5752
5753 #[derive(Clone, Debug)]
5770 pub struct PerformDiskShrink(
5771 RequestBuilder<crate::model::SqlInstancesPerformDiskShrinkRequest>,
5772 );
5773
5774 impl PerformDiskShrink {
5775 pub(crate) fn new(
5776 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5777 ) -> Self {
5778 Self(RequestBuilder::new(stub))
5779 }
5780
5781 pub fn with_request<V: Into<crate::model::SqlInstancesPerformDiskShrinkRequest>>(
5783 mut self,
5784 v: V,
5785 ) -> Self {
5786 self.0.request = v.into();
5787 self
5788 }
5789
5790 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5792 self.0.options = v.into();
5793 self
5794 }
5795
5796 pub async fn send(self) -> Result<crate::model::Operation> {
5798 (*self.0.stub)
5799 .perform_disk_shrink(self.0.request, self.0.options)
5800 .await
5801 .map(crate::Response::into_body)
5802 }
5803
5804 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5806 self.0.request.instance = v.into();
5807 self
5808 }
5809
5810 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5812 self.0.request.project = v.into();
5813 self
5814 }
5815
5816 pub fn set_body<T>(mut self, v: T) -> Self
5818 where
5819 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
5820 {
5821 self.0.request.body = std::option::Option::Some(v.into());
5822 self
5823 }
5824
5825 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5827 where
5828 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
5829 {
5830 self.0.request.body = v.map(|x| x.into());
5831 self
5832 }
5833
5834 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5836 self.0.request.location = v.into();
5837 self
5838 }
5839 }
5840
5841 #[doc(hidden)]
5842 impl crate::RequestBuilder for PerformDiskShrink {
5843 fn request_options(&mut self) -> &mut crate::RequestOptions {
5844 &mut self.0.options
5845 }
5846 }
5847
5848 #[derive(Clone, Debug)]
5865 pub struct GetDiskShrinkConfig(
5866 RequestBuilder<crate::model::SqlInstancesGetDiskShrinkConfigRequest>,
5867 );
5868
5869 impl GetDiskShrinkConfig {
5870 pub(crate) fn new(
5871 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5872 ) -> Self {
5873 Self(RequestBuilder::new(stub))
5874 }
5875
5876 pub fn with_request<V: Into<crate::model::SqlInstancesGetDiskShrinkConfigRequest>>(
5878 mut self,
5879 v: V,
5880 ) -> Self {
5881 self.0.request = v.into();
5882 self
5883 }
5884
5885 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5887 self.0.options = v.into();
5888 self
5889 }
5890
5891 pub async fn send(self) -> Result<crate::model::SqlInstancesGetDiskShrinkConfigResponse> {
5893 (*self.0.stub)
5894 .get_disk_shrink_config(self.0.request, self.0.options)
5895 .await
5896 .map(crate::Response::into_body)
5897 }
5898
5899 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5901 self.0.request.instance = v.into();
5902 self
5903 }
5904
5905 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5907 self.0.request.project = v.into();
5908 self
5909 }
5910
5911 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5913 self.0.request.location = v.into();
5914 self
5915 }
5916 }
5917
5918 #[doc(hidden)]
5919 impl crate::RequestBuilder for GetDiskShrinkConfig {
5920 fn request_options(&mut self) -> &mut crate::RequestOptions {
5921 &mut self.0.options
5922 }
5923 }
5924
5925 #[derive(Clone, Debug)]
5942 pub struct ResetReplicaSize(RequestBuilder<crate::model::SqlInstancesResetReplicaSizeRequest>);
5943
5944 impl ResetReplicaSize {
5945 pub(crate) fn new(
5946 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5947 ) -> Self {
5948 Self(RequestBuilder::new(stub))
5949 }
5950
5951 pub fn with_request<V: Into<crate::model::SqlInstancesResetReplicaSizeRequest>>(
5953 mut self,
5954 v: V,
5955 ) -> Self {
5956 self.0.request = v.into();
5957 self
5958 }
5959
5960 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5962 self.0.options = v.into();
5963 self
5964 }
5965
5966 pub async fn send(self) -> Result<crate::model::Operation> {
5968 (*self.0.stub)
5969 .reset_replica_size(self.0.request, self.0.options)
5970 .await
5971 .map(crate::Response::into_body)
5972 }
5973
5974 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5976 self.0.request.instance = v.into();
5977 self
5978 }
5979
5980 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5982 self.0.request.project = v.into();
5983 self
5984 }
5985
5986 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5988 self.0.request.location = v.into();
5989 self
5990 }
5991 }
5992
5993 #[doc(hidden)]
5994 impl crate::RequestBuilder for ResetReplicaSize {
5995 fn request_options(&mut self) -> &mut crate::RequestOptions {
5996 &mut self.0.options
5997 }
5998 }
5999
6000 #[derive(Clone, Debug)]
6017 pub struct GetLatestRecoveryTime(
6018 RequestBuilder<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>,
6019 );
6020
6021 impl GetLatestRecoveryTime {
6022 pub(crate) fn new(
6023 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
6024 ) -> Self {
6025 Self(RequestBuilder::new(stub))
6026 }
6027
6028 pub fn with_request<V: Into<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>>(
6030 mut self,
6031 v: V,
6032 ) -> Self {
6033 self.0.request = v.into();
6034 self
6035 }
6036
6037 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6039 self.0.options = v.into();
6040 self
6041 }
6042
6043 pub async fn send(self) -> Result<crate::model::SqlInstancesGetLatestRecoveryTimeResponse> {
6045 (*self.0.stub)
6046 .get_latest_recovery_time(self.0.request, self.0.options)
6047 .await
6048 .map(crate::Response::into_body)
6049 }
6050
6051 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6053 self.0.request.instance = v.into();
6054 self
6055 }
6056
6057 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6059 self.0.request.project = v.into();
6060 self
6061 }
6062
6063 pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
6065 where
6066 T: std::convert::Into<wkt::Timestamp>,
6067 {
6068 self.0.request.source_instance_deletion_time = std::option::Option::Some(v.into());
6069 self
6070 }
6071
6072 pub fn set_or_clear_source_instance_deletion_time<T>(
6074 mut self,
6075 v: std::option::Option<T>,
6076 ) -> Self
6077 where
6078 T: std::convert::Into<wkt::Timestamp>,
6079 {
6080 self.0.request.source_instance_deletion_time = v.map(|x| x.into());
6081 self
6082 }
6083
6084 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6086 self.0.request.location = v.into();
6087 self
6088 }
6089 }
6090
6091 #[doc(hidden)]
6092 impl crate::RequestBuilder for GetLatestRecoveryTime {
6093 fn request_options(&mut self) -> &mut crate::RequestOptions {
6094 &mut self.0.options
6095 }
6096 }
6097
6098 #[derive(Clone, Debug)]
6115 pub struct ExecuteSql(RequestBuilder<crate::model::SqlInstancesExecuteSqlRequest>);
6116
6117 impl ExecuteSql {
6118 pub(crate) fn new(
6119 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
6120 ) -> Self {
6121 Self(RequestBuilder::new(stub))
6122 }
6123
6124 pub fn with_request<V: Into<crate::model::SqlInstancesExecuteSqlRequest>>(
6126 mut self,
6127 v: V,
6128 ) -> Self {
6129 self.0.request = v.into();
6130 self
6131 }
6132
6133 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6135 self.0.options = v.into();
6136 self
6137 }
6138
6139 pub async fn send(self) -> Result<crate::model::SqlInstancesExecuteSqlResponse> {
6141 (*self.0.stub)
6142 .execute_sql(self.0.request, self.0.options)
6143 .await
6144 .map(crate::Response::into_body)
6145 }
6146
6147 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6151 self.0.request.instance = v.into();
6152 self
6153 }
6154
6155 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6159 self.0.request.project = v.into();
6160 self
6161 }
6162
6163 pub fn set_body<T>(mut self, v: T) -> Self
6165 where
6166 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
6167 {
6168 self.0.request.body = std::option::Option::Some(v.into());
6169 self
6170 }
6171
6172 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6174 where
6175 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
6176 {
6177 self.0.request.body = v.map(|x| x.into());
6178 self
6179 }
6180
6181 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6183 self.0.request.location = v.into();
6184 self
6185 }
6186 }
6187
6188 #[doc(hidden)]
6189 impl crate::RequestBuilder for ExecuteSql {
6190 fn request_options(&mut self) -> &mut crate::RequestOptions {
6191 &mut self.0.options
6192 }
6193 }
6194
6195 #[derive(Clone, Debug)]
6212 pub struct AcquireSsrsLease(RequestBuilder<crate::model::SqlInstancesAcquireSsrsLeaseRequest>);
6213
6214 impl AcquireSsrsLease {
6215 pub(crate) fn new(
6216 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
6217 ) -> Self {
6218 Self(RequestBuilder::new(stub))
6219 }
6220
6221 pub fn with_request<V: Into<crate::model::SqlInstancesAcquireSsrsLeaseRequest>>(
6223 mut self,
6224 v: V,
6225 ) -> Self {
6226 self.0.request = v.into();
6227 self
6228 }
6229
6230 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6232 self.0.options = v.into();
6233 self
6234 }
6235
6236 pub async fn send(self) -> Result<crate::model::SqlInstancesAcquireSsrsLeaseResponse> {
6238 (*self.0.stub)
6239 .acquire_ssrs_lease(self.0.request, self.0.options)
6240 .await
6241 .map(crate::Response::into_body)
6242 }
6243
6244 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6248 self.0.request.instance = v.into();
6249 self
6250 }
6251
6252 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6256 self.0.request.project = v.into();
6257 self
6258 }
6259
6260 pub fn set_body<T>(mut self, v: T) -> Self
6264 where
6265 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
6266 {
6267 self.0.request.body = std::option::Option::Some(v.into());
6268 self
6269 }
6270
6271 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6275 where
6276 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
6277 {
6278 self.0.request.body = v.map(|x| x.into());
6279 self
6280 }
6281
6282 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6284 self.0.request.location = v.into();
6285 self
6286 }
6287 }
6288
6289 #[doc(hidden)]
6290 impl crate::RequestBuilder for AcquireSsrsLease {
6291 fn request_options(&mut self) -> &mut crate::RequestOptions {
6292 &mut self.0.options
6293 }
6294 }
6295
6296 #[derive(Clone, Debug)]
6313 pub struct ReleaseSsrsLease(RequestBuilder<crate::model::SqlInstancesReleaseSsrsLeaseRequest>);
6314
6315 impl ReleaseSsrsLease {
6316 pub(crate) fn new(
6317 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
6318 ) -> Self {
6319 Self(RequestBuilder::new(stub))
6320 }
6321
6322 pub fn with_request<V: Into<crate::model::SqlInstancesReleaseSsrsLeaseRequest>>(
6324 mut self,
6325 v: V,
6326 ) -> Self {
6327 self.0.request = v.into();
6328 self
6329 }
6330
6331 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6333 self.0.options = v.into();
6334 self
6335 }
6336
6337 pub async fn send(self) -> Result<crate::model::SqlInstancesReleaseSsrsLeaseResponse> {
6339 (*self.0.stub)
6340 .release_ssrs_lease(self.0.request, self.0.options)
6341 .await
6342 .map(crate::Response::into_body)
6343 }
6344
6345 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6349 self.0.request.instance = v.into();
6350 self
6351 }
6352
6353 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6357 self.0.request.project = v.into();
6358 self
6359 }
6360
6361 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6363 self.0.request.location = v.into();
6364 self
6365 }
6366 }
6367
6368 #[doc(hidden)]
6369 impl crate::RequestBuilder for ReleaseSsrsLease {
6370 fn request_options(&mut self) -> &mut crate::RequestOptions {
6371 &mut self.0.options
6372 }
6373 }
6374
6375 #[derive(Clone, Debug)]
6392 pub struct PreCheckMajorVersionUpgrade(
6393 RequestBuilder<crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest>,
6394 );
6395
6396 impl PreCheckMajorVersionUpgrade {
6397 pub(crate) fn new(
6398 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
6399 ) -> Self {
6400 Self(RequestBuilder::new(stub))
6401 }
6402
6403 pub fn with_request<
6405 V: Into<crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest>,
6406 >(
6407 mut self,
6408 v: V,
6409 ) -> Self {
6410 self.0.request = v.into();
6411 self
6412 }
6413
6414 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6416 self.0.options = v.into();
6417 self
6418 }
6419
6420 pub async fn send(self) -> Result<crate::model::Operation> {
6422 (*self.0.stub)
6423 .pre_check_major_version_upgrade(self.0.request, self.0.options)
6424 .await
6425 .map(crate::Response::into_body)
6426 }
6427
6428 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6432 self.0.request.instance = v.into();
6433 self
6434 }
6435
6436 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6440 self.0.request.project = v.into();
6441 self
6442 }
6443
6444 pub fn set_body<T>(mut self, v: T) -> Self
6448 where
6449 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
6450 {
6451 self.0.request.body = std::option::Option::Some(v.into());
6452 self
6453 }
6454
6455 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6459 where
6460 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
6461 {
6462 self.0.request.body = v.map(|x| x.into());
6463 self
6464 }
6465
6466 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6468 self.0.request.location = v.into();
6469 self
6470 }
6471 }
6472
6473 #[doc(hidden)]
6474 impl crate::RequestBuilder for PreCheckMajorVersionUpgrade {
6475 fn request_options(&mut self) -> &mut crate::RequestOptions {
6476 &mut self.0.options
6477 }
6478 }
6479
6480 #[derive(Clone, Debug)]
6497 pub struct PointInTimeRestore(
6498 RequestBuilder<crate::model::SqlInstancesPointInTimeRestoreRequest>,
6499 );
6500
6501 impl PointInTimeRestore {
6502 pub(crate) fn new(
6503 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
6504 ) -> Self {
6505 Self(RequestBuilder::new(stub))
6506 }
6507
6508 pub fn with_request<V: Into<crate::model::SqlInstancesPointInTimeRestoreRequest>>(
6510 mut self,
6511 v: V,
6512 ) -> Self {
6513 self.0.request = v.into();
6514 self
6515 }
6516
6517 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6519 self.0.options = v.into();
6520 self
6521 }
6522
6523 pub async fn send(self) -> Result<crate::model::Operation> {
6525 (*self.0.stub)
6526 .point_in_time_restore(self.0.request, self.0.options)
6527 .await
6528 .map(crate::Response::into_body)
6529 }
6530
6531 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6535 self.0.request.parent = v.into();
6536 self
6537 }
6538
6539 pub fn set_context<T>(mut self, v: T) -> Self
6543 where
6544 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
6545 {
6546 self.0.request.context = std::option::Option::Some(v.into());
6547 self
6548 }
6549
6550 pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
6554 where
6555 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
6556 {
6557 self.0.request.context = v.map(|x| x.into());
6558 self
6559 }
6560 }
6561
6562 #[doc(hidden)]
6563 impl crate::RequestBuilder for PointInTimeRestore {
6564 fn request_options(&mut self) -> &mut crate::RequestOptions {
6565 &mut self.0.options
6566 }
6567 }
6568}
6569
6570pub mod sql_operations_service {
6572 use crate::Result;
6573
6574 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6588
6589 pub(crate) mod client {
6590 use super::super::super::client::SqlOperationsService;
6591 pub struct Factory;
6592 impl crate::ClientFactory for Factory {
6593 type Client = SqlOperationsService;
6594 type Credentials = gaxi::options::Credentials;
6595 async fn build(
6596 self,
6597 config: gaxi::options::ClientConfig,
6598 ) -> crate::ClientBuilderResult<Self::Client> {
6599 Self::Client::new(config).await
6600 }
6601 }
6602 }
6603
6604 #[derive(Clone, Debug)]
6606 pub(crate) struct RequestBuilder<R: std::default::Default> {
6607 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
6608 request: R,
6609 options: crate::RequestOptions,
6610 }
6611
6612 impl<R> RequestBuilder<R>
6613 where
6614 R: std::default::Default,
6615 {
6616 pub(crate) fn new(
6617 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
6618 ) -> Self {
6619 Self {
6620 stub,
6621 request: R::default(),
6622 options: crate::RequestOptions::default(),
6623 }
6624 }
6625 }
6626
6627 #[derive(Clone, Debug)]
6644 pub struct Get(RequestBuilder<crate::model::SqlOperationsGetRequest>);
6645
6646 impl Get {
6647 pub(crate) fn new(
6648 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
6649 ) -> Self {
6650 Self(RequestBuilder::new(stub))
6651 }
6652
6653 pub fn with_request<V: Into<crate::model::SqlOperationsGetRequest>>(
6655 mut self,
6656 v: V,
6657 ) -> Self {
6658 self.0.request = v.into();
6659 self
6660 }
6661
6662 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6664 self.0.options = v.into();
6665 self
6666 }
6667
6668 pub async fn send(self) -> Result<crate::model::Operation> {
6670 (*self.0.stub)
6671 .get(self.0.request, self.0.options)
6672 .await
6673 .map(crate::Response::into_body)
6674 }
6675
6676 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
6680 self.0.request.operation = v.into();
6681 self
6682 }
6683
6684 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6688 self.0.request.project = v.into();
6689 self
6690 }
6691
6692 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6694 self.0.request.location = v.into();
6695 self
6696 }
6697 }
6698
6699 #[doc(hidden)]
6700 impl crate::RequestBuilder for Get {
6701 fn request_options(&mut self) -> &mut crate::RequestOptions {
6702 &mut self.0.options
6703 }
6704 }
6705
6706 #[derive(Clone, Debug)]
6727 pub struct List(RequestBuilder<crate::model::SqlOperationsListRequest>);
6728
6729 impl List {
6730 pub(crate) fn new(
6731 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
6732 ) -> Self {
6733 Self(RequestBuilder::new(stub))
6734 }
6735
6736 pub fn with_request<V: Into<crate::model::SqlOperationsListRequest>>(
6738 mut self,
6739 v: V,
6740 ) -> Self {
6741 self.0.request = v.into();
6742 self
6743 }
6744
6745 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6747 self.0.options = v.into();
6748 self
6749 }
6750
6751 pub async fn send(self) -> Result<crate::model::OperationsListResponse> {
6753 (*self.0.stub)
6754 .list(self.0.request, self.0.options)
6755 .await
6756 .map(crate::Response::into_body)
6757 }
6758
6759 pub fn by_page(
6761 self,
6762 ) -> impl google_cloud_gax::paginator::Paginator<
6763 crate::model::OperationsListResponse,
6764 crate::Error,
6765 > {
6766 use std::clone::Clone;
6767 let token = self.0.request.page_token.clone();
6768 let execute = move |token: String| {
6769 let mut builder = self.clone();
6770 builder.0.request = builder.0.request.set_page_token(token);
6771 builder.send()
6772 };
6773 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6774 }
6775
6776 pub fn by_item(
6778 self,
6779 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6780 crate::model::OperationsListResponse,
6781 crate::Error,
6782 > {
6783 use google_cloud_gax::paginator::Paginator;
6784 self.by_page().items()
6785 }
6786
6787 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6789 self.0.request.instance = v.into();
6790 self
6791 }
6792
6793 pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
6795 self.0.request.max_results = v.into();
6796 self
6797 }
6798
6799 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6801 self.0.request.page_token = v.into();
6802 self
6803 }
6804
6805 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6807 self.0.request.project = v.into();
6808 self
6809 }
6810
6811 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6813 self.0.request.location = v.into();
6814 self
6815 }
6816 }
6817
6818 #[doc(hidden)]
6819 impl crate::RequestBuilder for List {
6820 fn request_options(&mut self) -> &mut crate::RequestOptions {
6821 &mut self.0.options
6822 }
6823 }
6824
6825 #[derive(Clone, Debug)]
6842 pub struct Cancel(RequestBuilder<crate::model::SqlOperationsCancelRequest>);
6843
6844 impl Cancel {
6845 pub(crate) fn new(
6846 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
6847 ) -> Self {
6848 Self(RequestBuilder::new(stub))
6849 }
6850
6851 pub fn with_request<V: Into<crate::model::SqlOperationsCancelRequest>>(
6853 mut self,
6854 v: V,
6855 ) -> Self {
6856 self.0.request = v.into();
6857 self
6858 }
6859
6860 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6862 self.0.options = v.into();
6863 self
6864 }
6865
6866 pub async fn send(self) -> Result<()> {
6868 (*self.0.stub)
6869 .cancel(self.0.request, self.0.options)
6870 .await
6871 .map(crate::Response::into_body)
6872 }
6873
6874 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
6876 self.0.request.operation = v.into();
6877 self
6878 }
6879
6880 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6882 self.0.request.project = v.into();
6883 self
6884 }
6885
6886 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6888 self.0.request.location = v.into();
6889 self
6890 }
6891 }
6892
6893 #[doc(hidden)]
6894 impl crate::RequestBuilder for Cancel {
6895 fn request_options(&mut self) -> &mut crate::RequestOptions {
6896 &mut self.0.options
6897 }
6898 }
6899}
6900
6901pub mod sql_ssl_certs_service {
6903 use crate::Result;
6904
6905 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6919
6920 pub(crate) mod client {
6921 use super::super::super::client::SqlSslCertsService;
6922 pub struct Factory;
6923 impl crate::ClientFactory for Factory {
6924 type Client = SqlSslCertsService;
6925 type Credentials = gaxi::options::Credentials;
6926 async fn build(
6927 self,
6928 config: gaxi::options::ClientConfig,
6929 ) -> crate::ClientBuilderResult<Self::Client> {
6930 Self::Client::new(config).await
6931 }
6932 }
6933 }
6934
6935 #[derive(Clone, Debug)]
6937 pub(crate) struct RequestBuilder<R: std::default::Default> {
6938 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6939 request: R,
6940 options: crate::RequestOptions,
6941 }
6942
6943 impl<R> RequestBuilder<R>
6944 where
6945 R: std::default::Default,
6946 {
6947 pub(crate) fn new(
6948 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6949 ) -> Self {
6950 Self {
6951 stub,
6952 request: R::default(),
6953 options: crate::RequestOptions::default(),
6954 }
6955 }
6956 }
6957
6958 #[derive(Clone, Debug)]
6975 pub struct Delete(RequestBuilder<crate::model::SqlSslCertsDeleteRequest>);
6976
6977 impl Delete {
6978 pub(crate) fn new(
6979 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6980 ) -> Self {
6981 Self(RequestBuilder::new(stub))
6982 }
6983
6984 pub fn with_request<V: Into<crate::model::SqlSslCertsDeleteRequest>>(
6986 mut self,
6987 v: V,
6988 ) -> Self {
6989 self.0.request = v.into();
6990 self
6991 }
6992
6993 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6995 self.0.options = v.into();
6996 self
6997 }
6998
6999 pub async fn send(self) -> Result<crate::model::Operation> {
7001 (*self.0.stub)
7002 .delete(self.0.request, self.0.options)
7003 .await
7004 .map(crate::Response::into_body)
7005 }
7006
7007 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7009 self.0.request.instance = v.into();
7010 self
7011 }
7012
7013 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7015 self.0.request.project = v.into();
7016 self
7017 }
7018
7019 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
7021 self.0.request.sha1_fingerprint = v.into();
7022 self
7023 }
7024 }
7025
7026 #[doc(hidden)]
7027 impl crate::RequestBuilder for Delete {
7028 fn request_options(&mut self) -> &mut crate::RequestOptions {
7029 &mut self.0.options
7030 }
7031 }
7032
7033 #[derive(Clone, Debug)]
7050 pub struct Get(RequestBuilder<crate::model::SqlSslCertsGetRequest>);
7051
7052 impl Get {
7053 pub(crate) fn new(
7054 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
7055 ) -> Self {
7056 Self(RequestBuilder::new(stub))
7057 }
7058
7059 pub fn with_request<V: Into<crate::model::SqlSslCertsGetRequest>>(mut self, v: V) -> Self {
7061 self.0.request = v.into();
7062 self
7063 }
7064
7065 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7067 self.0.options = v.into();
7068 self
7069 }
7070
7071 pub async fn send(self) -> Result<crate::model::SslCert> {
7073 (*self.0.stub)
7074 .get(self.0.request, self.0.options)
7075 .await
7076 .map(crate::Response::into_body)
7077 }
7078
7079 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7081 self.0.request.instance = v.into();
7082 self
7083 }
7084
7085 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7087 self.0.request.project = v.into();
7088 self
7089 }
7090
7091 pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
7093 self.0.request.sha1_fingerprint = v.into();
7094 self
7095 }
7096 }
7097
7098 #[doc(hidden)]
7099 impl crate::RequestBuilder for Get {
7100 fn request_options(&mut self) -> &mut crate::RequestOptions {
7101 &mut self.0.options
7102 }
7103 }
7104
7105 #[derive(Clone, Debug)]
7122 pub struct Insert(RequestBuilder<crate::model::SqlSslCertsInsertRequest>);
7123
7124 impl Insert {
7125 pub(crate) fn new(
7126 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
7127 ) -> Self {
7128 Self(RequestBuilder::new(stub))
7129 }
7130
7131 pub fn with_request<V: Into<crate::model::SqlSslCertsInsertRequest>>(
7133 mut self,
7134 v: V,
7135 ) -> Self {
7136 self.0.request = v.into();
7137 self
7138 }
7139
7140 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7142 self.0.options = v.into();
7143 self
7144 }
7145
7146 pub async fn send(self) -> Result<crate::model::SslCertsInsertResponse> {
7148 (*self.0.stub)
7149 .insert(self.0.request, self.0.options)
7150 .await
7151 .map(crate::Response::into_body)
7152 }
7153
7154 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7156 self.0.request.instance = v.into();
7157 self
7158 }
7159
7160 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7162 self.0.request.project = v.into();
7163 self
7164 }
7165
7166 pub fn set_body<T>(mut self, v: T) -> Self
7168 where
7169 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
7170 {
7171 self.0.request.body = std::option::Option::Some(v.into());
7172 self
7173 }
7174
7175 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7177 where
7178 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
7179 {
7180 self.0.request.body = v.map(|x| x.into());
7181 self
7182 }
7183 }
7184
7185 #[doc(hidden)]
7186 impl crate::RequestBuilder for Insert {
7187 fn request_options(&mut self) -> &mut crate::RequestOptions {
7188 &mut self.0.options
7189 }
7190 }
7191
7192 #[derive(Clone, Debug)]
7209 pub struct List(RequestBuilder<crate::model::SqlSslCertsListRequest>);
7210
7211 impl List {
7212 pub(crate) fn new(
7213 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
7214 ) -> Self {
7215 Self(RequestBuilder::new(stub))
7216 }
7217
7218 pub fn with_request<V: Into<crate::model::SqlSslCertsListRequest>>(mut self, v: V) -> Self {
7220 self.0.request = v.into();
7221 self
7222 }
7223
7224 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7226 self.0.options = v.into();
7227 self
7228 }
7229
7230 pub async fn send(self) -> Result<crate::model::SslCertsListResponse> {
7232 (*self.0.stub)
7233 .list(self.0.request, self.0.options)
7234 .await
7235 .map(crate::Response::into_body)
7236 }
7237
7238 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7240 self.0.request.instance = v.into();
7241 self
7242 }
7243
7244 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7246 self.0.request.project = v.into();
7247 self
7248 }
7249 }
7250
7251 #[doc(hidden)]
7252 impl crate::RequestBuilder for List {
7253 fn request_options(&mut self) -> &mut crate::RequestOptions {
7254 &mut self.0.options
7255 }
7256 }
7257}
7258
7259pub mod sql_tiers_service {
7261 use crate::Result;
7262
7263 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7277
7278 pub(crate) mod client {
7279 use super::super::super::client::SqlTiersService;
7280 pub struct Factory;
7281 impl crate::ClientFactory for Factory {
7282 type Client = SqlTiersService;
7283 type Credentials = gaxi::options::Credentials;
7284 async fn build(
7285 self,
7286 config: gaxi::options::ClientConfig,
7287 ) -> crate::ClientBuilderResult<Self::Client> {
7288 Self::Client::new(config).await
7289 }
7290 }
7291 }
7292
7293 #[derive(Clone, Debug)]
7295 pub(crate) struct RequestBuilder<R: std::default::Default> {
7296 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
7297 request: R,
7298 options: crate::RequestOptions,
7299 }
7300
7301 impl<R> RequestBuilder<R>
7302 where
7303 R: std::default::Default,
7304 {
7305 pub(crate) fn new(
7306 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
7307 ) -> Self {
7308 Self {
7309 stub,
7310 request: R::default(),
7311 options: crate::RequestOptions::default(),
7312 }
7313 }
7314 }
7315
7316 #[derive(Clone, Debug)]
7333 pub struct List(RequestBuilder<crate::model::SqlTiersListRequest>);
7334
7335 impl List {
7336 pub(crate) fn new(
7337 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
7338 ) -> Self {
7339 Self(RequestBuilder::new(stub))
7340 }
7341
7342 pub fn with_request<V: Into<crate::model::SqlTiersListRequest>>(mut self, v: V) -> Self {
7344 self.0.request = v.into();
7345 self
7346 }
7347
7348 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7350 self.0.options = v.into();
7351 self
7352 }
7353
7354 pub async fn send(self) -> Result<crate::model::TiersListResponse> {
7356 (*self.0.stub)
7357 .list(self.0.request, self.0.options)
7358 .await
7359 .map(crate::Response::into_body)
7360 }
7361
7362 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7364 self.0.request.project = v.into();
7365 self
7366 }
7367 }
7368
7369 #[doc(hidden)]
7370 impl crate::RequestBuilder for List {
7371 fn request_options(&mut self) -> &mut crate::RequestOptions {
7372 &mut self.0.options
7373 }
7374 }
7375}
7376
7377pub mod sql_users_service {
7379 use crate::Result;
7380
7381 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7395
7396 pub(crate) mod client {
7397 use super::super::super::client::SqlUsersService;
7398 pub struct Factory;
7399 impl crate::ClientFactory for Factory {
7400 type Client = SqlUsersService;
7401 type Credentials = gaxi::options::Credentials;
7402 async fn build(
7403 self,
7404 config: gaxi::options::ClientConfig,
7405 ) -> crate::ClientBuilderResult<Self::Client> {
7406 Self::Client::new(config).await
7407 }
7408 }
7409 }
7410
7411 #[derive(Clone, Debug)]
7413 pub(crate) struct RequestBuilder<R: std::default::Default> {
7414 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
7415 request: R,
7416 options: crate::RequestOptions,
7417 }
7418
7419 impl<R> RequestBuilder<R>
7420 where
7421 R: std::default::Default,
7422 {
7423 pub(crate) fn new(
7424 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
7425 ) -> Self {
7426 Self {
7427 stub,
7428 request: R::default(),
7429 options: crate::RequestOptions::default(),
7430 }
7431 }
7432 }
7433
7434 #[derive(Clone, Debug)]
7451 pub struct Delete(RequestBuilder<crate::model::SqlUsersDeleteRequest>);
7452
7453 impl Delete {
7454 pub(crate) fn new(
7455 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
7456 ) -> Self {
7457 Self(RequestBuilder::new(stub))
7458 }
7459
7460 pub fn with_request<V: Into<crate::model::SqlUsersDeleteRequest>>(mut self, v: V) -> Self {
7462 self.0.request = v.into();
7463 self
7464 }
7465
7466 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7468 self.0.options = v.into();
7469 self
7470 }
7471
7472 pub async fn send(self) -> Result<crate::model::Operation> {
7474 (*self.0.stub)
7475 .delete(self.0.request, self.0.options)
7476 .await
7477 .map(crate::Response::into_body)
7478 }
7479
7480 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
7482 self.0.request.host = v.into();
7483 self
7484 }
7485
7486 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7488 self.0.request.instance = v.into();
7489 self
7490 }
7491
7492 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7494 self.0.request.name = v.into();
7495 self
7496 }
7497
7498 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7500 self.0.request.project = v.into();
7501 self
7502 }
7503
7504 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
7506 self.0.request.location = v.into();
7507 self
7508 }
7509 }
7510
7511 #[doc(hidden)]
7512 impl crate::RequestBuilder for Delete {
7513 fn request_options(&mut self) -> &mut crate::RequestOptions {
7514 &mut self.0.options
7515 }
7516 }
7517
7518 #[derive(Clone, Debug)]
7535 pub struct Get(RequestBuilder<crate::model::SqlUsersGetRequest>);
7536
7537 impl Get {
7538 pub(crate) fn new(
7539 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
7540 ) -> Self {
7541 Self(RequestBuilder::new(stub))
7542 }
7543
7544 pub fn with_request<V: Into<crate::model::SqlUsersGetRequest>>(mut self, v: V) -> Self {
7546 self.0.request = v.into();
7547 self
7548 }
7549
7550 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7552 self.0.options = v.into();
7553 self
7554 }
7555
7556 pub async fn send(self) -> Result<crate::model::User> {
7558 (*self.0.stub)
7559 .get(self.0.request, self.0.options)
7560 .await
7561 .map(crate::Response::into_body)
7562 }
7563
7564 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7566 self.0.request.instance = v.into();
7567 self
7568 }
7569
7570 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7572 self.0.request.name = v.into();
7573 self
7574 }
7575
7576 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7578 self.0.request.project = v.into();
7579 self
7580 }
7581
7582 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
7584 self.0.request.host = v.into();
7585 self
7586 }
7587
7588 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
7590 self.0.request.location = v.into();
7591 self
7592 }
7593 }
7594
7595 #[doc(hidden)]
7596 impl crate::RequestBuilder for Get {
7597 fn request_options(&mut self) -> &mut crate::RequestOptions {
7598 &mut self.0.options
7599 }
7600 }
7601
7602 #[derive(Clone, Debug)]
7619 pub struct Insert(RequestBuilder<crate::model::SqlUsersInsertRequest>);
7620
7621 impl Insert {
7622 pub(crate) fn new(
7623 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
7624 ) -> Self {
7625 Self(RequestBuilder::new(stub))
7626 }
7627
7628 pub fn with_request<V: Into<crate::model::SqlUsersInsertRequest>>(mut self, v: V) -> Self {
7630 self.0.request = v.into();
7631 self
7632 }
7633
7634 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7636 self.0.options = v.into();
7637 self
7638 }
7639
7640 pub async fn send(self) -> Result<crate::model::Operation> {
7642 (*self.0.stub)
7643 .insert(self.0.request, self.0.options)
7644 .await
7645 .map(crate::Response::into_body)
7646 }
7647
7648 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7650 self.0.request.instance = v.into();
7651 self
7652 }
7653
7654 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7656 self.0.request.project = v.into();
7657 self
7658 }
7659
7660 pub fn set_body<T>(mut self, v: T) -> Self
7662 where
7663 T: std::convert::Into<crate::model::User>,
7664 {
7665 self.0.request.body = std::option::Option::Some(v.into());
7666 self
7667 }
7668
7669 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7671 where
7672 T: std::convert::Into<crate::model::User>,
7673 {
7674 self.0.request.body = v.map(|x| x.into());
7675 self
7676 }
7677
7678 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
7680 self.0.request.location = v.into();
7681 self
7682 }
7683 }
7684
7685 #[doc(hidden)]
7686 impl crate::RequestBuilder for Insert {
7687 fn request_options(&mut self) -> &mut crate::RequestOptions {
7688 &mut self.0.options
7689 }
7690 }
7691
7692 #[derive(Clone, Debug)]
7709 pub struct List(RequestBuilder<crate::model::SqlUsersListRequest>);
7710
7711 impl List {
7712 pub(crate) fn new(
7713 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
7714 ) -> Self {
7715 Self(RequestBuilder::new(stub))
7716 }
7717
7718 pub fn with_request<V: Into<crate::model::SqlUsersListRequest>>(mut self, v: V) -> Self {
7720 self.0.request = v.into();
7721 self
7722 }
7723
7724 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7726 self.0.options = v.into();
7727 self
7728 }
7729
7730 pub async fn send(self) -> Result<crate::model::UsersListResponse> {
7732 (*self.0.stub)
7733 .list(self.0.request, self.0.options)
7734 .await
7735 .map(crate::Response::into_body)
7736 }
7737
7738 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7740 self.0.request.instance = v.into();
7741 self
7742 }
7743
7744 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7746 self.0.request.project = v.into();
7747 self
7748 }
7749
7750 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
7752 self.0.request.location = v.into();
7753 self
7754 }
7755 }
7756
7757 #[doc(hidden)]
7758 impl crate::RequestBuilder for List {
7759 fn request_options(&mut self) -> &mut crate::RequestOptions {
7760 &mut self.0.options
7761 }
7762 }
7763
7764 #[derive(Clone, Debug)]
7781 pub struct Update(RequestBuilder<crate::model::SqlUsersUpdateRequest>);
7782
7783 impl Update {
7784 pub(crate) fn new(
7785 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
7786 ) -> Self {
7787 Self(RequestBuilder::new(stub))
7788 }
7789
7790 pub fn with_request<V: Into<crate::model::SqlUsersUpdateRequest>>(mut self, v: V) -> Self {
7792 self.0.request = v.into();
7793 self
7794 }
7795
7796 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7798 self.0.options = v.into();
7799 self
7800 }
7801
7802 pub async fn send(self) -> Result<crate::model::Operation> {
7804 (*self.0.stub)
7805 .update(self.0.request, self.0.options)
7806 .await
7807 .map(crate::Response::into_body)
7808 }
7809
7810 pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
7812 self.0.request.host = v.into();
7813 self
7814 }
7815
7816 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7818 self.0.request.instance = v.into();
7819 self
7820 }
7821
7822 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7824 self.0.request.name = v.into();
7825 self
7826 }
7827
7828 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7830 self.0.request.project = v.into();
7831 self
7832 }
7833
7834 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
7836 where
7837 T: std::iter::IntoIterator<Item = V>,
7838 V: std::convert::Into<std::string::String>,
7839 {
7840 use std::iter::Iterator;
7841 self.0.request.database_roles = v.into_iter().map(|i| i.into()).collect();
7842 self
7843 }
7844
7845 pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
7847 where
7848 T: std::convert::Into<bool>,
7849 {
7850 self.0.request.revoke_existing_roles = std::option::Option::Some(v.into());
7851 self
7852 }
7853
7854 pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
7856 where
7857 T: std::convert::Into<bool>,
7858 {
7859 self.0.request.revoke_existing_roles = v.map(|x| x.into());
7860 self
7861 }
7862
7863 pub fn set_server_roles<T, V>(mut self, v: T) -> Self
7865 where
7866 T: std::iter::IntoIterator<Item = V>,
7867 V: std::convert::Into<std::string::String>,
7868 {
7869 use std::iter::Iterator;
7870 self.0.request.server_roles = v.into_iter().map(|i| i.into()).collect();
7871 self
7872 }
7873
7874 pub fn set_revoke_existing_server_roles<T>(mut self, v: T) -> Self
7876 where
7877 T: std::convert::Into<bool>,
7878 {
7879 self.0.request.revoke_existing_server_roles = std::option::Option::Some(v.into());
7880 self
7881 }
7882
7883 pub fn set_or_clear_revoke_existing_server_roles<T>(
7885 mut self,
7886 v: std::option::Option<T>,
7887 ) -> Self
7888 where
7889 T: std::convert::Into<bool>,
7890 {
7891 self.0.request.revoke_existing_server_roles = v.map(|x| x.into());
7892 self
7893 }
7894
7895 pub fn set_body<T>(mut self, v: T) -> Self
7897 where
7898 T: std::convert::Into<crate::model::User>,
7899 {
7900 self.0.request.body = std::option::Option::Some(v.into());
7901 self
7902 }
7903
7904 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7906 where
7907 T: std::convert::Into<crate::model::User>,
7908 {
7909 self.0.request.body = v.map(|x| x.into());
7910 self
7911 }
7912
7913 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
7915 self.0.request.location = v.into();
7916 self
7917 }
7918 }
7919
7920 #[doc(hidden)]
7921 impl crate::RequestBuilder for Update {
7922 fn request_options(&mut self) -> &mut crate::RequestOptions {
7923 &mut self.0.options
7924 }
7925 }
7926}
7927
7928pub mod sql_workload_captures_service {
7930 use crate::Result;
7931
7932 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7946
7947 pub(crate) mod client {
7948 use super::super::super::client::SqlWorkloadCapturesService;
7949 pub struct Factory;
7950 impl crate::ClientFactory for Factory {
7951 type Client = SqlWorkloadCapturesService;
7952 type Credentials = gaxi::options::Credentials;
7953 async fn build(
7954 self,
7955 config: gaxi::options::ClientConfig,
7956 ) -> crate::ClientBuilderResult<Self::Client> {
7957 Self::Client::new(config).await
7958 }
7959 }
7960 }
7961
7962 #[derive(Clone, Debug)]
7964 pub(crate) struct RequestBuilder<R: std::default::Default> {
7965 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlWorkloadCapturesService>,
7966 request: R,
7967 options: crate::RequestOptions,
7968 }
7969
7970 impl<R> RequestBuilder<R>
7971 where
7972 R: std::default::Default,
7973 {
7974 pub(crate) fn new(
7975 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlWorkloadCapturesService>,
7976 ) -> Self {
7977 Self {
7978 stub,
7979 request: R::default(),
7980 options: crate::RequestOptions::default(),
7981 }
7982 }
7983 }
7984
7985 #[derive(Clone, Debug)]
8002 pub struct Start(RequestBuilder<crate::model::WorkloadCapturesStartRequest>);
8003
8004 impl Start {
8005 pub(crate) fn new(
8006 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlWorkloadCapturesService>,
8007 ) -> Self {
8008 Self(RequestBuilder::new(stub))
8009 }
8010
8011 pub fn with_request<V: Into<crate::model::WorkloadCapturesStartRequest>>(
8013 mut self,
8014 v: V,
8015 ) -> Self {
8016 self.0.request = v.into();
8017 self
8018 }
8019
8020 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8022 self.0.options = v.into();
8023 self
8024 }
8025
8026 pub async fn send(self) -> Result<crate::model::Operation> {
8028 (*self.0.stub)
8029 .start(self.0.request, self.0.options)
8030 .await
8031 .map(crate::Response::into_body)
8032 }
8033
8034 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8038 self.0.request.project = v.into();
8039 self
8040 }
8041
8042 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8046 self.0.request.instance = v.into();
8047 self
8048 }
8049
8050 pub fn set_start_workload_capture_context<T>(mut self, v: T) -> Self
8052 where
8053 T: std::convert::Into<crate::model::StartWorkloadCaptureContext>,
8054 {
8055 self.0.request.start_workload_capture_context = std::option::Option::Some(v.into());
8056 self
8057 }
8058
8059 pub fn set_or_clear_start_workload_capture_context<T>(
8061 mut self,
8062 v: std::option::Option<T>,
8063 ) -> Self
8064 where
8065 T: std::convert::Into<crate::model::StartWorkloadCaptureContext>,
8066 {
8067 self.0.request.start_workload_capture_context = v.map(|x| x.into());
8068 self
8069 }
8070 }
8071
8072 #[doc(hidden)]
8073 impl crate::RequestBuilder for Start {
8074 fn request_options(&mut self) -> &mut crate::RequestOptions {
8075 &mut self.0.options
8076 }
8077 }
8078
8079 #[derive(Clone, Debug)]
8096 pub struct Stop(RequestBuilder<crate::model::WorkloadCapturesStopRequest>);
8097
8098 impl Stop {
8099 pub(crate) fn new(
8100 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlWorkloadCapturesService>,
8101 ) -> Self {
8102 Self(RequestBuilder::new(stub))
8103 }
8104
8105 pub fn with_request<V: Into<crate::model::WorkloadCapturesStopRequest>>(
8107 mut self,
8108 v: V,
8109 ) -> Self {
8110 self.0.request = v.into();
8111 self
8112 }
8113
8114 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8116 self.0.options = v.into();
8117 self
8118 }
8119
8120 pub async fn send(self) -> Result<crate::model::Operation> {
8122 (*self.0.stub)
8123 .stop(self.0.request, self.0.options)
8124 .await
8125 .map(crate::Response::into_body)
8126 }
8127
8128 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8132 self.0.request.project = v.into();
8133 self
8134 }
8135
8136 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8140 self.0.request.instance = v.into();
8141 self
8142 }
8143
8144 pub fn set_stop_workload_capture_context<T>(mut self, v: T) -> Self
8146 where
8147 T: std::convert::Into<crate::model::StopWorkloadCaptureContext>,
8148 {
8149 self.0.request.stop_workload_capture_context = std::option::Option::Some(v.into());
8150 self
8151 }
8152
8153 pub fn set_or_clear_stop_workload_capture_context<T>(
8155 mut self,
8156 v: std::option::Option<T>,
8157 ) -> Self
8158 where
8159 T: std::convert::Into<crate::model::StopWorkloadCaptureContext>,
8160 {
8161 self.0.request.stop_workload_capture_context = v.map(|x| x.into());
8162 self
8163 }
8164 }
8165
8166 #[doc(hidden)]
8167 impl crate::RequestBuilder for Stop {
8168 fn request_options(&mut self) -> &mut crate::RequestOptions {
8169 &mut self.0.options
8170 }
8171 }
8172
8173 #[derive(Clone, Debug)]
8190 pub struct StartReplay(RequestBuilder<crate::model::WorkloadCapturesStartReplayRequest>);
8191
8192 impl StartReplay {
8193 pub(crate) fn new(
8194 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlWorkloadCapturesService>,
8195 ) -> Self {
8196 Self(RequestBuilder::new(stub))
8197 }
8198
8199 pub fn with_request<V: Into<crate::model::WorkloadCapturesStartReplayRequest>>(
8201 mut self,
8202 v: V,
8203 ) -> Self {
8204 self.0.request = v.into();
8205 self
8206 }
8207
8208 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8210 self.0.options = v.into();
8211 self
8212 }
8213
8214 pub async fn send(self) -> Result<crate::model::Operation> {
8216 (*self.0.stub)
8217 .start_replay(self.0.request, self.0.options)
8218 .await
8219 .map(crate::Response::into_body)
8220 }
8221
8222 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8226 self.0.request.project = v.into();
8227 self
8228 }
8229
8230 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8234 self.0.request.instance = v.into();
8235 self
8236 }
8237
8238 pub fn set_start_workload_replay_context<T>(mut self, v: T) -> Self
8242 where
8243 T: std::convert::Into<crate::model::StartWorkloadReplayContext>,
8244 {
8245 self.0.request.start_workload_replay_context = std::option::Option::Some(v.into());
8246 self
8247 }
8248
8249 pub fn set_or_clear_start_workload_replay_context<T>(
8253 mut self,
8254 v: std::option::Option<T>,
8255 ) -> Self
8256 where
8257 T: std::convert::Into<crate::model::StartWorkloadReplayContext>,
8258 {
8259 self.0.request.start_workload_replay_context = v.map(|x| x.into());
8260 self
8261 }
8262
8263 pub fn set_workload_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8267 self.0.request.workload_id = v.into();
8268 self
8269 }
8270 }
8271
8272 #[doc(hidden)]
8273 impl crate::RequestBuilder for StartReplay {
8274 fn request_options(&mut self) -> &mut crate::RequestOptions {
8275 &mut self.0.options
8276 }
8277 }
8278
8279 #[derive(Clone, Debug)]
8296 pub struct StopReplay(RequestBuilder<crate::model::WorkloadCapturesStopReplayRequest>);
8297
8298 impl StopReplay {
8299 pub(crate) fn new(
8300 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlWorkloadCapturesService>,
8301 ) -> Self {
8302 Self(RequestBuilder::new(stub))
8303 }
8304
8305 pub fn with_request<V: Into<crate::model::WorkloadCapturesStopReplayRequest>>(
8307 mut self,
8308 v: V,
8309 ) -> Self {
8310 self.0.request = v.into();
8311 self
8312 }
8313
8314 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8316 self.0.options = v.into();
8317 self
8318 }
8319
8320 pub async fn send(self) -> Result<crate::model::Operation> {
8322 (*self.0.stub)
8323 .stop_replay(self.0.request, self.0.options)
8324 .await
8325 .map(crate::Response::into_body)
8326 }
8327
8328 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8332 self.0.request.project = v.into();
8333 self
8334 }
8335
8336 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8340 self.0.request.instance = v.into();
8341 self
8342 }
8343
8344 pub fn set_stop_workload_replay_context<T>(mut self, v: T) -> Self
8346 where
8347 T: std::convert::Into<crate::model::StopWorkloadReplayContext>,
8348 {
8349 self.0.request.stop_workload_replay_context = std::option::Option::Some(v.into());
8350 self
8351 }
8352
8353 pub fn set_or_clear_stop_workload_replay_context<T>(
8355 mut self,
8356 v: std::option::Option<T>,
8357 ) -> Self
8358 where
8359 T: std::convert::Into<crate::model::StopWorkloadReplayContext>,
8360 {
8361 self.0.request.stop_workload_replay_context = v.map(|x| x.into());
8362 self
8363 }
8364 }
8365
8366 #[doc(hidden)]
8367 impl crate::RequestBuilder for StopReplay {
8368 fn request_options(&mut self) -> &mut crate::RequestOptions {
8369 &mut self.0.options
8370 }
8371 }
8372
8373 #[derive(Clone, Debug)]
8390 pub struct List(RequestBuilder<crate::model::SqlWorkloadCapturesListRequest>);
8391
8392 impl List {
8393 pub(crate) fn new(
8394 stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlWorkloadCapturesService>,
8395 ) -> Self {
8396 Self(RequestBuilder::new(stub))
8397 }
8398
8399 pub fn with_request<V: Into<crate::model::SqlWorkloadCapturesListRequest>>(
8401 mut self,
8402 v: V,
8403 ) -> Self {
8404 self.0.request = v.into();
8405 self
8406 }
8407
8408 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8410 self.0.options = v.into();
8411 self
8412 }
8413
8414 pub async fn send(self) -> Result<crate::model::WorkloadCapturesListResponse> {
8416 (*self.0.stub)
8417 .list(self.0.request, self.0.options)
8418 .await
8419 .map(crate::Response::into_body)
8420 }
8421
8422 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8426 self.0.request.project = v.into();
8427 self
8428 }
8429
8430 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8434 self.0.request.instance = v.into();
8435 self
8436 }
8437 }
8438
8439 #[doc(hidden)]
8440 impl crate::RequestBuilder for List {
8441 fn request_options(&mut self) -> &mut crate::RequestOptions {
8442 &mut self.0.options
8443 }
8444 }
8445}