Skip to main content

google_cloud_sql_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17/// Request and client builders for [SqlBackupRunsService][crate::client::SqlBackupRunsService].
18pub mod sql_backup_runs_service {
19    use crate::Result;
20
21    /// A builder for [SqlBackupRunsService][crate::client::SqlBackupRunsService].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_sql_v1::*;
26    /// # use builder::sql_backup_runs_service::ClientBuilder;
27    /// # use client::SqlBackupRunsService;
28    /// let builder : ClientBuilder = SqlBackupRunsService::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://sqladmin.googleapis.com")
31    ///     .build().await?;
32    /// # Ok(()) }
33    /// ```
34    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    /// Common implementation for [crate::client::SqlBackupRunsService] request builders.
52    #[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    /// The request builder for [SqlBackupRunsService::delete][crate::client::SqlBackupRunsService::delete] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_sql_v1::builder::sql_backup_runs_service::Delete;
79    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
80    ///
81    /// let builder = prepare_request_builder();
82    /// let response = builder.send().await?;
83    /// # Ok(()) }
84    ///
85    /// fn prepare_request_builder() -> Delete {
86    ///   # panic!();
87    ///   // ... details omitted ...
88    /// }
89    /// ```
90    #[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        /// Sets the full request, replacing any prior values.
101        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        /// Sets all the options, replacing any prior values.
110        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111            self.0.options = v.into();
112            self
113        }
114
115        /// Sends the request.
116        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        /// Sets the value of [id][crate::model::SqlBackupRunsDeleteRequest::id].
124        pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
125            self.0.request.id = v.into();
126            self
127        }
128
129        /// Sets the value of [instance][crate::model::SqlBackupRunsDeleteRequest::instance].
130        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        /// Sets the value of [project][crate::model::SqlBackupRunsDeleteRequest::project].
136        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    /// The request builder for [SqlBackupRunsService::get][crate::client::SqlBackupRunsService::get] calls.
150    ///
151    /// # Example
152    /// ```
153    /// # use google_cloud_sql_v1::builder::sql_backup_runs_service::Get;
154    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
155    ///
156    /// let builder = prepare_request_builder();
157    /// let response = builder.send().await?;
158    /// # Ok(()) }
159    ///
160    /// fn prepare_request_builder() -> Get {
161    ///   # panic!();
162    ///   // ... details omitted ...
163    /// }
164    /// ```
165    #[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        /// Sets the full request, replacing any prior values.
176        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        /// Sets all the options, replacing any prior values.
185        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
186            self.0.options = v.into();
187            self
188        }
189
190        /// Sends the request.
191        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        /// Sets the value of [id][crate::model::SqlBackupRunsGetRequest::id].
199        pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
200            self.0.request.id = v.into();
201            self
202        }
203
204        /// Sets the value of [instance][crate::model::SqlBackupRunsGetRequest::instance].
205        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        /// Sets the value of [project][crate::model::SqlBackupRunsGetRequest::project].
211        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    /// The request builder for [SqlBackupRunsService::insert][crate::client::SqlBackupRunsService::insert] calls.
225    ///
226    /// # Example
227    /// ```
228    /// # use google_cloud_sql_v1::builder::sql_backup_runs_service::Insert;
229    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
230    ///
231    /// let builder = prepare_request_builder();
232    /// let response = builder.send().await?;
233    /// # Ok(()) }
234    ///
235    /// fn prepare_request_builder() -> Insert {
236    ///   # panic!();
237    ///   // ... details omitted ...
238    /// }
239    /// ```
240    #[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        /// Sets the full request, replacing any prior values.
251        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        /// Sets all the options, replacing any prior values.
260        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
261            self.0.options = v.into();
262            self
263        }
264
265        /// Sends the request.
266        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        /// Sets the value of [instance][crate::model::SqlBackupRunsInsertRequest::instance].
274        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        /// Sets the value of [project][crate::model::SqlBackupRunsInsertRequest::project].
280        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        /// Sets the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
286        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        /// Sets or clears the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
295        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    /// The request builder for [SqlBackupRunsService::list][crate::client::SqlBackupRunsService::list] calls.
312    ///
313    /// # Example
314    /// ```
315    /// # use google_cloud_sql_v1::builder::sql_backup_runs_service::List;
316    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
317    /// use google_cloud_gax::paginator::ItemPaginator;
318    ///
319    /// let builder = prepare_request_builder();
320    /// let mut items = builder.by_item();
321    /// while let Some(result) = items.next().await {
322    ///   let item = result?;
323    /// }
324    /// # Ok(()) }
325    ///
326    /// fn prepare_request_builder() -> List {
327    ///   # panic!();
328    ///   // ... details omitted ...
329    /// }
330    /// ```
331    #[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        /// Sets the full request, replacing any prior values.
342        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        /// Sets all the options, replacing any prior values.
351        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
352            self.0.options = v.into();
353            self
354        }
355
356        /// Sends the request.
357        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        /// Streams each page in the collection.
365        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        /// Streams each item in the collection.
382        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        /// Sets the value of [instance][crate::model::SqlBackupRunsListRequest::instance].
393        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        /// Sets the value of [max_results][crate::model::SqlBackupRunsListRequest::max_results].
399        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        /// Sets the value of [page_token][crate::model::SqlBackupRunsListRequest::page_token].
405        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        /// Sets the value of [project][crate::model::SqlBackupRunsListRequest::project].
411        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
425/// Request and client builders for [SqlBackupsService][crate::client::SqlBackupsService].
426pub mod sql_backups_service {
427    use crate::Result;
428
429    /// A builder for [SqlBackupsService][crate::client::SqlBackupsService].
430    ///
431    /// ```
432    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
433    /// # use google_cloud_sql_v1::*;
434    /// # use builder::sql_backups_service::ClientBuilder;
435    /// # use client::SqlBackupsService;
436    /// let builder : ClientBuilder = SqlBackupsService::builder();
437    /// let client = builder
438    ///     .with_endpoint("https://sqladmin.googleapis.com")
439    ///     .build().await?;
440    /// # Ok(()) }
441    /// ```
442    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    /// Common implementation for [crate::client::SqlBackupsService] request builders.
460    #[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    /// The request builder for [SqlBackupsService::create_backup][crate::client::SqlBackupsService::create_backup] calls.
483    ///
484    /// # Example
485    /// ```
486    /// # use google_cloud_sql_v1::builder::sql_backups_service::CreateBackup;
487    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
488    ///
489    /// let builder = prepare_request_builder();
490    /// let response = builder.send().await?;
491    /// # Ok(()) }
492    ///
493    /// fn prepare_request_builder() -> CreateBackup {
494    ///   # panic!();
495    ///   // ... details omitted ...
496    /// }
497    /// ```
498    #[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        /// Sets the full request, replacing any prior values.
509        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        /// Sets all the options, replacing any prior values.
515        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
516            self.0.options = v.into();
517            self
518        }
519
520        /// Sends the request.
521        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        /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
529        ///
530        /// This is a **required** field for requests.
531        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        /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
537        ///
538        /// This is a **required** field for requests.
539        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        /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
548        ///
549        /// This is a **required** field for requests.
550        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    /// The request builder for [SqlBackupsService::get_backup][crate::client::SqlBackupsService::get_backup] calls.
567    ///
568    /// # Example
569    /// ```
570    /// # use google_cloud_sql_v1::builder::sql_backups_service::GetBackup;
571    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
572    ///
573    /// let builder = prepare_request_builder();
574    /// let response = builder.send().await?;
575    /// # Ok(()) }
576    ///
577    /// fn prepare_request_builder() -> GetBackup {
578    ///   # panic!();
579    ///   // ... details omitted ...
580    /// }
581    /// ```
582    #[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        /// Sets the full request, replacing any prior values.
593        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        /// Sets all the options, replacing any prior values.
599        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
600            self.0.options = v.into();
601            self
602        }
603
604        /// Sends the request.
605        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        /// Sets the value of [name][crate::model::GetBackupRequest::name].
613        ///
614        /// This is a **required** field for requests.
615        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    /// The request builder for [SqlBackupsService::list_backups][crate::client::SqlBackupsService::list_backups] calls.
629    ///
630    /// # Example
631    /// ```
632    /// # use google_cloud_sql_v1::builder::sql_backups_service::ListBackups;
633    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
634    /// use google_cloud_gax::paginator::ItemPaginator;
635    ///
636    /// let builder = prepare_request_builder();
637    /// let mut items = builder.by_item();
638    /// while let Some(result) = items.next().await {
639    ///   let item = result?;
640    /// }
641    /// # Ok(()) }
642    ///
643    /// fn prepare_request_builder() -> ListBackups {
644    ///   # panic!();
645    ///   // ... details omitted ...
646    /// }
647    /// ```
648    #[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        /// Sets the full request, replacing any prior values.
659        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        /// Sets all the options, replacing any prior values.
665        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
666            self.0.options = v.into();
667            self
668        }
669
670        /// Sends the request.
671        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        /// Streams each page in the collection.
679        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        /// Streams each item in the collection.
694        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        /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
705        ///
706        /// This is a **required** field for requests.
707        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        /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
713        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        /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
719        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        /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
725        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    /// The request builder for [SqlBackupsService::update_backup][crate::client::SqlBackupsService::update_backup] calls.
739    ///
740    /// # Example
741    /// ```
742    /// # use google_cloud_sql_v1::builder::sql_backups_service::UpdateBackup;
743    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
744    ///
745    /// let builder = prepare_request_builder();
746    /// let response = builder.send().await?;
747    /// # Ok(()) }
748    ///
749    /// fn prepare_request_builder() -> UpdateBackup {
750    ///   # panic!();
751    ///   // ... details omitted ...
752    /// }
753    /// ```
754    #[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        /// Sets the full request, replacing any prior values.
765        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        /// Sets all the options, replacing any prior values.
771        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
772            self.0.options = v.into();
773            self
774        }
775
776        /// Sends the request.
777        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        /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
785        ///
786        /// This is a **required** field for requests.
787        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        /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
796        ///
797        /// This is a **required** field for requests.
798        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        /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
807        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        /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
816        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    /// The request builder for [SqlBackupsService::delete_backup][crate::client::SqlBackupsService::delete_backup] calls.
833    ///
834    /// # Example
835    /// ```
836    /// # use google_cloud_sql_v1::builder::sql_backups_service::DeleteBackup;
837    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
838    ///
839    /// let builder = prepare_request_builder();
840    /// let response = builder.send().await?;
841    /// # Ok(()) }
842    ///
843    /// fn prepare_request_builder() -> DeleteBackup {
844    ///   # panic!();
845    ///   // ... details omitted ...
846    /// }
847    /// ```
848    #[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        /// Sets the full request, replacing any prior values.
859        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        /// Sets all the options, replacing any prior values.
865        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
866            self.0.options = v.into();
867            self
868        }
869
870        /// Sends the request.
871        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        /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
879        ///
880        /// This is a **required** field for requests.
881        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
895/// Request and client builders for [SqlConnectService][crate::client::SqlConnectService].
896pub mod sql_connect_service {
897    use crate::Result;
898
899    /// A builder for [SqlConnectService][crate::client::SqlConnectService].
900    ///
901    /// ```
902    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
903    /// # use google_cloud_sql_v1::*;
904    /// # use builder::sql_connect_service::ClientBuilder;
905    /// # use client::SqlConnectService;
906    /// let builder : ClientBuilder = SqlConnectService::builder();
907    /// let client = builder
908    ///     .with_endpoint("https://sqladmin.googleapis.com")
909    ///     .build().await?;
910    /// # Ok(()) }
911    /// ```
912    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
913
914    pub(crate) mod client {
915        use super::super::super::client::SqlConnectService;
916        pub struct Factory;
917        impl crate::ClientFactory for Factory {
918            type Client = SqlConnectService;
919            type Credentials = gaxi::options::Credentials;
920            async fn build(
921                self,
922                config: gaxi::options::ClientConfig,
923            ) -> crate::ClientBuilderResult<Self::Client> {
924                Self::Client::new(config).await
925            }
926        }
927    }
928
929    /// Common implementation for [crate::client::SqlConnectService] request builders.
930    #[derive(Clone, Debug)]
931    pub(crate) struct RequestBuilder<R: std::default::Default> {
932        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
933        request: R,
934        options: crate::RequestOptions,
935    }
936
937    impl<R> RequestBuilder<R>
938    where
939        R: std::default::Default,
940    {
941        pub(crate) fn new(
942            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
943        ) -> Self {
944            Self {
945                stub,
946                request: R::default(),
947                options: crate::RequestOptions::default(),
948            }
949        }
950    }
951
952    /// The request builder for [SqlConnectService::get_connect_settings][crate::client::SqlConnectService::get_connect_settings] calls.
953    ///
954    /// # Example
955    /// ```
956    /// # use google_cloud_sql_v1::builder::sql_connect_service::GetConnectSettings;
957    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
958    ///
959    /// let builder = prepare_request_builder();
960    /// let response = builder.send().await?;
961    /// # Ok(()) }
962    ///
963    /// fn prepare_request_builder() -> GetConnectSettings {
964    ///   # panic!();
965    ///   // ... details omitted ...
966    /// }
967    /// ```
968    #[derive(Clone, Debug)]
969    pub struct GetConnectSettings(RequestBuilder<crate::model::GetConnectSettingsRequest>);
970
971    impl GetConnectSettings {
972        pub(crate) fn new(
973            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
974        ) -> Self {
975            Self(RequestBuilder::new(stub))
976        }
977
978        /// Sets the full request, replacing any prior values.
979        pub fn with_request<V: Into<crate::model::GetConnectSettingsRequest>>(
980            mut self,
981            v: V,
982        ) -> Self {
983            self.0.request = v.into();
984            self
985        }
986
987        /// Sets all the options, replacing any prior values.
988        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
989            self.0.options = v.into();
990            self
991        }
992
993        /// Sends the request.
994        pub async fn send(self) -> Result<crate::model::ConnectSettings> {
995            (*self.0.stub)
996                .get_connect_settings(self.0.request, self.0.options)
997                .await
998                .map(crate::Response::into_body)
999        }
1000
1001        /// Sets the value of [instance][crate::model::GetConnectSettingsRequest::instance].
1002        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1003            self.0.request.instance = v.into();
1004            self
1005        }
1006
1007        /// Sets the value of [project][crate::model::GetConnectSettingsRequest::project].
1008        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1009            self.0.request.project = v.into();
1010            self
1011        }
1012
1013        /// Sets the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
1014        pub fn set_read_time<T>(mut self, v: T) -> Self
1015        where
1016            T: std::convert::Into<wkt::Timestamp>,
1017        {
1018            self.0.request.read_time = std::option::Option::Some(v.into());
1019            self
1020        }
1021
1022        /// Sets or clears the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
1023        pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1024        where
1025            T: std::convert::Into<wkt::Timestamp>,
1026        {
1027            self.0.request.read_time = v.map(|x| x.into());
1028            self
1029        }
1030    }
1031
1032    #[doc(hidden)]
1033    impl crate::RequestBuilder for GetConnectSettings {
1034        fn request_options(&mut self) -> &mut crate::RequestOptions {
1035            &mut self.0.options
1036        }
1037    }
1038
1039    /// The request builder for [SqlConnectService::resolve_connect_settings][crate::client::SqlConnectService::resolve_connect_settings] calls.
1040    ///
1041    /// # Example
1042    /// ```
1043    /// # use google_cloud_sql_v1::builder::sql_connect_service::ResolveConnectSettings;
1044    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
1045    ///
1046    /// let builder = prepare_request_builder();
1047    /// let response = builder.send().await?;
1048    /// # Ok(()) }
1049    ///
1050    /// fn prepare_request_builder() -> ResolveConnectSettings {
1051    ///   # panic!();
1052    ///   // ... details omitted ...
1053    /// }
1054    /// ```
1055    #[derive(Clone, Debug)]
1056    pub struct ResolveConnectSettings(RequestBuilder<crate::model::ResolveConnectSettingsRequest>);
1057
1058    impl ResolveConnectSettings {
1059        pub(crate) fn new(
1060            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
1061        ) -> Self {
1062            Self(RequestBuilder::new(stub))
1063        }
1064
1065        /// Sets the full request, replacing any prior values.
1066        pub fn with_request<V: Into<crate::model::ResolveConnectSettingsRequest>>(
1067            mut self,
1068            v: V,
1069        ) -> Self {
1070            self.0.request = v.into();
1071            self
1072        }
1073
1074        /// Sets all the options, replacing any prior values.
1075        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1076            self.0.options = v.into();
1077            self
1078        }
1079
1080        /// Sends the request.
1081        pub async fn send(self) -> Result<crate::model::ConnectSettings> {
1082            (*self.0.stub)
1083                .resolve_connect_settings(self.0.request, self.0.options)
1084                .await
1085                .map(crate::Response::into_body)
1086        }
1087
1088        /// Sets the value of [dns_name][crate::model::ResolveConnectSettingsRequest::dns_name].
1089        ///
1090        /// This is a **required** field for requests.
1091        pub fn set_dns_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1092            self.0.request.dns_name = v.into();
1093            self
1094        }
1095
1096        /// Sets the value of [location][crate::model::ResolveConnectSettingsRequest::location].
1097        ///
1098        /// This is a **required** field for requests.
1099        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1100            self.0.request.location = v.into();
1101            self
1102        }
1103    }
1104
1105    #[doc(hidden)]
1106    impl crate::RequestBuilder for ResolveConnectSettings {
1107        fn request_options(&mut self) -> &mut crate::RequestOptions {
1108            &mut self.0.options
1109        }
1110    }
1111
1112    /// The request builder for [SqlConnectService::generate_ephemeral_cert][crate::client::SqlConnectService::generate_ephemeral_cert] calls.
1113    ///
1114    /// # Example
1115    /// ```
1116    /// # use google_cloud_sql_v1::builder::sql_connect_service::GenerateEphemeralCert;
1117    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
1118    ///
1119    /// let builder = prepare_request_builder();
1120    /// let response = builder.send().await?;
1121    /// # Ok(()) }
1122    ///
1123    /// fn prepare_request_builder() -> GenerateEphemeralCert {
1124    ///   # panic!();
1125    ///   // ... details omitted ...
1126    /// }
1127    /// ```
1128    #[derive(Clone, Debug)]
1129    pub struct GenerateEphemeralCert(RequestBuilder<crate::model::GenerateEphemeralCertRequest>);
1130
1131    impl GenerateEphemeralCert {
1132        pub(crate) fn new(
1133            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
1134        ) -> Self {
1135            Self(RequestBuilder::new(stub))
1136        }
1137
1138        /// Sets the full request, replacing any prior values.
1139        pub fn with_request<V: Into<crate::model::GenerateEphemeralCertRequest>>(
1140            mut self,
1141            v: V,
1142        ) -> Self {
1143            self.0.request = v.into();
1144            self
1145        }
1146
1147        /// Sets all the options, replacing any prior values.
1148        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1149            self.0.options = v.into();
1150            self
1151        }
1152
1153        /// Sends the request.
1154        pub async fn send(self) -> Result<crate::model::GenerateEphemeralCertResponse> {
1155            (*self.0.stub)
1156                .generate_ephemeral_cert(self.0.request, self.0.options)
1157                .await
1158                .map(crate::Response::into_body)
1159        }
1160
1161        /// Sets the value of [instance][crate::model::GenerateEphemeralCertRequest::instance].
1162        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1163            self.0.request.instance = v.into();
1164            self
1165        }
1166
1167        /// Sets the value of [project][crate::model::GenerateEphemeralCertRequest::project].
1168        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1169            self.0.request.project = v.into();
1170            self
1171        }
1172
1173        /// Sets the value of [public_key][crate::model::GenerateEphemeralCertRequest::public_key].
1174        pub fn set_public_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1175            self.0.request.public_key = v.into();
1176            self
1177        }
1178
1179        /// Sets the value of [access_token][crate::model::GenerateEphemeralCertRequest::access_token].
1180        pub fn set_access_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1181            self.0.request.access_token = v.into();
1182            self
1183        }
1184
1185        /// Sets the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
1186        pub fn set_read_time<T>(mut self, v: T) -> Self
1187        where
1188            T: std::convert::Into<wkt::Timestamp>,
1189        {
1190            self.0.request.read_time = std::option::Option::Some(v.into());
1191            self
1192        }
1193
1194        /// Sets or clears the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
1195        pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1196        where
1197            T: std::convert::Into<wkt::Timestamp>,
1198        {
1199            self.0.request.read_time = v.map(|x| x.into());
1200            self
1201        }
1202
1203        /// Sets the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
1204        pub fn set_valid_duration<T>(mut self, v: T) -> Self
1205        where
1206            T: std::convert::Into<wkt::Duration>,
1207        {
1208            self.0.request.valid_duration = std::option::Option::Some(v.into());
1209            self
1210        }
1211
1212        /// Sets or clears the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
1213        pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
1214        where
1215            T: std::convert::Into<wkt::Duration>,
1216        {
1217            self.0.request.valid_duration = v.map(|x| x.into());
1218            self
1219        }
1220    }
1221
1222    #[doc(hidden)]
1223    impl crate::RequestBuilder for GenerateEphemeralCert {
1224        fn request_options(&mut self) -> &mut crate::RequestOptions {
1225            &mut self.0.options
1226        }
1227    }
1228}
1229
1230/// Request and client builders for [SqlDatabasesService][crate::client::SqlDatabasesService].
1231pub mod sql_databases_service {
1232    use crate::Result;
1233
1234    /// A builder for [SqlDatabasesService][crate::client::SqlDatabasesService].
1235    ///
1236    /// ```
1237    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1238    /// # use google_cloud_sql_v1::*;
1239    /// # use builder::sql_databases_service::ClientBuilder;
1240    /// # use client::SqlDatabasesService;
1241    /// let builder : ClientBuilder = SqlDatabasesService::builder();
1242    /// let client = builder
1243    ///     .with_endpoint("https://sqladmin.googleapis.com")
1244    ///     .build().await?;
1245    /// # Ok(()) }
1246    /// ```
1247    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1248
1249    pub(crate) mod client {
1250        use super::super::super::client::SqlDatabasesService;
1251        pub struct Factory;
1252        impl crate::ClientFactory for Factory {
1253            type Client = SqlDatabasesService;
1254            type Credentials = gaxi::options::Credentials;
1255            async fn build(
1256                self,
1257                config: gaxi::options::ClientConfig,
1258            ) -> crate::ClientBuilderResult<Self::Client> {
1259                Self::Client::new(config).await
1260            }
1261        }
1262    }
1263
1264    /// Common implementation for [crate::client::SqlDatabasesService] request builders.
1265    #[derive(Clone, Debug)]
1266    pub(crate) struct RequestBuilder<R: std::default::Default> {
1267        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1268        request: R,
1269        options: crate::RequestOptions,
1270    }
1271
1272    impl<R> RequestBuilder<R>
1273    where
1274        R: std::default::Default,
1275    {
1276        pub(crate) fn new(
1277            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1278        ) -> Self {
1279            Self {
1280                stub,
1281                request: R::default(),
1282                options: crate::RequestOptions::default(),
1283            }
1284        }
1285    }
1286
1287    /// The request builder for [SqlDatabasesService::delete][crate::client::SqlDatabasesService::delete] calls.
1288    ///
1289    /// # Example
1290    /// ```
1291    /// # use google_cloud_sql_v1::builder::sql_databases_service::Delete;
1292    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
1293    ///
1294    /// let builder = prepare_request_builder();
1295    /// let response = builder.send().await?;
1296    /// # Ok(()) }
1297    ///
1298    /// fn prepare_request_builder() -> Delete {
1299    ///   # panic!();
1300    ///   // ... details omitted ...
1301    /// }
1302    /// ```
1303    #[derive(Clone, Debug)]
1304    pub struct Delete(RequestBuilder<crate::model::SqlDatabasesDeleteRequest>);
1305
1306    impl Delete {
1307        pub(crate) fn new(
1308            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1309        ) -> Self {
1310            Self(RequestBuilder::new(stub))
1311        }
1312
1313        /// Sets the full request, replacing any prior values.
1314        pub fn with_request<V: Into<crate::model::SqlDatabasesDeleteRequest>>(
1315            mut self,
1316            v: V,
1317        ) -> Self {
1318            self.0.request = v.into();
1319            self
1320        }
1321
1322        /// Sets all the options, replacing any prior values.
1323        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1324            self.0.options = v.into();
1325            self
1326        }
1327
1328        /// Sends the request.
1329        pub async fn send(self) -> Result<crate::model::Operation> {
1330            (*self.0.stub)
1331                .delete(self.0.request, self.0.options)
1332                .await
1333                .map(crate::Response::into_body)
1334        }
1335
1336        /// Sets the value of [database][crate::model::SqlDatabasesDeleteRequest::database].
1337        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1338            self.0.request.database = v.into();
1339            self
1340        }
1341
1342        /// Sets the value of [instance][crate::model::SqlDatabasesDeleteRequest::instance].
1343        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1344            self.0.request.instance = v.into();
1345            self
1346        }
1347
1348        /// Sets the value of [project][crate::model::SqlDatabasesDeleteRequest::project].
1349        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1350            self.0.request.project = v.into();
1351            self
1352        }
1353    }
1354
1355    #[doc(hidden)]
1356    impl crate::RequestBuilder for Delete {
1357        fn request_options(&mut self) -> &mut crate::RequestOptions {
1358            &mut self.0.options
1359        }
1360    }
1361
1362    /// The request builder for [SqlDatabasesService::get][crate::client::SqlDatabasesService::get] calls.
1363    ///
1364    /// # Example
1365    /// ```
1366    /// # use google_cloud_sql_v1::builder::sql_databases_service::Get;
1367    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
1368    ///
1369    /// let builder = prepare_request_builder();
1370    /// let response = builder.send().await?;
1371    /// # Ok(()) }
1372    ///
1373    /// fn prepare_request_builder() -> Get {
1374    ///   # panic!();
1375    ///   // ... details omitted ...
1376    /// }
1377    /// ```
1378    #[derive(Clone, Debug)]
1379    pub struct Get(RequestBuilder<crate::model::SqlDatabasesGetRequest>);
1380
1381    impl Get {
1382        pub(crate) fn new(
1383            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1384        ) -> Self {
1385            Self(RequestBuilder::new(stub))
1386        }
1387
1388        /// Sets the full request, replacing any prior values.
1389        pub fn with_request<V: Into<crate::model::SqlDatabasesGetRequest>>(mut self, v: V) -> Self {
1390            self.0.request = v.into();
1391            self
1392        }
1393
1394        /// Sets all the options, replacing any prior values.
1395        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1396            self.0.options = v.into();
1397            self
1398        }
1399
1400        /// Sends the request.
1401        pub async fn send(self) -> Result<crate::model::Database> {
1402            (*self.0.stub)
1403                .get(self.0.request, self.0.options)
1404                .await
1405                .map(crate::Response::into_body)
1406        }
1407
1408        /// Sets the value of [database][crate::model::SqlDatabasesGetRequest::database].
1409        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1410            self.0.request.database = v.into();
1411            self
1412        }
1413
1414        /// Sets the value of [instance][crate::model::SqlDatabasesGetRequest::instance].
1415        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1416            self.0.request.instance = v.into();
1417            self
1418        }
1419
1420        /// Sets the value of [project][crate::model::SqlDatabasesGetRequest::project].
1421        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1422            self.0.request.project = v.into();
1423            self
1424        }
1425    }
1426
1427    #[doc(hidden)]
1428    impl crate::RequestBuilder for Get {
1429        fn request_options(&mut self) -> &mut crate::RequestOptions {
1430            &mut self.0.options
1431        }
1432    }
1433
1434    /// The request builder for [SqlDatabasesService::insert][crate::client::SqlDatabasesService::insert] calls.
1435    ///
1436    /// # Example
1437    /// ```
1438    /// # use google_cloud_sql_v1::builder::sql_databases_service::Insert;
1439    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
1440    ///
1441    /// let builder = prepare_request_builder();
1442    /// let response = builder.send().await?;
1443    /// # Ok(()) }
1444    ///
1445    /// fn prepare_request_builder() -> Insert {
1446    ///   # panic!();
1447    ///   // ... details omitted ...
1448    /// }
1449    /// ```
1450    #[derive(Clone, Debug)]
1451    pub struct Insert(RequestBuilder<crate::model::SqlDatabasesInsertRequest>);
1452
1453    impl Insert {
1454        pub(crate) fn new(
1455            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1456        ) -> Self {
1457            Self(RequestBuilder::new(stub))
1458        }
1459
1460        /// Sets the full request, replacing any prior values.
1461        pub fn with_request<V: Into<crate::model::SqlDatabasesInsertRequest>>(
1462            mut self,
1463            v: V,
1464        ) -> Self {
1465            self.0.request = v.into();
1466            self
1467        }
1468
1469        /// Sets all the options, replacing any prior values.
1470        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1471            self.0.options = v.into();
1472            self
1473        }
1474
1475        /// Sends the request.
1476        pub async fn send(self) -> Result<crate::model::Operation> {
1477            (*self.0.stub)
1478                .insert(self.0.request, self.0.options)
1479                .await
1480                .map(crate::Response::into_body)
1481        }
1482
1483        /// Sets the value of [instance][crate::model::SqlDatabasesInsertRequest::instance].
1484        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1485            self.0.request.instance = v.into();
1486            self
1487        }
1488
1489        /// Sets the value of [project][crate::model::SqlDatabasesInsertRequest::project].
1490        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1491            self.0.request.project = v.into();
1492            self
1493        }
1494
1495        /// Sets the value of [body][crate::model::SqlDatabasesInsertRequest::body].
1496        pub fn set_body<T>(mut self, v: T) -> Self
1497        where
1498            T: std::convert::Into<crate::model::Database>,
1499        {
1500            self.0.request.body = std::option::Option::Some(v.into());
1501            self
1502        }
1503
1504        /// Sets or clears the value of [body][crate::model::SqlDatabasesInsertRequest::body].
1505        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1506        where
1507            T: std::convert::Into<crate::model::Database>,
1508        {
1509            self.0.request.body = v.map(|x| x.into());
1510            self
1511        }
1512    }
1513
1514    #[doc(hidden)]
1515    impl crate::RequestBuilder for Insert {
1516        fn request_options(&mut self) -> &mut crate::RequestOptions {
1517            &mut self.0.options
1518        }
1519    }
1520
1521    /// The request builder for [SqlDatabasesService::list][crate::client::SqlDatabasesService::list] calls.
1522    ///
1523    /// # Example
1524    /// ```
1525    /// # use google_cloud_sql_v1::builder::sql_databases_service::List;
1526    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
1527    ///
1528    /// let builder = prepare_request_builder();
1529    /// let response = builder.send().await?;
1530    /// # Ok(()) }
1531    ///
1532    /// fn prepare_request_builder() -> List {
1533    ///   # panic!();
1534    ///   // ... details omitted ...
1535    /// }
1536    /// ```
1537    #[derive(Clone, Debug)]
1538    pub struct List(RequestBuilder<crate::model::SqlDatabasesListRequest>);
1539
1540    impl List {
1541        pub(crate) fn new(
1542            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1543        ) -> Self {
1544            Self(RequestBuilder::new(stub))
1545        }
1546
1547        /// Sets the full request, replacing any prior values.
1548        pub fn with_request<V: Into<crate::model::SqlDatabasesListRequest>>(
1549            mut self,
1550            v: V,
1551        ) -> Self {
1552            self.0.request = v.into();
1553            self
1554        }
1555
1556        /// Sets all the options, replacing any prior values.
1557        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1558            self.0.options = v.into();
1559            self
1560        }
1561
1562        /// Sends the request.
1563        pub async fn send(self) -> Result<crate::model::DatabasesListResponse> {
1564            (*self.0.stub)
1565                .list(self.0.request, self.0.options)
1566                .await
1567                .map(crate::Response::into_body)
1568        }
1569
1570        /// Sets the value of [instance][crate::model::SqlDatabasesListRequest::instance].
1571        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1572            self.0.request.instance = v.into();
1573            self
1574        }
1575
1576        /// Sets the value of [project][crate::model::SqlDatabasesListRequest::project].
1577        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1578            self.0.request.project = v.into();
1579            self
1580        }
1581    }
1582
1583    #[doc(hidden)]
1584    impl crate::RequestBuilder for List {
1585        fn request_options(&mut self) -> &mut crate::RequestOptions {
1586            &mut self.0.options
1587        }
1588    }
1589
1590    /// The request builder for [SqlDatabasesService::patch][crate::client::SqlDatabasesService::patch] calls.
1591    ///
1592    /// # Example
1593    /// ```
1594    /// # use google_cloud_sql_v1::builder::sql_databases_service::Patch;
1595    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
1596    ///
1597    /// let builder = prepare_request_builder();
1598    /// let response = builder.send().await?;
1599    /// # Ok(()) }
1600    ///
1601    /// fn prepare_request_builder() -> Patch {
1602    ///   # panic!();
1603    ///   // ... details omitted ...
1604    /// }
1605    /// ```
1606    #[derive(Clone, Debug)]
1607    pub struct Patch(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1608
1609    impl Patch {
1610        pub(crate) fn new(
1611            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1612        ) -> Self {
1613            Self(RequestBuilder::new(stub))
1614        }
1615
1616        /// Sets the full request, replacing any prior values.
1617        pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1618            mut self,
1619            v: V,
1620        ) -> Self {
1621            self.0.request = v.into();
1622            self
1623        }
1624
1625        /// Sets all the options, replacing any prior values.
1626        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1627            self.0.options = v.into();
1628            self
1629        }
1630
1631        /// Sends the request.
1632        pub async fn send(self) -> Result<crate::model::Operation> {
1633            (*self.0.stub)
1634                .patch(self.0.request, self.0.options)
1635                .await
1636                .map(crate::Response::into_body)
1637        }
1638
1639        /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
1640        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1641            self.0.request.database = v.into();
1642            self
1643        }
1644
1645        /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
1646        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1647            self.0.request.instance = v.into();
1648            self
1649        }
1650
1651        /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
1652        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1653            self.0.request.project = v.into();
1654            self
1655        }
1656
1657        /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
1658        pub fn set_body<T>(mut self, v: T) -> Self
1659        where
1660            T: std::convert::Into<crate::model::Database>,
1661        {
1662            self.0.request.body = std::option::Option::Some(v.into());
1663            self
1664        }
1665
1666        /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
1667        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1668        where
1669            T: std::convert::Into<crate::model::Database>,
1670        {
1671            self.0.request.body = v.map(|x| x.into());
1672            self
1673        }
1674    }
1675
1676    #[doc(hidden)]
1677    impl crate::RequestBuilder for Patch {
1678        fn request_options(&mut self) -> &mut crate::RequestOptions {
1679            &mut self.0.options
1680        }
1681    }
1682
1683    /// The request builder for [SqlDatabasesService::update][crate::client::SqlDatabasesService::update] calls.
1684    ///
1685    /// # Example
1686    /// ```
1687    /// # use google_cloud_sql_v1::builder::sql_databases_service::Update;
1688    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
1689    ///
1690    /// let builder = prepare_request_builder();
1691    /// let response = builder.send().await?;
1692    /// # Ok(()) }
1693    ///
1694    /// fn prepare_request_builder() -> Update {
1695    ///   # panic!();
1696    ///   // ... details omitted ...
1697    /// }
1698    /// ```
1699    #[derive(Clone, Debug)]
1700    pub struct Update(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1701
1702    impl Update {
1703        pub(crate) fn new(
1704            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1705        ) -> Self {
1706            Self(RequestBuilder::new(stub))
1707        }
1708
1709        /// Sets the full request, replacing any prior values.
1710        pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1711            mut self,
1712            v: V,
1713        ) -> Self {
1714            self.0.request = v.into();
1715            self
1716        }
1717
1718        /// Sets all the options, replacing any prior values.
1719        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1720            self.0.options = v.into();
1721            self
1722        }
1723
1724        /// Sends the request.
1725        pub async fn send(self) -> Result<crate::model::Operation> {
1726            (*self.0.stub)
1727                .update(self.0.request, self.0.options)
1728                .await
1729                .map(crate::Response::into_body)
1730        }
1731
1732        /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
1733        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1734            self.0.request.database = v.into();
1735            self
1736        }
1737
1738        /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
1739        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1740            self.0.request.instance = v.into();
1741            self
1742        }
1743
1744        /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
1745        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1746            self.0.request.project = v.into();
1747            self
1748        }
1749
1750        /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
1751        pub fn set_body<T>(mut self, v: T) -> Self
1752        where
1753            T: std::convert::Into<crate::model::Database>,
1754        {
1755            self.0.request.body = std::option::Option::Some(v.into());
1756            self
1757        }
1758
1759        /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
1760        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1761        where
1762            T: std::convert::Into<crate::model::Database>,
1763        {
1764            self.0.request.body = v.map(|x| x.into());
1765            self
1766        }
1767    }
1768
1769    #[doc(hidden)]
1770    impl crate::RequestBuilder for Update {
1771        fn request_options(&mut self) -> &mut crate::RequestOptions {
1772            &mut self.0.options
1773        }
1774    }
1775}
1776
1777/// Request and client builders for [SqlFlagsService][crate::client::SqlFlagsService].
1778pub mod sql_flags_service {
1779    use crate::Result;
1780
1781    /// A builder for [SqlFlagsService][crate::client::SqlFlagsService].
1782    ///
1783    /// ```
1784    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1785    /// # use google_cloud_sql_v1::*;
1786    /// # use builder::sql_flags_service::ClientBuilder;
1787    /// # use client::SqlFlagsService;
1788    /// let builder : ClientBuilder = SqlFlagsService::builder();
1789    /// let client = builder
1790    ///     .with_endpoint("https://sqladmin.googleapis.com")
1791    ///     .build().await?;
1792    /// # Ok(()) }
1793    /// ```
1794    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1795
1796    pub(crate) mod client {
1797        use super::super::super::client::SqlFlagsService;
1798        pub struct Factory;
1799        impl crate::ClientFactory for Factory {
1800            type Client = SqlFlagsService;
1801            type Credentials = gaxi::options::Credentials;
1802            async fn build(
1803                self,
1804                config: gaxi::options::ClientConfig,
1805            ) -> crate::ClientBuilderResult<Self::Client> {
1806                Self::Client::new(config).await
1807            }
1808        }
1809    }
1810
1811    /// Common implementation for [crate::client::SqlFlagsService] request builders.
1812    #[derive(Clone, Debug)]
1813    pub(crate) struct RequestBuilder<R: std::default::Default> {
1814        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1815        request: R,
1816        options: crate::RequestOptions,
1817    }
1818
1819    impl<R> RequestBuilder<R>
1820    where
1821        R: std::default::Default,
1822    {
1823        pub(crate) fn new(
1824            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1825        ) -> Self {
1826            Self {
1827                stub,
1828                request: R::default(),
1829                options: crate::RequestOptions::default(),
1830            }
1831        }
1832    }
1833
1834    /// The request builder for [SqlFlagsService::list][crate::client::SqlFlagsService::list] calls.
1835    ///
1836    /// # Example
1837    /// ```
1838    /// # use google_cloud_sql_v1::builder::sql_flags_service::List;
1839    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
1840    ///
1841    /// let builder = prepare_request_builder();
1842    /// let response = builder.send().await?;
1843    /// # Ok(()) }
1844    ///
1845    /// fn prepare_request_builder() -> List {
1846    ///   # panic!();
1847    ///   // ... details omitted ...
1848    /// }
1849    /// ```
1850    #[derive(Clone, Debug)]
1851    pub struct List(RequestBuilder<crate::model::SqlFlagsListRequest>);
1852
1853    impl List {
1854        pub(crate) fn new(
1855            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1856        ) -> Self {
1857            Self(RequestBuilder::new(stub))
1858        }
1859
1860        /// Sets the full request, replacing any prior values.
1861        pub fn with_request<V: Into<crate::model::SqlFlagsListRequest>>(mut self, v: V) -> Self {
1862            self.0.request = v.into();
1863            self
1864        }
1865
1866        /// Sets all the options, replacing any prior values.
1867        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1868            self.0.options = v.into();
1869            self
1870        }
1871
1872        /// Sends the request.
1873        pub async fn send(self) -> Result<crate::model::FlagsListResponse> {
1874            (*self.0.stub)
1875                .list(self.0.request, self.0.options)
1876                .await
1877                .map(crate::Response::into_body)
1878        }
1879
1880        /// Sets the value of [database_version][crate::model::SqlFlagsListRequest::database_version].
1881        pub fn set_database_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
1882            self.0.request.database_version = v.into();
1883            self
1884        }
1885
1886        /// Sets the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
1887        pub fn set_flag_scope<T>(mut self, v: T) -> Self
1888        where
1889            T: std::convert::Into<crate::model::SqlFlagScope>,
1890        {
1891            self.0.request.flag_scope = std::option::Option::Some(v.into());
1892            self
1893        }
1894
1895        /// Sets or clears the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
1896        pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
1897        where
1898            T: std::convert::Into<crate::model::SqlFlagScope>,
1899        {
1900            self.0.request.flag_scope = v.map(|x| x.into());
1901            self
1902        }
1903    }
1904
1905    #[doc(hidden)]
1906    impl crate::RequestBuilder for List {
1907        fn request_options(&mut self) -> &mut crate::RequestOptions {
1908            &mut self.0.options
1909        }
1910    }
1911}
1912
1913/// Request and client builders for [SqlInstancesService][crate::client::SqlInstancesService].
1914pub mod sql_instances_service {
1915    use crate::Result;
1916
1917    /// A builder for [SqlInstancesService][crate::client::SqlInstancesService].
1918    ///
1919    /// ```
1920    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1921    /// # use google_cloud_sql_v1::*;
1922    /// # use builder::sql_instances_service::ClientBuilder;
1923    /// # use client::SqlInstancesService;
1924    /// let builder : ClientBuilder = SqlInstancesService::builder();
1925    /// let client = builder
1926    ///     .with_endpoint("https://sqladmin.googleapis.com")
1927    ///     .build().await?;
1928    /// # Ok(()) }
1929    /// ```
1930    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1931
1932    pub(crate) mod client {
1933        use super::super::super::client::SqlInstancesService;
1934        pub struct Factory;
1935        impl crate::ClientFactory for Factory {
1936            type Client = SqlInstancesService;
1937            type Credentials = gaxi::options::Credentials;
1938            async fn build(
1939                self,
1940                config: gaxi::options::ClientConfig,
1941            ) -> crate::ClientBuilderResult<Self::Client> {
1942                Self::Client::new(config).await
1943            }
1944        }
1945    }
1946
1947    /// Common implementation for [crate::client::SqlInstancesService] request builders.
1948    #[derive(Clone, Debug)]
1949    pub(crate) struct RequestBuilder<R: std::default::Default> {
1950        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1951        request: R,
1952        options: crate::RequestOptions,
1953    }
1954
1955    impl<R> RequestBuilder<R>
1956    where
1957        R: std::default::Default,
1958    {
1959        pub(crate) fn new(
1960            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1961        ) -> Self {
1962            Self {
1963                stub,
1964                request: R::default(),
1965                options: crate::RequestOptions::default(),
1966            }
1967        }
1968    }
1969
1970    /// The request builder for [SqlInstancesService::add_server_ca][crate::client::SqlInstancesService::add_server_ca] calls.
1971    ///
1972    /// # Example
1973    /// ```
1974    /// # use google_cloud_sql_v1::builder::sql_instances_service::AddServerCa;
1975    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
1976    ///
1977    /// let builder = prepare_request_builder();
1978    /// let response = builder.send().await?;
1979    /// # Ok(()) }
1980    ///
1981    /// fn prepare_request_builder() -> AddServerCa {
1982    ///   # panic!();
1983    ///   // ... details omitted ...
1984    /// }
1985    /// ```
1986    #[derive(Clone, Debug)]
1987    pub struct AddServerCa(RequestBuilder<crate::model::SqlInstancesAddServerCaRequest>);
1988
1989    impl AddServerCa {
1990        pub(crate) fn new(
1991            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1992        ) -> Self {
1993            Self(RequestBuilder::new(stub))
1994        }
1995
1996        /// Sets the full request, replacing any prior values.
1997        pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCaRequest>>(
1998            mut self,
1999            v: V,
2000        ) -> Self {
2001            self.0.request = v.into();
2002            self
2003        }
2004
2005        /// Sets all the options, replacing any prior values.
2006        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2007            self.0.options = v.into();
2008            self
2009        }
2010
2011        /// Sends the request.
2012        pub async fn send(self) -> Result<crate::model::Operation> {
2013            (*self.0.stub)
2014                .add_server_ca(self.0.request, self.0.options)
2015                .await
2016                .map(crate::Response::into_body)
2017        }
2018
2019        /// Sets the value of [instance][crate::model::SqlInstancesAddServerCaRequest::instance].
2020        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2021            self.0.request.instance = v.into();
2022            self
2023        }
2024
2025        /// Sets the value of [project][crate::model::SqlInstancesAddServerCaRequest::project].
2026        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2027            self.0.request.project = v.into();
2028            self
2029        }
2030    }
2031
2032    #[doc(hidden)]
2033    impl crate::RequestBuilder for AddServerCa {
2034        fn request_options(&mut self) -> &mut crate::RequestOptions {
2035            &mut self.0.options
2036        }
2037    }
2038
2039    /// The request builder for [SqlInstancesService::add_server_certificate][crate::client::SqlInstancesService::add_server_certificate] calls.
2040    ///
2041    /// # Example
2042    /// ```
2043    /// # use google_cloud_sql_v1::builder::sql_instances_service::AddServerCertificate;
2044    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
2045    ///
2046    /// let builder = prepare_request_builder();
2047    /// let response = builder.send().await?;
2048    /// # Ok(()) }
2049    ///
2050    /// fn prepare_request_builder() -> AddServerCertificate {
2051    ///   # panic!();
2052    ///   // ... details omitted ...
2053    /// }
2054    /// ```
2055    #[derive(Clone, Debug)]
2056    pub struct AddServerCertificate(
2057        RequestBuilder<crate::model::SqlInstancesAddServerCertificateRequest>,
2058    );
2059
2060    impl AddServerCertificate {
2061        pub(crate) fn new(
2062            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2063        ) -> Self {
2064            Self(RequestBuilder::new(stub))
2065        }
2066
2067        /// Sets the full request, replacing any prior values.
2068        pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCertificateRequest>>(
2069            mut self,
2070            v: V,
2071        ) -> Self {
2072            self.0.request = v.into();
2073            self
2074        }
2075
2076        /// Sets all the options, replacing any prior values.
2077        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2078            self.0.options = v.into();
2079            self
2080        }
2081
2082        /// Sends the request.
2083        pub async fn send(self) -> Result<crate::model::Operation> {
2084            (*self.0.stub)
2085                .add_server_certificate(self.0.request, self.0.options)
2086                .await
2087                .map(crate::Response::into_body)
2088        }
2089
2090        /// Sets the value of [instance][crate::model::SqlInstancesAddServerCertificateRequest::instance].
2091        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2092            self.0.request.instance = v.into();
2093            self
2094        }
2095
2096        /// Sets the value of [project][crate::model::SqlInstancesAddServerCertificateRequest::project].
2097        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2098            self.0.request.project = v.into();
2099            self
2100        }
2101    }
2102
2103    #[doc(hidden)]
2104    impl crate::RequestBuilder for AddServerCertificate {
2105        fn request_options(&mut self) -> &mut crate::RequestOptions {
2106            &mut self.0.options
2107        }
2108    }
2109
2110    /// The request builder for [SqlInstancesService::add_entra_id_certificate][crate::client::SqlInstancesService::add_entra_id_certificate] calls.
2111    ///
2112    /// # Example
2113    /// ```
2114    /// # use google_cloud_sql_v1::builder::sql_instances_service::AddEntraIdCertificate;
2115    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
2116    ///
2117    /// let builder = prepare_request_builder();
2118    /// let response = builder.send().await?;
2119    /// # Ok(()) }
2120    ///
2121    /// fn prepare_request_builder() -> AddEntraIdCertificate {
2122    ///   # panic!();
2123    ///   // ... details omitted ...
2124    /// }
2125    /// ```
2126    #[derive(Clone, Debug)]
2127    pub struct AddEntraIdCertificate(
2128        RequestBuilder<crate::model::SqlInstancesAddEntraIdCertificateRequest>,
2129    );
2130
2131    impl AddEntraIdCertificate {
2132        pub(crate) fn new(
2133            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2134        ) -> Self {
2135            Self(RequestBuilder::new(stub))
2136        }
2137
2138        /// Sets the full request, replacing any prior values.
2139        pub fn with_request<V: Into<crate::model::SqlInstancesAddEntraIdCertificateRequest>>(
2140            mut self,
2141            v: V,
2142        ) -> Self {
2143            self.0.request = v.into();
2144            self
2145        }
2146
2147        /// Sets all the options, replacing any prior values.
2148        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2149            self.0.options = v.into();
2150            self
2151        }
2152
2153        /// Sends the request.
2154        pub async fn send(self) -> Result<crate::model::Operation> {
2155            (*self.0.stub)
2156                .add_entra_id_certificate(self.0.request, self.0.options)
2157                .await
2158                .map(crate::Response::into_body)
2159        }
2160
2161        /// Sets the value of [instance][crate::model::SqlInstancesAddEntraIdCertificateRequest::instance].
2162        ///
2163        /// This is a **required** field for requests.
2164        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        /// Sets the value of [project][crate::model::SqlInstancesAddEntraIdCertificateRequest::project].
2170        ///
2171        /// This is a **required** field for requests.
2172        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2173            self.0.request.project = v.into();
2174            self
2175        }
2176    }
2177
2178    #[doc(hidden)]
2179    impl crate::RequestBuilder for AddEntraIdCertificate {
2180        fn request_options(&mut self) -> &mut crate::RequestOptions {
2181            &mut self.0.options
2182        }
2183    }
2184
2185    /// The request builder for [SqlInstancesService::clone][crate::client::SqlInstancesService::clone] calls.
2186    ///
2187    /// # Example
2188    /// ```
2189    /// # use google_cloud_sql_v1::builder::sql_instances_service::Clone;
2190    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
2191    ///
2192    /// let builder = prepare_request_builder();
2193    /// let response = builder.send().await?;
2194    /// # Ok(()) }
2195    ///
2196    /// fn prepare_request_builder() -> Clone {
2197    ///   # panic!();
2198    ///   // ... details omitted ...
2199    /// }
2200    /// ```
2201    #[derive(Clone, Debug)]
2202    pub struct Clone(RequestBuilder<crate::model::SqlInstancesCloneRequest>);
2203
2204    impl Clone {
2205        pub(crate) fn new(
2206            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2207        ) -> Self {
2208            Self(RequestBuilder::new(stub))
2209        }
2210
2211        /// Sets the full request, replacing any prior values.
2212        pub fn with_request<V: Into<crate::model::SqlInstancesCloneRequest>>(
2213            mut self,
2214            v: V,
2215        ) -> Self {
2216            self.0.request = v.into();
2217            self
2218        }
2219
2220        /// Sets all the options, replacing any prior values.
2221        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2222            self.0.options = v.into();
2223            self
2224        }
2225
2226        /// Sends the request.
2227        pub async fn send(self) -> Result<crate::model::Operation> {
2228            (*self.0.stub)
2229                .clone(self.0.request, self.0.options)
2230                .await
2231                .map(crate::Response::into_body)
2232        }
2233
2234        /// Sets the value of [instance][crate::model::SqlInstancesCloneRequest::instance].
2235        ///
2236        /// This is a **required** field for requests.
2237        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2238            self.0.request.instance = v.into();
2239            self
2240        }
2241
2242        /// Sets the value of [project][crate::model::SqlInstancesCloneRequest::project].
2243        ///
2244        /// This is a **required** field for requests.
2245        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2246            self.0.request.project = v.into();
2247            self
2248        }
2249
2250        /// Sets the value of [body][crate::model::SqlInstancesCloneRequest::body].
2251        ///
2252        /// This is a **required** field for requests.
2253        pub fn set_body<T>(mut self, v: T) -> Self
2254        where
2255            T: std::convert::Into<crate::model::InstancesCloneRequest>,
2256        {
2257            self.0.request.body = std::option::Option::Some(v.into());
2258            self
2259        }
2260
2261        /// Sets or clears the value of [body][crate::model::SqlInstancesCloneRequest::body].
2262        ///
2263        /// This is a **required** field for requests.
2264        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2265        where
2266            T: std::convert::Into<crate::model::InstancesCloneRequest>,
2267        {
2268            self.0.request.body = v.map(|x| x.into());
2269            self
2270        }
2271    }
2272
2273    #[doc(hidden)]
2274    impl crate::RequestBuilder for Clone {
2275        fn request_options(&mut self) -> &mut crate::RequestOptions {
2276            &mut self.0.options
2277        }
2278    }
2279
2280    /// The request builder for [SqlInstancesService::delete][crate::client::SqlInstancesService::delete] calls.
2281    ///
2282    /// # Example
2283    /// ```
2284    /// # use google_cloud_sql_v1::builder::sql_instances_service::Delete;
2285    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
2286    ///
2287    /// let builder = prepare_request_builder();
2288    /// let response = builder.send().await?;
2289    /// # Ok(()) }
2290    ///
2291    /// fn prepare_request_builder() -> Delete {
2292    ///   # panic!();
2293    ///   // ... details omitted ...
2294    /// }
2295    /// ```
2296    #[derive(Clone, Debug)]
2297    pub struct Delete(RequestBuilder<crate::model::SqlInstancesDeleteRequest>);
2298
2299    impl Delete {
2300        pub(crate) fn new(
2301            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2302        ) -> Self {
2303            Self(RequestBuilder::new(stub))
2304        }
2305
2306        /// Sets the full request, replacing any prior values.
2307        pub fn with_request<V: Into<crate::model::SqlInstancesDeleteRequest>>(
2308            mut self,
2309            v: V,
2310        ) -> Self {
2311            self.0.request = v.into();
2312            self
2313        }
2314
2315        /// Sets all the options, replacing any prior values.
2316        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2317            self.0.options = v.into();
2318            self
2319        }
2320
2321        /// Sends the request.
2322        pub async fn send(self) -> Result<crate::model::Operation> {
2323            (*self.0.stub)
2324                .delete(self.0.request, self.0.options)
2325                .await
2326                .map(crate::Response::into_body)
2327        }
2328
2329        /// Sets the value of [instance][crate::model::SqlInstancesDeleteRequest::instance].
2330        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2331            self.0.request.instance = v.into();
2332            self
2333        }
2334
2335        /// Sets the value of [project][crate::model::SqlInstancesDeleteRequest::project].
2336        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2337            self.0.request.project = v.into();
2338            self
2339        }
2340
2341        /// Sets the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
2342        pub fn set_enable_final_backup<T>(mut self, v: T) -> Self
2343        where
2344            T: std::convert::Into<bool>,
2345        {
2346            self.0.request.enable_final_backup = std::option::Option::Some(v.into());
2347            self
2348        }
2349
2350        /// Sets or clears the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
2351        pub fn set_or_clear_enable_final_backup<T>(mut self, v: std::option::Option<T>) -> Self
2352        where
2353            T: std::convert::Into<bool>,
2354        {
2355            self.0.request.enable_final_backup = v.map(|x| x.into());
2356            self
2357        }
2358
2359        /// Sets the value of [final_backup_description][crate::model::SqlInstancesDeleteRequest::final_backup_description].
2360        pub fn set_final_backup_description<T: Into<std::string::String>>(mut self, v: T) -> Self {
2361            self.0.request.final_backup_description = v.into();
2362            self
2363        }
2364
2365        /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration].
2366        ///
2367        /// Note that all the setters affecting `expiration` are
2368        /// mutually exclusive.
2369        pub fn set_expiration<
2370            T: Into<Option<crate::model::sql_instances_delete_request::Expiration>>,
2371        >(
2372            mut self,
2373            v: T,
2374        ) -> Self {
2375            self.0.request.expiration = v.into();
2376            self
2377        }
2378
2379        /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
2380        /// to hold a `FinalBackupTtlDays`.
2381        ///
2382        /// Note that all the setters affecting `expiration` are
2383        /// mutually exclusive.
2384        pub fn set_final_backup_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2385            self.0.request = self.0.request.set_final_backup_ttl_days(v);
2386            self
2387        }
2388
2389        /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
2390        /// to hold a `FinalBackupExpiryTime`.
2391        ///
2392        /// Note that all the setters affecting `expiration` are
2393        /// mutually exclusive.
2394        pub fn set_final_backup_expiry_time<
2395            T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>,
2396        >(
2397            mut self,
2398            v: T,
2399        ) -> Self {
2400            self.0.request = self.0.request.set_final_backup_expiry_time(v);
2401            self
2402        }
2403    }
2404
2405    #[doc(hidden)]
2406    impl crate::RequestBuilder for Delete {
2407        fn request_options(&mut self) -> &mut crate::RequestOptions {
2408            &mut self.0.options
2409        }
2410    }
2411
2412    /// The request builder for [SqlInstancesService::demote_master][crate::client::SqlInstancesService::demote_master] calls.
2413    ///
2414    /// # Example
2415    /// ```
2416    /// # use google_cloud_sql_v1::builder::sql_instances_service::DemoteMaster;
2417    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
2418    ///
2419    /// let builder = prepare_request_builder();
2420    /// let response = builder.send().await?;
2421    /// # Ok(()) }
2422    ///
2423    /// fn prepare_request_builder() -> DemoteMaster {
2424    ///   # panic!();
2425    ///   // ... details omitted ...
2426    /// }
2427    /// ```
2428    #[derive(Clone, Debug)]
2429    pub struct DemoteMaster(RequestBuilder<crate::model::SqlInstancesDemoteMasterRequest>);
2430
2431    impl DemoteMaster {
2432        pub(crate) fn new(
2433            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2434        ) -> Self {
2435            Self(RequestBuilder::new(stub))
2436        }
2437
2438        /// Sets the full request, replacing any prior values.
2439        pub fn with_request<V: Into<crate::model::SqlInstancesDemoteMasterRequest>>(
2440            mut self,
2441            v: V,
2442        ) -> Self {
2443            self.0.request = v.into();
2444            self
2445        }
2446
2447        /// Sets all the options, replacing any prior values.
2448        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2449            self.0.options = v.into();
2450            self
2451        }
2452
2453        /// Sends the request.
2454        pub async fn send(self) -> Result<crate::model::Operation> {
2455            (*self.0.stub)
2456                .demote_master(self.0.request, self.0.options)
2457                .await
2458                .map(crate::Response::into_body)
2459        }
2460
2461        /// Sets the value of [instance][crate::model::SqlInstancesDemoteMasterRequest::instance].
2462        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2463            self.0.request.instance = v.into();
2464            self
2465        }
2466
2467        /// Sets the value of [project][crate::model::SqlInstancesDemoteMasterRequest::project].
2468        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2469            self.0.request.project = v.into();
2470            self
2471        }
2472
2473        /// Sets the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
2474        pub fn set_body<T>(mut self, v: T) -> Self
2475        where
2476            T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
2477        {
2478            self.0.request.body = std::option::Option::Some(v.into());
2479            self
2480        }
2481
2482        /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
2483        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2484        where
2485            T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
2486        {
2487            self.0.request.body = v.map(|x| x.into());
2488            self
2489        }
2490    }
2491
2492    #[doc(hidden)]
2493    impl crate::RequestBuilder for DemoteMaster {
2494        fn request_options(&mut self) -> &mut crate::RequestOptions {
2495            &mut self.0.options
2496        }
2497    }
2498
2499    /// The request builder for [SqlInstancesService::demote][crate::client::SqlInstancesService::demote] calls.
2500    ///
2501    /// # Example
2502    /// ```
2503    /// # use google_cloud_sql_v1::builder::sql_instances_service::Demote;
2504    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
2505    ///
2506    /// let builder = prepare_request_builder();
2507    /// let response = builder.send().await?;
2508    /// # Ok(()) }
2509    ///
2510    /// fn prepare_request_builder() -> Demote {
2511    ///   # panic!();
2512    ///   // ... details omitted ...
2513    /// }
2514    /// ```
2515    #[derive(Clone, Debug)]
2516    pub struct Demote(RequestBuilder<crate::model::SqlInstancesDemoteRequest>);
2517
2518    impl Demote {
2519        pub(crate) fn new(
2520            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2521        ) -> Self {
2522            Self(RequestBuilder::new(stub))
2523        }
2524
2525        /// Sets the full request, replacing any prior values.
2526        pub fn with_request<V: Into<crate::model::SqlInstancesDemoteRequest>>(
2527            mut self,
2528            v: V,
2529        ) -> Self {
2530            self.0.request = v.into();
2531            self
2532        }
2533
2534        /// Sets all the options, replacing any prior values.
2535        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2536            self.0.options = v.into();
2537            self
2538        }
2539
2540        /// Sends the request.
2541        pub async fn send(self) -> Result<crate::model::Operation> {
2542            (*self.0.stub)
2543                .demote(self.0.request, self.0.options)
2544                .await
2545                .map(crate::Response::into_body)
2546        }
2547
2548        /// Sets the value of [instance][crate::model::SqlInstancesDemoteRequest::instance].
2549        ///
2550        /// This is a **required** field for requests.
2551        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2552            self.0.request.instance = v.into();
2553            self
2554        }
2555
2556        /// Sets the value of [project][crate::model::SqlInstancesDemoteRequest::project].
2557        ///
2558        /// This is a **required** field for requests.
2559        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2560            self.0.request.project = v.into();
2561            self
2562        }
2563
2564        /// Sets the value of [body][crate::model::SqlInstancesDemoteRequest::body].
2565        ///
2566        /// This is a **required** field for requests.
2567        pub fn set_body<T>(mut self, v: T) -> Self
2568        where
2569            T: std::convert::Into<crate::model::InstancesDemoteRequest>,
2570        {
2571            self.0.request.body = std::option::Option::Some(v.into());
2572            self
2573        }
2574
2575        /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteRequest::body].
2576        ///
2577        /// This is a **required** field for requests.
2578        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2579        where
2580            T: std::convert::Into<crate::model::InstancesDemoteRequest>,
2581        {
2582            self.0.request.body = v.map(|x| x.into());
2583            self
2584        }
2585    }
2586
2587    #[doc(hidden)]
2588    impl crate::RequestBuilder for Demote {
2589        fn request_options(&mut self) -> &mut crate::RequestOptions {
2590            &mut self.0.options
2591        }
2592    }
2593
2594    /// The request builder for [SqlInstancesService::export][crate::client::SqlInstancesService::export] calls.
2595    ///
2596    /// # Example
2597    /// ```
2598    /// # use google_cloud_sql_v1::builder::sql_instances_service::Export;
2599    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
2600    ///
2601    /// let builder = prepare_request_builder();
2602    /// let response = builder.send().await?;
2603    /// # Ok(()) }
2604    ///
2605    /// fn prepare_request_builder() -> Export {
2606    ///   # panic!();
2607    ///   // ... details omitted ...
2608    /// }
2609    /// ```
2610    #[derive(Clone, Debug)]
2611    pub struct Export(RequestBuilder<crate::model::SqlInstancesExportRequest>);
2612
2613    impl Export {
2614        pub(crate) fn new(
2615            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2616        ) -> Self {
2617            Self(RequestBuilder::new(stub))
2618        }
2619
2620        /// Sets the full request, replacing any prior values.
2621        pub fn with_request<V: Into<crate::model::SqlInstancesExportRequest>>(
2622            mut self,
2623            v: V,
2624        ) -> Self {
2625            self.0.request = v.into();
2626            self
2627        }
2628
2629        /// Sets all the options, replacing any prior values.
2630        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2631            self.0.options = v.into();
2632            self
2633        }
2634
2635        /// Sends the request.
2636        pub async fn send(self) -> Result<crate::model::Operation> {
2637            (*self.0.stub)
2638                .export(self.0.request, self.0.options)
2639                .await
2640                .map(crate::Response::into_body)
2641        }
2642
2643        /// Sets the value of [instance][crate::model::SqlInstancesExportRequest::instance].
2644        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2645            self.0.request.instance = v.into();
2646            self
2647        }
2648
2649        /// Sets the value of [project][crate::model::SqlInstancesExportRequest::project].
2650        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2651            self.0.request.project = v.into();
2652            self
2653        }
2654
2655        /// Sets the value of [body][crate::model::SqlInstancesExportRequest::body].
2656        pub fn set_body<T>(mut self, v: T) -> Self
2657        where
2658            T: std::convert::Into<crate::model::InstancesExportRequest>,
2659        {
2660            self.0.request.body = std::option::Option::Some(v.into());
2661            self
2662        }
2663
2664        /// Sets or clears the value of [body][crate::model::SqlInstancesExportRequest::body].
2665        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2666        where
2667            T: std::convert::Into<crate::model::InstancesExportRequest>,
2668        {
2669            self.0.request.body = v.map(|x| x.into());
2670            self
2671        }
2672    }
2673
2674    #[doc(hidden)]
2675    impl crate::RequestBuilder for Export {
2676        fn request_options(&mut self) -> &mut crate::RequestOptions {
2677            &mut self.0.options
2678        }
2679    }
2680
2681    /// The request builder for [SqlInstancesService::failover][crate::client::SqlInstancesService::failover] calls.
2682    ///
2683    /// # Example
2684    /// ```
2685    /// # use google_cloud_sql_v1::builder::sql_instances_service::Failover;
2686    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
2687    ///
2688    /// let builder = prepare_request_builder();
2689    /// let response = builder.send().await?;
2690    /// # Ok(()) }
2691    ///
2692    /// fn prepare_request_builder() -> Failover {
2693    ///   # panic!();
2694    ///   // ... details omitted ...
2695    /// }
2696    /// ```
2697    #[derive(Clone, Debug)]
2698    pub struct Failover(RequestBuilder<crate::model::SqlInstancesFailoverRequest>);
2699
2700    impl Failover {
2701        pub(crate) fn new(
2702            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2703        ) -> Self {
2704            Self(RequestBuilder::new(stub))
2705        }
2706
2707        /// Sets the full request, replacing any prior values.
2708        pub fn with_request<V: Into<crate::model::SqlInstancesFailoverRequest>>(
2709            mut self,
2710            v: V,
2711        ) -> Self {
2712            self.0.request = v.into();
2713            self
2714        }
2715
2716        /// Sets all the options, replacing any prior values.
2717        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2718            self.0.options = v.into();
2719            self
2720        }
2721
2722        /// Sends the request.
2723        pub async fn send(self) -> Result<crate::model::Operation> {
2724            (*self.0.stub)
2725                .failover(self.0.request, self.0.options)
2726                .await
2727                .map(crate::Response::into_body)
2728        }
2729
2730        /// Sets the value of [instance][crate::model::SqlInstancesFailoverRequest::instance].
2731        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2732            self.0.request.instance = v.into();
2733            self
2734        }
2735
2736        /// Sets the value of [project][crate::model::SqlInstancesFailoverRequest::project].
2737        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2738            self.0.request.project = v.into();
2739            self
2740        }
2741
2742        /// Sets the value of [body][crate::model::SqlInstancesFailoverRequest::body].
2743        pub fn set_body<T>(mut self, v: T) -> Self
2744        where
2745            T: std::convert::Into<crate::model::InstancesFailoverRequest>,
2746        {
2747            self.0.request.body = std::option::Option::Some(v.into());
2748            self
2749        }
2750
2751        /// Sets or clears the value of [body][crate::model::SqlInstancesFailoverRequest::body].
2752        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2753        where
2754            T: std::convert::Into<crate::model::InstancesFailoverRequest>,
2755        {
2756            self.0.request.body = v.map(|x| x.into());
2757            self
2758        }
2759    }
2760
2761    #[doc(hidden)]
2762    impl crate::RequestBuilder for Failover {
2763        fn request_options(&mut self) -> &mut crate::RequestOptions {
2764            &mut self.0.options
2765        }
2766    }
2767
2768    /// The request builder for [SqlInstancesService::reencrypt][crate::client::SqlInstancesService::reencrypt] calls.
2769    ///
2770    /// # Example
2771    /// ```
2772    /// # use google_cloud_sql_v1::builder::sql_instances_service::Reencrypt;
2773    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
2774    ///
2775    /// let builder = prepare_request_builder();
2776    /// let response = builder.send().await?;
2777    /// # Ok(()) }
2778    ///
2779    /// fn prepare_request_builder() -> Reencrypt {
2780    ///   # panic!();
2781    ///   // ... details omitted ...
2782    /// }
2783    /// ```
2784    #[derive(Clone, Debug)]
2785    pub struct Reencrypt(RequestBuilder<crate::model::SqlInstancesReencryptRequest>);
2786
2787    impl Reencrypt {
2788        pub(crate) fn new(
2789            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2790        ) -> Self {
2791            Self(RequestBuilder::new(stub))
2792        }
2793
2794        /// Sets the full request, replacing any prior values.
2795        pub fn with_request<V: Into<crate::model::SqlInstancesReencryptRequest>>(
2796            mut self,
2797            v: V,
2798        ) -> Self {
2799            self.0.request = v.into();
2800            self
2801        }
2802
2803        /// Sets all the options, replacing any prior values.
2804        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2805            self.0.options = v.into();
2806            self
2807        }
2808
2809        /// Sends the request.
2810        pub async fn send(self) -> Result<crate::model::Operation> {
2811            (*self.0.stub)
2812                .reencrypt(self.0.request, self.0.options)
2813                .await
2814                .map(crate::Response::into_body)
2815        }
2816
2817        /// Sets the value of [instance][crate::model::SqlInstancesReencryptRequest::instance].
2818        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2819            self.0.request.instance = v.into();
2820            self
2821        }
2822
2823        /// Sets the value of [project][crate::model::SqlInstancesReencryptRequest::project].
2824        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2825            self.0.request.project = v.into();
2826            self
2827        }
2828
2829        /// Sets the value of [body][crate::model::SqlInstancesReencryptRequest::body].
2830        pub fn set_body<T>(mut self, v: T) -> Self
2831        where
2832            T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2833        {
2834            self.0.request.body = std::option::Option::Some(v.into());
2835            self
2836        }
2837
2838        /// Sets or clears the value of [body][crate::model::SqlInstancesReencryptRequest::body].
2839        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2840        where
2841            T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2842        {
2843            self.0.request.body = v.map(|x| x.into());
2844            self
2845        }
2846    }
2847
2848    #[doc(hidden)]
2849    impl crate::RequestBuilder for Reencrypt {
2850        fn request_options(&mut self) -> &mut crate::RequestOptions {
2851            &mut self.0.options
2852        }
2853    }
2854
2855    /// The request builder for [SqlInstancesService::get][crate::client::SqlInstancesService::get] calls.
2856    ///
2857    /// # Example
2858    /// ```
2859    /// # use google_cloud_sql_v1::builder::sql_instances_service::Get;
2860    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
2861    ///
2862    /// let builder = prepare_request_builder();
2863    /// let response = builder.send().await?;
2864    /// # Ok(()) }
2865    ///
2866    /// fn prepare_request_builder() -> Get {
2867    ///   # panic!();
2868    ///   // ... details omitted ...
2869    /// }
2870    /// ```
2871    #[derive(Clone, Debug)]
2872    pub struct Get(RequestBuilder<crate::model::SqlInstancesGetRequest>);
2873
2874    impl Get {
2875        pub(crate) fn new(
2876            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2877        ) -> Self {
2878            Self(RequestBuilder::new(stub))
2879        }
2880
2881        /// Sets the full request, replacing any prior values.
2882        pub fn with_request<V: Into<crate::model::SqlInstancesGetRequest>>(mut self, v: V) -> Self {
2883            self.0.request = v.into();
2884            self
2885        }
2886
2887        /// Sets all the options, replacing any prior values.
2888        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2889            self.0.options = v.into();
2890            self
2891        }
2892
2893        /// Sends the request.
2894        pub async fn send(self) -> Result<crate::model::DatabaseInstance> {
2895            (*self.0.stub)
2896                .get(self.0.request, self.0.options)
2897                .await
2898                .map(crate::Response::into_body)
2899        }
2900
2901        /// Sets the value of [instance][crate::model::SqlInstancesGetRequest::instance].
2902        ///
2903        /// This is a **required** field for requests.
2904        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2905            self.0.request.instance = v.into();
2906            self
2907        }
2908
2909        /// Sets the value of [project][crate::model::SqlInstancesGetRequest::project].
2910        ///
2911        /// This is a **required** field for requests.
2912        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2913            self.0.request.project = v.into();
2914            self
2915        }
2916    }
2917
2918    #[doc(hidden)]
2919    impl crate::RequestBuilder for Get {
2920        fn request_options(&mut self) -> &mut crate::RequestOptions {
2921            &mut self.0.options
2922        }
2923    }
2924
2925    /// The request builder for [SqlInstancesService::import][crate::client::SqlInstancesService::import] calls.
2926    ///
2927    /// # Example
2928    /// ```
2929    /// # use google_cloud_sql_v1::builder::sql_instances_service::Import;
2930    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
2931    ///
2932    /// let builder = prepare_request_builder();
2933    /// let response = builder.send().await?;
2934    /// # Ok(()) }
2935    ///
2936    /// fn prepare_request_builder() -> Import {
2937    ///   # panic!();
2938    ///   // ... details omitted ...
2939    /// }
2940    /// ```
2941    #[derive(Clone, Debug)]
2942    pub struct Import(RequestBuilder<crate::model::SqlInstancesImportRequest>);
2943
2944    impl Import {
2945        pub(crate) fn new(
2946            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2947        ) -> Self {
2948            Self(RequestBuilder::new(stub))
2949        }
2950
2951        /// Sets the full request, replacing any prior values.
2952        pub fn with_request<V: Into<crate::model::SqlInstancesImportRequest>>(
2953            mut self,
2954            v: V,
2955        ) -> Self {
2956            self.0.request = v.into();
2957            self
2958        }
2959
2960        /// Sets all the options, replacing any prior values.
2961        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2962            self.0.options = v.into();
2963            self
2964        }
2965
2966        /// Sends the request.
2967        pub async fn send(self) -> Result<crate::model::Operation> {
2968            (*self.0.stub)
2969                .import(self.0.request, self.0.options)
2970                .await
2971                .map(crate::Response::into_body)
2972        }
2973
2974        /// Sets the value of [instance][crate::model::SqlInstancesImportRequest::instance].
2975        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2976            self.0.request.instance = v.into();
2977            self
2978        }
2979
2980        /// Sets the value of [project][crate::model::SqlInstancesImportRequest::project].
2981        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2982            self.0.request.project = v.into();
2983            self
2984        }
2985
2986        /// Sets the value of [body][crate::model::SqlInstancesImportRequest::body].
2987        pub fn set_body<T>(mut self, v: T) -> Self
2988        where
2989            T: std::convert::Into<crate::model::InstancesImportRequest>,
2990        {
2991            self.0.request.body = std::option::Option::Some(v.into());
2992            self
2993        }
2994
2995        /// Sets or clears the value of [body][crate::model::SqlInstancesImportRequest::body].
2996        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2997        where
2998            T: std::convert::Into<crate::model::InstancesImportRequest>,
2999        {
3000            self.0.request.body = v.map(|x| x.into());
3001            self
3002        }
3003    }
3004
3005    #[doc(hidden)]
3006    impl crate::RequestBuilder for Import {
3007        fn request_options(&mut self) -> &mut crate::RequestOptions {
3008            &mut self.0.options
3009        }
3010    }
3011
3012    /// The request builder for [SqlInstancesService::insert][crate::client::SqlInstancesService::insert] calls.
3013    ///
3014    /// # Example
3015    /// ```
3016    /// # use google_cloud_sql_v1::builder::sql_instances_service::Insert;
3017    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
3018    ///
3019    /// let builder = prepare_request_builder();
3020    /// let response = builder.send().await?;
3021    /// # Ok(()) }
3022    ///
3023    /// fn prepare_request_builder() -> Insert {
3024    ///   # panic!();
3025    ///   // ... details omitted ...
3026    /// }
3027    /// ```
3028    #[derive(Clone, Debug)]
3029    pub struct Insert(RequestBuilder<crate::model::SqlInstancesInsertRequest>);
3030
3031    impl Insert {
3032        pub(crate) fn new(
3033            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3034        ) -> Self {
3035            Self(RequestBuilder::new(stub))
3036        }
3037
3038        /// Sets the full request, replacing any prior values.
3039        pub fn with_request<V: Into<crate::model::SqlInstancesInsertRequest>>(
3040            mut self,
3041            v: V,
3042        ) -> Self {
3043            self.0.request = v.into();
3044            self
3045        }
3046
3047        /// Sets all the options, replacing any prior values.
3048        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3049            self.0.options = v.into();
3050            self
3051        }
3052
3053        /// Sends the request.
3054        pub async fn send(self) -> Result<crate::model::Operation> {
3055            (*self.0.stub)
3056                .insert(self.0.request, self.0.options)
3057                .await
3058                .map(crate::Response::into_body)
3059        }
3060
3061        /// Sets the value of [project][crate::model::SqlInstancesInsertRequest::project].
3062        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3063            self.0.request.project = v.into();
3064            self
3065        }
3066
3067        /// Sets the value of [body][crate::model::SqlInstancesInsertRequest::body].
3068        pub fn set_body<T>(mut self, v: T) -> Self
3069        where
3070            T: std::convert::Into<crate::model::DatabaseInstance>,
3071        {
3072            self.0.request.body = std::option::Option::Some(v.into());
3073            self
3074        }
3075
3076        /// Sets or clears the value of [body][crate::model::SqlInstancesInsertRequest::body].
3077        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3078        where
3079            T: std::convert::Into<crate::model::DatabaseInstance>,
3080        {
3081            self.0.request.body = v.map(|x| x.into());
3082            self
3083        }
3084    }
3085
3086    #[doc(hidden)]
3087    impl crate::RequestBuilder for Insert {
3088        fn request_options(&mut self) -> &mut crate::RequestOptions {
3089            &mut self.0.options
3090        }
3091    }
3092
3093    /// The request builder for [SqlInstancesService::list][crate::client::SqlInstancesService::list] calls.
3094    ///
3095    /// # Example
3096    /// ```
3097    /// # use google_cloud_sql_v1::builder::sql_instances_service::List;
3098    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
3099    /// use google_cloud_gax::paginator::ItemPaginator;
3100    ///
3101    /// let builder = prepare_request_builder();
3102    /// let mut items = builder.by_item();
3103    /// while let Some(result) = items.next().await {
3104    ///   let item = result?;
3105    /// }
3106    /// # Ok(()) }
3107    ///
3108    /// fn prepare_request_builder() -> List {
3109    ///   # panic!();
3110    ///   // ... details omitted ...
3111    /// }
3112    /// ```
3113    #[derive(Clone, Debug)]
3114    pub struct List(RequestBuilder<crate::model::SqlInstancesListRequest>);
3115
3116    impl List {
3117        pub(crate) fn new(
3118            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3119        ) -> Self {
3120            Self(RequestBuilder::new(stub))
3121        }
3122
3123        /// Sets the full request, replacing any prior values.
3124        pub fn with_request<V: Into<crate::model::SqlInstancesListRequest>>(
3125            mut self,
3126            v: V,
3127        ) -> Self {
3128            self.0.request = v.into();
3129            self
3130        }
3131
3132        /// Sets all the options, replacing any prior values.
3133        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3134            self.0.options = v.into();
3135            self
3136        }
3137
3138        /// Sends the request.
3139        pub async fn send(self) -> Result<crate::model::InstancesListResponse> {
3140            (*self.0.stub)
3141                .list(self.0.request, self.0.options)
3142                .await
3143                .map(crate::Response::into_body)
3144        }
3145
3146        /// Streams each page in the collection.
3147        pub fn by_page(
3148            self,
3149        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::InstancesListResponse, crate::Error>
3150        {
3151            use std::clone::Clone;
3152            let token = self.0.request.page_token.clone();
3153            let execute = move |token: String| {
3154                let mut builder = self.clone();
3155                builder.0.request = builder.0.request.set_page_token(token);
3156                builder.send()
3157            };
3158            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3159        }
3160
3161        /// Streams each item in the collection.
3162        pub fn by_item(
3163            self,
3164        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3165            crate::model::InstancesListResponse,
3166            crate::Error,
3167        > {
3168            use google_cloud_gax::paginator::Paginator;
3169            self.by_page().items()
3170        }
3171
3172        /// Sets the value of [filter][crate::model::SqlInstancesListRequest::filter].
3173        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3174            self.0.request.filter = v.into();
3175            self
3176        }
3177
3178        /// Sets the value of [max_results][crate::model::SqlInstancesListRequest::max_results].
3179        pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
3180            self.0.request.max_results = v.into();
3181            self
3182        }
3183
3184        /// Sets the value of [page_token][crate::model::SqlInstancesListRequest::page_token].
3185        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3186            self.0.request.page_token = v.into();
3187            self
3188        }
3189
3190        /// Sets the value of [project][crate::model::SqlInstancesListRequest::project].
3191        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3192            self.0.request.project = v.into();
3193            self
3194        }
3195    }
3196
3197    #[doc(hidden)]
3198    impl crate::RequestBuilder for List {
3199        fn request_options(&mut self) -> &mut crate::RequestOptions {
3200            &mut self.0.options
3201        }
3202    }
3203
3204    /// The request builder for [SqlInstancesService::list_server_cas][crate::client::SqlInstancesService::list_server_cas] calls.
3205    ///
3206    /// # Example
3207    /// ```
3208    /// # use google_cloud_sql_v1::builder::sql_instances_service::ListServerCas;
3209    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
3210    ///
3211    /// let builder = prepare_request_builder();
3212    /// let response = builder.send().await?;
3213    /// # Ok(()) }
3214    ///
3215    /// fn prepare_request_builder() -> ListServerCas {
3216    ///   # panic!();
3217    ///   // ... details omitted ...
3218    /// }
3219    /// ```
3220    #[derive(Clone, Debug)]
3221    pub struct ListServerCas(RequestBuilder<crate::model::SqlInstancesListServerCasRequest>);
3222
3223    impl ListServerCas {
3224        pub(crate) fn new(
3225            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3226        ) -> Self {
3227            Self(RequestBuilder::new(stub))
3228        }
3229
3230        /// Sets the full request, replacing any prior values.
3231        pub fn with_request<V: Into<crate::model::SqlInstancesListServerCasRequest>>(
3232            mut self,
3233            v: V,
3234        ) -> Self {
3235            self.0.request = v.into();
3236            self
3237        }
3238
3239        /// Sets all the options, replacing any prior values.
3240        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3241            self.0.options = v.into();
3242            self
3243        }
3244
3245        /// Sends the request.
3246        pub async fn send(self) -> Result<crate::model::InstancesListServerCasResponse> {
3247            (*self.0.stub)
3248                .list_server_cas(self.0.request, self.0.options)
3249                .await
3250                .map(crate::Response::into_body)
3251        }
3252
3253        /// Sets the value of [instance][crate::model::SqlInstancesListServerCasRequest::instance].
3254        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3255            self.0.request.instance = v.into();
3256            self
3257        }
3258
3259        /// Sets the value of [project][crate::model::SqlInstancesListServerCasRequest::project].
3260        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3261            self.0.request.project = v.into();
3262            self
3263        }
3264    }
3265
3266    #[doc(hidden)]
3267    impl crate::RequestBuilder for ListServerCas {
3268        fn request_options(&mut self) -> &mut crate::RequestOptions {
3269            &mut self.0.options
3270        }
3271    }
3272
3273    /// The request builder for [SqlInstancesService::list_server_certificates][crate::client::SqlInstancesService::list_server_certificates] calls.
3274    ///
3275    /// # Example
3276    /// ```
3277    /// # use google_cloud_sql_v1::builder::sql_instances_service::ListServerCertificates;
3278    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
3279    ///
3280    /// let builder = prepare_request_builder();
3281    /// let response = builder.send().await?;
3282    /// # Ok(()) }
3283    ///
3284    /// fn prepare_request_builder() -> ListServerCertificates {
3285    ///   # panic!();
3286    ///   // ... details omitted ...
3287    /// }
3288    /// ```
3289    #[derive(Clone, Debug)]
3290    pub struct ListServerCertificates(
3291        RequestBuilder<crate::model::SqlInstancesListServerCertificatesRequest>,
3292    );
3293
3294    impl ListServerCertificates {
3295        pub(crate) fn new(
3296            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3297        ) -> Self {
3298            Self(RequestBuilder::new(stub))
3299        }
3300
3301        /// Sets the full request, replacing any prior values.
3302        pub fn with_request<V: Into<crate::model::SqlInstancesListServerCertificatesRequest>>(
3303            mut self,
3304            v: V,
3305        ) -> Self {
3306            self.0.request = v.into();
3307            self
3308        }
3309
3310        /// Sets all the options, replacing any prior values.
3311        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3312            self.0.options = v.into();
3313            self
3314        }
3315
3316        /// Sends the request.
3317        pub async fn send(self) -> Result<crate::model::InstancesListServerCertificatesResponse> {
3318            (*self.0.stub)
3319                .list_server_certificates(self.0.request, self.0.options)
3320                .await
3321                .map(crate::Response::into_body)
3322        }
3323
3324        /// Sets the value of [instance][crate::model::SqlInstancesListServerCertificatesRequest::instance].
3325        ///
3326        /// This is a **required** field for requests.
3327        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3328            self.0.request.instance = v.into();
3329            self
3330        }
3331
3332        /// Sets the value of [project][crate::model::SqlInstancesListServerCertificatesRequest::project].
3333        ///
3334        /// This is a **required** field for requests.
3335        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3336            self.0.request.project = v.into();
3337            self
3338        }
3339    }
3340
3341    #[doc(hidden)]
3342    impl crate::RequestBuilder for ListServerCertificates {
3343        fn request_options(&mut self) -> &mut crate::RequestOptions {
3344            &mut self.0.options
3345        }
3346    }
3347
3348    /// The request builder for [SqlInstancesService::list_entra_id_certificates][crate::client::SqlInstancesService::list_entra_id_certificates] calls.
3349    ///
3350    /// # Example
3351    /// ```
3352    /// # use google_cloud_sql_v1::builder::sql_instances_service::ListEntraIdCertificates;
3353    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
3354    ///
3355    /// let builder = prepare_request_builder();
3356    /// let response = builder.send().await?;
3357    /// # Ok(()) }
3358    ///
3359    /// fn prepare_request_builder() -> ListEntraIdCertificates {
3360    ///   # panic!();
3361    ///   // ... details omitted ...
3362    /// }
3363    /// ```
3364    #[derive(Clone, Debug)]
3365    pub struct ListEntraIdCertificates(
3366        RequestBuilder<crate::model::SqlInstancesListEntraIdCertificatesRequest>,
3367    );
3368
3369    impl ListEntraIdCertificates {
3370        pub(crate) fn new(
3371            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3372        ) -> Self {
3373            Self(RequestBuilder::new(stub))
3374        }
3375
3376        /// Sets the full request, replacing any prior values.
3377        pub fn with_request<V: Into<crate::model::SqlInstancesListEntraIdCertificatesRequest>>(
3378            mut self,
3379            v: V,
3380        ) -> Self {
3381            self.0.request = v.into();
3382            self
3383        }
3384
3385        /// Sets all the options, replacing any prior values.
3386        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3387            self.0.options = v.into();
3388            self
3389        }
3390
3391        /// Sends the request.
3392        pub async fn send(self) -> Result<crate::model::InstancesListEntraIdCertificatesResponse> {
3393            (*self.0.stub)
3394                .list_entra_id_certificates(self.0.request, self.0.options)
3395                .await
3396                .map(crate::Response::into_body)
3397        }
3398
3399        /// Sets the value of [instance][crate::model::SqlInstancesListEntraIdCertificatesRequest::instance].
3400        ///
3401        /// This is a **required** field for requests.
3402        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        /// Sets the value of [project][crate::model::SqlInstancesListEntraIdCertificatesRequest::project].
3408        ///
3409        /// This is a **required** field for requests.
3410        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3411            self.0.request.project = v.into();
3412            self
3413        }
3414    }
3415
3416    #[doc(hidden)]
3417    impl crate::RequestBuilder for ListEntraIdCertificates {
3418        fn request_options(&mut self) -> &mut crate::RequestOptions {
3419            &mut self.0.options
3420        }
3421    }
3422
3423    /// The request builder for [SqlInstancesService::patch][crate::client::SqlInstancesService::patch] calls.
3424    ///
3425    /// # Example
3426    /// ```
3427    /// # use google_cloud_sql_v1::builder::sql_instances_service::Patch;
3428    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
3429    ///
3430    /// let builder = prepare_request_builder();
3431    /// let response = builder.send().await?;
3432    /// # Ok(()) }
3433    ///
3434    /// fn prepare_request_builder() -> Patch {
3435    ///   # panic!();
3436    ///   // ... details omitted ...
3437    /// }
3438    /// ```
3439    #[derive(Clone, Debug)]
3440    pub struct Patch(RequestBuilder<crate::model::SqlInstancesPatchRequest>);
3441
3442    impl Patch {
3443        pub(crate) fn new(
3444            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3445        ) -> Self {
3446            Self(RequestBuilder::new(stub))
3447        }
3448
3449        /// Sets the full request, replacing any prior values.
3450        pub fn with_request<V: Into<crate::model::SqlInstancesPatchRequest>>(
3451            mut self,
3452            v: V,
3453        ) -> Self {
3454            self.0.request = v.into();
3455            self
3456        }
3457
3458        /// Sets all the options, replacing any prior values.
3459        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3460            self.0.options = v.into();
3461            self
3462        }
3463
3464        /// Sends the request.
3465        pub async fn send(self) -> Result<crate::model::Operation> {
3466            (*self.0.stub)
3467                .patch(self.0.request, self.0.options)
3468                .await
3469                .map(crate::Response::into_body)
3470        }
3471
3472        /// Sets the value of [instance][crate::model::SqlInstancesPatchRequest::instance].
3473        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3474            self.0.request.instance = v.into();
3475            self
3476        }
3477
3478        /// Sets the value of [project][crate::model::SqlInstancesPatchRequest::project].
3479        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3480            self.0.request.project = v.into();
3481            self
3482        }
3483
3484        /// Sets the value of [reconcile_psc_networking][crate::model::SqlInstancesPatchRequest::reconcile_psc_networking].
3485        pub fn set_reconcile_psc_networking<T>(mut self, v: T) -> Self
3486        where
3487            T: std::convert::Into<bool>,
3488        {
3489            self.0.request.reconcile_psc_networking = std::option::Option::Some(v.into());
3490            self
3491        }
3492
3493        /// Sets or clears the value of [reconcile_psc_networking][crate::model::SqlInstancesPatchRequest::reconcile_psc_networking].
3494        pub fn set_or_clear_reconcile_psc_networking<T>(mut self, v: std::option::Option<T>) -> Self
3495        where
3496            T: std::convert::Into<bool>,
3497        {
3498            self.0.request.reconcile_psc_networking = v.map(|x| x.into());
3499            self
3500        }
3501
3502        /// Sets the value of [reconcile_psc_networking_force][crate::model::SqlInstancesPatchRequest::reconcile_psc_networking_force].
3503        pub fn set_reconcile_psc_networking_force<T>(mut self, v: T) -> Self
3504        where
3505            T: std::convert::Into<bool>,
3506        {
3507            self.0.request.reconcile_psc_networking_force = std::option::Option::Some(v.into());
3508            self
3509        }
3510
3511        /// Sets or clears the value of [reconcile_psc_networking_force][crate::model::SqlInstancesPatchRequest::reconcile_psc_networking_force].
3512        pub fn set_or_clear_reconcile_psc_networking_force<T>(
3513            mut self,
3514            v: std::option::Option<T>,
3515        ) -> Self
3516        where
3517            T: std::convert::Into<bool>,
3518        {
3519            self.0.request.reconcile_psc_networking_force = v.map(|x| x.into());
3520            self
3521        }
3522
3523        /// Sets the value of [body][crate::model::SqlInstancesPatchRequest::body].
3524        pub fn set_body<T>(mut self, v: T) -> Self
3525        where
3526            T: std::convert::Into<crate::model::DatabaseInstance>,
3527        {
3528            self.0.request.body = std::option::Option::Some(v.into());
3529            self
3530        }
3531
3532        /// Sets or clears the value of [body][crate::model::SqlInstancesPatchRequest::body].
3533        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3534        where
3535            T: std::convert::Into<crate::model::DatabaseInstance>,
3536        {
3537            self.0.request.body = v.map(|x| x.into());
3538            self
3539        }
3540    }
3541
3542    #[doc(hidden)]
3543    impl crate::RequestBuilder for Patch {
3544        fn request_options(&mut self) -> &mut crate::RequestOptions {
3545            &mut self.0.options
3546        }
3547    }
3548
3549    /// The request builder for [SqlInstancesService::promote_replica][crate::client::SqlInstancesService::promote_replica] calls.
3550    ///
3551    /// # Example
3552    /// ```
3553    /// # use google_cloud_sql_v1::builder::sql_instances_service::PromoteReplica;
3554    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
3555    ///
3556    /// let builder = prepare_request_builder();
3557    /// let response = builder.send().await?;
3558    /// # Ok(()) }
3559    ///
3560    /// fn prepare_request_builder() -> PromoteReplica {
3561    ///   # panic!();
3562    ///   // ... details omitted ...
3563    /// }
3564    /// ```
3565    #[derive(Clone, Debug)]
3566    pub struct PromoteReplica(RequestBuilder<crate::model::SqlInstancesPromoteReplicaRequest>);
3567
3568    impl PromoteReplica {
3569        pub(crate) fn new(
3570            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3571        ) -> Self {
3572            Self(RequestBuilder::new(stub))
3573        }
3574
3575        /// Sets the full request, replacing any prior values.
3576        pub fn with_request<V: Into<crate::model::SqlInstancesPromoteReplicaRequest>>(
3577            mut self,
3578            v: V,
3579        ) -> Self {
3580            self.0.request = v.into();
3581            self
3582        }
3583
3584        /// Sets all the options, replacing any prior values.
3585        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3586            self.0.options = v.into();
3587            self
3588        }
3589
3590        /// Sends the request.
3591        pub async fn send(self) -> Result<crate::model::Operation> {
3592            (*self.0.stub)
3593                .promote_replica(self.0.request, self.0.options)
3594                .await
3595                .map(crate::Response::into_body)
3596        }
3597
3598        /// Sets the value of [instance][crate::model::SqlInstancesPromoteReplicaRequest::instance].
3599        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3600            self.0.request.instance = v.into();
3601            self
3602        }
3603
3604        /// Sets the value of [project][crate::model::SqlInstancesPromoteReplicaRequest::project].
3605        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3606            self.0.request.project = v.into();
3607            self
3608        }
3609
3610        /// Sets the value of [failover][crate::model::SqlInstancesPromoteReplicaRequest::failover].
3611        pub fn set_failover<T: Into<bool>>(mut self, v: T) -> Self {
3612            self.0.request.failover = v.into();
3613            self
3614        }
3615    }
3616
3617    #[doc(hidden)]
3618    impl crate::RequestBuilder for PromoteReplica {
3619        fn request_options(&mut self) -> &mut crate::RequestOptions {
3620            &mut self.0.options
3621        }
3622    }
3623
3624    /// The request builder for [SqlInstancesService::switchover][crate::client::SqlInstancesService::switchover] calls.
3625    ///
3626    /// # Example
3627    /// ```
3628    /// # use google_cloud_sql_v1::builder::sql_instances_service::Switchover;
3629    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
3630    ///
3631    /// let builder = prepare_request_builder();
3632    /// let response = builder.send().await?;
3633    /// # Ok(()) }
3634    ///
3635    /// fn prepare_request_builder() -> Switchover {
3636    ///   # panic!();
3637    ///   // ... details omitted ...
3638    /// }
3639    /// ```
3640    #[derive(Clone, Debug)]
3641    pub struct Switchover(RequestBuilder<crate::model::SqlInstancesSwitchoverRequest>);
3642
3643    impl Switchover {
3644        pub(crate) fn new(
3645            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3646        ) -> Self {
3647            Self(RequestBuilder::new(stub))
3648        }
3649
3650        /// Sets the full request, replacing any prior values.
3651        pub fn with_request<V: Into<crate::model::SqlInstancesSwitchoverRequest>>(
3652            mut self,
3653            v: V,
3654        ) -> Self {
3655            self.0.request = v.into();
3656            self
3657        }
3658
3659        /// Sets all the options, replacing any prior values.
3660        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3661            self.0.options = v.into();
3662            self
3663        }
3664
3665        /// Sends the request.
3666        pub async fn send(self) -> Result<crate::model::Operation> {
3667            (*self.0.stub)
3668                .switchover(self.0.request, self.0.options)
3669                .await
3670                .map(crate::Response::into_body)
3671        }
3672
3673        /// Sets the value of [instance][crate::model::SqlInstancesSwitchoverRequest::instance].
3674        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3675            self.0.request.instance = v.into();
3676            self
3677        }
3678
3679        /// Sets the value of [project][crate::model::SqlInstancesSwitchoverRequest::project].
3680        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3681            self.0.request.project = v.into();
3682            self
3683        }
3684
3685        /// Sets the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
3686        pub fn set_db_timeout<T>(mut self, v: T) -> Self
3687        where
3688            T: std::convert::Into<wkt::Duration>,
3689        {
3690            self.0.request.db_timeout = std::option::Option::Some(v.into());
3691            self
3692        }
3693
3694        /// Sets or clears the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
3695        pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
3696        where
3697            T: std::convert::Into<wkt::Duration>,
3698        {
3699            self.0.request.db_timeout = v.map(|x| x.into());
3700            self
3701        }
3702    }
3703
3704    #[doc(hidden)]
3705    impl crate::RequestBuilder for Switchover {
3706        fn request_options(&mut self) -> &mut crate::RequestOptions {
3707            &mut self.0.options
3708        }
3709    }
3710
3711    /// The request builder for [SqlInstancesService::reset_ssl_config][crate::client::SqlInstancesService::reset_ssl_config] calls.
3712    ///
3713    /// # Example
3714    /// ```
3715    /// # use google_cloud_sql_v1::builder::sql_instances_service::ResetSslConfig;
3716    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
3717    ///
3718    /// let builder = prepare_request_builder();
3719    /// let response = builder.send().await?;
3720    /// # Ok(()) }
3721    ///
3722    /// fn prepare_request_builder() -> ResetSslConfig {
3723    ///   # panic!();
3724    ///   // ... details omitted ...
3725    /// }
3726    /// ```
3727    #[derive(Clone, Debug)]
3728    pub struct ResetSslConfig(RequestBuilder<crate::model::SqlInstancesResetSslConfigRequest>);
3729
3730    impl ResetSslConfig {
3731        pub(crate) fn new(
3732            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3733        ) -> Self {
3734            Self(RequestBuilder::new(stub))
3735        }
3736
3737        /// Sets the full request, replacing any prior values.
3738        pub fn with_request<V: Into<crate::model::SqlInstancesResetSslConfigRequest>>(
3739            mut self,
3740            v: V,
3741        ) -> Self {
3742            self.0.request = v.into();
3743            self
3744        }
3745
3746        /// Sets all the options, replacing any prior values.
3747        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3748            self.0.options = v.into();
3749            self
3750        }
3751
3752        /// Sends the request.
3753        pub async fn send(self) -> Result<crate::model::Operation> {
3754            (*self.0.stub)
3755                .reset_ssl_config(self.0.request, self.0.options)
3756                .await
3757                .map(crate::Response::into_body)
3758        }
3759
3760        /// Sets the value of [instance][crate::model::SqlInstancesResetSslConfigRequest::instance].
3761        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3762            self.0.request.instance = v.into();
3763            self
3764        }
3765
3766        /// Sets the value of [project][crate::model::SqlInstancesResetSslConfigRequest::project].
3767        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3768            self.0.request.project = v.into();
3769            self
3770        }
3771
3772        /// Sets the value of [mode][crate::model::SqlInstancesResetSslConfigRequest::mode].
3773        pub fn set_mode<
3774            T: Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
3775        >(
3776            mut self,
3777            v: T,
3778        ) -> Self {
3779            self.0.request.mode = v.into();
3780            self
3781        }
3782    }
3783
3784    #[doc(hidden)]
3785    impl crate::RequestBuilder for ResetSslConfig {
3786        fn request_options(&mut self) -> &mut crate::RequestOptions {
3787            &mut self.0.options
3788        }
3789    }
3790
3791    /// The request builder for [SqlInstancesService::restart][crate::client::SqlInstancesService::restart] calls.
3792    ///
3793    /// # Example
3794    /// ```
3795    /// # use google_cloud_sql_v1::builder::sql_instances_service::Restart;
3796    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
3797    ///
3798    /// let builder = prepare_request_builder();
3799    /// let response = builder.send().await?;
3800    /// # Ok(()) }
3801    ///
3802    /// fn prepare_request_builder() -> Restart {
3803    ///   # panic!();
3804    ///   // ... details omitted ...
3805    /// }
3806    /// ```
3807    #[derive(Clone, Debug)]
3808    pub struct Restart(RequestBuilder<crate::model::SqlInstancesRestartRequest>);
3809
3810    impl Restart {
3811        pub(crate) fn new(
3812            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3813        ) -> Self {
3814            Self(RequestBuilder::new(stub))
3815        }
3816
3817        /// Sets the full request, replacing any prior values.
3818        pub fn with_request<V: Into<crate::model::SqlInstancesRestartRequest>>(
3819            mut self,
3820            v: V,
3821        ) -> Self {
3822            self.0.request = v.into();
3823            self
3824        }
3825
3826        /// Sets all the options, replacing any prior values.
3827        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3828            self.0.options = v.into();
3829            self
3830        }
3831
3832        /// Sends the request.
3833        pub async fn send(self) -> Result<crate::model::Operation> {
3834            (*self.0.stub)
3835                .restart(self.0.request, self.0.options)
3836                .await
3837                .map(crate::Response::into_body)
3838        }
3839
3840        /// Sets the value of [instance][crate::model::SqlInstancesRestartRequest::instance].
3841        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3842            self.0.request.instance = v.into();
3843            self
3844        }
3845
3846        /// Sets the value of [project][crate::model::SqlInstancesRestartRequest::project].
3847        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3848            self.0.request.project = v.into();
3849            self
3850        }
3851    }
3852
3853    #[doc(hidden)]
3854    impl crate::RequestBuilder for Restart {
3855        fn request_options(&mut self) -> &mut crate::RequestOptions {
3856            &mut self.0.options
3857        }
3858    }
3859
3860    /// The request builder for [SqlInstancesService::restore_backup][crate::client::SqlInstancesService::restore_backup] calls.
3861    ///
3862    /// # Example
3863    /// ```
3864    /// # use google_cloud_sql_v1::builder::sql_instances_service::RestoreBackup;
3865    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
3866    ///
3867    /// let builder = prepare_request_builder();
3868    /// let response = builder.send().await?;
3869    /// # Ok(()) }
3870    ///
3871    /// fn prepare_request_builder() -> RestoreBackup {
3872    ///   # panic!();
3873    ///   // ... details omitted ...
3874    /// }
3875    /// ```
3876    #[derive(Clone, Debug)]
3877    pub struct RestoreBackup(RequestBuilder<crate::model::SqlInstancesRestoreBackupRequest>);
3878
3879    impl RestoreBackup {
3880        pub(crate) fn new(
3881            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3882        ) -> Self {
3883            Self(RequestBuilder::new(stub))
3884        }
3885
3886        /// Sets the full request, replacing any prior values.
3887        pub fn with_request<V: Into<crate::model::SqlInstancesRestoreBackupRequest>>(
3888            mut self,
3889            v: V,
3890        ) -> Self {
3891            self.0.request = v.into();
3892            self
3893        }
3894
3895        /// Sets all the options, replacing any prior values.
3896        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3897            self.0.options = v.into();
3898            self
3899        }
3900
3901        /// Sends the request.
3902        pub async fn send(self) -> Result<crate::model::Operation> {
3903            (*self.0.stub)
3904                .restore_backup(self.0.request, self.0.options)
3905                .await
3906                .map(crate::Response::into_body)
3907        }
3908
3909        /// Sets the value of [instance][crate::model::SqlInstancesRestoreBackupRequest::instance].
3910        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3911            self.0.request.instance = v.into();
3912            self
3913        }
3914
3915        /// Sets the value of [project][crate::model::SqlInstancesRestoreBackupRequest::project].
3916        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3917            self.0.request.project = v.into();
3918            self
3919        }
3920
3921        /// Sets the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
3922        pub fn set_body<T>(mut self, v: T) -> Self
3923        where
3924            T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
3925        {
3926            self.0.request.body = std::option::Option::Some(v.into());
3927            self
3928        }
3929
3930        /// Sets or clears the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
3931        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3932        where
3933            T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
3934        {
3935            self.0.request.body = v.map(|x| x.into());
3936            self
3937        }
3938    }
3939
3940    #[doc(hidden)]
3941    impl crate::RequestBuilder for RestoreBackup {
3942        fn request_options(&mut self) -> &mut crate::RequestOptions {
3943            &mut self.0.options
3944        }
3945    }
3946
3947    /// The request builder for [SqlInstancesService::rotate_server_ca][crate::client::SqlInstancesService::rotate_server_ca] calls.
3948    ///
3949    /// # Example
3950    /// ```
3951    /// # use google_cloud_sql_v1::builder::sql_instances_service::RotateServerCa;
3952    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
3953    ///
3954    /// let builder = prepare_request_builder();
3955    /// let response = builder.send().await?;
3956    /// # Ok(()) }
3957    ///
3958    /// fn prepare_request_builder() -> RotateServerCa {
3959    ///   # panic!();
3960    ///   // ... details omitted ...
3961    /// }
3962    /// ```
3963    #[derive(Clone, Debug)]
3964    pub struct RotateServerCa(RequestBuilder<crate::model::SqlInstancesRotateServerCaRequest>);
3965
3966    impl RotateServerCa {
3967        pub(crate) fn new(
3968            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3969        ) -> Self {
3970            Self(RequestBuilder::new(stub))
3971        }
3972
3973        /// Sets the full request, replacing any prior values.
3974        pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCaRequest>>(
3975            mut self,
3976            v: V,
3977        ) -> Self {
3978            self.0.request = v.into();
3979            self
3980        }
3981
3982        /// Sets all the options, replacing any prior values.
3983        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3984            self.0.options = v.into();
3985            self
3986        }
3987
3988        /// Sends the request.
3989        pub async fn send(self) -> Result<crate::model::Operation> {
3990            (*self.0.stub)
3991                .rotate_server_ca(self.0.request, self.0.options)
3992                .await
3993                .map(crate::Response::into_body)
3994        }
3995
3996        /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCaRequest::instance].
3997        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3998            self.0.request.instance = v.into();
3999            self
4000        }
4001
4002        /// Sets the value of [project][crate::model::SqlInstancesRotateServerCaRequest::project].
4003        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4004            self.0.request.project = v.into();
4005            self
4006        }
4007
4008        /// Sets the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
4009        pub fn set_body<T>(mut self, v: T) -> Self
4010        where
4011            T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
4012        {
4013            self.0.request.body = std::option::Option::Some(v.into());
4014            self
4015        }
4016
4017        /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
4018        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4019        where
4020            T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
4021        {
4022            self.0.request.body = v.map(|x| x.into());
4023            self
4024        }
4025    }
4026
4027    #[doc(hidden)]
4028    impl crate::RequestBuilder for RotateServerCa {
4029        fn request_options(&mut self) -> &mut crate::RequestOptions {
4030            &mut self.0.options
4031        }
4032    }
4033
4034    /// The request builder for [SqlInstancesService::rotate_server_certificate][crate::client::SqlInstancesService::rotate_server_certificate] calls.
4035    ///
4036    /// # Example
4037    /// ```
4038    /// # use google_cloud_sql_v1::builder::sql_instances_service::RotateServerCertificate;
4039    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
4040    ///
4041    /// let builder = prepare_request_builder();
4042    /// let response = builder.send().await?;
4043    /// # Ok(()) }
4044    ///
4045    /// fn prepare_request_builder() -> RotateServerCertificate {
4046    ///   # panic!();
4047    ///   // ... details omitted ...
4048    /// }
4049    /// ```
4050    #[derive(Clone, Debug)]
4051    pub struct RotateServerCertificate(
4052        RequestBuilder<crate::model::SqlInstancesRotateServerCertificateRequest>,
4053    );
4054
4055    impl RotateServerCertificate {
4056        pub(crate) fn new(
4057            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4058        ) -> Self {
4059            Self(RequestBuilder::new(stub))
4060        }
4061
4062        /// Sets the full request, replacing any prior values.
4063        pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCertificateRequest>>(
4064            mut self,
4065            v: V,
4066        ) -> Self {
4067            self.0.request = v.into();
4068            self
4069        }
4070
4071        /// Sets all the options, replacing any prior values.
4072        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4073            self.0.options = v.into();
4074            self
4075        }
4076
4077        /// Sends the request.
4078        pub async fn send(self) -> Result<crate::model::Operation> {
4079            (*self.0.stub)
4080                .rotate_server_certificate(self.0.request, self.0.options)
4081                .await
4082                .map(crate::Response::into_body)
4083        }
4084
4085        /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCertificateRequest::instance].
4086        ///
4087        /// This is a **required** field for requests.
4088        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4089            self.0.request.instance = v.into();
4090            self
4091        }
4092
4093        /// Sets the value of [project][crate::model::SqlInstancesRotateServerCertificateRequest::project].
4094        ///
4095        /// This is a **required** field for requests.
4096        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4097            self.0.request.project = v.into();
4098            self
4099        }
4100
4101        /// Sets the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
4102        pub fn set_body<T>(mut self, v: T) -> Self
4103        where
4104            T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
4105        {
4106            self.0.request.body = std::option::Option::Some(v.into());
4107            self
4108        }
4109
4110        /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
4111        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4112        where
4113            T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
4114        {
4115            self.0.request.body = v.map(|x| x.into());
4116            self
4117        }
4118    }
4119
4120    #[doc(hidden)]
4121    impl crate::RequestBuilder for RotateServerCertificate {
4122        fn request_options(&mut self) -> &mut crate::RequestOptions {
4123            &mut self.0.options
4124        }
4125    }
4126
4127    /// The request builder for [SqlInstancesService::rotate_entra_id_certificate][crate::client::SqlInstancesService::rotate_entra_id_certificate] calls.
4128    ///
4129    /// # Example
4130    /// ```
4131    /// # use google_cloud_sql_v1::builder::sql_instances_service::RotateEntraIdCertificate;
4132    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
4133    ///
4134    /// let builder = prepare_request_builder();
4135    /// let response = builder.send().await?;
4136    /// # Ok(()) }
4137    ///
4138    /// fn prepare_request_builder() -> RotateEntraIdCertificate {
4139    ///   # panic!();
4140    ///   // ... details omitted ...
4141    /// }
4142    /// ```
4143    #[derive(Clone, Debug)]
4144    pub struct RotateEntraIdCertificate(
4145        RequestBuilder<crate::model::SqlInstancesRotateEntraIdCertificateRequest>,
4146    );
4147
4148    impl RotateEntraIdCertificate {
4149        pub(crate) fn new(
4150            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4151        ) -> Self {
4152            Self(RequestBuilder::new(stub))
4153        }
4154
4155        /// Sets the full request, replacing any prior values.
4156        pub fn with_request<V: Into<crate::model::SqlInstancesRotateEntraIdCertificateRequest>>(
4157            mut self,
4158            v: V,
4159        ) -> Self {
4160            self.0.request = v.into();
4161            self
4162        }
4163
4164        /// Sets all the options, replacing any prior values.
4165        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4166            self.0.options = v.into();
4167            self
4168        }
4169
4170        /// Sends the request.
4171        pub async fn send(self) -> Result<crate::model::Operation> {
4172            (*self.0.stub)
4173                .rotate_entra_id_certificate(self.0.request, self.0.options)
4174                .await
4175                .map(crate::Response::into_body)
4176        }
4177
4178        /// Sets the value of [instance][crate::model::SqlInstancesRotateEntraIdCertificateRequest::instance].
4179        ///
4180        /// This is a **required** field for requests.
4181        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4182            self.0.request.instance = v.into();
4183            self
4184        }
4185
4186        /// Sets the value of [project][crate::model::SqlInstancesRotateEntraIdCertificateRequest::project].
4187        ///
4188        /// This is a **required** field for requests.
4189        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4190            self.0.request.project = v.into();
4191            self
4192        }
4193
4194        /// Sets the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
4195        pub fn set_body<T>(mut self, v: T) -> Self
4196        where
4197            T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
4198        {
4199            self.0.request.body = std::option::Option::Some(v.into());
4200            self
4201        }
4202
4203        /// Sets or clears the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
4204        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4205        where
4206            T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
4207        {
4208            self.0.request.body = v.map(|x| x.into());
4209            self
4210        }
4211    }
4212
4213    #[doc(hidden)]
4214    impl crate::RequestBuilder for RotateEntraIdCertificate {
4215        fn request_options(&mut self) -> &mut crate::RequestOptions {
4216            &mut self.0.options
4217        }
4218    }
4219
4220    /// The request builder for [SqlInstancesService::start_replica][crate::client::SqlInstancesService::start_replica] calls.
4221    ///
4222    /// # Example
4223    /// ```
4224    /// # use google_cloud_sql_v1::builder::sql_instances_service::StartReplica;
4225    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
4226    ///
4227    /// let builder = prepare_request_builder();
4228    /// let response = builder.send().await?;
4229    /// # Ok(()) }
4230    ///
4231    /// fn prepare_request_builder() -> StartReplica {
4232    ///   # panic!();
4233    ///   // ... details omitted ...
4234    /// }
4235    /// ```
4236    #[derive(Clone, Debug)]
4237    pub struct StartReplica(RequestBuilder<crate::model::SqlInstancesStartReplicaRequest>);
4238
4239    impl StartReplica {
4240        pub(crate) fn new(
4241            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4242        ) -> Self {
4243            Self(RequestBuilder::new(stub))
4244        }
4245
4246        /// Sets the full request, replacing any prior values.
4247        pub fn with_request<V: Into<crate::model::SqlInstancesStartReplicaRequest>>(
4248            mut self,
4249            v: V,
4250        ) -> Self {
4251            self.0.request = v.into();
4252            self
4253        }
4254
4255        /// Sets all the options, replacing any prior values.
4256        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4257            self.0.options = v.into();
4258            self
4259        }
4260
4261        /// Sends the request.
4262        pub async fn send(self) -> Result<crate::model::Operation> {
4263            (*self.0.stub)
4264                .start_replica(self.0.request, self.0.options)
4265                .await
4266                .map(crate::Response::into_body)
4267        }
4268
4269        /// Sets the value of [instance][crate::model::SqlInstancesStartReplicaRequest::instance].
4270        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4271            self.0.request.instance = v.into();
4272            self
4273        }
4274
4275        /// Sets the value of [project][crate::model::SqlInstancesStartReplicaRequest::project].
4276        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4277            self.0.request.project = v.into();
4278            self
4279        }
4280    }
4281
4282    #[doc(hidden)]
4283    impl crate::RequestBuilder for StartReplica {
4284        fn request_options(&mut self) -> &mut crate::RequestOptions {
4285            &mut self.0.options
4286        }
4287    }
4288
4289    /// The request builder for [SqlInstancesService::stop_replica][crate::client::SqlInstancesService::stop_replica] calls.
4290    ///
4291    /// # Example
4292    /// ```
4293    /// # use google_cloud_sql_v1::builder::sql_instances_service::StopReplica;
4294    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
4295    ///
4296    /// let builder = prepare_request_builder();
4297    /// let response = builder.send().await?;
4298    /// # Ok(()) }
4299    ///
4300    /// fn prepare_request_builder() -> StopReplica {
4301    ///   # panic!();
4302    ///   // ... details omitted ...
4303    /// }
4304    /// ```
4305    #[derive(Clone, Debug)]
4306    pub struct StopReplica(RequestBuilder<crate::model::SqlInstancesStopReplicaRequest>);
4307
4308    impl StopReplica {
4309        pub(crate) fn new(
4310            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4311        ) -> Self {
4312            Self(RequestBuilder::new(stub))
4313        }
4314
4315        /// Sets the full request, replacing any prior values.
4316        pub fn with_request<V: Into<crate::model::SqlInstancesStopReplicaRequest>>(
4317            mut self,
4318            v: V,
4319        ) -> Self {
4320            self.0.request = v.into();
4321            self
4322        }
4323
4324        /// Sets all the options, replacing any prior values.
4325        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4326            self.0.options = v.into();
4327            self
4328        }
4329
4330        /// Sends the request.
4331        pub async fn send(self) -> Result<crate::model::Operation> {
4332            (*self.0.stub)
4333                .stop_replica(self.0.request, self.0.options)
4334                .await
4335                .map(crate::Response::into_body)
4336        }
4337
4338        /// Sets the value of [instance][crate::model::SqlInstancesStopReplicaRequest::instance].
4339        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4340            self.0.request.instance = v.into();
4341            self
4342        }
4343
4344        /// Sets the value of [project][crate::model::SqlInstancesStopReplicaRequest::project].
4345        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4346            self.0.request.project = v.into();
4347            self
4348        }
4349    }
4350
4351    #[doc(hidden)]
4352    impl crate::RequestBuilder for StopReplica {
4353        fn request_options(&mut self) -> &mut crate::RequestOptions {
4354            &mut self.0.options
4355        }
4356    }
4357
4358    /// The request builder for [SqlInstancesService::truncate_log][crate::client::SqlInstancesService::truncate_log] calls.
4359    ///
4360    /// # Example
4361    /// ```
4362    /// # use google_cloud_sql_v1::builder::sql_instances_service::TruncateLog;
4363    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
4364    ///
4365    /// let builder = prepare_request_builder();
4366    /// let response = builder.send().await?;
4367    /// # Ok(()) }
4368    ///
4369    /// fn prepare_request_builder() -> TruncateLog {
4370    ///   # panic!();
4371    ///   // ... details omitted ...
4372    /// }
4373    /// ```
4374    #[derive(Clone, Debug)]
4375    pub struct TruncateLog(RequestBuilder<crate::model::SqlInstancesTruncateLogRequest>);
4376
4377    impl TruncateLog {
4378        pub(crate) fn new(
4379            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4380        ) -> Self {
4381            Self(RequestBuilder::new(stub))
4382        }
4383
4384        /// Sets the full request, replacing any prior values.
4385        pub fn with_request<V: Into<crate::model::SqlInstancesTruncateLogRequest>>(
4386            mut self,
4387            v: V,
4388        ) -> Self {
4389            self.0.request = v.into();
4390            self
4391        }
4392
4393        /// Sets all the options, replacing any prior values.
4394        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4395            self.0.options = v.into();
4396            self
4397        }
4398
4399        /// Sends the request.
4400        pub async fn send(self) -> Result<crate::model::Operation> {
4401            (*self.0.stub)
4402                .truncate_log(self.0.request, self.0.options)
4403                .await
4404                .map(crate::Response::into_body)
4405        }
4406
4407        /// Sets the value of [instance][crate::model::SqlInstancesTruncateLogRequest::instance].
4408        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4409            self.0.request.instance = v.into();
4410            self
4411        }
4412
4413        /// Sets the value of [project][crate::model::SqlInstancesTruncateLogRequest::project].
4414        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4415            self.0.request.project = v.into();
4416            self
4417        }
4418
4419        /// Sets the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
4420        pub fn set_body<T>(mut self, v: T) -> Self
4421        where
4422            T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
4423        {
4424            self.0.request.body = std::option::Option::Some(v.into());
4425            self
4426        }
4427
4428        /// Sets or clears the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
4429        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4430        where
4431            T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
4432        {
4433            self.0.request.body = v.map(|x| x.into());
4434            self
4435        }
4436    }
4437
4438    #[doc(hidden)]
4439    impl crate::RequestBuilder for TruncateLog {
4440        fn request_options(&mut self) -> &mut crate::RequestOptions {
4441            &mut self.0.options
4442        }
4443    }
4444
4445    /// The request builder for [SqlInstancesService::update][crate::client::SqlInstancesService::update] calls.
4446    ///
4447    /// # Example
4448    /// ```
4449    /// # use google_cloud_sql_v1::builder::sql_instances_service::Update;
4450    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
4451    ///
4452    /// let builder = prepare_request_builder();
4453    /// let response = builder.send().await?;
4454    /// # Ok(()) }
4455    ///
4456    /// fn prepare_request_builder() -> Update {
4457    ///   # panic!();
4458    ///   // ... details omitted ...
4459    /// }
4460    /// ```
4461    #[derive(Clone, Debug)]
4462    pub struct Update(RequestBuilder<crate::model::SqlInstancesUpdateRequest>);
4463
4464    impl Update {
4465        pub(crate) fn new(
4466            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4467        ) -> Self {
4468            Self(RequestBuilder::new(stub))
4469        }
4470
4471        /// Sets the full request, replacing any prior values.
4472        pub fn with_request<V: Into<crate::model::SqlInstancesUpdateRequest>>(
4473            mut self,
4474            v: V,
4475        ) -> Self {
4476            self.0.request = v.into();
4477            self
4478        }
4479
4480        /// Sets all the options, replacing any prior values.
4481        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4482            self.0.options = v.into();
4483            self
4484        }
4485
4486        /// Sends the request.
4487        pub async fn send(self) -> Result<crate::model::Operation> {
4488            (*self.0.stub)
4489                .update(self.0.request, self.0.options)
4490                .await
4491                .map(crate::Response::into_body)
4492        }
4493
4494        /// Sets the value of [instance][crate::model::SqlInstancesUpdateRequest::instance].
4495        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4496            self.0.request.instance = v.into();
4497            self
4498        }
4499
4500        /// Sets the value of [project][crate::model::SqlInstancesUpdateRequest::project].
4501        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4502            self.0.request.project = v.into();
4503            self
4504        }
4505
4506        /// Sets the value of [body][crate::model::SqlInstancesUpdateRequest::body].
4507        pub fn set_body<T>(mut self, v: T) -> Self
4508        where
4509            T: std::convert::Into<crate::model::DatabaseInstance>,
4510        {
4511            self.0.request.body = std::option::Option::Some(v.into());
4512            self
4513        }
4514
4515        /// Sets or clears the value of [body][crate::model::SqlInstancesUpdateRequest::body].
4516        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4517        where
4518            T: std::convert::Into<crate::model::DatabaseInstance>,
4519        {
4520            self.0.request.body = v.map(|x| x.into());
4521            self
4522        }
4523    }
4524
4525    #[doc(hidden)]
4526    impl crate::RequestBuilder for Update {
4527        fn request_options(&mut self) -> &mut crate::RequestOptions {
4528            &mut self.0.options
4529        }
4530    }
4531
4532    /// The request builder for [SqlInstancesService::create_ephemeral][crate::client::SqlInstancesService::create_ephemeral] calls.
4533    ///
4534    /// # Example
4535    /// ```
4536    /// # use google_cloud_sql_v1::builder::sql_instances_service::CreateEphemeral;
4537    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
4538    ///
4539    /// let builder = prepare_request_builder();
4540    /// let response = builder.send().await?;
4541    /// # Ok(()) }
4542    ///
4543    /// fn prepare_request_builder() -> CreateEphemeral {
4544    ///   # panic!();
4545    ///   // ... details omitted ...
4546    /// }
4547    /// ```
4548    #[derive(Clone, Debug)]
4549    pub struct CreateEphemeral(
4550        RequestBuilder<crate::model::SqlInstancesCreateEphemeralCertRequest>,
4551    );
4552
4553    impl CreateEphemeral {
4554        pub(crate) fn new(
4555            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4556        ) -> Self {
4557            Self(RequestBuilder::new(stub))
4558        }
4559
4560        /// Sets the full request, replacing any prior values.
4561        pub fn with_request<V: Into<crate::model::SqlInstancesCreateEphemeralCertRequest>>(
4562            mut self,
4563            v: V,
4564        ) -> Self {
4565            self.0.request = v.into();
4566            self
4567        }
4568
4569        /// Sets all the options, replacing any prior values.
4570        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4571            self.0.options = v.into();
4572            self
4573        }
4574
4575        /// Sends the request.
4576        pub async fn send(self) -> Result<crate::model::SslCert> {
4577            (*self.0.stub)
4578                .create_ephemeral(self.0.request, self.0.options)
4579                .await
4580                .map(crate::Response::into_body)
4581        }
4582
4583        /// Sets the value of [instance][crate::model::SqlInstancesCreateEphemeralCertRequest::instance].
4584        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4585            self.0.request.instance = v.into();
4586            self
4587        }
4588
4589        /// Sets the value of [project][crate::model::SqlInstancesCreateEphemeralCertRequest::project].
4590        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4591            self.0.request.project = v.into();
4592            self
4593        }
4594
4595        /// Sets the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
4596        pub fn set_body<T>(mut self, v: T) -> Self
4597        where
4598            T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
4599        {
4600            self.0.request.body = std::option::Option::Some(v.into());
4601            self
4602        }
4603
4604        /// Sets or clears the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
4605        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4606        where
4607            T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
4608        {
4609            self.0.request.body = v.map(|x| x.into());
4610            self
4611        }
4612    }
4613
4614    #[doc(hidden)]
4615    impl crate::RequestBuilder for CreateEphemeral {
4616        fn request_options(&mut self) -> &mut crate::RequestOptions {
4617            &mut self.0.options
4618        }
4619    }
4620
4621    /// The request builder for [SqlInstancesService::reschedule_maintenance][crate::client::SqlInstancesService::reschedule_maintenance] calls.
4622    ///
4623    /// # Example
4624    /// ```
4625    /// # use google_cloud_sql_v1::builder::sql_instances_service::RescheduleMaintenance;
4626    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
4627    ///
4628    /// let builder = prepare_request_builder();
4629    /// let response = builder.send().await?;
4630    /// # Ok(()) }
4631    ///
4632    /// fn prepare_request_builder() -> RescheduleMaintenance {
4633    ///   # panic!();
4634    ///   // ... details omitted ...
4635    /// }
4636    /// ```
4637    #[derive(Clone, Debug)]
4638    pub struct RescheduleMaintenance(
4639        RequestBuilder<crate::model::SqlInstancesRescheduleMaintenanceRequest>,
4640    );
4641
4642    impl RescheduleMaintenance {
4643        pub(crate) fn new(
4644            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4645        ) -> Self {
4646            Self(RequestBuilder::new(stub))
4647        }
4648
4649        /// Sets the full request, replacing any prior values.
4650        pub fn with_request<V: Into<crate::model::SqlInstancesRescheduleMaintenanceRequest>>(
4651            mut self,
4652            v: V,
4653        ) -> Self {
4654            self.0.request = v.into();
4655            self
4656        }
4657
4658        /// Sets all the options, replacing any prior values.
4659        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4660            self.0.options = v.into();
4661            self
4662        }
4663
4664        /// Sends the request.
4665        pub async fn send(self) -> Result<crate::model::Operation> {
4666            (*self.0.stub)
4667                .reschedule_maintenance(self.0.request, self.0.options)
4668                .await
4669                .map(crate::Response::into_body)
4670        }
4671
4672        /// Sets the value of [instance][crate::model::SqlInstancesRescheduleMaintenanceRequest::instance].
4673        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4674            self.0.request.instance = v.into();
4675            self
4676        }
4677
4678        /// Sets the value of [project][crate::model::SqlInstancesRescheduleMaintenanceRequest::project].
4679        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4680            self.0.request.project = v.into();
4681            self
4682        }
4683
4684        /// Sets the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
4685        pub fn set_body<T>(mut self, v: T) -> Self
4686        where
4687            T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4688        {
4689            self.0.request.body = std::option::Option::Some(v.into());
4690            self
4691        }
4692
4693        /// Sets or clears the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
4694        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4695        where
4696            T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4697        {
4698            self.0.request.body = v.map(|x| x.into());
4699            self
4700        }
4701    }
4702
4703    #[doc(hidden)]
4704    impl crate::RequestBuilder for RescheduleMaintenance {
4705        fn request_options(&mut self) -> &mut crate::RequestOptions {
4706            &mut self.0.options
4707        }
4708    }
4709
4710    /// The request builder for [SqlInstancesService::verify_external_sync_settings][crate::client::SqlInstancesService::verify_external_sync_settings] calls.
4711    ///
4712    /// # Example
4713    /// ```
4714    /// # use google_cloud_sql_v1::builder::sql_instances_service::VerifyExternalSyncSettings;
4715    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
4716    ///
4717    /// let builder = prepare_request_builder();
4718    /// let response = builder.send().await?;
4719    /// # Ok(()) }
4720    ///
4721    /// fn prepare_request_builder() -> VerifyExternalSyncSettings {
4722    ///   # panic!();
4723    ///   // ... details omitted ...
4724    /// }
4725    /// ```
4726    #[derive(Clone, Debug)]
4727    pub struct VerifyExternalSyncSettings(
4728        RequestBuilder<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
4729    );
4730
4731    impl VerifyExternalSyncSettings {
4732        pub(crate) fn new(
4733            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4734        ) -> Self {
4735            Self(RequestBuilder::new(stub))
4736        }
4737
4738        /// Sets the full request, replacing any prior values.
4739        pub fn with_request<
4740            V: Into<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
4741        >(
4742            mut self,
4743            v: V,
4744        ) -> Self {
4745            self.0.request = v.into();
4746            self
4747        }
4748
4749        /// Sets all the options, replacing any prior values.
4750        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4751            self.0.options = v.into();
4752            self
4753        }
4754
4755        /// Sends the request.
4756        pub async fn send(
4757            self,
4758        ) -> Result<crate::model::SqlInstancesVerifyExternalSyncSettingsResponse> {
4759            (*self.0.stub)
4760                .verify_external_sync_settings(self.0.request, self.0.options)
4761                .await
4762                .map(crate::Response::into_body)
4763        }
4764
4765        /// Sets the value of [instance][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::instance].
4766        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4767            self.0.request.instance = v.into();
4768            self
4769        }
4770
4771        /// Sets the value of [project][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::project].
4772        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4773            self.0.request.project = v.into();
4774            self
4775        }
4776
4777        /// Sets the value of [verify_connection_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_connection_only].
4778        pub fn set_verify_connection_only<T: Into<bool>>(mut self, v: T) -> Self {
4779            self.0.request.verify_connection_only = v.into();
4780            self
4781        }
4782
4783        /// Sets the value of [sync_mode][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_mode].
4784        pub fn set_sync_mode<
4785            T: Into<
4786                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
4787            >,
4788        >(
4789            mut self,
4790            v: T,
4791        ) -> Self {
4792            self.0.request.sync_mode = v.into();
4793            self
4794        }
4795
4796        /// Sets the value of [verify_replication_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_replication_only].
4797        pub fn set_verify_replication_only<T: Into<bool>>(mut self, v: T) -> Self {
4798            self.0.request.verify_replication_only = v.into();
4799            self
4800        }
4801
4802        /// Sets the value of [migration_type][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::migration_type].
4803        pub fn set_migration_type<
4804            T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
4805        >(
4806            mut self,
4807            v: T,
4808        ) -> Self {
4809            self.0.request.migration_type = v.into();
4810            self
4811        }
4812
4813        /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_parallel_level].
4814        pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
4815            mut self,
4816            v: T,
4817        ) -> Self {
4818            self.0.request.sync_parallel_level = v.into();
4819            self
4820        }
4821
4822        /// Sets the value of [selected_objects][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::selected_objects].
4823        pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
4824        where
4825            T: std::iter::IntoIterator<Item = V>,
4826            V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
4827        {
4828            use std::iter::Iterator;
4829            self.0.request.selected_objects = v.into_iter().map(|i| i.into()).collect();
4830            self
4831        }
4832
4833        /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config].
4834        ///
4835        /// Note that all the setters affecting `sync_config` are
4836        /// mutually exclusive.
4837        pub fn set_sync_config<
4838            T: Into<
4839                Option<
4840                    crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
4841                >,
4842            >,
4843        >(
4844            mut self,
4845            v: T,
4846        ) -> Self {
4847            self.0.request.sync_config = v.into();
4848            self
4849        }
4850
4851        /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
4852        /// to hold a `MysqlSyncConfig`.
4853        ///
4854        /// Note that all the setters affecting `sync_config` are
4855        /// mutually exclusive.
4856        pub fn set_mysql_sync_config<
4857            T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
4858        >(
4859            mut self,
4860            v: T,
4861        ) -> Self {
4862            self.0.request = self.0.request.set_mysql_sync_config(v);
4863            self
4864        }
4865    }
4866
4867    #[doc(hidden)]
4868    impl crate::RequestBuilder for VerifyExternalSyncSettings {
4869        fn request_options(&mut self) -> &mut crate::RequestOptions {
4870            &mut self.0.options
4871        }
4872    }
4873
4874    /// The request builder for [SqlInstancesService::start_external_sync][crate::client::SqlInstancesService::start_external_sync] calls.
4875    ///
4876    /// # Example
4877    /// ```
4878    /// # use google_cloud_sql_v1::builder::sql_instances_service::StartExternalSync;
4879    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
4880    ///
4881    /// let builder = prepare_request_builder();
4882    /// let response = builder.send().await?;
4883    /// # Ok(()) }
4884    ///
4885    /// fn prepare_request_builder() -> StartExternalSync {
4886    ///   # panic!();
4887    ///   // ... details omitted ...
4888    /// }
4889    /// ```
4890    #[derive(Clone, Debug)]
4891    pub struct StartExternalSync(
4892        RequestBuilder<crate::model::SqlInstancesStartExternalSyncRequest>,
4893    );
4894
4895    impl StartExternalSync {
4896        pub(crate) fn new(
4897            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4898        ) -> Self {
4899            Self(RequestBuilder::new(stub))
4900        }
4901
4902        /// Sets the full request, replacing any prior values.
4903        pub fn with_request<V: Into<crate::model::SqlInstancesStartExternalSyncRequest>>(
4904            mut self,
4905            v: V,
4906        ) -> Self {
4907            self.0.request = v.into();
4908            self
4909        }
4910
4911        /// Sets all the options, replacing any prior values.
4912        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4913            self.0.options = v.into();
4914            self
4915        }
4916
4917        /// Sends the request.
4918        pub async fn send(self) -> Result<crate::model::Operation> {
4919            (*self.0.stub)
4920                .start_external_sync(self.0.request, self.0.options)
4921                .await
4922                .map(crate::Response::into_body)
4923        }
4924
4925        /// Sets the value of [instance][crate::model::SqlInstancesStartExternalSyncRequest::instance].
4926        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4927            self.0.request.instance = v.into();
4928            self
4929        }
4930
4931        /// Sets the value of [project][crate::model::SqlInstancesStartExternalSyncRequest::project].
4932        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4933            self.0.request.project = v.into();
4934            self
4935        }
4936
4937        /// Sets the value of [sync_mode][crate::model::SqlInstancesStartExternalSyncRequest::sync_mode].
4938        pub fn set_sync_mode<
4939            T: Into<
4940                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
4941            >,
4942        >(
4943            mut self,
4944            v: T,
4945        ) -> Self {
4946            self.0.request.sync_mode = v.into();
4947            self
4948        }
4949
4950        /// Sets the value of [skip_verification][crate::model::SqlInstancesStartExternalSyncRequest::skip_verification].
4951        pub fn set_skip_verification<T: Into<bool>>(mut self, v: T) -> Self {
4952            self.0.request.skip_verification = v.into();
4953            self
4954        }
4955
4956        /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesStartExternalSyncRequest::sync_parallel_level].
4957        pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
4958            mut self,
4959            v: T,
4960        ) -> Self {
4961            self.0.request.sync_parallel_level = v.into();
4962            self
4963        }
4964
4965        /// Sets the value of [migration_type][crate::model::SqlInstancesStartExternalSyncRequest::migration_type].
4966        pub fn set_migration_type<
4967            T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
4968        >(
4969            mut self,
4970            v: T,
4971        ) -> Self {
4972            self.0.request.migration_type = v.into();
4973            self
4974        }
4975
4976        /// Sets the value of [replica_overwrite_enabled][crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled].
4977        pub fn set_replica_overwrite_enabled<T: Into<bool>>(mut self, v: T) -> Self {
4978            self.0.request.replica_overwrite_enabled = v.into();
4979            self
4980        }
4981
4982        /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config].
4983        ///
4984        /// Note that all the setters affecting `sync_config` are
4985        /// mutually exclusive.
4986        pub fn set_sync_config<
4987            T: Into<Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>>,
4988        >(
4989            mut self,
4990            v: T,
4991        ) -> Self {
4992            self.0.request.sync_config = v.into();
4993            self
4994        }
4995
4996        /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
4997        /// to hold a `MysqlSyncConfig`.
4998        ///
4999        /// Note that all the setters affecting `sync_config` are
5000        /// mutually exclusive.
5001        pub fn set_mysql_sync_config<
5002            T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
5003        >(
5004            mut self,
5005            v: T,
5006        ) -> Self {
5007            self.0.request = self.0.request.set_mysql_sync_config(v);
5008            self
5009        }
5010    }
5011
5012    #[doc(hidden)]
5013    impl crate::RequestBuilder for StartExternalSync {
5014        fn request_options(&mut self) -> &mut crate::RequestOptions {
5015            &mut self.0.options
5016        }
5017    }
5018
5019    /// The request builder for [SqlInstancesService::perform_disk_shrink][crate::client::SqlInstancesService::perform_disk_shrink] calls.
5020    ///
5021    /// # Example
5022    /// ```
5023    /// # use google_cloud_sql_v1::builder::sql_instances_service::PerformDiskShrink;
5024    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
5025    ///
5026    /// let builder = prepare_request_builder();
5027    /// let response = builder.send().await?;
5028    /// # Ok(()) }
5029    ///
5030    /// fn prepare_request_builder() -> PerformDiskShrink {
5031    ///   # panic!();
5032    ///   // ... details omitted ...
5033    /// }
5034    /// ```
5035    #[derive(Clone, Debug)]
5036    pub struct PerformDiskShrink(
5037        RequestBuilder<crate::model::SqlInstancesPerformDiskShrinkRequest>,
5038    );
5039
5040    impl PerformDiskShrink {
5041        pub(crate) fn new(
5042            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5043        ) -> Self {
5044            Self(RequestBuilder::new(stub))
5045        }
5046
5047        /// Sets the full request, replacing any prior values.
5048        pub fn with_request<V: Into<crate::model::SqlInstancesPerformDiskShrinkRequest>>(
5049            mut self,
5050            v: V,
5051        ) -> Self {
5052            self.0.request = v.into();
5053            self
5054        }
5055
5056        /// Sets all the options, replacing any prior values.
5057        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5058            self.0.options = v.into();
5059            self
5060        }
5061
5062        /// Sends the request.
5063        pub async fn send(self) -> Result<crate::model::Operation> {
5064            (*self.0.stub)
5065                .perform_disk_shrink(self.0.request, self.0.options)
5066                .await
5067                .map(crate::Response::into_body)
5068        }
5069
5070        /// Sets the value of [instance][crate::model::SqlInstancesPerformDiskShrinkRequest::instance].
5071        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5072            self.0.request.instance = v.into();
5073            self
5074        }
5075
5076        /// Sets the value of [project][crate::model::SqlInstancesPerformDiskShrinkRequest::project].
5077        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5078            self.0.request.project = v.into();
5079            self
5080        }
5081
5082        /// Sets the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
5083        pub fn set_body<T>(mut self, v: T) -> Self
5084        where
5085            T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
5086        {
5087            self.0.request.body = std::option::Option::Some(v.into());
5088            self
5089        }
5090
5091        /// Sets or clears the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
5092        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5093        where
5094            T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
5095        {
5096            self.0.request.body = v.map(|x| x.into());
5097            self
5098        }
5099    }
5100
5101    #[doc(hidden)]
5102    impl crate::RequestBuilder for PerformDiskShrink {
5103        fn request_options(&mut self) -> &mut crate::RequestOptions {
5104            &mut self.0.options
5105        }
5106    }
5107
5108    /// The request builder for [SqlInstancesService::get_disk_shrink_config][crate::client::SqlInstancesService::get_disk_shrink_config] calls.
5109    ///
5110    /// # Example
5111    /// ```
5112    /// # use google_cloud_sql_v1::builder::sql_instances_service::GetDiskShrinkConfig;
5113    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
5114    ///
5115    /// let builder = prepare_request_builder();
5116    /// let response = builder.send().await?;
5117    /// # Ok(()) }
5118    ///
5119    /// fn prepare_request_builder() -> GetDiskShrinkConfig {
5120    ///   # panic!();
5121    ///   // ... details omitted ...
5122    /// }
5123    /// ```
5124    #[derive(Clone, Debug)]
5125    pub struct GetDiskShrinkConfig(
5126        RequestBuilder<crate::model::SqlInstancesGetDiskShrinkConfigRequest>,
5127    );
5128
5129    impl GetDiskShrinkConfig {
5130        pub(crate) fn new(
5131            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5132        ) -> Self {
5133            Self(RequestBuilder::new(stub))
5134        }
5135
5136        /// Sets the full request, replacing any prior values.
5137        pub fn with_request<V: Into<crate::model::SqlInstancesGetDiskShrinkConfigRequest>>(
5138            mut self,
5139            v: V,
5140        ) -> Self {
5141            self.0.request = v.into();
5142            self
5143        }
5144
5145        /// Sets all the options, replacing any prior values.
5146        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5147            self.0.options = v.into();
5148            self
5149        }
5150
5151        /// Sends the request.
5152        pub async fn send(self) -> Result<crate::model::SqlInstancesGetDiskShrinkConfigResponse> {
5153            (*self.0.stub)
5154                .get_disk_shrink_config(self.0.request, self.0.options)
5155                .await
5156                .map(crate::Response::into_body)
5157        }
5158
5159        /// Sets the value of [instance][crate::model::SqlInstancesGetDiskShrinkConfigRequest::instance].
5160        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5161            self.0.request.instance = v.into();
5162            self
5163        }
5164
5165        /// Sets the value of [project][crate::model::SqlInstancesGetDiskShrinkConfigRequest::project].
5166        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5167            self.0.request.project = v.into();
5168            self
5169        }
5170    }
5171
5172    #[doc(hidden)]
5173    impl crate::RequestBuilder for GetDiskShrinkConfig {
5174        fn request_options(&mut self) -> &mut crate::RequestOptions {
5175            &mut self.0.options
5176        }
5177    }
5178
5179    /// The request builder for [SqlInstancesService::reset_replica_size][crate::client::SqlInstancesService::reset_replica_size] calls.
5180    ///
5181    /// # Example
5182    /// ```
5183    /// # use google_cloud_sql_v1::builder::sql_instances_service::ResetReplicaSize;
5184    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
5185    ///
5186    /// let builder = prepare_request_builder();
5187    /// let response = builder.send().await?;
5188    /// # Ok(()) }
5189    ///
5190    /// fn prepare_request_builder() -> ResetReplicaSize {
5191    ///   # panic!();
5192    ///   // ... details omitted ...
5193    /// }
5194    /// ```
5195    #[derive(Clone, Debug)]
5196    pub struct ResetReplicaSize(RequestBuilder<crate::model::SqlInstancesResetReplicaSizeRequest>);
5197
5198    impl ResetReplicaSize {
5199        pub(crate) fn new(
5200            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5201        ) -> Self {
5202            Self(RequestBuilder::new(stub))
5203        }
5204
5205        /// Sets the full request, replacing any prior values.
5206        pub fn with_request<V: Into<crate::model::SqlInstancesResetReplicaSizeRequest>>(
5207            mut self,
5208            v: V,
5209        ) -> Self {
5210            self.0.request = v.into();
5211            self
5212        }
5213
5214        /// Sets all the options, replacing any prior values.
5215        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5216            self.0.options = v.into();
5217            self
5218        }
5219
5220        /// Sends the request.
5221        pub async fn send(self) -> Result<crate::model::Operation> {
5222            (*self.0.stub)
5223                .reset_replica_size(self.0.request, self.0.options)
5224                .await
5225                .map(crate::Response::into_body)
5226        }
5227
5228        /// Sets the value of [instance][crate::model::SqlInstancesResetReplicaSizeRequest::instance].
5229        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5230            self.0.request.instance = v.into();
5231            self
5232        }
5233
5234        /// Sets the value of [project][crate::model::SqlInstancesResetReplicaSizeRequest::project].
5235        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5236            self.0.request.project = v.into();
5237            self
5238        }
5239    }
5240
5241    #[doc(hidden)]
5242    impl crate::RequestBuilder for ResetReplicaSize {
5243        fn request_options(&mut self) -> &mut crate::RequestOptions {
5244            &mut self.0.options
5245        }
5246    }
5247
5248    /// The request builder for [SqlInstancesService::get_latest_recovery_time][crate::client::SqlInstancesService::get_latest_recovery_time] calls.
5249    ///
5250    /// # Example
5251    /// ```
5252    /// # use google_cloud_sql_v1::builder::sql_instances_service::GetLatestRecoveryTime;
5253    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
5254    ///
5255    /// let builder = prepare_request_builder();
5256    /// let response = builder.send().await?;
5257    /// # Ok(()) }
5258    ///
5259    /// fn prepare_request_builder() -> GetLatestRecoveryTime {
5260    ///   # panic!();
5261    ///   // ... details omitted ...
5262    /// }
5263    /// ```
5264    #[derive(Clone, Debug)]
5265    pub struct GetLatestRecoveryTime(
5266        RequestBuilder<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>,
5267    );
5268
5269    impl GetLatestRecoveryTime {
5270        pub(crate) fn new(
5271            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5272        ) -> Self {
5273            Self(RequestBuilder::new(stub))
5274        }
5275
5276        /// Sets the full request, replacing any prior values.
5277        pub fn with_request<V: Into<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>>(
5278            mut self,
5279            v: V,
5280        ) -> Self {
5281            self.0.request = v.into();
5282            self
5283        }
5284
5285        /// Sets all the options, replacing any prior values.
5286        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5287            self.0.options = v.into();
5288            self
5289        }
5290
5291        /// Sends the request.
5292        pub async fn send(self) -> Result<crate::model::SqlInstancesGetLatestRecoveryTimeResponse> {
5293            (*self.0.stub)
5294                .get_latest_recovery_time(self.0.request, self.0.options)
5295                .await
5296                .map(crate::Response::into_body)
5297        }
5298
5299        /// Sets the value of [instance][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::instance].
5300        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5301            self.0.request.instance = v.into();
5302            self
5303        }
5304
5305        /// Sets the value of [project][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::project].
5306        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5307            self.0.request.project = v.into();
5308            self
5309        }
5310
5311        /// Sets the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
5312        pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
5313        where
5314            T: std::convert::Into<wkt::Timestamp>,
5315        {
5316            self.0.request.source_instance_deletion_time = std::option::Option::Some(v.into());
5317            self
5318        }
5319
5320        /// Sets or clears the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
5321        pub fn set_or_clear_source_instance_deletion_time<T>(
5322            mut self,
5323            v: std::option::Option<T>,
5324        ) -> Self
5325        where
5326            T: std::convert::Into<wkt::Timestamp>,
5327        {
5328            self.0.request.source_instance_deletion_time = v.map(|x| x.into());
5329            self
5330        }
5331    }
5332
5333    #[doc(hidden)]
5334    impl crate::RequestBuilder for GetLatestRecoveryTime {
5335        fn request_options(&mut self) -> &mut crate::RequestOptions {
5336            &mut self.0.options
5337        }
5338    }
5339
5340    /// The request builder for [SqlInstancesService::execute_sql][crate::client::SqlInstancesService::execute_sql] calls.
5341    ///
5342    /// # Example
5343    /// ```
5344    /// # use google_cloud_sql_v1::builder::sql_instances_service::ExecuteSql;
5345    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
5346    ///
5347    /// let builder = prepare_request_builder();
5348    /// let response = builder.send().await?;
5349    /// # Ok(()) }
5350    ///
5351    /// fn prepare_request_builder() -> ExecuteSql {
5352    ///   # panic!();
5353    ///   // ... details omitted ...
5354    /// }
5355    /// ```
5356    #[derive(Clone, Debug)]
5357    pub struct ExecuteSql(RequestBuilder<crate::model::SqlInstancesExecuteSqlRequest>);
5358
5359    impl ExecuteSql {
5360        pub(crate) fn new(
5361            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5362        ) -> Self {
5363            Self(RequestBuilder::new(stub))
5364        }
5365
5366        /// Sets the full request, replacing any prior values.
5367        pub fn with_request<V: Into<crate::model::SqlInstancesExecuteSqlRequest>>(
5368            mut self,
5369            v: V,
5370        ) -> Self {
5371            self.0.request = v.into();
5372            self
5373        }
5374
5375        /// Sets all the options, replacing any prior values.
5376        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5377            self.0.options = v.into();
5378            self
5379        }
5380
5381        /// Sends the request.
5382        pub async fn send(self) -> Result<crate::model::SqlInstancesExecuteSqlResponse> {
5383            (*self.0.stub)
5384                .execute_sql(self.0.request, self.0.options)
5385                .await
5386                .map(crate::Response::into_body)
5387        }
5388
5389        /// Sets the value of [instance][crate::model::SqlInstancesExecuteSqlRequest::instance].
5390        ///
5391        /// This is a **required** field for requests.
5392        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5393            self.0.request.instance = v.into();
5394            self
5395        }
5396
5397        /// Sets the value of [project][crate::model::SqlInstancesExecuteSqlRequest::project].
5398        ///
5399        /// This is a **required** field for requests.
5400        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5401            self.0.request.project = v.into();
5402            self
5403        }
5404
5405        /// Sets the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
5406        pub fn set_body<T>(mut self, v: T) -> Self
5407        where
5408            T: std::convert::Into<crate::model::ExecuteSqlPayload>,
5409        {
5410            self.0.request.body = std::option::Option::Some(v.into());
5411            self
5412        }
5413
5414        /// Sets or clears the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
5415        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5416        where
5417            T: std::convert::Into<crate::model::ExecuteSqlPayload>,
5418        {
5419            self.0.request.body = v.map(|x| x.into());
5420            self
5421        }
5422    }
5423
5424    #[doc(hidden)]
5425    impl crate::RequestBuilder for ExecuteSql {
5426        fn request_options(&mut self) -> &mut crate::RequestOptions {
5427            &mut self.0.options
5428        }
5429    }
5430
5431    /// The request builder for [SqlInstancesService::acquire_ssrs_lease][crate::client::SqlInstancesService::acquire_ssrs_lease] calls.
5432    ///
5433    /// # Example
5434    /// ```
5435    /// # use google_cloud_sql_v1::builder::sql_instances_service::AcquireSsrsLease;
5436    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
5437    ///
5438    /// let builder = prepare_request_builder();
5439    /// let response = builder.send().await?;
5440    /// # Ok(()) }
5441    ///
5442    /// fn prepare_request_builder() -> AcquireSsrsLease {
5443    ///   # panic!();
5444    ///   // ... details omitted ...
5445    /// }
5446    /// ```
5447    #[derive(Clone, Debug)]
5448    pub struct AcquireSsrsLease(RequestBuilder<crate::model::SqlInstancesAcquireSsrsLeaseRequest>);
5449
5450    impl AcquireSsrsLease {
5451        pub(crate) fn new(
5452            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5453        ) -> Self {
5454            Self(RequestBuilder::new(stub))
5455        }
5456
5457        /// Sets the full request, replacing any prior values.
5458        pub fn with_request<V: Into<crate::model::SqlInstancesAcquireSsrsLeaseRequest>>(
5459            mut self,
5460            v: V,
5461        ) -> Self {
5462            self.0.request = v.into();
5463            self
5464        }
5465
5466        /// Sets all the options, replacing any prior values.
5467        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5468            self.0.options = v.into();
5469            self
5470        }
5471
5472        /// Sends the request.
5473        pub async fn send(self) -> Result<crate::model::SqlInstancesAcquireSsrsLeaseResponse> {
5474            (*self.0.stub)
5475                .acquire_ssrs_lease(self.0.request, self.0.options)
5476                .await
5477                .map(crate::Response::into_body)
5478        }
5479
5480        /// Sets the value of [instance][crate::model::SqlInstancesAcquireSsrsLeaseRequest::instance].
5481        ///
5482        /// This is a **required** field for requests.
5483        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5484            self.0.request.instance = v.into();
5485            self
5486        }
5487
5488        /// Sets the value of [project][crate::model::SqlInstancesAcquireSsrsLeaseRequest::project].
5489        ///
5490        /// This is a **required** field for requests.
5491        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5492            self.0.request.project = v.into();
5493            self
5494        }
5495
5496        /// Sets the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
5497        ///
5498        /// This is a **required** field for requests.
5499        pub fn set_body<T>(mut self, v: T) -> Self
5500        where
5501            T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
5502        {
5503            self.0.request.body = std::option::Option::Some(v.into());
5504            self
5505        }
5506
5507        /// Sets or clears the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
5508        ///
5509        /// This is a **required** field for requests.
5510        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5511        where
5512            T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
5513        {
5514            self.0.request.body = v.map(|x| x.into());
5515            self
5516        }
5517    }
5518
5519    #[doc(hidden)]
5520    impl crate::RequestBuilder for AcquireSsrsLease {
5521        fn request_options(&mut self) -> &mut crate::RequestOptions {
5522            &mut self.0.options
5523        }
5524    }
5525
5526    /// The request builder for [SqlInstancesService::release_ssrs_lease][crate::client::SqlInstancesService::release_ssrs_lease] calls.
5527    ///
5528    /// # Example
5529    /// ```
5530    /// # use google_cloud_sql_v1::builder::sql_instances_service::ReleaseSsrsLease;
5531    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
5532    ///
5533    /// let builder = prepare_request_builder();
5534    /// let response = builder.send().await?;
5535    /// # Ok(()) }
5536    ///
5537    /// fn prepare_request_builder() -> ReleaseSsrsLease {
5538    ///   # panic!();
5539    ///   // ... details omitted ...
5540    /// }
5541    /// ```
5542    #[derive(Clone, Debug)]
5543    pub struct ReleaseSsrsLease(RequestBuilder<crate::model::SqlInstancesReleaseSsrsLeaseRequest>);
5544
5545    impl ReleaseSsrsLease {
5546        pub(crate) fn new(
5547            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5548        ) -> Self {
5549            Self(RequestBuilder::new(stub))
5550        }
5551
5552        /// Sets the full request, replacing any prior values.
5553        pub fn with_request<V: Into<crate::model::SqlInstancesReleaseSsrsLeaseRequest>>(
5554            mut self,
5555            v: V,
5556        ) -> Self {
5557            self.0.request = v.into();
5558            self
5559        }
5560
5561        /// Sets all the options, replacing any prior values.
5562        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5563            self.0.options = v.into();
5564            self
5565        }
5566
5567        /// Sends the request.
5568        pub async fn send(self) -> Result<crate::model::SqlInstancesReleaseSsrsLeaseResponse> {
5569            (*self.0.stub)
5570                .release_ssrs_lease(self.0.request, self.0.options)
5571                .await
5572                .map(crate::Response::into_body)
5573        }
5574
5575        /// Sets the value of [instance][crate::model::SqlInstancesReleaseSsrsLeaseRequest::instance].
5576        ///
5577        /// This is a **required** field for requests.
5578        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5579            self.0.request.instance = v.into();
5580            self
5581        }
5582
5583        /// Sets the value of [project][crate::model::SqlInstancesReleaseSsrsLeaseRequest::project].
5584        ///
5585        /// This is a **required** field for requests.
5586        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5587            self.0.request.project = v.into();
5588            self
5589        }
5590    }
5591
5592    #[doc(hidden)]
5593    impl crate::RequestBuilder for ReleaseSsrsLease {
5594        fn request_options(&mut self) -> &mut crate::RequestOptions {
5595            &mut self.0.options
5596        }
5597    }
5598
5599    /// The request builder for [SqlInstancesService::pre_check_major_version_upgrade][crate::client::SqlInstancesService::pre_check_major_version_upgrade] calls.
5600    ///
5601    /// # Example
5602    /// ```
5603    /// # use google_cloud_sql_v1::builder::sql_instances_service::PreCheckMajorVersionUpgrade;
5604    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
5605    ///
5606    /// let builder = prepare_request_builder();
5607    /// let response = builder.send().await?;
5608    /// # Ok(()) }
5609    ///
5610    /// fn prepare_request_builder() -> PreCheckMajorVersionUpgrade {
5611    ///   # panic!();
5612    ///   // ... details omitted ...
5613    /// }
5614    /// ```
5615    #[derive(Clone, Debug)]
5616    pub struct PreCheckMajorVersionUpgrade(
5617        RequestBuilder<crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest>,
5618    );
5619
5620    impl PreCheckMajorVersionUpgrade {
5621        pub(crate) fn new(
5622            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5623        ) -> Self {
5624            Self(RequestBuilder::new(stub))
5625        }
5626
5627        /// Sets the full request, replacing any prior values.
5628        pub fn with_request<
5629            V: Into<crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest>,
5630        >(
5631            mut self,
5632            v: V,
5633        ) -> Self {
5634            self.0.request = v.into();
5635            self
5636        }
5637
5638        /// Sets all the options, replacing any prior values.
5639        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5640            self.0.options = v.into();
5641            self
5642        }
5643
5644        /// Sends the request.
5645        pub async fn send(self) -> Result<crate::model::Operation> {
5646            (*self.0.stub)
5647                .pre_check_major_version_upgrade(self.0.request, self.0.options)
5648                .await
5649                .map(crate::Response::into_body)
5650        }
5651
5652        /// Sets the value of [instance][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::instance].
5653        ///
5654        /// This is a **required** field for requests.
5655        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5656            self.0.request.instance = v.into();
5657            self
5658        }
5659
5660        /// Sets the value of [project][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::project].
5661        ///
5662        /// This is a **required** field for requests.
5663        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5664            self.0.request.project = v.into();
5665            self
5666        }
5667
5668        /// Sets the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
5669        ///
5670        /// This is a **required** field for requests.
5671        pub fn set_body<T>(mut self, v: T) -> Self
5672        where
5673            T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
5674        {
5675            self.0.request.body = std::option::Option::Some(v.into());
5676            self
5677        }
5678
5679        /// Sets or clears the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
5680        ///
5681        /// This is a **required** field for requests.
5682        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5683        where
5684            T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
5685        {
5686            self.0.request.body = v.map(|x| x.into());
5687            self
5688        }
5689    }
5690
5691    #[doc(hidden)]
5692    impl crate::RequestBuilder for PreCheckMajorVersionUpgrade {
5693        fn request_options(&mut self) -> &mut crate::RequestOptions {
5694            &mut self.0.options
5695        }
5696    }
5697
5698    /// The request builder for [SqlInstancesService::point_in_time_restore][crate::client::SqlInstancesService::point_in_time_restore] calls.
5699    ///
5700    /// # Example
5701    /// ```
5702    /// # use google_cloud_sql_v1::builder::sql_instances_service::PointInTimeRestore;
5703    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
5704    ///
5705    /// let builder = prepare_request_builder();
5706    /// let response = builder.send().await?;
5707    /// # Ok(()) }
5708    ///
5709    /// fn prepare_request_builder() -> PointInTimeRestore {
5710    ///   # panic!();
5711    ///   // ... details omitted ...
5712    /// }
5713    /// ```
5714    #[derive(Clone, Debug)]
5715    pub struct PointInTimeRestore(
5716        RequestBuilder<crate::model::SqlInstancesPointInTimeRestoreRequest>,
5717    );
5718
5719    impl PointInTimeRestore {
5720        pub(crate) fn new(
5721            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
5722        ) -> Self {
5723            Self(RequestBuilder::new(stub))
5724        }
5725
5726        /// Sets the full request, replacing any prior values.
5727        pub fn with_request<V: Into<crate::model::SqlInstancesPointInTimeRestoreRequest>>(
5728            mut self,
5729            v: V,
5730        ) -> Self {
5731            self.0.request = v.into();
5732            self
5733        }
5734
5735        /// Sets all the options, replacing any prior values.
5736        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5737            self.0.options = v.into();
5738            self
5739        }
5740
5741        /// Sends the request.
5742        pub async fn send(self) -> Result<crate::model::Operation> {
5743            (*self.0.stub)
5744                .point_in_time_restore(self.0.request, self.0.options)
5745                .await
5746                .map(crate::Response::into_body)
5747        }
5748
5749        /// Sets the value of [parent][crate::model::SqlInstancesPointInTimeRestoreRequest::parent].
5750        ///
5751        /// This is a **required** field for requests.
5752        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5753            self.0.request.parent = v.into();
5754            self
5755        }
5756
5757        /// Sets the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
5758        ///
5759        /// This is a **required** field for requests.
5760        pub fn set_context<T>(mut self, v: T) -> Self
5761        where
5762            T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
5763        {
5764            self.0.request.context = std::option::Option::Some(v.into());
5765            self
5766        }
5767
5768        /// Sets or clears the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
5769        ///
5770        /// This is a **required** field for requests.
5771        pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
5772        where
5773            T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
5774        {
5775            self.0.request.context = v.map(|x| x.into());
5776            self
5777        }
5778    }
5779
5780    #[doc(hidden)]
5781    impl crate::RequestBuilder for PointInTimeRestore {
5782        fn request_options(&mut self) -> &mut crate::RequestOptions {
5783            &mut self.0.options
5784        }
5785    }
5786}
5787
5788/// Request and client builders for [SqlOperationsService][crate::client::SqlOperationsService].
5789pub mod sql_operations_service {
5790    use crate::Result;
5791
5792    /// A builder for [SqlOperationsService][crate::client::SqlOperationsService].
5793    ///
5794    /// ```
5795    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5796    /// # use google_cloud_sql_v1::*;
5797    /// # use builder::sql_operations_service::ClientBuilder;
5798    /// # use client::SqlOperationsService;
5799    /// let builder : ClientBuilder = SqlOperationsService::builder();
5800    /// let client = builder
5801    ///     .with_endpoint("https://sqladmin.googleapis.com")
5802    ///     .build().await?;
5803    /// # Ok(()) }
5804    /// ```
5805    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5806
5807    pub(crate) mod client {
5808        use super::super::super::client::SqlOperationsService;
5809        pub struct Factory;
5810        impl crate::ClientFactory for Factory {
5811            type Client = SqlOperationsService;
5812            type Credentials = gaxi::options::Credentials;
5813            async fn build(
5814                self,
5815                config: gaxi::options::ClientConfig,
5816            ) -> crate::ClientBuilderResult<Self::Client> {
5817                Self::Client::new(config).await
5818            }
5819        }
5820    }
5821
5822    /// Common implementation for [crate::client::SqlOperationsService] request builders.
5823    #[derive(Clone, Debug)]
5824    pub(crate) struct RequestBuilder<R: std::default::Default> {
5825        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5826        request: R,
5827        options: crate::RequestOptions,
5828    }
5829
5830    impl<R> RequestBuilder<R>
5831    where
5832        R: std::default::Default,
5833    {
5834        pub(crate) fn new(
5835            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5836        ) -> Self {
5837            Self {
5838                stub,
5839                request: R::default(),
5840                options: crate::RequestOptions::default(),
5841            }
5842        }
5843    }
5844
5845    /// The request builder for [SqlOperationsService::get][crate::client::SqlOperationsService::get] calls.
5846    ///
5847    /// # Example
5848    /// ```
5849    /// # use google_cloud_sql_v1::builder::sql_operations_service::Get;
5850    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
5851    ///
5852    /// let builder = prepare_request_builder();
5853    /// let response = builder.send().await?;
5854    /// # Ok(()) }
5855    ///
5856    /// fn prepare_request_builder() -> Get {
5857    ///   # panic!();
5858    ///   // ... details omitted ...
5859    /// }
5860    /// ```
5861    #[derive(Clone, Debug)]
5862    pub struct Get(RequestBuilder<crate::model::SqlOperationsGetRequest>);
5863
5864    impl Get {
5865        pub(crate) fn new(
5866            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5867        ) -> Self {
5868            Self(RequestBuilder::new(stub))
5869        }
5870
5871        /// Sets the full request, replacing any prior values.
5872        pub fn with_request<V: Into<crate::model::SqlOperationsGetRequest>>(
5873            mut self,
5874            v: V,
5875        ) -> Self {
5876            self.0.request = v.into();
5877            self
5878        }
5879
5880        /// Sets all the options, replacing any prior values.
5881        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5882            self.0.options = v.into();
5883            self
5884        }
5885
5886        /// Sends the request.
5887        pub async fn send(self) -> Result<crate::model::Operation> {
5888            (*self.0.stub)
5889                .get(self.0.request, self.0.options)
5890                .await
5891                .map(crate::Response::into_body)
5892        }
5893
5894        /// Sets the value of [operation][crate::model::SqlOperationsGetRequest::operation].
5895        ///
5896        /// This is a **required** field for requests.
5897        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
5898            self.0.request.operation = v.into();
5899            self
5900        }
5901
5902        /// Sets the value of [project][crate::model::SqlOperationsGetRequest::project].
5903        ///
5904        /// This is a **required** field for requests.
5905        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5906            self.0.request.project = v.into();
5907            self
5908        }
5909    }
5910
5911    #[doc(hidden)]
5912    impl crate::RequestBuilder for Get {
5913        fn request_options(&mut self) -> &mut crate::RequestOptions {
5914            &mut self.0.options
5915        }
5916    }
5917
5918    /// The request builder for [SqlOperationsService::list][crate::client::SqlOperationsService::list] calls.
5919    ///
5920    /// # Example
5921    /// ```
5922    /// # use google_cloud_sql_v1::builder::sql_operations_service::List;
5923    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
5924    /// use google_cloud_gax::paginator::ItemPaginator;
5925    ///
5926    /// let builder = prepare_request_builder();
5927    /// let mut items = builder.by_item();
5928    /// while let Some(result) = items.next().await {
5929    ///   let item = result?;
5930    /// }
5931    /// # Ok(()) }
5932    ///
5933    /// fn prepare_request_builder() -> List {
5934    ///   # panic!();
5935    ///   // ... details omitted ...
5936    /// }
5937    /// ```
5938    #[derive(Clone, Debug)]
5939    pub struct List(RequestBuilder<crate::model::SqlOperationsListRequest>);
5940
5941    impl List {
5942        pub(crate) fn new(
5943            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5944        ) -> Self {
5945            Self(RequestBuilder::new(stub))
5946        }
5947
5948        /// Sets the full request, replacing any prior values.
5949        pub fn with_request<V: Into<crate::model::SqlOperationsListRequest>>(
5950            mut self,
5951            v: V,
5952        ) -> Self {
5953            self.0.request = v.into();
5954            self
5955        }
5956
5957        /// Sets all the options, replacing any prior values.
5958        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5959            self.0.options = v.into();
5960            self
5961        }
5962
5963        /// Sends the request.
5964        pub async fn send(self) -> Result<crate::model::OperationsListResponse> {
5965            (*self.0.stub)
5966                .list(self.0.request, self.0.options)
5967                .await
5968                .map(crate::Response::into_body)
5969        }
5970
5971        /// Streams each page in the collection.
5972        pub fn by_page(
5973            self,
5974        ) -> impl google_cloud_gax::paginator::Paginator<
5975            crate::model::OperationsListResponse,
5976            crate::Error,
5977        > {
5978            use std::clone::Clone;
5979            let token = self.0.request.page_token.clone();
5980            let execute = move |token: String| {
5981                let mut builder = self.clone();
5982                builder.0.request = builder.0.request.set_page_token(token);
5983                builder.send()
5984            };
5985            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5986        }
5987
5988        /// Streams each item in the collection.
5989        pub fn by_item(
5990            self,
5991        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5992            crate::model::OperationsListResponse,
5993            crate::Error,
5994        > {
5995            use google_cloud_gax::paginator::Paginator;
5996            self.by_page().items()
5997        }
5998
5999        /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
6000        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6001            self.0.request.instance = v.into();
6002            self
6003        }
6004
6005        /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
6006        pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
6007            self.0.request.max_results = v.into();
6008            self
6009        }
6010
6011        /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
6012        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6013            self.0.request.page_token = v.into();
6014            self
6015        }
6016
6017        /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
6018        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6019            self.0.request.project = v.into();
6020            self
6021        }
6022    }
6023
6024    #[doc(hidden)]
6025    impl crate::RequestBuilder for List {
6026        fn request_options(&mut self) -> &mut crate::RequestOptions {
6027            &mut self.0.options
6028        }
6029    }
6030
6031    /// The request builder for [SqlOperationsService::cancel][crate::client::SqlOperationsService::cancel] calls.
6032    ///
6033    /// # Example
6034    /// ```
6035    /// # use google_cloud_sql_v1::builder::sql_operations_service::Cancel;
6036    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6037    ///
6038    /// let builder = prepare_request_builder();
6039    /// let response = builder.send().await?;
6040    /// # Ok(()) }
6041    ///
6042    /// fn prepare_request_builder() -> Cancel {
6043    ///   # panic!();
6044    ///   // ... details omitted ...
6045    /// }
6046    /// ```
6047    #[derive(Clone, Debug)]
6048    pub struct Cancel(RequestBuilder<crate::model::SqlOperationsCancelRequest>);
6049
6050    impl Cancel {
6051        pub(crate) fn new(
6052            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
6053        ) -> Self {
6054            Self(RequestBuilder::new(stub))
6055        }
6056
6057        /// Sets the full request, replacing any prior values.
6058        pub fn with_request<V: Into<crate::model::SqlOperationsCancelRequest>>(
6059            mut self,
6060            v: V,
6061        ) -> Self {
6062            self.0.request = v.into();
6063            self
6064        }
6065
6066        /// Sets all the options, replacing any prior values.
6067        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6068            self.0.options = v.into();
6069            self
6070        }
6071
6072        /// Sends the request.
6073        pub async fn send(self) -> Result<()> {
6074            (*self.0.stub)
6075                .cancel(self.0.request, self.0.options)
6076                .await
6077                .map(crate::Response::into_body)
6078        }
6079
6080        /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
6081        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
6082            self.0.request.operation = v.into();
6083            self
6084        }
6085
6086        /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
6087        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6088            self.0.request.project = v.into();
6089            self
6090        }
6091    }
6092
6093    #[doc(hidden)]
6094    impl crate::RequestBuilder for Cancel {
6095        fn request_options(&mut self) -> &mut crate::RequestOptions {
6096            &mut self.0.options
6097        }
6098    }
6099}
6100
6101/// Request and client builders for [SqlSslCertsService][crate::client::SqlSslCertsService].
6102pub mod sql_ssl_certs_service {
6103    use crate::Result;
6104
6105    /// A builder for [SqlSslCertsService][crate::client::SqlSslCertsService].
6106    ///
6107    /// ```
6108    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6109    /// # use google_cloud_sql_v1::*;
6110    /// # use builder::sql_ssl_certs_service::ClientBuilder;
6111    /// # use client::SqlSslCertsService;
6112    /// let builder : ClientBuilder = SqlSslCertsService::builder();
6113    /// let client = builder
6114    ///     .with_endpoint("https://sqladmin.googleapis.com")
6115    ///     .build().await?;
6116    /// # Ok(()) }
6117    /// ```
6118    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6119
6120    pub(crate) mod client {
6121        use super::super::super::client::SqlSslCertsService;
6122        pub struct Factory;
6123        impl crate::ClientFactory for Factory {
6124            type Client = SqlSslCertsService;
6125            type Credentials = gaxi::options::Credentials;
6126            async fn build(
6127                self,
6128                config: gaxi::options::ClientConfig,
6129            ) -> crate::ClientBuilderResult<Self::Client> {
6130                Self::Client::new(config).await
6131            }
6132        }
6133    }
6134
6135    /// Common implementation for [crate::client::SqlSslCertsService] request builders.
6136    #[derive(Clone, Debug)]
6137    pub(crate) struct RequestBuilder<R: std::default::Default> {
6138        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6139        request: R,
6140        options: crate::RequestOptions,
6141    }
6142
6143    impl<R> RequestBuilder<R>
6144    where
6145        R: std::default::Default,
6146    {
6147        pub(crate) fn new(
6148            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6149        ) -> Self {
6150            Self {
6151                stub,
6152                request: R::default(),
6153                options: crate::RequestOptions::default(),
6154            }
6155        }
6156    }
6157
6158    /// The request builder for [SqlSslCertsService::delete][crate::client::SqlSslCertsService::delete] calls.
6159    ///
6160    /// # Example
6161    /// ```
6162    /// # use google_cloud_sql_v1::builder::sql_ssl_certs_service::Delete;
6163    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6164    ///
6165    /// let builder = prepare_request_builder();
6166    /// let response = builder.send().await?;
6167    /// # Ok(()) }
6168    ///
6169    /// fn prepare_request_builder() -> Delete {
6170    ///   # panic!();
6171    ///   // ... details omitted ...
6172    /// }
6173    /// ```
6174    #[derive(Clone, Debug)]
6175    pub struct Delete(RequestBuilder<crate::model::SqlSslCertsDeleteRequest>);
6176
6177    impl Delete {
6178        pub(crate) fn new(
6179            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6180        ) -> Self {
6181            Self(RequestBuilder::new(stub))
6182        }
6183
6184        /// Sets the full request, replacing any prior values.
6185        pub fn with_request<V: Into<crate::model::SqlSslCertsDeleteRequest>>(
6186            mut self,
6187            v: V,
6188        ) -> Self {
6189            self.0.request = v.into();
6190            self
6191        }
6192
6193        /// Sets all the options, replacing any prior values.
6194        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6195            self.0.options = v.into();
6196            self
6197        }
6198
6199        /// Sends the request.
6200        pub async fn send(self) -> Result<crate::model::Operation> {
6201            (*self.0.stub)
6202                .delete(self.0.request, self.0.options)
6203                .await
6204                .map(crate::Response::into_body)
6205        }
6206
6207        /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
6208        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6209            self.0.request.instance = v.into();
6210            self
6211        }
6212
6213        /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
6214        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6215            self.0.request.project = v.into();
6216            self
6217        }
6218
6219        /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
6220        pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6221            self.0.request.sha1_fingerprint = v.into();
6222            self
6223        }
6224    }
6225
6226    #[doc(hidden)]
6227    impl crate::RequestBuilder for Delete {
6228        fn request_options(&mut self) -> &mut crate::RequestOptions {
6229            &mut self.0.options
6230        }
6231    }
6232
6233    /// The request builder for [SqlSslCertsService::get][crate::client::SqlSslCertsService::get] calls.
6234    ///
6235    /// # Example
6236    /// ```
6237    /// # use google_cloud_sql_v1::builder::sql_ssl_certs_service::Get;
6238    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6239    ///
6240    /// let builder = prepare_request_builder();
6241    /// let response = builder.send().await?;
6242    /// # Ok(()) }
6243    ///
6244    /// fn prepare_request_builder() -> Get {
6245    ///   # panic!();
6246    ///   // ... details omitted ...
6247    /// }
6248    /// ```
6249    #[derive(Clone, Debug)]
6250    pub struct Get(RequestBuilder<crate::model::SqlSslCertsGetRequest>);
6251
6252    impl Get {
6253        pub(crate) fn new(
6254            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6255        ) -> Self {
6256            Self(RequestBuilder::new(stub))
6257        }
6258
6259        /// Sets the full request, replacing any prior values.
6260        pub fn with_request<V: Into<crate::model::SqlSslCertsGetRequest>>(mut self, v: V) -> Self {
6261            self.0.request = v.into();
6262            self
6263        }
6264
6265        /// Sets all the options, replacing any prior values.
6266        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6267            self.0.options = v.into();
6268            self
6269        }
6270
6271        /// Sends the request.
6272        pub async fn send(self) -> Result<crate::model::SslCert> {
6273            (*self.0.stub)
6274                .get(self.0.request, self.0.options)
6275                .await
6276                .map(crate::Response::into_body)
6277        }
6278
6279        /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
6280        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6281            self.0.request.instance = v.into();
6282            self
6283        }
6284
6285        /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
6286        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6287            self.0.request.project = v.into();
6288            self
6289        }
6290
6291        /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
6292        pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6293            self.0.request.sha1_fingerprint = v.into();
6294            self
6295        }
6296    }
6297
6298    #[doc(hidden)]
6299    impl crate::RequestBuilder for Get {
6300        fn request_options(&mut self) -> &mut crate::RequestOptions {
6301            &mut self.0.options
6302        }
6303    }
6304
6305    /// The request builder for [SqlSslCertsService::insert][crate::client::SqlSslCertsService::insert] calls.
6306    ///
6307    /// # Example
6308    /// ```
6309    /// # use google_cloud_sql_v1::builder::sql_ssl_certs_service::Insert;
6310    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6311    ///
6312    /// let builder = prepare_request_builder();
6313    /// let response = builder.send().await?;
6314    /// # Ok(()) }
6315    ///
6316    /// fn prepare_request_builder() -> Insert {
6317    ///   # panic!();
6318    ///   // ... details omitted ...
6319    /// }
6320    /// ```
6321    #[derive(Clone, Debug)]
6322    pub struct Insert(RequestBuilder<crate::model::SqlSslCertsInsertRequest>);
6323
6324    impl Insert {
6325        pub(crate) fn new(
6326            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6327        ) -> Self {
6328            Self(RequestBuilder::new(stub))
6329        }
6330
6331        /// Sets the full request, replacing any prior values.
6332        pub fn with_request<V: Into<crate::model::SqlSslCertsInsertRequest>>(
6333            mut self,
6334            v: V,
6335        ) -> Self {
6336            self.0.request = v.into();
6337            self
6338        }
6339
6340        /// Sets all the options, replacing any prior values.
6341        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6342            self.0.options = v.into();
6343            self
6344        }
6345
6346        /// Sends the request.
6347        pub async fn send(self) -> Result<crate::model::SslCertsInsertResponse> {
6348            (*self.0.stub)
6349                .insert(self.0.request, self.0.options)
6350                .await
6351                .map(crate::Response::into_body)
6352        }
6353
6354        /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
6355        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6356            self.0.request.instance = v.into();
6357            self
6358        }
6359
6360        /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
6361        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6362            self.0.request.project = v.into();
6363            self
6364        }
6365
6366        /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
6367        pub fn set_body<T>(mut self, v: T) -> Self
6368        where
6369            T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6370        {
6371            self.0.request.body = std::option::Option::Some(v.into());
6372            self
6373        }
6374
6375        /// Sets or clears the value of [body][crate::model::SqlSslCertsInsertRequest::body].
6376        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6377        where
6378            T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6379        {
6380            self.0.request.body = v.map(|x| x.into());
6381            self
6382        }
6383    }
6384
6385    #[doc(hidden)]
6386    impl crate::RequestBuilder for Insert {
6387        fn request_options(&mut self) -> &mut crate::RequestOptions {
6388            &mut self.0.options
6389        }
6390    }
6391
6392    /// The request builder for [SqlSslCertsService::list][crate::client::SqlSslCertsService::list] calls.
6393    ///
6394    /// # Example
6395    /// ```
6396    /// # use google_cloud_sql_v1::builder::sql_ssl_certs_service::List;
6397    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6398    ///
6399    /// let builder = prepare_request_builder();
6400    /// let response = builder.send().await?;
6401    /// # Ok(()) }
6402    ///
6403    /// fn prepare_request_builder() -> List {
6404    ///   # panic!();
6405    ///   // ... details omitted ...
6406    /// }
6407    /// ```
6408    #[derive(Clone, Debug)]
6409    pub struct List(RequestBuilder<crate::model::SqlSslCertsListRequest>);
6410
6411    impl List {
6412        pub(crate) fn new(
6413            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6414        ) -> Self {
6415            Self(RequestBuilder::new(stub))
6416        }
6417
6418        /// Sets the full request, replacing any prior values.
6419        pub fn with_request<V: Into<crate::model::SqlSslCertsListRequest>>(mut self, v: V) -> Self {
6420            self.0.request = v.into();
6421            self
6422        }
6423
6424        /// Sets all the options, replacing any prior values.
6425        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6426            self.0.options = v.into();
6427            self
6428        }
6429
6430        /// Sends the request.
6431        pub async fn send(self) -> Result<crate::model::SslCertsListResponse> {
6432            (*self.0.stub)
6433                .list(self.0.request, self.0.options)
6434                .await
6435                .map(crate::Response::into_body)
6436        }
6437
6438        /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
6439        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6440            self.0.request.instance = v.into();
6441            self
6442        }
6443
6444        /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
6445        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6446            self.0.request.project = v.into();
6447            self
6448        }
6449    }
6450
6451    #[doc(hidden)]
6452    impl crate::RequestBuilder for List {
6453        fn request_options(&mut self) -> &mut crate::RequestOptions {
6454            &mut self.0.options
6455        }
6456    }
6457}
6458
6459/// Request and client builders for [SqlTiersService][crate::client::SqlTiersService].
6460pub mod sql_tiers_service {
6461    use crate::Result;
6462
6463    /// A builder for [SqlTiersService][crate::client::SqlTiersService].
6464    ///
6465    /// ```
6466    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6467    /// # use google_cloud_sql_v1::*;
6468    /// # use builder::sql_tiers_service::ClientBuilder;
6469    /// # use client::SqlTiersService;
6470    /// let builder : ClientBuilder = SqlTiersService::builder();
6471    /// let client = builder
6472    ///     .with_endpoint("https://sqladmin.googleapis.com")
6473    ///     .build().await?;
6474    /// # Ok(()) }
6475    /// ```
6476    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6477
6478    pub(crate) mod client {
6479        use super::super::super::client::SqlTiersService;
6480        pub struct Factory;
6481        impl crate::ClientFactory for Factory {
6482            type Client = SqlTiersService;
6483            type Credentials = gaxi::options::Credentials;
6484            async fn build(
6485                self,
6486                config: gaxi::options::ClientConfig,
6487            ) -> crate::ClientBuilderResult<Self::Client> {
6488                Self::Client::new(config).await
6489            }
6490        }
6491    }
6492
6493    /// Common implementation for [crate::client::SqlTiersService] request builders.
6494    #[derive(Clone, Debug)]
6495    pub(crate) struct RequestBuilder<R: std::default::Default> {
6496        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6497        request: R,
6498        options: crate::RequestOptions,
6499    }
6500
6501    impl<R> RequestBuilder<R>
6502    where
6503        R: std::default::Default,
6504    {
6505        pub(crate) fn new(
6506            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6507        ) -> Self {
6508            Self {
6509                stub,
6510                request: R::default(),
6511                options: crate::RequestOptions::default(),
6512            }
6513        }
6514    }
6515
6516    /// The request builder for [SqlTiersService::list][crate::client::SqlTiersService::list] calls.
6517    ///
6518    /// # Example
6519    /// ```
6520    /// # use google_cloud_sql_v1::builder::sql_tiers_service::List;
6521    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6522    ///
6523    /// let builder = prepare_request_builder();
6524    /// let response = builder.send().await?;
6525    /// # Ok(()) }
6526    ///
6527    /// fn prepare_request_builder() -> List {
6528    ///   # panic!();
6529    ///   // ... details omitted ...
6530    /// }
6531    /// ```
6532    #[derive(Clone, Debug)]
6533    pub struct List(RequestBuilder<crate::model::SqlTiersListRequest>);
6534
6535    impl List {
6536        pub(crate) fn new(
6537            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6538        ) -> Self {
6539            Self(RequestBuilder::new(stub))
6540        }
6541
6542        /// Sets the full request, replacing any prior values.
6543        pub fn with_request<V: Into<crate::model::SqlTiersListRequest>>(mut self, v: V) -> Self {
6544            self.0.request = v.into();
6545            self
6546        }
6547
6548        /// Sets all the options, replacing any prior values.
6549        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6550            self.0.options = v.into();
6551            self
6552        }
6553
6554        /// Sends the request.
6555        pub async fn send(self) -> Result<crate::model::TiersListResponse> {
6556            (*self.0.stub)
6557                .list(self.0.request, self.0.options)
6558                .await
6559                .map(crate::Response::into_body)
6560        }
6561
6562        /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
6563        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6564            self.0.request.project = v.into();
6565            self
6566        }
6567    }
6568
6569    #[doc(hidden)]
6570    impl crate::RequestBuilder for List {
6571        fn request_options(&mut self) -> &mut crate::RequestOptions {
6572            &mut self.0.options
6573        }
6574    }
6575}
6576
6577/// Request and client builders for [SqlUsersService][crate::client::SqlUsersService].
6578pub mod sql_users_service {
6579    use crate::Result;
6580
6581    /// A builder for [SqlUsersService][crate::client::SqlUsersService].
6582    ///
6583    /// ```
6584    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6585    /// # use google_cloud_sql_v1::*;
6586    /// # use builder::sql_users_service::ClientBuilder;
6587    /// # use client::SqlUsersService;
6588    /// let builder : ClientBuilder = SqlUsersService::builder();
6589    /// let client = builder
6590    ///     .with_endpoint("https://sqladmin.googleapis.com")
6591    ///     .build().await?;
6592    /// # Ok(()) }
6593    /// ```
6594    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6595
6596    pub(crate) mod client {
6597        use super::super::super::client::SqlUsersService;
6598        pub struct Factory;
6599        impl crate::ClientFactory for Factory {
6600            type Client = SqlUsersService;
6601            type Credentials = gaxi::options::Credentials;
6602            async fn build(
6603                self,
6604                config: gaxi::options::ClientConfig,
6605            ) -> crate::ClientBuilderResult<Self::Client> {
6606                Self::Client::new(config).await
6607            }
6608        }
6609    }
6610
6611    /// Common implementation for [crate::client::SqlUsersService] request builders.
6612    #[derive(Clone, Debug)]
6613    pub(crate) struct RequestBuilder<R: std::default::Default> {
6614        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6615        request: R,
6616        options: crate::RequestOptions,
6617    }
6618
6619    impl<R> RequestBuilder<R>
6620    where
6621        R: std::default::Default,
6622    {
6623        pub(crate) fn new(
6624            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6625        ) -> Self {
6626            Self {
6627                stub,
6628                request: R::default(),
6629                options: crate::RequestOptions::default(),
6630            }
6631        }
6632    }
6633
6634    /// The request builder for [SqlUsersService::delete][crate::client::SqlUsersService::delete] calls.
6635    ///
6636    /// # Example
6637    /// ```
6638    /// # use google_cloud_sql_v1::builder::sql_users_service::Delete;
6639    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6640    ///
6641    /// let builder = prepare_request_builder();
6642    /// let response = builder.send().await?;
6643    /// # Ok(()) }
6644    ///
6645    /// fn prepare_request_builder() -> Delete {
6646    ///   # panic!();
6647    ///   // ... details omitted ...
6648    /// }
6649    /// ```
6650    #[derive(Clone, Debug)]
6651    pub struct Delete(RequestBuilder<crate::model::SqlUsersDeleteRequest>);
6652
6653    impl Delete {
6654        pub(crate) fn new(
6655            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6656        ) -> Self {
6657            Self(RequestBuilder::new(stub))
6658        }
6659
6660        /// Sets the full request, replacing any prior values.
6661        pub fn with_request<V: Into<crate::model::SqlUsersDeleteRequest>>(mut self, v: V) -> Self {
6662            self.0.request = v.into();
6663            self
6664        }
6665
6666        /// Sets all the options, replacing any prior values.
6667        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6668            self.0.options = v.into();
6669            self
6670        }
6671
6672        /// Sends the request.
6673        pub async fn send(self) -> Result<crate::model::Operation> {
6674            (*self.0.stub)
6675                .delete(self.0.request, self.0.options)
6676                .await
6677                .map(crate::Response::into_body)
6678        }
6679
6680        /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
6681        pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6682            self.0.request.host = v.into();
6683            self
6684        }
6685
6686        /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
6687        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6688            self.0.request.instance = v.into();
6689            self
6690        }
6691
6692        /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
6693        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6694            self.0.request.name = v.into();
6695            self
6696        }
6697
6698        /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
6699        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6700            self.0.request.project = v.into();
6701            self
6702        }
6703    }
6704
6705    #[doc(hidden)]
6706    impl crate::RequestBuilder for Delete {
6707        fn request_options(&mut self) -> &mut crate::RequestOptions {
6708            &mut self.0.options
6709        }
6710    }
6711
6712    /// The request builder for [SqlUsersService::get][crate::client::SqlUsersService::get] calls.
6713    ///
6714    /// # Example
6715    /// ```
6716    /// # use google_cloud_sql_v1::builder::sql_users_service::Get;
6717    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6718    ///
6719    /// let builder = prepare_request_builder();
6720    /// let response = builder.send().await?;
6721    /// # Ok(()) }
6722    ///
6723    /// fn prepare_request_builder() -> Get {
6724    ///   # panic!();
6725    ///   // ... details omitted ...
6726    /// }
6727    /// ```
6728    #[derive(Clone, Debug)]
6729    pub struct Get(RequestBuilder<crate::model::SqlUsersGetRequest>);
6730
6731    impl Get {
6732        pub(crate) fn new(
6733            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6734        ) -> Self {
6735            Self(RequestBuilder::new(stub))
6736        }
6737
6738        /// Sets the full request, replacing any prior values.
6739        pub fn with_request<V: Into<crate::model::SqlUsersGetRequest>>(mut self, v: V) -> Self {
6740            self.0.request = v.into();
6741            self
6742        }
6743
6744        /// Sets all the options, replacing any prior values.
6745        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6746            self.0.options = v.into();
6747            self
6748        }
6749
6750        /// Sends the request.
6751        pub async fn send(self) -> Result<crate::model::User> {
6752            (*self.0.stub)
6753                .get(self.0.request, self.0.options)
6754                .await
6755                .map(crate::Response::into_body)
6756        }
6757
6758        /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
6759        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6760            self.0.request.instance = v.into();
6761            self
6762        }
6763
6764        /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
6765        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6766            self.0.request.name = v.into();
6767            self
6768        }
6769
6770        /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
6771        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6772            self.0.request.project = v.into();
6773            self
6774        }
6775
6776        /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
6777        pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6778            self.0.request.host = v.into();
6779            self
6780        }
6781    }
6782
6783    #[doc(hidden)]
6784    impl crate::RequestBuilder for Get {
6785        fn request_options(&mut self) -> &mut crate::RequestOptions {
6786            &mut self.0.options
6787        }
6788    }
6789
6790    /// The request builder for [SqlUsersService::insert][crate::client::SqlUsersService::insert] calls.
6791    ///
6792    /// # Example
6793    /// ```
6794    /// # use google_cloud_sql_v1::builder::sql_users_service::Insert;
6795    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6796    ///
6797    /// let builder = prepare_request_builder();
6798    /// let response = builder.send().await?;
6799    /// # Ok(()) }
6800    ///
6801    /// fn prepare_request_builder() -> Insert {
6802    ///   # panic!();
6803    ///   // ... details omitted ...
6804    /// }
6805    /// ```
6806    #[derive(Clone, Debug)]
6807    pub struct Insert(RequestBuilder<crate::model::SqlUsersInsertRequest>);
6808
6809    impl Insert {
6810        pub(crate) fn new(
6811            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6812        ) -> Self {
6813            Self(RequestBuilder::new(stub))
6814        }
6815
6816        /// Sets the full request, replacing any prior values.
6817        pub fn with_request<V: Into<crate::model::SqlUsersInsertRequest>>(mut self, v: V) -> Self {
6818            self.0.request = v.into();
6819            self
6820        }
6821
6822        /// Sets all the options, replacing any prior values.
6823        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6824            self.0.options = v.into();
6825            self
6826        }
6827
6828        /// Sends the request.
6829        pub async fn send(self) -> Result<crate::model::Operation> {
6830            (*self.0.stub)
6831                .insert(self.0.request, self.0.options)
6832                .await
6833                .map(crate::Response::into_body)
6834        }
6835
6836        /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
6837        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6838            self.0.request.instance = v.into();
6839            self
6840        }
6841
6842        /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
6843        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6844            self.0.request.project = v.into();
6845            self
6846        }
6847
6848        /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
6849        pub fn set_body<T>(mut self, v: T) -> Self
6850        where
6851            T: std::convert::Into<crate::model::User>,
6852        {
6853            self.0.request.body = std::option::Option::Some(v.into());
6854            self
6855        }
6856
6857        /// Sets or clears the value of [body][crate::model::SqlUsersInsertRequest::body].
6858        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6859        where
6860            T: std::convert::Into<crate::model::User>,
6861        {
6862            self.0.request.body = v.map(|x| x.into());
6863            self
6864        }
6865    }
6866
6867    #[doc(hidden)]
6868    impl crate::RequestBuilder for Insert {
6869        fn request_options(&mut self) -> &mut crate::RequestOptions {
6870            &mut self.0.options
6871        }
6872    }
6873
6874    /// The request builder for [SqlUsersService::list][crate::client::SqlUsersService::list] calls.
6875    ///
6876    /// # Example
6877    /// ```
6878    /// # use google_cloud_sql_v1::builder::sql_users_service::List;
6879    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6880    ///
6881    /// let builder = prepare_request_builder();
6882    /// let response = builder.send().await?;
6883    /// # Ok(()) }
6884    ///
6885    /// fn prepare_request_builder() -> List {
6886    ///   # panic!();
6887    ///   // ... details omitted ...
6888    /// }
6889    /// ```
6890    #[derive(Clone, Debug)]
6891    pub struct List(RequestBuilder<crate::model::SqlUsersListRequest>);
6892
6893    impl List {
6894        pub(crate) fn new(
6895            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6896        ) -> Self {
6897            Self(RequestBuilder::new(stub))
6898        }
6899
6900        /// Sets the full request, replacing any prior values.
6901        pub fn with_request<V: Into<crate::model::SqlUsersListRequest>>(mut self, v: V) -> Self {
6902            self.0.request = v.into();
6903            self
6904        }
6905
6906        /// Sets all the options, replacing any prior values.
6907        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6908            self.0.options = v.into();
6909            self
6910        }
6911
6912        /// Sends the request.
6913        pub async fn send(self) -> Result<crate::model::UsersListResponse> {
6914            (*self.0.stub)
6915                .list(self.0.request, self.0.options)
6916                .await
6917                .map(crate::Response::into_body)
6918        }
6919
6920        /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
6921        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6922            self.0.request.instance = v.into();
6923            self
6924        }
6925
6926        /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
6927        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6928            self.0.request.project = v.into();
6929            self
6930        }
6931    }
6932
6933    #[doc(hidden)]
6934    impl crate::RequestBuilder for List {
6935        fn request_options(&mut self) -> &mut crate::RequestOptions {
6936            &mut self.0.options
6937        }
6938    }
6939
6940    /// The request builder for [SqlUsersService::update][crate::client::SqlUsersService::update] calls.
6941    ///
6942    /// # Example
6943    /// ```
6944    /// # use google_cloud_sql_v1::builder::sql_users_service::Update;
6945    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6946    ///
6947    /// let builder = prepare_request_builder();
6948    /// let response = builder.send().await?;
6949    /// # Ok(()) }
6950    ///
6951    /// fn prepare_request_builder() -> Update {
6952    ///   # panic!();
6953    ///   // ... details omitted ...
6954    /// }
6955    /// ```
6956    #[derive(Clone, Debug)]
6957    pub struct Update(RequestBuilder<crate::model::SqlUsersUpdateRequest>);
6958
6959    impl Update {
6960        pub(crate) fn new(
6961            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6962        ) -> Self {
6963            Self(RequestBuilder::new(stub))
6964        }
6965
6966        /// Sets the full request, replacing any prior values.
6967        pub fn with_request<V: Into<crate::model::SqlUsersUpdateRequest>>(mut self, v: V) -> Self {
6968            self.0.request = v.into();
6969            self
6970        }
6971
6972        /// Sets all the options, replacing any prior values.
6973        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6974            self.0.options = v.into();
6975            self
6976        }
6977
6978        /// Sends the request.
6979        pub async fn send(self) -> Result<crate::model::Operation> {
6980            (*self.0.stub)
6981                .update(self.0.request, self.0.options)
6982                .await
6983                .map(crate::Response::into_body)
6984        }
6985
6986        /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
6987        pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6988            self.0.request.host = v.into();
6989            self
6990        }
6991
6992        /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
6993        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6994            self.0.request.instance = v.into();
6995            self
6996        }
6997
6998        /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
6999        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7000            self.0.request.name = v.into();
7001            self
7002        }
7003
7004        /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
7005        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7006            self.0.request.project = v.into();
7007            self
7008        }
7009
7010        /// Sets the value of [database_roles][crate::model::SqlUsersUpdateRequest::database_roles].
7011        pub fn set_database_roles<T, V>(mut self, v: T) -> Self
7012        where
7013            T: std::iter::IntoIterator<Item = V>,
7014            V: std::convert::Into<std::string::String>,
7015        {
7016            use std::iter::Iterator;
7017            self.0.request.database_roles = v.into_iter().map(|i| i.into()).collect();
7018            self
7019        }
7020
7021        /// Sets the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
7022        pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
7023        where
7024            T: std::convert::Into<bool>,
7025        {
7026            self.0.request.revoke_existing_roles = std::option::Option::Some(v.into());
7027            self
7028        }
7029
7030        /// Sets or clears the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
7031        pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
7032        where
7033            T: std::convert::Into<bool>,
7034        {
7035            self.0.request.revoke_existing_roles = v.map(|x| x.into());
7036            self
7037        }
7038
7039        /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
7040        pub fn set_body<T>(mut self, v: T) -> Self
7041        where
7042            T: std::convert::Into<crate::model::User>,
7043        {
7044            self.0.request.body = std::option::Option::Some(v.into());
7045            self
7046        }
7047
7048        /// Sets or clears the value of [body][crate::model::SqlUsersUpdateRequest::body].
7049        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7050        where
7051            T: std::convert::Into<crate::model::User>,
7052        {
7053            self.0.request.body = v.map(|x| x.into());
7054            self
7055        }
7056    }
7057
7058    #[doc(hidden)]
7059    impl crate::RequestBuilder for Update {
7060        fn request_options(&mut self) -> &mut crate::RequestOptions {
7061            &mut self.0.options
7062        }
7063    }
7064}